(function(n,t,i,r){function y(t,i){return t in n?n[t]:typeof n[i]=="function"?n[i]:function(n){if(n instanceof Array)return n;if(typeof n=="number"){var t=[];return t.length=n,t}}}function g(n){var t,u;if(typeof n=="string"){for(t=0,u=0;u<n.length;++u)t=t*31+n.charCodeAt(u)&4294967295;return t}return typeof n!="object"?n&4294967295:n.hashCode instanceof Function?n.hashCode():(n.$id===r&&(n.$id=i.floor(i.random()*65536)-32768<<16|i.floor(i.random()*65536)),n.$id)}function l(n,t){return n===null||t===null?n===null&&t===null:typeof n=="string"?n===t:typeof n!="object"?n===t:n.equals instanceof Function?n.equals(t):n===t}function rt(){}function ct(n,t,i){var u,f,e,r;if(!n.hasOwnProperty(t)||typeof n[t]!="function"){n[t]=i;return}if(u=n[t],"$overloads"in u){u.$defaultOverload=i;return}("$overloads"in i||u.length!==i.length)&&("$overloads"in i?(f=i.$overloads.slice(0),f[u.length]=u,e=i.$defaultOverload):(f=[],f[i.length]=i,f[u.length]=u,e=u),r=function(){var n=r.$overloads[arguments.length]||("$methodArgsIndex"in r&&arguments.length>r.$methodArgsIndex?r.$overloads[r.$methodArgsIndex]:null)||r.$defaultOverload;return n.apply(this,arguments)},r.$overloads=f,"$methodArgsIndex"in i&&(r.$methodArgsIndex=i.$methodArgsIndex),r.$defaultOverload=e,r.name=t,n[t]=r)}function tt(n,t){function u(i){o.defineProperty(n,i,{get:function(){return t[i]},set:function(n){t[i]=n},enumerable:!0})}var r=[],i;for(i in t)typeof t[i]=="function"?ct(n,i,t[i]):i.charAt(0)==="$"||i in n||r.push(i);while(r.length>0)u(r.shift());n.$super=t}function lt(n){return typeof n!="string"?!1:["byte","int","char","color","float","long","double"].indexOf(n)!==-1}function yt(n){var o=250,l=n.size/o,f=t.createElement("canvas"),a,r,h,u,d,g,c;f.width=2*o,f.height=2*o,f.style.opacity=0,a=n.getCSSDefinition(o+"px","normal"),r=f.getContext("2d"),r.font=a,h="dbflkhyjqpg",f.width=r.measureText(h).width,r.font=a,u=t.createElement("div"),u.style.position="absolute",u.style.opacity=0,u.style.fontFamily='"'+n.name+'"',u.style.fontSize=o+"px",u.innerHTML=h+"<br/>"+h,t.body.appendChild(u);var v=f.width,y=f.height,p=y/2;r.fillStyle="white",r.fillRect(0,0,v,y),r.fillStyle="black",r.fillText(h,0,p);for(var w=r.getImageData(0,0,v,y).data,e=0,b=v*4,k=w.length;++e<k&&w[e]===255;)s();for(d=i.round(e/b),e=k-1;--e>0&&w[e]===255;)s();return g=i.round(e/b),n.ascent=l*(p-d),n.descent=l*(g-p),t.defaultView.getComputedStyle&&(c=t.defaultView.getComputedStyle(u,null).getPropertyValue("height"),c=l*c.replace("px",""),c>=n.size*2&&(n.leading=i.round(c/2))),t.body.removeChild(u),n.caching?r:void 0}function e(n,t){var i,u,f;if(n===r&&(n=""),this.name=n,t===r&&(t=0),this.size=t,this.glyph=!1,this.ascent=0,this.descent=0,this.leading=1.2*t,i=n.indexOf(" Italic Bold"),i!==-1&&(n=n.substring(0,i)),this.style="normal",u=n.indexOf(" Italic"),u!==-1&&(n=n.substring(0,u),this.style="italic"),this.weight="normal",f=n.indexOf(" Bold"),f!==-1&&(n=n.substring(0,f),this.weight="bold"),this.family="sans-serif",n!==r)switch(n){case"sans-serif":case"serif":case"monospace":case"fantasy":case"cursive":this.family=n;break;default:this.family='"'+n+'", sans-serif'}this.context2d=yt(this),this.css=this.getCSSDefinition(),this.context2d&&(this.context2d.font=this.css)}function pt(){for(var e=["abs","acos","alpha","ambient","ambientLight","append","applyMatrix","arc","arrayCopy","asin","atan","atan2","background","beginCamera","beginDraw","beginShape","bezier","bezierDetail","bezierPoint","bezierTangent","bezierVertex","binary","blend","blendColor","blit_resize","blue","box","breakShape","brightness","camera","ceil","Character","color","colorMode","concat","constrain","copy","cos","createFont","createGraphics","createImage","cursor","curve","curveDetail","curvePoint","curveTangent","curveTightness","curveVertex","day","degrees","directionalLight","disableContextMenu","dist","draw","ellipse","ellipseMode","emissive","enableContextMenu","endCamera","endDraw","endShape","exit","exp","expand","externals","fill","filter","floor","focused","frameCount","frameRate","frustum","get","glyphLook","glyphTable","green","height","hex","hint","hour","hue","image","imageMode","intersect","join","key","keyCode","keyPressed","keyReleased","keyTyped","lerp","lerpColor","lightFalloff","lights","lightSpecular","line","link","loadBytes","loadFont","loadGlyphs","loadImage","loadPixels","loadShape","loadXML","loadStrings","log","loop","mag","map","match","matchAll","max","millis","min","minute","mix","modelX","modelY","modelZ","modes","month","mouseButton","mouseClicked","mouseDragged","mouseMoved","mouseOut","mouseOver","mousePressed","mouseReleased","mouseScroll","mouseScrolled","mouseX","mouseY","name","nf","nfc","nfp","nfs","noCursor","noFill","noise","noiseDetail","noiseSeed","noLights","noLoop","norm","normal","noSmooth","noStroke","noTint","ortho","param","parseBoolean","parseByte","parseChar","parseFloat","parseInt","peg","perspective","PImage","pixels","PMatrix2D","PMatrix3D","PMatrixStack","pmouseX","pmouseY","point","pointLight","popMatrix","popStyle","pow","print","printCamera","println","printMatrix","printProjection","PShape","PShapeSVG","pushMatrix","pushStyle","quad","radians","random","Random","randomSeed","rect","rectMode","red","redraw","requestImage","resetMatrix","reverse","rotate","rotateX","rotateY","rotateZ","round","saturation","save","saveFrame","saveStrings","scale","screenX","screenY","screenZ","second","set","setup","shape","shapeMode","shared","shearX","shearY","shininess","shorten","sin","size","smooth","sort","specular","sphere","sphereDetail","splice","split","splitTokens","spotLight","sq","sqrt","status","str","stroke","strokeCap","strokeJoin","strokeWeight","subset","tan","text","textAlign","textAscent","textDescent","textFont","textLeading","textMode","textSize","texture","textureMode","textWidth","tint","toImageData","touchCancel","touchEnd","touchMove","touchStart","translate","transform","triangle","trim","unbinary","unhex","updatePixels","use3DContext","vertex","width","XMLElement","XML","year","__contains","__equals","__equalsIgnoreCase","__frameRate","__hashCode","__int_cast","__instanceof","__keyPressed","__mousePressed","__printStackTrace","__replace","__replaceAll","__replaceFirst","__toCharArray","__split","__codePointAt","__startsWith","__endsWith","__matches"],r={},i,f,n=0,t=e.length;n<t;++n)r[e[n]]=null;for(i in u.lib)if(u.lib.hasOwnProperty(i)&&u.lib[i].exports)for(f=u.lib[i].exports,n=0,t=f.length;n<t;++n)r[f[n]]=null;return r}function wt(n){function vr(n){for(var u=[],f=n.split(/([\{\[\(\)\]\}])/),i=f[0],e=[],t,o,s,r=1;r<f.length;r+=2)t=f[r],t==="["||t==="{"||t==="("?(e.push(i),i=t):(t==="]"||t==="}"||t===")")&&(o=t==="}"?"A":t===")"?"B":"C",s=u.length,u.push(i+t),i=e.pop()+'"'+o+(s+1)+'"'),i+=f[r+1];return u.unshift(i),u}function yr(n,t){return n.replace(/'(\d+)'/g,function(n,i){var r=t[i];return r.charAt(0)==="/"?r:/^'((?:[^'\\\n])|(?:\\.[0-9A-Fa-f]*))'$/.test(r)?"(new $p.Character("+r+"))":r})}function c(n){var t=/^\s*/.exec(n),i,r;return t[0].length===n.length?i={left:t[0],middle:"",right:""}:(r=/\s*$/.exec(n),i={left:t[0],middle:n.substring(t[0].length,r.index),right:r[0]}),i.untrim=function(n){return this.left+n+this.right},i}function e(n){return n.replace(/^\s+/,"").replace(/\s+$/,"")}function y(n,t){for(var i=0,r=t.length;i<r;++i)n[t[i]]=null;return n}function pr(n){for(var t in n)if(n.hasOwnProperty(t))return!1;return!0}function l(n){return n.substring(2,n.length-1)}function u(n,i){var r=t.length;return t.push(n),'"'+i+r+'"'}function lt(){return"class"+ ++br}function at(n,t,i){n.classId=t,n.scopeId=i,f[t]=n}function wt(n){var t=n;return t=t.replace(k,function(n){return u(n,"E")}),t=t.replace(d,function(n){return u(n,"D")}),t=t.replace(li,function(n){return u(n,"H")})}function ai(n,t){return n.replace(dr,function(n,i,r){return r!==t?n:u(n,"G")})}function bt(n){this.name=n}function ut(n,t){this.params=n,this.methodArgsParam=t}function g(n){var u=e(n.substring(1,n.length-1)),f=[],o=null,i,t,r;if(u!=="")for(i=u.split(","),t=0;t<i.length;++t){if(r=/\b([A-Za-z_$][\w$]*\b)(\s*"[ABC][\d]*")*\s*$/.exec(i[t]),t===i.length-1&&i[t].indexOf("...")>=0){o=new bt(r[1]);break}f.push(new bt(r[1]))}return new ut(f,o)}function gr(n){function f(n,i,f,e){var s=t[e],o;return r=!0,o=c(s.substring(1,s.length-1)),"__"+f+(o.middle===""?u("("+i.replace(/\.\s*$/,"")+")","B"):u("("+i.replace(/\.\s*$/,"")+","+o.middle+")","B"))}function e(n,t,i){return r=!0,"__instanceof"+u("("+t+", "+i+")","B")}var i=n,r;i=i.replace(/\bnew\s+([A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)(?:\s*"C\d+")+\s*("A\d+")/g,function(n,t,i){return i}),i=i.replace(/\bnew\s+([A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)(?:\s*"B\d+")\s*("A\d+")/g,function(n){return u(n,"F")}),i=i.replace(li,function(n){return u(n,"H")}),i=i.replace(/\bnew\s+([A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)\s*("C\d+"(?:\s*"C\d+")*)/g,function(n,i,r){var f=r.replace(/"C(\d+)"/g,function(n,i){return t[i]}).replace(/\[\s*\]/g,"[null]").replace(/\s*\]\s*\[\s*/g,", "),e="{"+f.substring(1,f.length-1)+"}",o="('"+i+"', "+u(e,"A")+")";return"$p.createJavaArray"+u(o,"B")}),i=i.replace(/(\.\s*length)\s*"B\d+"/g,"$1"),i=i.replace(/#([0-9A-Fa-f]{6})\b/g,function(n,t){return"0xFF"+t}),i=i.replace(/"B(\d+)"(\s*(?:[\w$']|"B))/g,function(n,i,r){var u=t[i],f;return/^\(\s*[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*\s*(?:"C\d+"\s*)*\)$/.test(u)?/^\(\s*int\s*\)$/.test(u)?"(int)"+r:(f=u.split(/"C(\d+)"/g),f.length>1&&!/^\[\s*\]$/.test(t[f[1]]))?n:""+r:n}),i=i.replace(/\(int\)([^,\]\)\}\?\:\*\+\-\/\^\|\%\&\~<\>\=]+)/g,function(n,t){var i=c(t);return i.untrim("__int_cast("+i.middle+")")}),i=i.replace(/\bsuper(\s*"B\d+")/g,"$$superCstr$1").replace(/\bsuper(\s*\.)/g,"$$super$1"),i=i.replace(/\b0+((\d*)(?:\.[\d*])?(?:[eE][\-\+]?\d+)?[fF]?)\b/,function(n,t,i){return t===i?n:i===""?"0"+t:t}),i=i.replace(/\b(\.?\d+\.?)[fF]\b/g,"$1"),i=i.replace(/([^\s])%([^=\s])/g,"$1 % $2"),i=i.replace(/\b(frameRate|keyPressed|mousePressed)\b(?!\s*"B)/g,"__$1"),i=i.replace(/\b(boolean|byte|char|float|int)\s*"B/g,function(n,t){return"parse"+t.substring(0,1).toUpperCase()+t.substring(1)+'"B'}),i=i.replace(/\bpixels\b\s*(("C(\d+)")|\.length)?(\s*=(?!=)([^,\]\)\}]+))?/g,function(n,i,r,f,e,o){if(r){var s=t[f];return e?"pixels.setPixel"+u("("+s.substring(1,s.length-1)+","+o+")","B"):"pixels.getPixel"+u("("+s.substring(1,s.length-1)+")","B")}return i?"pixels.getLength"+u("()","B"):e?"pixels.set"+u("("+o+")","B"):"pixels.toArray"+u("()","B")});do r=!1,i=i.replace(/((?:'\d+'|\b[A-Za-z_$][\w$]*\s*(?:"[BC]\d+")*)\s*\.\s*(?:[A-Za-z_$][\w$]*\s*(?:"[BC]\d+"\s*)*\.\s*)*)(replace|replaceAll|replaceFirst|contains|equals|equalsIgnoreCase|hashCode|toCharArray|printStackTrace|split|startsWith|endsWith|codePointAt|matches)\s*"B(\d+)"/g,f);while(r);do r=!1,i=i.replace(/((?:'\d+'|\b[A-Za-z_$][\w$]*\s*(?:"[BC]\d+")*)\s*(?:\.\s*[A-Za-z_$][\w$]*\s*(?:"[BC]\d+"\s*)*)*)instanceof\s+([A-Za-z_$][\w$]*\s*(?:\.\s*[A-Za-z_$][\w$]*)*)/g,e);while(r);return i=i.replace(/\bthis(\s*"B\d+")/g,"$$constr$1")}function vi(n,t){this.baseInterfaceName=n,this.body=t,t.owner=this}function nu(n){var i=new RegExp(/\bnew\s*([A-Za-z_$][\w$]*\s*(?:\.\s*[A-Za-z_$][\w$]*)*)\s*"B\d+"\s*"A(\d+)"/).exec(n),e=h,r=lt(),u,f;return h=r,u=i[1]+"$"+r,f=new vi(u,rt(t[i[2]],u,"","implements "+i[1])),at(f,r,e),h=e,f}function kt(n,t,i){this.name=n,this.params=t,this.body=i}function dt(n){var i=new RegExp(/\b([A-Za-z_$][\w$]*)\s*"B(\d+)"\s*"A(\d+)"/).exec(n);return new kt(i[1]!=="function"?i[1]:null,g(t[i[2]]),a(t[i[3]]))}function yi(n){this.members=n}function tu(n){for(var i=n.split(","),r,t=0;t<i.length;++t)r=i[t].indexOf(":"),i[t]=r<0?{value:s(i[t])}:{label:e(i[t].substring(0,r)),value:s(e(i[t].substring(r+1)))};return new yi(i)}function ft(n){if(n.charAt(0)==="("||n.charAt(0)==="[")return n.charAt(0)+ft(n.substring(1,n.length-1))+n.charAt(n.length-1);if(n.charAt(0)==="{")return/^\{\s*(?:[A-Za-z_$][\w$]*|'\d+')\s*:/.test(n)?"{"+u(n.substring(1,n.length-1),"I")+"}":"["+ft(n.substring(1,n.length-1))+"]";var r=c(n),i=gr(r.middle);return i=i.replace(/"[ABC](\d+)"/g,function(n,i){return ft(t[i])}),r.untrim(i)}function iu(n){return n.replace(/(\.\s*)?((?:\b[A-Za-z_]|\$)[\w$]*)(\s*\.\s*([A-Za-z_$][\w$]*)(\s*\()?)?/g,function(n,t,u,f,e,o){if(t)return n;var s={name:u,member:e,callSign:!!o};return i(s)+(f===r?"":f)})}function pi(n,t){this.expr=n,this.transforms=t}function wi(n,t,i){this.name=n,this.value=t,this.isDefault=i}function bi(n,t){var i=n.indexOf("="),r,u,f;return i<0?(r=n,u=t,f=!0):(r=n.substring(0,i),u=s(n.substring(i+1)),f=!1),new wi(e(r.replace(/(\s*"C\d+")+/g,"")),u,f)}function ki(n){return n==="int"||n==="float"?"0":n==="boolean"?"false":n==="color"?"0x00000000":"null"}function nt(n,t){this.definitions=n,this.varType=t}function di(n){this.expression=n}function tt(n){var t;if(kr.test(n)){var r=ci.exec(n),i=n.substring(r[0].length).split(","),u=ki(r[2]);for(t=0;t<i.length;++t)i[t]=bi(i[t],u);return new nt(i,r[2])}return new di(s(n))}function gi(n,t,i){this.initStatement=n,this.condition=t,this.step=i}function nr(n,t){this.initStatement=n,this.container=t}function et(n,t){this.initStatement=n,this.container=t}function ru(n){var t;return/\bin\b/.test(n)?(t=n.substring(1,n.length-1).split(/\bin\b/g),new nr(tt(e(t[0])),s(t[1]))):n.indexOf(":")>=0&&n.indexOf(";")<0?(t=n.substring(1,n.length-1).split(":"),new et(tt(e(t[0])),s(t[1]))):(t=n.substring(1,n.length-1).split(";"),new gi(tt(e(t[0])),s(t[1]),s(t[2])))}function gt(n){n.sort(function(n,t){return t.weight-n.weight})}function ni(n,t,i){this.name=n,this.body=t,this.isStatic=i,t.owner=this}function ti(n,t,i){this.name=n,this.body=t,this.isStatic=i,t.owner=this}function tr(n){var i=k.exec(n);k.lastIndex=0;var u=i[1].indexOf("static")>=0,f=t[l(i[6])],r,e=h,o=lt();return h=o,r=i[2]==="interface"?new ni(i[3],vt(f,i[3],i[4]),u):new ti(i[3],rt(f,i[3],i[4],i[5]),u),at(r,o,e),h=e,r}function ir(n,t,i,r){this.name=n,this.params=t,this.body=i,this.isStatic=r}function rr(n){var i=d.exec(n),r,u;return d.lastIndex=0,r=i[1].indexOf("static")>=0,u=i[6]!==";"?t[l(i[6])]:"{}",new ir(i[3],g(t[l(i[4])]),a(u),r)}function ii(n,t,i){this.definitions=n,this.fieldType=t,this.isStatic=i}function ur(n){for(var i=ci.exec(n),u=i[1].indexOf("static")>=0,r=n.substring(i[0].length).split(/,\s*/g),f=ki(i[2]),t=0;t<r.length;++t)r[t]=bi(r[t],f);return new ii(r,i[2],u)}function fr(n,t){this.params=n,this.body=t}function uu(n){var i=new RegExp(/"B(\d+)"\s*"A(\d+)"/).exec(n),r=g(t[i[1]]);return new fr(r,a(t[i[2]]))}function ri(n,t,i,r,u,f){var e,o;for(this.name=n,this.interfacesNames=t,this.methodsNames=i,this.fields=r,this.innerClasses=u,this.misc=f,e=0,o=r.length;e<o;++e)r[e].owner=this}function ui(n,t,i,r,u,f,e,o,s){var h,c;for(this.name=n,this.baseClassName=t,this.interfacesNames=i,this.functions=r,this.methods=u,this.fields=f,this.cstrs=e,this.innerClasses=o,this.misc=s,h=0,c=f.length;h<c;++h)f[h].owner=this}function ot(n,t){this.name=n,this.body=t,t.owner=this}function st(n,t){this.name=n,this.body=t,t.owner=this}function fu(n){var i=k.exec(n),r;k.lastIndex=0;var u=t[l(i[6])],f=h,e=lt();return h=e,r=i[2]==="interface"?new ot(i[3],vt(u,i[3],i[4])):new st(i[3],rt(u,i[3],i[4],i[5])),at(r,e,f),h=f,r}function fi(n,t,i){this.name=n,this.params=t,this.body=i}function eu(n){var i=d.exec(n),r=d.lastIndex=0;return new fi(i[3],g(t[l(i[4])]),a(t[l(i[6])]))}function ou(n){var t=n;return t=t.replace(/\b(catch\s*"B\d+"\s*"A\d+")(\s*catch\s*"B\d+"\s*"A\d+")+/g,"$1")}function ei(n,t){this.argument=n,this.misc=t}function er(n,t){this.argument=n,this.misc=t}function oi(n,t,i){this.name=n,this.argument=t,this.misc=i}function or(n){this.expr=n}function sr(n){this.label=n}function hr(n){for(var i=[],t,r=0,u=n.length;r<u;++r)t=n[r],t instanceof nt?i=i.concat(t.getNames()):t instanceof ei&&t.argument.initStatement instanceof nt?i=i.concat(t.argument.initStatement.getNames()):(t instanceof ni||t instanceof ti||t instanceof ot||t instanceof st||t instanceof fi||t instanceof kt)&&i.push(t.name);return y({},i)}function cr(n){this.statements=n}function lr(n){this.statements=n}function su(){function p(n,t){for(var u=t.split("."),f=n.scope,i,e,o;f;){if(f.hasOwnProperty(u[0])){i=f[u[0]];break}f=f.scope}for(i===r&&(i=y[u[0]]),e=1,o=u.length;e<o&&i;++e)i=i.inScope[u[e]];return i}var y={},i,t,l,a,o,v,u,s,h,c,w,e;for(i in f)f.hasOwnProperty(i)&&(t=f[i],l=t.scopeId,a=t.name,l?(o=f[l],t.scope=o,o.inScope===r&&(o.inScope={}),o.inScope[a]=t):y[a]=t);for(i in f)if(f.hasOwnProperty(i)&&(t=f[i],v=t.body.baseClassName,v&&(u=p(t,v),u&&(t.base=u,u.derived||(u.derived=[]),u.derived.push(t))),s=t.body.interfacesNames,h=[],s&&s.length>0)){for(c=0,w=s.length;c<w;++c)(e=p(t,s[c]),h.push(e),e)&&(e.derived||(e.derived=[]),e.derived.push(t));h.length>0&&(t.interfaces=h)}}function hu(){function h(n,t){var i=o[n],r;return i?(r=i.indexOf(t),r<0)?!1:(i.splice(r,1),i.length>0)?!1:(delete o[n],!0):!1}var u=[],o={},i,s,t,e,r,c;for(i in f)if(f.hasOwnProperty(i))if(t=f[i],t.inScope||t.derived){if(e=[],t.inScope)for(s in t.inScope)t.inScope.hasOwnProperty(s)&&e.push(t.inScope[s]);t.derived&&(e=e.concat(t.derived)),o[i]=e}else u.push(i),t.weight=0;while(u.length>0)if(i=u.shift(),t=f[i],t.scopeId&&h(t.scopeId,t)&&(u.push(t.scopeId),f[t.scopeId].weight=t.weight+1),t.base&&h(t.base.classId,t)&&(u.push(t.base.classId),t.base.weight=t.weight+1),t.interfaces)for(r=0,c=t.interfaces.length;r<c;++r)t.interfaces[r]&&h(t.interfaces[r].classId,t)&&(u.push(t.interfaces[r].classId),t.interfaces[r].weight=t.weight+1)}var ar=pt(),wr=n.replace(/\r\n?|\n\r/g,"\n"),w=[],b=wr.replace(/("(?:[^"\\\n]|\\.)*")|('(?:[^'\\\n]|\\.)*')|(([\[\(=|&!\^:?]\s*)(\/(?![*\/])(?:[^\/\\\n]|\\.)*\/[gim]*)\b)|(\/\/[^\n]*\n)|(\/\*(?:(?!\*\/)(?:.|\n))*\*\/)/g,function(n,t,i,r,u,f,e,o){var s;return t||i?(s=w.length,w.push(n),"'"+s+"'"):r?(s=w.length,w.push(f),u+"'"+s+"'"):o!==""?" ":"\n"}),ct,it,si,ht,v;b=b.replace(/__x([0-9A-F]{4})/g,function(n,t){return"__x005F_x"+t}),b=b.replace(/\$/g,"__x0024"),it=b,si=function(n,t,i,r){return!!t||!!r?n:(ct=!0,"")};do ct=!1,it=it.replace(/([<]?)<\s*((?:\?|[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)(?:\[\])*(?:\s+(?:extends|super)\s+[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)?(?:\s*,\s*(?:\?|[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)(?:\[\])*(?:\s+(?:extends|super)\s+[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)?)*)\s*>([=]?)/g,si);while(ct);var t=vr(it),i,f={},h,br=0;var rt,vt,a,yt,hi,s,k=/\b((?:(?:public|private|final|protected|static|abstract)\s+)*)(class|interface)\s+([A-Za-z_$][\w$]*\b)(\s+extends\s+[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*,\s*[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*\b)*)?(\s+implements\s+[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*,\s*[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*\b)*)?\s*("A\d+")/g,d=/\b((?:(?:public|private|final|protected|static|abstract|synchronized)\s+)*)((?!(?:else|new|return|throw|function|public|private|protected)\b)[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*"C\d+")*)\s*([A-Za-z_$][\w$]*\b)\s*("B\d+")(\s*throws\s+[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*,\s*[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)*)?\s*("A\d+"|;)/g,kr=/^((?:(?:public|private|final|protected|static)\s+)*)((?!(?:else|new|return|throw)\b)[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*"C\d+")*)\s*([A-Za-z_$][\w$]*\b)\s*(?:"C\d+"\s*)*([=,]|$)/,dr=/\b((?:(?:public|private|final|protected|static|abstract)\s+)*)((?!(?:new|return|throw)\b)[A-Za-z_$][\w$]*\b)\s*("B\d+")(\s*throws\s+[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*,\s*[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)*)?\s*("A\d+")/g,ci=/^((?:(?:public|private|final|protected|static)\s+)*)((?!(?:new|return|throw)\b)[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*"C\d+")*)\s*/,li=/\bfunction(?:\s+([A-Za-z_$][\w$]*))?\s*("B\d+")\s*("A\d+")/g;return bt.prototype.toString=function(){return this.name},ut.prototype.getNames=function(){for(var t=[],n=0,i=this.params.length;n<i;++n)t.push(this.params[n].name);return t},ut.prototype.prependMethodArgs=function(n){return this.methodArgsParam?"{\nvar "+this.methodArgsParam.name+" = Array.prototype.slice.call(arguments, "+this.params.length+");\n"+n.substring(1):n},ut.prototype.toString=function(){var n,t,i;if(this.params.length===0)return"()";for(n="(",t=0,i=this.params.length;t<i;++t)n+=this.params[t]+", ";return n.substring(0,n.length-2)+")"},vi.prototype.toString=function(){return"new ("+this.body+")"},kt.prototype.toString=function(){var t=i,u=y({"this":null},this.params.getNames()),n,r;return i=function(n){return u.hasOwnProperty(n.name)?n.name:t(n)},n="function",this.name&&(n+=" "+this.name),r=this.params.prependMethodArgs(this.body.toString()),n+=this.params+" "+r,i=t,n},yi.prototype.toString=function(){var r=i,t,n,u;for(i=function(n){return n.name==="this"?"this":r(n)},t="",n=0,u=this.members.length;n<u;++n)this.members[n].label&&(t+=this.members[n].label+": "),t+=this.members[n].value.toString()+", ";return i=r,t.substring(0,t.length-2)},pi.prototype.toString=function(){var n=this.transforms,t=iu(this.expr);return t.replace(/"!(\d+)"/g,function(t,i){return n[i].toString()})},s=function(n){var i=[],r=ft(n);return r=r.replace(/"H(\d+)"/g,function(n,r){return i.push(dt(t[r])),'"!'+(i.length-1)+'"'}),r=r.replace(/"F(\d+)"/g,function(n,r){return i.push(nu(t[r])),'"!'+(i.length-1)+'"'}),r=r.replace(/"I(\d+)"/g,function(n,r){return i.push(tu(t[r])),'"!'+(i.length-1)+'"'}),new pi(r,i)},wi.prototype.toString=function(){return this.name+" = "+this.value},nt.prototype.getNames=function(){for(var t=[],n=0,i=this.definitions.length;n<i;++n)t.push(this.definitions[n].name);return t},nt.prototype.toString=function(){return"var "+this.definitions.join(",")},di.prototype.toString=function(){return this.expression.toString()},gi.prototype.toString=function(){return"("+this.initStatement+"; "+this.condition+"; "+this.step+")"},nr.prototype.toString=function(){var n=this.initStatement.toString();return n.indexOf("=")>=0&&(n=n.substring(0,n.indexOf("="))),"("+n+" in "+this.container+")"},et.iteratorId=0,et.prototype.toString=function(){var i=this.initStatement.toString(),n="$it"+et.iteratorId++,t=i.replace(/^\s*var\s*/,"").split("=")[0],r="var "+n+" = new $p.ObjectIterator("+this.container+"), "+t+" = void(0)",u=n+".hasNext() && (("+t+" = "+n+".next()) || true)";return"("+r+"; "+u+";)"},ni.prototype.toString=function(){return""+this.body},ti.prototype.toString=function(){return""+this.body},ir.prototype.toString=function(){var u=y({},this.params.getNames()),n=i,t,r;return i=function(t){return u.hasOwnProperty(t.name)?t.name:n(t)},t=this.params.prependMethodArgs(this.body.toString()),r="function "+this.methodId+this.params+" "+t+"\n",i=n,r},ii.prototype.getNames=function(){for(var t=[],n=0,i=this.definitions.length;n<i;++n)t.push(this.definitions[n].name);return t},ii.prototype.toString=function(){var r=i({name:"[this]"}),f,u,n,e;if(this.isStatic){for(f=this.owner.name,u=[],n=0,e=this.definitions.length;n<e;++n){var o=this.definitions[n],s=o.name,t=f+"."+s,h="if("+t+" === void(0)) {\n "+t+" = "+o.value+"; }\n$p.defineProperty("+r+", '"+s+"', { get: function(){return "+t+";}, set: function(val){"+t+" = val;} });\n";u.push(h)}return u.join("")}return r+"."+this.definitions.join("; "+r+".")},fr.prototype.toString=function(){var u=y({},this.params.getNames()),t=i,r,n;return i=function(n){return u.hasOwnProperty(n.name)?n.name:t(n)},r="function $constr_"+this.params.params.length+this.params.toString(),n=this.params.prependMethodArgs(this.body.toString()),/\$(superCstr|constr)\b/.test(n)||(n="{\n$superCstr();\n"+n.substring(1)),i=t,r+n+"\n"},ri.prototype.getMembers=function(n,t,i){var r,f,u,s,e,h,o;for(this.owner.base&&this.owner.base.body.getMembers(n,t,i),r=0,u=this.fields.length;r<u;++r)for(e=this.fields[r].getNames(),f=0,s=e.length;f<s;++f)n[e[f]]=this.fields[r];for(r=0,u=this.methodsNames.length;r<u;++r)h=this.methodsNames[r],t[h]=!0;for(r=0,u=this.innerClasses.length;r<u;++r)o=this.innerClasses[r],i[o.name]=o},ri.prototype.toString=function(){function c(n){for(var t=0;n;)++t,n=n.scope;return t}var y=c(this.owner),t=this.name,u="",f="",l={},a={},v={},n,r,p,w,o,s,e,h;if(this.getMembers(l,a,v),this.owner.interfaces){for(o=[],n=0,r=this.interfacesNames.length;n<r;++n)this.owner.interfaces[n]&&(s=i({name:this.interfacesNames[n]}),o.push(s),u+="$p.extendInterfaceMembers("+t+", "+s+");\n");f+=t+".$interfaces = ["+o.join(", ")+"];\n"}for(f+=t+".$isInterface = true;\n",f+=t+".$methods = ['"+this.methodsNames.join("', '")+"'];\n",gt(this.innerClasses),n=0,r=this.innerClasses.length;n<r;++n)e=this.innerClasses[n],e.isStatic&&(u+=t+"."+e.name+" = "+e+";\n");for(n=0,r=this.fields.length;n<r;++n)h=this.fields[n],h.isStatic&&(u+=t+"."+h.definitions.join(";\n"+t+".")+";\n");return"(function() {\nfunction "+t+"() { throw 'Unable to create the interface'; }\n"+u+f+"return "+t+";\n})()"},vt=function(n,i,u){var e=n.substring(1,n.length-1),o,s,h,a,f,l,v,y,p;for(e=wt(e),e=ai(e,i),o=[],s=[],e=e.replace(/"([DE])(\d+)"/g,function(n,t,i){return t==="D"?o.push(i):t==="E"&&s.push(i),""}),h=e.split(/;(?:\s*;)*/g),u!==r&&(a=u.replace(/^\s*extends\s+(.+?)\s*$/g,"$1").split(/\s*,\s*/g)),f=0,l=o.length;f<l;++f)v=rr(t[o[f]]),o[f]=v.name;for(f=0,l=h.length-1;f<l;++f)y=c(h[f]),h[f]=ur(y.middle);for(p=h.pop(),f=0,l=s.length;f<l;++f)s[f]=tr(t[s[f]]);return new ri(i,a,o,h,s,{tail:p})},ui.prototype.getMembers=function(n,t,i){var r,f,u,h,e,o,s;for(this.owner.base&&this.owner.base.body.getMembers(n,t,i),r=0,u=this.fields.length;r<u;++r)for(e=this.fields[r].getNames(),f=0,h=e.length;f<h;++f)n[e[f]]=this.fields[r];for(r=0,u=this.methods.length;r<u;++r)o=this.methods[r],t[o.name]=o;for(r=0,u=this.innerClasses.length;r<u;++r)s=this.innerClasses[r],i[s.name]=s},ui.prototype.toString=function(){function ht(n){for(var t=0;n;)++t,n=n.scope;return t}var ct=ht(this.owner),r="$this_"+ct,u=this.name,t="var "+r+" = this;\n",h="",b="",k={},d={},et={},l,y,n,o,p,ot,g,nt,s,c,tt,it,rt,w,ft,st;if(this.getMembers(k,d,et),l=i,i=function(n){var t=n.name;return t==="this"?n.callSign||!n.member?r+".$self":r:k.hasOwnProperty(t)?k[t].isStatic?u+"."+t:r+"."+t:et.hasOwnProperty(t)?r+"."+t:d.hasOwnProperty(t)?d[t].isStatic?u+"."+t:r+".$self."+t:l(n)},this.baseClassName?(y=l({name:this.baseClassName}),t+="var $super = { $upcast: "+r+" };\n",t+="function $superCstr(){"+y+".apply($super,arguments);if(!('$self' in $super)) $p.extendClassChain($super)}\n",b+=u+".$base = "+y+";\n"):t+="function $superCstr(){$p.extendClassChain("+r+")}\n",this.owner.base&&(h+="$p.extendStaticMembers("+u+", "+y+");\n"),this.owner.interfaces){for(g=[],n=0,o=this.interfacesNames.length;n<o;++n)this.owner.interfaces[n]&&(nt=l({name:this.interfacesNames[n]}),g.push(nt),h+="$p.extendInterfaceMembers("+u+", "+nt+");\n");b+=u+".$interfaces = ["+g.join(", ")+"];\n"}for(this.functions.length>0&&(t+=this.functions.join("\n")+"\n"),gt(this.innerClasses),n=0,o=this.innerClasses.length;n<o;++n)s=this.innerClasses[n],s.isStatic?(h+=u+"."+s.name+" = "+s+";\n",t+=r+"."+s.name+" = "+u+"."+s.name+";\n"):t+=r+"."+s.name+" = "+s+";\n";for(n=0,o=this.fields.length;n<o;++n)if(c=this.fields[n],c.isStatic)for(h+=u+"."+c.definitions.join(";\n"+u+".")+";\n",p=0,ot=c.definitions.length;p<ot;++p)tt=c.definitions[p].name,it=u+"."+tt,t+="$p.defineProperty("+r+", '"+tt+"', {get: function(){return "+it+"}, set: function(val){"+it+" = val}});\n";else t+=r+"."+c.definitions.join(";\n"+r+".")+";\n";for(rt={},n=0,o=this.methods.length;n<o;++n){var f=this.methods[n],a=rt[f.name],v=f.name+"$"+f.params.params.length,ut=!!f.params.methodArgsParam;a?(++a,v+="_"+a):a=1,f.methodId=v,rt[f.name]=a,f.isStatic?(h+=f,h+="$p.addMethod("+u+", '"+f.name+"', "+v+", "+ut+");\n",t+="$p.addMethod("+r+", '"+f.name+"', "+v+", "+ut+");\n"):(t+=f,t+="$p.addMethod("+r+", '"+f.name+"', "+v+", "+ut+");\n")}for(t+=e(this.misc.tail),this.cstrs.length>0&&(t+=this.cstrs.join("\n")+"\n"),t+="function $constr() {\n",w=[],n=0,o=this.cstrs.length;n<o;++n)ft=this.cstrs[n].params.params.length,st=!!this.cstrs[n].params.methodArgsParam,w.push("if(arguments.length "+(st?">=":"===")+" "+ft+") { $constr_"+ft+".apply("+r+", arguments); }");return w.length>0&&(t+=w.join(" else ")+" else "),t+="$superCstr();\n}\n",t+="$constr.apply(null, arguments);\n",i=l,"(function() {\nfunction "+u+"() {\n"+t+"}\n"+h+b+"return "+u+";\n})()"},rt=function(n,i,u,f){var o=n.substring(1,n.length-1),s,y,p,e,w,b;o=wt(o),o=ai(o,i);var h=[],l=[],a=[],v=[];for(o=o.replace(/"([DEGH])(\d+)"/g,function(n,t,i){return t==="D"?h.push(i):t==="E"?l.push(i):t==="H"?v.push(i):a.push(i),""}),s=o.replace(/^(?:\s*;)+/,"").split(/;(?:\s*;)*/g),u!==r&&(y=u.replace(/^\s*extends\s+([A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)\s*$/g,"$1")),f!==r&&(p=f.replace(/^\s*implements\s+(.+?)\s*$/g,"$1").split(/\s*,\s*/g)),e=0;e<v.length;++e)v[e]=dt(t[v[e]]);for(e=0;e<h.length;++e)h[e]=rr(t[h[e]]);for(e=0;e<s.length-1;++e)w=c(s[e]),s[e]=ur(w.middle);for(b=s.pop(),e=0;e<a.length;++e)a[e]=uu(t[a[e]]);for(e=0;e<l.length;++e)l[e]=tr(t[l[e]]);return new ui(i,y,p,v,h,s,a,l,{tail:b})},ot.prototype.toString=function(){return"var "+this.name+" = "+this.body+";\n$p."+this.name+" = "+this.name+";\n"},st.prototype.toString=function(){return"var "+this.name+" = "+this.body+";\n$p."+this.name+" = "+this.name+";\n"},fi.prototype.toString=function(){var u=y({},this.params.getNames()),n=i,t,r;return i=function(t){return u.hasOwnProperty(t.name)?t.name:n(t)},t=this.params.prependMethodArgs(this.body.toString()),r="function "+this.name+this.params+" "+t+"\n$p."+this.name+" = "+this.name+";",i=n,r},ei.prototype.toString=function(){return this.misc.prefix+this.argument.toString()},er.prototype.toString=function(){return this.misc.prefix+this.argument.toString()},oi.prototype.toString=function(){var n=this.misc.prefix;return this.argument!==r&&(n+=this.argument.toString()),n},or.prototype.toString=function(){return"case "+this.expr+":"},sr.prototype.toString=function(){return this.label},yt=function(n,i,u){var l=new RegExp(/\b(catch|for|if|switch|while|with)\s*"B(\d+)"|\b(do|else|finally|return|throw|try|break|continue)\b|("[ADEH](\d+)")|\b(case)\s+([^:]+):|\b([A-Za-z_$][\w$]*\s*:)|(;)/g),f=[],h,o,v,d,w,b,y,k,p;for(n=ou(n),h=0;(o=l.exec(n))!==null;){if(o[1]!==r)d=n.lastIndexOf('"B',l.lastIndex),w=n.substring(h,d),o[1]==="for"?f.push(new ei(ru(t[o[2]]),{prefix:w})):o[1]==="catch"?f.push(new er(g(t[o[2]]),{prefix:w})):f.push(new oi(o[1],s(t[o[2]]),{prefix:w}));else if(o[3]!==r)f.push(new oi(o[3],r,{prefix:n.substring(h,l.lastIndex)}));else if(o[4]!==r){if(v=n.substring(h,l.lastIndex-o[4].length),e(v).length!==0)continue;f.push(v),b=o[4].charAt(1),y=o[5],b==="D"?f.push(i(t[y])):b==="E"?f.push(u(t[y])):b==="H"?f.push(dt(t[y])):f.push(a(t[y]))}else if(o[6]!==r)f.push(new or(s(e(o[7]))));else if(o[8]!==r){if(v=n.substring(h,l.lastIndex-o[8].length),e(v).length!==0)continue;f.push(new sr(n.substring(h,l.lastIndex)))}else k=c(n.substring(h,l.lastIndex-1)),f.push(k.left),f.push(tt(k.middle)),f.push(k.right+";");h=l.lastIndex}return p=c(n.substring(h)),f.push(p.left),p.middle!==""&&(f.push(tt(p.middle)),f.push(";"+p.right)),f},cr.prototype.toString=function(){var n=hr(this.statements),t=i,r;return pr(n)||(i=function(i){return n.hasOwnProperty(i.name)?i.name:t(i)}),r="{\n"+this.statements.join("")+"\n}",i=t,r},a=function(n){var t=c(n.substring(1,n.length-1));return new cr(yt(t.middle))},lr.prototype.toString=function(){for(var r=[],u=[],n,e,s,t=0,f=this.statements.length;t<f;++t)n=this.statements[t],n instanceof st||n instanceof ot?r.push(n):u.push(n);return gt(r),e=hr(this.statements),i=function(n){var t=n.name;return e.hasOwnProperty(t)?t:ar.hasOwnProperty(t)||p.hasOwnProperty(t)||o.hasOwnProperty(t)?"$p."+t:t},s="// this code was autogenerated from PJS\n(function($p) {\n"+r.join("")+"\n"+u.join("")+"\n})",i=null,s},hi=function(){var n=wt(t[0]);return n=n.replace(/\bimport\s+[^;]+;/g,""),new lr(yt(n,eu,fu))},ht=hi(),su(ht),hu(ht),v=ht.toString(),v=v.replace(/\s*\n(?:[\t ]*\n)+/g,"\n\n"),v=v.replace(/__x([0-9A-F]{4})/g,function(n,t){return String.fromCharCode(parseInt(t,16))}),yr(v,w)}function bt(n,t){var l=new RegExp(/\/\*\s*@pjs\s+((?:[^\*]|\*+[^\*\/])*)\*\//g).exec(n),s,w,f,h,b,k,c,d,v,y;if(l&&l.length===2){var a=[],p=l.splice(1,2)[0].replace(/\{([\s\S]*?)\}/g,function(){return function(n,t){return a.push(t),"{"+(a.length-1)+"}"}}()).replace("\n","").replace("\r","").split(";"),o=function(n){return n.replace(/^\s*["']?/,"").replace(/["']?\s*$/,"")};for(s=0,w=p.length;s<w;s++)if(f=p[s].split("="),f&&f.length===2){var i=o(f[0]),r=o(f[1]),u=[];if(i==="preload")for(u=r.split(","),h=0,b=u.length;h<b;h++)k=o(u[h]),t.imageCache.add(k);else if(i==="font")for(u=r.split(","),c=0,d=u.length;c<d;c++)v=o(u[c]),y=/^\{(\d*?)\}$/.exec(v),e.preloading.add(y?JSON.parse("{"+a[y[1]]+"}"):v);else i==="pauseOnBlur"?t.options.pauseOnBlur=r==="true":i==="globalKeyEvents"?t.options.globalKeyEvents=r==="true":i.substring(0,6)==="param-"?t.params[i.substring(6)]=r:t.options[i]=r}}return n}var s=function(){},ft=function(){return"console"in n?function(t){n.console.log("Processing.js: "+t)}:s}(),k=function(n){var t=new XMLHttpRequest;if(t.open("GET",n,!1),t.overrideMimeType&&t.overrideMimeType("text/plain"),t.setRequestHeader("If-Modified-Since","Fri, 01 Jan 1960 00:00:00 GMT"),t.send(null),t.status!==200&&t.status!==0)throw"XMLHttpRequest failed, status code "+t.status;return t.responseText},d="document"in this&&!("fake"in this.document),o,a,u,ut,b,v;if(t.head=t.head||t.getElementsByTagName("head")[0],t.documentMode>=9&&!t.doctype)throw"The doctype directive is missing. The recommended doctype in Internet Explorer is the HTML5 doctype: <!DOCTYPE html>";var f=y("Float32Array","WebGLFloatArray"),et=y("Int32Array","WebGLIntArray"),ot=y("Uint16Array","WebGLUnsignedShortArray"),it=y("Uint8Array","WebGLUnsignedByteArray"),p={X:0,Y:1,Z:2,R:3,G:4,B:5,A:6,U:7,V:8,NX:9,NY:10,NZ:11,EDGE:12,SR:13,SG:14,SB:15,SA:16,SW:17,TX:18,TY:19,TZ:20,VX:21,VY:22,VZ:23,VW:24,AR:25,AG:26,AB:27,DR:3,DG:4,DB:5,DA:6,SPR:28,SPG:29,SPB:30,SHINE:31,ER:32,EG:33,EB:34,BEEN_LIT:35,VERTEX_FIELD_COUNT:36,P2D:1,JAVA2D:1,WEBGL:2,P3D:2,OPENGL:2,PDF:0,DXF:0,OTHER:0,WINDOWS:1,MAXOSX:2,LINUX:3,EPSILON:.0001,MAX_FLOAT:34028235e31,MIN_FLOAT:-34028235e31,MAX_INT:2147483647,MIN_INT:-2147483648,PI:i.PI,TWO_PI:2*i.PI,HALF_PI:i.PI/2,THIRD_PI:i.PI/3,QUARTER_PI:i.PI/4,DEG_TO_RAD:i.PI/180,RAD_TO_DEG:180/i.PI,WHITESPACE:" \t\n\r\f ",RGB:1,ARGB:2,HSB:3,ALPHA:4,CMYK:5,TIFF:0,TARGA:1,JPEG:2,GIF:3,BLUR:11,GRAY:12,INVERT:13,OPAQUE:14,POSTERIZE:15,THRESHOLD:16,ERODE:17,DILATE:18,REPLACE:0,BLEND:1,ADD:2,SUBTRACT:4,LIGHTEST:8,DARKEST:16,DIFFERENCE:32,EXCLUSION:64,MULTIPLY:128,SCREEN:256,OVERLAY:512,HARD_LIGHT:1024,SOFT_LIGHT:2048,DODGE:4096,BURN:8192,ALPHA_MASK:4278190080,RED_MASK:16711680,GREEN_MASK:65280,BLUE_MASK:255,CUSTOM:0,ORTHOGRAPHIC:2,PERSPECTIVE:3,POINT:2,POINTS:2,LINE:4,LINES:4,TRIANGLE:8,TRIANGLES:9,TRIANGLE_STRIP:10,TRIANGLE_FAN:11,QUAD:16,QUADS:16,QUAD_STRIP:17,POLYGON:20,PATH:21,RECT:30,ELLIPSE:31,ARC:32,SPHERE:40,BOX:41,GROUP:0,PRIMITIVE:1,GEOMETRY:3,VERTEX:0,BEZIER_VERTEX:1,CURVE_VERTEX:2,BREAK:3,CLOSESHAPE:4,OPEN:1,CLOSE:2,CORNER:0,CORNERS:1,RADIUS:2,CENTER_RADIUS:2,CENTER:3,DIAMETER:3,CENTER_DIAMETER:3,BASELINE:0,TOP:101,BOTTOM:102,NORMAL:1,NORMALIZED:1,IMAGE:2,MODEL:4,SHAPE:5,SQUARE:"butt",ROUND:"round",PROJECT:"square",MITER:"miter",BEVEL:"bevel",AMBIENT:0,DIRECTIONAL:1,SPOT:3,BACKSPACE:8,TAB:9,ENTER:10,RETURN:13,ESC:27,DELETE:127,CODED:65535,SHIFT:16,CONTROL:17,ALT:18,CAPSLK:20,PGUP:33,PGDN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLK:144,META:157,INSERT:155,ARROW:"default",CROSS:"crosshair",HAND:"pointer",MOVE:"move",TEXT:"text",WAIT:"wait",NOCURSOR:"url('data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='), auto",DISABLE_OPENGL_2X_SMOOTH:1,ENABLE_OPENGL_2X_SMOOTH:-1,ENABLE_OPENGL_4X_SMOOTH:2,ENABLE_NATIVE_FONTS:3,DISABLE_DEPTH_TEST:4,ENABLE_DEPTH_TEST:-4,ENABLE_DEPTH_SORT:5,DISABLE_DEPTH_SORT:-5,DISABLE_OPENGL_ERROR_REPORT:6,ENABLE_OPENGL_ERROR_REPORT:-6,ENABLE_ACCURATE_TEXTURES:7,DISABLE_ACCURATE_TEXTURES:-7,HINT_COUNT:10,SINCOS_LENGTH:720,PRECISIONB:15,PRECISIONF:32768,PREC_MAXVAL:32767,PREC_ALPHA_SHIFT:9,PREC_RED_SHIFT:1,NORMAL_MODE_AUTO:0,NORMAL_MODE_SHAPE:1,NORMAL_MODE_VERTEX:2,MAX_LIGHTS:8};var nt=function(n){if(n.iterator instanceof Function)return n.iterator();if(n instanceof Array){var t=-1;this.hasNext=function(){return++t<n.length},this.next=function(){return n[t]}}else throw"Unable to iterate: "+n;},st=function(){function t(n){var t=0;this.hasNext=function(){return t<n.length},this.next=function(){return n[t++]},this.remove=function(){n.splice(t,1)}}function n(i){var r;i instanceof n?r=i.toArray():(r=[],typeof i=="number"&&(r.length=i>0?i:0)),this.get=function(n){return r[n]},this.contains=function(n){return this.indexOf(n)>-1},this.indexOf=function(n){for(var t=0,i=r.length;t<i;++t)if(l(n,r[t]))return t;return-1},this.lastIndexOf=function(n){for(var t=r.length-1;t>=0;--t)if(l(n,r[t]))return t;return-1},this.add=function(){if(arguments.length===1)r.push(arguments[0]);else if(arguments.length===2){var n=arguments[0];if(typeof n=="number")if(n>=0&&n<=r.length)r.splice(n,0,arguments[1]);else throw n+" is not a valid index";else throw typeof n+" is not a number";}else throw"Please use the proper number of parameters.";},this.addAll=function(n,t){var i;if(typeof n=="number"){if(n<0||n>r.length)throw"Index out of bounds for addAll: "+n+" greater or equal than "+r.length;for(i=new nt(t);i.hasNext();)r.splice(n++,0,i.next())}else for(i=new nt(n);i.hasNext();)r.push(i.next())},this.set=function(){if(arguments.length===2){var n=arguments[0];if(typeof n=="number")if(n>=0&&n<r.length)r.splice(n,1,arguments[1]);else throw n+" is not a valid index.";else throw typeof n+" is not a number";}else throw"Please use the proper number of parameters.";},this.size=function(){return r.length},this.clear=function(){r.length=0},this.remove=function(n){return typeof n=="number"?r.splice(n,1)[0]:(n=this.indexOf(n),n>-1)?(r.splice(n,1),!0):!1},this.removeAll=function(t){var i,f,u,r=new n;for(r.addAll(this),this.clear(),i=0,f=0;i<r.size();i++)u=r.get(i),t.contains(u)||this.add(f++,u);return this.size()<r.size()?!0:!1},this.isEmpty=function(){return!r.length},this.clone=function(){return new n(this)},this.toArray=function(){return r.slice(0)},this.iterator=function(){return new t(r)}}return n}(),ht=function(){function n(){function f(n){var i=g(n)%t.length;return i<0?t.length+i:i}function s(){var n,i,h,e,s,o;if(!(u<=c*t.length)){for(n=[],i=0;i<t.length;++i)t[i]!==r&&(n=n.concat(t[i]));for(h=t.length*2,t=[],t.length=h,e=0;e<n.length;++e)s=f(n[e].key),o=t[s],o===r&&(t[s]=o=[]),o.push(n[e])}}function a(n,i){function s(){while(!o)if(++f,u>=t.length)o=!0;else if(t[u]===r||f>=t[u].length)f=-1,++u;else return}var u=0,f=-1,o=!1,e;this.hasNext=function(){return!o},this.next=function(){return e=n(t[u][f]),s(),e},this.remove=function(){e!==r&&(i(e),--f,s())},s()}function e(n,t,r){this.clear=function(){i.clear()},this.contains=function(n){return t(n)},this.containsAll=function(n){for(var t=n.iterator();t.hasNext();)if(!this.contains(t.next()))return!1;return!0},this.isEmpty=function(){return i.isEmpty()},this.iterator=function(){return new a(n,r)},this.remove=function(n){return this.contains(n)?(r(n),!0):!1},this.removeAll=function(n){for(var i=n.iterator(),u=!1,t;i.hasNext();)t=i.next(),this.contains(t)&&(r(t),u=!0);return!0},this.retainAll=function(n){for(var f=this.iterator(),t=[],u,i;f.hasNext();)u=f.next(),n.contains(u)||t.push(u);for(i=0;i<t.length;++i)r(t[i]);return t.length>0},this.size=function(){return i.size()},this.toArray=function(){for(var n=[],t=this.iterator();t.hasNext();)n.push(t.next());return n}}function h(n){this._isIn=function(t){return t===i&&n.removed===r},this.equals=function(t){return l(n.key,t.getKey())},this.getKey=function(){return n.key},this.getValue=function(){return n.value},this.hashCode=function(){return g(n.key)},this.setValue=function(t){var i=n.value;return n.value=t,i}}var u,i;if(arguments.length===1&&arguments[0]instanceof n)return arguments[0].clone();var o=arguments.length>0?arguments[0]:16,c=arguments.length>1?arguments[1]:.75,t=[];t.length=o,u=0,i=this,this.clear=function(){u=0,t=[],t.length=o},this.clone=function(){var t=new n;return t.putAll(this),t},this.containsKey=function(n){var e=f(n),u=t[e],i;if(u===r)return!1;for(i=0;i<u.length;++i)if(l(u[i].key,n))return!0;return!1},this.containsValue=function(n){for(var u,f,i=0;i<t.length;++i)if(u=t[i],u!==r)for(f=0;f<u.length;++f)if(l(u[f].value,n))return!0;return!1},this.entrySet=function(){return new e(function(n){return new h(n)},function(n){return n instanceof h&&n._isIn(i)},function(n){return i.remove(n.getKey())})},this.get=function(n){var e=f(n),u=t[e],i;if(u===r)return null;for(i=0;i<u.length;++i)if(l(u[i].key,n))return u[i].value;return null},this.isEmpty=function(){return u===0},this.keySet=function(){return new e(function(n){return n.key},function(n){return i.containsKey(n)},function(n){return i.remove(n)})},this.values=function(){return new e(function(n){return n.value},function(n){return i.containsValue(n)},function(n){return i.removeByValue(n)})},this.put=function(n,i){var h=f(n),e=t[h],o,c;if(e===r)return++u,t[h]=[{key:n,value:i}],s(),null;for(o=0;o<e.length;++o)if(l(e[o].key,n))return c=e[o].value,e[o].value=i,c;return++u,e.push({key:n,value:i}),s(),null},this.putAll=function(n){for(var i=n.entrySet().iterator(),t;i.hasNext();)t=i.next(),this.put(t.getKey(),t.getValue())},this.remove=function(n){var o=f(n),i=t[o],e,s;if(i===r)return null;for(e=0;e<i.length;++e)if(l(i[e].key,n))return--u,s=i[e].value,i[e].removed=!0,i.length>1?i.splice(e,1):t[o]=r,s;return null},this.removeByValue=function(n){var i,r,u,f;for(i in t)if(t.hasOwnProperty(i))for(r=0,u=t[i].length;r<u;r++)if(f=t[i][r],f.value===n)return t[i].splice(r,1),!0;return!1},this.size=function(){return u}}return n}(),h=function(){function n(n,t,i){this.x=n||0,this.y=t||0,this.z=i||0}function r(n){return function(t,i){var r=t.get();return r[n](i),r}}n.dist=function(n,t){return n.dist(t)},n.dot=function(n,t){return n.dot(t)},n.cross=function(n,t){return n.cross(t)},n.angleBetween=function(n,t){return i.acos(n.dot(t)/(n.mag()*t.mag()))},n.prototype={set:function(n,t,i){arguments.length===1?this.set(n.x||n[0]||0,n.y||n[1]||0,n.z||n[2]||0):(this.x=n,this.y=t,this.z=i)},get:function(){return new n(this.x,this.y,this.z)},mag:function(){var n=this.x,t=this.y,r=this.z;return i.sqrt(n*n+t*t+r*r)},add:function(n,t,i){arguments.length===1?(this.x+=n.x,this.y+=n.y,this.z+=n.z):(this.x+=n,this.y+=t,this.z+=i)},sub:function(n,t,i){arguments.length===1?(this.x-=n.x,this.y-=n.y,this.z-=n.z):(this.x-=n,this.y-=t,this.z-=i)},mult:function(n){typeof n=="number"?(this.x*=n,this.y*=n,this.z*=n):(this.x*=n.x,this.y*=n.y,this.z*=n.z)},div:function(n){typeof n=="number"?(this.x/=n,this.y/=n,this.z/=n):(this.x/=n.x,this.y/=n.y,this.z/=n.z)},dist:function(n){var t=this.x-n.x,r=this.y-n.y,u=this.z-n.z;return i.sqrt(t*t+r*r+u*u)},dot:function(n,t,i){return arguments.length===1?this.x*n.x+this.y*n.y+this.z*n.z:this.x*n+this.y*t+this.z*i},cross:function(t){var i=this.x,r=this.y,u=this.z;return new n(r*t.z-t.y*u,u*t.x-t.z*i,i*t.y-t.x*r)},normalize:function(){var n=this.mag();n>0&&this.div(n)},limit:function(n){this.mag()>n&&(this.normalize(),this.mult(n))},heading2D:function(){return-i.atan2(-this.y,this.x)},toString:function(){return"["+this.x+", "+this.y+", "+this.z+"]"},array:function(){return[this.x,this.y,this.z]}};for(var t in n.prototype)n.prototype.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=r(t));return n}();rt.prototype=p,o=new rt,o.ArrayList=st,o.HashMap=ht,o.PVector=h,o.ObjectIterator=nt,o.PConstants=p,o.defineProperty=function(n,t,i){"defineProperty"in Object?Object.defineProperty(n,t,i):(i.hasOwnProperty("get")&&n.__defineGetter__(t,i.get),i.hasOwnProperty("set")&&n.__defineSetter__(t,i.set))},o.extendClassChain=function(n){for(var i=[n],t=n.$upcast;t;t=t.$upcast)tt(t,n),i.push(t),n=t;while(i.length>0)i.pop().$self=n},o.extendStaticMembers=function(n,t){tt(n,t)},o.extendInterfaceMembers=function(n,t){tt(n,t)},o.addMethod=function(n,t,i,r){var f=n[t],e,u,o;f||r?(e=i.length,"$overloads"in f?f.$overloads[e]=i:(u=function(){var n=u.$overloads[arguments.length]||("$methodArgsIndex"in u&&arguments.length>u.$methodArgsIndex?u.$overloads[u.$methodArgsIndex]:null)||u.$defaultOverload;return n.apply(this,arguments)},o=[],f&&(o[f.length]=f),o[e]=i,u.$overloads=o,u.$defaultOverload=f||i,r&&(u.$methodArgsIndex=e),u.name=t,n[t]=u)):n[t]=i},o.createJavaArray=function(n,t){var i=null,f=null,r,u,s,e;if(typeof n=="string"&&(n==="boolean"?f=!1:lt(n)&&(f=0)),typeof t[0]=="number")if(r=0|t[0],t.length<=1)for(i=[],i.length=r,u=0;u<r;++u)i[u]=f;else for(i=[],s=t.slice(1),e=0;e<r;++e)i.push(o.createJavaArray(n,s));return i},a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},function(n){function f(n){return function(){throw"Processing.js does not support "+n+".";}}for(var i="open() createOutput() createInput() BufferedReader selectFolder() dataPath() createWriter() selectOutput() beginRecord() saveStream() endRecord() selectInput() saveBytes() createReader() beginRaw() endRaw() PrintWriter delay()".split(" "),r=i.length,t,u;r--;)t=i[r],u=t.replace("()",""),n[u]=f(t)}(o),o.defineProperty(o,"screenWidth",{get:function(){return n.innerWidth}}),o.defineProperty(o,"screenHeight",{get:function(){return n.innerHeight}}),o.defineProperty(o,"online",{get:function(){return!0}});var c=[],w={},at=function(n){c.splice(w[n],1),delete w[n]},vt=function(n){n.externals.canvas.id!==r&&n.externals.canvas.id.length||(n.externals.canvas.id="__processing"+c.length),w[n.externals.canvas.id]=c.length,c.push(n)};e.prototype.caching=!0,e.prototype.getCSSDefinition=function(n,t){n===r&&(n=this.size+"px"),t===r&&(t=this.leading+"px");var i=[this.style,"normal",this.weight,n+"/"+t,this.family];return i.join(" ")},e.prototype.measureTextWidth=function(n){return this.context2d.measureText(n).width},e.prototype.measureTextWidthFallback=function(n){var r=t.createElement("canvas"),i=r.getContext("2d");return i.font=this.css,i.measureText(n).width},e.PFontCache={length:0},e.get=function(n,t){var i,r,u;if(t=(t*10+.5|0)/10,i=e.PFontCache,r=n+"/"+t,!i[r]){if(i[r]=new e(n,t),i.length++,i.length===50){e.prototype.measureTextWidth=e.prototype.measureTextWidthFallback,e.prototype.caching=!1;for(u in i)u!=="length"&&(i[u].context2d=null);return new e(n,t)}if(i.length===400)return e.PFontCache={},e.get=e.getFallback,new e(n,t)}return i[r]},e.getFallback=function(n,t){return new e(n,t)},e.list=function(){return["sans-serif","serif","monospace","fantasy","cursive"]},e.preloading={template:{},initialized:!1,initialize:function(){var r=function(){var n="#E3KAI2wAgT1MvMg7Eo3VmNtYX7ABi3CxnbHlm7Abw3kaGVhZ7ACs3OGhoZWE7A53CRobXR47AY3AGbG9jYQ7G03Bm1heH7ABC3CBuYW1l7Ae3AgcG9zd7AI3AE#B3AQ2kgTY18PPPUACwAg3ALSRoo3#yld0xg32QAB77#E777773B#E3C#I#Q77773E#Q7777777772CMAIw7AB77732B#M#Q3wAB#g3B#E#E2BB//82BB////w#B7#gAEg3E77x2B32B#E#Q#MTcBAQ32gAe#M#QQJ#E32M#QQJ#I#g32Q77#",t=function(n){return"AAAAAAAA".substr(~~n?7-n:6)};return n.replace(/[#237]/g,t)},i=t.createElement("style"),n;i.setAttribute("type","text/css"),i.innerHTML='@font-face {\n  font-family: "PjsEmptyFont";\n  src: url(\'data:application/x-font-ttf;base64,'+r()+"')\n       format('truetype');\n}",t.head.appendChild(i),n=t.createElement("span"),n.style.cssText='position: absolute; top: 0; left: 0; opacity: 0; font-family: "PjsEmptyFont", fantasy;',n.innerHTML="AAAAAAAA",t.body.appendChild(n),this.template=n,this.initialized=!0},getElementWidth:function(n){return t.defaultView.getComputedStyle(n,"").getPropertyValue("width")},timeAttempted:0,pending:function(n){var r,u,f,i;for(this.initialized||this.initialize(),f=this.getElementWidth(this.template),i=0;i<this.fontList.length;i++){if(r=this.fontList[i],u=this.getElementWidth(r),this.timeAttempted<4e3&&u===f)return this.timeAttempted+=n,!0;t.body.removeChild(r),this.fontList.splice(i--,1),this.timeAttempted=0}return this.fontList.length===0?!1:!0},fontList:[],addedList:{},add:function(n){var r,f,u,i;(this.initialized||this.initialize(),r=typeof n=="object"?n.fontFace:n,f=typeof n=="object"?n.url:n,this.addedList[r])||(u=t.createElement("style"),u.setAttribute("type","text/css"),u.innerHTML="@font-face{\n  font-family: '"+r+"';\n  src:  url('"+f+"');\n}\n",t.head.appendChild(u),this.addedList[r]=!0,i=t.createElement("span"),i.style.cssText="position: absolute; top: 0; left: 0; opacity: 0;",i.style.fontFamily='"'+r+'", "PjsEmptyFont", fantasy',i.innerHTML="AAAAAAAA",t.body.appendChild(i),this.fontList.push(i))}},o.PFont=e,u=this.Processing=function(c,l){function bf(n){u.debug("Unimplemented - "+n)}function dt(n,t,i,u){var f=or.locations[n];f===r&&(f=y.getUniformLocation(t,i),or.locations[n]=f),f!==null&&(u.length===4?y.uniform4fv(f,u):u.length===3?y.uniform3fv(f,u):u.length===2?y.uniform2fv(f,u):y.uniform1f(f,u))}function gt(n,t,i,u){var f=or.locations[n];f===r&&(f=y.getUniformLocation(t,i),or.locations[n]=f),f!==null&&(u.length===4?y.uniform4iv(f,u):u.length===3?y.uniform3iv(f,u):u.length===2?y.uniform2iv(f,u):y.uniform1i(f,u))}function kt(n,t,i,u,f){var e=or.locations[n];e===r&&(e=y.getUniformLocation(t,i),or.locations[n]=e),e!==-1&&(f.length===16?y.uniformMatrix4fv(e,u,f):f.length===9?y.uniformMatrix3fv(e,u,f):y.uniformMatrix2fv(e,u,f))}function fi(n,t,i,u,f){var e=or.attributes[n];e===r&&(e=y.getAttribLocation(t,i),or.attributes[n]=e),e!==-1&&(y.bindBuffer(y.ARRAY_BUFFER,f),y.vertexAttribPointer(e,u,y.FLOAT,!1,0,0),y.enableVertexAttribArray(e))}function gi(n,t,i){var u=or.attributes[n];u===r&&(u=y.getAttribLocation(t,i),or.attributes[n]=u),u!==-1&&y.disableVertexAttribArray(u)}function ir(n,t,r,u){var f,e,o,s,h;return gr===3?(h=v.color.toRGB(n,t,r),f=h[0],e=h[1],o=h[2]):(f=i.round(255*(n/bi)),e=i.round(255*(t/er)),o=i.round(255*(r/ki))),s=i.round(255*(u/oi)),f=f<0?0:f,e=e<0?0:e,o=o<0?0:o,s=s<0?0:s,f=f>255?255:f,e=e>255?255:e,o=o>255?255:o,s=s>255?255:s,s<<24&4278190080|f<<16&16711680|e<<8&65280|o&255}function ra(n,t){var r;return n&4278190080?(r=i.round(255*(t/oi)),r=r>255?255:r,r=r<0?0:r,n-(n&4278190080)+(r<<24&4278190080)):gr===1?ir(n,n,n,t):gr===3?ir(0,0,n/bi*ki,t):void 0}function ua(n){if(n<=bi&&n>=0){if(gr===1)return ir(n,n,n,oi);if(gr===3)return ir(0,0,n/bi*ki,oi)}if(n)return n>2147483647&&(n-=4294967296),n}function fe(n){var r,u,e,t,f,i,o;return(r=(n>>16&255)/255,u=(n>>8&255)/255,e=(n&255)/255,t=v.max(v.max(r,u),e),f=v.min(v.min(r,u),e),f===t)?[0,0,t*ki]:(o=(t-f)/t,i=r===t?(u-e)/(t-f):u===t?2+(e-r)/(t-f):4+(r-u)/(t-f),i/=6,i<0?i+=1:i>1&&(i-=1),[i*bi,o*er,t*ki])}function du(){y.save()}function gu(){y.restore(),ce=!0,eu=!0}function sc(){var n=(Date.now()-ko)/1e3,t;be++,t=be/n,n>.5&&(ko=Date.now(),be=0,v.__frameRate=t),v.frameCount++}function ri(n,t,i){n.addEventListener?n.addEventListener(t,i,!1):n.attachEvent("on"+t,i),nf.push({elem:n,type:t,fn:i})}function ws(n){var t=n.elem,i=n.type,r=n.fn;t.removeEventListener?t.removeEventListener(i,r,!1):t.detachEvent&&t.detachEvent("on"+i,r)}function hc(n,t,u,f,e,o){var w=n<0?u:t,b=e===0,c=e===r||e<0?0:e,h=i.abs(n),l,v,y,s,p,a;if(b)for(c=1,h*=10;i.abs(i.round(h)-h)>1e-6&&c<7;)++c,h*=10;else c!==0&&(h*=i.pow(10,c));for(v=h*2,i.floor(h)===h?l=h:i.floor(v)===v?(y=i.floor(h),l=y+y%2):l=i.round(h),s="",p=f+c;p>0||l>0;)p--,s=""+l%10+s,l=i.floor(l/10);if(o!==r)for(a=s.length-3-c;a>0;)s=s.substring(0,a)+o+s.substring(a),a-=3;return c>0?w+s.substring(0,s.length-c)+"."+s.substring(s.length-c,s.length):w+s}function fo(n,t,i,r,u,f){var o,e,s;if(n instanceof Array){for(o=[],e=0,s=n.length;e<s;e++)o.push(hc(n[e],t,i,r,u,f));return o}return hc(n,t,i,r,u,f)}function lc(n){var t=parseInt("0x"+n,16);return t>2147483647&&(t-=4294967296),t}function hr(n){return Array.prototype.slice.call(n,1)}function ac(n){return typeof n=="number"?n!==0:typeof n=="boolean"?n:typeof n=="string"?n.toLowerCase()==="true":n instanceof yi?n.code===49||n.code===84||n.code===116:void 0}function vc(n){return typeof n=="number"?n:typeof n=="boolean"?n?1:0:typeof n=="string"?parseFloat(n):n instanceof yi?n.code:void 0}function yc(n,t){if(typeof n=="number")return n&4294967295;if(typeof n=="boolean")return n?1:0;if(typeof n=="string"){var i=parseInt(n,t||10);return i&4294967295}if(n instanceof yi)return n.code}function af(n,t){var i=n||362436069,r=t||521288629,u=function(){return i=36969*(i&65535)+(i>>>16)&4294967295,r=18e3*(r&65535)+(r>>>16)&4294967295,((i&65535)<<16|r&65535)&4294967295};this.nextDouble=function(){var n=u()/4294967296;return n<0?1+n:n},this.nextInt=u}function fa(n){function e(n,t,i,r){var u=n&15,f=u<8?t:i,e=u<4?i:u===12||u===14?t:r;return((u&1)==0?f:-f)+((u&2)==0?e:-e)}function o(n,t,i){var r=(n&1)==0?t:i;return(n&2)==0?-r:r}function c(n,t){return(n&1)==0?-t:t}function f(n,t,i){return t+n*(i-t)}for(var l=n!==r?new af(n):af.createRandomized(),s,t=new it(512),h,u=0;u<256;++u)t[u]=u;for(u=0;u<256;++u)h=t[s=l.nextInt()&255],t[s]=t[u],t[u]=h;for(u=0;u<256;++u)t[u+256]=t[u];this.noise3d=function(n,r,u){var h=i.floor(n)&255,c=i.floor(r)&255,o=i.floor(u)&255;n-=i.floor(n),r-=i.floor(r),u-=i.floor(u);var s=(3-2*n)*n*n,l=(3-2*r)*r*r,k=(3-2*u)*u*u,a=t[h]+c,v=t[a]+o,y=t[a+1]+o,p=t[h+1]+c,w=t[p]+o,b=t[p+1]+o;return f(k,f(l,f(s,e(t[v],n,r,u),e(t[w],n-1,r,u)),f(s,e(t[y],n,r-1,u),e(t[b],n-1,r-1,u))),f(l,f(s,e(t[v+1],n,r,u-1),e(t[w+1],n-1,r,u-1)),f(s,e(t[y+1],n,r-1,u-1),e(t[b+1],n-1,r-1,u-1))))},this.noise2d=function(n,r){var u=i.floor(n)&255,e=i.floor(r)&255;n-=i.floor(n),r-=i.floor(r);var s=(3-2*n)*n*n,l=(3-2*r)*r*r,h=t[u]+e,c=t[u+1]+e;return f(l,f(s,o(t[h],n,r),o(t[c],n-1,r)),f(s,o(t[h+1],n,r-1),o(t[c+1],n-1,r-1)))},this.noise1d=function(n){var r=i.floor(n)&255,u;return n-=i.floor(n),u=(3-2*n)*n*n,f(u,c(t[r],n),c(t[r+1],n-1))}}function ru(){wt&&(eu&&(y.fillStyle=v.color.toString(fu),eu=!1),y.fill())}function dr(){lt&&(ce&&(y.strokeStyle=v.color.toString(ou),ce=!1),y.stroke())}function se(){ru(),dr(),y.closePath()}function vf(n,i,u){var f=ds.shift();f===r&&(f={},f.canvas=t.createElement("canvas"),f.context=f.canvas.getContext("2d")),ds.push(f);var h=f.canvas,e=f.context,o=i||n.width,s=u||n.height;return h.width=o,h.height=s,n?"data"in n?e.putImageData(n,0,0):(e.clearRect(0,0,o,s),e.drawImage(n,0,0,o,s)):e.clearRect(0,0,o,s),f}function ea(n){return{getLength:function(n){return function(){if(n.isRemote)throw"Image is loaded remotely. Cannot get length.";else return n.imageData.data.length?n.imageData.data.length/4:0}}(n),getPixel:function(n){return function(t){var i=t*4,r=n.imageData.data;if(n.isRemote)throw"Image is loaded remotely. Cannot get pixels.";return(r[i+3]&255)<<24|(r[i]&255)<<16|(r[i+1]&255)<<8|r[i+2]&255}}(n),setPixel:function(n){return function(t,i){var r=t*4,u=n.imageData.data;if(n.isRemote)throw"Image is loaded remotely. Cannot set pixel.";u[r+0]=i>>16&255,u[r+1]=i>>8&255,u[r+2]=i&255,u[r+3]=i>>24&255,n.__isDirty=!0}}(n),toArray:function(n){return function(){var u=[],i=n.imageData.data,f=n.width*n.height,r,t;if(n.isRemote)throw"Image is loaded remotely. Cannot get pixels.";for(r=0,t=0;r<f;r++,t+=4)u.push((i[t+3]&255)<<24|(i[t]&255)<<16|(i[t+1]&255)<<8|i[t+2]&255);return u}}(n),set:function(n){return function(t){var i,r,u,f,e;if(this.isRemote)throw"Image is loaded remotely. Cannot set pixels.";for(r=n.imageData.data,f=0,e=t.length;f<e;f++)u=t[f],i=f*4,r[i+0]=u>>16&255,r[i+1]=u>>8&255,r[i+2]=u&255,r[i+3]=u>>24&255;n.__isDirty=!0}}(n)}}function oa(n,t){var i,r;return n>=v.width||n<0||t<0||t>=v.height?0:gf?(r=((0|n)+v.width*(0|t))*4,i=v.imageData.data,(i[r+3]&255)<<24|(i[r]&255)<<16|(i[r+1]&255)<<8|i[r+2]&255):(i=v.toImageData(0|n,0|t,1,1).data,(i[3]&255)<<24|(i[0]&255)<<16|(i[1]&255)<<8|i[2]&255)}function sa(n,t,i){if(i.isRemote)throw"Image is loaded remotely. Cannot get x,y.";var r=t*i.width*4+n*4,u=i.imageData.data;return(u[r+3]&255)<<24|(u[r]&255)<<16|(u[r+1]&255)<<8|u[r+2]&255}function nl(n,t,i,r){var u=new ur(i,r,2);return u.fromImageData(v.toImageData(n,t,i,r)),u}function tl(n,t,r,u,f){var e,o,s,v;if(f.isRemote)throw"Image is loaded remotely. Cannot get x,y,w,h.";var l=new ur(r,u,2),h=l.imageData.data,y=f.width,p=f.height,c=f.imageData.data,w=i.max(0,-t),a=i.max(0,-n),b=i.min(u,p-t),k=i.min(r,y-n);for(e=w;e<b;++e)for(o=((t+e)*y+(n+a))*4,s=(e*r+a)*4,v=a;v<k;++v)h[s++]=c[o++],h[s++]=c[o++],h[s++]=c[o++],h[s++]=c[o++];return l.__isDirty=!0,l}function he(){gf&&(y=vh,gf=!1,v.updatePixels())}function ha(){function t(n,t){function i(){he(),y[t].apply(y,arguments)}n[t]=i}function i(n,t){function i(){return he(),y[t]}function r(n){he(),y[t]=n}v.defineProperty(n,t,{get:i,set:r})}for(var n in y)typeof y[n]=="function"?t(this,n):i(this,n)}function ca(){gf||(v.loadPixels(),cs===null&&(vh=y,cs=new ha),gf=!0,y=cs,yh=0)}function la(n,t,i){n<v.width&&n>=0&&t>=0&&t<v.height&&(ca(),v.pixels.setPixel((0|n)+v.width*(0|t),i),++yh>ph&&he())}function aa(n,t,i,r){if(r.isRemote)throw"Image is loaded remotely. Cannot set x,y.";var u=v.color.toArray(i),f=t*r.width*4+n*4,e=r.imageData.data;e[f]=u[0],e[f+1]=u[1],e[f+2]=u[2],e[f+3]=u[3]}function yf(n){return n instanceof String?n:typeof n=="number"?n===(0|n)?n.toString():v.nf(n,0,3):n===null||n===r?"":n.toString()}function rl(n,t,i,r){var e,f,u,o,s;for(n.indexOf("\n")<0?(e=[n],f=1):(e=n.split(/\r?\n/g),f=e.length),u=0,nu===101?u=tu+ar:nu===3?u=tu/2-(f-1)*tr/2:nu===102&&(u=-(ar+(f-1)*tr)),o=0;o<f;++o)s=e[o],ei.text$line(s,t,i+u,r,vu),u+=tr}function ul(n,t,r,u,f,e){var o,w,p,c,b,g,v,nt,k;if(n.length!==0&&u!==0&&f!==0&&!(lr>f)){var l=-1,s=0,h=0,a=[];for(o=0,w=n.length;o<w;o++){var y=n[o],tt=y===" ",d=ti.measureTextWidth(y);if(y!=="\n"&&h+d<=u)tt&&(l=o),h+=d;else{if(l+1===s)if(o>0)l=o;else return;y==="\n"?(a.push({text:n.substring(s,o),width:h}),s=o+1):(a.push({text:n.substring(s,l+1),width:h}),s=l+1),h=0,o=s-1}}for(s<w&&a.push({text:n.substring(s),width:h}),p=1,c=tu,vu===3?p=u/2:vu===39&&(p=u),b=a.length,g=i.min(b,i.floor(f/tr)),nu===101?c=tu+ar:nu===3?c=f/2-tr*(g/2-1):nu===102&&(c=ar+tr),v=0;v<b;v++){if(k=v*tr,c+k>f-ar)break;nt=a[v],ei.text$line(nt.text,t+p,r+c+k,e,vu)}}}function pf(n){ei=n==="3D"?new rt:n==="2D"?new tt:new nt;for(var t in nt.prototype)nt.prototype.hasOwnProperty(t)&&t.indexOf("$")<0&&(v[t]=ei[t]);ei.$init()}function st(n){return function(){return pf("2D"),ei[n].apply(this,arguments)}}function fl(t){var r=t,u=0,f=0;if(v.pmouseX=v.mouseX,v.pmouseY=v.mouseY,r.offsetParent)do u+=r.offsetLeft,f+=r.offsetTop;while(!!(r=r.offsetParent));r=t;do u-=r.scrollLeft||0,f-=r.scrollTop||0;while(!!(r=r.parentNode));return u+=wh,f+=bh,u+=kh,f+=dh,u+=n.pageXOffset,f+=n.pageYOffset,{X:u,Y:f}}function eo(n,t){var i=fl(n,t);v.mouseX=t.pageX-i.X,v.mouseY=t.pageY-i.Y}function oo(n){for(var i=fl(n.changedTouches[0].target,n.changedTouches[0]),r,u,f,t=0;t<n.touches.length;t++)r=n.touches[t],r.offsetX=r.pageX-i.X,r.offsetY=r.pageY-i.Y;for(t=0;t<n.targetTouches.length;t++)u=n.targetTouches[t],u.offsetX=u.pageX-i.X,u.offsetY=u.pageY-i.Y;for(t=0;t<n.changedTouches.length;t++)f=n.changedTouches[t],f.offsetX=f.pageX-i.X,f.offsetY=f.pageY-i.Y;return n}function el(n){var t=n.which||n.keyCode;switch(t){case 13:return 10;case 91:case 93:case 224:return 157;case 57392:return 17;case 46:return 127;case 45:return 155}return t}function pa(n){var t=n.which||n.keyCode,i=n.shiftKey||n.ctrlKey||n.altKey||n.metaKey;switch(t){case 13:t=i?13:10;break;case 8:t=i?127:8}return new yi(t)}function ol(n){return typeof n.preventDefault=="function"?n.preventDefault():typeof n.stopPropagation=="function"&&n.stopPropagation(),!1}function th(){var n;for(n in yu)if(yu.hasOwnProperty(n)){v.__keyPressed=!0;return}v.__keyPressed=!1}function sl(){v.__keyPressed=!1,yu=[],ef=null}function hl(n,t){yu[n]=t,ef=null,v.key=t,v.keyCode=n,v.keyPressed(),v.keyCode=0,v.keyTyped(),th()}function wa(n){var t=el(n),i;if(t===127){hl(t,new yi(127));return}if(al.indexOf(t)<0){ef=t;return}return i=new yi(65535),v.key=i,v.keyCode=t,yu[t]=i,v.keyPressed(),ef=null,th(),ol(n)}function ba(n){if(ef!==null){var t=ef,i=pa(n);return hl(t,i),ol(n)}}function ka(n){var t=el(n),i=yu[t];i!==r&&(v.key=i,v.keyCode=t,v.keyReleased(),delete yu[t],th())}var d,ho,v,uo,yi,ys,pt,ue,iu,oc,ps,br,ut,kr,nf,cc,ee,oe,cr,pc,bs,ks,bc,kc,dc,gc,ds,ur,gs,hi,nh,so,wf,ih,rh;if(!(this instanceof u))throw"called Processing constructor as if it were a function: missing 'new'.";if(ho=c===r&&l===r,d=ho?t.createElement("canvas"):typeof c=="string"?t.getElementById(c):c,!(d instanceof HTMLCanvasElement))throw"called Processing constructor without passing canvas element reference or id.";v=this,v.externals={canvas:d,context:r,sketch:r},v.name="Processing.js Instance",v.use3DContext=!1,v.focused=!1,v.breakShape=!1,v.glyphTable={},v.pmouseX=0,v.pmouseY=0,v.mouseX=0,v.mouseY=0,v.mouseButton=0,v.mouseScroll=0,v.mouseClicked=r,v.mouseDragged=r,v.mouseMoved=r,v.mousePressed=r,v.mouseReleased=r,v.mouseScrolled=r,v.mouseOver=r,v.mouseOut=r,v.touchStart=r,v.touchEnd=r,v.touchMove=r,v.touchCancel=r,v.key=r,v.keyCode=r,v.keyPressed=s,v.keyReleased=s,v.keyTyped=s,v.draw=r,v.setup=r,v.__mousePressed=!1,v.__keyPressed=!1,v.__frameRate=60,v.frameCount=0,v.width=100,v.height=100;var y,ii,ei,da=!0,wt=!0,di=[1,1,1,1],fu=4294967295,eu=!0,lt=!0,pi=[0,0,0,1],ou=4278190080,ce=!0,si=1,le=!1,su=!1,lu=!0,ae=0,fr=0,wi=3,co=0,lo=0,ao=0,ve=0,vo=60,uh=1e3/vo,ye="default",cl=d.style.cursor,ni=20,ga=0,ll=[],yo=0,po=20,fh=!1,au=-3355444,wo=20,oi=255,bi=255,er=255,ki=255,nv=!1,tv=!1,pe=0,we=0,gr=1,hu=null,bo=null,iv=!1,eh=Date.now(),ko=eh,be=0,nr,kf,ke,tf,rf,go,ns,or={attributes:{},locations:{}},b,ft,ci,ts,is,rs,de,us,df,fs,oh,es,sh,ge,hh,ch,lh,uf={width:0,height:0},ah=2,ai=!1,os,ss,hs,vu=37,nu=0,no=4,ff="Arial",lr=12,tu=9,ar=2,tr=14,ti=e.get(ff,lr),vh,cs=null,gf=!1,yh,ph=1e3,yu=[],ef=null,al=[16,17,18,20,33,34,35,36,37,38,39,40,144,155,112,113,114,115,116,117,118,119,120,121,122,123,157],wh,bh,kh,dh;t.defaultView&&t.defaultView.getComputedStyle&&(wh=parseInt(t.defaultView.getComputedStyle(d,null).paddingLeft,10)||0,bh=parseInt(t.defaultView.getComputedStyle(d,null).paddingTop,10)||0,kh=parseInt(t.defaultView.getComputedStyle(d,null).borderLeftWidth,10)||0,dh=parseInt(t.defaultView.getComputedStyle(d,null).borderTopWidth,10)||0);var ct=0,to=0,pu=0,vr=[],yr=[],pr=[],ne=new f(720),te=new f(720),yt,rv,wu,wr,ht,ui,of,sf,ie,sr,io=!1,gh=!1,ro=i.PI/3,ls=v.width/2,bu=v.height/2,ku=bu/i.tan(ro/2),nc=ku/10,tc=ku*10,ic=v.width/v.height,w=[],vi=[],li=0,hf=!1,cf=!1,cu=!0,re=0,rc=[],uc=new f([.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,.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,-.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,-.5,.5,-.5,-.5,.5,-.5,-.5,.5,.5,.5,.5,.5]),fc=new f([.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,-.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,-.5,.5,-.5,-.5,.5,.5,-.5,.5]),vl=new f([0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0]),as=new f([0,0,0,0,1,0,1,1,0,1,0,0]),yl=new f([0,0,1,0,0,1,0,0,1,0,0,1]),pl="varying vec4 vFrontColor;attribute vec3 aVertex;attribute vec4 aColor;uniform mat4 uView;uniform mat4 uProjection;uniform float uPointSize;void main(void) {  vFrontColor = aColor;  gl_PointSize = uPointSize;  gl_Position = uProjection * uView * vec4(aVertex, 1.0);}",wl="#ifdef GL_ES\nprecision highp float;\n#endif\nvarying vec4 vFrontColor;uniform bool uSmooth;void main(void){  if(uSmooth == true){    float dist = distance(gl_PointCoord, vec2(0.5));    if(dist > 0.5){      discard;    }  }  gl_FragColor = vFrontColor;}",bl="varying vec4 vFrontColor;attribute vec3 aVertex;attribute vec2 aTextureCoord;uniform vec4 uColor;uniform mat4 uModel;uniform mat4 uView;uniform mat4 uProjection;uniform float uPointSize;varying vec2 vTextureCoord;void main(void) {  gl_PointSize = uPointSize;  vFrontColor = uColor;  gl_Position = uProjection * uView * uModel * vec4(aVertex, 1.0);  vTextureCoord = aTextureCoord;}",kl="#ifdef GL_ES\nprecision highp float;\n#endif\nvarying vec4 vFrontColor;varying vec2 vTextureCoord;uniform sampler2D uSampler;uniform int uIsDrawingText;uniform bool uSmooth;void main(void){  if(uSmooth == true){    float dist = distance(gl_PointCoord, vec2(0.5));    if(dist > 0.5){      discard;    }  }  if(uIsDrawingText == 1){    float alpha = texture2D(uSampler, vTextureCoord).a;    gl_FragColor = vec4(vFrontColor.rgb * alpha, alpha);  }  else{    gl_FragColor = vFrontColor;  }}",dl=/Windows/.test(navigator.userAgent),gl="varying vec4 vFrontColor;attribute vec3 aVertex;attribute vec3 aNormal;attribute vec4 aColor;attribute vec2 aTexture;varying   vec2 vTexture;uniform vec4 uColor;uniform bool uUsingMat;uniform vec3 uSpecular;uniform vec3 uMaterialEmissive;uniform vec3 uMaterialAmbient;uniform vec3 uMaterialSpecular;uniform float uShininess;uniform mat4 uModel;uniform mat4 uView;uniform mat4 uProjection;uniform mat4 uNormalTransform;uniform int uLightCount;uniform vec3 uFalloff;struct Light {  int type;  vec3 color;  vec3 position;  vec3 direction;  float angle;  vec3 halfVector;  float concentration;};uniform Light uLights0;uniform Light uLights1;uniform Light uLights2;uniform Light uLights3;uniform Light uLights4;uniform Light uLights5;uniform Light uLights6;uniform Light uLights7;Light getLight(int index){  if(index == 0) return uLights0;  if(index == 1) return uLights1;  if(index == 2) return uLights2;  if(index == 3) return uLights3;  if(index == 4) return uLights4;  if(index == 5) return uLights5;  if(index == 6) return uLights6;  return uLights7;}void AmbientLight( inout vec3 totalAmbient, in vec3 ecPos, in Light light ) {  float d = length( light.position - ecPos );  float attenuation = 1.0 / ( uFalloff[0] + ( uFalloff[1] * d ) + ( uFalloff[2] * d * d ));  totalAmbient += light.color * attenuation;}void DirectionalLight( inout vec3 col, inout vec3 spec, in vec3 vertNormal, in vec3 ecPos, in Light light ) {  float powerFactor = 0.0;  float nDotVP = max(0.0, dot( vertNormal, normalize(-light.position) ));  float nDotVH = max(0.0, dot( vertNormal, normalize(-light.position-normalize(ecPos) )));  if( nDotVP != 0.0 ){    powerFactor = pow( nDotVH, uShininess );  }  col += light.color * nDotVP;  spec += uSpecular * powerFactor;}void PointLight( inout vec3 col, inout vec3 spec, in vec3 vertNormal, in vec3 ecPos, in Light light ) {  float powerFactor;   vec3 VP = light.position - ecPos;  float d = length( VP );   VP = normalize( VP );  float attenuation = 1.0 / ( uFalloff[0] + ( uFalloff[1] * d ) + ( uFalloff[2] * d * d ));  float nDotVP = max( 0.0, dot( vertNormal, VP ));  vec3 halfVector = normalize( VP - normalize(ecPos) );  float nDotHV = max( 0.0, dot( vertNormal, halfVector ));  if( nDotVP == 0.0 ) {    powerFactor = 0.0;  }  else {    powerFactor = pow( nDotHV, uShininess );  }  spec += uSpecular * powerFactor * attenuation;  col += light.color * nDotVP * attenuation;}void SpotLight( inout vec3 col, inout vec3 spec, in vec3 vertNormal, in vec3 ecPos, in Light light ) {  float spotAttenuation;  float powerFactor = 0.0;  vec3 VP = light.position - ecPos;  vec3 ldir = normalize( -light.direction );  float d = length( VP );  VP = normalize( VP );  float attenuation = 1.0 / ( uFalloff[0] + ( uFalloff[1] * d ) + ( uFalloff[2] * d * d ) );  float spotDot = dot( VP, ldir );"+(dl?"  spotAttenuation = 1.0; ":"  if( spotDot > cos( light.angle ) ) {    spotAttenuation = pow( spotDot, light.concentration );  }  else{    spotAttenuation = 0.0;  }  attenuation *= spotAttenuation;")+"  float nDotVP = max( 0.0, dot( vertNormal, VP ) );  vec3 halfVector = normalize( VP - normalize(ecPos) );  float nDotHV = max( 0.0, dot( vertNormal, halfVector ) );  if( nDotVP != 0.0 ) {    powerFactor = pow( nDotHV, uShininess );  }  spec += uSpecular * powerFactor * attenuation;  col += light.color * nDotVP * attenuation;}void main(void) {  vec3 finalAmbient = vec3( 0.0 );  vec3 finalDiffuse = vec3( 0.0 );  vec3 finalSpecular = vec3( 0.0 );  vec4 col = uColor;  if ( uColor[0] == -1.0 ){    col = aColor;  }  vec3 norm = normalize(vec3( uNormalTransform * vec4( aNormal, 0.0 ) ));  vec4 ecPos4 = uView * uModel * vec4(aVertex, 1.0);  vec3 ecPos = (vec3(ecPos4))/ecPos4.w;  if( uLightCount == 0 ) {    vFrontColor = col + vec4(uMaterialSpecular, 1.0);  }  else {    for( int i = 0; i < 8; i++ ) {      Light l = getLight(i);      if( i >= uLightCount ){        break;      }      if( l.type == 0 ) {        AmbientLight( finalAmbient, ecPos, l );      }      else if( l.type == 1 ) {        DirectionalLight( finalDiffuse, finalSpecular, norm, ecPos, l );      }      else if( l.type == 2 ) {        PointLight( finalDiffuse, finalSpecular, norm, ecPos, l );      }      else {        SpotLight( finalDiffuse, finalSpecular, norm, ecPos, l );      }    }   if( uUsingMat == false ) {     vFrontColor = vec4(       vec3( col ) * finalAmbient +       vec3( col ) * finalDiffuse +       vec3( col ) * finalSpecular,       col[3] );   }   else{     vFrontColor = vec4(        uMaterialEmissive +        (vec3(col) * uMaterialAmbient * finalAmbient ) +        (vec3(col) * finalDiffuse) +        (uMaterialSpecular * finalSpecular),        col[3] );    }  }  vTexture.xy = aTexture.xy;  gl_Position = uProjection * uView * uModel * vec4( aVertex, 1.0 );}",na="#ifdef GL_ES\nprecision highp float;\n#endif\nvarying vec4 vFrontColor;uniform sampler2D uSampler;uniform bool uUsingTexture;varying vec2 vTexture;void main(void){  if( uUsingTexture ){    gl_FragColor = vec4(texture2D(uSampler, vTexture.xy)) * vFrontColor;  }  else{    gl_FragColor = vFrontColor;  }}";var vs=function(n,t,i){var f=n.createShader(n.VERTEX_SHADER),r,u;if(n.shaderSource(f,t),n.compileShader(f),!n.getShaderParameter(f,n.COMPILE_STATUS))throw n.getShaderInfoLog(f);if(r=n.createShader(n.FRAGMENT_SHADER),n.shaderSource(r,i),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw n.getShaderInfoLog(r);if(u=n.createProgram(),n.attachShader(u,f),n.attachShader(u,r),n.linkProgram(u),!n.getProgramParameter(u,n.LINK_STATUS))throw"Error linking shaders.";return u},ec=function(n,t,i,r){return{x:n,y:t,w:i,h:r}},lf=ec,ta=function(n,t,i,r,u){return{x:n,y:t,w:u?i:i-n,h:u?r:r-t}},ia=function(n,t,i,r){return{x:n-i/2,y:t-r/2,w:i,h:r}},bt=function(){},tt=function(){},rt=function(){},nt=function(){};tt.prototype=new bt,tt.prototype.constructor=tt,rt.prototype=new bt,rt.prototype.constructor=rt,nt.prototype=new bt,nt.prototype.constructor=nt,bt.prototype.a3DOnlyFunction=s,uo={},yi=v.Character=function(n){return this.code=typeof n=="string"&&n.length===1?n.charCodeAt(0):typeof n=="number"?n:n instanceof yi?n:NaN,uo[this.code]===r?uo[this.code]=this:uo[this.code]},yi.prototype.toString=function(){return String.fromCharCode(this.code)},yi.prototype.valueOf=function(){return this.code},ys=v.PShape=function(n){this.family=n||0,this.visible=!0,this.style=!0,this.children=[],this.nameTable=[],this.params=[],this.name="",this.image=null,this.matrix=null,this.kind=null,this.close=null,this.width=null,this.height=null,this.parent=null},ys.prototype={isVisible:function(){return this.visible},setVisible:function(n){this.visible=n},disableStyle:function(){this.style=!1;for(var n=0,t=this.children.length;n<t;n++)this.children[n].disableStyle()},enableStyle:function(){this.style=!0;for(var n=0,t=this.children.length;n<t;n++)this.children[n].enableStyle()},getFamily:function(){return this.family},getWidth:function(){return this.width},getHeight:function(){return this.height},setName:function(n){this.name=n},getName:function(){return this.name},draw:function(n){n=n||v,this.visible&&(this.pre(n),this.drawImpl(n),this.post(n))},drawImpl:function(n){this.family===0?this.drawGroup(n):this.family===1?this.drawPrimitive(n):this.family===3?this.drawGeometry(n):this.family===21&&this.drawPath(n)},drawPath:function(n){var i,r,t;if(this.vertices.length!==0){if(n.beginShape(),this.vertexCodes.length===0)if(this.vertices[0].length===2)for(i=0,r=this.vertices.length;i<r;i++)n.vertex(this.vertices[i][0],this.vertices[i][1]);else for(i=0,r=this.vertices.length;i<r;i++)n.vertex(this.vertices[i][0],this.vertices[i][1],this.vertices[i][2]);else if(t=0,this.vertices[0].length===2)for(i=0,r=this.vertexCodes.length;i<r;i++)this.vertexCodes[i]===0?(n.vertex(this.vertices[t][0],this.vertices[t][1],this.vertices[t].moveTo),n.breakShape=!1,t++):this.vertexCodes[i]===1?(n.bezierVertex(this.vertices[t+0][0],this.vertices[t+0][1],this.vertices[t+1][0],this.vertices[t+1][1],this.vertices[t+2][0],this.vertices[t+2][1]),t+=3):this.vertexCodes[i]===2?(n.curveVertex(this.vertices[t][0],this.vertices[t][1]),t++):this.vertexCodes[i]===3&&(n.breakShape=!0);else for(i=0,r=this.vertexCodes.length;i<r;i++)this.vertexCodes[i]===0?(n.vertex(this.vertices[t][0],this.vertices[t][1],this.vertices[t][2]),this.vertices[t].moveTo===!0?w[w.length-1].moveTo=!0:this.vertices[t].moveTo===!1&&(w[w.length-1].moveTo=!1),n.breakShape=!1):this.vertexCodes[i]===1?(n.bezierVertex(this.vertices[t+0][0],this.vertices[t+0][1],this.vertices[t+0][2],this.vertices[t+1][0],this.vertices[t+1][1],this.vertices[t+1][2],this.vertices[t+2][0],this.vertices[t+2][1],this.vertices[t+2][2]),t+=3):this.vertexCodes[i]===2?(n.curveVertex(this.vertices[t][0],this.vertices[t][1],this.vertices[t][2]),t++):this.vertexCodes[i]===3&&(n.breakShape=!0);n.endShape(this.close?2:1)}},drawGeometry:function(n){var t,r,i;if(n.beginShape(this.kind),this.style)for(t=0,r=this.vertices.length;t<r;t++)n.vertex(this.vertices[t]);else for(t=0,r=this.vertices.length;t<r;t++)i=this.vertices[t],i[2]===0?n.vertex(i[0],i[1]):n.vertex(i[0],i[1],i[2]);n.endShape()},drawGroup:function(n){for(var t=0,i=this.children.length;t<i;t++)this.children[t].draw(n)},drawPrimitive:function(n){var t,i,r,u;this.kind===2?n.point(this.params[0],this.params[1]):this.kind===4?this.params.length===4?n.line(this.params[0],this.params[1],this.params[2],this.params[3]):n.line(this.params[0],this.params[1],this.params[2],this.params[3],this.params[4],this.params[5]):this.kind===8?n.triangle(this.params[0],this.params[1],this.params[2],this.params[3],this.params[4],this.params[5]):this.kind===16?n.quad(this.params[0],this.params[1],this.params[2],this.params[3],this.params[4],this.params[5],this.params[6],this.params[7]):this.kind===30?this.image!==null?(t=lf,n.imageMode(0),n.image(this.image,this.params[0],this.params[1],this.params[2],this.params[3]),lf=t):(i=fr,n.rectMode(0),n.rect(this.params[0],this.params[1],this.params[2],this.params[3]),fr=i):this.kind===31?(r=wi,n.ellipseMode(0),n.ellipse(this.params[0],this.params[1],this.params[2],this.params[3]),wi=r):this.kind===32?(u=wi,n.ellipseMode(0),n.arc(this.params[0],this.params[1],this.params[2],this.params[3],this.params[4],this.params[5]),wi=u):this.kind===41?this.params.length===1?n.box(this.params[0]):n.box(this.params[0],this.params[1],this.params[2]):this.kind===40&&n.sphere(this.params[0])},pre:function(n){this.matrix&&(n.pushMatrix(),n.transform(this.matrix)),this.style&&(n.pushStyle(),this.styles(n))},post:function(n){this.matrix&&n.popMatrix(),this.style&&n.popStyle()},styles:function(n){this.stroke?(n.stroke(this.strokeColor),n.strokeWeight(this.strokeWeight),n.strokeCap(this.strokeCap),n.strokeJoin(this.strokeJoin)):n.noStroke(),this.fill?n.fill(this.fillColor):n.noFill()},getChild:function(n){var t,r,i;if(typeof n=="number")return this.children[n];if(n===""||this.name===n)return this;if(this.nameTable.length>0){for(t=0,r=this.nameTable.length;t<r||i;t++)if(this.nameTable[t].getName===n){i=this.nameTable[t];break}if(i)return i}for(t=0,r=this.children.length;t<r;t++)if(i=this.children[t].getChild(n),i)return i;return null},getChildCount:function(){return this.children.length},addChild:function(n){this.children.push(n),n.parent=this,n.getName()!==null&&this.addName(n.getName(),n)},addName:function(n,t){this.parent!==null?this.parent.addName(n,t):this.nameTable.push([n,t])},translate:function(){arguments.length===2?(this.checkMatrix(2),this.matrix.translate(arguments[0],arguments[1])):(this.checkMatrix(3),this.matrix.translate(arguments[0],arguments[1],0))},checkMatrix:function(n){this.matrix===null?this.matrix=n===2?new v.PMatrix2D:new v.PMatrix3D:n===3&&this.matrix instanceof v.PMatrix2D&&(this.matrix=new v.PMatrix3D)},rotateX:function(n){this.rotate(n,1,0,0)},rotateY:function(n){this.rotate(n,0,1,0)},rotateZ:function(n){this.rotate(n,0,0,1)},rotate:function(){arguments.length===1?(this.checkMatrix(2),this.matrix.rotate(arguments[0])):(this.checkMatrix(3),this.matrix.rotate(arguments[0],arguments[1],arguments[2],arguments[3]))},scale:function(){arguments.length===2?(this.checkMatrix(2),this.matrix.scale(arguments[0],arguments[1])):arguments.length===3?(this.checkMatrix(2),this.matrix.scale(arguments[0],arguments[1],arguments[2])):(this.checkMatrix(2),this.matrix.scale(arguments[0]))},resetMatrix:function(){this.checkMatrix(2),this.matrix.reset()},applyMatrix:function(n){arguments.length===1?this.applyMatrix(n.elements[0],n.elements[1],0,n.elements[2],n.elements[3],n.elements[4],0,n.elements[5],0,0,1,0,0,0,0,1):arguments.length===6?(this.checkMatrix(2),this.matrix.apply(arguments[0],arguments[1],arguments[2],0,arguments[3],arguments[4],arguments[5],0,0,0,1,0,0,0,0,1)):arguments.length===16&&(this.checkMatrix(3),this.matrix.apply(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8],arguments[9],arguments[10],arguments[11],arguments[12],arguments[13],arguments[14],arguments[15]))}},pt=v.PShapeSVG=function(){var u,n,t,i,r,f;if(v.PShape.call(this),arguments.length===1){if(this.element=arguments[0],this.vertexCodes=[],this.vertices=[],this.opacity=1,this.stroke=!1,this.strokeColor=4278190080,this.strokeWeight=1,this.strokeCap="butt",this.strokeJoin="miter",this.strokeGradient=null,this.strokeGradientPaint=null,this.strokeName=null,this.strokeOpacity=1,this.fill=!0,this.fillColor=4278190080,this.fillGradient=null,this.fillGradientPaint=null,this.fillName=null,this.fillOpacity=1,this.element.getName()!=="svg")throw"root is not <svg>, it's <"+this.element.getName()+">";}else arguments.length===2&&(typeof arguments[1]=="string"?arguments[1].indexOf(".svg")>-1&&(this.element=new v.XMLElement(v,arguments[1]),this.vertexCodes=[],this.vertices=[],this.opacity=1,this.stroke=!1,this.strokeColor=4278190080,this.strokeWeight=1,this.strokeCap="butt",this.strokeJoin="miter",this.strokeGradient="",this.strokeGradientPaint="",this.strokeName="",this.strokeOpacity=1,this.fill=!0,this.fillColor=4278190080,this.fillGradient=null,this.fillGradientPaint=null,this.fillOpacity=1):arguments[0]&&(this.element=arguments[1],this.vertexCodes=arguments[0].vertexCodes.slice(),this.vertices=arguments[0].vertices.slice(),this.stroke=arguments[0].stroke,this.strokeColor=arguments[0].strokeColor,this.strokeWeight=arguments[0].strokeWeight,this.strokeCap=arguments[0].strokeCap,this.strokeJoin=arguments[0].strokeJoin,this.strokeGradient=arguments[0].strokeGradient,this.strokeGradientPaint=arguments[0].strokeGradientPaint,this.strokeName=arguments[0].strokeName,this.fill=arguments[0].fill,this.fillColor=arguments[0].fillColor,this.fillGradient=arguments[0].fillGradient,this.fillGradientPaint=arguments[0].fillGradientPaint,this.fillName=arguments[0].fillName,this.strokeOpacity=arguments[0].strokeOpacity,this.fillOpacity=arguments[0].fillOpacity,this.opacity=arguments[0].opacity));if(this.name=this.element.getStringAttribute("id"),u=this.element.getStringAttribute("display","inline"),this.visible=u!=="none",n=this.element.getAttribute("transform"),n&&(this.matrix=this.parseMatrix(n)),t=this.element.getStringAttribute("viewBox"),t!==null&&(i=t.split(" "),this.width=i[2],this.height=i[3]),r=this.element.getStringAttribute("width"),f=this.element.getStringAttribute("height"),r!==null)this.width=this.parseUnitSize(r),this.height=this.parseUnitSize(f);else if(this.width===0||this.height===0){this.width=1,this.height=1;throw"The width and/or height is not readable in the <svg> tag of this file.";}this.parseColors(this.element),this.parseChildren(this.element)},pt.prototype=new ys,pt.prototype.parseMatrix=function(){function n(n){var t=[];return n.replace(/\((.*?)\)/,function(){return function(n,i){t=i.replace(/,+/g," ").split(/\s+/)}}()),t}return function(t){var r,u,f,i,e,o,s,h,c;if(this.checkMatrix(2),r=[],t.replace(/\s*(\w+)\((.*?)\)/g,function(n){r.push(v.trim(n))}),r.length===0)return null;for(u=0,f=r.length;u<f;u++)i=n(r[u]),r[u].indexOf("matrix")!==-1?this.matrix.set(i[0],i[2],i[4],i[1],i[3],i[5]):r[u].indexOf("translate")!==-1?(e=i[0],o=i.length===2?i[1]:0,this.matrix.translate(e,o)):r[u].indexOf("scale")!==-1?(s=i[0],h=i.length===2?i[1]:i[0],this.matrix.scale(s,h)):r[u].indexOf("rotate")!==-1?(c=i[0],i.length===1?this.matrix.rotate(v.radians(c)):i.length===3&&(this.matrix.translate(i[1],i[2]),this.matrix.rotate(v.radians(i[0])),this.matrix.translate(-i[1],-i[2]))):r[u].indexOf("skewX")!==-1?this.matrix.skewX(parseFloat(i[0])):r[u].indexOf("skewY")!==-1?this.matrix.skewY(i[0]):r[u].indexOf("shearX")!==-1?this.matrix.shearX(i[0]):r[u].indexOf("shearY")!==-1&&this.matrix.shearY(i[0]);return this.matrix}}(),pt.prototype.parseChildren=function(n){for(var r=n.getChildren(),u=new v.PShape,i,t=0,f=r.length;t<f;t++)i=this.parseChild(r[t]),i&&u.addChild(i);this.children.push(u)},pt.prototype.getName=function(){return this.name},pt.prototype.parseChild=function(n){var i=n.getName(),t;return i==="g"?t=new pt(this,n):i==="defs"?t=new pt(this,n):i==="line"?(t=new pt(this,n),t.parseLine()):i==="circle"?(t=new pt(this,n),t.parseEllipse(!0)):i==="ellipse"?(t=new pt(this,n),t.parseEllipse(!1)):i==="rect"?(t=new pt(this,n),t.parseRect()):i==="polygon"?(t=new pt(this,n),t.parsePoly(!0)):i==="polyline"?(t=new pt(this,n),t.parsePoly(!1)):i==="path"?(t=new pt(this,n),t.parsePath()):i==="radialGradient"?bf("PShapeSVG.prototype.parseChild, name = radialGradient"):i==="linearGradient"?bf("PShapeSVG.prototype.parseChild, name = linearGradient"):i==="text"?bf("PShapeSVG.prototype.parseChild, name = text"):i==="filter"?bf("PShapeSVG.prototype.parseChild, name = filter"):i==="mask"?bf("PShapeSVG.prototype.parseChild, name = mask"):s(),t},pt.prototype.parsePath=function(){var ut,ft,h;if(this.family=21,this.kind=0,ut=[],h=v.trim(this.element.getStringAttribute("d").replace(/[\s,]+/g," ")),h!==null){h=v.__toCharArray(h);for(var i=0,r=0,y=0,p=0,w=0,d=0,b=0,g=0,e=0,o=0,nt=0,tt=0,c=0,l=0,s=0,u=0,a="",n=[],rt=!1,k,it,t,f;s<h.length;)if(u=h[s].valueOf(),u>=65&&u<=90||u>=97&&u<=122){if(t=s,s++,s<h.length)for(n=[],u=h[s].valueOf();!(u>=65&&u<=90||u>=97&&u<=100||u>=102&&u<=122)&&rt===!1;)u===32?(a!==""&&(n.push(parseFloat(a)),a=""),s++):u===45?h[s-1].valueOf()===101?(a+=h[s].toString(),s++):(a!==""&&n.push(parseFloat(a)),a=h[s].toString(),s++):(a+=h[s].toString(),s++),s===h.length?rt=!0:u=h[s].valueOf();if(a!==""&&(n.push(parseFloat(a)),a=""),it=h[t],u=it.valueOf(),u===77){if(n.length>=2&&n.length%2==0&&(i=n[0],r=n[1],this.parsePathMoveto(i,r),n.length>2))for(t=2,f=n.length;t<f;t+=2)i=n[t],r=n[t+1],this.parsePathLineto(i,r)}else if(u===109){if(n.length>=2&&n.length%2==0&&(i+=n[0],r+=n[1],this.parsePathMoveto(i,r),n.length>2))for(t=2,f=n.length;t<f;t+=2)i+=n[t],r+=n[t+1],this.parsePathLineto(i,r)}else if(u===76){if(n.length>=2&&n.length%2==0)for(t=0,f=n.length;t<f;t+=2)i=n[t],r=n[t+1],this.parsePathLineto(i,r)}else if(u===108){if(n.length>=2&&n.length%2==0)for(t=0,f=n.length;t<f;t+=2)i+=n[t],r+=n[t+1],this.parsePathLineto(i,r)}else if(u===72)for(t=0,f=n.length;t<f;t++)i=n[t],this.parsePathLineto(i,r);else if(u===104)for(t=0,f=n.length;t<f;t++)i+=n[t],this.parsePathLineto(i,r);else if(u===86)for(t=0,f=n.length;t<f;t++)r=n[t],this.parsePathLineto(i,r);else if(u===118)for(t=0,f=n.length;t<f;t++)r+=n[t],this.parsePathLineto(i,r);else if(u===67){if(n.length>=6&&n.length%6==0)for(t=0,f=n.length;t<f;t+=6)w=n[t],b=n[t+1],d=n[t+2],g=n[t+3],e=n[t+4],o=n[t+5],this.parsePathCurveto(w,b,d,g,e,o),i=e,r=o}else if(u===99){if(n.length>=6&&n.length%6==0)for(t=0,f=n.length;t<f;t+=6)w=i+n[t],b=r+n[t+1],d=i+n[t+2],g=r+n[t+3],e=i+n[t+4],o=r+n[t+5],this.parsePathCurveto(w,b,d,g,e,o),i=e,r=o}else if(u===83){if(n.length>=4&&n.length%4==0)for(t=0,f=n.length;t<f;t+=4)k.toLowerCase()==="c"||k.toLowerCase()==="s"?(nt=this.vertices[this.vertices.length-2][0],tt=this.vertices[this.vertices.length-2][1],c=this.vertices[this.vertices.length-1][0],l=this.vertices[this.vertices.length-1][1],w=c+(c-nt),b=l+(l-tt)):(w=this.vertices[this.vertices.length-1][0],b=this.vertices[this.vertices.length-1][1]),d=n[t],g=n[t+1],e=n[t+2],o=n[t+3],this.parsePathCurveto(w,b,d,g,e,o),i=e,r=o}else if(u===115){if(n.length>=4&&n.length%4==0)for(t=0,f=n.length;t<f;t+=4)k.toLowerCase()==="c"||k.toLowerCase()==="s"?(nt=this.vertices[this.vertices.length-2][0],tt=this.vertices[this.vertices.length-2][1],c=this.vertices[this.vertices.length-1][0],l=this.vertices[this.vertices.length-1][1],w=c+(c-nt),b=l+(l-tt)):(w=this.vertices[this.vertices.length-1][0],b=this.vertices[this.vertices.length-1][1]),d=i+n[t],g=r+n[t+1],e=i+n[t+2],o=r+n[t+3],this.parsePathCurveto(w,b,d,g,e,o),i=e,r=o}else if(u===81){if(n.length>=4&&n.length%4==0)for(t=0,f=n.length;t<f;t+=4)y=n[t],p=n[t+1],e=n[t+2],o=n[t+3],this.parsePathQuadto(i,r,y,p,e,o),i=e,r=o}else if(u===113){if(n.length>=4&&n.length%4==0)for(t=0,f=n.length;t<f;t+=4)y=i+n[t],p=r+n[t+1],e=i+n[t+2],o=r+n[t+3],this.parsePathQuadto(i,r,y,p,e,o),i=e,r=o}else if(u===84){if(n.length>=2&&n.length%2==0)for(t=0,f=n.length;t<f;t+=2)k.toLowerCase()==="q"||k.toLowerCase()==="t"?(nt=this.vertices[this.vertices.length-2][0],tt=this.vertices[this.vertices.length-2][1],c=this.vertices[this.vertices.length-1][0],l=this.vertices[this.vertices.length-1][1],y=c+(c-nt),p=l+(l-tt)):(y=i,p=r),e=n[t],o=n[t+1],this.parsePathQuadto(i,r,y,p,e,o),i=e,r=o}else if(u===116){if(n.length>=2&&n.length%2==0)for(t=0,f=n.length;t<f;t+=2)k.toLowerCase()==="q"||k.toLowerCase()==="t"?(nt=this.vertices[this.vertices.length-2][0],tt=this.vertices[this.vertices.length-2][1],c=this.vertices[this.vertices.length-1][0],l=this.vertices[this.vertices.length-1][1],y=c+(c-nt),p=l+(l-tt)):(y=i,p=r),e=i+n[t],o=r+n[t+1],this.parsePathQuadto(i,r,y,p,e,o),i=e,r=o}else(u===90||u===122)&&(this.close=!0);k=it.toString()}else s++}},pt.prototype.parsePathQuadto=function(n,t,i,r,u,f){if(this.vertices.length>0)this.parsePathCode(1),this.parsePathVertex(n+(i-n)*2/3,t+(r-t)*2/3),this.parsePathVertex(u+(i-u)*2/3,f+(r-f)*2/3),this.parsePathVertex(u,f);else throw"Path must start with M/m";},pt.prototype.parsePathCurveto=function(n,t,i,r,u,f){if(this.vertices.length>0)this.parsePathCode(1),this.parsePathVertex(n,t),this.parsePathVertex(i,r),this.parsePathVertex(u,f);else throw"Path must start with M/m";},pt.prototype.parsePathLineto=function(n,t){if(this.vertices.length>0)this.parsePathCode(0),this.parsePathVertex(n,t),this.vertices[this.vertices.length-1].moveTo=!1;else throw"Path must start with M/m";},pt.prototype.parsePathMoveto=function(n,t){this.vertices.length>0&&this.parsePathCode(3),this.parsePathCode(0),this.parsePathVertex(n,t),this.vertices[this.vertices.length-1].moveTo=!0},pt.prototype.parsePathVertex=function(n,t){var i=[];i[0]=n,i[1]=t,this.vertices.push(i)},pt.prototype.parsePathCode=function(n){this.vertexCodes.push(n)},pt.prototype.parsePoly=function(n){var u,t,i,f,r;if(this.family=21,this.close=n,u=v.trim(this.element.getStringAttribute("points").replace(/[,\s]+/g," ")),u!==null)if(t=u.split(" "),t.length%2==0)for(i=0,f=t.length;i<f;i++)r=[],r[0]=t[i],r[1]=t[++i],this.vertices.push(r);else throw"Error parsing polygon points: odd number of coordinates provided";},pt.prototype.parseRect=function(){if(this.kind=30,this.family=1,this.params=[],this.params[0]=this.element.getFloatAttribute("x"),this.params[1]=this.element.getFloatAttribute("y"),this.params[2]=this.element.getFloatAttribute("width"),this.params[3]=this.element.getFloatAttribute("height"),this.params[2]<0||this.params[3]<0)throw"svg error: negative width or height found while parsing <rect>";},pt.prototype.parseEllipse=function(n){this.kind=31,this.family=1,this.params=[],this.params[0]=this.element.getFloatAttribute("cx")|0,this.params[1]=this.element.getFloatAttribute("cy")|0;var t,i;if(n){if(t=i=this.element.getFloatAttribute("r"),t<0)throw"svg error: negative radius found while parsing <circle>";}else if(t=this.element.getFloatAttribute("rx"),i=this.element.getFloatAttribute("ry"),t<0||i<0)throw"svg error: negative x-axis radius or y-axis radius found while parsing <ellipse>";this.params[0]-=t,this.params[1]-=i,this.params[2]=t*2,this.params[3]=i*2},pt.prototype.parseLine=function(){this.kind=4,this.family=1,this.params=[],this.params[0]=this.element.getFloatAttribute("x1"),this.params[1]=this.element.getFloatAttribute("y1"),this.params[2]=this.element.getFloatAttribute("x2"),this.params[3]=this.element.getFloatAttribute("y2")},pt.prototype.parseColors=function(n){var u,r,i,f,t;if(n.hasAttribute("opacity")&&this.setOpacity(n.getAttribute("opacity")),n.hasAttribute("stroke")&&this.setStroke(n.getAttribute("stroke")),n.hasAttribute("stroke-width")&&this.setStrokeWeight(n.getAttribute("stroke-width")),n.hasAttribute("stroke-linejoin")&&this.setStrokeJoin(n.getAttribute("stroke-linejoin")),n.hasAttribute("stroke-linecap")&&this.setStrokeCap(n.getStringAttribute("stroke-linecap")),n.hasAttribute("fill")&&this.setFill(n.getStringAttribute("fill")),n.hasAttribute("style"))for(u=n.getStringAttribute("style"),r=u.toString().split(";"),i=0,f=r.length;i<f;i++)t=v.trim(r[i].split(":")),t[0]==="fill"?this.setFill(t[1]):t[0]==="fill-opacity"?this.setFillOpacity(t[1]):t[0]==="stroke"?this.setStroke(t[1]):t[0]==="stroke-width"?this.setStrokeWeight(t[1]):t[0]==="stroke-linecap"?this.setStrokeCap(t[1]):t[0]==="stroke-linejoin"?this.setStrokeJoin(t[1]):t[0]==="stroke-opacity"?this.setStrokeOpacity(t[1]):t[0]==="opacity"&&this.setOpacity(t[1])},pt.prototype.setFillOpacity=function(n){this.fillOpacity=parseFloat(n),this.fillColor=this.fillOpacity*255<<24|this.fillColor&16777215},pt.prototype.setFill=function(n){var t=this.fillColor&4278190080;n==="none"?this.fill=!1:n.indexOf("#")===0?(this.fill=!0,n.length===4&&(n=n.replace(/#(.)(.)(.)/,"#$1$1$2$2$3$3")),this.fillColor=t|parseInt(n.substring(1),16)&16777215):n.indexOf("rgb")===0?(this.fill=!0,this.fillColor=t|this.parseRGB(n)):n.indexOf("url(#")===0?this.fillName=n.substring(5,n.length-1):a[n]&&(this.fill=!0,this.fillColor=t|parseInt(a[n].substring(1),16)&16777215)},pt.prototype.setOpacity=function(n){this.strokeColor=parseFloat(n)*255<<24|this.strokeColor&16777215,this.fillColor=parseFloat(n)*255<<24|this.fillColor&16777215},pt.prototype.setStroke=function(n){var t=this.strokeColor&4278190080;n==="none"?this.stroke=!1:n.charAt(0)==="#"?(this.stroke=!0,n.length===4&&(n=n.replace(/#(.)(.)(.)/,"#$1$1$2$2$3$3")),this.strokeColor=t|parseInt(n.substring(1),16)&16777215):n.indexOf("rgb")===0?(this.stroke=!0,this.strokeColor=t|this.parseRGB(n)):n.indexOf("url(#")===0?this.strokeName=n.substring(5,n.length-1):a[n]&&(this.stroke=!0,this.strokeColor=t|parseInt(a[n].substring(1),16)&16777215)},pt.prototype.setStrokeWeight=function(n){this.strokeWeight=this.parseUnitSize(n)},pt.prototype.setStrokeJoin=function(n){n==="miter"?this.strokeJoin="miter":n==="round"?this.strokeJoin="round":n==="bevel"&&(this.strokeJoin="bevel")},pt.prototype.setStrokeCap=function(n){n==="butt"?this.strokeCap="butt":n==="round"?this.strokeCap="round":n==="square"&&(this.strokeCap="square")},pt.prototype.setStrokeOpacity=function(n){this.strokeOpacity=parseFloat(n),this.strokeColor=this.strokeOpacity*255<<24|this.strokeColor&16777215},pt.prototype.parseRGB=function(n){var i=n.substring(n.indexOf("(")+1,n.indexOf(")")),t=i.split(", ");return t[0]<<16|t[1]<<8|t[2]},pt.prototype.parseUnitSize=function(n){var t=n.length-2;return t<0?n:n.indexOf("pt")===t?parseFloat(n.substring(0,t))*1.25:n.indexOf("pc")===t?parseFloat(n.substring(0,t))*15:n.indexOf("mm")===t?parseFloat(n.substring(0,t))*3.543307:n.indexOf("cm")===t?parseFloat(n.substring(0,t))*35.43307:n.indexOf("in")===t?parseFloat(n.substring(0,t))*90:n.indexOf("px")===t?parseFloat(n.substring(0,t)):parseFloat(n)},v.shape=function(n,t,i,r,u){arguments.length>=1&&arguments[0]!==null&&n.isVisible()&&(v.pushMatrix(),re===3?arguments.length===5?(v.translate(t-r/2,i-u/2),v.scale(r/n.getWidth(),u/n.getHeight())):arguments.length===3?v.translate(t-n.getWidth()/2,-n.getHeight()/2):v.translate(-n.getWidth()/2,-n.getHeight()/2):re===0?arguments.length===5?(v.translate(t,i),v.scale(r/n.getWidth(),u/n.getHeight())):arguments.length===3&&v.translate(t,i):re===1&&(arguments.length===5?(r-=t,u-=i,v.translate(t,i),v.scale(r/n.getWidth(),u/n.getHeight())):arguments.length===3&&v.translate(t,i)),n.draw(v),(arguments.length===1&&re===3||arguments.length>1)&&v.popMatrix())},v.shapeMode=function(n){re=n},v.loadShape=function(n){return arguments.length===1&&n.indexOf(".svg")>-1?new pt(null,n):null},ue=function(n,t,i,r,u){this.fullName=n||"",this.name=t||"",this.namespace=i||"",this.value=r,this.type=u},ue.prototype={getName:function(){return this.name},getFullName:function(){return this.fullName},getNamespace:function(){return this.namespace},getValue:function(){return this.value},getType:function(){return this.type},setValue:function(n){this.value=n}},iu=v.XMLElement=function(n,t,i,u){this.attributes=[],this.children=[],this.fullName=null,this.name=null,this.namespace="",this.content=null,this.parent=null,this.lineNr="",this.systemID="",this.type="ELEMENT",n&&(typeof n=="string"?t===r&&n.indexOf("<")>-1?this.parse(n):(this.fullName=n,this.namespace=t,this.systemId=i,this.lineNr=u):this.parse(t))},iu.prototype={parse:function(n){var r,t,i;try{if(t=n.substring(n.length-4),(t===".xml"||t===".svg")&&(n=k(n)),r=(new DOMParser).parseFromString(n,"text/xml"),i=r.documentElement,i)this.parseChildrenRecursive(null,i);else throw"Error loading document";return this}catch(u){throw u;}},parseChildrenRecursive:function(n,t){var i,o,u,r,f,e,s;if(n?(i=new iu(t.nodeName),i.parent=n):(this.fullName=t.localName,this.name=t.nodeName,i=this),t.nodeType===3&&t.textContent!=="")return this.createPCDataElement(t.textContent);if(t.nodeType===4)return this.createCDataElement(t.textContent);if(t.attributes)for(r=0,f=t.attributes.length;r<f;r++)u=t.attributes[r],o=new ue(u.getname,u.nodeName,u.namespaceURI,u.nodeValue,u.nodeType),i.attributes.push(o);if(t.childNodes)for(r=0,f=t.childNodes.length;r<f;r++)s=t.childNodes[r],e=i.parseChildrenRecursive(i,s),e!==null&&i.children.push(e);return i},createElement:function(n,t,i,u){return i===r?new iu(n,t):new iu(n,t,i,u)},createPCDataElement:function(n){if(n.replace(/^\s+$/g,"")==="")return null;var i=new iu;return i.type="TEXT",i.content=n,i},createCDataElement:function(n){var t=this.createPCDataElement(n),i,r;if(t===null)return null;t.type="CDATA",i={"<":"&lt;",">":"&gt;","'":"&apos;",'"':"&quot;"};for(r in i)Object.hasOwnProperty(i,r)||(n=n.replace(new RegExp(r,"g"),i[r]));return t.cdata=n,t},hasAttribute:function(){return arguments.length===1?this.getAttribute(arguments[0])!==null:arguments.length===2?this.getAttribute(arguments[0],arguments[1])!==null:void 0},equals:function(n){var t,i,u,f,s,h,r,e,o;if(!(n instanceof iu)||this.fullName!==n.fullName||this.attributes.length!==n.getAttributeCount()||this.attributes.length!==n.attributes.length)return!1;for(t=0,i=this.attributes.length;t<i;t++)if((u=this.attributes[t].getName(),f=this.attributes[t].getNamespace(),r=n.findAttribute(u,f),r===null)||this.attributes[t].getValue()!==r.getValue()||this.attributes[t].getType()!==r.getType())return!1;if(this.children.length!==n.getChildCount())return!1;if(this.children.length>0){for(t=0,i=this.children.length;t<i;t++)if(e=this.getChild(t),o=n.getChild(t),!e.equals(o))return!1;return!0}return this.content===n.content},getContent:function(){if(this.type==="TEXT"||this.type==="CDATA")return this.content;var n=this.children;return n.length===1&&(n[0].type==="TEXT"||n[0].type==="CDATA")?n[0].content:null},getAttribute:function(){var n;return arguments.length===2?(n=this.findAttribute(arguments[0]),n)?n.getValue():arguments[1]:arguments.length===1?(n=this.findAttribute(arguments[0]),n)?n.getValue():null:arguments.length===3?(n=this.findAttribute(arguments[0],arguments[1]),n)?n.getValue():arguments[2]:void 0},getStringAttribute:function(){return arguments.length===1?this.getAttribute(arguments[0]):arguments.length===2?this.getAttribute(arguments[0],arguments[1]):this.getAttribute(arguments[0],arguments[1],arguments[2])},getString:function(n){return this.getStringAttribute(n)},getFloatAttribute:function(){return arguments.length===1?parseFloat(this.getAttribute(arguments[0],0)):arguments.length===2?this.getAttribute(arguments[0],arguments[1]):this.getAttribute(arguments[0],arguments[1],arguments[2])},getFloat:function(n){return this.getFloatAttribute(n)},getIntAttribute:function(){return arguments.length===1?this.getAttribute(arguments[0],0):arguments.length===2?this.getAttribute(arguments[0],arguments[1]):this.getAttribute(arguments[0],arguments[1],arguments[2])},getInt:function(n){return this.getIntAttribute(n)},hasChildren:function(){return this.children.length>0},addChild:function(n){n!==null&&(n.parent=this,this.children.push(n))},insertChild:function(n,t){if(n){if(n.getLocalName()===null&&!this.hasChildren()){var i=this.children[this.children.length-1];if(i.getLocalName()===null){i.setContent(i.getContent()+n.getContent());return}}n.parent=this,this.children.splice(t,0,n)}},getChild:function(n){var i,r,t,u;if(typeof n=="number")return this.children[n];if(n.indexOf("/")!==-1)return this.getChildRecursive(n.split("/"),0);for(t=0,u=this.getChildCount();t<u;t++)if(i=this.getChild(t),r=i.getName(),r!==null&&r===n)return i;return null},getChildren:function(){var t,i,r,n,u;if(arguments.length===1){if(typeof arguments[0]=="number")return this.getChild(arguments[0]);if(arguments[0].indexOf("/")!==-1)return this.getChildrenRecursive(arguments[0].split("/"),0);for(t=[],n=0,u=this.getChildCount();n<u;n++)i=this.getChild(n),r=i.getName(),r!==null&&r===arguments[0]&&t.push(i);return t}return this.children},getChildCount:function(){return this.children.length},getChildRecursive:function(n,t){var r,u,f,i,e;if(t===n.length)return this;for(f=n[t],i=0,e=this.getChildCount();i<e;i++)if(r=this.getChild(i),u=r.getName(),u!==null&&u===f)return r.getChildRecursive(n,t+1);return null},getChildrenRecursive:function(n,t){var u,i,r;if(t===n.length-1)return this.getChildren(n[t]);for(u=this.getChildren(n[t]),i=[],r=0;r<u.length;r++)i=i.concat(u[r].getChildrenRecursive(n,t+1));return i},isLeaf:function(){return!this.hasChildren()},listChildren:function(){for(var t=[],n=0,i=this.children.length;n<i;n++)t.push(this.getChild(n).getName());return t},removeAttribute:function(n,t){this.namespace=t||"";for(var i=0,r=this.attributes.length;i<r;i++)if(this.attributes[i].getName()===n&&this.attributes[i].getNamespace()===this.namespace){this.attributes.splice(i,1);break}},removeChild:function(n){if(n)for(var t=0,i=this.children.length;t<i;t++)if(this.children[t].equals(n)){this.children.splice(t,1);break}},removeChildAtIndex:function(n){this.children.length>n&&this.children.splice(n,1)},findAttribute:function(n,t){this.namespace=t||"";for(var i=0,r=this.attributes.length;i<r;i++)if(this.attributes[i].getName()===n&&this.attributes[i].getNamespace()===this.namespace)return this.attributes[i];return null},setAttribute:function(){var n,i,t;arguments.length===3?(i=arguments[0].indexOf(":"),t=arguments[0].substring(i+1),n=this.findAttribute(t,arguments[1]),n?n.setValue(arguments[2]):(n=new ue(arguments[0],t,arguments[1],arguments[2],"CDATA"),this.attributes.push(n))):(n=this.findAttribute(arguments[0]),n?n.setValue(arguments[1]):(n=new ue(arguments[0],arguments[0],null,arguments[1],"CDATA"),this.attributes.push(n)))},setString:function(n,t){this.setAttribute(n,t)},setInt:function(n,t){this.setAttribute(n,t)},setFloat:function(n,t){this.setAttribute(n,t)},setContent:function(n){this.children.length>0&&u.debug("Tried to set content for XMLElement with children"),this.content=n},setName:function(){if(arguments.length===1)this.name=arguments[0],this.fullName=arguments[0],this.namespace=null;else{var n=arguments[0].indexOf(":");this.name=arguments[1]===null||n<0?arguments[0]:arguments[0].substring(n+1),this.fullName=arguments[0],this.namespace=arguments[1]}},getName:function(){return this.fullName},getLocalName:function(){return this.name},getAttributeCount:function(){return this.attributes.length},toString:function(){var t,n,i,r,u;if(this.type==="TEXT")return this.content;if(this.type==="CDATA")return this.cdata;for(t=this.fullName,n="<"+t,i=0;i<this.attributes.length;i++)u=this.attributes[i],n+=" "+u.getName()+'="'+u.getValue()+'"';if(this.children.length===0)n+=this.content===""?"/>":">"+this.content+"<\/"+t+">";else{for(n+=">",r=0;r<this.children.length;r++)n+=this.children[r].toString();n+="<\/"+t+">"}return n}},iu.parse=function(n){var t=new iu;return t.parse(n),t},oc=v.XML=v.XMLElement,v.loadXML=function(n){return new oc(v,n)},ps=function(n){for(var u=0,r,t=0;t<n.length;t++)u=t!==0?i.max(u,i.abs(n[t])):i.abs(n[t]);return r=(u+"").indexOf("."),r===0?r=1:r===-1&&(r=(u+"").length),r},br=v.PMatrix2D=function(){arguments.length===0?this.reset():arguments.length===1&&arguments[0]instanceof br?this.set(arguments[0].array()):arguments.length===6&&this.set(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},br.prototype={set:function(){if(arguments.length===6){var n=arguments;this.set([n[0],n[1],n[2],n[3],n[4],n[5]])}else arguments.length===1&&arguments[0]instanceof br?this.elements=arguments[0].array():arguments.length===1&&arguments[0]instanceof Array&&(this.elements=arguments[0].slice())},get:function(){var n=new br;return n.set(this.elements),n},reset:function(){this.set([1,0,0,0,1,0])},array:function(){return this.elements.slice()},translate:function(n,t){this.elements[2]=n*this.elements[0]+t*this.elements[1]+this.elements[2],this.elements[5]=n*this.elements[3]+t*this.elements[4]+this.elements[5]},invTranslate:function(n,t){this.translate(-n,-t)},transpose:function(){},mult:function(n,t){var i,r;return n instanceof h?(i=n.x,r=n.y,t||(t=new h)):n instanceof Array&&(i=n[0],r=n[1],t||(t=[])),t instanceof Array?(t[0]=this.elements[0]*i+this.elements[1]*r+this.elements[2],t[1]=this.elements[3]*i+this.elements[4]*r+this.elements[5]):t instanceof h&&(t.x=this.elements[0]*i+this.elements[1]*r+this.elements[2],t.y=this.elements[3]*i+this.elements[4]*r+this.elements[5],t.z=0),t},multX:function(n,t){return n*this.elements[0]+t*this.elements[1]+this.elements[2]},multY:function(n,t){return n*this.elements[3]+t*this.elements[4]+this.elements[5]},skewX:function(n){this.apply(1,0,1,n,0,0)},skewY:function(n){this.apply(1,0,1,0,n,0)},shearX:function(n){this.apply(1,0,1,i.tan(n),0,0)},shearY:function(n){this.apply(1,0,1,0,i.tan(n),0)},determinant:function(){return this.elements[0]*this.elements[4]-this.elements[1]*this.elements[3]},invert:function(){var n=this.determinant();if(i.abs(n)>-2147483648){var t=this.elements[0],r=this.elements[1],u=this.elements[2],f=this.elements[3],e=this.elements[4],o=this.elements[5];return this.elements[0]=e/n,this.elements[3]=-f/n,this.elements[1]=-r/n,this.elements[4]=t/n,this.elements[2]=(r*o-e*u)/n,this.elements[5]=(f*u-t*o)/n,!0}return!1},scale:function(n,t){n&&!t&&(t=n),n&&t&&(this.elements[0]*=n,this.elements[1]*=t,this.elements[3]*=n,this.elements[4]*=t)},invScale:function(n,t){n&&!t&&(t=n),this.scale(1/n,1/t)},apply:function(){var n,r,u,t,i;for(arguments.length===1&&arguments[0]instanceof br?n=arguments[0].array():arguments.length===6?n=Array.prototype.slice.call(arguments):arguments.length===1&&arguments[0]instanceof Array&&(n=arguments[0]),r=[0,0,this.elements[2],0,0,this.elements[5]],u=0,t=0;t<2;t++)for(i=0;i<3;i++,u++)r[u]+=this.elements[t*3+0]*n[i+0]+this.elements[t*3+1]*n[i+3];this.elements=r.slice()},preApply:function(){var n,t;arguments.length===1&&arguments[0]instanceof br?n=arguments[0].array():arguments.length===6?n=Array.prototype.slice.call(arguments):arguments.length===1&&arguments[0]instanceof Array&&(n=arguments[0]),t=[0,0,n[2],0,0,n[5]],t[2]=n[2]+this.elements[2]*n[0]+this.elements[5]*n[1],t[5]=n[5]+this.elements[2]*n[3]+this.elements[5]*n[4],t[0]=this.elements[0]*n[0]+this.elements[3]*n[1],t[3]=this.elements[0]*n[3]+this.elements[3]*n[4],t[1]=this.elements[1]*n[0]+this.elements[4]*n[1],t[4]=this.elements[1]*n[3]+this.elements[4]*n[4],this.elements=t.slice()},rotate:function(n){var u=i.cos(n),f=i.sin(n),t=this.elements[0],r=this.elements[1];this.elements[0]=u*t+f*r,this.elements[1]=-f*t+u*r,t=this.elements[3],r=this.elements[4],this.elements[3]=u*t+f*r,this.elements[4]=-f*t+u*r},rotateZ:function(n){this.rotate(n)},invRotateZ:function(n){this.rotateZ(n-i.PI)},print:function(){var n=ps(this.elements),t=""+v.nfs(this.elements[0],n,4)+" "+v.nfs(this.elements[1],n,4)+" "+v.nfs(this.elements[2],n,4)+"\n"+v.nfs(this.elements[3],n,4)+" "+v.nfs(this.elements[4],n,4)+" "+v.nfs(this.elements[5],n,4)+"\n\n";v.println(t)}},ut=v.PMatrix3D=function(){this.reset()},ut.prototype={set:function(){arguments.length===16?this.elements=Array.prototype.slice.call(arguments):arguments.length===1&&arguments[0]instanceof ut?this.elements=arguments[0].array():arguments.length===1&&arguments[0]instanceof Array&&(this.elements=arguments[0].slice())},get:function(){var n=new ut;return n.set(this.elements),n},reset:function(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},array:function(){return this.elements.slice()},translate:function(n,t,i){i===r&&(i=0),this.elements[3]+=n*this.elements[0]+t*this.elements[1]+i*this.elements[2],this.elements[7]+=n*this.elements[4]+t*this.elements[5]+i*this.elements[6],this.elements[11]+=n*this.elements[8]+t*this.elements[9]+i*this.elements[10],this.elements[15]+=n*this.elements[12]+t*this.elements[13]+i*this.elements[14]},transpose:function(){var n=this.elements[4];this.elements[4]=this.elements[1],this.elements[1]=n,n=this.elements[8],this.elements[8]=this.elements[2],this.elements[2]=n,n=this.elements[6],this.elements[6]=this.elements[9],this.elements[9]=n,n=this.elements[3],this.elements[3]=this.elements[12],this.elements[12]=n,n=this.elements[7],this.elements[7]=this.elements[13],this.elements[13]=n,n=this.elements[11],this.elements[11]=this.elements[14],this.elements[14]=n},mult:function(n,t){var i,r,u,f;return n instanceof h?(i=n.x,r=n.y,u=n.z,f=1,t||(t=new h)):n instanceof Array&&(i=n[0],r=n[1],u=n[2],f=n[3]||1,t&&(t.length===3||t.length===4)||(t=[0,0,0])),t instanceof Array&&(t.length===3?(t[0]=this.elements[0]*i+this.elements[1]*r+this.elements[2]*u+this.elements[3],t[1]=this.elements[4]*i+this.elements[5]*r+this.elements[6]*u+this.elements[7],t[2]=this.elements[8]*i+this.elements[9]*r+this.elements[10]*u+this.elements[11]):t.length===4&&(t[0]=this.elements[0]*i+this.elements[1]*r+this.elements[2]*u+this.elements[3]*f,t[1]=this.elements[4]*i+this.elements[5]*r+this.elements[6]*u+this.elements[7]*f,t[2]=this.elements[8]*i+this.elements[9]*r+this.elements[10]*u+this.elements[11]*f,t[3]=this.elements[12]*i+this.elements[13]*r+this.elements[14]*u+this.elements[15]*f)),t instanceof h&&(t.x=this.elements[0]*i+this.elements[1]*r+this.elements[2]*u+this.elements[3],t.y=this.elements[4]*i+this.elements[5]*r+this.elements[6]*u+this.elements[7],t.z=this.elements[8]*i+this.elements[9]*r+this.elements[10]*u+this.elements[11]),t},preApply:function(){var n,r,u,t,i;for(arguments.length===1&&arguments[0]instanceof ut?n=arguments[0].array():arguments.length===16?n=Array.prototype.slice.call(arguments):arguments.length===1&&arguments[0]instanceof Array&&(n=arguments[0]),r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0,t=0;t<4;t++)for(i=0;i<4;i++,u++)r[u]+=this.elements[i+0]*n[t*4+0]+this.elements[i+4]*n[t*4+1]+this.elements[i+8]*n[t*4+2]+this.elements[i+12]*n[t*4+3];this.elements=r.slice()},apply:function(){var n,r,u,t,i;for(arguments.length===1&&arguments[0]instanceof ut?n=arguments[0].array():arguments.length===16?n=Array.prototype.slice.call(arguments):arguments.length===1&&arguments[0]instanceof Array&&(n=arguments[0]),r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0,t=0;t<4;t++)for(i=0;i<4;i++,u++)r[u]+=this.elements[t*4+0]*n[i+0]+this.elements[t*4+1]*n[i+4]+this.elements[t*4+2]*n[i+8]+this.elements[t*4+3]*n[i+12];this.elements=r.slice()},rotate:function(n,t,i,r){if(i){var e=v.cos(n),f=v.sin(n),u=1-e;this.apply(u*t*t+e,u*t*i-f*r,u*t*r+f*i,0,u*t*i+f*r,u*i*i+e,u*i*r-f*t,0,u*t*r-f*i,u*i*r+f*t,u*r*r+e,0,0,0,0,1)}else this.rotateZ(n)},invApply:function(){ie===r&&(ie=new ut);var n=arguments;return(ie.set(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15]),!ie.invert())?!1:(this.preApply(ie),!0)},rotateX:function(n){var t=v.cos(n),i=v.sin(n);this.apply([1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1])},rotateY:function(n){var t=v.cos(n),i=v.sin(n);this.apply([t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1])},rotateZ:function(n){var t=i.cos(n),r=i.sin(n);this.apply([t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1])},scale:function(n,t,i){!n||t||i?n&&t&&!i&&(i=1):t=i=n,n&&t&&i&&(this.elements[0]*=n,this.elements[1]*=t,this.elements[2]*=i,this.elements[4]*=n,this.elements[5]*=t,this.elements[6]*=i,this.elements[8]*=n,this.elements[9]*=t,this.elements[10]*=i,this.elements[12]*=n,this.elements[13]*=t,this.elements[14]*=i)},skewX:function(n){var t=i.tan(n);this.apply(1,t,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},skewY:function(n){var t=i.tan(n);this.apply(1,0,0,0,t,1,0,0,0,0,1,0,0,0,0,1)},shearX:function(n){var t=i.tan(n);this.apply(1,t,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},shearY:function(n){var t=i.tan(n);this.apply(1,0,0,0,t,1,0,0,0,0,1,0,0,0,0,1)},multX:function(n,t,i,r){return i?r?this.elements[0]*n+this.elements[1]*t+this.elements[2]*i+this.elements[3]*r:this.elements[0]*n+this.elements[1]*t+this.elements[2]*i+this.elements[3]:this.elements[0]*n+this.elements[1]*t+this.elements[3]},multY:function(n,t,i,r){return i?r?this.elements[4]*n+this.elements[5]*t+this.elements[6]*i+this.elements[7]*r:this.elements[4]*n+this.elements[5]*t+this.elements[6]*i+this.elements[7]:this.elements[4]*n+this.elements[5]*t+this.elements[7]},multZ:function(n,t,i,r){return r?this.elements[8]*n+this.elements[9]*t+this.elements[10]*i+this.elements[11]*r:this.elements[8]*n+this.elements[9]*t+this.elements[10]*i+this.elements[11]},multW:function(n,t,i,r){return r?this.elements[12]*n+this.elements[13]*t+this.elements[14]*i+this.elements[15]*r:this.elements[12]*n+this.elements[13]*t+this.elements[14]*i+this.elements[15]},invert:function(){var r=this.elements[0]*this.elements[5]-this.elements[1]*this.elements[4],u=this.elements[0]*this.elements[6]-this.elements[2]*this.elements[4],f=this.elements[0]*this.elements[7]-this.elements[3]*this.elements[4],e=this.elements[1]*this.elements[6]-this.elements[2]*this.elements[5],o=this.elements[1]*this.elements[7]-this.elements[3]*this.elements[5],s=this.elements[2]*this.elements[7]-this.elements[3]*this.elements[6],h=this.elements[8]*this.elements[13]-this.elements[9]*this.elements[12],c=this.elements[8]*this.elements[14]-this.elements[10]*this.elements[12],l=this.elements[8]*this.elements[15]-this.elements[11]*this.elements[12],a=this.elements[9]*this.elements[14]-this.elements[10]*this.elements[13],v=this.elements[9]*this.elements[15]-this.elements[11]*this.elements[13],y=this.elements[10]*this.elements[15]-this.elements[11]*this.elements[14],p=r*y-u*v+f*a+e*l-o*c+s*h,n,t;return i.abs(p)<=1e-9?!1:(n=[],n[0]=+this.elements[5]*y-this.elements[6]*v+this.elements[7]*a,n[4]=-this.elements[4]*y+this.elements[6]*l-this.elements[7]*c,n[8]=+this.elements[4]*v-this.elements[5]*l+this.elements[7]*h,n[12]=-this.elements[4]*a+this.elements[5]*c-this.elements[6]*h,n[1]=-this.elements[1]*y+this.elements[2]*v-this.elements[3]*a,n[5]=+this.elements[0]*y-this.elements[2]*l+this.elements[3]*c,n[9]=-this.elements[0]*v+this.elements[1]*l-this.elements[3]*h,n[13]=+this.elements[0]*a-this.elements[1]*c+this.elements[2]*h,n[2]=+this.elements[13]*s-this.elements[14]*o+this.elements[15]*e,n[6]=-this.elements[12]*s+this.elements[14]*f-this.elements[15]*u,n[10]=+this.elements[12]*o-this.elements[13]*f+this.elements[15]*r,n[14]=-this.elements[12]*e+this.elements[13]*u-this.elements[14]*r,n[3]=-this.elements[9]*s+this.elements[10]*o-this.elements[11]*e,n[7]=+this.elements[8]*s-this.elements[10]*f+this.elements[11]*u,n[11]=-this.elements[8]*o+this.elements[9]*f-this.elements[11]*r,n[15]=+this.elements[8]*e-this.elements[9]*u+this.elements[10]*r,t=1/p,n[0]*=t,n[1]*=t,n[2]*=t,n[3]*=t,n[4]*=t,n[5]*=t,n[6]*=t,n[7]*=t,n[8]*=t,n[9]*=t,n[10]*=t,n[11]*=t,n[12]*=t,n[13]*=t,n[14]*=t,n[15]*=t,this.elements=n.slice(),!0)},toString:function(){for(var t="",n=0;n<15;n++)t+=this.elements[n]+", ";return t+=this.elements[15]},print:function(){var n=ps(this.elements),t=""+v.nfs(this.elements[0],n,4)+" "+v.nfs(this.elements[1],n,4)+" "+v.nfs(this.elements[2],n,4)+" "+v.nfs(this.elements[3],n,4)+"\n"+v.nfs(this.elements[4],n,4)+" "+v.nfs(this.elements[5],n,4)+" "+v.nfs(this.elements[6],n,4)+" "+v.nfs(this.elements[7],n,4)+"\n"+v.nfs(this.elements[8],n,4)+" "+v.nfs(this.elements[9],n,4)+" "+v.nfs(this.elements[10],n,4)+" "+v.nfs(this.elements[11],n,4)+"\n"+v.nfs(this.elements[12],n,4)+" "+v.nfs(this.elements[13],n,4)+" "+v.nfs(this.elements[14],n,4)+" "+v.nfs(this.elements[15],n,4)+"\n\n";v.println(t)},invTranslate:function(n,t,i){this.preApply(1,0,0,-n,0,1,0,-t,0,0,1,-i,0,0,0,1)},invRotateX:function(n){var t=i.cos(-n),r=i.sin(-n);this.preApply([1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1])},invRotateY:function(n){var t=i.cos(-n),r=i.sin(-n);this.preApply([t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1])},invRotateZ:function(n){var t=i.cos(-n),r=i.sin(-n);this.preApply([t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1])},invScale:function(n,t,i){this.preApply([1/n,0,0,0,0,1/t,0,0,0,0,1/i,0,0,0,0,1])}},kr=v.PMatrixStack=function(){this.matrixStack=[]},kr.prototype.load=function(){var n=ei.$newPMatrix();arguments.length===1?n.set(arguments[0]):n.set(arguments),this.matrixStack.push(n)},tt.prototype.$newPMatrix=function(){return new br},rt.prototype.$newPMatrix=function(){return new ut},kr.prototype.push=function(){this.matrixStack.push(this.peek())},kr.prototype.pop=function(){return this.matrixStack.pop()},kr.prototype.peek=function(){var n=ei.$newPMatrix();return n.set(this.matrixStack[this.matrixStack.length-1]),n},kr.prototype.mult=function(n){this.matrixStack[this.matrixStack.length-1].apply(n)},v.split=function(n,t){return n.split(t)},v.splitTokens=function(n,t){if(t===r)return n.split(/\s+/g);for(var o=t.split(/()/g),i="",s=n.length,f,e=[],u=0;u<s;u++)f=n[u],o.indexOf(f)>-1?(i!==""&&e.push(i),i=""):i+=f;return i!==""&&e.push(i),e},v.append=function(n,t){return n[n.length]=t,n},v.concat=function(n,t){return n.concat(t)},v.sort=function(n,t){var i=[],f,r,u;if(n.length>0){for(f=t>0?t:n.length,r=0;r<f;r++)i.push(n[r]);if(typeof n[0]=="string"?i.sort():i.sort(function(n,t){return n-t}),t>0)for(u=i.length;u<n.length;u++)i.push(n[u])}return i},v.splice=function(n,t,i){if(t.length===0)return n;if(t instanceof Array)for(var r=0,u=i;r<t.length;u++,r++)n.splice(u,0,t[r]);else n.splice(i,0,t);return n},v.subset=function(n,t,i){var u=i!==r?t+i:n.length;return n.slice(t,u)},v.join=function(n,t){return n.join(t)},v.shorten=function(n){for(var i=[],r=n.length,t=0;t<r;t++)i[t]=n[t];return i.pop(),i},v.expand=function(n,t){var i=n.slice(0),r=t||n.length*2;return i.length=r,i},v.arrayCopy=function(){var n,e=0,t,o=0,i,u,f;for(arguments.length===2?(n=arguments[0],t=arguments[1],i=n.length):arguments.length===3?(n=arguments[0],t=arguments[1],i=arguments[2]):arguments.length===5&&(n=arguments[0],e=arguments[1],t=arguments[2],o=arguments[3],i=arguments[4]),u=e,f=o;u<i+e;u++,f++)if(t[f]!==r)t[f]=n[u];else throw"array index out of bounds exception";},v.reverse=function(n){return n.reverse()},v.mix=function(n,t,i){return n+((t-n)*i>>8)},v.peg=function(n){return n<0?0:n>255?255:n},v.modes=function(){function e(n,t,i,r,u,e,o,s,h,c,l){var p=f(((n&4278190080)>>>24)+t,255)<<24,y=i+((h-i)*t>>8),a,v;return y=(y<0?0:y>255?255:y)<<16,a=r+((c-r)*t>>8),a=(a<0?0:a>255?255:a)<<8,v=u+((l-u)*t>>8),v=v<0?0:v>255?255:v,p|y|a|v}var u=4278190080,t=16711680,n=65280,r=255,f=i.min,o=i.max;return{replace:function(n,t){return t},blend:function(i,e){var o=(e&u)>>>24,s=i&t,h=i&n,c=i&r,l=e&t,a=e&n,v=e&r;return f(((i&u)>>>24)+o,255)<<24|s+((l-s)*o>>8)&t|h+((a-h)*o>>8)&n|c+((v-c)*o>>8)&r},add:function(i,e){var o=(e&u)>>>24;return f(((i&u)>>>24)+o,255)<<24|f((i&t)+((e&t)>>8)*o,t)&t|f((i&n)+((e&n)>>8)*o,n)&n|f((i&r)+((e&r)*o>>8),r)},subtract:function(i,e){var s=(e&u)>>>24;return f(((i&u)>>>24)+s,255)<<24|o((i&t)-((e&t)>>8)*s,n)&t|o((i&n)-((e&n)>>8)*s,r)&n|o((i&r)-((e&r)*s>>8),0)},lightest:function(i,e){var s=(e&u)>>>24;return f(((i&u)>>>24)+s,255)<<24|o(i&t,((e&t)>>8)*s)&t|o(i&n,((e&n)>>8)*s)&n|o(i&r,(e&r)*s>>8)},darkest:function(i,e){var o=(e&u)>>>24,s=i&t,h=i&n,c=i&r,l=f(i&t,((e&t)>>8)*o),a=f(i&n,((e&n)>>8)*o),v=f(i&r,(e&r)*o>>8);return f(((i&u)>>>24)+o,255)<<24|s+((l-s)*o>>8)&t|h+((a-h)*o>>8)&n|c+((v-c)*o>>8)&r},difference:function(i,f){var v=(f&u)>>>24,o=(i&t)>>16,s=(i&n)>>8,h=i&r,c=(f&t)>>16,l=(f&n)>>8,a=f&r,y=o>c?o-c:c-o,p=s>l?s-l:l-s,w=h>a?h-a:a-h;return e(i,v,o,s,h,c,l,a,y,p,w)},exclusion:function(i,f){var v=(f&u)>>>24,o=(i&t)>>16,s=(i&n)>>8,h=i&r,c=(f&t)>>16,l=(f&n)>>8,a=f&r,y=o+c-(o*c>>7),p=s+l-(s*l>>7),w=h+a-(h*a>>7);return e(i,v,o,s,h,c,l,a,y,p,w)},multiply:function(i,f){var v=(f&u)>>>24,o=(i&t)>>16,s=(i&n)>>8,h=i&r,c=(f&t)>>16,l=(f&n)>>8,a=f&r,y=o*c>>8,p=s*l>>8,w=h*a>>8;return e(i,v,o,s,h,c,l,a,y,p,w)},screen:function(i,f){var v=(f&u)>>>24,o=(i&t)>>16,s=(i&n)>>8,h=i&r,c=(f&t)>>16,l=(f&n)>>8,a=f&r,y=255-((255-o)*(255-c)>>8),p=255-((255-s)*(255-l)>>8),w=255-((255-h)*(255-a)>>8);return e(i,v,o,s,h,c,l,a,y,p,w)},hard_light:function(i,f){var v=(f&u)>>>24,c=(i&t)>>16,l=(i&n)>>8,a=i&r,o=(f&t)>>16,s=(f&n)>>8,h=f&r,y=o<128?c*o>>7:255-((255-c)*(255-o)>>7),p=s<128?l*s>>7:255-((255-l)*(255-s)>>7),w=h<128?a*h>>7:255-((255-a)*(255-h)>>7);return e(i,v,c,l,a,o,s,h,y,p,w)},soft_light:function(i,f){var v=(f&u)>>>24,o=(i&t)>>16,s=(i&n)>>8,h=i&r,c=(f&t)>>16,l=(f&n)>>8,a=f&r,y=(o*c>>7)+(o*o>>8)-(o*o*c>>15),p=(s*l>>7)+(s*s>>8)-(s*s*l>>15),w=(h*a>>7)+(h*h>>8)-(h*h*a>>15);return e(i,v,o,s,h,c,l,a,y,p,w)},overlay:function(i,f){var v=(f&u)>>>24,o=(i&t)>>16,s=(i&n)>>8,h=i&r,c=(f&t)>>16,l=(f&n)>>8,a=f&r,y=o<128?o*c>>7:255-((255-o)*(255-c)>>7),p=s<128?s*l>>7:255-((255-s)*(255-l)>>7),w=h<128?h*a>>7:255-((255-h)*(255-a)>>7);return e(i,v,o,s,h,c,l,a,y,p,w)},dodge:function(i,f){var w=(f&u)>>>24,v=(i&t)>>16,y=(i&n)>>8,p=i&r,c=(f&t)>>16,l=(f&n)>>8,a=f&r,h=255,o,s;return c!==255&&(h=(v<<8)/(255-c),h=h<0?0:h>255?255:h),o=255,l!==255&&(o=(y<<8)/(255-l),o=o<0?0:o>255?255:o),s=255,a!==255&&(s=(p<<8)/(255-a),s=s<0?0:s>255?255:s),e(i,w,v,y,p,c,l,a,h,o,s)},burn:function(i,f){var w=(f&u)>>>24,v=(i&t)>>16,y=(i&n)>>8,p=i&r,c=(f&t)>>16,l=(f&n)>>8,a=f&r,h=0,o,s;return c!==0&&(h=(255-v<<8)/c,h=255-(h<0?0:h>255?255:h)),o=0,l!==0&&(o=(255-y<<8)/l,o=255-(o<0?0:o>255?255:o)),s=0,a!==0&&(s=(255-p<<8)/a,s=255-(s<0?0:s>255?255:s)),e(i,w,v,y,p,c,l,a,h,o,s)}}}(),v.color=function(n,t,i,u){return n!==r&&t!==r&&i!==r&&u!==r?ir(n,t,i,u):n!==r&&t!==r&&i!==r?ir(n,t,i,oi):n!==r&&t!==r?ra(n,t):typeof n=="number"?ua(n):ir(bi,er,ki,oi)},v.color.toString=function(n){return"rgba("+(n>>16&255)+","+(n>>8&255)+","+(n&255)+","+(n>>24&255)/255+")"},v.color.toInt=function(n,t,i,r){return r<<24&4278190080|n<<16&16711680|t<<8&65280|i&255},v.color.toArray=function(n){return[n>>16&255,n>>8&255,n&255,n>>24&255]},v.color.toGLArray=function(n){return[((n&16711680)>>>16)/255,(n>>8&255)/255,(n&255)/255,(n>>24&255)/255]},v.color.toRGB=function(n,t,r){var u;if(n=n>bi?bi:n,t=t>er?er:t,r=r>ki?ki:r,n=n/bi*360,t=t/er*100,r=r/ki*100,u=i.round(r/100*255),t===0)return[u,u,u];var s=n%360,h=s%60,f=i.round(r*(100-t)/1e4*255),e=i.round(r*(6e3-t*h)/6e5*255),o=i.round(r*(6e3-t*(60-h))/6e5*255);switch(i.floor(s/60)){case 0:return[u,o,f];case 1:return[e,u,f];case 2:return[f,u,o];case 3:return[f,e,u];case 4:return[o,f,u];case 5:return[u,f,e]}},v.brightness=function(n){return fe(n)[2]},v.saturation=function(n){return fe(n)[1]},v.hue=function(n){return fe(n)[0]},v.red=function(n){return(n>>16&255)/255*bi},v.green=function(n){return((n&65280)>>>8)/255*er},v.blue=function(n){return(n&255)/255*ki},v.alpha=function(n){return(n>>24&255)/255*oi},v.lerpColor=function(n,t,i){var a,y,f,e,p,w,b,o,k,d,g,s,h,c,l,nt,tt,r=v.color(n),u=v.color(t);return gr===3?(h=fe(r),o=(r>>24&255)/oi,c=fe(u),s=((u&4278190080)>>>24)/oi,nt=v.lerp(h[0],c[0],i),tt=v.lerp(h[1],c[1],i),f=v.lerp(h[2],c[2],i),l=v.color.toRGB(nt,tt,f),e=v.lerp(o,s,i)*oi,e<<24&4278190080|(l[0]&255)<<16|(l[1]&255)<<8|l[2]&255):(p=r>>16&255,w=r>>8&255,b=r&255,o=(r>>24&255)/oi,k=(u&16711680)>>>16,d=u>>8&255,g=u&255,s=(u>>24&255)/oi,a=v.lerp(p,k,i)|0,y=v.lerp(w,d,i)|0,f=v.lerp(b,g,i)|0,e=v.lerp(o,s,i)*oi,e<<24&4278190080|a<<16&16711680|y<<8&65280|f&255)},v.colorMode=function(){gr=arguments[0],arguments.length>1&&(bi=arguments[1],er=arguments[2]||arguments[1],ki=arguments[3]||arguments[1],oi=arguments[4]||arguments[1])},v.blendColor=function(n,t,i){return i===0?v.modes.replace(n,t):i===1?v.modes.blend(n,t):i===2?v.modes.add(n,t):i===4?v.modes.subtract(n,t):i===8?v.modes.lightest(n,t):i===16?v.modes.darkest(n,t):i===32?v.modes.difference(n,t):i===64?v.modes.exclusion(n,t):i===128?v.modes.multiply(n,t):i===256?v.modes.screen(n,t):i===1024?v.modes.hard_light(n,t):i===2048?v.modes.soft_light(n,t):i===512?v.modes.overlay(n,t):i===4096?v.modes.dodge(n,t):i===8192?v.modes.burn(n,t):void 0},v.printMatrix=function(){ht.print()},tt.prototype.translate=function(n,t){ht.translate(n,t),ui.invTranslate(n,t),y.translate(n,t)},rt.prototype.translate=function(n,t,i){ht.translate(n,t,i),ui.invTranslate(n,t,i)},tt.prototype.scale=function(n,t){ht.scale(n,t),ui.invScale(n,t),y.scale(n,t||n)},rt.prototype.scale=function(n,t,i){ht.scale(n,t,i),ui.invScale(n,t,i)},tt.prototype.transform=function(n){var t=n.array();y.transform(t[0],t[3],t[1],t[4],t[2],t[5])},rt.prototype.transformm=function(){throw"p.transform is currently not supported in 3D mode";},tt.prototype.pushMatrix=function(){of.load(ht),sf.load(ui),du()},rt.prototype.pushMatrix=function(){of.load(ht),sf.load(ui)},tt.prototype.popMatrix=function(){ht.set(of.pop()),ui.set(sf.pop()),gu()},rt.prototype.popMatrix=function(){ht.set(of.pop()),ui.set(sf.pop())},tt.prototype.resetMatrix=function(){ht.reset(),ui.reset(),y.setTransform(1,0,0,1,0,0)},rt.prototype.resetMatrix=function(){ht.reset(),ui.reset()},bt.prototype.applyMatrix=function(){var n=arguments;ht.apply(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15]),ui.invApply(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15])},tt.prototype.applyMatrix=function(){for(var n=arguments,t=n.length;t<16;t++)n[t]=0;n[10]=n[15]=1,bt.prototype.applyMatrix.apply(this,n)},v.rotateX=function(n){ht.rotateX(n),ui.invRotateX(n)},tt.prototype.rotateZ=function(){throw"rotateZ() is not supported in 2D mode. Use rotate(float) instead.";},rt.prototype.rotateZ=function(n){ht.rotateZ(n),ui.invRotateZ(n)},v.rotateY=function(n){ht.rotateY(n),ui.invRotateY(n)},tt.prototype.rotate=function(n){ht.rotateZ(n),ui.invRotateZ(n),y.rotate(n)},rt.prototype.rotate=function(n){v.rotateZ(n)},tt.prototype.shearX=function(n){ht.shearX(n),y.transform(1,0,n,1,0,0)},rt.prototype.shearX=function(n){ht.shearX(n)},tt.prototype.shearY=function(n){ht.shearY(n),y.transform(1,n,0,1,0,0)},rt.prototype.shearY=function(n){ht.shearY(n)},v.pushStyle=function(){du(),v.pushMatrix();var n={doFill:wt,currentFillColor:fu,doStroke:lt,currentStrokeColor:ou,curTint:hu,curRectMode:fr,curColorMode:gr,colorModeX:bi,colorModeZ:ki,colorModeY:er,colorModeA:oi,curTextFont:ti,horizontalTextAlignment:vu,verticalTextAlignment:nu,textMode:no,curFontName:ff,curTextSize:lr,curTextAscent:tu,curTextDescent:ar,curTextLeading:tr};rc.push(n)},v.popStyle=function(){var n=rc.pop();if(n)gu(),v.popMatrix(),wt=n.doFill,fu=n.currentFillColor,lt=n.doStroke,ou=n.currentStrokeColor,hu=n.curTint,fr=n.curRectMode,gr=n.curColorMode,bi=n.colorModeX,ki=n.colorModeZ,er=n.colorModeY,oi=n.colorModeA,ti=n.curTextFont,ff=n.curFontName,lr=n.curTextSize,vu=n.horizontalTextAlignment,nu=n.verticalTextAlignment,no=n.textMode,tu=n.curTextAscent,ar=n.curTextDescent,tr=n.curTextLeading;else throw"Too many popStyle() without enough pushStyle()";},v.year=function(){return(new Date).getFullYear()},v.month=function(){return(new Date).getMonth()+1},v.day=function(){return(new Date).getDate()},v.hour=function(){return(new Date).getHours()},v.minute=function(){return(new Date).getMinutes()},v.second=function(){return(new Date).getSeconds()},v.millis=function(){return Date.now()-eh},tt.prototype.redraw=function(){sc(),y.lineWidth=si;var n=v.pmouseX,t=v.pmouseY;v.pmouseX=pe,v.pmouseY=we,du(),v.draw(),gu(),pe=v.mouseX,we=v.mouseY,v.pmouseX=n,v.pmouseY=t},rt.prototype.redraw=function(){sc();var n=v.pmouseX,t=v.pmouseY;v.pmouseX=pe,v.pmouseY=we,y.clear(y.DEPTH_BUFFER_BIT),or={attributes:{},locations:{}},v.noLights(),v.lightFalloff(1,0,0),v.shininess(1),v.ambient(255,255,255),v.specular(0,0,0),v.emissive(0,0,0),v.camera(),v.draw(),pe=v.mouseX,we=v.mouseY,v.pmouseX=n,v.pmouseY=t},v.noLoop=function(){lu=!1,le=!1,clearInterval(ae),ii.onPause()},v.loop=function(){le||(ko=Date.now(),be=0,ae=n.setInterval(function(){try{ii.onFrameStart(),v.redraw(),ii.onFrameEnd()}catch(t){n.clearInterval(ae);throw t;}},uh),lu=!0,le=!0,ii.onLoop())},v.frameRate=function(n){vo=n,uh=1e3/vo,lu&&(v.noLoop(),v.loop())},nf=[],v.exit=function(){var t,i;n.clearInterval(ae),at(v.externals.canvas.id),delete d.onmousedown;for(t in u.lib)u.lib.hasOwnProperty(t)&&u.lib[t].hasOwnProperty("detach")&&u.lib[t].detach(v);for(i=nf.length;i--;)ws(nf[i]);ii.onExit()},v.cursor=function(){var n,t,i,r,u,f;if(arguments.length>1||arguments.length===1&&arguments[0]instanceof v.PImage){if(n=arguments[0],arguments.length>=3){if(t=arguments[1],i=arguments[2],t<0||i<0||i>=n.height||t>=n.width)throw"x and y must be non-negative and less than the dimensions of the image";}else t=n.width>>>1,i=n.height>>>1;r=n.toDataURL(),u='url("'+r+'") '+t+" "+i+", default",ye=d.style.cursor=u}else arguments.length===1?(f=arguments[0],ye=d.style.cursor=f):ye=d.style.cursor=cl},v.noCursor=function(){ye=d.style.cursor=p.NOCURSOR},v.link=function(t,i){i!==r?n.open(t,i):n.location=t},v.beginDraw=s,v.endDraw=s,tt.prototype.toImageData=function(n,t,i,u){return n=n!==r?n:0,t=t!==r?t:0,i=i!==r?i:v.width,u=u!==r?u:v.height,y.getImageData(n,t,i,u)},rt.prototype.toImageData=function(n,u,f,e){n=n!==r?n:0,u=u!==r?u:0,f=f!==r?f:v.width,e=e!==r?e:v.height;var c=t.createElement("canvas"),l=c.getContext("2d"),h=l.createImageData(f,e),s=new it(f*e*4);y.readPixels(n,u,f,e,y.RGBA,y.UNSIGNED_BYTE,s);for(var o=0,a=s.length,p=h.data;o<a;o++)p[o]=s[(e-1-i.floor(o/4/f))*f*4+o%(f*4)];return h},v.status=function(t){n.status=t},v.binary=function(n,t){var i,r;if(t>0)i=t;else if(n instanceof yi)i=16,n|=0;else for(i=32;i>1&&!(n>>>i-1&1);)i--;for(r="";i>0;)r+=n>>>--i&1?"1":"0";return r},v.unbinary=function(n){for(var i=n.length-1,r=1,u=0,t;i>=0;){if(t=n[i--],t!=="0"&&t!=="1")throw"the value passed into unbinary was not an 8 bit binary number";t==="1"&&(u+=r),r<<=1}return u},v.nf=function(n,t,i){return fo(n,"","-",t,i)},v.nfs=function(n,t,i){return fo(n," ","-",t,i)},v.nfp=function(n,t,i){return fo(n,"+","-",t,i)},v.nfc=function(n,t,i){return fo(n,"","-",t,i,",")},cc=function(n,t){t=t===r||t===null?t=8:t,n<0&&(n=4294967295+n+1);for(var i=Number(n).toString(16).toUpperCase();i.length<t;)i="0"+i;return i.length>=t&&(i=i.substring(i.length-t,i.length)),i},v.hex=function(n,t){return arguments.length===1&&(t=n instanceof yi?4:8),cc(n,t)},v.unhex=function(n){var i,t;if(n instanceof Array){for(i=[],t=0;t<n.length;t++)i.push(lc(n[t]));return i}return lc(n)},v.loadStrings=function(n){if(localStorage[n])return localStorage[n].split("\n");var t=k(n);return typeof t!="string"||t===""?[]:(t=t.replace(/(\r\n?)/g,"\n").replace(/\n$/,""),t.split("\n"))},v.saveStrings=function(n,t){localStorage[n]=t.join("\n")},v.loadBytes=function(n){for(var i=k(n),r=[],t=0;t<i.length;t++)r.push(i.charCodeAt(t));return r},v.matchAll=function(n,t){for(var i=[],r,u=new RegExp(t,"g");(r=u.exec(n))!==null;)i.push(r),r[0].length===0&&++u.lastIndex;return i.length>0?i:null},v.__contains=function(n,t){return typeof n!="string"?n.contains.apply(n,hr(arguments)):n!==null&&t!==null&&typeof t=="string"&&n.indexOf(t)>-1},v.__replaceAll=function(n,t,i){return typeof n!="string"?n.replaceAll.apply(n,hr(arguments)):n.replace(new RegExp(t,"g"),i)},v.__replaceFirst=function(n,t,i){return typeof n!="string"?n.replaceFirst.apply(n,hr(arguments)):n.replace(new RegExp(t,""),i)},v.__replace=function(n,t,i){var r,u,f;if(typeof n!="string")return n.replace.apply(n,hr(arguments));if(t instanceof RegExp)return n.replace(t,i);if((typeof t!="string"&&(t=t.toString()),t==="")||(r=n.indexOf(t),r<0))return n;u=0,f="";do f+=n.substring(u,r)+i,u=r+t.length;while((r=n.indexOf(t,u))>=0);return f+n.substring(u)},v.__equals=function(n,t){return n.equals instanceof Function?n.equals.apply(n,hr(arguments)):n.valueOf()===t.valueOf()},v.__equalsIgnoreCase=function(n,t){return typeof n!="string"?n.equalsIgnoreCase.apply(n,hr(arguments)):n.toLowerCase()===t.toLowerCase()},v.__toCharArray=function(n){var i,t,r;if(typeof n!="string")return n.toCharArray.apply(n,hr(arguments));for(i=[],t=0,r=n.length;t<r;++t)i[t]=new yi(n.charAt(t));return i},v.__split=function(n,t,i){var e,f,u,o,s;if(typeof n!="string")return n.split.apply(n,hr(arguments));if(e=new RegExp(t),i===r||i<1)return n.split(e);for(f=[],u=n;(o=u.search(e))!==-1&&f.length<i-1;)s=e.exec(u).toString(),f.push(u.substring(0,o)),u=u.substring(o+s.length);return(o!==-1||u!=="")&&f.push(u),f},v.__codePointAt=function(n,t){var i=n.charCodeAt(t),r,u;return 55296<=i&&i<=56319?(r=i,u=n.charCodeAt(t+1),(r-55296)*1024+(u-56320)+65536):i},v.match=function(n,t){return n.match(t)},v.__matches=function(n,t){return new RegExp(t).test(n)},v.__startsWith=function(n,t,i){return typeof n!="string"?n.startsWith.apply(n,hr(arguments)):(i=i||0,i<0||i>n.length)?!1:t===""||t===n?!0:n.indexOf(t)===i},v.__endsWith=function(n,t){if(typeof n!="string")return n.endsWith.apply(n,hr(arguments));var i=t?t.length:0;return t===""||t===n?!0:n.indexOf(t)===n.length-i},v.__hashCode=function(n){return n.hashCode instanceof Function?n.hashCode.apply(n,hr(arguments)):g(n)},v.__printStackTrace=function(n){v.println("Exception: "+n.toString())},ee=[],v.println=function(n){var t=ee.length;t&&(u.logger.log(ee.join("")),ee.length=0),arguments.length===0&&t===0?u.logger.log(""):arguments.length!==0&&u.logger.log(n)},v.print=function(n){ee.push(n)},v.str=function(n){var i,t;if(n instanceof Array){for(i=[],t=0;t<n.length;t++)i.push(n[t].toString()+"");return i}return n.toString()+""},v.trim=function(n){var i,t;if(n instanceof Array){for(i=[],t=0;t<n.length;t++)i.push(n[t].replace(/^\s*/,"").replace(/\s*$/,"").replace(/\r*$/,""));return i}return n.replace(/^\s*/,"").replace(/\s*$/,"").replace(/\r*$/,"")},v.parseBoolean=function(n){var i,t;if(n instanceof Array){for(i=[],t=0;t<n.length;t++)i.push(ac(n[t]));return i}return ac(n)},v.parseByte=function(n){var i,t;if(n instanceof Array){for(i=[],t=0;t<n.length;t++)i.push(0-(n[t]&128)|n[t]&127);return i}return 0-(n&128)|n&127},v.parseChar=function(n){var i,t;if(typeof n=="number")return new yi(String.fromCharCode(n&65535));if(n instanceof Array){for(i=[],t=0;t<n.length;t++)i.push(new yi(String.fromCharCode(n[t]&65535)));return i}throw"char() may receive only one argument of type int, byte, int[], or byte[].";},v.parseFloat=function(n){var i,t;if(n instanceof Array){for(i=[],t=0;t<n.length;t++)i.push(vc(n[t]));return i}return vc(n)},v.parseInt=function(n,t){var r,i;if(n instanceof Array){for(r=[],i=0;i<n.length;i++)typeof n[i]!="string"||/^\s*[+\-]?\d+\s*$/.test(n[i])?r.push(yc(n[i],t)):r.push(0);return r}return yc(n,t)},v.__int_cast=function(n){return 0|n},v.__instanceof=function(n,t){var i,r,u;if(typeof t!="function")throw"Function is expected as type argument for instanceof operator";if(typeof n=="string")return t===Object||t===String;if(n instanceof t)return!0;if(typeof n!="object"||n===null)return!1;if(i=n.constructor,t.$isInterface){for(r=[];i;)i.$interfaces&&(r=r.concat(i.$interfaces)),i=i.$base;while(r.length>0){if(u=r.shift(),u===t)return!0;u.$interfaces&&(r=r.concat(u.$interfaces))}return!1}while(i.hasOwnProperty("$base"))if(i=i.$base,i===t)return!0;return!1},v.abs=i.abs,v.ceil=i.ceil,v.constrain=function(n,t,i){return n>i?i:n<t?t:n},v.dist=function(){var n,t,r;return arguments.length===4?(n=arguments[0]-arguments[2],t=arguments[1]-arguments[3],i.sqrt(n*n+t*t)):arguments.length===6?(n=arguments[0]-arguments[3],t=arguments[1]-arguments[4],r=arguments[2]-arguments[5],i.sqrt(n*n+t*t+r*r)):void 0},v.exp=i.exp,v.floor=i.floor,v.lerp=function(n,t,i){return(t-n)*i+n},v.log=i.log,v.mag=function(n,t,r){return r?i.sqrt(n*n+t*t+r*r):i.sqrt(n*n+t*t)},v.map=function(n,t,i,r,u){return r+(u-r)*((n-t)/(i-t))},v.max=function(){var n,i,r,t;if(arguments.length===2)return arguments[0]<arguments[1]?arguments[1]:arguments[0];if(n=arguments.length===1?arguments[0]:arguments,!("length"in n&&n.length>0))throw"Non-empty array is expected";for(i=n[0],r=n.length,t=1;t<r;++t)i<n[t]&&(i=n[t]);return i},v.min=function(){var n,i,r,t;if(arguments.length===2)return arguments[0]<arguments[1]?arguments[0]:arguments[1];if(n=arguments.length===1?arguments[0]:arguments,!("length"in n&&n.length>0))throw"Non-empty array is expected";for(i=n[0],r=n.length,t=1;t<r;++t)i>n[t]&&(i=n[t]);return i},v.norm=function(n,t,i){return(n-t)/(i-t)},v.pow=i.pow,v.round=i.round,v.sq=function(n){return n*n},v.sqrt=i.sqrt,v.acos=i.acos,v.asin=i.asin,v.atan=i.atan,v.atan2=i.atan2,v.cos=i.cos,v.degrees=function(n){return n*180/i.PI},v.radians=function(n){return n/180*i.PI},v.sin=i.sin,v.tan=i.tan,oe=i.random,v.random=function(){if(arguments.length===0)return oe();if(arguments.length===1)return oe()*arguments[0];var n=arguments[0],t=arguments[1];return oe()*(t-n)+n},af.createRandomized=function(){var n=new Date;return new af(n/6e4&4294967295,n&4294967295)},v.randomSeed=function(n){oe=new af(n).nextDouble},v.Random=function(n){var t=!1,f,u;this.nextGaussian=function(){var r,e,n,o;if(t)return t=!1,f;do r=2*u()-1,e=2*u()-1,n=r*r+e*e;while(n>=1||n===0);return o=i.sqrt(-2*i.log(n)/n),f=e*o,t=!0,r*o},u=n===r?i.random:new af(n).nextDouble},cr={generator:r,octaves:4,fallout:.5,seed:r},v.noise=function(n,t,i){var s;cr.generator===r&&(cr.generator=new fa(cr.seed));var o=cr.generator,f=1,u=1,e=0;for(s=0;s<cr.octaves;++s){f*=cr.fallout;switch(arguments.length){case 1:e+=f*(1+o.noise1d(u*n))/2;break;case 2:e+=f*(1+o.noise2d(u*n,u*t))/2;break;case 3:e+=f*(1+o.noise3d(u*n,u*t,u*i))/2}u*=2}return e},v.noiseDetail=function(n,t){cr.octaves=n,t!==r&&(cr.fallout=t)},v.noiseSeed=function(n){cr.seed=n,cr.generator=r},bt.prototype.size=function(n,t){var f,e,u;lt&&v.stroke(0),wt&&v.fill(255),f={fillStyle:y.fillStyle,strokeStyle:y.strokeStyle,lineCap:y.lineCap,lineJoin:y.lineJoin},d.style.length>0&&(d.style.removeProperty("width"),d.style.removeProperty("height")),d.width=v.width=n||100,d.height=v.height=t||100;for(e in f)f.hasOwnProperty(e)&&(y[e]=f[e]);for(v.textFont(ti),v.background(),ph=i.max(1e3,n*t*.05),v.externals.context=y,u=0;u<720;u++)ne[u]=v.sin(u*(i.PI/180)*.5),te[u]=v.cos(u*(i.PI/180)*.5)},tt.prototype.size=function(){y===r&&(y=d.getContext("2d"),of=new kr,sf=new kr,ht=new br,ui=new br),bt.prototype.size.apply(this,arguments)},rt.prototype.size=function(){var n=!1;return function(t,i){function e(n){for(var r=["experimental-webgl","webgl","webkit-3d"],i,t=0,u=r.length;t<u;t++)if(i=n.getContext(r[t],{antialias:!1,preserveDrawingBuffer:!0}),i)break;return i}if(n)throw"Multiple calls to size() for 3D renders are not allowed.";n=!0;try{d.width=v.width=t||100,d.height=v.height=i||100,y=e(d),ch=y.createTexture(),lh=y.createTexture()}catch(o){u.debug(o)}if(!y)throw"WebGL context is not supported on this browser.";y.viewport(0,0,d.width,d.height),y.enable(y.DEPTH_TEST),y.enable(y.BLEND),y.blendFunc(y.SRC_ALPHA,y.ONE_MINUS_SRC_ALPHA),ft=vs(y,bl,kl),ci=vs(y,pl,wl),v.strokeWeight(1),b=vs(y,gl,na),y.useProgram(b),gt("usingTexture3d",b,"usingTexture",ai),v.lightFalloff(1,0,0),v.shininess(1),v.ambient(255,255,255),v.specular(0,0,0),v.emissive(0,0,0),ts=y.createBuffer(),y.bindBuffer(y.ARRAY_BUFFER,ts),y.bufferData(y.ARRAY_BUFFER,uc,y.STATIC_DRAW),is=y.createBuffer(),y.bindBuffer(y.ARRAY_BUFFER,is),y.bufferData(y.ARRAY_BUFFER,vl,y.STATIC_DRAW),rs=y.createBuffer(),y.bindBuffer(y.ARRAY_BUFFER,rs),y.bufferData(y.ARRAY_BUFFER,fc,y.STATIC_DRAW),de=y.createBuffer(),y.bindBuffer(y.ARRAY_BUFFER,de),y.bufferData(y.ARRAY_BUFFER,as,y.STATIC_DRAW),us=y.createBuffer(),y.bindBuffer(y.ARRAY_BUFFER,us),y.bufferData(y.ARRAY_BUFFER,yl,y.STATIC_DRAW),df=y.createBuffer(),fs=y.createBuffer(),oh=y.createBuffer(),es=y.createBuffer(),sh=y.createBuffer(),hh=y.createBuffer(),ge=y.createBuffer(),y.bindBuffer(y.ARRAY_BUFFER,ge),y.bufferData(y.ARRAY_BUFFER,new f([0,0,0]),y.STATIC_DRAW),os=y.createBuffer(),y.bindBuffer(y.ARRAY_BUFFER,os),y.bufferData(y.ARRAY_BUFFER,new f([1,1,0,-1,1,0,-1,-1,0,1,-1,0]),y.STATIC_DRAW),ss=y.createBuffer(),y.bindBuffer(y.ARRAY_BUFFER,ss),y.bufferData(y.ARRAY_BUFFER,new f([0,0,1,0,1,1,0,1]),y.STATIC_DRAW),hs=y.createBuffer(),y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,hs),y.bufferData(y.ELEMENT_ARRAY_BUFFER,new ot([0,1,2,2,3,0]),y.STATIC_DRAW),wu=new ut,wr=new ut,ht=new ut,ui=new ut,sr=new ut,v.camera(),v.perspective(),of=new kr,sf=new kr,kf=new ut,ke=new ut,tf=new ut,rf=new ut,go=new ut,ns=new ut,ns.set(-1,3,-3,1,3,-6,3,0,-3,3,0,0,1,0,0,0),bt.prototype.size.apply(this,arguments)}}(),tt.prototype.ambientLight=bt.prototype.a3DOnlyFunction,rt.prototype.ambientLight=function(n,t,i,r,u,f){var e,o,s,c;if(ct===8)throw"can only create 8 lights";e=new h(r,u,f),o=new ut,o.scale(1,-1,1),o.apply(ht.array()),o.mult(e,e),s=ir(n,t,i,0),c=[(s>>16&255)/255,(s>>8&255)/255,(s&255)/255],y.useProgram(b),dt("uLights.color.3d."+ct,b,"uLights"+ct+".color",c),dt("uLights.position.3d."+ct,b,"uLights"+ct+".position",e.array()),gt("uLights.type.3d."+ct,b,"uLights"+ct+".type",0),gt("uLightCount3d",b,"uLightCount",++ct)},tt.prototype.directionalLight=bt.prototype.a3DOnlyFunction,rt.prototype.directionalLight=function(n,t,i,r,u,f){var e;if(ct===8)throw"can only create 8 lights";y.useProgram(b),e=new ut,e.scale(1,-1,1),e.apply(ht.array()),e=e.array();var s=[e[0]*r+e[4]*u+e[8]*f,e[1]*r+e[5]*u+e[9]*f,e[2]*r+e[6]*u+e[10]*f],o=ir(n,t,i,0),h=[(o>>16&255)/255,(o>>8&255)/255,(o&255)/255];dt("uLights.color.3d."+ct,b,"uLights"+ct+".color",h),dt("uLights.position.3d."+ct,b,"uLights"+ct+".position",s),gt("uLights.type.3d."+ct,b,"uLights"+ct+".type",1),gt("uLightCount3d",b,"uLightCount",++ct)},tt.prototype.lightFalloff=bt.prototype.a3DOnlyFunction,rt.prototype.lightFalloff=function(n,t,i){y.useProgram(b),dt("uFalloff3d",b,"uFalloff",[n,t,i])},tt.prototype.lightSpecular=bt.prototype.a3DOnlyFunction,rt.prototype.lightSpecular=function(n,t,i){var r=ir(n,t,i,0),u=[(r>>16&255)/255,(r>>8&255)/255,(r&255)/255];y.useProgram(b),dt("uSpecular3d",b,"uSpecular",u)},v.lights=function(){v.ambientLight(128,128,128),v.directionalLight(128,128,128,0,0,-1),v.lightFalloff(1,0,0),v.lightSpecular(0,0,0)},tt.prototype.pointLight=bt.prototype.a3DOnlyFunction,rt.prototype.pointLight=function(n,t,i,r,u,f){var e,o,s,c;if(ct===8)throw"can only create 8 lights";e=new h(r,u,f),o=new ut,o.scale(1,-1,1),o.apply(ht.array()),o.mult(e,e),s=ir(n,t,i,0),c=[(s>>16&255)/255,(s>>8&255)/255,(s&255)/255],y.useProgram(b),dt("uLights.color.3d."+ct,b,"uLights"+ct+".color",c),dt("uLights.position.3d."+ct,b,"uLights"+ct+".position",e.array()),gt("uLights.type.3d."+ct,b,"uLights"+ct+".type",2),gt("uLightCount3d",b,"uLightCount",++ct)},tt.prototype.noLights=bt.prototype.a3DOnlyFunction,rt.prototype.noLights=function(){ct=0,y.useProgram(b),gt("uLightCount3d",b,"uLightCount",ct)},tt.prototype.spotLight=bt.prototype.a3DOnlyFunction,rt.prototype.spotLight=function(n,t,i,r,u,f,e,o,s,c,l){var v,a;if(ct===8)throw"can only create 8 lights";y.useProgram(b),v=new h(r,u,f),a=new ut,a.scale(1,-1,1),a.apply(ht.array()),a.mult(v,v),a=a.array();var w=[a[0]*e+a[4]*o+a[8]*s,a[1]*e+a[5]*o+a[9]*s,a[2]*e+a[6]*o+a[10]*s],p=ir(n,t,i,0),k=[(p>>16&255)/255,(p>>8&255)/255,(p&255)/255];dt("uLights.color.3d."+ct,b,"uLights"+ct+".color",k),dt("uLights.position.3d."+ct,b,"uLights"+ct+".position",v.array()),dt("uLights.direction.3d."+ct,b,"uLights"+ct+".direction",w),dt("uLights.concentration.3d."+ct,b,"uLights"+ct+".concentration",l),dt("uLights.angle.3d."+ct,b,"uLights"+ct+".angle",c),gt("uLights.type.3d."+ct,b,"uLights"+ct+".type",3),gt("uLightCount3d",b,"uLightCount",++ct)},tt.prototype.beginCamera=function(){throw"beginCamera() is not available in 2D mode";},rt.prototype.beginCamera=function(){if(io)throw"You cannot call beginCamera() again before calling endCamera()";io=!0,ht=wr,ui=wu},tt.prototype.endCamera=function(){throw"endCamera() is not available in 2D mode";},rt.prototype.endCamera=function(){if(!io)throw"You cannot call endCamera() before calling beginCamera()";ht.set(wu),ui.set(wr),io=!1},v.camera=function(n,t,u,f,e,o,s,c,l){var a,y,p;n===r&&(ls=v.width/2,bu=v.height/2,ku=bu/i.tan(ro/2),n=ls,t=bu,u=ku,f=ls,e=bu,o=0,s=0,c=1,l=0),a=new h(n-f,t-e,u-o),y=new h(s,c,l),a.normalize(),p=h.cross(y,a),y=h.cross(a,p),p.normalize(),y.normalize();var w=p.x,b=p.y,k=p.z,d=y.x,g=y.y,nt=y.z,tt=a.x,it=a.y,rt=a.z;wu.set(w,b,k,0,d,g,nt,0,tt,it,rt,0,0,0,0,1),wu.translate(-n,-t,-u),wr.reset(),wr.invApply(w,b,k,0,d,g,nt,0,tt,it,rt,0,0,0,0,1),wr.translate(n,t,u),ht.set(wu),ui.set(wr)},v.perspective=function(n,t,r,u){arguments.length===0&&(bu=d.height/2,ku=bu/i.tan(ro/2),nc=ku/10,tc=ku*10,ic=v.width/v.height,n=ro,t=ic,r=nc,u=tc);var f,e,o,s;f=r*i.tan(n/2),e=-f,o=f*t,s=e*t,v.frustum(s,o,e,f,r,u)},tt.prototype.frustum=function(){throw"Processing.js: frustum() is not supported in 2D mode";},rt.prototype.frustum=function(n,t,i,r,u,f){gh=!0,sr=new ut,sr.set(2*u/(t-n),0,(t+n)/(t-n),0,0,2*u/(r-i),(r+i)/(r-i),0,0,0,-(f+u)/(f-u),-(2*f*u)/(f-u),0,0,-1,0);var e=new ut;e.set(sr),e.transpose(),y.useProgram(ft),kt("projection2d",ft,"uProjection",!1,e.array()),y.useProgram(b),kt("projection3d",b,"uProjection",!1,e.array()),y.useProgram(ci),kt("uProjectionUS",ci,"uProjection",!1,e.array())},v.ortho=function(n,t,i,r,u,f){var e;arguments.length===0&&(n=0,t=v.width,i=0,r=v.height,u=-10,f=10);var o=2/(t-n),s=2/(r-i),h=-2/(f-u),c=-(t+n)/(t-n),l=-(r+i)/(r-i),a=-(f+u)/(f-u);sr=new ut,sr.set(o,0,0,c,0,s,0,l,0,0,h,a,0,0,0,1),e=new ut,e.set(sr),e.transpose(),y.useProgram(ft),kt("projection2d",ft,"uProjection",!1,e.array()),y.useProgram(b),kt("projection3d",b,"uProjection",!1,e.array()),y.useProgram(ci),kt("uProjectionUS",ci,"uProjection",!1,e.array()),gh=!1},v.printProjection=function(){sr.print()},v.printCamera=function(){wu.print()},tt.prototype.box=bt.prototype.a3DOnlyFunction,rt.prototype.box=function(n,t,i){var u,r,e,o,f;t&&i||(t=i=n),u=new ut,u.scale(n,t,i),r=new ut,r.scale(1,-1,1),r.apply(ht.array()),r.transpose(),wt&&(y.useProgram(b),kt("model3d",b,"uModel",!1,u.array()),kt("view3d",b,"uView",!1,r.array()),y.enable(y.POLYGON_OFFSET_FILL),y.polygonOffset(1,1),dt("color3d",b,"uColor",di),ct>0?(e=new ut,e.set(r),o=new ut,o.set(u),e.mult(o),f=new ut,f.set(e),f.invert(),f.transpose(),kt("uNormalTransform3d",b,"uNormalTransform",!1,f.array()),fi("aNormal3d",b,"aNormal",3,is)):gi("aNormal3d",b,"aNormal"),fi("aVertex3d",b,"aVertex",3,ts),gi("aColor3d",b,"aColor"),gi("aTexture3d",b,"aTexture"),y.drawArrays(y.TRIANGLES,0,uc.length/3),y.disable(y.POLYGON_OFFSET_FILL)),si>0&&lt&&(y.useProgram(ft),kt("uModel2d",ft,"uModel",!1,u.array()),kt("uView2d",ft,"uView",!1,r.array()),dt("uColor2d",ft,"uColor",pi),gt("uIsDrawingText2d",ft,"uIsDrawingText",!1),fi("vertex2d",ft,"aVertex",3,rs),gi("aTextureCoord2d",ft,"aTextureCoord"),y.drawArrays(y.LINES,0,fc.length/3))},pc=function(){var n,r,e,t,i,u;for(yt=[],n=0;n<pu;n++)yt.push(0),yt.push(-1),yt.push(0),yt.push(vr[n]),yt.push(yr[n]),yt.push(pr[n]);for(yt.push(0),yt.push(-1),yt.push(0),yt.push(vr[0]),yt.push(yr[0]),yt.push(pr[0]),i=0,n=2;n<to;n++){for(r=e=i,i+=pu,t=i,u=0;u<pu;u++)yt.push(vr[r]),yt.push(yr[r]),yt.push(pr[r++]),yt.push(vr[t]),yt.push(yr[t]),yt.push(pr[t++]);r=e,t=i,yt.push(vr[r]),yt.push(yr[r]),yt.push(pr[r]),yt.push(vr[t]),yt.push(yr[t]),yt.push(pr[t])}for(n=0;n<pu;n++)t=i+n,yt.push(vr[t]),yt.push(yr[t]),yt.push(pr[t]),yt.push(0),yt.push(1),yt.push(0);yt.push(vr[i]),yt.push(yr[i]),yt.push(pr[i]),yt.push(0),yt.push(1),yt.push(0),y.bindBuffer(y.ARRAY_BUFFER,df),y.bufferData(y.ARRAY_BUFFER,new f(yt),y.STATIC_DRAW)},v.sphereDetail=function(n,t){var i,u,e,s,o,h,v,r;if(arguments.length===1&&(n=t=arguments[0]),n<3&&(n=3),t<2&&(t=2),n!==pu||t!==to){var c=720/n,l=new f(n),a=new f(n);for(i=0;i<n;i++)l[i]=te[i*c%720|0],a[i]=ne[i*c%720|0];for(u=n*(t-1)+2,e=0,vr=new f(u),yr=new f(u),pr=new f(u),s=720*.5/t,o=s,i=1;i<t;i++){for(h=ne[o%720|0],v=-te[o%720|0],r=0;r<n;r++)vr[e]=l[r]*h,yr[e]=v,pr[e++]=a[r]*h;o+=s}pu=n,to=t,pc()}},tt.prototype.sphere=bt.prototype.a3DOnlyFunction,rt.prototype.sphere=function(){var u=arguments[0],t,n,r,f,i;(pu<3||to<2)&&v.sphereDetail(30),t=new ut,t.scale(u,u,u),n=new ut,n.scale(1,-1,1),n.apply(ht.array()),n.transpose(),wt&&(ct>0?(r=new ut,r.set(n),f=new ut,f.set(t),r.mult(f),i=new ut,i.set(r),i.invert(),i.transpose(),kt("uNormalTransform3d",b,"uNormalTransform",!1,i.array()),fi("aNormal3d",b,"aNormal",3,df)):gi("aNormal3d",b,"aNormal"),y.useProgram(b),gi("aTexture3d",b,"aTexture"),kt("uModel3d",b,"uModel",!1,t.array()),kt("uView3d",b,"uView",!1,n.array()),fi("aVertex3d",b,"aVertex",3,df),gi("aColor3d",b,"aColor"),y.enable(y.POLYGON_OFFSET_FILL),y.polygonOffset(1,1),dt("uColor3d",b,"uColor",di),y.drawArrays(y.TRIANGLE_STRIP,0,yt.length/3),y.disable(y.POLYGON_OFFSET_FILL)),si>0&&lt&&(y.useProgram(ft),kt("uModel2d",ft,"uModel",!1,t.array()),kt("uView2d",ft,"uView",!1,n.array()),fi("aVertex2d",ft,"aVertex",3,df),gi("aTextureCoord2d",ft,"aTextureCoord"),dt("uColor2d",ft,"uColor",pi),gt("uIsDrawingText",ft,"uIsDrawingText",!1),y.drawArrays(y.LINE_STRIP,0,yt.length/3))},v.modelX=function(n,t,i){var r=ht.array(),u=wr.array(),f=r[0]*n+r[1]*t+r[2]*i+r[3],e=r[4]*n+r[5]*t+r[6]*i+r[7],o=r[8]*n+r[9]*t+r[10]*i+r[11],s=r[12]*n+r[13]*t+r[14]*i+r[15],h=u[0]*f+u[1]*e+u[2]*o+u[3]*s,c=u[12]*f+u[13]*e+u[14]*o+u[15]*s;return c!==0?h/c:h},v.modelY=function(n,t,i){var r=ht.array(),u=wr.array(),f=r[0]*n+r[1]*t+r[2]*i+r[3],e=r[4]*n+r[5]*t+r[6]*i+r[7],o=r[8]*n+r[9]*t+r[10]*i+r[11],s=r[12]*n+r[13]*t+r[14]*i+r[15],h=u[4]*f+u[5]*e+u[6]*o+u[7]*s,c=u[12]*f+u[13]*e+u[14]*o+u[15]*s;return c!==0?h/c:h},v.modelZ=function(n,t,i){var r=ht.array(),u=wr.array(),f=r[0]*n+r[1]*t+r[2]*i+r[3],e=r[4]*n+r[5]*t+r[6]*i+r[7],o=r[8]*n+r[9]*t+r[10]*i+r[11],s=r[12]*n+r[13]*t+r[14]*i+r[15],h=u[8]*f+u[9]*e+u[10]*o+u[11]*s,c=u[12]*f+u[13]*e+u[14]*o+u[15]*s;return c!==0?h/c:h},tt.prototype.ambient=bt.prototype.a3DOnlyFunction,rt.prototype.ambient=function(n,t,i){y.useProgram(b),gt("uUsingMat3d",b,"uUsingMat",!0);var r=v.color(n,t,i);dt("uMaterialAmbient3d",b,"uMaterialAmbient",v.color.toGLArray(r).slice(0,3))},tt.prototype.emissive=bt.prototype.a3DOnlyFunction,rt.prototype.emissive=function(n,t,i){y.useProgram(b),gt("uUsingMat3d",b,"uUsingMat",!0);var r=v.color(n,t,i);dt("uMaterialEmissive3d",b,"uMaterialEmissive",v.color.toGLArray(r).slice(0,3))},tt.prototype.shininess=bt.prototype.a3DOnlyFunction,rt.prototype.shininess=function(n){y.useProgram(b),gt("uUsingMat3d",b,"uUsingMat",!0),dt("uShininess3d",b,"uShininess",n)},tt.prototype.specular=bt.prototype.a3DOnlyFunction,rt.prototype.specular=function(n,t,i){y.useProgram(b),gt("uUsingMat3d",b,"uUsingMat",!0);var r=v.color(n,t,i);dt("uMaterialSpecular3d",b,"uMaterialSpecular",v.color.toGLArray(r).slice(0,3))},v.screenX=function(n,t,i){var r=ht.array();if(r.length===16){var f=r[0]*n+r[1]*t+r[2]*i+r[3],e=r[4]*n+r[5]*t+r[6]*i+r[7],o=r[8]*n+r[9]*t+r[10]*i+r[11],s=r[12]*n+r[13]*t+r[14]*i+r[15],u=sr.array(),h=u[0]*f+u[1]*e+u[2]*o+u[3]*s,c=u[12]*f+u[13]*e+u[14]*o+u[15]*s;return c!==0&&(h/=c),v.width*(1+h)/2}return ht.multX(n,t)},v.screenY=function(n,t,i){var r=ht.array();if(r.length===16){var f=r[0]*n+r[1]*t+r[2]*i+r[3],e=r[4]*n+r[5]*t+r[6]*i+r[7],o=r[8]*n+r[9]*t+r[10]*i+r[11],s=r[12]*n+r[13]*t+r[14]*i+r[15],u=sr.array(),h=u[4]*f+u[5]*e+u[6]*o+u[7]*s,c=u[12]*f+u[13]*e+u[14]*o+u[15]*s;return c!==0&&(h/=c),v.height*(1+h)/2}return ht.multY(n,t)},v.screenZ=function(n,t,i){var r=ht.array();if(r.length!==16)return 0;var u=sr.array(),f=r[0]*n+r[1]*t+r[2]*i+r[3],e=r[4]*n+r[5]*t+r[6]*i+r[7],o=r[8]*n+r[9]*t+r[10]*i+r[11],s=r[12]*n+r[13]*t+r[14]*i+r[15],h=u[8]*f+u[9]*e+u[10]*o+u[11]*s,c=u[12]*f+u[13]*e+u[14]*o+u[15]*s;return c!==0&&(h/=c),(h+1)/2},bt.prototype.fill=function(){var n=v.color(arguments[0],arguments[1],arguments[2],arguments[3]);n===fu&&wt||(wt=!0,fu=n)},tt.prototype.fill=function(){bt.prototype.fill.apply(this,arguments),eu=!0},rt.prototype.fill=function(){bt.prototype.fill.apply(this,arguments),di=v.color.toGLArray(fu)},v.noFill=function(){wt=!1},bt.prototype.stroke=function(){var n=v.color(arguments[0],arguments[1],arguments[2],arguments[3]);n===ou&&lt||(lt=!0,ou=n)},tt.prototype.stroke=function(){bt.prototype.stroke.apply(this,arguments),ce=!0},rt.prototype.stroke=function(){bt.prototype.stroke.apply(this,arguments),pi=v.color.toGLArray(ou)},v.noStroke=function(){lt=!1},bt.prototype.strokeWeight=function(n){si=n},tt.prototype.strokeWeight=function(n){bt.prototype.strokeWeight.apply(this,arguments),y.lineWidth=n},rt.prototype.strokeWeight=function(n){bt.prototype.strokeWeight.apply(this,arguments),y.useProgram(ft),dt("pointSize2d",ft,"uPointSize",n),y.useProgram(ci),dt("pointSizeUnlitShape",ci,"uPointSize",n),y.lineWidth(n)},v.strokeCap=function(n){ei.$ensureContext().lineCap=n},v.strokeJoin=function(n){ei.$ensureContext().lineJoin=n},tt.prototype.smooth=function(){su=!0;var n=d.style;n.setProperty("image-rendering","optimizeQuality","important"),n.setProperty("-ms-interpolation-mode","bicubic","important"),y.hasOwnProperty("mozImageSmoothingEnabled")&&(y.mozImageSmoothingEnabled=!0)},rt.prototype.smooth=function(){su=!0},tt.prototype.noSmooth=function(){su=!1;var n=d.style;n.setProperty("image-rendering","optimizeSpeed","important"),n.setProperty("image-rendering","-moz-crisp-edges","important"),n.setProperty("image-rendering","-webkit-optimize-contrast","important"),n.setProperty("image-rendering","optimize-contrast","important"),n.setProperty("-ms-interpolation-mode","nearest-neighbor","important"),y.hasOwnProperty("mozImageSmoothingEnabled")&&(y.mozImageSmoothingEnabled=!1)},rt.prototype.noSmooth=function(){su=!1},tt.prototype.point=function(n,t){lt&&(n=i.round(n),t=i.round(t),y.fillStyle=v.color.toString(ou),eu=!0,si>1?(y.beginPath(),y.arc(n,t,si/2,0,6.2831853071795862,!1),y.fill()):y.fillRect(n,t,1,1))},rt.prototype.point=function(n,t,i){var u=new ut,r;u.translate(n,t,i||0),u.transpose(),r=new ut,r.scale(1,-1,1),r.apply(ht.array()),r.transpose(),y.useProgram(ft),kt("uModel2d",ft,"uModel",!1,u.array()),kt("uView2d",ft,"uView",!1,r.array()),si>0&&lt&&(dt("uColor2d",ft,"uColor",pi),gt("uIsDrawingText2d",ft,"uIsDrawingText",!1),gt("uSmooth2d",ft,"uSmooth",su),fi("aVertex2d",ft,"aVertex",3,ge),gi("aTextureCoord2d",ft,"aTextureCoord"),y.drawArrays(y.POINTS,0,1))},v.beginShape=function(n){ni=n,ll=[],w=[]},tt.prototype.vertex=function(n,t,i){var r=[];cu&&(cu=!1),r.isVert=!0,r[0]=n,r[1]=t,r[2]=0,r[3]=0,r[4]=0,r[5]=fu,r[6]=ou,w.push(r),i&&(w[w.length-1].moveTo=i)},rt.prototype.vertex=function(n,t,i,u,f){var e=[];cu&&(cu=!1),e.isVert=!0,f===r&&ai&&(f=u,u=i,i=0),u!==r&&f!==r&&(ah===2&&(u/=uf.width,f/=uf.height),u=u>1?1:u,u=u<0?0:u,f=f>1?1:f,f=f<0?0:f),e[0]=n,e[1]=t,e[2]=i||0,e[3]=u||0,e[4]=f||0,e[5]=di[0],e[6]=di[1],e[7]=di[2],e[8]=di[3],e[9]=pi[0],e[10]=pi[1],e[11]=pi[2],e[12]=pi[3],e[13]=co,e[14]=lo,e[15]=ao,w.push(e)};var wc=function(n,t){var i=new ut;i.scale(1,-1,1),i.apply(ht.array()),i.transpose(),y.useProgram(ci),kt("uViewUS",ci,"uView",!1,i.array()),gt("uSmoothUS",ci,"uSmooth",su),fi("aVertexUS",ci,"aVertex",3,ge),y.bufferData(y.ARRAY_BUFFER,new f(n),y.STREAM_DRAW),fi("aColorUS",ci,"aColor",4,es),y.bufferData(y.ARRAY_BUFFER,new f(t),y.STREAM_DRAW),y.drawArrays(y.POINTS,0,n.length/3)},rr=function(n,t,i){var u,r;u=t==="LINES"?y.LINES:t==="LINE_LOOP"?y.LINE_LOOP:y.LINE_STRIP,r=new ut,r.scale(1,-1,1),r.apply(ht.array()),r.transpose(),y.useProgram(ci),kt("uViewUS",ci,"uView",!1,r.array()),fi("aVertexUS",ci,"aVertex",3,fs),y.bufferData(y.ARRAY_BUFFER,new f(n),y.STREAM_DRAW),fi("aColorUS",ci,"aColor",4,sh),y.bufferData(y.ARRAY_BUFFER,new f(i),y.STREAM_DRAW),y.drawArrays(u,0,n.length/3)},uu=function(n,t,i,r){var e,u;e=t==="TRIANGLES"?y.TRIANGLES:t==="TRIANGLE_FAN"?y.TRIANGLE_FAN:y.TRIANGLE_STRIP,u=new ut,u.scale(1,-1,1),u.apply(ht.array()),u.transpose(),y.useProgram(b),kt("model3d",b,"uModel",!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),kt("view3d",b,"uView",!1,u.array()),y.enable(y.POLYGON_OFFSET_FILL),y.polygonOffset(1,1),dt("color3d",b,"uColor",[-1,0,0,0]),fi("vertex3d",b,"aVertex",3,oh),y.bufferData(y.ARRAY_BUFFER,new f(n),y.STREAM_DRAW),ai&&hu!==null&&bo(i),fi("aColor3d",b,"aColor",4,es),y.bufferData(y.ARRAY_BUFFER,new f(i),y.STREAM_DRAW),gi("aNormal3d",b,"aNormal"),ai&&(gt("uUsingTexture3d",b,"uUsingTexture",ai),fi("aTexture3d",b,"aTexture",2,hh),y.bufferData(y.ARRAY_BUFFER,new f(r),y.STREAM_DRAW)),y.drawArrays(e,0,n.length/3),y.disable(y.POLYGON_OFFSET_FILL)};tt.prototype.endShape=function(n){var s,t,f,b,u,e,o;if(w.length!==0){s=n===2,s&&w.push(w[0]);var p=[],c=[],l=[],a=[],h=[],i;for(cu=!0,u=w.length,t=0;t<u;t++)for(i=w[t],f=0;f<3;f++)c.push(i[f]);for(t=0;t<u;t++)for(i=w[t],f=5;f<9;f++)l.push(i[f]);for(t=0;t<u;t++)for(i=w[t],f=9;f<13;f++)a.push(i[f]);for(t=0;t<u;t++)i=w[t],h.push(i[3]),h.push(i[4]);if(hf&&(ni===20||ni===r)){if(u>3){for(e=[],o=1-yo,y.beginPath(),y.moveTo(w[1][0],w[1][1]),t=1;t+2<u;t++)i=w[t],e[0]=[i[0],i[1]],e[1]=[i[0]+(o*w[t+1][0]-o*w[t-1][0])/6,i[1]+(o*w[t+1][1]-o*w[t-1][1])/6],e[2]=[w[t+1][0]+(o*w[t][0]-o*w[t+2][0])/6,w[t+1][1]+(o*w[t][1]-o*w[t+2][1])/6],e[3]=[w[t+1][0],w[t+1][1]],y.bezierCurveTo(e[1][0],e[1][1],e[2][0],e[2][1],e[3][0],e[3][1]);se()}}else if(cf&&(ni===20||ni===r)){for(y.beginPath(),t=0;t<u;t++)i=w[t],w[t].isVert?w[t].moveTo?y.moveTo(i[0],i[1]):y.lineTo(i[0],i[1]):y.bezierCurveTo(w[t][0],w[t][1],w[t][2],w[t][3],w[t][4],w[t][5]);se()}else if(ni===2)for(t=0;t<u;t++)i=w[t],lt&&v.stroke(i[6]),v.point(i[0],i[1]);else if(ni===4)for(t=0;t+1<u;t+=2)i=w[t],lt&&v.stroke(w[t+1][6]),v.line(i[0],i[1],w[t+1][0],w[t+1][1]);else if(ni===9)for(t=0;t+2<u;t+=3)i=w[t],y.beginPath(),y.moveTo(i[0],i[1]),y.lineTo(w[t+1][0],w[t+1][1]),y.lineTo(w[t+2][0],w[t+2][1]),y.lineTo(i[0],i[1]),wt&&(v.fill(w[t+2][5]),ru()),lt&&(v.stroke(w[t+2][6]),dr()),y.closePath();else if(ni===10)for(t=0;t+1<u;t++)i=w[t],y.beginPath(),y.moveTo(w[t+1][0],w[t+1][1]),y.lineTo(i[0],i[1]),lt&&v.stroke(w[t+1][6]),wt&&v.fill(w[t+1][5]),t+2<u&&(y.lineTo(w[t+2][0],w[t+2][1]),lt&&v.stroke(w[t+2][6]),wt&&v.fill(w[t+2][5])),se();else if(ni===11){if(u>2)for(y.beginPath(),y.moveTo(w[0][0],w[0][1]),y.lineTo(w[1][0],w[1][1]),y.lineTo(w[2][0],w[2][1]),wt&&(v.fill(w[2][5]),ru()),lt&&(v.stroke(w[2][6]),dr()),y.closePath(),t=3;t<u;t++)i=w[t],y.beginPath(),y.moveTo(w[0][0],w[0][1]),y.lineTo(w[t-1][0],w[t-1][1]),y.lineTo(i[0],i[1]),wt&&(v.fill(i[5]),ru()),lt&&(v.stroke(i[6]),dr()),y.closePath()}else if(ni===16)for(t=0;t+3<u;t+=4){for(i=w[t],y.beginPath(),y.moveTo(i[0],i[1]),f=1;f<4;f++)y.lineTo(w[t+f][0],w[t+f][1]);y.lineTo(i[0],i[1]),wt&&(v.fill(w[t+3][5]),ru()),lt&&(v.stroke(w[t+3][6]),dr()),y.closePath()}else if(ni===17){if(u>3)for(t=0;t+1<u;t+=2)i=w[t],y.beginPath(),t+3<u?(y.moveTo(w[t+2][0],w[t+2][1]),y.lineTo(i[0],i[1]),y.lineTo(w[t+1][0],w[t+1][1]),y.lineTo(w[t+3][0],w[t+3][1]),wt&&v.fill(w[t+3][5]),lt&&v.stroke(w[t+3][6])):(y.moveTo(i[0],i[1]),y.lineTo(w[t+1][0],w[t+1][1])),se()}else{for(y.beginPath(),y.moveTo(w[0][0],w[0][1]),t=1;t<u;t++)i=w[t],i.isVert&&(i.moveTo?y.moveTo(i[0],i[1]):y.lineTo(i[0],i[1]));se()}hf=!1,cf=!1,vi=[],li=0,s&&w.pop()}},rt.prototype.endShape=function(n){var i,t,f,c,v;if(w.length!==0){var a=n===2,u=[],s=[],l=[],e=[],h=[],o;for(cu=!0,c=w.length,i=0;i<c;i++)for(o=w[i],t=0;t<3;t++)s.push(o[t]);for(i=0;i<c;i++)for(o=w[i],t=5;t<9;t++)l.push(o[t]);for(i=0;i<c;i++)for(o=w[i],t=9;t<13;t++)e.push(o[t]);for(i=0;i<c;i++)o=w[i],h.push(o[3]),h.push(o[4]);if(a){for(s.push(w[0][0]),s.push(w[0][1]),s.push(w[0][2]),i=5;i<9;i++)l.push(w[0][i]);for(i=9;i<13;i++)e.push(w[0][i]);h.push(w[0][3]),h.push(w[0][4])}if(hf&&(ni===20||ni===r))u=s,lt&&rr(u,null,e),wt&&uu(s,null,l);else if(cf&&(ni===20||ni===r))u=s,u.splice(u.length-3),e.splice(e.length-4),lt&&rr(u,null,e),wt&&uu(s,"TRIANGLES",l);else{if(ni===2){for(i=0;i<c;i++)for(o=w[i],t=0;t<3;t++)u.push(o[t]);wc(u,e)}else if(ni===4){for(i=0;i<c;i++)for(o=w[i],t=0;t<3;t++)u.push(o[t]);for(i=0;i<c;i++)for(o=w[i],t=5;t<9;t++)l.push(o[t]);rr(u,"LINES",e)}else if(ni===9){if(c>2)for(i=0;i+2<c;i+=3){for(s=[],h=[],u=[],l=[],e=[],t=0;t<3;t++)for(f=0;f<3;f++)u.push(w[i+t][f]),s.push(w[i+t][f]);for(t=0;t<3;t++)for(f=3;f<5;f++)h.push(w[i+t][f]);for(t=0;t<3;t++)for(f=5;f<9;f++)l.push(w[i+t][f]),e.push(w[i+t][f+4]);lt&&rr(u,"LINE_LOOP",e),(wt||ai)&&uu(s,"TRIANGLES",l,h)}}else if(ni===10){if(c>2)for(i=0;i+2<c;i++){for(u=[],s=[],e=[],l=[],h=[],t=0;t<3;t++)for(f=0;f<3;f++)u.push(w[i+t][f]),s.push(w[i+t][f]);for(t=0;t<3;t++)for(f=3;f<5;f++)h.push(w[i+t][f]);for(t=0;t<3;t++)for(f=5;f<9;f++)e.push(w[i+t][f+4]),l.push(w[i+t][f]);(wt||ai)&&uu(s,"TRIANGLE_STRIP",l,h),lt&&rr(u,"LINE_LOOP",e)}}else if(ni===11){if(c>2){for(i=0;i<3;i++)for(o=w[i],t=0;t<3;t++)u.push(o[t]);for(i=0;i<3;i++)for(o=w[i],t=9;t<13;t++)e.push(o[t]);for(lt&&rr(u,"LINE_LOOP",e),i=2;i+1<c;i++){for(u=[],e=[],u.push(w[0][0]),u.push(w[0][1]),u.push(w[0][2]),e.push(w[0][9]),e.push(w[0][10]),e.push(w[0][11]),e.push(w[0][12]),t=0;t<2;t++)for(f=0;f<3;f++)u.push(w[i+t][f]);for(t=0;t<2;t++)for(f=9;f<13;f++)e.push(w[i+t][f]);lt&&rr(u,"LINE_STRIP",e)}(wt||ai)&&uu(s,"TRIANGLE_FAN",l,h)}}else if(ni===16)for(i=0;i+3<c;i+=4){for(u=[],t=0;t<4;t++)for(o=w[i+t],f=0;f<3;f++)u.push(o[f]);if(lt&&rr(u,"LINE_LOOP",e),wt){for(s=[],l=[],h=[],t=0;t<3;t++)s.push(w[i][t]);for(t=5;t<9;t++)l.push(w[i][t]);for(t=0;t<3;t++)s.push(w[i+1][t]);for(t=5;t<9;t++)l.push(w[i+1][t]);for(t=0;t<3;t++)s.push(w[i+3][t]);for(t=5;t<9;t++)l.push(w[i+3][t]);for(t=0;t<3;t++)s.push(w[i+2][t]);for(t=5;t<9;t++)l.push(w[i+2][t]);ai&&(h.push(w[i+0][3]),h.push(w[i+0][4]),h.push(w[i+1][3]),h.push(w[i+1][4]),h.push(w[i+3][3]),h.push(w[i+3][4]),h.push(w[i+2][3]),h.push(w[i+2][4])),uu(s,"TRIANGLE_STRIP",l,h)}}else if(ni===17){if(v=[],c>3){for(i=0;i<2;i++)for(o=w[i],t=0;t<3;t++)u.push(o[t]);for(i=0;i<2;i++)for(o=w[i],t=9;t<13;t++)e.push(o[t]);for(rr(u,"LINE_STRIP",e),c>4&&c%2>0&&(v=s.splice(s.length-3),w.pop()),i=0;i+3<c;i+=2){for(u=[],e=[],t=0;t<3;t++)u.push(w[i+1][t]);for(t=0;t<3;t++)u.push(w[i+3][t]);for(t=0;t<3;t++)u.push(w[i+2][t]);for(t=0;t<3;t++)u.push(w[i+0][t]);for(t=9;t<13;t++)e.push(w[i+1][t]);for(t=9;t<13;t++)e.push(w[i+3][t]);for(t=9;t<13;t++)e.push(w[i+2][t]);for(t=9;t<13;t++)e.push(w[i+0][t]);lt&&rr(u,"LINE_STRIP",e)}(wt||ai)&&uu(s,"TRIANGLE_LIST",l,h)}}else if(c===1){for(t=0;t<3;t++)u.push(w[0][t]);for(t=9;t<13;t++)e.push(w[0][t]);wc(u,e)}else{for(i=0;i<c;i++){for(o=w[i],t=0;t<3;t++)u.push(o[t]);for(t=5;t<9;t++)e.push(o[t])}lt&&a?rr(u,"LINE_LOOP",e):lt&&!a&&rr(u,"LINE_STRIP",e),(wt||ai)&&uu(s,"TRIANGLE_FAN",l,h)}ai=!1,y.useProgram(b),gt("usingTexture3d",b,"uUsingTexture",ai)}hf=!1,cf=!1,vi=[],li=0}},bs=function(n,t){var i=1/n,r=i*i,u=r*i;t.set(0,0,0,1,u,r,i,0,6*u,2*r,0,0,6*u,0,0,0)},ks=function(){tf||(kf=new ut,tf=new ut,fh=!0);var n=yo;kf.set((n-1)/2,(n+3)/2,(-3-n)/2,(1-n)/2,1-n,(-5-n)/2,n+2,(n-1)/2,(n-1)/2,0,(1-n)/2,0,0,1,0,0),bs(po,tf),go||(ke=new ut),ke.set(kf),ke.preApply(go),tf.apply(kf)},tt.prototype.bezierVertex=function(){var t,n;if(cf=!0,t=[],cu)throw"vertex() must be used at least once before calling bezierVertex()";for(n=0;n<arguments.length;n++)t[n]=arguments[n];w.push(t),w[w.length-1].isVert=!1},rt.prototype.bezierVertex=function(){var y,f,e;if(cf=!0,y=[],cu)throw"vertex() must be used at least once before calling bezierVertex()";if(arguments.length===9){rf===r&&(rf=new ut),f=w.length-1,bs(wo,rf),rf.apply(ns);var n=rf.array(),t=w[f][0],i=w[f][1],u=w[f][2],o=n[4]*t+n[5]*arguments[0]+n[6]*arguments[3]+n[7]*arguments[6],s=n[8]*t+n[9]*arguments[0]+n[10]*arguments[3]+n[11]*arguments[6],p=n[12]*t+n[13]*arguments[0]+n[14]*arguments[3]+n[15]*arguments[6],h=n[4]*i+n[5]*arguments[1]+n[6]*arguments[4]+n[7]*arguments[7],c=n[8]*i+n[9]*arguments[1]+n[10]*arguments[4]+n[11]*arguments[7],b=n[12]*i+n[13]*arguments[1]+n[14]*arguments[4]+n[15]*arguments[7],l=n[4]*u+n[5]*arguments[2]+n[6]*arguments[5]+n[7]*arguments[8],a=n[8]*u+n[9]*arguments[2]+n[10]*arguments[5]+n[11]*arguments[8],k=n[12]*u+n[13]*arguments[2]+n[14]*arguments[5]+n[15]*arguments[8];for(e=0;e<wo;e++)t+=o,o+=s,s+=p,i+=h,h+=c,c+=b,u+=l,l+=a,a+=k,v.vertex(t,i,u);v.vertex(arguments[6],arguments[7],arguments[8])}},v.texture=function(n){var i=ei.$ensureContext();if(n.__texture)i.bindTexture(i.TEXTURE_2D,n.__texture);else if(n.localName==="canvas")i.bindTexture(i.TEXTURE_2D,ch),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.generateMipmap(i.TEXTURE_2D),uf.width=n.width,uf.height=n.height;else{var f=i.createTexture(),r=t.createElement("canvas"),e=r.getContext("2d"),u;if(n.width&n.width-1==0)r.width=n.width;else{for(u=1;u<n.width;)u*=2;r.width=u}if(n.height&n.height-1==0)r.height=n.height;else{for(u=1;u<n.height;)u*=2;r.height=u}e.drawImage(n.sourceImg,0,0,n.width,n.height,0,0,r.width,r.height),i.bindTexture(i.TEXTURE_2D,f),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,r),i.generateMipmap(i.TEXTURE_2D),n.__texture=f,uf.width=n.width,uf.height=n.height}ai=!0,i.useProgram(b),gt("usingTexture3d",b,"uUsingTexture",ai)},v.textureMode=function(n){ah=n},bc=function(n,t,i,r,u,f,e,o,s,h,c,l){var y=r,p=u,w=f,a=tf.array(),k=a[4]*n+a[5]*r+a[6]*e+a[7]*h,d=a[8]*n+a[9]*r+a[10]*e+a[11]*h,rt=a[12]*n+a[13]*r+a[14]*e+a[15]*h,g=a[4]*t+a[5]*u+a[6]*o+a[7]*c,nt=a[8]*t+a[9]*u+a[10]*o+a[11]*c,ut=a[12]*t+a[13]*u+a[14]*o+a[15]*c,tt=a[4]*i+a[5]*f+a[6]*s+a[7]*l,it=a[8]*i+a[9]*f+a[10]*s+a[11]*l,ft=a[12]*i+a[13]*f+a[14]*s+a[15]*l,b;for(v.vertex(y,p,w),b=0;b<po;b++)y+=k,k+=d,d+=rt,p+=g,g+=nt,nt+=ut,w+=tt,tt+=it,it+=ft,v.vertex(y,p,w)},tt.prototype.curveVertex=function(n,t){hf=!0,v.vertex(n,t)},rt.prototype.curveVertex=function(n,t,i){hf=!0,fh||ks();var r=[];r[0]=n,r[1]=t,r[2]=i,vi.push(r),li++,li>3&&bc(vi[li-4][0],vi[li-4][1],vi[li-4][2],vi[li-3][0],vi[li-3][1],vi[li-3][2],vi[li-2][0],vi[li-2][1],vi[li-2][2],vi[li-1][0],vi[li-1][1],vi[li-1][2])},tt.prototype.curve=function(n,t,i,r,u,f,e,o){v.beginShape(),v.curveVertex(n,t),v.curveVertex(i,r),v.curveVertex(u,f),v.curveVertex(e,o),v.endShape()},rt.prototype.curve=function(n,t,i,u,f,e,o,s,h,c,l,a){if(a!==r){v.beginShape(),v.curveVertex(n,t,i),v.curveVertex(u,f,e),v.curveVertex(o,s,h),v.curveVertex(c,l,a),v.endShape();return}v.beginShape(),v.curveVertex(n,t),v.curveVertex(i,u),v.curveVertex(f,e),v.curveVertex(o,s),v.endShape()},v.curveTightness=function(n){yo=n},v.curveDetail=function(n){po=n,ks()},v.rectMode=function(n){fr=n},v.imageMode=function(n){switch(n){case 0:lf=ec;break;case 1:lf=ta;break;case 3:lf=ia;break;default:throw"Invalid imageMode";}},v.ellipseMode=function(n){wi=n},v.arc=function(n,t,i,r,u,f){var p,w;if(!(i<=0)&&!(f<u)){for(wi===1?(i=i-n,r=r-t):wi===2?(n=n-i,t=t-r,i=i*2,r=r*2):wi===3&&(n=n-i/2,t=t-r/2);u<0;)u+=6.2831853071795862,f+=6.2831853071795862;f-u>6.2831853071795862&&(u=0,f=6.2831853071795862);var s=i/2,h=r/2,c=n+s,l=t+h,a=0|.5+u*v.RAD_TO_DEG*2,y=0|.5+f*v.RAD_TO_DEG*2,e,o;if(wt){for(p=lt,lt=!1,v.beginShape(),v.vertex(c,l),e=a;e<=y;e++)o=e%720,v.vertex(c+te[o]*s,l+ne[o]*h);v.endShape(2),lt=p}if(lt){for(w=wt,wt=!1,v.beginShape(),e=a;e<=y;e++)o=e%720,v.vertex(c+te[o]*s,l+ne[o]*h);v.endShape(),wt=w}}},tt.prototype.line=function(n,t,u,f){var e;if(lt){if(n=i.round(n),u=i.round(u),t=i.round(t),f=i.round(f),n===u&&t===f){v.point(n,t);return}var o=r,h=r,s=!0,c=ht.array(),l=[1,0,0,0,1,0];for(e=0;e<6&&s;e++)s=c[e]===l[e];s&&(n===u?(t>f&&(o=t,t=f,f=o),f++,si%2==1&&y.translate(.5,0)):t===f&&(n>u&&(o=n,n=u,u=o),u++,si%2==1&&y.translate(0,.5)),si===1&&(h=y.lineCap,y.lineCap="butt")),y.beginPath(),y.moveTo(n||0,t||0),y.lineTo(u||0,f||0),dr(),s&&(n===u&&si%2==1?y.translate(-.5,0):t===f&&si%2==1&&y.translate(0,-.5),si===1&&(y.lineCap=h))}},rt.prototype.line=function(n,t,i,u,e,o){if((e===r||o===r)&&(o=0,e=u,u=i,i=0),n===u&&t===e&&i===o){v.point(n,t,i);return}var h=[n,t,i,u,e,o],s=new ut;s.scale(1,-1,1),s.apply(ht.array()),s.transpose(),si>0&&lt&&(y.useProgram(ft),kt("uModel2d",ft,"uModel",!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),kt("uView2d",ft,"uView",!1,s.array()),dt("uColor2d",ft,"uColor",pi),gt("uIsDrawingText",ft,"uIsDrawingText",!1),fi("aVertex2d",ft,"aVertex",3,fs),gi("aTextureCoord2d",ft,"aTextureCoord"),y.bufferData(y.ARRAY_BUFFER,new f(h),y.STREAM_DRAW),y.drawArrays(y.LINES,0,2))},tt.prototype.bezier=function(){if(arguments.length!==8)throw"You must use 8 parameters for bezier() in 2D mode";v.beginShape(),v.vertex(arguments[0],arguments[1]),v.bezierVertex(arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7]),v.endShape()},rt.prototype.bezier=function(){if(arguments.length!==12)throw"You must use 12 parameters for bezier() in 3D mode";v.beginShape(),v.vertex(arguments[0],arguments[1],arguments[2]),v.bezierVertex(arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8],arguments[9],arguments[10],arguments[11]),v.endShape()},v.bezierDetail=function(n){wo=n},v.bezierPoint=function(n,t,i,r,u){return(1-u)*(1-u)*(1-u)*n+3*(1-u)*(1-u)*u*t+3*(1-u)*u*u*i+u*u*u*r},v.bezierTangent=function(n,t,i,r,u){return 3*u*u*(-n+3*t-3*i+r)+6*u*(n-2*t+i)+3*(-n+t)},v.curvePoint=function(n,t,i,r,u){return.5*(2*t+(-n+i)*u+(2*n-5*t+4*i-r)*u*u+(-n+3*t-3*i+r)*u*u*u)},v.curveTangent=function(n,t,i,r,u){return.5*(-n+i+2*(2*n-5*t+4*i-r)*u+3*(-n+3*t-3*i+r)*u*u)},v.triangle=function(n,t,i,r,u,f){v.beginShape(9),v.vertex(n,t,0),v.vertex(i,r,0),v.vertex(u,f,0),v.endShape()},v.quad=function(n,t,i,r,u,f,e,o){v.beginShape(16),v.vertex(n,t,0),v.vertex(i,r,0),v.vertex(u,f,0),v.vertex(e,o,0),v.endShape()},kc=function(n,t,u,f,e,o,s,h){h===r&&(o=e,s=e,h=e);var c=u/2,l=f/2;(e>c||e>l)&&(e=i.min(c,l)),(o>c||o>l)&&(o=i.min(c,l)),(s>c||s>l)&&(s=i.min(c,l)),(h>c||h>l)&&(h=i.min(c,l)),(!wt||lt)&&y.translate(.5,.5),y.beginPath(),y.moveTo(n+e,t),y.lineTo(n+u-o,t),y.quadraticCurveTo(n+u,t,n+u,t+o),y.lineTo(n+u,t+f-s),y.quadraticCurveTo(n+u,t+f,n+u-s,t+f),y.lineTo(n+h,t+f),y.quadraticCurveTo(n,t+f,n,t+f-h),y.lineTo(n,t+e),y.quadraticCurveTo(n,t,n+e,t),(!wt||lt)&&y.translate(-.5,-.5),ru(),dr()},tt.prototype.rect=function(n,t,u,f,e,o,s,h){if(u||f){if(fr===1?(u-=n,f-=t):fr===2?(u*=2,f*=2,n-=u/2,t-=f/2):fr===3&&(n-=u/2,t-=f/2),n=i.round(n),t=i.round(t),u=i.round(u),f=i.round(f),e!==r){kc(n,t,u,f,e,o,s,h);return}lt&&si%2==1&&y.translate(.5,.5),y.beginPath(),y.rect(n,t,u,f),ru(),dr(),lt&&si%2==1&&y.translate(-.5,-.5)}},rt.prototype.rect=function(n,t,i,u,f){var h,c,a,v,l;if(f!==r)throw"rect() with rounded corners is not supported in 3D mode";fr===1?(i-=n,u-=t):fr===2?(i*=2,u*=2,n-=i/2,t-=u/2):fr===3&&(n-=i/2,t-=u/2),h=new ut,h.translate(n,t,0),h.scale(i,u,1),h.transpose(),c=new ut,c.scale(1,-1,1),c.apply(ht.array()),c.transpose(),si>0&&lt&&(y.useProgram(ft),kt("uModel2d",ft,"uModel",!1,h.array()),kt("uView2d",ft,"uView",!1,c.array()),dt("uColor2d",ft,"uColor",pi),gt("uIsDrawingText2d",ft,"uIsDrawingText",!1),fi("aVertex2d",ft,"aVertex",3,de),gi("aTextureCoord2d",ft,"aTextureCoord"),y.drawArrays(y.LINE_LOOP,0,as.length/3)),wt&&(y.useProgram(b),kt("uModel3d",b,"uModel",!1,h.array()),kt("uView3d",b,"uView",!1,c.array()),y.enable(y.POLYGON_OFFSET_FILL),y.polygonOffset(1,1),dt("color3d",b,"uColor",di),ct>0?(a=new ut,a.set(c),v=new ut,v.set(h),a.mult(v),l=new ut,l.set(a),l.invert(),l.transpose(),kt("uNormalTransform3d",b,"uNormalTransform",!1,l.array()),fi("aNormal3d",b,"aNormal",3,us)):gi("normal3d",b,"aNormal"),fi("vertex3d",b,"aVertex",3,de),y.drawArrays(y.TRIANGLE_FAN,0,as.length/3),y.disable(y.POLYGON_OFFSET_FILL))},tt.prototype.ellipse=function(n,t,i,r){if(n=n||0,t=t||0,!(i<=0)||!(r<=0))if(wi===2?(i*=2,r*=2):wi===1?(i=i-n,r=r-t,n+=i/2,t+=r/2):wi===0&&(n+=i/2,t+=r/2),i===r)y.beginPath(),y.arc(n,t,i/2,0,6.2831853071795862,!1),ru(),dr();else{var u=i/2,f=r/2,s=.55228474983079334,e=s*u,o=s*f;v.beginShape(),v.vertex(n+u,t),v.bezierVertex(n+u,t-o,n+e,t-f,n,t-f),v.bezierVertex(n-e,t-f,n-u,t-o,n-u,t),v.bezierVertex(n-u,t+o,n-e,t+f,n,t+f),v.bezierVertex(n+e,t+f,n+u,t+o,n+u,t),v.endShape()}},rt.prototype.ellipse=function(n,t,i,r){var l,a,f,o;if(n=n||0,t=t||0,!(i<=0)||!(r<=0)){wi===2?(i*=2,r*=2):wi===1?(i=i-n,r=r-t,n+=i/2,t+=r/2):wi===0&&(n+=i/2,t+=r/2);var e=i/2,s=r/2,y=.55228474983079334,h=y*e,c=y*s;if(v.beginShape(),v.vertex(n+e,t),v.bezierVertex(n+e,t-c,0,n+h,t-s,0,n,t-s,0),v.bezierVertex(n-h,t-s,0,n-e,t-c,0,n-e,t,0),v.bezierVertex(n-e,t+c,0,n-h,t+s,0,n,t+s,0),v.bezierVertex(n+h,t+s,0,n+e,t+c,0,n+e,t,0),v.endShape(),wt){for(l=0,a=0,f=0;f<w.length;f++)l+=w[f][0],a+=w[f][1];l/=w.length,a/=w.length;var u=[],p=[],b=[];for(u[0]=l,u[1]=a,u[2]=0,u[3]=0,u[4]=0,u[5]=di[0],u[6]=di[1],u[7]=di[2],u[8]=di[3],u[9]=pi[0],u[10]=pi[1],u[11]=pi[2],u[12]=pi[3],u[13]=co,u[14]=lo,u[15]=ao,w.unshift(u),f=0;f<w.length;f++){for(o=0;o<3;o++)p.push(w[f][o]);for(o=5;o<9;o++)b.push(w[f][o])}uu(p,"TRIANGLE_FAN",b)}}},v.normal=function(n,t,i){if(arguments.length!==3||!(typeof n=="number"&&typeof t=="number"&&typeof i=="number"))throw"normal() requires three numeric arguments.";co=n,lo=t,ao=i,ni!==0&&(ve===0?ve=1:ve===1&&(ve=2))},v.save=function(t,i){return i!==r?n.open(i.toDataURL(),"_blank"):n.open(v.externals.canvas.toDataURL(),"_blank")},dc=0,v.saveFrame=function(n){n===r&&(n="screen-####.png");var t=n.replace(/#+/,function(n){for(var t=""+dc++;t.length<n.length;)t="0"+t;return t});v.save(t)},gc=t.createElement("canvas").getContext("2d"),ds=[r,r,r],ur=function(n,i,r){var u,o;if(this.__isDirty=!1,n instanceof HTMLImageElement)this.fromHTMLImageData(n);else if(i||r){if(this.width=n||1,this.height=i||1,u=this.sourceImg=t.createElement("canvas"),u.width=this.width,u.height=this.height,o=this.imageData=u.getContext("2d").createImageData(this.width,this.height),this.format=r===2||r===4?r:1,this.format===1)for(var f=3,e=this.imageData.data,s=e.length;f<s;f+=4)e[f]=255;this.__isDirty=!0,this.updatePixels()}else this.width=0,this.height=0,this.imageData=gc.createImageData(1,1),this.format=2;this.pixels=ea(this)},ur.prototype={__isPImage:!0,updatePixels:function(){var n=this.sourceImg;n&&n instanceof HTMLCanvasElement&&this.__isDirty&&n.getContext("2d").putImageData(this.imageData,0,0),this.__isDirty=!1},fromHTMLImageData:function(n){var i=vf(n),t;try{t=i.context.getImageData(0,0,n.width,n.height),this.fromImageData(t)}catch(r){n.width&&n.height&&(this.isRemote=!0,this.width=n.width,this.height=n.height)}this.sourceImg=n},get:function(n,t,i,r){return arguments.length?arguments.length===2?v.get(n,t,this):arguments.length===4?v.get(n,t,i,r,this):void 0:v.get(this)},set:function(n,t,i){v.set(n,t,i,this),this.__isDirty=!0},blend:function(n,t,i,r,u,f,e,o,s,h){arguments.length===9?v.blend(this,n,t,i,r,u,f,e,o,s,this):arguments.length===10&&v.blend(n,t,i,r,u,f,e,o,s,h,this),delete this.sourceImg},copy:function(n,t,i,r,u,f,e,o,s){arguments.length===8?v.blend(this,n,t,i,r,u,f,e,o,0,this):arguments.length===9&&v.blend(n,t,i,r,u,f,e,o,s,0,this),delete this.sourceImg},filter:function(n,t){arguments.length===2?v.filter(n,t,this):arguments.length===1&&v.filter(n,null,this),delete this.sourceImg},save:function(n){v.save(n,this)},resize:function(n,t){if(this.isRemote)throw"Image is loaded remotely. Cannot resize.";if(this.width!==0||this.height!==0){n===0&&t!==0?n=i.floor(this.width/this.height*t):t===0&&n!==0&&(t=i.floor(this.height/this.width*n));var r=vf(this.imageData).canvas,u=vf(r,n,t).context.getImageData(0,0,n,t);this.fromImageData(u)}},mask:function(n){var r=this.toImageData(),t,i;if(n instanceof ur||n.__isPImage)if(n.width===this.width&&n.height===this.height)for(n=n.toImageData(),t=2,i=this.width*this.height*4;t<i;t+=4)r.data[t+1]=n.data[t];else throw"mask must have the same dimensions as PImage.";else if(n instanceof Array)if(this.width*this.height===n.length)for(t=0,i=n.length;t<i;++t)r.data[t*4+3]=n[t];else throw"mask array must be the same length as PImage pixels array.";this.fromImageData(r)},loadPixels:s,toImageData:function(){if(this.isRemote)return this.sourceImg;if(!this.__isDirty)return this.imageData;var n=vf(this.sourceImg);return n.context.getImageData(0,0,this.width,this.height)},toDataURL:function(){if(this.isRemote)throw"Image is loaded remotely. Cannot create dataURI.";var n=vf(this.imageData);return n.canvas.toDataURL()},fromImageData:function(n){var r=n.width,u=n.height,i=t.createElement("canvas"),f=i.getContext("2d");this.width=i.width=r,this.height=i.height=u,f.putImageData(n,0,0),this.format=2,this.imageData=n,this.sourceImg=i}},v.PImage=ur,v.createImage=function(n,t,i){return new ur(n,t,i)},v.loadImage=function(n,i,r){var u,f;return(i&&(n=n+"."+i),ii.imageCache.images[n])?(u=new ur(ii.imageCache.images[n]),u.loaded=!0,u):(u=new ur,f=t.createElement("img"),u.sourceImg=f,f.onload=function(n,t,i){var f=n,r=t,u=i;return function(){r.fromHTMLImageData(f),r.loaded=!0,u&&u()}}(f,u,r),f.src=n,u)},v.requestImage=v.loadImage,v.get=function(n,t,i,r,u){return u!==undefined?tl(n,t,i,r,u):r!==undefined?nl(n,t,i,r):i!==undefined?sa(n,t,i):t!==undefined?oa(n,t):n!==undefined?tl(0,0,n.width,n.height,n):nl(0,0,v.width,v.height)},v.createGraphics=function(n,t,i){var r=new u;return r.size(n,t,i),r.background(0,0),r},v.set=function(n,t,i,r){var u,f;arguments.length===3?typeof i=="number"?la(n,t,i):(i instanceof ur||i.__isPImage)&&v.image(i,n,t):arguments.length===4&&aa(n,t,i,r)},v.imageData={},v.pixels={getLength:function(){return v.imageData.data.length?v.imageData.data.length/4:0},getPixel:function(n){var t=n*4,i=v.imageData.data;return i[t+3]<<24&4278190080|i[t+0]<<16&16711680|i[t+1]<<8&65280|i[t+2]&255},setPixel:function(n,t){var i=n*4,r=v.imageData.data;r[i+0]=(t&16711680)>>>16,r[i+1]=(t&65280)>>>8,r[i+2]=t&255,r[i+3]=(t&4278190080)>>>24},toArray:function(){for(var r=[],u=v.imageData.width*v.imageData.height,t=v.imageData.data,i=0,n=0;i<u;i++,n+=4)r.push(t[n+3]<<24&4278190080|t[n+0]<<16&16711680|t[n+1]<<8&65280|t[n+2]&255);return r},set:function(n){for(var t=0,i=n.length;t<i;t++)this.setPixel(t,n[t])}},v.loadPixels=function(){v.imageData=ei.$ensureContext().getImageData(0,0,v.width,v.height)},v.updatePixels=function(){v.imageData&&ei.$ensureContext().putImageData(v.imageData,0,0)},v.hint=function(n){var t=ei.$ensureContext();n===4?(t.disable(t.DEPTH_TEST),t.depthMask(!1),t.clear(t.DEPTH_BUFFER_BIT)):n===-4?(t.enable(t.DEPTH_TEST),t.depthMask(!0)):n===-1||n===2?su=!0:n===1&&(su=!1)},gs=function(n,t,i,r){var u;if(n instanceof ur||n.__isPImage){if(u=n,!u.loaded)throw"Error using image in background(): PImage not loaded.";if(u.width!==v.width||u.height!==v.height)throw"Background image must be the same dimensions as the canvas.";}else u=v.color(n,t,i,r);au=u},tt.prototype.background=function(n,t,i,u){n!==r&&gs(n,t,i,u),au instanceof ur||au.__isPImage?(du(),y.setTransform(1,0,0,1,0,0),v.image(au,0,0),gu()):(du(),y.setTransform(1,0,0,1,0,0),v.alpha(au)!==oi&&y.clearRect(0,0,v.width,v.height),y.fillStyle=v.color.toString(au),y.fillRect(0,0,v.width,v.height),eu=!0,gu())},rt.prototype.background=function(n,t,i,r){arguments.length>0&&gs(n,t,i,r);var u=v.color.toGLArray(au);y.clearColor(u[0],u[1],u[2],u[3]),y.clear(y.COLOR_BUFFER_BIT|y.DEPTH_BUFFER_BIT)},tt.prototype.image=function(n,t,r,u,f){var o,s;if(t=i.round(t),r=i.round(r),n.width>0){var c=u||n.width,l=f||n.height,e=lf(t||0,r||0,u||n.width,f||n.height,arguments.length<4),h=!!n.sourceImg&&hu===null;h?(o=n.sourceImg,n.__isDirty&&n.updatePixels(),y.drawImage(o,0,0,o.width,o.height,e.x,e.y,e.w,e.h)):(s=n.toImageData(),hu!==null&&(hu(s),n.__isDirty=!0),y.drawImage(vf(s).canvas,0,0,n.width,n.height,e.x,e.y,e.w,e.h))}},rt.prototype.image=function(n,t,r,u,f){n.width>0&&(t=i.round(t),r=i.round(r),u=u||n.width,f=f||n.height,v.beginShape(v.QUADS),v.texture(n),v.vertex(t,r,0,0,0),v.vertex(t,r+f,0,0,f),v.vertex(t+u,r+f,0,u,f),v.vertex(t+u,r,0,u,0),v.endShape())},v.tint=function(n,t,i,r){var u=v.color(n,t,i,r),f=v.red(u)/bi,e=v.green(u)/er,o=v.blue(u)/ki,s=v.alpha(u)/oi;hu=function(n){for(var i=n.data,r=4*n.width*n.height,t=0;t<r;)i[t++]*=f,i[t++]*=e,i[t++]*=o,i[t++]*=s},bo=function(n){for(var t=0;t<n.length;)n[t++]=f,n[t++]=e,n[t++]=o,n[t++]=s}},v.noTint=function(){hu=null,bo=null},v.copy=function(n,t,i,u,f,e,o,s,h){h===r&&(h=s,s=o,o=e,e=f,f=u,u=i,i=t,t=n,n=v),v.blend(n,t,i,u,f,e,o,s,h,0)},v.blend=function(n,t,i,u,f,e,o,s,h,c,l){if(n.isRemote)throw"Image is loaded remotely. Cannot blend image.";c===r&&(c=h,h=s,s=o,o=e,e=f,f=u,u=i,i=t,t=n,n=v);var y=t+u,p=i+f,w=e+s,b=o+h,a=l||v;(l===r||c===r)&&v.loadPixels(),n.loadPixels(),n===v&&v.intersect(t,i,y,p,e,o,w,b)?v.blit_resize(v.get(t,i,y-t,p-i),0,0,y-t-1,p-i-1,a.imageData.data,a.width,a.height,e,o,w,b,c):v.blit_resize(n,t,i,y,p,a.imageData.data,a.width,a.height,e,o,w,b,c),l===r&&v.updatePixels()};var va=function(n){var t=v.floor(n*3.5),i,e,u;if(t=t<1?1:t<248?t:248,v.shared.blurRadius!==t){v.shared.blurRadius=t,v.shared.blurKernelSize=1+(v.shared.blurRadius<<1),v.shared.blurKernel=new f(v.shared.blurKernelSize);var r=v.shared.blurKernel,o=v.shared.blurKernelSize,s=v.shared.blurRadius;for(i=0;i<o;i++)r[i]=0;for(u=(t-1)*(t-1),i=1;i<t;i++)r[t+i]=r[e]=u;r[t]=t*t}},ya=function(n,t){var r,y,p,w,b,ct,u,i,s,a,it,k,nt=t.pixels.getLength(),rt=new f(nt),ut=new f(nt),ft=new f(nt),et=new f(nt),d=0,e,g,c,o;va(n);var tt=t.height,h=t.width,ot=v.shared.blurKernelSize,st=v.shared.blurRadius,ht=v.shared.blurKernel,l=t.imageData.data;for(g=0;g<tt;g++){for(e=0;e<h;e++){if(w=p=y=b=r=0,i=e-st,i<0)k=-i,i=0;else{if(i>=h)break;k=0}for(c=k;c<ot;c++){if(i>=h)break;o=(i+d)*4,u=ht[c],b+=u*l[o+3],y+=u*l[o],p+=u*l[o+1],w+=u*l[o+2],r+=u,i++}s=d+e,et[s]=b/r,rt[s]=y/r,ut[s]=p/r,ft[s]=w/r}d+=h}for(d=0,a=-st,it=a*h,g=0;g<tt;g++){for(e=0;e<h;e++){if(w=p=y=b=r=0,a<0)k=s=-a,i=e;else{if(a>=tt)break;k=0,s=a,i=e+it}for(c=k;c<ot;c++){if(s>=tt)break;u=ht[c],b+=u*et[i],y+=u*rt[i],p+=u*ut[i],w+=u*ft[i],r+=u,s++,i+=h}o=(e+d)*4,l[o]=y/r,l[o+1]=p/r,l[o+2]=w/r,l[o+3]=b/r}d+=h,it+=h,a++}},il=function(n,t){var i=0,d=t.pixels.getLength(),nt=new et(d),g,y,h,u,r,c,l,a,v,f,e,o,s,p,w,b,k;if(n)while(i<d)for(g=i,y=i+t.width;i<y;)h=u=t.pixels.getPixel(i),l=i-1,c=i+1,a=i-t.width,v=i+t.width,l<g&&(l=i),c>=y&&(c=i),a<0&&(a=0),v>=d&&(v=i),o=t.pixels.getPixel(a),e=t.pixels.getPixel(l),s=t.pixels.getPixel(v),f=t.pixels.getPixel(c),r=77*(h>>16&255)+151*(h>>8&255)+28*(h&255),w=77*(e>>16&255)+151*(e>>8&255)+28*(e&255),p=77*(f>>16&255)+151*(f>>8&255)+28*(f&255),b=77*(o>>16&255)+151*(o>>8&255)+28*(o&255),k=77*(s>>16&255)+151*(s>>8&255)+28*(s&255),w<r&&(u=e,r=w),p<r&&(u=f,r=p),b<r&&(u=o,r=b),k<r&&(u=s,r=k),nt[i++]=u;else while(i<d)for(g=i,y=i+t.width;i<y;)h=u=t.pixels.getPixel(i),l=i-1,c=i+1,a=i-t.width,v=i+t.width,l<g&&(l=i),c>=y&&(c=i),a<0&&(a=0),v>=d&&(v=i),o=t.pixels.getPixel(a),e=t.pixels.getPixel(l),s=t.pixels.getPixel(v),f=t.pixels.getPixel(c),r=77*(h>>16&255)+151*(h>>8&255)+28*(h&255),w=77*(e>>16&255)+151*(e>>8&255)+28*(e&255),p=77*(f>>16&255)+151*(f>>8&255)+28*(f&255),b=77*(o>>16&255)+151*(o>>8&255)+28*(o&255),k=77*(s>>16&255)+151*(s>>8&255)+28*(s&255),w>r&&(u=e,r=w),p>r&&(u=f,r=p),b>r&&(u=o,r=b),k>r&&(u=s,r=k),nt[i++]=u;t.pixels.set(nt)};if(v.filter=function(n,t,i){var f,e,h,u,o,p,s,c,w,b;if(arguments.length===3?(i.loadPixels(),f=i):(v.loadPixels(),f=v),t===r&&(t=null),f.isRemote)throw"Image is loaded remotely. Cannot filter image.";o=f.pixels.getLength();switch(n){case 11:p=t||1,ya(p,f);break;case 12:if(f.format===4){for(u=0;u<o;u++)e=255-f.pixels.getPixel(u),f.pixels.setPixel(u,4278190080|e<<16|e<<8|e);f.format=1}else for(u=0;u<o;u++)e=f.pixels.getPixel(u),h=77*(e>>16&255)+151*(e>>8&255)+28*(e&255)>>8,f.pixels.setPixel(u,e&4278190080|h<<16|h<<8|h);break;case 13:for(u=0;u<o;u++)f.pixels.setPixel(u,f.pixels.getPixel(u)^16777215);break;case 15:if(t===null)throw"Use filter(POSTERIZE, int levels) instead of filter(POSTERIZE)";if(s=v.floor(t),s<2||s>255)throw"Levels must be between 2 and 255 for filter(POSTERIZE, levels)";for(c=s-1,u=0;u<o;u++){var l=f.pixels.getPixel(u)>>16&255,a=f.pixels.getPixel(u)>>8&255,y=f.pixels.getPixel(u)&255;l=(l*s>>8)*255/c,a=(a*s>>8)*255/c,y=(y*s>>8)*255/c,f.pixels.setPixel(u,4278190080&f.pixels.getPixel(u)|l<<16|a<<8|y)}break;case 14:for(u=0;u<o;u++)f.pixels.setPixel(u,f.pixels.getPixel(u)|4278190080);f.format=1;break;case 16:if(t===null&&(t=.5),t<0||t>1)throw"Level must be between 0 and 1 for filter(THRESHOLD, level)";for(w=v.floor(t*255),u=0;u<o;u++)b=v.max((f.pixels.getPixel(u)&16711680)>>16,v.max((f.pixels.getPixel(u)&65280)>>8,f.pixels.getPixel(u)&255)),f.pixels.setPixel(u,f.pixels.getPixel(u)&4278190080|(b<w?0:16777215));break;case 17:il(!0,f);break;case 18:il(!1,f)}f.updatePixels()},v.shared={fracU:0,ifU:0,fracV:0,ifV:0,u1:0,u2:0,v1:0,v2:0,sX:0,sY:0,iw:0,iw1:0,ih1:0,ul:0,ll:0,ur:0,lr:0,cUL:0,cLL:0,cUR:0,cLR:0,srcXOffset:0,srcYOffset:0,r:0,g:0,b:0,a:0,srcBuffer:null,blurRadius:0,blurKernelSize:0,blurKernel:null},v.intersect=function(n,t,i,r,u,f,e,o){var c=i-n+1,l=r-t+1,s=e-u+1,h=o-f+1,a,v;return u<n?(s+=u-n,s>c&&(s=c)):(a=c+n-u,s>a&&(s=a)),f<t?(h+=f-t,h>l&&(h=l)):(v=l+t-f,h>v&&(h=v)),!(s<=0||h<=0)},hi={},hi[1]=v.modes.blend,hi[2]=v.modes.add,hi[4]=v.modes.subtract,hi[8]=v.modes.lightest,hi[16]=v.modes.darkest,hi[0]=v.modes.replace,hi[32]=v.modes.difference,hi[64]=v.modes.exclusion,hi[128]=v.modes.multiply,hi[256]=v.modes.screen,hi[512]=v.modes.overlay,hi[1024]=v.modes.hard_light,hi[2048]=v.modes.soft_light,hi[4096]=v.modes.dodge,hi[8192]=v.modes.burn,v.blit_resize=function(n,t,r,u,f,e,o,s,h,c,l,a,y){var ht,lt,at,bt;t<0&&(t=0),r<0&&(r=0),u>=n.width&&(u=n.width-1),f>=n.height&&(f=n.height-1);var vt=u-t,yt=f-r,it=l-h,rt=a-c;if(!(it<=0)&&!(rt<=0)&&!(vt<=0)&&!(yt<=0)&&!(h>=o)&&!(c>=s)&&!(t>=n.width)&&!(r>=n.height)){var pt=i.floor(vt/it*32768),wt=i.floor(yt/rt*32768),p=v.shared;p.srcXOffset=i.floor(h<0?-h*pt:t*32768),p.srcYOffset=i.floor(c<0?-c*wt:r*32768),h<0&&(it+=h,h=0),c<0&&(rt+=c,c=0),it=i.min(it,o-h),rt=i.min(rt,s-c),at=c*o+h,p.srcBuffer=n.imageData.data,p.iw=n.width,p.iw1=n.width-1,p.ih1=n.height-1;var ti=v.filter_bilinear,ii=v.filter_new_scanline,dt=hi[y],ut,nt,ft,et,ot,st,b=4278190080,k=16711680,d=65280,g=255,ct=32767,tt=15,gt=1,ni=9,w=p.srcBuffer,kt=i.min;for(lt=0;lt<rt;lt++){for(p.sX=p.srcXOffset,p.fracV=p.srcYOffset&ct,p.ifV=ct-p.fracV,p.v1=(p.srcYOffset>>tt)*p.iw,p.v2=kt((p.srcYOffset>>tt)+1,p.ih1)*p.iw,ht=0;ht<it;ht++)nt=(at+ht)*4,bt=e[nt+3]<<24&b|e[nt]<<16&k|e[nt+1]<<8&d|e[nt+2]&g,p.fracU=p.sX&ct,p.ifU=ct-p.fracU,p.ul=p.ifU*p.ifV>>tt,p.ll=p.ifU*p.fracV>>tt,p.ur=p.fracU*p.ifV>>tt,p.lr=p.fracU*p.fracV>>tt,p.u1=p.sX>>tt,p.u2=kt(p.u1+1,p.iw1),ft=(p.v1+p.u1)*4,et=(p.v1+p.u2)*4,ot=(p.v2+p.u1)*4,st=(p.v2+p.u2)*4,p.cUL=w[ft+3]<<24&b|w[ft]<<16&k|w[ft+1]<<8&d|w[ft+2]&g,p.cUR=w[et+3]<<24&b|w[et]<<16&k|w[et+1]<<8&d|w[et+2]&g,p.cLL=w[ot+3]<<24&b|w[ot]<<16&k|w[ot+1]<<8&d|w[ot+2]&g,p.cLR=w[st+3]<<24&b|w[st]<<16&k|w[st+1]<<8&d|w[st+2]&g,p.r=p.ul*((p.cUL&k)>>16)+p.ll*((p.cLL&k)>>16)+p.ur*((p.cUR&k)>>16)+p.lr*((p.cLR&k)>>16)<<gt&k,p.g=p.ul*(p.cUL&d)+p.ll*(p.cLL&d)+p.ur*(p.cUR&d)+p.lr*(p.cLR&d)>>>tt&d,p.b=p.ul*(p.cUL&g)+p.ll*(p.cLL&g)+p.ur*(p.cUR&g)+p.lr*(p.cLR&g)>>>tt,p.a=p.ul*((p.cUL&b)>>>24)+p.ll*((p.cLL&b)>>>24)+p.ur*((p.cUR&b)>>>24)+p.lr*((p.cLR&b)>>>24)<<ni&b,ut=dt(bt,p.a|p.r|p.g|p.b),e[nt]=(ut&k)>>>16,e[nt+1]=(ut&d)>>>8,e[nt+2]=ut&g,e[nt+3]=(ut&b)>>>24,p.sX+=pt;at+=o,p.srcYOffset+=wt}}},v.loadFont=function(n,t){if(n===r)throw"font name required in loadFont.";if(n.indexOf(".svg")===-1)return t===r&&(t=ti.size),e.get(n,t);var i=v.loadGlyphs(n);return{name:n,css:"12px sans-serif",glyph:!0,units_per_em:i.units_per_em,horiz_adv_x:1/i.units_per_em*i.horiz_adv_x,ascent:i.ascent,descent:i.descent,width:function(t){for(var r=0,f=t.length,i=0;i<f;i++)try{r+=parseFloat(v.glyphLook(v.glyphTable[n],t[i]).horiz_adv_x)}catch(e){u.debug(e)}return r/v.glyphTable[n].units_per_em}}},v.createFont=function(n,t){return v.loadFont(n,t)},v.textFont=function(n,t){t!==r&&(n.glyph||(n=e.get(n.name,t)),lr=t),ti=n,ff=ti.name,tu=ti.ascent,ar=ti.descent,tr=ti.leading;var i=ei.$ensureContext();i.font=ti.css},v.textSize=function(n){ti=e.get(ff,n),lr=n,tu=ti.ascent,ar=ti.descent,tr=ti.leading;var t=ei.$ensureContext();t.font=ti.css},v.textAscent=function(){return tu},v.textDescent=function(){return ar},v.textLeading=function(n){tr=n},v.textAlign=function(n,t){vu=n,nu=t||0},tt.prototype.textWidth=function(n){var u=yf(n).split(/\r?\n/g),r=0,t,f=u.length;for(y.font=ti.css,t=0;t<f;++t)r=i.max(r,ti.measureTextWidth(u[t]));return r|0},rt.prototype.textWidth=function(n){var o=yf(n).split(/\r?\n/g),f=0,u,s=o.length,e;for(nr===r&&(nr=t.createElement("canvas")),e=nr.getContext("2d"),e.font=ti.css,u=0;u<s;++u)f=i.max(f,e.measureText(o[u]).width);return f|0},v.glyphLook=function(n,t){try{switch(t){case"1":return n.one;case"2":return n.two;case"3":return n.three;case"4":return n.four;case"5":return n.five;case"6":return n.six;case"7":return n.seven;case"8":return n.eight;case"9":return n.nine;case"0":return n.zero;case" ":return n.space;case"$":return n.dollar;case"!":return n.exclam;case'"':return n.quotedbl;case"#":return n.numbersign;case"%":return n.percent;case"&":return n.ampersand;case"'":return n.quotesingle;case"(":return n.parenleft;case")":return n.parenright;case"*":return n.asterisk;case"+":return n.plus;case",":return n.comma;case"-":return n.hyphen;case".":return n.period;case"/":return n.slash;case"_":return n.underscore;case":":return n.colon;case";":return n.semicolon;case"<":return n.less;case"=":return n.equal;case">":return n.greater;case"?":return n.question;case"@":return n.at;case"[":return n.bracketleft;case"\\":return n.backslash;case"]":return n.bracketright;case"^":return n.asciicircum;case"`":return n.grave;case"{":return n.braceleft;case"|":return n.bar;case"}":return n.braceright;case"~":return n.asciitilde;default:return n[t]}}catch(i){u.debug(i)}},tt.prototype.text$line=function(n,t,i,r,f){var e=0,o=0,s,l,c,h,a;if(ti.glyph){for(s=v.glyphTable[ff],du(),y.translate(t,i+lr),(f===39||f===3)&&(e=s.width(n),o=f===39?-e:-e/2),l=s.units_per_em,c=1/l*lr,y.scale(c,c),h=0,a=n.length;h<a;h++)try{v.glyphLook(s,n[h]).draw()}catch(p){u.debug(p)}gu()}else n&&"fillText"in y&&(eu&&(y.fillStyle=v.color.toString(fu),eu=!1),(f===39||f===3)&&(e=ti.measureTextWidth(n),o=f===39?-e:-e/2),y.fillText(n,t+o,i))},rt.prototype.text$line=function(n,i,u,f,e){var a,c,v,l,o,s,h;nr===r&&(nr=t.createElement("canvas")),a=y,y=nr.getContext("2d"),y.font=ti.css,c=ti.measureTextWidth(n),nr.width=c,nr.height=lr,y=nr.getContext("2d"),y.font=ti.css,y.textBaseline="top",tt.prototype.text$line(n,0,0,0,37),v=nr.width/nr.height,y=a,y.bindTexture(y.TEXTURE_2D,lh),y.texImage2D(y.TEXTURE_2D,0,y.RGBA,y.RGBA,y.UNSIGNED_BYTE,nr),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MAG_FILTER,y.LINEAR),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,y.LINEAR),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_T,y.CLAMP_TO_EDGE),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_S,y.CLAMP_TO_EDGE),l=0,e===39?l=-c:e===3&&(l=-c/2),o=new ut,s=lr*.5,o.translate(i+l-s/2,u-s,f),o.scale(-v*s,-s,s),o.translate(-1,-1,-1),o.transpose(),h=new ut,h.scale(1,-1,1),h.apply(ht.array()),h.transpose(),y.useProgram(ft),fi("aVertex2d",ft,"aVertex",3,os),fi("aTextureCoord2d",ft,"aTextureCoord",2,ss),gt("uSampler2d",ft,"uSampler",[0]),gt("uIsDrawingText2d",ft,"uIsDrawingText",!0),kt("uModel2d",ft,"uModel",!1,o.array()),kt("uView2d",ft,"uView",!1,h.array()),dt("uColor2d",ft,"uColor",di),y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,hs),y.drawElements(y.TRIANGLES,6,y.UNSIGNED_SHORT,0)},v.text=function(){no!==5&&(arguments.length===3?rl(yf(arguments[0]),arguments[1],arguments[2],0):arguments.length===4?rl(yf(arguments[0]),arguments[1],arguments[2],arguments[3]):arguments.length===5?ul(yf(arguments[0]),arguments[1],arguments[2],arguments[3],arguments[4],0):arguments.length===6&&ul(yf(arguments[0]),arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]))},v.textMode=function(n){no=n},v.loadGlyphs=function(f){var e,o,h,c,l,a,b,p,w,k,y,nt="[0-9\\-]+",s,d=function(n,t){for(var i=0,r=[],f=new RegExp(n,"g"),u=r[i]=f.exec(t);u;)i++,u=r[i]=f.exec(t);return r},tt=function(n){var f=d("[A-Za-z][0-9\\- ]+|Z",n),v=function(){return du(),ei.$ensureContext()},b=function(){ru(),dr(),gu()},r,u,t;for(s="return {draw:function(){var curContext=beforePathDraw();curContext.beginPath();",e=0,o=0,h=0,c=0,l=0,a=0,n=0,p=0,w="",k=f.length-1,r=0;r<k;r++){u=f[r][0],t=d(nt,u);switch(u[0]){case"M":e=parseFloat(t[0][0]),o=parseFloat(t[1][0]),s+="curContext.moveTo("+e+","+-o+");";break;case"L":e=parseFloat(t[0][0]),o=parseFloat(t[1][0]),s+="curContext.lineTo("+e+","+-o+");";break;case"H":e=parseFloat(t[0][0]),s+="curContext.lineTo("+e+","+-o+");";break;case"V":o=parseFloat(t[0][0]),s+="curContext.lineTo("+e+","+-o+");";break;case"T":l=parseFloat(t[0][0]),a=parseFloat(t[1][0]),w==="Q"||w==="T"?(n=i.sqrt(i.pow(e-h,2)+i.pow(c-o,2)),p=i.PI+i.atan2(h-e,c-o),h=e+i.sin(p)*n,c=o+i.cos(p)*n):(h=e,c=o),s+="curContext.quadraticCurveTo("+h+","+-c+","+l+","+-a+");",e=l,o=a;break;case"Q":h=parseFloat(t[0][0]),c=parseFloat(t[1][0]),l=parseFloat(t[2][0]),a=parseFloat(t[3][0]),s+="curContext.quadraticCurveTo("+h+","+-c+","+l+","+-a+");",e=l,o=a;break;case"Z":s+="curContext.closePath();"}w=u[0]}return s+="afterPathDraw();",s+="curContext.translate("+y+",0);",s+="}}",new Function("beforePathDraw","afterPathDraw",s)(v,b)},g=function(n){var c=n.getElementsByTagName("font"),u,i,o,t,h,e;for(v.glyphTable[f].horiz_adv_x=c[0].getAttribute("horiz-adv-x"),u=n.getElementsByTagName("font-face")[0],v.glyphTable[f].units_per_em=parseFloat(u.getAttribute("units-per-em")),v.glyphTable[f].ascent=parseFloat(u.getAttribute("ascent")),v.glyphTable[f].descent=parseFloat(u.getAttribute("descent")),i=n.getElementsByTagName("glyph"),o=i.length,t=0;t<o;t++)h=i[t].getAttribute("unicode"),e=i[t].getAttribute("glyph-name"),y=i[t].getAttribute("horiz-adv-x"),y===null&&(y=v.glyphTable[f].horiz_adv_x),b=i[t].getAttribute("d"),b!==r&&(s=tt(b),v.glyphTable[f][e]={name:e,unicode:h,horiz_adv_x:y,draw:s.draw})},it=function(){var i,r;try{i=t.implementation.createDocument("","",null)}catch(e){u.debug(e.message);return}try{i.async=!1,i.load(f),g(i.getElementsByTagName("svg")[0])}catch(o){u.debug(o);try{r=new n.XMLHttpRequest,r.open("GET",f,!1),r.send(null),g(r.responseXML.documentElement)}catch(s){u.debug(o)}}};return v.glyphTable[f]={},it(f),v.glyphTable[f]},v.param=function(n){var r="data-processing-"+n,i,u,t;if(d.hasAttribute(r))return d.getAttribute(r);for(i=0,u=d.childNodes.length;i<u;++i)if((t=d.childNodes.item(i),t.nodeType===1&&t.tagName.toLowerCase()==="param")&&t.getAttribute("name")===n)return t.getAttribute("value");return ii.params.hasOwnProperty(n)?ii.params[n]:null},nt.prototype.translate=st("translate"),nt.prototype.transform=st("transform"),nt.prototype.scale=st("scale"),nt.prototype.pushMatrix=st("pushMatrix"),nt.prototype.popMatrix=st("popMatrix"),nt.prototype.resetMatrix=st("resetMatrix"),nt.prototype.applyMatrix=st("applyMatrix"),nt.prototype.rotate=st("rotate"),nt.prototype.rotateZ=st("rotateZ"),nt.prototype.shearX=st("shearX"),nt.prototype.shearY=st("shearY"),nt.prototype.redraw=st("redraw"),nt.prototype.toImageData=st("toImageData"),nt.prototype.ambientLight=st("ambientLight"),nt.prototype.directionalLight=st("directionalLight"),nt.prototype.lightFalloff=st("lightFalloff"),nt.prototype.lightSpecular=st("lightSpecular"),nt.prototype.pointLight=st("pointLight"),nt.prototype.noLights=st("noLights"),nt.prototype.spotLight=st("spotLight"),nt.prototype.beginCamera=st("beginCamera"),nt.prototype.endCamera=st("endCamera"),nt.prototype.frustum=st("frustum"),nt.prototype.box=st("box"),nt.prototype.sphere=st("sphere"),nt.prototype.ambient=st("ambient"),nt.prototype.emissive=st("emissive"),nt.prototype.shininess=st("shininess"),nt.prototype.specular=st("specular"),nt.prototype.fill=st("fill"),nt.prototype.stroke=st("stroke"),nt.prototype.strokeWeight=st("strokeWeight"),nt.prototype.smooth=st("smooth"),nt.prototype.noSmooth=st("noSmooth"),nt.prototype.point=st("point"),nt.prototype.vertex=st("vertex"),nt.prototype.endShape=st("endShape"),nt.prototype.bezierVertex=st("bezierVertex"),nt.prototype.curveVertex=st("curveVertex"),nt.prototype.curve=st("curve"),nt.prototype.line=st("line"),nt.prototype.bezier=st("bezier"),nt.prototype.rect=st("rect"),nt.prototype.ellipse=st("ellipse"),nt.prototype.background=st("background"),nt.prototype.image=st("image"),nt.prototype.textWidth=st("textWidth"),nt.prototype.text$line=st("text$line"),nt.prototype.$ensureContext=st("$ensureContext"),nt.prototype.$newPMatrix=st("$newPMatrix"),nt.prototype.size=function(n,t,i){pf(i===2?"3D":"2D"),v.size(n,t,i)},nt.prototype.$init=s,tt.prototype.$init=function(){v.size(v.width,v.height),y.lineCap="round",v.noSmooth(),v.disableContextMenu()},rt.prototype.$init=function(){v.use3DContext=!0,v.disableContextMenu()},bt.prototype.$ensureContext=function(){return y},ri(d,"touchstart",function(n){var i,u,t;for(d.setAttribute("style","-webkit-user-select: none"),d.setAttribute("onclick","void(0)"),d.setAttribute("style","-webkit-tap-highlight-color:rgba(0,0,0,0)"),i=0,u=nf.length;i<u;i++)t=nf[i].type,(t==="mouseout"||t==="mousemove"||t==="mousedown"||t==="mouseup"||t==="DOMMouseScroll"||t==="mousewheel"||t==="touchstart")&&ws(nf[i]);v.touchStart!==r||v.touchMove!==r||v.touchEnd!==r||v.touchCancel!==r?(ri(d,"touchstart",function(n){v.touchStart!==r&&(n=oo(n),v.touchStart(n))}),ri(d,"touchmove",function(n){v.touchMove!==r&&(n.preventDefault(),n=oo(n),v.touchMove(n))}),ri(d,"touchend",function(n){v.touchEnd!==r&&(n=oo(n),v.touchEnd(n))}),ri(d,"touchcancel",function(n){v.touchCancel!==r&&(n=oo(n),v.touchCancel(n))})):(ri(d,"touchstart",function(n){eo(d,n.touches[0]),v.__mousePressed=!0,v.mouseDragging=!1,v.mouseButton=37,typeof v.mousePressed=="function"&&v.mousePressed()}),ri(d,"touchmove",function(n){n.preventDefault(),eo(d,n.touches[0]),typeof v.mouseMoved!="function"||v.__mousePressed||v.mouseMoved(),typeof v.mouseDragged=="function"&&v.__mousePressed&&(v.mouseDragged(),v.mouseDragging=!0)}),ri(d,"touchend",function(){v.__mousePressed=!1,typeof v.mouseClicked!="function"||v.mouseDragging||v.mouseClicked(),typeof v.mouseReleased=="function"&&v.mouseReleased()})),d.dispatchEvent(n)}),function(){var n=!0,t=function(n){n.preventDefault(),n.stopPropagation()};v.disableContextMenu=function(){n&&(ri(d,"contextmenu",t),n=!1)},v.enableContextMenu=function(){n||(ws({elem:d,type:"contextmenu",fn:t}),n=!0)}}(),ri(d,"mousemove",function(n){eo(d,n),typeof v.mouseMoved!="function"||v.__mousePressed||v.mouseMoved(),typeof v.mouseDragged=="function"&&v.__mousePressed&&(v.mouseDragged(),v.mouseDragging=!0)}),ri(d,"mouseout",function(){typeof v.mouseOut=="function"&&v.mouseOut()}),ri(d,"mouseover",function(n){eo(d,n),typeof v.mouseOver=="function"&&v.mouseOver()}),d.onmousedown=function(){return d.focus(),!1},ri(d,"mousedown",function(n){v.__mousePressed=!0,v.mouseDragging=!1;switch(n.which){case 1:v.mouseButton=37;break;case 2:v.mouseButton=3;break;case 3:v.mouseButton=39}typeof v.mousePressed=="function"&&v.mousePressed()}),ri(d,"mouseup",function(){v.__mousePressed=!1,typeof v.mouseClicked!="function"||v.mouseDragging||v.mouseClicked(),typeof v.mouseReleased=="function"&&v.mouseReleased()}),nh=function(t){var i=0;t.wheelDelta?(i=t.wheelDelta/120,n.opera&&(i=-i)):t.detail&&(i=-t.detail/3),v.mouseScroll=i,i&&typeof v.mouseScrolled=="function"&&v.mouseScrolled()},ri(t,"DOMMouseScroll",nh),ri(t,"mousewheel",nh),d.getAttribute("tabindex")||d.setAttribute("tabindex",0),ho)ii=new u.Sketch,pf(),v.size=function(n,t,i){i&&i===2?pf("3D"):pf("2D"),v.size(n,t,i)};else{ii=l instanceof u.Sketch?l:typeof l=="function"?new u.Sketch(l):l?u.compile(l):new u.Sketch(function(){}),v.externals.sketch=ii,pf(),d.onfocus=function(){v.focused=!0},d.onblur=function(){v.focused=!1,ii.options.globalKeyEvents||sl()},ii.options.pauseOnBlur&&(ri(n,"focus",function(){lu&&v.loop()}),ri(n,"blur",function(){lu&&le&&(v.noLoop(),lu=!0),sl()})),so=ii.options.globalKeyEvents?n:d,ri(so,"keydown",wa),ri(so,"keypress",ba),ri(so,"keyup",ka);for(wf in u.lib)u.lib.hasOwnProperty(wf)&&(u.lib[wf].hasOwnProperty("attach")?u.lib[wf].attach(v):u.lib[wf]instanceof Function&&u.lib[wf].call(this));ih=100,rh=function(i){if(ii.imageCache.pending||e.preloading.pending(ih))n.setTimeout(function(){rh(i)},ih);else{if(n.opera){var r,f,u=ii.imageCache.operaCache;for(r in u)u.hasOwnProperty(r)&&(f=u[r],f!==null&&t.body.removeChild(f),delete u[r])}ii.attach(i,o);ii.onLoad(i);i.setup&&(i.setup(),i.resetMatrix(),ii.onSetup()),he(),i.draw&&(lu?i.loop():i.redraw())}},vt(this),rh(v)}},u.debug=ft,u.prototype=o,u.compile=function(n){var t=new u.Sketch,i=bt(n,t),r=wt(i);return t.sourceCode=r,t},ut=function(){var n={},u="undefined",f="function",i=!1,e=!0,o=512,r="log";return typeof tinylog!==u&&typeof tinylog[r]===f?n[r]=tinylog[r]:typeof t===u||t.fake?typeof print===f&&(n[r]=print):function(){var f=t,s="div",a="style",v="title",d={zIndex:1e4,position:"fixed",bottom:"0px",width:"100%",height:"15%",fontFamily:"sans-serif",color:"#ccc",backgroundColor:"black"},g={position:"relative",fontFamily:"monospace",overflow:"auto",height:"100%",paddingTop:"5px"},nt={height:"5px",marginTop:"-5px",cursor:"n-resize",backgroundColor:"darkgrey"},tt={position:"absolute",top:"5px",right:"20px",color:"#111",MozBorderRadius:"4px",webkitBorderRadius:"4px",borderRadius:"4px",cursor:"pointer",fontWeight:"normal",textAlign:"center",padding:"3px 5px",backgroundColor:"#333",fontSize:"12px"},it={minHeight:"16px"},rt={fontSize:"12px",margin:"0 8px 0 8px",maxWidth:"100%",whiteSpace:"pre-wrap",overflow:"auto"},p=f.defaultView,l=f.documentElement,y=l[a],w=function(){for(var i=arguments.length,r,n,t;i--;){n=arguments[i--],r=arguments[i][a];for(t in n)n.hasOwnProperty(t)&&(r[t]=n[t])}},h=function(n,t,r){return n.addEventListener?n.addEventListener(t,r,i):n.attachEvent&&n.attachEvent("on"+t,r),[n,t,r]},ut=function(n,t,r){n.removeEventListener?n.removeEventListener(t,r,i):n.detachEvent&&n.detachEvent("on"+t,r)},b=function(n){for(var t=n.childNodes,i=t.length;i--;)n.removeChild(t.item(0))},u=function(n,t){return n.appendChild(t)},c=function(n){return f.createElement(n)},k=function(n){return f.createTextNode(n)},ft=n[r]=function(t){var vt,dt=y.paddingBottom,et=c(s),yt=et[a],st=u(et,c(s)),ot=u(et,c(s)),ct=u(et,c(s)),ht=i,lt=i,at=i,pt=0,wt=function(){y.paddingBottom=et.clientHeight+"px"},bt=function(n){var t=p.innerHeight,i=st.clientHeight;n<0?n=0:n+i>t&&(n=t-i),yt.height=n/t*100+"%",wt()},kt=[h(f,"mousemove",function(n){ht&&(bt(p.innerHeight-n.clientY),ot.scrollTop=at)}),h(f,"mouseup",function(){ht&&(ht=at=i)}),h(st,"dblclick",function(n){n.preventDefault(),lt?(bt(lt),lt=i):(lt=et.clientHeight,yt.height="0px")}),h(st,"mousedown",function(n){n.preventDefault(),ht=e,at=ot.scrollTop}),h(st,"contextmenu",function(){ht=i}),h(ct,"click",function(){vt()})];vt=function(){for(var t=kt.length;t--;)ut.apply(n,kt[t]);l.removeChild(et),y.paddingBottom=dt,b(ot),b(et),n[r]=ft},w(et,d,ot,g,st,nt,ct,tt),ct[v]="Close Log",u(ct,k("✖")),st[v]="Double-click to toggle log minimization",l.insertBefore(et,l.firstChild),n[r]=function(n){pt===o?ot.removeChild(ot.firstChild):pt++;var t=u(ot,c(s)),i=u(t,c(s));t[v]=(new Date).toLocaleTimeString(),w(t,it,i,rt),u(i,k(n)),ot.scrollTop=ot.scrollHeight},n[r](t),wt()}}(),n}(),u.logger=ut,u.version="1.4.1",u.lib={},u.registerLibrary=function(n,t){u.lib[n]=t,t.hasOwnProperty("init")&&t.init(o)},u.instances=c,u.getInstanceById=function(n){return c[w[n]]},u.Sketch=function(i){this.attachFunction=i,this.options={pauseOnBlur:!1,globalKeyEvents:!1},this.onLoad=s,this.onSetup=s,this.onPause=s,this.onLoop=s,this.onFrameStart=s,this.onFrameEnd=s,this.onExit=s,this.params={},this.imageCache={pending:0,images:{},operaCache:{},add:function(i,r){if(!this.images[i]&&(d||(this.images[i]=null),r||(r=new Image,r.onload=function(n){return function(){n.pending--}}(this),this.pending++,r.src=i),this.images[i]=r,n.opera)){var u=t.createElement("div");u.appendChild(r),u.style.position="absolute",u.style.opacity=0,u.style.width="1px",u.style.height="1px",this.operaCache[i]||(t.body.appendChild(u),this.operaCache[i]=u)}}},this.sourceCode=undefined,this.attach=function(n){if(typeof this.attachFunction=="function")this.attachFunction(n);else if(this.sourceCode){var t=new Function("return ("+this.sourceCode+");")();t(n),this.attachFunction=t}else throw"Unable to attach sketch to the processing instance";},this.toString=function(){var n,t="((function(Sketch) {\n",i;t+="var sketch = new Sketch(\n"+this.sourceCode+");\n";for(n in this.options)this.options.hasOwnProperty(n)&&(i=this.options[n],t+="sketch.options."+n+" = "+(typeof i=="string"?'"'+i+'"':""+i)+";\n");for(n in this.imageCache)this.options.hasOwnProperty(n)&&(t+='sketch.imageCache.add("'+n+'");\n');return t+="return sketch;\n})(Processing.Sketch))"}},b=function(i,r){function c(t,i){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(r.readyState===4){var t;r.status!==200&&r.status!==0?t="Invalid XHR status "+r.status:r.responseText===""&&(t="withCredentials"in new XMLHttpRequest&&(new XMLHttpRequest).withCredentials===!1&&n.location.protocol==="file:"?"XMLHttpRequest failure, possibly due to a same-origin policy violation. You can try loading this page in another browser, or load it from http://localhost using a local webserver. See the Processing.js README for a more detailed explanation of this problem and solutions.":"File is empty."),i(r.responseText,t)}},r.open("GET",t,!0),r.overrideMimeType&&r.overrideMimeType("application/json"),r.setRequestHeader("If-Modified-Since","Fri, 01 Jan 1960 00:00:00 GMT"),r.send(null)}function l(n,r){function f(t,f){if(o[n]=t,++h,f&&e.push(r+" ==> "+f),h===s)if(e.length===0)try{return new u(i,o.join("\n"))}catch(c){throw"Processing.js: Unable to execute pjs sketch: "+c;}else throw"Processing.js: Unable to load pjs sketch files: "+e.join("\n");}if(r.charAt(0)==="#"){var l=t.getElementById(r.substring(1));l?f(l.text||l.textContent):f("","Unable to load pjs sketch: element with id '"+r.substring(1)+"' was not found");return}c(r,f)}for(var o=[],e=[],s=r.length,h=0,f=0;f<s;++f)l(f,r[f])},v=function(){var n,o,s,k,h,l,f,d,g,nt,p,a,i,y,w,e;for(t.removeEventListener("DOMContentLoaded",v,!1),c=[],n=t.getElementsByTagName("canvas"),s=0,k=n.length;s<k;s++)if(h=n[s].getAttribute("data-processing-sources"),h===null&&(h=n[s].getAttribute("data-src"),h===null&&(h=n[s].getAttribute("datasrc"))),h){for(o=h.split(/\s+/g),l=0;l<o.length;)o[l]?l++:o.splice(l,1);b(n[s],o)}for(p=t.getElementsByTagName("script"),a=[],f=p.length-1;f>=0;f--)a.push(p[f]);for(f=0,d=a.length;f<d;f++)if((i=a[f],i.getAttribute)&&(y=i.getAttribute("type"),y&&(y.toLowerCase()==="text/processing"||y.toLowerCase()==="application/processing"))){if(w=i.getAttribute("data-processing-target"),n=r,w)n=t.getElementById(w);else{for(e=i.nextSibling;e&&e.nodeType!==1;)e=e.nextSibling;e&&e.nodeName.toLowerCase()==="canvas"&&(n=e)}if(n){if(i.getAttribute("src")){o=i.getAttribute("src").split(/\s+/),b(n,o);continue}g=i.textContent||i.text,nt=new u(n,g)}}},u.reload=function(){if(c.length>0)for(var n=c.length-1;n>=0;n--)c[n]&&c[n].exit();v()},u.loadSketchFromSources=b,u.disableInit=function(){d&&t.removeEventListener("DOMContentLoaded",v,!1)},d?(n.Processing=u,t.addEventListener("DOMContentLoaded",v,!1)):this.Processing=u})(window,window.document,Math)