mirror of
https://github.com/wahyd4/cdnjs.git
synced 2026-08-12 06:16:02 +10:00
13 lines
187 KiB
JavaScript
13 lines
187 KiB
JavaScript
/***
|
|
|
|
P R O C E S S I N G . J S - 1.3.6-API
|
|
a port of the Processing visualization language
|
|
|
|
Processing.js is licensed under the MIT License, see LICENSE.
|
|
For a list of copyright holders, please refer to AUTHORS.
|
|
|
|
http://processingjs.org
|
|
|
|
***/
|
|
|
|
(function(l,u,o,c){var h=function(){};var s=function(){if("console" in l){return function(G){l.console.log("Processing.js: "+G)}}return h()}();var r=function(G){var H=new XMLHttpRequest;H.open("GET",G,false);if(H.overrideMimeType){H.overrideMimeType("text/plain")}H.setRequestHeader("If-Modified-Since","Fri, 01 Jan 1960 00:00:00 GMT");H.send(null);if(H.status!==200&&H.status!==0){throw"XMLHttpRequest failed, status code "+H.status}return H.responseText};var F="document" in this&&!("fake" in this.document);u.head=u.head||u.getElementsByTagName("head")[0];function i(G,H){if(G in l){return l[G]}if(typeof l[H]==="function"){return l[H]}return function(J){if(J instanceof Array){return J}if(typeof J==="number"){var I=[];I.length=J;return I}}}var d=i("Float32Array","WebGLFloatArray"),m=i("Int32Array","WebGLIntArray"),w=i("Uint16Array","WebGLUnsignedShortArray"),q=i("Uint8Array","WebGLUnsignedByteArray");var j={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:0.0001,MAX_FLOAT:3.4028235e+38,MIN_FLOAT:-3.4028235e+38,MAX_INT:2147483647,MIN_INT:-2147483648,PI:o.PI,TWO_PI:2*o.PI,HALF_PI:o.PI/2,THIRD_PI:o.PI/3,QUARTER_PI:o.PI/4,DEG_TO_RAD:o.PI/180,RAD_TO_DEG:180/o.PI,WHITESPACE:" \t\n\r\u000c\u00a0",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<<0,ADD:1<<1,SUBTRACT:1<<2,LIGHTEST:1<<3,DARKEST:1<<4,DIFFERENCE:1<<5,EXCLUSION:1<<6,MULTIPLY:1<<7,SCREEN:1<<8,OVERLAY:1<<9,HARD_LIGHT:1<<10,SOFT_LIGHT:1<<11,DODGE:1<<12,BURN:1<<13,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:1<<15,PREC_MAXVAL:(1<<15)-1,PREC_ALPHA_SHIFT:24-15,PREC_RED_SHIFT:16-15,NORMAL_MODE_AUTO:0,NORMAL_MODE_SHAPE:1,NORMAL_MODE_VERTEX:2,MAX_LIGHTS:8};function a(I){if(typeof I==="string"){var H=0;for(var G=0;G<I.length;++G){H=H*31+I.charCodeAt(G)&4294967295}return H}if(typeof I!=="object"){return I&4294967295}if(I.hashCode instanceof Function){return I.hashCode()}if(I.$id===c){I.$id=o.floor(o.random()*65536)-32768<<16|o.floor(o.random()*65536)}return I.$id}function t(H,G){if(H===null||G===null){return H===null&&G===null}if(typeof H==="string"){return H===G}if(typeof H!=="object"){return H===G}if(H.equals instanceof Function){return H.equals(G)}return H===G}var e=function(H){if(H.iterator instanceof Function){return H.iterator()}if(H instanceof Array){var G=-1;this.hasNext=function(){return ++G<H.length};this.next=function(){return H[G]}}else{throw"Unable to iterate: "+H}};var n=function(){function H(J){var I=0;this.hasNext=function(){return I<J.length};this.next=function(){return J[I++]};this.remove=function(){J.splice(I,1)}}function G(){var I;if(arguments.length===0){I=[]}else{if(arguments.length>0&&typeof arguments[0]!=="number"){I=arguments[0].toArray()}else{I=[];I.length=0|arguments[0]}}this.get=function(J){return I[J]};this.contains=function(J){return this.indexOf(J)>-1};this.indexOf=function(L){for(var K=0,J=I.length;K<J;++K){if(t(L,I[K])){return K}}return -1};this.add=function(){if(arguments.length===1){I.push(arguments[0])}else{if(arguments.length===2){var J=arguments[0];if(typeof J==="number"){if(J>=0&&J<=I.length){I.splice(J,0,arguments[1])}else{throw J+" is not a valid index"}}else{throw typeof J+" is not a number"}}else{throw"Please use the proper number of parameters."}}};this.addAll=function(K,J){var L;if(typeof K==="number"){if(K<0||K>I.length){throw"Index out of bounds for addAll: "+K+" greater or equal than "+I.length}L=new e(J);while(L.hasNext()){I.splice(K++,0,L.next())}}else{L=new e(K);while(L.hasNext()){I.push(L.next())}}};this.set=function(){if(arguments.length===2){var J=arguments[0];if(typeof J==="number"){if(J>=0&&J<I.length){I.splice(J,1,arguments[1])}else{throw J+" is not a valid index."}}else{throw typeof J+" is not a number"}}else{throw"Please use the proper number of parameters."}};this.size=function(){return I.length};this.clear=function(){I.length=0};this.remove=function(J){if(typeof J==="number"){return I.splice(J,1)[0]}J=this.indexOf(J);if(J>-1){I.splice(J,1);return true}return false};this.isEmpty=function(){return !I.length};this.clone=function(){return new G(this)};this.toArray=function(){return I.slice(0)};this.iterator=function(){return new H(I)}}return G}();var C=function(){function G(){if(arguments.length===1&&arguments[0] instanceof G){return arguments[0].clone()}var P=arguments.length>0?arguments[0]:16;var Q=arguments.length>1?arguments[1]:0.75;var J=[];J.length=P;var L=0;var H=this;function N(S){var R=a(S)%J.length;return R<0?J.length+R:R}function K(){if(L<=Q*J.length){return}var U=[];for(var T=0;T<J.length;++T){if(J[T]!==c){U=U.concat(J[T])}}var V=J.length*2;J=[];J.length=V;for(var S=0;S<U.length;++S){var R=N(U[S].key);var W=J[R];if(W===c){J[R]=W=[]}W.push(U[S])}}function I(V,W){var R=0;var U=-1;var T=false;function S(){while(!T){++U;if(R>=J.length){T=true}else{if(J[R]===c||U>=J[R].length){U=-1;++R}else{return}}}}this.hasNext=function(){return !T};this.next=function(){var X=V(J[R][U]);S();return X};this.remove=function(){W(this.next());--U};S()}function O(R,S,T){this.clear=function(){H.clear()};this.contains=function(U){return S(U)};this.containsAll=function(V){var U=V.iterator();while(U.hasNext()){if(!this.contains(U.next())){return false}}return true};this.isEmpty=function(){return H.isEmpty()};this.iterator=function(){return new I(R,T)};this.remove=function(U){if(this.contains(U)){T(U);return true}return false};this.removeAll=function(X){var U=X.iterator();var W=false;while(U.hasNext()){var V=U.next();if(this.contains(V)){T(V);W=true}}return true};this.retainAll=function(Y){var W=this.iterator();var V=[];while(W.hasNext()){var X=W.next();if(!Y.contains(X)){V.push(X)}}for(var U=0;U<V.length;++U){T(V[U])}return V.length>0};this.size=function(){return H.size()};this.toArray=function(){var U=[];var V=this.iterator();while(V.hasNext()){U.push(V.next())}return U}}function M(R){this._isIn=function(S){return S===H&&R.removed===c};this.equals=function(S){return t(R.key,S.getKey())};this.getKey=function(){return R.key};this.getValue=function(){return R.value};this.hashCode=function(S){return a(R.key)};this.setValue=function(T){var S=R.value;R.value=T;return S}}this.clear=function(){L=0;J=[];J.length=P};this.clone=function(){var R=new G;R.putAll(this);return R};this.containsKey=function(T){var R=N(T);var U=J[R];if(U===c){return false}for(var S=0;S<U.length;++S){if(t(U[S].key,T)){return true}}return false};this.containsValue=function(T){for(var S=0;S<J.length;++S){var U=J[S];if(U===c){continue}for(var R=0;R<U.length;++R){if(t(U[R].value,T)){return true}}}return false};this.entrySet=function(){return new O(function(R){return new M(R)},function(R){return R instanceof M&&R._isIn(H)},function(R){return H.remove(R.getKey())})};this.get=function(T){var R=N(T);var U=J[R];if(U===c){return null}for(var S=0;S<U.length;++S){if(t(U[S].key,T)){return U[S].value}}return null};this.isEmpty=function(){return L===0};this.keySet=function(){return new O(function(R){return R.key},function(R){return H.containsKey(R)},function(R){return H.remove(R)})};this.values=function(){return new O(function(R){return R.value},function(R){return H.containsValue(R)},function(R){return H.removeByValue(R)})};this.put=function(T,V){var R=N(T);var W=J[R];if(W===c){++L;J[R]=[{key:T,value:V}];K();return null}for(var S=0;S<W.length;++S){if(t(W[S].key,T)){var U=W[S].value;W[S].value=V;return U}}++L;W.push({key:T,value:V});K();return null};this.putAll=function(R){var S=R.entrySet().iterator();while(S.hasNext()){var T=S.next();this.put(T.getKey(),T.getValue())}};this.remove=function(T){var R=N(T);var V=J[R];if(V===c){return null}for(var S=0;S<V.length;++S){if(t(V[S].key,T)){--L;var U=V[S].value;V[S].removed=true;if(V.length>1){V.splice(S,1)}else{J[R]=c}return U}}return null};this.removeByValue=function(T){var V,S,R,U;for(V in J){if(J.hasOwnProperty(V)){for(S=0,R=J[V].length;S<R;S++){U=J[V][S];if(U.value===T){J[V].splice(S,1);return true}}}}return false};this.size=function(){return L}}return G}();var k=function(){function G(J,L,K){this.x=J||0;this.y=L||0;this.z=K||0}G.dist=function(K,J){return K.dist(J)};G.dot=function(K,J){return K.dot(J)};G.cross=function(K,J){return K.cross(J)};G.angleBetween=function(K,J){return o.acos(K.dot(J)/(K.mag()*J.mag()))};G.prototype={set:function(J,L,K){if(arguments.length===1){this.set(J.x||J[0]||0,J.y||J[1]||0,J.z||J[2]||0)}else{this.x=J;this.y=L;this.z=K}},get:function(){return new G(this.x,this.y,this.z)},mag:function(){var J=this.x,L=this.y,K=this.z;return o.sqrt(J*J+L*L+K*K)},add:function(J,L,K){if(arguments.length===1){this.x+=J.x;this.y+=J.y;this.z+=J.z}else{this.x+=J;this.y+=L;this.z+=K}},sub:function(J,L,K){if(arguments.length===1){this.x-=J.x;this.y-=J.y;this.z-=J.z}else{this.x-=J;this.y-=L;this.z-=K}},mult:function(J){if(typeof J==="number"){this.x*=J;this.y*=J;this.z*=J}else{this.x*=J.x;this.y*=J.y;this.z*=J.z}},div:function(J){if(typeof J==="number"){this.x/=J;this.y/=J;this.z/=J}else{this.x/=J.x;this.y/=J.y;this.z/=J.z}},dist:function(M){var L=this.x-M.x,K=this.y-M.y,J=this.z-M.z;return o.sqrt(L*L+K*K+J*J)},dot:function(J,L,K){if(arguments.length===1){return this.x*J.x+this.y*J.y+this.z*J.z}return this.x*J+this.y*L+this.z*K},cross:function(K){var J=this.x,M=this.y,L=this.z;return new G(M*K.z-K.y*L,L*K.x-K.z*J,J*K.y-K.x*M)},normalize:function(){var J=this.mag();if(J>0){this.div(J)}},limit:function(J){if(this.mag()>J){this.normalize();this.mult(J)}},heading2D:function(){return -o.atan2(-this.y,this.x)},toString:function(){return"["+this.x+", "+this.y+", "+this.z+"]"},array:function(){return[this.x,this.y,this.z]}};function H(J){return function(M,L){var K=M.get();K[J](L);return K}}for(var I in G.prototype){if(G.prototype.hasOwnProperty(I)&&!G.hasOwnProperty(I)){G[I]=H(I)}}return G}();function A(){}A.prototype=j;var b=new A;b.ArrayList=n;b.HashMap=C;b.PVector=k;b.ObjectIterator=e;b.PConstants=j;b.defineProperty=function(H,G,I){if("defineProperty" in Object){Object.defineProperty(H,G,I)}else{if(I.hasOwnProperty("get")){H.__defineGetter__(G,I.get)}if(I.hasOwnProperty("set")){H.__defineSetter__(G,I.set)}}};function x(J,I){function K(L){b.defineProperty(J,L,{get:function(){return I[L]},set:function(M){I[L]=M},enumerable:true})}var H=[];for(var G in I){if(typeof I[G]==="function"){if(!J.hasOwnProperty(G)){J[G]=I[G]}}else{if(G.charAt(0)!=="$"&&!(G in J)){H.push(G)}}}while(H.length>0){K(H.shift())}}b.extendClassChain=function(H){var I=[H];for(var G=H.$upcast;G;G=G.$upcast){x(G,H);I.push(G);H=G}while(I.length>0){I.pop().$self=H}};b.extendStaticMembers=function(G,H){x(G,H)};b.extendInterfaceMembers=function(G,H){x(G,H)};b.addMethod=function(J,I,L,K){if(J[I]){var H=L.length,G=J[I];J[I]=function(){if(arguments.length===H){return L.apply(this,arguments)}return G.apply(this,arguments)}}else{J[I]=L}};b.createJavaArray=function(K,L){var H=null;if(typeof L[0]==="number"){var G=0|L[0];if(L.length<=1){H=[];H.length=G;for(var J=0;J<G;++J){H[J]=0}}else{H=[];var M=L.slice(1);for(var I=0;I<G;++I){H.push(b.createJavaArray(K,M))}}}return H};var p={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(H){var K=("open() createOutput() createInput() BufferedReader selectFolder() dataPath() createWriter() selectOutput() beginRecord() saveStream() endRecord() selectInput() saveBytes() createReader() beginRaw() endRaw() PrintWriter delay()").split(" "),J=K.length,G,L;function I(M){return function(){throw"Processing.js does not support "+M+"."}}while(J--){G=K[J];L=G.replace("()","");H[L]=I(G)}})(b);b.defineProperty(b,"screenWidth",{get:function(){return l.innerWidth}});b.defineProperty(b,"screenHeight",{get:function(){return l.innerHeight}});var z=[];var g={};var D=function(G){z.splice(g[G],1);delete g[G]};var v=function(G){if(G.externals.canvas.id===c||!G.externals.canvas.id.length){G.externals.canvas.id="__processing"+z.length}g[G.externals.canvas.id]=z.length;z.push(G)};function y(Q){var J=250,X=Q.size/J,G=u.createElement("canvas");G.width=2*J;G.height=2*J;G.style.opacity=0;var P=Q.getCSSDefinition(J+"px","normal"),R=G.getContext("2d");R.font=P;Q.context2d=R;var V="dbflkhyjqpg";G.width=R.measureText(V).width;R.font=P;var M=u.createElement("div");M.style.position="absolute";M.style.opacity=0;M.style.fontFamily='"'+Q.name+'"';M.style.fontSize=J+"px";M.innerHTML=V+"<br/>"+V;u.body.appendChild(M);var N=G.width,U=G.height,O=U/2;R.fillStyle="white";R.fillRect(0,0,N,U);R.fillStyle="black";R.fillText(V,0,O);var I=R.getImageData(0,0,N,U).data;var S=0,L=N*4,T=I.length;while(++S<T&&I[S]===255){h()}var K=o.round(S/L);S=T-1;while(--S>0&&I[S]===255){h()}var W=o.round(S/L);Q.ascent=X*(O-K);Q.descent=X*(W-O);if(u.defaultView.getComputedStyle){var H=u.defaultView.getComputedStyle(M,null).getPropertyValue("height");H=X*H.replace("px","");if(H>=Q.size*2){Q.leading=o.round(H/2)}}u.body.removeChild(M)}function f(G,H){if(G===c){G=""}this.name=G;if(H===c){H=0}this.size=H;this.glyph=false;this.ascent=0;this.descent=0;this.leading=1.2*H;var K=G.indexOf(" Italic Bold");if(K!==-1){G=G.substring(0,K)}this.style="normal";var J=G.indexOf(" Italic");if(J!==-1){G=G.substring(0,J);this.style="italic"}this.weight="normal";var I=G.indexOf(" Bold");if(I!==-1){G=G.substring(0,I);this.weight="bold"}this.family="sans-serif";if(G!==c){switch(G){case"sans-serif":case"serif":case"monospace":case"fantasy":case"cursive":this.family=G;break;default:this.family='"'+G+'", sans-serif';break}}this.context2d=null;y(this);this.css=this.getCSSDefinition();this.context2d.font=this.css}f.prototype.getCSSDefinition=function(I,G){if(I===c){I=this.size+"px"}if(G===c){G=this.leading+"px"}var H=[this.style,"normal",this.weight,I+"/"+G,this.family];return H.join(" ")};f.prototype.measureTextWidth=function(G){return this.context2d.measureText(G).width};f.PFontCache={};f.get=function(I,J){var H=f.PFontCache;var G=I+"/"+J;if(!H[G]){H[G]=new f(I,J)}return H[G]};f.list=function(){return["sans-serif","serif","monospace","fantasy","cursive"]};f.preloading={template:{},initialized:false,initialize:function(){var I=function(){var K="#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#";var J=function(L){return"AAAAAAAA".substr(~~L?7-L:6)};return K.replace(/[#237]/g,J)};var G=u.createElement("style");G.setAttribute("type","text/css");G.innerHTML='@font-face {\n font-family: "PjsEmptyFont";\n src: url(\'data:application/x-font-ttf;base64,'+I()+"')\n format('truetype');\n}";u.head.appendChild(G);var H=u.createElement("span");H.style.cssText='position: absolute; top: 0; left: 0; opacity: 0; font-family: "PjsEmptyFont", fantasy;';H.innerHTML="AAAAAAAA";u.body.appendChild(H);this.template=H;this.initialized=true},getElementWidth:function(G){return u.defaultView.getComputedStyle(G,"").getPropertyValue("width")},timeAttempted:0,pending:function(K){if(!this.initialized){this.initialize()}var I,G,J=this.getElementWidth(this.template);for(var H=0;H<this.fontList.length;H++){I=this.fontList[H];G=this.getElementWidth(I);if(this.timeAttempted<4000&&G===J){this.timeAttempted+=K;return true}else{u.body.removeChild(I);this.fontList.splice(H--,1);this.timeAttempted=0}}if(this.fontList.length===0){return false}return true},fontList:[],addedList:{},add:function(G){if(!this.initialized){this.initialize()}var K=typeof G==="object"?G.fontFace:G,J=typeof G==="object"?G.url:G;if(this.addedList[K]){return}var I=u.createElement("style");I.setAttribute("type","text/css");I.innerHTML="@font-face{\n font-family: '"+K+"';\n src: url('"+J+"');\n}\n";u.head.appendChild(I);this.addedList[K]=true;var H=u.createElement("span");H.style.cssText="position: absolute; top: 0; left: 0; opacity: 0;";H.style.fontFamily='"'+K+'", "PjsEmptyFont", fantasy';H.innerHTML="AAAAAAAA";u.body.appendChild(H);this.fontList.push(H)}};b.PFont=f;var B=this.Processing=function(a5,a1){if(!(this instanceof B)){throw"called Processing constructor as if it were a function: missing 'new'."}var X,cP=a5===c&&a1===c;if(cP){X=u.createElement("canvas")}else{X=typeof a5==="string"?u.getElementById(a5):a5}if(!(X instanceof HTMLCanvasElement)){throw"called Processing constructor without passing canvas element reference or id."}function dn(d2){B.debug("Unimplemented - "+d2)}var cQ=this;cQ.externals={canvas:X,context:c,sketch:c};cQ.name="Processing.js Instance";cQ.use3DContext=false;cQ.focused=false;cQ.breakShape=false;cQ.glyphTable={};cQ.pmouseX=0;cQ.pmouseY=0;cQ.mouseX=0;cQ.mouseY=0;cQ.mouseButton=0;cQ.mouseScroll=0;cQ.mouseClicked=c;cQ.mouseDragged=c;cQ.mouseMoved=c;cQ.mousePressed=c;cQ.mouseReleased=c;cQ.mouseScrolled=c;cQ.mouseOver=c;cQ.mouseOut=c;cQ.touchStart=c;cQ.touchEnd=c;cQ.touchMove=c;cQ.touchCancel=c;cQ.key=c;cQ.keyCode=c;cQ.keyPressed=h;cQ.keyReleased=h;cQ.keyTyped=h;cQ.draw=c;cQ.setup=c;cQ.__mousePressed=false;cQ.__keyPressed=false;cQ.__frameRate=60;cQ.frameCount=0;cQ.width=100;cQ.height=100;var dZ,cK,dP,bv=true,aA=true,bg=[1,1,1,1],aS=4294967295,ak=true,b8=true,cU=[0,0,0,1],cp=4278190080,bX=true,dN=1,aq=false,dF=false,aw=true,bY=0,bD=0,cH=3,aZ=0,aY=0,aX=0,aT=0,dL=60,at=1000/dL,S="default",ce=X.style.cursor,dI=20,cd=0,dX=[],aC=0,J=20,cG=false,aV=-3355444,cs=20,bM=255,bB=255,bA=255,by=255,cT=false,aD=false,dE=0,dW=0,cS=1,a6=null,bo=null,aW=false,dh=Date.now(),dk=dh,I=0,cy,cX,aI,aE,br,b7,N,du={attributes:{},locations:{}},dp,dH,bL,a8,cD,dd,av,bW,a7,b2,am,az,bu,ap,Z,c1,bK,cm={width:0,height:0},dV=2,dK=false,cB,V,K,G=37,cV=0,cC=4,R="Arial",dR=12,aU=9,ds=2,dY=14,P=f.get(R,dR),ad,ch=null,dM=false,dU,bT=1000,aa=[],dz=null,dO=[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];var W,dg,aM,bQ;if(u.defaultView&&u.defaultView.getComputedStyle){W=parseInt(u.defaultView.getComputedStyle(X,null)["paddingLeft"],10)||0;dg=parseInt(u.defaultView.getComputedStyle(X,null)["paddingTop"],10)||0;aM=parseInt(u.defaultView.getComputedStyle(X,null)["borderLeftWidth"],10)||0;bQ=parseInt(u.defaultView.getComputedStyle(X,null)["borderTopWidth"],10)||0}var dC=0;var bE=0,bF=0,bl=[],bk=[],bj=[],ab=new d(720),bd=new d(720),cz,cu;var bO,cb,dA,aL,ag,c4,U,c5,aj=false,cc=false,cE=60*(o.PI/180),de=cQ.width/2,dc=cQ.height/2,db=dc/o.tan(cE/2),aR=db/10,ao=db*10,bZ=cQ.width/cQ.height;var a2=[],b5=[],cW=0,dG=false,T=false,dl=true;var L=0;var be=[];var da=new d([0.5,0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,0.5,0.5,0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,0.5]);var bz=new d([0.5,0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5]);var c9=new d([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]);var ae=new d([0,0,0,0,1,0,1,1,0,1,0,0]);var ac=new d([0,0,1,0,0,1,0,0,1,0,0,1]);var bN="varying vec4 frontColor;attribute vec3 aVertex;attribute vec4 aColor;uniform mat4 uView;uniform mat4 uProjection;uniform float pointSize;void main(void) { frontColor = aColor; gl_PointSize = pointSize; gl_Position = uProjection * uView * vec4(aVertex, 1.0);}";var ba="#ifdef GL_ES\nprecision highp float;\n#endif\nvarying vec4 frontColor;void main(void){ gl_FragColor = frontColor;}";var Y="varying vec4 frontColor;attribute vec3 Vertex;attribute vec2 aTextureCoord;uniform vec4 color;uniform mat4 model;uniform mat4 view;uniform mat4 projection;uniform float pointSize;varying vec2 vTextureCoord;void main(void) { gl_PointSize = pointSize; frontColor = color; gl_Position = projection * view * model * vec4(Vertex, 1.0); vTextureCoord = aTextureCoord;}";var bS="#ifdef GL_ES\nprecision highp float;\n#endif\nvarying vec4 frontColor;varying vec2 vTextureCoord;uniform sampler2D uSampler;uniform int picktype;void main(void){ if(picktype == 0){ gl_FragColor = frontColor; } else if(picktype == 1){ float alpha = texture2D(uSampler, vTextureCoord).a; gl_FragColor = vec4(frontColor.rgb*alpha, alpha);\n }}";var bs=/Windows/.test(navigator.userAgent);var d0="varying vec4 frontColor;attribute vec3 Vertex;attribute vec3 Normal;attribute vec4 aColor;attribute vec2 aTexture;varying vec2 vTexture;uniform vec4 color;uniform bool usingMat;uniform vec3 specular;uniform vec3 mat_emissive;uniform vec3 mat_ambient;uniform vec3 mat_specular;uniform float shininess;uniform mat4 model;uniform mat4 view;uniform mat4 projection;uniform mat4 normalTransform;uniform int lightCount;uniform vec3 falloff;struct Light { int type; vec3 color; vec3 position; vec3 direction; float angle; vec3 halfVector; float concentration;};uniform Light lights0;uniform Light lights1;uniform Light lights2;uniform Light lights3;uniform Light lights4;uniform Light lights5;uniform Light lights6;uniform Light lights7;Light getLight(int index){ if(index == 0) return lights0; if(index == 1) return lights1; if(index == 2) return lights2; if(index == 3) return lights3; if(index == 4) return lights4; if(index == 5) return lights5; if(index == 6) return lights6; return lights7;}void AmbientLight( inout vec3 totalAmbient, in vec3 ecPos, in Light light ) { float d = length( light.position - ecPos ); float attenuation = 1.0 / ( falloff[0] + ( falloff[1] * d ) + ( falloff[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, shininess ); } col += light.color * nDotVP; spec += specular * 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 / ( falloff[0] + ( falloff[1] * d ) + ( falloff[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, shininess ); } spec += specular * 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; vec3 VP = light.position - ecPos; vec3 ldir = normalize( -light.direction ); float d = length( VP ); VP = normalize( VP ); float attenuation = 1.0 / ( falloff[0] + ( falloff[1] * d ) + ( falloff[2] * d * d ) ); float spotDot = dot( VP, ldir );"+(bs?" 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 = 0.0; } else { powerfactor = pow( nDotHV, shininess ); } spec += specular * powerfactor * attenuation; col += light.color * nDotVP * attenuation;}void main(void) { vec3 finalAmbient = vec3( 0.0, 0.0, 0.0 ); vec3 finalDiffuse = vec3( 0.0, 0.0, 0.0 ); vec3 finalSpecular = vec3( 0.0, 0.0, 0.0 ); vec4 col = color; if(color[0] == -1.0){ col = aColor; } vec3 norm = normalize(vec3( normalTransform * vec4( Normal, 0.0 ) )); vec4 ecPos4 = view * model * vec4(Vertex,1.0); vec3 ecPos = (vec3(ecPos4))/ecPos4.w; if( lightCount == 0 ) { frontColor = col + vec4(mat_specular,1.0); } else { for( int i = 0; i < 8; i++ ) { Light l = getLight(i); if( i >= lightCount ){ 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( usingMat == false ) { frontColor = vec4( vec3(col) * finalAmbient + vec3(col) * finalDiffuse + vec3(col) * finalSpecular, col[3] ); } else{ frontColor = vec4( mat_emissive + (vec3(col) * mat_ambient * finalAmbient) + (vec3(col) * finalDiffuse) + (mat_specular * finalSpecular), col[3] ); } } vTexture.xy = aTexture.xy; gl_Position = projection * view * model * vec4( Vertex, 1.0 );}";var bC="#ifdef GL_ES\nprecision highp float;\n#endif\nvarying vec4 frontColor;uniform sampler2D sampler;uniform bool usingTexture;varying vec2 vTexture;void main(void){ if(usingTexture){ gl_FragColor = vec4(texture2D(sampler, vTexture.xy)) * frontColor; } else{ gl_FragColor = frontColor; }}";function dT(d4,d3,d6,d5){var d2=du.locations[d4];if(d2===c){d2=dZ.getUniformLocation(d3,d6);du.locations[d4]=d2}if(d2!==null){if(d5.length===4){dZ.uniform4fv(d2,d5)}else{if(d5.length===3){dZ.uniform3fv(d2,d5)}else{if(d5.length===2){dZ.uniform2fv(d2,d5)}else{dZ.uniform1f(d2,d5)}}}}}function dQ(d4,d3,d6,d5){var d2=du.locations[d4];if(d2===c){d2=dZ.getUniformLocation(d3,d6);du.locations[d4]=d2}if(d2!==null){if(d5.length===4){dZ.uniform4iv(d2,d5)}else{if(d5.length===3){dZ.uniform3iv(d2,d5)}else{if(d5.length===2){dZ.uniform2iv(d2,d5)}else{dZ.uniform1i(d2,d5)}}}}}function a0(d6,d4,d7,d5,d3){var d2=du.locations[d6];if(d2===c){d2=dZ.getUniformLocation(d4,d7);du.locations[d6]=d2}if(d2!==-1){if(d3.length===16){dZ.uniformMatrix4fv(d2,d5,d3)}else{if(d3.length===9){dZ.uniformMatrix3fv(d2,d5,d3)}else{dZ.uniformMatrix2fv(d2,d5,d3)}}}}function c6(d6,d4,d7,d3,d5){var d2=du.attributes[d6];if(d2===c){d2=dZ.getAttribLocation(d4,d7);du.attributes[d6]=d2}if(d2!==-1){dZ.bindBuffer(dZ.ARRAY_BUFFER,d5);dZ.vertexAttribPointer(d2,d3,dZ.FLOAT,false,0,0);dZ.enableVertexAttribArray(d2)}}function ca(d4,d3,d5){var d2=du.attributes[d4];if(d2===c){d2=dZ.getAttribLocation(d3,d5);du.attributes[d4]=d2}if(d2!==-1){dZ.disableVertexAttribArray(d2)}}var bx=function(d4,d6,d3){var d7=d4.createShader(d4.VERTEX_SHADER);d4.shaderSource(d7,d6);d4.compileShader(d7);if(!d4.getShaderParameter(d7,d4.COMPILE_STATUS)){throw d4.getShaderInfoLog(d7)}var d5=d4.createShader(d4.FRAGMENT_SHADER);d4.shaderSource(d5,d3);d4.compileShader(d5);if(!d4.getShaderParameter(d5,d4.COMPILE_STATUS)){throw d4.getShaderInfoLog(d5)}var d2=d4.createProgram();d4.attachShader(d2,d7);d4.attachShader(d2,d5);d4.linkProgram(d2);if(!d4.getProgramParameter(d2,d4.LINK_STATUS)){throw"Error linking shaders."}return d2};var aQ=function(d2,d6,d3,d5,d4){return{x:d2,y:d6,w:d3,h:d5}};var bc=aQ;var bV=function(d2,d6,d3,d5,d4){return{x:d2,y:d6,w:d4?d3:d3-d2,h:d4?d5:d5-d6}};var aG=function(d2,d6,d3,d5,d4){return{x:d2-d3/2,y:d6-d5/2,w:d3,h:d5}};var dj=function(){};var bJ=function(){};var bt=function(){};var b4=function(){};bJ.prototype=new dj;bJ.prototype.constructor=bJ;bt.prototype=new dj;bt.prototype.constructor=bt;b4.prototype=new dj;b4.prototype.constructor=b4;dj.prototype.a3DOnlyFunction=h;var cf={};var bI=cQ.Character=function(d2){if(typeof d2==="string"&&d2.length===1){this.code=d2.charCodeAt(0)}else{if(typeof d2==="number"){this.code=d2}else{if(d2 instanceof bI){this.code=d2}else{this.code=NaN}}}return cf[this.code]===c?cf[this.code]=this:cf[this.code]};bI.prototype.toString=function(){return String.fromCharCode(this.code)};bI.prototype.valueOf=function(){return this.code};var H=cQ.PShape=function(d2){this.family=d2||0;this.visible=true;this.style=true;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};H.prototype={isVisible:function(){return this.visible},setVisible:function(d2){this.visible=d2},disableStyle:function(){this.style=false;for(var d3=0,d2=this.children.length;d3<d2;d3++){this.children[d3].disableStyle()}},enableStyle:function(){this.style=true;for(var d3=0,d2=this.children.length;d3<d2;d3++){this.children[d3].enableStyle()}},getFamily:function(){return this.family},getWidth:function(){return this.width},getHeight:function(){return this.height},setName:function(d2){this.name=d2},getName:function(){return this.name},draw:function(){if(this.visible){this.pre();this.drawImpl();this.post()}},drawImpl:function(){if(this.family===0){this.drawGroup()}else{if(this.family===1){this.drawPrimitive()}else{if(this.family===3){this.drawGeometry()}else{if(this.family===21){this.drawPath()}}}}},drawPath:function(){var d4,d3;if(this.vertices.length===0){return}cQ.beginShape();if(this.vertexCodes.length===0){if(this.vertices[0].length===2){for(d4=0,d3=this.vertices.length;d4<d3;d4++){cQ.vertex(this.vertices[d4][0],this.vertices[d4][1])}}else{for(d4=0,d3=this.vertices.length;d4<d3;d4++){cQ.vertex(this.vertices[d4][0],this.vertices[d4][1],this.vertices[d4][2])}}}else{var d2=0;if(this.vertices[0].length===2){for(d4=0,d3=this.vertexCodes.length;d4<d3;d4++){if(this.vertexCodes[d4]===0){cQ.vertex(this.vertices[d2][0],this.vertices[d2][1]);if(this.vertices[d2]["moveTo"]===true){a2[a2.length-1]["moveTo"]=true}else{if(this.vertices[d2]["moveTo"]===false){a2[a2.length-1]["moveTo"]=false}}cQ.breakShape=false;d2++}else{if(this.vertexCodes[d4]===1){cQ.bezierVertex(this.vertices[d2+0][0],this.vertices[d2+0][1],this.vertices[d2+1][0],this.vertices[d2+1][1],this.vertices[d2+2][0],this.vertices[d2+2][1]);d2+=3}else{if(this.vertexCodes[d4]===2){cQ.curveVertex(this.vertices[d2][0],this.vertices[d2][1]);d2++}else{if(this.vertexCodes[d4]===3){cQ.breakShape=true}}}}}}else{for(d4=0,d3=this.vertexCodes.length;d4<d3;d4++){if(this.vertexCodes[d4]===0){cQ.vertex(this.vertices[d2][0],this.vertices[d2][1],this.vertices[d2][2]);if(this.vertices[d2]["moveTo"]===true){a2[a2.length-1]["moveTo"]=true}else{if(this.vertices[d2]["moveTo"]===false){a2[a2.length-1]["moveTo"]=false}}cQ.breakShape=false}else{if(this.vertexCodes[d4]===1){cQ.bezierVertex(this.vertices[d2+0][0],this.vertices[d2+0][1],this.vertices[d2+0][2],this.vertices[d2+1][0],this.vertices[d2+1][1],this.vertices[d2+1][2],this.vertices[d2+2][0],this.vertices[d2+2][1],this.vertices[d2+2][2]);d2+=3}else{if(this.vertexCodes[d4]===2){cQ.curveVertex(this.vertices[d2][0],this.vertices[d2][1],this.vertices[d2][2]);d2++}else{if(this.vertexCodes[d4]===3){cQ.breakShape=true}}}}}}}cQ.endShape(this.close?2:1)},drawGeometry:function(){var d4,d3;cQ.beginShape(this.kind);if(this.style){for(d4=0,d3=this.vertices.length;d4<d3;d4++){cQ.vertex(this.vertices[d4])}}else{for(d4=0,d3=this.vertices.length;d4<d3;d4++){var d2=this.vertices[d4];if(d2[2]===0){cQ.vertex(d2[0],d2[1])}else{cQ.vertex(d2[0],d2[1],d2[2])}}}cQ.endShape()},drawGroup:function(){for(var d3=0,d2=this.children.length;d3<d2;d3++){this.children[d3].draw()}},drawPrimitive:function(){if(this.kind===2){cQ.point(this.params[0],this.params[1])}else{if(this.kind===4){if(this.params.length===4){cQ.line(this.params[0],this.params[1],this.params[2],this.params[3])}else{cQ.line(this.params[0],this.params[1],this.params[2],this.params[3],this.params[4],this.params[5])}}else{if(this.kind===8){cQ.triangle(this.params[0],this.params[1],this.params[2],this.params[3],this.params[4],this.params[5])}else{if(this.kind===16){cQ.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])}else{if(this.kind===30){if(this.image!==null){cQ.imageMode(0);cQ.image(this.image,this.params[0],this.params[1],this.params[2],this.params[3])}else{cQ.rectMode(0);cQ.rect(this.params[0],this.params[1],this.params[2],this.params[3])}}else{if(this.kind===31){cQ.ellipseMode(0);cQ.ellipse(this.params[0],this.params[1],this.params[2],this.params[3])}else{if(this.kind===32){cQ.ellipseMode(0);cQ.arc(this.params[0],this.params[1],this.params[2],this.params[3],this.params[4],this.params[5])}else{if(this.kind===41){if(this.params.length===1){cQ.box(this.params[0])}else{cQ.box(this.params[0],this.params[1],this.params[2])}}else{if(this.kind===40){cQ.sphere(this.params[0])}}}}}}}}}},pre:function(){if(this.matrix){cQ.pushMatrix();dZ.transform(this.matrix.elements[0],this.matrix.elements[3],this.matrix.elements[1],this.matrix.elements[4],this.matrix.elements[2],this.matrix.elements[5])}if(this.style){cQ.pushStyle();this.styles()}},post:function(){if(this.matrix){cQ.popMatrix()}if(this.style){cQ.popStyle()}},styles:function(){if(this.stroke){cQ.stroke(this.strokeColor);cQ.strokeWeight(this.strokeWeight);cQ.strokeCap(this.strokeCap);cQ.strokeJoin(this.strokeJoin)}else{cQ.noStroke()}if(this.fill){cQ.fill(this.fillColor)}else{cQ.noFill()}},getChild:function(d5){var d3,d2;if(typeof d5==="number"){return this.children[d5]}var d4;if(d5===""||this.name===d5){return this}if(this.nameTable.length>0){for(d3=0,d2=this.nameTable.length;d3<d2||d4;d3++){if(this.nameTable[d3].getName===d5){d4=this.nameTable[d3];break}}if(d4){return d4}}for(d3=0,d2=this.children.length;d3<d2;d3++){d4=this.children[d3].getChild(d5);if(d4){return d4}}return null},getChildCount:function(){return this.children.length},addChild:function(d2){this.children.push(d2);d2.parent=this;if(d2.getName()!==null){this.addName(d2.getName(),d2)}},addName:function(d3,d2){if(this.parent!==null){this.parent.addName(d3,d2)}else{this.nameTable.push([d3,d2])}},translate:function(){if(arguments.length===2){this.checkMatrix(2);this.matrix.translate(arguments[0],arguments[1])}else{this.checkMatrix(3);this.matrix.translate(arguments[0],arguments[1],0)}},checkMatrix:function(d2){if(this.matrix===null){if(d2===2){this.matrix=new cQ.PMatrix2D}else{this.matrix=new cQ.PMatrix3D}}else{if(d2===3&&this.matrix instanceof cQ.PMatrix2D){this.matrix=new cQ.PMatrix3D}}},rotateX:function(d2){this.rotate(d2,1,0,0)},rotateY:function(d2){this.rotate(d2,0,1,0)},rotateZ:function(d2){this.rotate(d2,0,0,1)},rotate:function(){if(arguments.length===1){this.checkMatrix(2);this.matrix.rotate(arguments[0])}else{this.checkMatrix(3);this.matrix.rotate(arguments[0],arguments[1],arguments[2],arguments[3])}},scale:function(){if(arguments.length===2){this.checkMatrix(2);this.matrix.scale(arguments[0],arguments[1])}else{if(arguments.length===3){this.checkMatrix(2);this.matrix.scale(arguments[0],arguments[1],arguments[2])}else{this.checkMatrix(2);this.matrix.scale(arguments[0])}}},resetMatrix:function(){this.checkMatrix(2);this.matrix.reset()},applyMatrix:function(d2){if(arguments.length===1){this.applyMatrix(d2.elements[0],d2.elements[1],0,d2.elements[2],d2.elements[3],d2.elements[4],0,d2.elements[5],0,0,1,0,0,0,0,1)}else{if(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)}else{if(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])}}}}};var cl=cQ.PShapeSVG=function(){cQ.PShape.call(this);if(arguments.length===1){this.element=arguments[0];this.vertexCodes=[];this.vertices=[];this.opacity=1;this.stroke=false;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=true;this.fillColor=4278190080;this.fillGradient=null;this.fillGradientPaint=null;this.fillName=null;this.fillOpacity=1;if(this.element.getName()!=="svg"){throw"root is not <svg>, it's <"+this.element.getName()+">"}}else{if(arguments.length===2){if(typeof arguments[1]==="string"){if(arguments[1].indexOf(".svg")>-1){this.element=new cQ.XMLElement(null,arguments[1]);this.vertexCodes=[];this.vertices=[];this.opacity=1;this.stroke=false;this.strokeColor=4278190080;this.strokeWeight=1;this.strokeCap="butt";this.strokeJoin="miter";this.strokeGradient="";this.strokeGradientPaint="";this.strokeName="";this.strokeOpacity=1;this.fill=true;this.fillColor=4278190080;this.fillGradient=null;this.fillGradientPaint=null;this.fillOpacity=1}}else{if(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}}}}this.name=this.element.getStringAttribute("id");var d2=this.element.getStringAttribute("display","inline");this.visible=d2!=="none";var d7=this.element.getAttribute("transform");if(d7){this.matrix=this.parseMatrix(d7)}var d4=this.element.getStringAttribute("viewBox");if(d4!==null){var d6=d4.split(" ");this.width=d6[2];this.height=d6[3]}var d3=this.element.getStringAttribute("width");var d5=this.element.getStringAttribute("height");if(d3!==null){this.width=this.parseUnitSize(d3);this.height=this.parseUnitSize(d5)}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)};cl.prototype=new H;cl.prototype.parseMatrix=function(){function d2(d4){var d3=[];d4.replace(/\((.*?)\)/,function(){return function(d5,d6){d3=d6.replace(/,+/g," ").split(/\s+/)}}());return d3}return function(ea){this.checkMatrix(2);var d3=[];ea.replace(/\s*(\w+)\((.*?)\)/g,function(ed){d3.push(cQ.trim(ed))});if(d3.length===0){return null}for(var d8=0,d6=d3.length;d8<d6;d8++){var d4=d2(d3[d8]);if(d3[d8].indexOf("matrix")!==-1){this.matrix.set(d4[0],d4[2],d4[4],d4[1],d4[3],d4[5])}else{if(d3[d8].indexOf("translate")!==-1){var d9=d4[0];var d7=d4.length===2?d4[1]:0;this.matrix.translate(d9,d7)}else{if(d3[d8].indexOf("scale")!==-1){var ec=d4[0];var eb=d4.length===2?d4[1]:d4[0];this.matrix.scale(ec,eb)}else{if(d3[d8].indexOf("rotate")!==-1){var d5=d4[0];if(d4.length===1){this.matrix.rotate(cQ.radians(d5))}else{if(d4.length===3){this.matrix.translate(d4[1],d4[2]);this.matrix.rotate(cQ.radians(d4[0]));this.matrix.translate(-d4[1],-d4[2])}}}else{if(d3[d8].indexOf("skewX")!==-1){this.matrix.skewX(parseFloat(d4[0]))}else{if(d3[d8].indexOf("skewY")!==-1){this.matrix.skewY(d4[0])}}}}}}}return this.matrix}}();cl.prototype.parseChildren=function(d7){var d3=d7.getChildren();var d6=new cQ.PShape;for(var d5=0,d4=d3.length;d5<d4;d5++){var d2=this.parseChild(d3[d5]);if(d2){d6.addChild(d2)}}this.children.push(d6)};cl.prototype.getName=function(){return this.name};cl.prototype.parseChild=function(d4){var d3=d4.getName();var d2;if(d3==="g"){d2=new cl(this,d4)}else{if(d3==="defs"){d2=new cl(this,d4)}else{if(d3==="line"){d2=new cl(this,d4);d2.parseLine()}else{if(d3==="circle"){d2=new cl(this,d4);d2.parseEllipse(true)}else{if(d3==="ellipse"){d2=new cl(this,d4);d2.parseEllipse(false)}else{if(d3==="rect"){d2=new cl(this,d4);d2.parseRect()}else{if(d3==="polygon"){d2=new cl(this,d4);d2.parsePoly(true)}else{if(d3==="polyline"){d2=new cl(this,d4);d2.parsePoly(false)}else{if(d3==="path"){d2=new cl(this,d4);d2.parsePath()}else{if(d3==="radialGradient"){dn("PShapeSVG.prototype.parseChild, name = radialGradient")}else{if(d3==="linearGradient"){dn("PShapeSVG.prototype.parseChild, name = linearGradient")}else{if(d3==="text"){dn("PShapeSVG.prototype.parseChild, name = text")}else{if(d3==="filter"){dn("PShapeSVG.prototype.parseChild, name = filter")}else{if(d3==="mask"){dn("PShapeSVG.prototype.parseChild, name = mask")}else{h()}}}}}}}}}}}}}}return d2};cl.prototype.parsePath=function(){this.family=21;this.kind=0;var d7=[];var er;var eq=cQ.trim(this.element.getStringAttribute("d").replace(/[\s,]+/g," "));if(eq===null){return}eq=cQ.__toCharArray(eq);var d5=0,d4=0,ec=0,ea=0,eb=0,d9=0,ei=0,eh=0,d3=0,d2=0,ee=0,ed=0,eg=0,ef=0,ep=0,el=0;var ej="";var en=[];var eo=false;var d8;var d6;var em,ek;while(ep<eq.length){el=eq[ep].valueOf();if(el>=65&&el<=90||el>=97&&el<=122){em=ep;ep++;if(ep<eq.length){en=[];el=eq[ep].valueOf();while(!(el>=65&&el<=90||el>=97&&el<=100||el>=102&&el<=122)&&eo===false){if(el===32){if(ej!==""){en.push(parseFloat(ej));ej=""}ep++}else{if(el===45){if(eq[ep-1].valueOf()===101){ej+=eq[ep].toString();ep++}else{if(ej!==""){en.push(parseFloat(ej))}ej=eq[ep].toString();ep++}}else{ej+=eq[ep].toString();ep++}}if(ep===eq.length){eo=true}else{el=eq[ep].valueOf()}}}if(ej!==""){en.push(parseFloat(ej));ej=""}d6=eq[em];el=d6.valueOf();if(el===77){if(en.length>=2&&en.length%2===0){d5=en[0];d4=en[1];this.parsePathMoveto(d5,d4);if(en.length>2){for(em=2,ek=en.length;em<ek;em+=2){d5=en[em];d4=en[em+1];this.parsePathLineto(d5,d4)}}}}else{if(el===109){if(en.length>=2&&en.length%2===0){d5+=en[0];d4+=en[1];this.parsePathMoveto(d5,d4);if(en.length>2){for(em=2,ek=en.length;em<ek;em+=2){d5+=en[em];d4+=en[em+1];this.parsePathLineto(d5,d4)}}}}else{if(el===76){if(en.length>=2&&en.length%2===0){for(em=0,ek=en.length;em<ek;em+=2){d5=en[em];d4=en[em+1];this.parsePathLineto(d5,d4)}}}else{if(el===108){if(en.length>=2&&en.length%2===0){for(em=0,ek=en.length;em<ek;em+=2){d5+=en[em];d4+=en[em+1];this.parsePathLineto(d5,d4)}}}else{if(el===72){for(em=0,ek=en.length;em<ek;em++){d5=en[em];this.parsePathLineto(d5,d4)}}else{if(el===104){for(em=0,ek=en.length;em<ek;em++){d5+=en[em];this.parsePathLineto(d5,d4)}}else{if(el===86){for(em=0,ek=en.length;em<ek;em++){d4=en[em];this.parsePathLineto(d5,d4)}}else{if(el===118){for(em=0,ek=en.length;em<ek;em++){d4+=en[em];this.parsePathLineto(d5,d4)}}else{if(el===67){if(en.length>=6&&en.length%6===0){for(em=0,ek=en.length;em<ek;em+=6){eb=en[em];ei=en[em+1];d9=en[em+2];eh=en[em+3];d3=en[em+4];d2=en[em+5];this.parsePathCurveto(eb,ei,d9,eh,d3,d2);d5=d3;d4=d2}}}else{if(el===99){if(en.length>=6&&en.length%6===0){for(em=0,ek=en.length;em<ek;em+=6){eb=d5+en[em];ei=d4+en[em+1];d9=d5+en[em+2];eh=d4+en[em+3];d3=d5+en[em+4];d2=d4+en[em+5];this.parsePathCurveto(eb,ei,d9,eh,d3,d2);d5=d3;d4=d2}}}else{if(el===83){if(en.length>=4&&en.length%4===0){for(em=0,ek=en.length;em<ek;em+=4){if(d8.toLowerCase()==="c"||d8.toLowerCase()==="s"){ee=this.vertices[this.vertices.length-2][0];ed=this.vertices[this.vertices.length-2][1];eg=this.vertices[this.vertices.length-1][0];ef=this.vertices[this.vertices.length-1][1];eb=eg+(eg-ee);ei=ef+(ef-ed)}else{eb=this.vertices[this.vertices.length-1][0];ei=this.vertices[this.vertices.length-1][1]}d9=en[em];eh=en[em+1];d3=en[em+2];d2=en[em+3];this.parsePathCurveto(eb,ei,d9,eh,d3,d2);d5=d3;d4=d2}}}else{if(el===115){if(en.length>=4&&en.length%4===0){for(em=0,ek=en.length;em<ek;em+=4){if(d8.toLowerCase()==="c"||d8.toLowerCase()==="s"){ee=this.vertices[this.vertices.length-2][0];ed=this.vertices[this.vertices.length-2][1];eg=this.vertices[this.vertices.length-1][0];ef=this.vertices[this.vertices.length-1][1];eb=eg+(eg-ee);ei=ef+(ef-ed)}else{eb=this.vertices[this.vertices.length-1][0];ei=this.vertices[this.vertices.length-1][1]}d9=d5+en[em];eh=d4+en[em+1];d3=d5+en[em+2];d2=d4+en[em+3];this.parsePathCurveto(eb,ei,d9,eh,d3,d2);d5=d3;d4=d2}}}else{if(el===81){if(en.length>=4&&en.length%4===0){for(em=0,ek=en.length;em<ek;em+=4){ec=en[em];ea=en[em+1];d3=en[em+2];d2=en[em+3];this.parsePathQuadto(d5,d4,ec,ea,d3,d2);d5=d3;d4=d2}}}else{if(el===113){if(en.length>=4&&en.length%4===0){for(em=0,ek=en.length;em<ek;em+=4){ec=d5+en[em];ea=d4+en[em+1];d3=d5+en[em+2];d2=d4+en[em+3];this.parsePathQuadto(d5,d4,ec,ea,d3,d2);d5=d3;d4=d2}}}else{if(el===84){if(en.length>=2&&en.length%2===0){for(em=0,ek=en.length;em<ek;em+=2){if(d8.toLowerCase()==="q"||d8.toLowerCase()==="t"){ee=this.vertices[this.vertices.length-2][0];ed=this.vertices[this.vertices.length-2][1];eg=this.vertices[this.vertices.length-1][0];ef=this.vertices[this.vertices.length-1][1];ec=eg+(eg-ee);ea=ef+(ef-ed)}else{ec=d5;ea=d4}d3=en[em];d2=en[em+1];this.parsePathQuadto(d5,d4,ec,ea,d3,d2);d5=d3;d4=d2}}}else{if(el===116){if(en.length>=2&&en.length%2===0){for(em=0,ek=en.length;em<ek;em+=2){if(d8.toLowerCase()==="q"||d8.toLowerCase()==="t"){ee=this.vertices[this.vertices.length-2][0];ed=this.vertices[this.vertices.length-2][1];eg=this.vertices[this.vertices.length-1][0];ef=this.vertices[this.vertices.length-1][1];ec=eg+(eg-ee);ea=ef+(ef-ed)}else{ec=d5;ea=d4}d3=d5+en[em];d2=d4+en[em+1];this.parsePathQuadto(d5,d4,ec,ea,d3,d2);d5=d3;d4=d2}}}else{if(el===90||el===122){this.close=true}}}}}}}}}}}}}}}}}d8=d6.toString()}else{ep++}}};cl.prototype.parsePathQuadto=function(d4,d6,d2,d7,d3,d5){if(this.vertices.length>0){this.parsePathCode(1);this.parsePathVertex(d4+(d2-d4)*2/3,d6+(d7-d6)*2/3);this.parsePathVertex(d3+(d2-d3)*2/3,d5+(d7-d5)*2/3);this.parsePathVertex(d3,d5)}else{throw"Path must start with M/m"}};cl.prototype.parsePathCurveto=function(d5,d7,d3,d6,d2,d4){if(this.vertices.length>0){this.parsePathCode(1);this.parsePathVertex(d5,d7);this.parsePathVertex(d3,d6);this.parsePathVertex(d2,d4)}else{throw"Path must start with M/m"}};cl.prototype.parsePathLineto=function(d3,d2){if(this.vertices.length>0){this.parsePathCode(0);this.parsePathVertex(d3,d2);this.vertices[this.vertices.length-1]["moveTo"]=false}else{throw"Path must start with M/m"}};cl.prototype.parsePathMoveto=function(d3,d2){if(this.vertices.length>0){this.parsePathCode(3)}this.parsePathCode(0);this.parsePathVertex(d3,d2);this.vertices[this.vertices.length-1]["moveTo"]=true};cl.prototype.parsePathVertex=function(d2,d4){var d3=[];d3[0]=d2;d3[1]=d4;this.vertices.push(d3)};cl.prototype.parsePathCode=function(d2){this.vertexCodes.push(d2)};cl.prototype.parsePoly=function(d6){this.family=21;this.close=d6;var d3=cQ.trim(this.element.getStringAttribute("points").replace(/[,\s]+/g," "));if(d3!==null){var d2=d3.split(" ");if(d2.length%2===0){for(var d5=0,d4=d2.length;d5<d4;d5++){var d7=[];d7[0]=d2[d5];d7[1]=d2[++d5];this.vertices.push(d7)}}else{throw"Error parsing polygon points: odd number of coordinates provided"}}};cl.prototype.parseRect=function(){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");if(this.params[2]<0||this.params[3]<0){throw"svg error: negative width or height found while parsing <rect>"}};cl.prototype.parseEllipse=function(d4){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 d3,d2;if(d4){d3=d2=this.element.getFloatAttribute("r");if(d3<0){throw"svg error: negative radius found while parsing <circle>"}}else{d3=this.element.getFloatAttribute("rx");d2=this.element.getFloatAttribute("ry");if(d3<0||d2<0){throw"svg error: negative x-axis radius or y-axis radius found while parsing <ellipse>"}}this.params[0]-=d3;this.params[1]-=d2;this.params[2]=d3*2;this.params[3]=d2*2};cl.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")};cl.prototype.parseColors=function(d4){if(d4.hasAttribute("opacity")){this.setOpacity(d4.getAttribute("opacity"))}if(d4.hasAttribute("stroke")){this.setStroke(d4.getAttribute("stroke"))}if(d4.hasAttribute("stroke-width")){this.setStrokeWeight(d4.getAttribute("stroke-width"))}if(d4.hasAttribute("stroke-linejoin")){this.setStrokeJoin(d4.getAttribute("stroke-linejoin"))}if(d4.hasAttribute("stroke-linecap")){this.setStrokeCap(d4.getStringAttribute("stroke-linecap"))}if(d4.hasAttribute("fill")){this.setFill(d4.getStringAttribute("fill"))}if(d4.hasAttribute("style")){var d7=d4.getStringAttribute("style");var d5=d7.toString().split(";");for(var d3=0,d2=d5.length;d3<d2;d3++){var d6=cQ.trim(d5[d3].split(":"));if(d6[0]==="fill"){this.setFill(d6[1])}else{if(d6[0]==="fill-opacity"){this.setFillOpacity(d6[1])}else{if(d6[0]==="stroke"){this.setStroke(d6[1])}else{if(d6[0]==="stroke-width"){this.setStrokeWeight(d6[1])}else{if(d6[0]==="stroke-linecap"){this.setStrokeCap(d6[1])}else{if(d6[0]==="stroke-linejoin"){this.setStrokeJoin(d6[1])}else{if(d6[0]==="stroke-opacity"){this.setStrokeOpacity(d6[1])}else{if(d6[0]==="opacity"){this.setOpacity(d6[1])}}}}}}}}}}};cl.prototype.setFillOpacity=function(d2){this.fillOpacity=parseFloat(d2);this.fillColor=this.fillOpacity*255<<24|this.fillColor&16777215};cl.prototype.setFill=function(d2){var d3=this.fillColor&4278190080;if(d2==="none"){this.fill=false}else{if(d2.indexOf("#")===0){this.fill=true;if(d2.length===4){d2=d2.replace(/#(.)(.)(.)/,"#$1$1$2$2$3$3")}this.fillColor=d3|parseInt(d2.substring(1),16)&16777215}else{if(d2.indexOf("rgb")===0){this.fill=true;this.fillColor=d3|this.parseRGB(d2)}else{if(d2.indexOf("url(#")===0){this.fillName=d2.substring(5,d2.length-1)}else{if(p[d2]){this.fill=true;this.fillColor=d3|parseInt(p[d2].substring(1),16)&16777215}}}}}};cl.prototype.setOpacity=function(d2){this.strokeColor=parseFloat(d2)*255<<24|this.strokeColor&16777215;this.fillColor=parseFloat(d2)*255<<24|this.fillColor&16777215};cl.prototype.setStroke=function(d2){var d3=this.strokeColor&4278190080;if(d2==="none"){this.stroke=false}else{if(d2.charAt(0)==="#"){this.stroke=true;if(d2.length===4){d2=d2.replace(/#(.)(.)(.)/,"#$1$1$2$2$3$3")}this.strokeColor=d3|parseInt(d2.substring(1),16)&16777215}else{if(d2.indexOf("rgb")===0){this.stroke=true;this.strokeColor=d3|this.parseRGB(d2)}else{if(d2.indexOf("url(#")===0){this.strokeName=d2.substring(5,d2.length-1)}else{if(p[d2]){this.stroke=true;this.strokeColor=d3|parseInt(p[d2].substring(1),16)&16777215}}}}}};cl.prototype.setStrokeWeight=function(d2){this.strokeWeight=this.parseUnitSize(d2)};cl.prototype.setStrokeJoin=function(d2){if(d2==="miter"){this.strokeJoin="miter"}else{if(d2==="round"){this.strokeJoin="round"}else{if(d2==="bevel"){this.strokeJoin="bevel"}}}};cl.prototype.setStrokeCap=function(d2){if(d2==="butt"){this.strokeCap="butt"}else{if(d2==="round"){this.strokeCap="round"}else{if(d2==="square"){this.strokeCap="square"}}}};cl.prototype.setStrokeOpacity=function(d2){this.strokeOpacity=parseFloat(d2);this.strokeColor=this.strokeOpacity*255<<24|this.strokeColor&16777215};cl.prototype.parseRGB=function(d3){var d4=d3.substring(d3.indexOf("(")+1,d3.indexOf(")"));var d2=d4.split(", ");return d2[0]<<16|d2[1]<<8|d2[2]};cl.prototype.parseUnitSize=function(d3){var d2=d3.length-2;if(d2<0){return d3}if(d3.indexOf("pt")===d2){return parseFloat(d3.substring(0,d2))*1.25}if(d3.indexOf("pc")===d2){return parseFloat(d3.substring(0,d2))*15}if(d3.indexOf("mm")===d2){return parseFloat(d3.substring(0,d2))*3.543307}if(d3.indexOf("cm")===d2){return parseFloat(d3.substring(0,d2))*35.43307}if(d3.indexOf("in")===d2){return parseFloat(d3.substring(0,d2))*90}if(d3.indexOf("px")===d2){return parseFloat(d3.substring(0,d2))}return parseFloat(d3)};cQ.shape=function(d4,d3,d6,d5,d2){if(arguments.length>=1&&arguments[0]!==null){if(d4.isVisible()){cQ.pushMatrix();if(L===3){if(arguments.length===5){cQ.translate(d3-d5/2,d6-d2/2);cQ.scale(d5/d4.getWidth(),d2/d4.getHeight())}else{if(arguments.length===3){cQ.translate(d3-d4.getWidth()/2,-d4.getHeight()/2)}else{cQ.translate(-d4.getWidth()/2,-d4.getHeight()/2)}}}else{if(L===0){if(arguments.length===5){cQ.translate(d3,d6);cQ.scale(d5/d4.getWidth(),d2/d4.getHeight())}else{if(arguments.length===3){cQ.translate(d3,d6)}}}else{if(L===1){if(arguments.length===5){d5-=d3;d2-=d6;cQ.translate(d3,d6);cQ.scale(d5/d4.getWidth(),d2/d4.getHeight())}else{if(arguments.length===3){cQ.translate(d3,d6)}}}}}d4.draw();if(arguments.length===1&&L===3||arguments.length>1){cQ.popMatrix()}}}};cQ.shapeMode=function(d2){L=d2};cQ.loadShape=function(d2){if(arguments.length===1){if(d2.indexOf(".svg")>-1){return new cl(null,d2)}}return null};var cN=function(d6,d5,d2,d3,d4){this.fullName=d6||"";this.name=d5||"";this.namespace=d2||"";this.value=d3;this.type=d4};cN.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(d2){this.value=d2}};var b3=cQ.XMLElement=function(){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";if(arguments.length===4){this.fullName=arguments[0]||"";if(arguments[1]){this.name=arguments[1]}else{var d2=this.fullName.indexOf(":");if(d2>=0){this.name=this.fullName.substring(d2+1)}else{this.name=this.fullName}}this.namespace=arguments[1];this.lineNr=arguments[3];this.systemID=arguments[2]}else{if(arguments.length===2&&arguments[1].indexOf(".")>-1){this.parse(arguments[arguments.length-1])}else{if(arguments.length===1&&typeof arguments[0]==="string"){this.parse(arguments[0])}}}};b3.prototype={parse:function(d2){var d4;try{var d6=d2.substring(d2.length-4);if(d6===".xml"||d6===".svg"){d2=r(d2)}d4=(new DOMParser).parseFromString(d2,"text/xml");var d3=d4.documentElement;if(d3){this.parseChildrenRecursive(null,d3)}else{throw"Error loading document"}return this}catch(d5){throw d5}},parseChildrenRecursive:function(ea,d8){var d7,d3,d9,d6,d5,d2;if(!ea){this.fullName=d8.localName;this.name=d8.nodeName;d7=this}else{d7=new b3(d8.localName,d8.nodeName,"","");d7.parent=ea}if(d8.nodeType===3&&d8.textContent!==""){return this.createPCDataElement(d8.textContent)}for(d6=0,d5=d8.attributes.length;d6<d5;d6++){d9=d8.attributes[d6];d3=new cN(d9.getname,d9.nodeName,d9.namespaceURI,d9.nodeValue,d9.nodeType);d7.attributes.push(d3)}for(d6=0,d5=d8.childNodes.length;d6<d5;d6++){var d4=d8.childNodes[d6];if(d4.nodeType===1||d4.nodeType===3){d2=d7.parseChildrenRecursive(d7,d4);if(d2!==null){d7.children.push(d2)}}}return d7},createElement:function(){if(arguments.length===2){return new b3(arguments[0],arguments[1],null,null)}return new b3(arguments[0],arguments[1],arguments[2],arguments[3])},createPCDataElement:function(d2){if(d2.replace(/^\s+$/g,"")===""){return null}var d3=new b3;d3.content=d2;d3.type="TEXT";return d3},hasAttribute:function(){if(arguments.length===1){return this.getAttribute(arguments[0])!==null}if(arguments.length===2){return this.getAttribute(arguments[0],arguments[1])!==null}},equals:function(d7){if(!(d7 instanceof b3)){return false}var d4,d3;if(this.name!==d7.getLocalName()){return false}if(this.attributes.length!==d7.getAttributeCount()){return false}if(this.attributes.length!==d7.attributes.length){return false}var eb,d9,d2,d8,ea;for(d4=0,d3=this.attributes.length;d4<d3;d4++){eb=this.attributes[d4].getName();d9=this.attributes[d4].getNamespace();ea=d7.findAttribute(eb,d9);if(ea===null){return false}if(this.attributes[d4].getValue()!==ea.getValue()){return false}if(this.attributes[d4].getType()!==ea.getType()){return false}}if(this.children.length!==d7.getChildCount()){return false}if(this.children.length>0){var d6,d5;for(d4=0,d3=this.children.length;d4<d3;d4++){d6=this.getChild(d4);d5=d7.getChild(d4);if(!d6.equals(d5)){return false}}return true}return this.content===d7.content},getContent:function(){if(this.type==="TEXT"){return this.content}var d2=this.children;if(d2.length===1&&d2[0].type==="TEXT"){return d2[0].content}return null},getAttribute:function(){var d2;if(arguments.length===2){d2=this.findAttribute(arguments[0]);if(d2){return d2.getValue()}return arguments[1]}else{if(arguments.length===1){d2=this.findAttribute(arguments[0]);if(d2){return d2.getValue()}return null}else{if(arguments.length===3){d2=this.findAttribute(arguments[0],arguments[1]);if(d2){return d2.getValue()}return arguments[2]}}}},getStringAttribute:function(){if(arguments.length===1){return this.getAttribute(arguments[0])}if(arguments.length===2){return this.getAttribute(arguments[0],arguments[1])}return this.getAttribute(arguments[0],arguments[1],arguments[2])},getString:function(d2){return this.getStringAttribute(d2)},getFloatAttribute:function(){if(arguments.length===1){return parseFloat(this.getAttribute(arguments[0],0))}if(arguments.length===2){return this.getAttribute(arguments[0],arguments[1])}return this.getAttribute(arguments[0],arguments[1],arguments[2])},getFloat:function(d2){return this.getFloatAttribute(d2)},getIntAttribute:function(){if(arguments.length===1){return this.getAttribute(arguments[0],0)}if(arguments.length===2){return this.getAttribute(arguments[0],arguments[1])}return this.getAttribute(arguments[0],arguments[1],arguments[2])},getInt:function(d2){return this.getIntAttribute(d2)},hasChildren:function(){return this.children.length>0},addChild:function(d2){if(d2!==null){d2.parent=this;this.children.push(d2)}},insertChild:function(d4,d2){if(d4){if(d4.getLocalName()===null&&!this.hasChildren()){var d3=this.children[this.children.length-1];if(d3.getLocalName()===null){d3.setContent(d3.getContent()+d4.getContent());return}}d4.parent=this;this.children.splice(d2,0,d4)}},getChild:function(){if(typeof arguments[0]==="number"){return this.children[arguments[0]]}if(arguments[0].indexOf("/")!==-1){this.getChildRecursive(arguments[0].split("/"),0);return null}var d2,d5;for(var d4=0,d3=this.getChildCount();d4<d3;d4++){d2=this.getChild(d4);d5=d2.getName();if(d5!==null&&d5===arguments[0]){return d2}}return null},getChildren:function(){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)}var d6=[];var d2,d5;for(var d4=0,d3=this.getChildCount();d4<d3;d4++){d2=this.getChild(d4);d5=d2.getName();if(d5!==null&&d5===arguments[0]){d6.push(d2)}}return d6}return this.children},getChildCount:function(){return this.children.length},getChildRecursive:function(d3,d7){var d2,d6;for(var d5=0,d4=this.getChildCount();d5<d4;d5++){d2=this.getChild(d5);d6=d2.getName();if(d6!==null&&d6===d3[d7]){if(d7===d3.length-1){return d2}d7+=1;return d2.getChildRecursive(d3,d7)}}return null},getChildrenRecursive:function(d2,d6){if(d6===d2.length-1){return this.getChildren(d2[d6])}var d5=this.getChildren(d2[d6]);var d4=[];for(var d3=0;d3<d5.length;d3++){d4=d4.concat(d5[d3].getChildrenRecursive(d2,d6+1))}return d4},isLeaf:function(){return !this.hasChildren()},listChildren:function(){var d2=[];for(var d4=0,d3=this.children.length;d4<d3;d4++){d2.push(this.getChild(d4).getName())}return d2},removeAttribute:function(d3,d5){this.namespace=d5||"";for(var d4=0,d2=this.attributes.length;d4<d2;d4++){if(this.attributes[d4].getName()===d3&&this.attributes[d4].getNamespace()===this.namespace){this.attributes.splice(d4,1);break}}},removeChild:function(d4){if(d4){for(var d3=0,d2=this.children.length;d3<d2;d3++){if(this.children[d3].equals(d4)){this.children.splice(d3,1);break}}}},removeChildAtIndex:function(d2){if(this.children.length>d2){this.children.splice(d2,1)}},findAttribute:function(d3,d5){this.namespace=d5||"";for(var d4=0,d2=this.attributes.length;d4<d2;d4++){if(this.attributes[d4].getName()===d3&&this.attributes[d4].getNamespace()===this.namespace){return this.attributes[d4]}}return null},setAttribute:function(){var d2;if(arguments.length===3){var d4=arguments[0].indexOf(":");var d3=arguments[0].substring(d4+1);d2=this.findAttribute(d3,arguments[1]);if(d2){d2.setValue(arguments[2])}else{d2=new cN(arguments[0],d3,arguments[1],arguments[2],"CDATA");this.attributes.push(d2)}}else{d2=this.findAttribute(arguments[0]);if(d2){d2.setValue(arguments[1])}else{d2=new cN(arguments[0],arguments[0],null,arguments[1],"CDATA");this.attributes.push(d2)}}},setString:function(d2,d3){this.setAttribute(d2,d3)},setInt:function(d2,d3){this.setAttribute(d2,d3)},setFloat:function(d2,d3){this.setAttribute(d2,d3)},setContent:function(d2){if(this.children.length>0){B.debug("Tried to set content for XMLElement with children")}this.content=d2},setName:function(){if(arguments.length===1){this.name=arguments[0];this.fullName=arguments[0];this.namespace=null}else{var d2=arguments[0].indexOf(":");if(arguments[1]===null||d2<0){this.name=arguments[0]}else{this.name=arguments[0].substring(d2+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(){if(this.type==="TEXT"){return this.content}var d4=(this.namespace!==""&&this.namespace!==this.name?this.namespace+":":"")+this.name;var d5="<"+d4;var d3,d6;for(d3=0;d3<this.attributes.length;d3++){var d2=this.attributes[d3];d5+=" "+d2.getName()+'="'+d2.getValue()+'"'}if(this.children.length===0){if(this.content===""){d5+="/>"}else{d5+=">"+this.content+"</"+d4+">"}}else{d5+=">";for(d6=0;d6<this.children.length;d6++){d5+=this.children[d6].toString()}d5+="</"+d4+">"}return d5}};b3.parse=function(d3){var d2=new b3;d2.parse(d3);return d2};var cg=function(d5){var d2=0;for(var d3=0;d3<d5.length;d3++){if(d3!==0){d2=o.max(d2,o.abs(d5[d3]))}else{d2=o.abs(d5[d3])}}var d4=(d2+"").indexOf(".");if(d4===0){d4=1}else{if(d4===-1){d4=(d2+"").length}}return d4};var aO=cQ.PMatrix2D=function(){if(arguments.length===0){this.reset()}else{if(arguments.length===1&&arguments[0] instanceof aO){this.set(arguments[0].array())}else{if(arguments.length===6){this.set(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])}}}};aO.prototype={set:function(){if(arguments.length===6){var d2=arguments;this.set([d2[0],d2[1],d2[2],d2[3],d2[4],d2[5]])}else{if(arguments.length===1&&arguments[0] instanceof aO){this.elements=arguments[0].array()}else{if(arguments.length===1&&arguments[0] instanceof Array){this.elements=arguments[0].slice()}}}},get:function(){var d2=new aO;d2.set(this.elements);return d2},reset:function(){this.set([1,0,0,0,1,0])},array:function ay(){return this.elements.slice()},translate:function(d3,d2){this.elements[2]=d3*this.elements[0]+d2*this.elements[1]+this.elements[2];this.elements[5]=d3*this.elements[3]+d2*this.elements[4]+this.elements[5]},invTranslate:function(d3,d2){this.translate(-d3,-d2)},transpose:function(){},mult:function(d3,d4){var d2,d5;if(d3 instanceof k){d2=d3.x;d5=d3.y;if(!d4){d4=new k}}else{if(d3 instanceof Array){d2=d3[0];d5=d3[1];if(!d4){d4=[]}}}if(d4 instanceof Array){d4[0]=this.elements[0]*d2+this.elements[1]*d5+this.elements[2];d4[1]=this.elements[3]*d2+this.elements[4]*d5+this.elements[5]}else{if(d4 instanceof k){d4.x=this.elements[0]*d2+this.elements[1]*d5+this.elements[2];d4.y=this.elements[3]*d2+this.elements[4]*d5+this.elements[5];d4.z=0}}return d4},multX:function(d2,d3){return d2*this.elements[0]+d3*this.elements[1]+this.elements[2]},multY:function(d2,d3){return d2*this.elements[3]+d3*this.elements[4]+this.elements[5]},skewX:function(d2){this.apply(1,0,1,d2,0,0)},skewY:function(d2){this.apply(1,0,1,0,d2,0)},determinant:function(){return this.elements[0]*this.elements[4]-this.elements[1]*this.elements[3]},invert:function(){var d7=this.determinant();if(o.abs(d7)>-2147483648){var d3=this.elements[0];var d8=this.elements[1];var d6=this.elements[2];var d5=this.elements[3];var d4=this.elements[4];var d2=this.elements[5];this.elements[0]=d4/d7;this.elements[3]=-d5/d7;this.elements[1]=-d8/d7;this.elements[4]=d3/d7;this.elements[2]=(d8*d2-d4*d6)/d7;this.elements[5]=(d5*d6-d3*d2)/d7;return true}return false},scale:function(d3,d2){if(d3&&!d2){d2=d3}if(d3&&d2){this.elements[0]*=d3;this.elements[1]*=d2;this.elements[3]*=d3;this.elements[4]*=d2}},invScale:function(d3,d2){if(d3&&!d2){d2=d3}this.scale(1/d3,1/d2)},apply:function(){var d4;if(arguments.length===1&&arguments[0] instanceof aO){d4=arguments[0].array()}else{if(arguments.length===6){d4=Array.prototype.slice.call(arguments)}else{if(arguments.length===1&&arguments[0] instanceof Array){d4=arguments[0]}}}var d2=[0,0,this.elements[2],0,0,this.elements[5]];var d5=0;for(var d6=0;d6<2;d6++){for(var d3=0;d3<3;d3++,d5++){d2[d5]+=this.elements[d6*3+0]*d4[d3+0]+this.elements[d6*3+1]*d4[d3+3]}}this.elements=d2.slice()},preApply:function(){var d3;if(arguments.length===1&&arguments[0] instanceof aO){d3=arguments[0].array()}else{if(arguments.length===6){d3=Array.prototype.slice.call(arguments)}else{if(arguments.length===1&&arguments[0] instanceof Array){d3=arguments[0]}}}var d2=[0,0,d3[2],0,0,d3[5]];d2[2]=d3[2]+this.elements[2]*d3[0]+this.elements[5]*d3[1];d2[5]=d3[5]+this.elements[2]*d3[3]+this.elements[5]*d3[4];d2[0]=this.elements[0]*d3[0]+this.elements[3]*d3[1];d2[3]=this.elements[0]*d3[3]+this.elements[3]*d3[4];d2[1]=this.elements[1]*d3[0]+this.elements[4]*d3[1];d2[4]=this.elements[1]*d3[3]+this.elements[4]*d3[4];this.elements=d2.slice()},rotate:function(d4){var d6=o.cos(d4);var d2=o.sin(d4);var d5=this.elements[0];var d3=this.elements[1];this.elements[0]=d6*d5+d2*d3;this.elements[1]=-d2*d5+d6*d3;d5=this.elements[3];d3=this.elements[4];this.elements[3]=d6*d5+d2*d3;this.elements[4]=-d2*d5+d6*d3},rotateZ:function(d2){this.rotate(d2)},invRotateZ:function(d2){this.rotateZ(d2-o.PI)},print:function(){var d3=cg(this.elements);var d2=""+cQ.nfs(this.elements[0],d3,4)+" "+cQ.nfs(this.elements[1],d3,4)+" "+cQ.nfs(this.elements[2],d3,4)+"\n"+cQ.nfs(this.elements[3],d3,4)+" "+cQ.nfs(this.elements[4],d3,4)+" "+cQ.nfs(this.elements[5],d3,4)+"\n\n";cQ.println(d2)}};var aH=cQ.PMatrix3D=function(){this.reset()};aH.prototype={set:function(){if(arguments.length===16){this.elements=Array.prototype.slice.call(arguments)}else{if(arguments.length===1&&arguments[0] instanceof aH){this.elements=arguments[0].array()}else{if(arguments.length===1&&arguments[0] instanceof Array){this.elements=arguments[0].slice()}}}},get:function(){var d2=new aH;d2.set(this.elements);return d2},reset:function(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},array:function ay(){return this.elements.slice()},translate:function(d3,d2,d4){if(d4===c){d4=0}this.elements[3]+=d3*this.elements[0]+d2*this.elements[1]+d4*this.elements[2];this.elements[7]+=d3*this.elements[4]+d2*this.elements[5]+d4*this.elements[6];this.elements[11]+=d3*this.elements[8]+d2*this.elements[9]+d4*this.elements[10];this.elements[15]+=d3*this.elements[12]+d2*this.elements[13]+d4*this.elements[14]},transpose:function(){var d2=this.elements[4];this.elements[4]=this.elements[1];this.elements[1]=d2;d2=this.elements[8];this.elements[8]=this.elements[2];this.elements[2]=d2;d2=this.elements[6];this.elements[6]=this.elements[9];this.elements[9]=d2;d2=this.elements[3];this.elements[3]=this.elements[12];this.elements[12]=d2;d2=this.elements[7];this.elements[7]=this.elements[13];this.elements[13]=d2;d2=this.elements[11];this.elements[11]=this.elements[14];this.elements[14]=d2},mult:function(d4,d5){var d2,d7,d6,d3;if(d4 instanceof k){d2=d4.x;d7=d4.y;d6=d4.z;d3=1;if(!d5){d5=new k}}else{if(d4 instanceof Array){d2=d4[0];d7=d4[1];d6=d4[2];d3=d4[3]||1;if(!d5||d5.length!==3&&d5.length!==4){d5=[0,0,0]}}}if(d5 instanceof Array){if(d5.length===3){d5[0]=this.elements[0]*d2+this.elements[1]*d7+this.elements[2]*d6+this.elements[3];d5[1]=this.elements[4]*d2+this.elements[5]*d7+this.elements[6]*d6+this.elements[7];d5[2]=this.elements[8]*d2+this.elements[9]*d7+this.elements[10]*d6+this.elements[11]}else{if(d5.length===4){d5[0]=this.elements[0]*d2+this.elements[1]*d7+this.elements[2]*d6+this.elements[3]*d3;d5[1]=this.elements[4]*d2+this.elements[5]*d7+this.elements[6]*d6+this.elements[7]*d3;d5[2]=this.elements[8]*d2+this.elements[9]*d7+this.elements[10]*d6+this.elements[11]*d3;d5[3]=this.elements[12]*d2+this.elements[13]*d7+this.elements[14]*d6+this.elements[15]*d3}}}if(d5 instanceof k){d5.x=this.elements[0]*d2+this.elements[1]*d7+this.elements[2]*d6+this.elements[3];d5.y=this.elements[4]*d2+this.elements[5]*d7+this.elements[6]*d6+this.elements[7];d5.z=this.elements[8]*d2+this.elements[9]*d7+this.elements[10]*d6+this.elements[11]}return d5},preApply:function(){var d4;if(arguments.length===1&&arguments[0] instanceof aH){d4=arguments[0].array()}else{if(arguments.length===16){d4=Array.prototype.slice.call(arguments)}else{if(arguments.length===1&&arguments[0] instanceof Array){d4=arguments[0]}}}var d2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var d5=0;for(var d6=0;d6<4;d6++){for(var d3=0;d3<4;d3++,d5++){d2[d5]+=this.elements[d3+0]*d4[d6*4+0]+this.elements[d3+4]*d4[d6*4+1]+this.elements[d3+8]*d4[d6*4+2]+this.elements[d3+12]*d4[d6*4+3]}}this.elements=d2.slice()},apply:function(){var d4;if(arguments.length===1&&arguments[0] instanceof aH){d4=arguments[0].array()}else{if(arguments.length===16){d4=Array.prototype.slice.call(arguments)}else{if(arguments.length===1&&arguments[0] instanceof Array){d4=arguments[0]}}}var d2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var d5=0;for(var d6=0;d6<4;d6++){for(var d3=0;d3<4;d3++,d5++){d2[d5]+=this.elements[d6*4+0]*d4[d3+0]+this.elements[d6*4+1]*d4[d3+4]+this.elements[d6*4+2]*d4[d3+8]+this.elements[d6*4+3]*d4[d3+12]}}this.elements=d2.slice()},rotate:function(d6,d2,d8,d5){if(!d8){this.rotateZ(d6)}else{var d7=cQ.cos(d6);var d4=cQ.sin(d6);var d3=1-d7;this.apply(d3*d2*d2+d7,d3*d2*d8-d4*d5,d3*d2*d5+d4*d8,0,d3*d2*d8+d4*d5,d3*d8*d8+d7,d3*d8*d5-d4*d2,0,d3*d2*d5-d4*d8,d3*d8*d5+d4*d2,d3*d5*d5+d7,0,0,0,0,1)}},invApply:function(){if(U===c){U=new aH}var d2=arguments;U.set(d2[0],d2[1],d2[2],d2[3],d2[4],d2[5],d2[6],d2[7],d2[8],d2[9],d2[10],d2[11],d2[12],d2[13],d2[14],d2[15]);if(!U.invert()){return false}this.preApply(U);return true},rotateX:function(d3){var d4=cQ.cos(d3);var d2=cQ.sin(d3);this.apply([1,0,0,0,0,d4,-d2,0,0,d2,d4,0,0,0,0,1])},rotateY:function(d3){var d4=cQ.cos(d3);var d2=cQ.sin(d3);this.apply([d4,0,d2,0,0,1,0,0,-d2,0,d4,0,0,0,0,1])},rotateZ:function(d3){var d4=o.cos(d3);var d2=o.sin(d3);this.apply([d4,-d2,0,0,d2,d4,0,0,0,0,1,0,0,0,0,1])},scale:function(d4,d3,d2){if(d4&&!d3&&!d2){d3=d2=d4}else{if(d4&&d3&&!d2){d2=1}}if(d4&&d3&&d2){this.elements[0]*=d4;this.elements[1]*=d3;this.elements[2]*=d2;this.elements[4]*=d4;this.elements[5]*=d3;this.elements[6]*=d2;this.elements[8]*=d4;this.elements[9]*=d3;this.elements[10]*=d2;this.elements[12]*=d4;this.elements[13]*=d3;this.elements[14]*=d2}},skewX:function(d3){var d2=o.tan(d3);this.apply(1,d2,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},skewY:function(d3){var d2=o.tan(d3);this.apply(1,0,0,0,d2,1,0,0,0,0,1,0,0,0,0,1)},multX:function(d2,d5,d4,d3){if(!d4){return this.elements[0]*d2+this.elements[1]*d5+this.elements[3]}if(!d3){return this.elements[0]*d2+this.elements[1]*d5+this.elements[2]*d4+this.elements[3]}return this.elements[0]*d2+this.elements[1]*d5+this.elements[2]*d4+this.elements[3]*d3},multY:function(d2,d5,d4,d3){if(!d4){return this.elements[4]*d2+this.elements[5]*d5+this.elements[7]}if(!d3){return this.elements[4]*d2+this.elements[5]*d5+this.elements[6]*d4+this.elements[7]}return this.elements[4]*d2+this.elements[5]*d5+this.elements[6]*d4+this.elements[7]*d3},multZ:function(d2,d5,d4,d3){if(!d3){return this.elements[8]*d2+this.elements[9]*d5+this.elements[10]*d4+this.elements[11]}return this.elements[8]*d2+this.elements[9]*d5+this.elements[10]*d4+this.elements[11]*d3},multW:function(d2,d5,d4,d3){if(!d3){return this.elements[12]*d2+this.elements[13]*d5+this.elements[14]*d4+this.elements[15]}return this.elements[12]*d2+this.elements[13]*d5+this.elements[14]*d4+this.elements[15]*d3},invert:function(){var eb=this.elements[0]*this.elements[5]-this.elements[1]*this.elements[4];var ea=this.elements[0]*this.elements[6]-this.elements[2]*this.elements[4];var d9=this.elements[0]*this.elements[7]-this.elements[3]*this.elements[4];var d8=this.elements[1]*this.elements[6]-this.elements[2]*this.elements[5];var d7=this.elements[1]*this.elements[7]-this.elements[3]*this.elements[5];var d6=this.elements[2]*this.elements[7]-this.elements[3]*this.elements[6];var d5=this.elements[8]*this.elements[13]-this.elements[9]*this.elements[12];var d4=this.elements[8]*this.elements[14]-this.elements[10]*this.elements[12];var d3=this.elements[8]*this.elements[15]-this.elements[11]*this.elements[12];var eg=this.elements[9]*this.elements[14]-this.elements[10]*this.elements[13];var ee=this.elements[9]*this.elements[15]-this.elements[11]*this.elements[13];var ed=this.elements[10]*this.elements[15]-this.elements[11]*this.elements[14];var ef=eb*ed-ea*ee+d9*eg+d8*d3-d7*d4+d6*d5;if(o.abs(ef)<=1e-9){return false}var ec=[];ec[0]=+this.elements[5]*ed-this.elements[6]*ee+this.elements[7]*eg;ec[4]=-this.elements[4]*ed+this.elements[6]*d3-this.elements[7]*d4;ec[8]=+this.elements[4]*ee-this.elements[5]*d3+this.elements[7]*d5;ec[12]=-this.elements[4]*eg+this.elements[5]*d4-this.elements[6]*d5;ec[1]=-this.elements[1]*ed+this.elements[2]*ee-this.elements[3]*eg;ec[5]=+this.elements[0]*ed-this.elements[2]*d3+this.elements[3]*d4;ec[9]=-this.elements[0]*ee+this.elements[1]*d3-this.elements[3]*d5;ec[13]=+this.elements[0]*eg-this.elements[1]*d4+this.elements[2]*d5;ec[2]=+this.elements[13]*d6-this.elements[14]*d7+this.elements[15]*d8;ec[6]=-this.elements[12]*d6+this.elements[14]*d9-this.elements[15]*ea;ec[10]=+this.elements[12]*d7-this.elements[13]*d9+this.elements[15]*eb;ec[14]=-this.elements[12]*d8+this.elements[13]*ea-this.elements[14]*eb;ec[3]=-this.elements[9]*d6+this.elements[10]*d7-this.elements[11]*d8;ec[7]=+this.elements[8]*d6-this.elements[10]*d9+this.elements[11]*ea;ec[11]=-this.elements[8]*d7+this.elements[9]*d9-this.elements[11]*eb;ec[15]=+this.elements[8]*d8-this.elements[9]*ea+this.elements[10]*eb;var d2=1/ef;ec[0]*=d2;ec[1]*=d2;ec[2]*=d2;ec[3]*=d2;ec[4]*=d2;ec[5]*=d2;ec[6]*=d2;ec[7]*=d2;ec[8]*=d2;ec[9]*=d2;ec[10]*=d2;ec[11]*=d2;ec[12]*=d2;ec[13]*=d2;ec[14]*=d2;ec[15]*=d2;this.elements=ec.slice();return true},toString:function(){var d3="";for(var d2=0;d2<15;d2++){d3+=this.elements[d2]+", "}d3+=this.elements[15];return d3},print:function(){var d3=cg(this.elements);var d2=""+cQ.nfs(this.elements[0],d3,4)+" "+cQ.nfs(this.elements[1],d3,4)+" "+cQ.nfs(this.elements[2],d3,4)+" "+cQ.nfs(this.elements[3],d3,4)+"\n"+cQ.nfs(this.elements[4],d3,4)+" "+cQ.nfs(this.elements[5],d3,4)+" "+cQ.nfs(this.elements[6],d3,4)+" "+cQ.nfs(this.elements[7],d3,4)+"\n"+cQ.nfs(this.elements[8],d3,4)+" "+cQ.nfs(this.elements[9],d3,4)+" "+cQ.nfs(this.elements[10],d3,4)+" "+cQ.nfs(this.elements[11],d3,4)+"\n"+cQ.nfs(this.elements[12],d3,4)+" "+cQ.nfs(this.elements[13],d3,4)+" "+cQ.nfs(this.elements[14],d3,4)+" "+cQ.nfs(this.elements[15],d3,4)+"\n\n";cQ.println(d2)},invTranslate:function(d3,d2,d4){this.preApply(1,0,0,-d3,0,1,0,-d2,0,0,1,-d4,0,0,0,1)},invRotateX:function(d3){var d4=o.cos(-d3);var d2=o.sin(-d3);this.preApply([1,0,0,0,0,d4,-d2,0,0,d2,d4,0,0,0,0,1])},invRotateY:function(d3){var d4=o.cos(-d3);var d2=o.sin(-d3);this.preApply([d4,0,d2,0,0,1,0,0,-d2,0,d4,0,0,0,0,1])},invRotateZ:function(d3){var d4=o.cos(-d3);var d2=o.sin(-d3);this.preApply([d4,-d2,0,0,d2,d4,0,0,0,0,1,0,0,0,0,1])},invScale:function(d2,d4,d3){this.preApply([1/d2,0,0,0,0,1/d4,0,0,0,0,1/d3,0,0,0,0,1])}};var O=cQ.PMatrixStack=function(){this.matrixStack=[]};O.prototype.load=function(){var d2=dP.$newPMatrix();if(arguments.length===1){d2.set(arguments[0])}else{d2.set(arguments)}this.matrixStack.push(d2)};bJ.prototype.$newPMatrix=function(){return new aO};bt.prototype.$newPMatrix=function(){return new aH};O.prototype.push=function(){this.matrixStack.push(this.peek())};O.prototype.pop=function(){return this.matrixStack.pop()};O.prototype.peek=function(){var d2=dP.$newPMatrix();d2.set(this.matrixStack[this.matrixStack.length-1]);return d2};O.prototype.mult=function(d2){this.matrixStack[this.matrixStack.length-1].apply(d2)};cQ.split=function(d3,d2){return d3.split(d2)};cQ.splitTokens=function(d5,d4){if(arguments.length===1){d4="\n\t\r\u000c "}d4="["+d4+"]";var d3=[];var d2=0;var d6=d5.search(d4);while(d6>=0){if(d6===0){d5=d5.substring(1)}else{d3[d2]=d5.substring(0,d6);d2++;d5=d5.substring(d6)}d6=d5.search(d4)}if(d5.length>0){d3[d2]=d5}if(d3.length===0){d3=c}return d3};cQ.append=function(d3,d2){d3[d3.length]=d2;return d3};cQ.concat=function(d3,d2){return d3.concat(d2)};cQ.sort=function(d7,d5){var d3=[];if(d7.length>0){var d6=d5>0?d5:d7.length;for(var d4=0;d4<d6;d4++){d3.push(d7[d4])}if(typeof d7[0]==="string"){d3.sort()}else{d3.sort(function(d9,d8){return d9-d8})}if(d5>0){for(var d2=d3.length;d2<d7.length;d2++){d3.push(d7[d2])}}}return d3};cQ.splice=function(d6,d5,d3){if(d5.length===0){return d6}if(d5 instanceof Array){for(var d4=0,d2=d3;d4<d5.length;d2++,d4++){d6.splice(d2,0,d5[d4])}}else{d6.splice(d3,0,d5)}return d6};cQ.subset=function(d5,d4,d3){var d2=d3!==c?d4+d3:d5.length;return d5.slice(d4,d2)};cQ.join=function(d3,d2){return d3.join(d2)};cQ.shorten=function(d5){var d3=[];var d2=d5.length;for(var d4=0;d4<d2;d4++){d3[d4]=d5[d4]}d3.pop();return d3};cQ.expand=function(d4,d5){var d3=d4.slice(0),d2=d5||d4.length*2;d3.length=d2;return d3};cQ.arrayCopy=function(){var d8,d6=0,d4,d3=0,d7;if(arguments.length===2){d8=arguments[0];d4=arguments[1];d7=d8.length}else{if(arguments.length===3){d8=arguments[0];d4=arguments[1];d7=arguments[2]}else{if(arguments.length===5){d8=arguments[0];d6=arguments[1];d4=arguments[2];d3=arguments[3];d7=arguments[4]}}}for(var d5=d6,d2=d3;d5<d7+d6;d5++,d2++){if(d4[d2]!==c){d4[d2]=d8[d5]}else{throw"array index out of bounds exception"}}};cQ.reverse=function(d2){return d2.reverse()};cQ.mix=function(d3,d2,d4){return d3+((d2-d3)*d4>>8)};cQ.peg=function(d2){return d2<0?0:d2>255?255:d2};cQ.modes=function(){var d7=4278190080,d4=16711680,d3=65280,d6=255,d5=o.min,d2=o.max;function d8(ed,eg,ec,el,en,em,ee,ei,eh,ea,eb){var ek=d5(((ed&4278190080)>>>24)+eg,255)<<24;var d9=ec+((eh-ec)*eg>>8);d9=(d9<0?0:d9>255?255:d9)<<16;var ef=el+((ea-el)*eg>>8);ef=(ef<0?0:ef>255?255:ef)<<8;var ej=en+((eb-en)*eg>>8);ej=ej<0?0:ej>255?255:ej;return ek|d9|ef|ej}return{replace:function(ea,d9){return d9},blend:function(eb,ea){var ed=(ea&d7)>>>24,d9=eb&d4,ef=eb&d3,eh=eb&d6,eg=ea&d4,ec=ea&d3,ee=ea&d6;return d5(((eb&d7)>>>24)+ed,255)<<24|d9+((eg-d9)*ed>>8)&d4|ef+((ec-ef)*ed>>8)&d3|eh+((ee-eh)*ed>>8)&d6},add:function(ea,d9){var eb=(d9&d7)>>>24;return d5(((ea&d7)>>>24)+eb,255)<<24|d5((ea&d4)+((d9&d4)>>8)*eb,d4)&d4|d5((ea&d3)+((d9&d3)>>8)*eb,d3)&d3|d5((ea&d6)+((d9&d6)*eb>>8),d6)},subtract:function(ea,d9){var eb=(d9&d7)>>>24;return d5(((ea&d7)>>>24)+eb,255)<<24|d2((ea&d4)-((d9&d4)>>8)*eb,d3)&d4|d2((ea&d3)-((d9&d3)>>8)*eb,d6)&d3|d2((ea&d6)-((d9&d6)*eb>>8),0)},lightest:function(ea,d9){var eb=(d9&d7)>>>24;return d5(((ea&d7)>>>24)+eb,255)<<24|d2(ea&d4,((d9&d4)>>8)*eb)&d4|d2(ea&d3,((d9&d3)>>8)*eb)&d3|d2(ea&d6,(d9&d6)*eb>>8)},darkest:function(eb,ea){var ed=(ea&d7)>>>24,d9=eb&d4,ef=eb&d3,eh=eb&d6,eg=d5(eb&d4,((ea&d4)>>8)*ed),ec=d5(eb&d3,((ea&d3)>>8)*ed),ee=d5(eb&d6,(ea&d6)*ed>>8);return d5(((eb&d7)>>>24)+ed,255)<<24|d9+((eg-d9)*ed>>8)&d4|ef+((ec-ef)*ed>>8)&d3|eh+((ee-eh)*ed>>8)&d6},difference:function(ed,ec){var ef=(ec&d7)>>>24,eb=(ed&d4)>>16,ei=(ed&d3)>>8,ek=ed&d6,ej=(ec&d4)>>16,ee=(ec&d3)>>8,eh=ec&d6,eg=eb>ej?eb-ej:ej-eb,d9=ei>ee?ei-ee:ee-ei,ea=ek>eh?ek-eh:eh-ek;return d8(ed,ef,eb,ei,ek,ej,ee,eh,eg,d9,ea)},exclusion:function(ed,ec){var ef=(ec&d7)>>>24,eb=(ed&d4)>>16,ei=(ed&d3)>>8,ek=ed&d6,ej=(ec&d4)>>16,ee=(ec&d3)>>8,eh=ec&d6,eg=eb+ej-(eb*ej>>7),d9=ei+ee-(ei*ee>>7),ea=ek+eh-(ek*eh>>7);return d8(ed,ef,eb,ei,ek,ej,ee,eh,eg,d9,ea)},multiply:function(ed,ec){var ef=(ec&d7)>>>24,eb=(ed&d4)>>16,ei=(ed&d3)>>8,ek=ed&d6,ej=(ec&d4)>>16,ee=(ec&d3)>>8,eh=ec&d6,eg=eb*ej>>8,d9=ei*ee>>8,ea=ek*eh>>8;return d8(ed,ef,eb,ei,ek,ej,ee,eh,eg,d9,ea)},screen:function(ed,ec){var ef=(ec&d7)>>>24,eb=(ed&d4)>>16,ei=(ed&d3)>>8,ek=ed&d6,ej=(ec&d4)>>16,ee=(ec&d3)>>8,eh=ec&d6,eg=255-((255-eb)*(255-ej)>>8),d9=255-((255-ei)*(255-ee)>>8),ea=255-((255-ek)*(255-eh)>>8);return d8(ed,ef,eb,ei,ek,ej,ee,eh,eg,d9,ea)},hard_light:function(ed,ec){var ef=(ec&d7)>>>24,eb=(ed&d4)>>16,ei=(ed&d3)>>8,ek=ed&d6,ej=(ec&d4)>>16,ee=(ec&d3)>>8,eh=ec&d6,eg=ej<128?eb*ej>>7:255-((255-eb)*(255-ej)>>7),d9=ee<128?ei*ee>>7:255-((255-ei)*(255-ee)>>7),ea=eh<128?ek*eh>>7:255-((255-ek)*(255-eh)>>7);return d8(ed,ef,eb,ei,ek,ej,ee,eh,eg,d9,ea)},soft_light:function(ed,ec){var ef=(ec&d7)>>>24,eb=(ed&d4)>>16,ei=(ed&d3)>>8,ek=ed&d6,ej=(ec&d4)>>16,ee=(ec&d3)>>8,eh=ec&d6,eg=(eb*ej>>7)+(eb*eb>>8)-(eb*eb*ej>>15),d9=(ei*ee>>7)+(ei*ei>>8)-(ei*ei*ee>>15),ea=(ek*eh>>7)+(ek*ek>>8)-(ek*ek*eh>>15);return d8(ed,ef,eb,ei,ek,ej,ee,eh,eg,d9,ea)},overlay:function(ed,ec){var ef=(ec&d7)>>>24,eb=(ed&d4)>>16,ei=(ed&d3)>>8,ek=ed&d6,ej=(ec&d4)>>16,ee=(ec&d3)>>8,eh=ec&d6,eg=eb<128?eb*ej>>7:255-((255-eb)*(255-ej)>>7),d9=ei<128?ei*ee>>7:255-((255-ei)*(255-ee)>>7),ea=ek<128?ek*eh>>7:255-((255-ek)*(255-eh)>>7);return d8(ed,ef,eb,ei,ek,ej,ee,eh,eg,d9,ea)},dodge:function(ed,ec){var ef=(ec&d7)>>>24,eb=(ed&d4)>>16,ei=(ed&d3)>>8,ek=ed&d6,ej=(ec&d4)>>16,ee=(ec&d3)>>8,eh=ec&d6;var eg=255;if(ej!==255){eg=(eb<<8)/(255-ej);eg=eg<0?0:eg>255?255:eg}var d9=255;if(ee!==255){d9=(ei<<8)/(255-ee);d9=d9<0?0:d9>255?255:d9}var ea=255;if(eh!==255){ea=(ek<<8)/(255-eh);ea=ea<0?0:ea>255?255:ea}return d8(ed,ef,eb,ei,ek,ej,ee,eh,eg,d9,ea)},burn:function(ed,ec){var ef=(ec&d7)>>>24,eb=(ed&d4)>>16,ei=(ed&d3)>>8,ek=ed&d6,ej=(ec&d4)>>16,ee=(ec&d3)>>8,eh=ec&d6;var eg=0;if(ej!==0){eg=(255-eb<<8)/ej;eg=255-(eg<0?0:eg>255?255:eg)}var d9=0;if(ee!==0){d9=(255-ei<<8)/ee;d9=255-(d9<0?0:d9>255?255:d9)}var ea=0;if(eh!==0){ea=(255-ek<<8)/eh;ea=255-(ea<0?0:ea>255?255:ea)}return d8(ed,ef,eb,ei,ek,ej,ee,eh,eg,d9,ea)}}}();function dy(d7,d6,d4,d3){var d2,d5,d9,ea;if(cS===3){var d8=cQ.color.toRGB(d7,d6,d4);d2=d8[0];d5=d8[1];d9=d8[2]}else{d2=o.round(255*(d7/bB));d5=o.round(255*(d6/bA));d9=o.round(255*(d4/by))}ea=o.round(255*(d3/bM));d2=d2<0?0:d2;d5=d5<0?0:d5;d9=d9<0?0:d9;ea=ea<0?0:ea;d2=d2>255?255:d2;d5=d5>255?255:d5;d9=d9>255?255:d9;ea=ea>255?255:ea;return ea<<24&4278190080|d2<<16&16711680|d5<<8&65280|d9&255}function dB(d2,d4){var d3;if(d2&4278190080){d3=o.round(255*(d4/bM));d3=d3>255?255:d3;d3=d3<0?0:d3;return d2-(d2&4278190080)+(d3<<24&4278190080)}if(cS===1){return dy(d2,d2,d2,d4)}if(cS===3){return dy(0,0,d2/bB*by,d4)}}function dD(d2){if(d2<=bB&&d2>=0){if(cS===1){return dy(d2,d2,d2,bM)}if(cS===3){return dy(0,0,d2/bB*by,bM)}}if(d2){if(d2>2147483647){d2-=4294967296}return d2}}cQ.color=function(d2,d5,d4,d3){if(d2!==c&&d5!==c&&d4!==c&&d3!==c){return dy(d2,d5,d4,d3)}if(d2!==c&&d5!==c&&d4!==c){return dy(d2,d5,d4,bM)}if(d2!==c&&d5!==c){return dB(d2,d5)}if(typeof d2==="number"){return dD(d2)}return dy(bB,bA,by,bM)};cQ.color.toString=function(d2){return"rgba("+(d2>>16&255)+","+(d2>>8&255)+","+(d2&255)+","+(d2>>24&255)/255+")"};cQ.color.toInt=function(d5,d4,d2,d3){return d3<<24&4278190080|d5<<16&16711680|d4<<8&65280|d2&255};cQ.color.toArray=function(d2){return[d2>>16&255,d2>>8&255,d2&255,d2>>24&255]};cQ.color.toGLArray=function(d2){return[(d2>>16&255)/255,(d2>>8&255)/255,(d2&255)/255,(d2>>24&255)/255]};cQ.color.toRGB=function(d4,ea,d7){d4=d4>bB?bB:d4;ea=ea>bA?bA:ea;d7=d7>by?by:d7;d4=d4/bB*360;ea=ea/bA*100;d7=d7/by*100;var d9=o.round(d7/100*255);if(ea===0){return[d9,d9,d9]}var d5=d4%360;var d6=d5%60;var d3=o.round(d7*(100-ea)/10000*255);var d2=o.round(d7*(6000-ea*d6)/600000*255);var d8=o.round(d7*(6000-ea*(60-d6))/600000*255);switch(o.floor(d5/60)){case 0:return[d9,d8,d3];case 1:return[d2,d9,d3];case 2:return[d3,d9,d8];case 3:return[d3,d2,d9];case 4:return[d8,d3,d9];case 5:return[d9,d3,d2]}};function aK(d9){var d8,d7,d3;d8=(d9>>16&255)/255;d7=(d9>>8&255)/255;d3=(d9&255)/255;var d2=cQ.max(cQ.max(d8,d7),d3),d5=cQ.min(cQ.min(d8,d7),d3),d4,d6;if(d5===d2){return[0,0,d2*by]}d6=(d2-d5)/d2;if(d8===d2){d4=(d7-d3)/(d2-d5)}else{if(d7===d2){d4=2+(d3-d8)/(d2-d5)}else{d4=4+(d8-d7)/(d2-d5)}}d4/=6;if(d4<0){d4+=1}else{if(d4>1){d4-=1}}return[d4*bB,d6*bA,d2*by]}cQ.brightness=function(d2){return aK(d2)[2]};cQ.saturation=function(d2){return aK(d2)[1]};cQ.hue=function(d2){return aK(d2)[0]};cQ.red=function(d2){return(d2>>16&255)/255*bB};cQ.green=function(d2){return(d2>>8&255)/255*bA};cQ.blue=function(d2){return(d2&255)/255*by};cQ.alpha=function(d2){return(d2>>24&255)/255*bM};cQ.lerpColor=function(ee,ed,d7){var ec,ei,ej,ek,eg,d2,d8,em,ef,en,d6,el;var ea,d9,d3,eh,eb;var d5=cQ.color(ee);var d4=cQ.color(ed);if(cS===3){ea=aK(d5);em=(d5>>24&255)/bM;d9=aK(d4);el=(d4>>24&255)/bM;eh=cQ.lerp(ea[0],d9[0],d7);eb=cQ.lerp(ea[1],d9[1],d7);ej=cQ.lerp(ea[2],d9[2],d7);d3=cQ.color.toRGB(eh,eb,ej);ek=cQ.lerp(em,el,d7)*bM;return ek<<24&4278190080|(d3[0]&255)<<16|(d3[1]&255)<<8|d3[2]&255}eg=d5>>16&255;d2=d5>>8&255;d8=d5&255;em=(d5>>24&255)/bM;ef=d4>>16&255;en=d4>>8&255;d6=d4&255;el=(d4>>24&255)/bM;ec=cQ.lerp(eg,ef,d7)|0;ei=cQ.lerp(d2,en,d7)|0;ej=cQ.lerp(d8,d6,d7)|0;ek=cQ.lerp(em,el,d7)*bM;return ek<<24&4278190080|ec<<16&16711680|ei<<8&65280|ej&255};cQ.colorMode=function(){cS=arguments[0];if(arguments.length>1){bB=arguments[1];bA=arguments[2]||arguments[1];by=arguments[3]||arguments[1];bM=arguments[4]||arguments[1]}};cQ.blendColor=function(d3,d2,d4){if(d4===0){return cQ.modes.replace(d3,d2)}else{if(d4===1){return cQ.modes.blend(d3,d2)}else{if(d4===2){return cQ.modes.add(d3,d2)}else{if(d4===4){return cQ.modes.subtract(d3,d2)}else{if(d4===8){return cQ.modes.lightest(d3,d2)}else{if(d4===16){return cQ.modes.darkest(d3,d2)}else{if(d4===32){return cQ.modes.difference(d3,d2)}else{if(d4===64){return cQ.modes.exclusion(d3,d2)}else{if(d4===128){return cQ.modes.multiply(d3,d2)}else{if(d4===256){return cQ.modes.screen(d3,d2)}else{if(d4===1024){return cQ.modes.hard_light(d3,d2)}else{if(d4===2048){return cQ.modes.soft_light(d3,d2)}else{if(d4===512){return cQ.modes.overlay(d3,d2)}else{if(d4===4096){return cQ.modes.dodge(d3,d2)}else{if(d4===8192){return cQ.modes.burn(d3,d2)}}}}}}}}}}}}}}}};function ax(){dZ.save()}function cJ(){dZ.restore();bX=true;ak=true}cQ.printMatrix=function(){dA.print()};bJ.prototype.translate=function(d2,d3){dA.translate(d2,d3);aL.invTranslate(d2,d3);dZ.translate(d2,d3)};bt.prototype.translate=function(d2,d4,d3){dA.translate(d2,d4,d3);aL.invTranslate(d2,d4,d3)};bJ.prototype.scale=function(d2,d3){dA.scale(d2,d3);aL.invScale(d2,d3);dZ.scale(d2,d3||d2)};bt.prototype.scale=function(d2,d4,d3){dA.scale(d2,d4,d3);aL.invScale(d2,d4,d3)};bJ.prototype.pushMatrix=function(){ag.load(dA);c4.load(aL);ax()};bt.prototype.pushMatrix=function(){ag.load(dA);c4.load(aL)};bJ.prototype.popMatrix=function(){dA.set(ag.pop());aL.set(c4.pop());cJ()};bt.prototype.popMatrix=function(){dA.set(ag.pop());aL.set(c4.pop())};bJ.prototype.resetMatrix=function(){dA.reset();aL.reset();dZ.setTransform(1,0,0,1,0,0)};bt.prototype.resetMatrix=function(){dA.reset();aL.reset()};dj.prototype.applyMatrix=function(){var d2=arguments;dA.apply(d2[0],d2[1],d2[2],d2[3],d2[4],d2[5],d2[6],d2[7],d2[8],d2[9],d2[10],d2[11],d2[12],d2[13],d2[14],d2[15]);aL.invApply(d2[0],d2[1],d2[2],d2[3],d2[4],d2[5],d2[6],d2[7],d2[8],d2[9],d2[10],d2[11],d2[12],d2[13],d2[14],d2[15])};bJ.prototype.applyMatrix=function(){var d2=arguments;for(var d3=d2.length;d3<16;d3++){d2[d3]=0}d2[10]=d2[15]=1;dj.prototype.applyMatrix.apply(this,d2)};cQ.rotateX=function(d2){dA.rotateX(d2);aL.invRotateX(d2)};bJ.prototype.rotateZ=function(){throw"rotateZ() is not supported in 2D mode. Use rotate(float) instead."};bt.prototype.rotateZ=function(d2){dA.rotateZ(d2);aL.invRotateZ(d2)};cQ.rotateY=function(d2){dA.rotateY(d2);aL.invRotateY(d2)};bJ.prototype.rotate=function(d2){dA.rotateZ(d2);aL.invRotateZ(d2);dZ.rotate(d2)};bt.prototype.rotate=function(d2){cQ.rotateZ(d2)};cQ.pushStyle=function(){ax();cQ.pushMatrix();var d2={doFill:aA,currentFillColor:aS,doStroke:b8,currentStrokeColor:cp,curTint:a6,curRectMode:bD,curColorMode:cS,colorModeX:bB,colorModeZ:by,colorModeY:bA,colorModeA:bM,curTextFont:P,horizontalTextAlignment:G,verticalTextAlignment:cV,textMode:cC,curFontName:R,curTextSize:dR,curTextAscent:aU,curTextDescent:ds,curTextLeading:dY};be.push(d2)};cQ.popStyle=function(){var d2=be.pop();if(d2){cJ();cQ.popMatrix();aA=d2.doFill;aS=d2.currentFillColor;b8=d2.doStroke;cp=d2.currentStrokeColor;a6=d2.curTint;bD=d2.curRectmode;cS=d2.curColorMode;bB=d2.colorModeX;by=d2.colorModeZ;bA=d2.colorModeY;bM=d2.colorModeA;P=d2.curTextFont;R=d2.curFontName;dR=d2.curTextSize;G=d2.horizontalTextAlignment;cV=d2.verticalTextAlignment;cC=d2.textMode;aU=d2.curTextAscent;ds=d2.curTextDescent;dY=d2.curTextLeading}else{throw"Too many popStyle() without enough pushStyle()"}};cQ.year=function(){return(new Date).getFullYear()};cQ.month=function(){return(new Date).getMonth()+1};cQ.day=function(){return(new Date).getDate()};cQ.hour=function(){return(new Date).getHours()};cQ.minute=function(){return(new Date).getMinutes()};cQ.second=function(){return(new Date).getSeconds()};cQ.millis=function(){return Date.now()-dh};function cn(){var d2=(Date.now()-dk)/1000;I++;var d3=I/d2;if(d2>0.5){dk=Date.now();I=0;cQ.__frameRate=d3}cQ.frameCount++}bJ.prototype.redraw=function(){cn();dZ.lineWidth=dN;var d2=cQ.pmouseX,d3=cQ.pmouseY;cQ.pmouseX=dE;cQ.pmouseY=dW;ax();cQ.draw();cJ();dE=cQ.mouseX;dW=cQ.mouseY;cQ.pmouseX=d2;cQ.pmouseY=d3};bt.prototype.redraw=function(){cn();var d2=cQ.pmouseX,d3=cQ.pmouseY;cQ.pmouseX=dE;cQ.pmouseY=dW;dZ.clear(dZ.DEPTH_BUFFER_BIT);du={attributes:{},locations:{}};cQ.noLights();cQ.lightFalloff(1,0,0);cQ.shininess(1);cQ.ambient(255,255,255);cQ.specular(0,0,0);cQ.emissive(0,0,0);cQ.camera();cQ.draw();dE=cQ.mouseX;dW=cQ.mouseY;cQ.pmouseX=d2;cQ.pmouseY=d3};cQ.noLoop=function(){aw=false;aq=false;clearInterval(bY);cK.onPause()};cQ.loop=function(){if(aq){return}dk=Date.now();I=0;bY=l.setInterval(function(){try{cK.onFrameStart();cQ.redraw();cK.onFrameEnd()}catch(d2){l.clearInterval(bY);throw d2}},at);aw=true;aq=true;cK.onLoop()};cQ.frameRate=function(d2){dL=d2;at=1000/dL;if(aw){cQ.noLoop();cQ.loop()}};var an=[];function bH(d4,d3,d2){if(d4.addEventListener){d4.addEventListener(d3,d2,false)}else{d4.attachEvent("on"+d3,d2)}an.push({elem:d4,type:d3,fn:d2})}function c8(d2){var d5=d2.elem,d4=d2.type,d3=d2.fn;if(d5.removeEventListener){d5.removeEventListener(d4,d3,false)}else{if(d5.detachEvent){d5.detachEvent("on"+d4,d3)}}}cQ.exit=function(){l.clearInterval(bY);D(cQ.externals.canvas.id);for(var d3 in B.lib){if(B.lib.hasOwnProperty(d3)){if(B.lib[d3].hasOwnProperty("detach")){B.lib[d3].detach(cQ)}}}var d2=an.length;while(d2--){c8(an[d2])}cK.onExit()};cQ.cursor=function(){if(arguments.length>1||arguments.length===1&&arguments[0] instanceof cQ.PImage){var d5=arguments[0],d2,d7;if(arguments.length>=3){d2=arguments[1];d7=arguments[2];if(d2<0||d7<0||d7>=d5.height||d2>=d5.width){throw"x and y must be non-negative and less than the dimensions of the image"}}else{d2=d5.width>>>1;d7=d5.height>>>1}var d3=d5.toDataURL();var d4='url("'+d3+'") '+d2+" "+d7+", default";S=X.style.cursor=d4}else{if(arguments.length===1){var d6=arguments[0];S=X.style.cursor=d6}else{S=X.style.cursor=ce}}};cQ.noCursor=function(){S=X.style.cursor=j.NOCURSOR};cQ.link=function(d2,d3){if(d3!==c){l.open(d2,d3)}else{l.location=d2}};cQ.beginDraw=h;cQ.endDraw=h;bJ.prototype.toImageData=function(d2,d5,d3,d4){d2=d2!==c?d2:0;d5=d5!==c?d5:0;d3=d3!==c?d3:cQ.width;d4=d4!==c?d4:cQ.height;return dZ.getImageData(d2,d5,d3,d4)};bt.prototype.toImageData=function(ea,d9,eb,d6){ea=ea!==c?ea:0;d9=d9!==c?d9:0;eb=eb!==c?eb:cQ.width;d6=d6!==c?d6:cQ.height;var d8=u.createElement("canvas"),ec=d8.getContext("2d"),d5=ec.createImageData(eb,d6),d3=new q(eb*d6*4);dZ.readPixels(ea,d9,eb,d6,dZ.RGBA,dZ.UNSIGNED_BYTE,d3);for(var d4=0,d7=d3.length,d2=d5.data;d4<d7;d4++){d2[d4]=d3[(d6-1-o.floor(d4/4/eb))*eb*4+d4%(eb*4)]}return d5};cQ.status=function(d2){l.status=d2};cQ.binary=function(d3,d4){var d5;if(d4>0){d5=d4}else{if(d3 instanceof bI){d5=16;d3|=0}else{d5=32;while(d5>1&&!(d3>>>d5-1&1)){d5--}}}var d2="";while(d5>0){d2+=d3>>>--d5&1?"1":"0"}return d2};cQ.unbinary=function(d3){var d5=d3.length-1,d4=1,d2=0;while(d5>=0){var d6=d3[d5--];if(d6!=="0"&&d6!=="1"){throw"the value passed into unbinary was not an 8 bit binary number"}if(d6==="1"){d2+=d4}d4<<=1}return d2};function cR(ee,ec,d6,eh,d8,ef){var d4=ee<0?d6:ec;var d3=d8===0;var ed=d8===c||d8<0?0:d8;var eb=o.abs(ee);if(d3){ed=1;eb*=10;while(o.abs(o.round(eb)-eb)>0.000001&&ed<7){++ed;eb*=10}}else{if(ed!==0){eb*=o.pow(10,ed)}}var d5,ea=eb*2;if(o.floor(eb)===eb){d5=eb}else{if(o.floor(ea)===ea){var d2=o.floor(eb);d5=d2+d2%2}else{d5=o.round(eb)}}var d7="";var eg=eh+ed;while(eg>0||d5>0){eg--;d7=""+d5%10+d7;d5=o.floor(d5/10)}if(ef!==c){var d9=d7.length-3-ed;while(d9>0){d7=d7.substring(0,d9)+ef+d7.substring(d9);d9-=3}}if(ed>0){return d4+d7.substring(0,d7.length-ed)+"."+d7.substring(d7.length-ed,d7.length)}return d4+d7}function ai(d8,d7,d2,ea,d3,d9){if(d8 instanceof Array){var d5=[];for(var d4=0,d6=d8.length;d4<d6;d4++){d5.push(cR(d8[d4],d7,d2,ea,d3,d9))}return d5}return cR(d8,d7,d2,ea,d3,d9)}cQ.nf=function(d4,d2,d3){return ai(d4,"","-",d2,d3)};cQ.nfs=function(d4,d2,d3){return ai(d4," ","-",d2,d3)};cQ.nfp=function(d4,d2,d3){return ai(d4,"+","-",d2,d3)};cQ.nfc=function(d4,d2,d3){return ai(d4,"","-",d2,d3,",")};var aF=function(d4,d3){d3=d3===c||d3===null?d3=8:d3;if(d4<0){d4=4294967295+d4+1}var d2=Number(d4).toString(16).toUpperCase();while(d2.length<d3){d2="0"+d2}if(d2.length>=d3){d2=d2.substring(d2.length-d3,d2.length)}return d2};cQ.hex=function(d3,d2){if(arguments.length===1){if(d3 instanceof bI){d2=4}else{d2=8}}return aF(d3,d2)};function dw(d2){var d3=parseInt("0x"+d2,16);if(d3>2147483647){d3-=4294967296}return d3}cQ.unhex=function(d4){if(d4 instanceof Array){var d2=[];for(var d3=0;d3<d4.length;d3++){d2.push(dw(d4[d3]))}return d2}return dw(d4)};cQ.loadStrings=function(d3){if(localStorage[d3]){return localStorage[d3].split("\n")}var d2=r(d3);if(typeof d2!=="string"||d2===""){return[]}d2=d2.replace(/(\r\n?)/g,"\n").replace(/\n$/,"");return d2.split("\n")};cQ.saveStrings=function(d3,d2){localStorage[d3]=d2.join("\n")};cQ.loadBytes=function(d4){var d3=r(d4);var d2=[];for(var d5=0;d5<d3.length;d5++){d2.push(d3.charCodeAt(d5))}return d2};function a3(d2){return Array.prototype.slice.call(d2,1)}cQ.matchAll=function(d3,d2){var d5=[],d4;var d6=new RegExp(d2,"g");while((d4=d6.exec(d3))!==null){d5.push(d4);if(d4[0].length===0){++d6.lastIndex}}return d5.length>0?d5:null};cQ.__contains=function(d3,d2){if(typeof d3!=="string"){return d3.contains.apply(d3,a3(arguments))}return d3!==null&&d2!==null&&typeof d2==="string"&&d3.indexOf(d2)>-1};cQ.__replaceAll=function(d2,d4,d3){if(typeof d2!=="string"){return d2.replaceAll.apply(d2,a3(arguments))}return d2.replace(new RegExp(d4,"g"),d3)};cQ.__replaceFirst=function(d2,d4,d3){if(typeof d2!=="string"){return d2.replaceFirst.apply(d2,a3(arguments))}return d2.replace(new RegExp(d4,""),d3)};cQ.__replace=function(d5,d7,d6){if(typeof d5!=="string"){return d5.replace.apply(d5,a3(arguments))}if(d7 instanceof RegExp){return d5.replace(d7,d6)}if(typeof d7!=="string"){d7=d7.toString()}if(d7===""){return d5}var d4=d5.indexOf(d7);if(d4<0){return d5}var d3=0,d2="";do{d2+=d5.substring(d3,d4)+d6;d3=d4+d7.length}while((d4=d5.indexOf(d7,d3))>=0);return d2+d5.substring(d3)};cQ.__equals=function(d3,d2){if(d3.equals instanceof Function){return d3.equals.apply(d3,a3(arguments))}return d3.valueOf()===d2.valueOf()};cQ.__equalsIgnoreCase=function(d3,d2){if(typeof d3!=="string"){return d3.equalsIgnoreCase.apply(d3,a3(arguments))}return d3.toLowerCase()===d2.toLowerCase()};cQ.__toCharArray=function(d4){if(typeof d4!=="string"){return d4.toCharArray.apply(d4,a3(arguments))}var d5=[];for(var d3=0,d2=d4.length;d3<d2;++d3){d5[d3]=new bI(d4.charAt(d3))}return d5};cQ.__split=function(d5,d6,d3){if(typeof d5!=="string"){return d5.split.apply(d5,a3(arguments))}var d8=new RegExp(d6);if(d3===c||d3<1){return d5.split(d8)}var d2=[],d7=d5,d9;while((d9=d7.search(d8))!==-1&&d2.length<d3-1){var d4=d8.exec(d7).toString();d2.push(d7.substring(0,d9));d7=d7.substring(d9+d4.length)}if(d9!==-1||d7!==""){d2.push(d7)}return d2};cQ.__codePointAt=function(d5,d3){var d6=d5.charCodeAt(d3),d4,d2;if(55296<=d6&&d6<=56319){d4=d6;d2=d5.charCodeAt(d3+1);return(d4-55296)*1024+(d2-56320)+65536}return d6};cQ.match=function(d3,d2){return d3.match(d2)};cQ.__startsWith=function(d2,d4,d3){if(typeof d2!=="string"){return d2.startsWith.apply(d2,a3(arguments))}d3=d3||0;if(d3<0||d3>d2.length){return false}return d4===""||d4===d2?true:d2.indexOf(d4)===d3};cQ.__endsWith=function(d3,d4){if(typeof d3!=="string"){return d3.endsWith.apply(d3,a3(arguments))}var d2=d4?d4.length:0;return d4===""||d4===d3?true:d3.indexOf(d4)===d3.length-d2};cQ.__hashCode=function(d2){if(d2.hashCode instanceof Function){return d2.hashCode.apply(d2,a3(arguments))}return a(d2)};cQ.__printStackTrace=function(d2){cQ.println("Exception: "+d2.toString())};var d1=[];cQ.println=function(d2){var d3=d1.length;if(d3){B.logger.log(d1.join(""));d1.length=0}if(arguments.length===0&&d3===0){B.logger.log("")}else{if(arguments.length!==0){B.logger.log(d2)}}};cQ.print=function(d2){d1.push(d2)};cQ.str=function(d4){if(d4 instanceof Array){var d2=[];for(var d3=0;d3<d4.length;d3++){d2.push(d4[d3].toString()+"")}return d2}return d4.toString()+""};cQ.trim=function(d4){if(d4 instanceof Array){var d2=[];for(var d3=0;d3<d4.length;d3++){d2.push(d4[d3].replace(/^\s*/,"").replace(/\s*$/,"").replace(/\r*$/,""))}return d2}return d4.replace(/^\s*/,"").replace(/\s*$/,"").replace(/\r*$/,"")};function aJ(d2){if(typeof d2==="number"){return d2!==0}if(typeof d2==="boolean"){return d2}if(typeof d2==="string"){return d2.toLowerCase()==="true"}if(d2 instanceof bI){return d2.code===49||d2.code===84||d2.code===116}}cQ.parseBoolean=function(d4){if(d4 instanceof Array){var d2=[];for(var d3=0;d3<d4.length;d3++){d2.push(aJ(d4[d3]))}return d2}return aJ(d4)};cQ.parseByte=function(d4){if(d4 instanceof Array){var d2=[];for(var d3=0;d3<d4.length;d3++){d2.push(0-(d4[d3]&128)|d4[d3]&127)}return d2}return 0-(d4&128)|d4&127};cQ.parseChar=function(d4){if(typeof d4==="number"){return new bI(String.fromCharCode(d4&65535))}if(d4 instanceof Array){var d2=[];for(var d3=0;d3<d4.length;d3++){d2.push(new bI(String.fromCharCode(d4[d3]&65535)))}return d2}throw"char() may receive only one argument of type int, byte, int[], or byte[]."};function cI(d2){if(typeof d2==="number"){return d2}if(typeof d2==="boolean"){return d2?1:0}if(typeof d2==="string"){return parseFloat(d2)}if(d2 instanceof bI){return d2.code}}cQ.parseFloat=function(d4){if(d4 instanceof Array){var d2=[];for(var d3=0;d3<d4.length;d3++){d2.push(cI(d4[d3]))}return d2}return cI(d4)};function af(d4,d2){if(typeof d4==="number"){return d4&4294967295}if(typeof d4==="boolean"){return d4?1:0}if(typeof d4==="string"){var d3=parseInt(d4,d2||10);return d3&4294967295}if(d4 instanceof bI){return d4.code}}cQ.parseInt=function(d5,d4){if(d5 instanceof Array){var d2=[];for(var d3=0;d3<d5.length;d3++){if(typeof d5[d3]==="string"&&!/^\s*[+\-]?\d+\s*$/.test(d5[d3])){d2.push(0)}else{d2.push(af(d5[d3],d4))}}return d2}return af(d5,d4)};cQ.__int_cast=function(d2){return 0|d2};cQ.__instanceof=function(d4,d3){if(typeof d3!=="function"){throw"Function is expected as type argument for instanceof operator"}if(typeof d4==="string"){return d3===Object||d3===String}if(d4 instanceof d3){return true}if(typeof d4!=="object"||d4===null){return false}var d6=d4.constructor;if(d3.$isInterface){var d5=[];while(d6){if(d6.$interfaces){d5=d5.concat(d6.$interfaces)}d6=d6.$base}while(d5.length>0){var d2=d5.shift();if(d2===d3){return true}if(d2.$interfaces){d5=d5.concat(d2.$interfaces)}}return false}while(d6.hasOwnProperty("$base")){d6=d6.$base;if(d6===d3){return true}}return false};cQ.abs=o.abs;cQ.ceil=o.ceil;cQ.constrain=function(d3,d4,d2){return d3>d2?d2:d3<d4?d4:d3};cQ.dist=function(){var d4,d3,d2;if(arguments.length===4){d4=arguments[0]-arguments[2];d3=arguments[1]-arguments[3];return o.sqrt(d4*d4+d3*d3)}if(arguments.length===6){d4=arguments[0]-arguments[3];d3=arguments[1]-arguments[4];d2=arguments[2]-arguments[5];return o.sqrt(d4*d4+d3*d3+d2*d2)}};cQ.exp=o.exp;cQ.floor=o.floor;cQ.lerp=function(d3,d2,d4){return(d2-d3)*d4+d3};cQ.log=o.log;cQ.mag=function(d3,d2,d4){if(d4){return o.sqrt(d3*d3+d2*d2+d4*d4)}return o.sqrt(d3*d3+d2*d2)};cQ.map=function(d5,d3,d4,d2,d6){return d2+(d6-d2)*((d5-d3)/(d4-d3))};cQ.max=function(){if(arguments.length===2){return arguments[0]<arguments[1]?arguments[1]:arguments[0]}var d3=arguments.length===1?arguments[0]:arguments;if(!("length" in d3&&d3.length>0)){throw"Non-empty array is expected"}var d2=d3[0],d5=d3.length;for(var d4=1;d4<d5;++d4){if(d2<d3[d4]){d2=d3[d4]}}return d2};cQ.min=function(){if(arguments.length===2){return arguments[0]<arguments[1]?arguments[0]:arguments[1]}var d2=arguments.length===1?arguments[0]:arguments;if(!("length" in d2&&d2.length>0)){throw"Non-empty array is expected"}var d4=d2[0],d5=d2.length;for(var d3=1;d3<d5;++d3){if(d4>d2[d3]){d4=d2[d3]}}return d4};cQ.norm=function(d3,d2,d4){return(d3-d2)/(d4-d2)};cQ.pow=o.pow;cQ.round=o.round;cQ.sq=function(d2){return d2*d2};cQ.sqrt=o.sqrt;cQ.acos=o.acos;cQ.asin=o.asin;cQ.atan=o.atan;cQ.atan2=o.atan2;cQ.cos=o.cos;cQ.degrees=function(d2){return d2*180/o.PI};cQ.radians=function(d2){return d2/180*o.PI};cQ.sin=o.sin;cQ.tan=o.tan;var bR=o.random;cQ.random=function(){if(arguments.length===0){return bR()}if(arguments.length===1){return bR()*arguments[0]}var d3=arguments[0],d2=arguments[1];return bR()*(d2-d3)+d3};function ci(d4,d3){var d6=d4||362436069,d2=d3||521288629;var d5=function(){d6=36969*(d6&65535)+(d6>>>16)&4294967295;d2=18000*(d2&65535)+(d2>>>16)&4294967295;return((d6&65535)<<16|d2&65535)&4294967295};this.nextDouble=function(){var d7=d5()/4294967296;return d7<0?1+d7:d7};this.nextInt=d5}ci.createRandomized=function(){var d2=new Date;return new ci(d2/60000&4294967295,d2&4294967295)};cQ.randomSeed=function(d2){bR=(new ci(d2)).nextDouble};cQ.Random=function(d2){var d5=false,d3,d4;this.nextGaussian=function(){if(d5){d5=false;return d3}var d9,d7,d6;do{d9=2*d4()-1;d7=2*d4()-1;d6=d9*d9+d7*d7}while(d6>=1||d6===0);var d8=o.sqrt(-2*o.log(d6)/d6);d3=d7*d8;d5=true;return d9*d8};d4=d2===c?o.random:(new ci(d2)).nextDouble};function dr(d9){var d3=d9!==c?new ci(d9):ci.createRandomized();var d8,d6;var d5=new q(512);for(d8=0;d8<256;++d8){d5[d8]=d8}for(d8=0;d8<256;++d8){var eb=d5[d6=d3.nextInt()&255];d5[d6]=d5[d8];d5[d8]=eb}for(d8=0;d8<256;++d8){d5[d8+256]=d5[d8]}function d2(ef,ec,ei,eh){var eg=ef&15;var ee=eg<8?ec:ei,ed=eg<4?ei:eg===12||eg===14?ec:eh;return((eg&1)===0?ee:-ee)+((eg&2)===0?ed:-ed)}function d7(ee,ec,ef){var ed=(ee&1)===0?ec:ef;return(ee&2)===0?-ed:ed}function ea(ed,ec){return(ed&1)===0?-ec:ec}function d4(ee,ed,ec){return ed+ee*(ec-ed)}this.noise3d=function(eo,en,em){var ef=o.floor(eo)&255,ed=o.floor(en)&255,ec=o.floor(em)&255;eo-=o.floor(eo);en-=o.floor(en);em-=o.floor(em);var ej=(3-2*eo)*eo*eo,ei=(3-2*en)*en*en,eh=(3-2*em)*em*em;var eq=d5[ef]+ed,el=d5[eq]+ec,ek=d5[eq+1]+ec,ep=d5[ef+1]+ed,eg=d5[ep]+ec,ee=d5[ep+1]+ec;return d4(eh,d4(ei,d4(ej,d2(d5[el],eo,en,em),d2(d5[eg],eo-1,en,em)),d4(ej,d2(d5[ek],eo,en-1,em),d2(d5[ee],eo-1,en-1,em))),d4(ei,d4(ej,d2(d5[el+1],eo,en,em-1),d2(d5[eg+1],eo-1,en,em-1)),d4(ej,d2(d5[ek+1],eo,en-1,em-1),d2(d5[ee+1],eo-1,en-1,em-1))))};this.noise2d=function(ec,ej){var ei=o.floor(ec)&255,eg=o.floor(ej)&255;ec-=o.floor(ec);ej-=o.floor(ej);var ee=(3-2*ec)*ec*ec,ed=(3-2*ej)*ej*ej;var eh=d5[ei]+eg,ef=d5[ei+1]+eg;return d4(ed,d4(ee,d7(d5[eh],ec,ej),d7(d5[ef],ec-1,ej)),d4(ee,d7(d5[eh+1],ec,ej-1),d7(d5[ef+1],ec-1,ej-1)))};this.noise1d=function(ec){var ee=o.floor(ec)&255;ec-=o.floor(ec);var ed=(3-2*ec)*ec*ec;return d4(ed,ea(d5[ee],ec),ea(d5[ee+1],ec-1))}}var bP={generator:c,octaves:4,fallout:0.5,seed:c};cQ.noise=function(d2,d9,d8){if(bP.generator===c){bP.generator=new dr(bP.seed)}var d7=bP.generator;var d6=1,d3=1,d5=0;for(var d4=0;d4<bP.octaves;++d4){d6*=bP.fallout;switch(arguments.length){case 1:d5+=d6*(1+d7.noise1d(d3*d2))/2;break;case 2:d5+=d6*(1+d7.noise2d(d3*d2,d3*d9))/2;break;case 3:d5+=d6*(1+d7.noise3d(d3*d2,d3*d9,d3*d8))/2;break}d3*=2}return d5};cQ.noiseDetail=function(d3,d2){bP.octaves=d3;if(d2!==c){bP.fallout=d2}};cQ.noiseSeed=function(d2){bP.seed=d2;bP.generator=c};dj.prototype.size=function(d3,d6,d5){if(b8){cQ.stroke(0)}if(aA){cQ.fill(255)}var d4={fillStyle:dZ.fillStyle,strokeStyle:dZ.strokeStyle,lineCap:dZ.lineCap,lineJoin:dZ.lineJoin};if(X.style.length>0){X.style.removeProperty("width");X.style.removeProperty("height")}X.width=cQ.width=d3||100;X.height=cQ.height=d6||100;for(var d7 in d4){if(d4.hasOwnProperty(d7)){dZ[d7]=d4[d7]}}cQ.textFont(P);cQ.background();bT=o.max(1000,d3*d6*0.05);cQ.externals.context=dZ;for(var d2=0;d2<720;d2++){ab[d2]=cQ.sin(d2*(o.PI/180)*0.5);bd[d2]=cQ.cos(d2*(o.PI/180)*0.5)}};bJ.prototype.size=function(d2,d4,d3){if(dZ===c){dZ=X.getContext("2d");ag=new O;c4=new O;dA=new aO;aL=new aO}dj.prototype.size.apply(this,arguments)};bt.prototype.size=function(){var d3=false;return function d2(d5,d7,d6){if(d3){throw"Multiple calls to size() for 3D renders are not allowed."}d3=true;function d8(ea){var ed=["experimental-webgl","webgl","webkit-3d"],ec;for(var eb=0,d9=ed.length;eb<d9;eb++){ec=ea.getContext(ed[eb],{antialias:false});if(ec){break}}return ec}try{X.width=cQ.width=d5||100;X.height=cQ.height=d7||100;dZ=d8(X);c1=dZ.createTexture();bK=dZ.createTexture()}catch(d4){B.debug(d4)}if(!dZ){throw"WebGL context is not supported on this browser."}dZ.viewport(0,0,X.width,X.height);dZ.enable(dZ.DEPTH_TEST);dZ.enable(dZ.BLEND);dZ.blendFunc(dZ.SRC_ALPHA,dZ.ONE_MINUS_SRC_ALPHA);dH=bx(dZ,Y,bS);bL=bx(dZ,bN,ba);cQ.strokeWeight(1);dp=bx(dZ,d0,bC);dZ.useProgram(dp);dQ("usingTexture3d",dp,"usingTexture",dK);cQ.lightFalloff(1,0,0);cQ.shininess(1);cQ.ambient(255,255,255);cQ.specular(0,0,0);cQ.emissive(0,0,0);a8=dZ.createBuffer();dZ.bindBuffer(dZ.ARRAY_BUFFER,a8);dZ.bufferData(dZ.ARRAY_BUFFER,da,dZ.STATIC_DRAW);cD=dZ.createBuffer();dZ.bindBuffer(dZ.ARRAY_BUFFER,cD);dZ.bufferData(dZ.ARRAY_BUFFER,c9,dZ.STATIC_DRAW);dd=dZ.createBuffer();dZ.bindBuffer(dZ.ARRAY_BUFFER,dd);dZ.bufferData(dZ.ARRAY_BUFFER,bz,dZ.STATIC_DRAW);av=dZ.createBuffer();dZ.bindBuffer(dZ.ARRAY_BUFFER,av);dZ.bufferData(dZ.ARRAY_BUFFER,ae,dZ.STATIC_DRAW);bW=dZ.createBuffer();dZ.bindBuffer(dZ.ARRAY_BUFFER,bW);dZ.bufferData(dZ.ARRAY_BUFFER,ac,dZ.STATIC_DRAW);a7=dZ.createBuffer();b2=dZ.createBuffer();am=dZ.createBuffer();az=dZ.createBuffer();bu=dZ.createBuffer();Z=dZ.createBuffer();ap=dZ.createBuffer();dZ.bindBuffer(dZ.ARRAY_BUFFER,ap);dZ.bufferData(dZ.ARRAY_BUFFER,new d([0,0,0]),dZ.STATIC_DRAW);cB=dZ.createBuffer();dZ.bindBuffer(dZ.ARRAY_BUFFER,cB);dZ.bufferData(dZ.ARRAY_BUFFER,new d([1,1,0,-1,1,0,-1,-1,0,1,-1,0]),dZ.STATIC_DRAW);V=dZ.createBuffer();dZ.bindBuffer(dZ.ARRAY_BUFFER,V);dZ.bufferData(dZ.ARRAY_BUFFER,new d([0,0,1,0,1,1,0,1]),dZ.STATIC_DRAW);K=dZ.createBuffer();dZ.bindBuffer(dZ.ELEMENT_ARRAY_BUFFER,K);dZ.bufferData(dZ.ELEMENT_ARRAY_BUFFER,new w([0,1,2,2,3,0]),dZ.STATIC_DRAW);bO=new aH;cb=new aH;dA=new aH;aL=new aH;c5=new aH;cQ.camera();cQ.perspective();ag=new O;c4=new O;cX=new aH;aI=new aH;aE=new aH;br=new aH;b7=new aH;N=new aH;N.set(-1,3,-3,1,3,-6,3,0,-3,3,0,0,1,0,0,0);dj.prototype.size.apply(this,arguments)}}();bJ.prototype.ambientLight=dj.prototype.a3DOnlyFunction;bt.prototype.ambientLight=function(d2,d5,ea,eb,d7,d6){if(dC===8){throw"can only create "+8+" lights"}var d8=new k(eb,d7,d6);var d9=new aH;d9.scale(1,-1,1);d9.apply(dA.array());d9.mult(d8,d8);var d3=dy(d2,d5,ea,0);var d4=[(d3>>16&255)/255,(d3>>8&255)/255,(d3&255)/255];dZ.useProgram(dp);dT("lights.color.3d."+dC,dp,"lights"+dC+".color",d4);dT("lights.position.3d."+dC,dp,"lights"+dC+".position",d8.array());dQ("lights.type.3d."+dC,dp,"lights"+dC+".type",0);dQ("lightCount3d",dp,"lightCount",++dC)};bJ.prototype.directionalLight=dj.prototype.a3DOnlyFunction;bt.prototype.directionalLight=function(d2,d8,ea,d9,d7,d6){if(dC===8){throw"can only create "+8+" lights"}dZ.useProgram(dp);var eb=new aH;eb.scale(1,-1,1);eb.apply(dA.array());eb=eb.array();var d4=[eb[0]*d9+eb[4]*d7+eb[8]*d6,eb[1]*d9+eb[5]*d7+eb[9]*d6,eb[2]*d9+eb[6]*d7+eb[10]*d6];var d3=dy(d2,d8,ea,0);var d5=[(d3>>16&255)/255,(d3>>8&255)/255,(d3&255)/255];dT("lights.color.3d."+dC,dp,"lights"+dC+".color",d5);dT("lights.position.3d."+dC,dp,"lights"+dC+".position",d4);dQ("lights.type.3d."+dC,dp,"lights"+dC+".type",1);dQ("lightCount3d",dp,"lightCount",++dC)};bJ.prototype.lightFalloff=dj.prototype.a3DOnlyFunction;bt.prototype.lightFalloff=function(d3,d2,d4){dZ.useProgram(dp);dT("falloff3d",dp,"falloff",[d3,d2,d4])};bJ.prototype.lightSpecular=dj.prototype.a3DOnlyFunction;bt.prototype.lightSpecular=function(d6,d5,d2){var d3=dy(d6,d5,d2,0);var d4=[(d3>>16&255)/255,(d3>>8&255)/255,(d3&255)/255];dZ.useProgram(dp);dT("specular3d",dp,"specular",d4)};cQ.lights=function(){cQ.ambientLight(128,128,128);cQ.directionalLight(128,128,128,0,0,-1);cQ.lightFalloff(1,0,0);cQ.lightSpecular(0,0,0)};bJ.prototype.pointLight=dj.prototype.a3DOnlyFunction;bt.prototype.pointLight=function(d2,d5,ea,eb,d7,d6){if(dC===8){throw"can only create "+8+" lights"}var d8=new k(eb,d7,d6);var d9=new aH;d9.scale(1,-1,1);d9.apply(dA.array());d9.mult(d8,d8);var d3=dy(d2,d5,ea,0);var d4=[(d3>>16&255)/255,(d3>>8&255)/255,(d3&255)/255];dZ.useProgram(dp);dT("lights.color.3d."+dC,dp,"lights"+dC+".color",d4);dT("lights.position.3d."+dC,dp,"lights"+dC+".position",d8.array());dQ("lights.type.3d."+dC,dp,"lights"+dC+".type",2);dQ("lightCount3d",dp,"lightCount",++dC)};bJ.prototype.noLights=dj.prototype.a3DOnlyFunction;bt.prototype.noLights=function(){dC=0;dZ.useProgram(dp);dQ("lightCount3d",dp,"lightCount",dC)};bJ.prototype.spotLight=dj.prototype.a3DOnlyFunction;bt.prototype.spotLight=function(d2,ea,ef,eg,ee,ec,eb,d9,d7,d6,d8){if(dC===8){throw"can only create "+8+" lights"}dZ.useProgram(dp);var ed=new k(eg,ee,ec);var eh=new aH;eh.scale(1,-1,1);eh.apply(dA.array());eh.mult(ed,ed);eh=eh.array();var d4=[eh[0]*eb+eh[4]*d9+eh[8]*d7,eh[1]*eb+eh[5]*d9+eh[9]*d7,eh[2]*eb+eh[6]*d9+eh[10]*d7];var d3=dy(d2,ea,ef,0);var d5=[(d3>>16&255)/255,(d3>>8&255)/255,(d3&255)/255];dT("lights.color.3d."+dC,dp,"lights"+dC+".color",d5);dT("lights.position.3d."+dC,dp,"lights"+dC+".position",ed.array());dT("lights.direction.3d."+dC,dp,"lights"+dC+".direction",d4);dT("lights.concentration.3d."+dC,dp,"lights"+dC+".concentration",d8);dT("lights.angle.3d."+dC,dp,"lights"+dC+".angle",d6);dQ("lights.type.3d."+dC,dp,"lights"+dC+".type",3);dQ("lightCount3d",dp,"lightCount",++dC)};bJ.prototype.beginCamera=function(){throw"beginCamera() is not available in 2D mode"};bt.prototype.beginCamera=function(){if(aj){throw"You cannot call beginCamera() again before calling endCamera()"}aj=true;dA=cb;aL=bO};bJ.prototype.endCamera=function(){throw"endCamera() is not available in 2D mode"};bt.prototype.endCamera=function(){if(!aj){throw"You cannot call endCamera() before calling beginCamera()"}dA.set(bO);aL.set(cb);aj=false};cQ.camera=function(ed,ec,ea,d8,d6,d5,el,ej,eh){if(ed===c){de=cQ.width/2;dc=cQ.height/2;db=dc/o.tan(cE/2);ed=de;ec=dc;ea=db;d8=de;d6=dc;d5=0;el=0;ej=1;eh=0}var d7=new k(ed-d8,ec-d6,ea-d5);var d9=new k(el,ej,eh);d7.normalize();var eb=k.cross(d9,d7);d9=k.cross(d7,eb);eb.normalize();d9.normalize();var em=eb.x,ek=eb.y,ei=eb.z;var d4=d9.x,d3=d9.y,d2=d9.z;var eg=d7.x,ef=d7.y,ee=d7.z;bO.set(em,ek,ei,0,d4,d3,d2,0,eg,ef,ee,0,0,0,0,1);bO.translate(-ed,-ec,-ea);cb.reset();cb.invApply(em,ek,ei,0,d4,d3,d2,0,eg,ef,ee,0,0,0,0,1);cb.translate(ed,ec,ea);dA.set(bO);aL.set(cb)};cQ.perspective=function(d6,d4,d7,d3){if(arguments.length===0){dc=X.height/2;db=dc/o.tan(cE/2);aR=db/10;ao=db*10;bZ=cQ.width/cQ.height;d6=cE;d4=bZ;d7=aR;d3=ao}var d8,d2,d9,d5;d8=d7*o.tan(d6/2);d2=-d8;d9=d8*d4;d5=d2*d4;cQ.frustum(d5,d9,d2,d8,d7,d3)};bJ.prototype.frustum=function(){throw"Processing.js: frustum() is not supported in 2D mode"};bt.prototype.frustum=function(d8,d4,d3,d7,d6,d2){cc=true;c5=new aH;c5.set(2*d6/(d4-d8),0,(d4+d8)/(d4-d8),0,0,2*d6/(d7-d3),(d7+d3)/(d7-d3),0,0,0,-(d2+d6)/(d2-d6),-(2*d2*d6)/(d2-d6),0,0,-1,0);var d5=new aH;d5.set(c5);d5.transpose();dZ.useProgram(dH);a0("projection2d",dH,"projection",false,d5.array());dZ.useProgram(dp);a0("projection3d",dp,"projection",false,d5.array());dZ.useProgram(bL);a0("uProjectionUS",bL,"uProjection",false,d5.array())};cQ.ortho=function(d3,ee,d2,ec,d9,d8){if(arguments.length===0){d3=0;ee=cQ.width;d2=0;ec=cQ.height;d9=-10;d8=10}var ed=2/(ee-d3);var eb=2/(ec-d2);var ea=-2/(d8-d9);var d7=-(ee+d3)/(ee-d3);var d6=-(ec+d2)/(ec-d2);var d5=-(d8+d9)/(d8-d9);c5=new aH;c5.set(ed,0,0,d7,0,eb,0,d6,0,0,ea,d5,0,0,0,1);var d4=new aH;d4.set(c5);d4.transpose();dZ.useProgram(dH);a0("projection2d",dH,"projection",false,d4.array());dZ.useProgram(dp);a0("projection3d",dp,"projection",false,d4.array());dZ.useProgram(bL);a0("uProjectionUS",bL,"uProjection",false,d4.array());cc=false};cQ.printProjection=function(){c5.print()};cQ.printCamera=function(){bO.print()};bJ.prototype.box=dj.prototype.a3DOnlyFunction;bt.prototype.box=function(d4,d7,d9){if(!d7||!d9){d7=d9=d4}var d6=new aH;d6.scale(d4,d7,d9);var d3=new aH;d3.scale(1,-1,1);d3.apply(dA.array());d3.transpose();if(aA){dZ.useProgram(dp);a0("model3d",dp,"model",false,d6.array());a0("view3d",dp,"view",false,d3.array());dZ.enable(dZ.POLYGON_OFFSET_FILL);dZ.polygonOffset(1,1);dT("color3d",dp,"color",bg);if(dC>0){var d5=new aH;d5.set(d3);var d2=new aH;d2.set(d6);d5.mult(d2);var d8=new aH;d8.set(d5);d8.invert();d8.transpose();a0("normalTransform3d",dp,"normalTransform",false,d8.array());c6("normal3d",dp,"Normal",3,cD)}else{ca("normal3d",dp,"Normal")}c6("vertex3d",dp,"Vertex",3,a8);ca("aColor3d",dp,"aColor");ca("aTexture3d",dp,"aTexture");dZ.drawArrays(dZ.TRIANGLES,0,da.length/3);dZ.disable(dZ.POLYGON_OFFSET_FILL)}if(dN>0&&b8){dZ.useProgram(dH);a0("model2d",dH,"model",false,d6.array());a0("view2d",dH,"view",false,d3.array());dT("color2d",dH,"color",cU);dQ("picktype2d",dH,"picktype",0);c6("vertex2d",dH,"Vertex",3,dd);ca("aTextureCoord2d",dH,"aTextureCoord");dZ.drawArrays(dZ.LINES,0,bz.length/3)}};var cx=function(){var d3;cz=[];for(d3=0;d3<bF;d3++){cz.push(0);cz.push(-1);cz.push(0);cz.push(bl[d3]);cz.push(bk[d3]);cz.push(bj[d3])}cz.push(0);cz.push(-1);cz.push(0);cz.push(bl[0]);cz.push(bk[0]);cz.push(bj[0]);var d7,d4,d6;var d5=0;for(d3=2;d3<bE;d3++){d7=d4=d5;d5+=bF;d6=d5;for(var d2=0;d2<bF;d2++){cz.push(bl[d7]);cz.push(bk[d7]);cz.push(bj[d7++]);cz.push(bl[d6]);cz.push(bk[d6]);cz.push(bj[d6++])}d7=d4;d6=d5;cz.push(bl[d7]);cz.push(bk[d7]);cz.push(bj[d7]);cz.push(bl[d6]);cz.push(bk[d6]);cz.push(bj[d6])}for(d3=0;d3<bF;d3++){d6=d5+d3;cz.push(bl[d6]);cz.push(bk[d6]);cz.push(bj[d6]);cz.push(0);cz.push(1);cz.push(0)}cz.push(bl[d5]);cz.push(bk[d5]);cz.push(bj[d5]);cz.push(0);cz.push(1);cz.push(0);dZ.bindBuffer(dZ.ARRAY_BUFFER,a7);dZ.bufferData(dZ.ARRAY_BUFFER,new d(cz),dZ.STATIC_DRAW)};cQ.sphereDetail=function(d3,ee){var d9;if(arguments.length===1){d3=ee=arguments[0]}if(d3<3){d3=3}if(ee<2){ee=2}if(d3===bF&&ee===bE){return}var ed=720/d3;var d7=new d(d3);var d4=new d(d3);for(d9=0;d9<d3;d9++){d7[d9]=bd[d9*ed%720|0];d4[d9]=ab[d9*ed%720|0]}var ec=d3*(ee-1)+2;var eb=0;bl=new d(ec);bk=new d(ec);bj=new d(ec);var ea=720*0.5/ee;var d6=ea;for(d9=1;d9<ee;d9++){var d5=ab[d6%720|0];var d2=-bd[d6%720|0];for(var d8=0;d8<d3;d8++){bl[eb]=d7[d8]*d5;bk[eb]=d2;bj[eb++]=d4[d8]*d5}d6+=ea}bF=d3;bE=ee;cx()};bJ.prototype.sphere=dj.prototype.a3DOnlyFunction;bt.prototype.sphere=function(){var d6=arguments[0];if(bF<3||bE<2){cQ.sphereDetail(30)}var d5=new aH;d5.scale(d6,d6,d6);var d3=new aH;d3.scale(1,-1,1);d3.apply(dA.array());d3.transpose();if(aA){if(dC>0){var d4=new aH;d4.set(d3);var d2=new aH;d2.set(d5);d4.mult(d2);var d7=new aH;d7.set(d4);d7.invert();d7.transpose();a0("normalTransform3d",dp,"normalTransform",false,d7.array());c6("normal3d",dp,"Normal",3,a7)}else{ca("normal3d",dp,"Normal")}dZ.useProgram(dp);ca("aTexture3d",dp,"aTexture");a0("model3d",dp,"model",false,d5.array());a0("view3d",dp,"view",false,d3.array());c6("vertex3d",dp,"Vertex",3,a7);ca("aColor3d",dp,"aColor");dZ.enable(dZ.POLYGON_OFFSET_FILL);dZ.polygonOffset(1,1);dT("color3d",dp,"color",bg);dZ.drawArrays(dZ.TRIANGLE_STRIP,0,cz.length/3);dZ.disable(dZ.POLYGON_OFFSET_FILL)}if(dN>0&&b8){dZ.useProgram(dH);a0("model2d",dH,"model",false,d5.array());a0("view2d",dH,"view",false,d3.array());c6("vertex2d",dH,"Vertex",3,a7);ca("aTextureCoord2d",dH,"aTextureCoord");dT("color2d",dH,"color",cU);dQ("picktype2d",dH,"picktype",0);dZ.drawArrays(dZ.LINE_STRIP,0,cz.length/3)}};cQ.modelX=function(d8,d7,d6){var ea=dA.array();var ec=cb.array();var d2=ea[0]*d8+ea[1]*d7+ea[2]*d6+ea[3];var eb=ea[4]*d8+ea[5]*d7+ea[6]*d6+ea[7];var d9=ea[8]*d8+ea[9]*d7+ea[10]*d6+ea[11];var d3=ea[12]*d8+ea[13]*d7+ea[14]*d6+ea[15];var d4=ec[0]*d2+ec[1]*eb+ec[2]*d9+ec[3]*d3;var d5=ec[12]*d2+ec[13]*eb+ec[14]*d9+ec[15]*d3;return d5!==0?d4/d5:d4};cQ.modelY=function(d8,d7,d6){var ea=dA.array();var ec=cb.array();var d2=ea[0]*d8+ea[1]*d7+ea[2]*d6+ea[3];var eb=ea[4]*d8+ea[5]*d7+ea[6]*d6+ea[7];var d9=ea[8]*d8+ea[9]*d7+ea[10]*d6+ea[11];var d3=ea[12]*d8+ea[13]*d7+ea[14]*d6+ea[15];var d4=ec[4]*d2+ec[5]*eb+ec[6]*d9+ec[7]*d3;var d5=ec[12]*d2+ec[13]*eb+ec[14]*d9+ec[15]*d3;return d5!==0?d4/d5:d4};cQ.modelZ=function(d8,d7,d6){var ea=dA.array();var ec=cb.array();var d2=ea[0]*d8+ea[1]*d7+ea[2]*d6+ea[3];var eb=ea[4]*d8+ea[5]*d7+ea[6]*d6+ea[7];var d9=ea[8]*d8+ea[9]*d7+ea[10]*d6+ea[11];var d4=ea[12]*d8+ea[13]*d7+ea[14]*d6+ea[15];var d3=ec[8]*d2+ec[9]*eb+ec[10]*d9+ec[11]*d4;var d5=ec[12]*d2+ec[13]*eb+ec[14]*d9+ec[15]*d4;return d5!==0?d3/d5:d3};bJ.prototype.ambient=dj.prototype.a3DOnlyFunction;bt.prototype.ambient=function(d5,d4,d3){dZ.useProgram(dp);dQ("usingMat3d",dp,"usingMat",true);var d2=cQ.color(d5,d4,d3);dT("mat_ambient3d",dp,"mat_ambient",cQ.color.toGLArray(d2).slice(0,3))};bJ.prototype.emissive=dj.prototype.a3DOnlyFunction;bt.prototype.emissive=function(d5,d4,d3){dZ.useProgram(dp);dQ("usingMat3d",dp,"usingMat",true);var d2=cQ.color(d5,d4,d3);dT("mat_emissive3d",dp,"mat_emissive",cQ.color.toGLArray(d2).slice(0,3))};bJ.prototype.shininess=dj.prototype.a3DOnlyFunction;bt.prototype.shininess=function(d2){dZ.useProgram(dp);dQ("usingMat3d",dp,"usingMat",true);dT("shininess3d",dp,"shininess",d2)};bJ.prototype.specular=dj.prototype.a3DOnlyFunction;bt.prototype.specular=function(d5,d4,d3){dZ.useProgram(dp);dQ("usingMat3d",dp,"usingMat",true);var d2=cQ.color(d5,d4,d3);dT("mat_specular3d",dp,"mat_specular",cQ.color.toGLArray(d2).slice(0,3))};cQ.screenX=function(d9,d8,d7){var eb=dA.array();if(eb.length===16){var d2=eb[0]*d9+eb[1]*d8+eb[2]*d7+eb[3];var ec=eb[4]*d9+eb[5]*d8+eb[6]*d7+eb[7];var ea=eb[8]*d9+eb[9]*d8+eb[10]*d7+eb[11];var d3=eb[12]*d9+eb[13]*d8+eb[14]*d7+eb[15];var d6=c5.array();var d4=d6[0]*d2+d6[1]*ec+d6[2]*ea+d6[3]*d3;var d5=d6[12]*d2+d6[13]*ec+d6[14]*ea+d6[15]*d3;if(d5!==0){d4/=d5}return cQ.width*(1+d4)/2}return dA.multX(d9,d8)};cQ.screenY=function au(d9,d8,d7){var eb=dA.array();if(eb.length===16){var d2=eb[0]*d9+eb[1]*d8+eb[2]*d7+eb[3];var ec=eb[4]*d9+eb[5]*d8+eb[6]*d7+eb[7];var ea=eb[8]*d9+eb[9]*d8+eb[10]*d7+eb[11];var d3=eb[12]*d9+eb[13]*d8+eb[14]*d7+eb[15];var d6=c5.array();var d4=d6[4]*d2+d6[5]*ec+d6[6]*ea+d6[7]*d3;var d5=d6[12]*d2+d6[13]*ec+d6[14]*ea+d6[15]*d3;if(d5!==0){d4/=d5}return cQ.height*(1+d4)/2}return dA.multY(d9,d8)};cQ.screenZ=function ar(d9,d8,d7){var eb=dA.array();if(eb.length!==16){return 0}var d6=c5.array();var d2=eb[0]*d9+eb[1]*d8+eb[2]*d7+eb[3];var ec=eb[4]*d9+eb[5]*d8+eb[6]*d7+eb[7];var ea=eb[8]*d9+eb[9]*d8+eb[10]*d7+eb[11];var d4=eb[12]*d9+eb[13]*d8+eb[14]*d7+eb[15];var d3=d6[8]*d2+d6[9]*ec+d6[10]*ea+d6[11]*d4;var d5=d6[12]*d2+d6[13]*ec+d6[14]*ea+d6[15]*d4;if(d5!==0){d3/=d5}return(d3+1)/2};dj.prototype.fill=function(){var d2=cQ.color(arguments[0],arguments[1],arguments[2],arguments[3]);if(d2===aS&&aA){return}aA=true;aS=d2};bJ.prototype.fill=function(){dj.prototype.fill.apply(this,arguments);ak=true};bt.prototype.fill=function(){dj.prototype.fill.apply(this,arguments);bg=cQ.color.toGLArray(aS)};function bf(){if(aA){if(ak){dZ.fillStyle=cQ.color.toString(aS);ak=false}dZ.fill()}}cQ.noFill=function(){aA=false};dj.prototype.stroke=function(){var d2=cQ.color(arguments[0],arguments[1],arguments[2],arguments[3]);if(d2===cp&&b8){return}b8=true;cp=d2};bJ.prototype.stroke=function(){dj.prototype.stroke.apply(this,arguments);bX=true};bt.prototype.stroke=function(){dj.prototype.stroke.apply(this,arguments);cU=cQ.color.toGLArray(cp)};function c7(){if(b8){if(bX){dZ.strokeStyle=cQ.color.toString(cp);bX=false}dZ.stroke()}}cQ.noStroke=function(){b8=false};dj.prototype.strokeWeight=function(d2){dN=d2};bJ.prototype.strokeWeight=function(d2){dj.prototype.strokeWeight.apply(this,arguments);dZ.lineWidth=d2};bt.prototype.strokeWeight=function(d2){dj.prototype.strokeWeight.apply(this,arguments);dZ.useProgram(dH);dT("pointSize2d",dH,"pointSize",d2);dZ.useProgram(bL);dT("pointSizeUnlitShape",bL,"pointSize",d2);dZ.lineWidth(d2)};cQ.strokeCap=function(d2){dP.$ensureContext().lineCap=d2};cQ.strokeJoin=function(d2){dP.$ensureContext().lineJoin=d2};bJ.prototype.smooth=function(){dF=true;var d2=X.style;d2.setProperty("image-rendering","optimizeQuality","important");d2.setProperty("-ms-interpolation-mode","bicubic","important");if(dZ.hasOwnProperty("mozImageSmoothingEnabled")){dZ.mozImageSmoothingEnabled=true}};bt.prototype.smooth=h;bJ.prototype.noSmooth=function(){dF=false;var d2=X.style;d2.setProperty("image-rendering","optimizeSpeed","important");d2.setProperty("image-rendering","-moz-crisp-edges","important");d2.setProperty("image-rendering","-webkit-optimize-contrast","important");d2.setProperty("image-rendering","optimize-contrast","important");d2.setProperty("-ms-interpolation-mode","nearest-neighbor","important");if(dZ.hasOwnProperty("mozImageSmoothingEnabled")){dZ.mozImageSmoothingEnabled=false}};bt.prototype.noSmooth=h;bJ.prototype.point=function(d2,d3){if(!b8){return}d2=o.round(d2);d3=o.round(d3);dZ.fillStyle=cQ.color.toString(cp);ak=true;if(dN>1){dZ.beginPath();dZ.arc(d2,d3,dN/2,0,6.283185307179586,false);dZ.fill()}else{dZ.fillRect(d2,d3,1,1)}};bt.prototype.point=function(d2,d6,d5){var d4=new aH;d4.translate(d2,d6,d5||0);d4.transpose();var d3=new aH;d3.scale(1,-1,1);d3.apply(dA.array());d3.transpose();dZ.useProgram(dH);a0("model2d",dH,"model",false,d4.array());a0("view2d",dH,"view",false,d3.array());if(dN>0&&b8){dT("color2d",dH,"color",cU);dQ("picktype2d",dH,"picktype",0);c6("vertex2d",dH,"Vertex",3,ap);ca("aTextureCoord2d",dH,"aTextureCoord");dZ.drawArrays(dZ.POINTS,0,1)}};cQ.beginShape=function(d2){dI=d2;dX=[];a2=[]};bJ.prototype.vertex=function(d2,d6,d5,d4){var d3=[];if(dl){dl=false}d3.isVert=true;d3[0]=d2;d3[1]=d6;d3[2]=0;d3[3]=d5;d3[4]=d4;d3[5]=aS;d3[6]=cp;a2.push(d3)};bt.prototype.vertex=function(d2,d7,d6,d5,d4){var d3=[];if(dl){dl=false}d3.isVert=true;if(d4===c&&dK){d4=d5;d5=d6;d6=0}if(d5!==c&&d4!==c){if(dV===2){d5/=cm.width;d4/=cm.height}d5=d5>1?1:d5;d5=d5<0?0:d5;d4=d4>1?1:d4;d4=d4<0?0:d4}d3[0]=d2;d3[1]=d7;d3[2]=d6||0;d3[3]=d5||0;d3[4]=d4||0;d3[5]=bg[0];d3[6]=bg[1];d3[7]=bg[2];d3[8]=bg[3];d3[9]=cU[0];d3[10]=cU[1];d3[11]=cU[2];d3[12]=cU[3];d3[13]=aZ;d3[14]=aY;d3[15]=aX;a2.push(d3)};var dS=function(d4,d3){var d2=new aH;d2.scale(1,-1,1);d2.apply(dA.array());d2.transpose();dZ.useProgram(bL);a0("uViewUS",bL,"uView",false,d2.array());c6("aVertexUS",bL,"aVertex",3,ap);dZ.bufferData(dZ.ARRAY_BUFFER,new d(d4),dZ.STREAM_DRAW);c6("aColorUS",bL,"aColor",4,az);dZ.bufferData(dZ.ARRAY_BUFFER,new d(d3),dZ.STREAM_DRAW);dZ.drawArrays(dZ.POINTS,0,d4.length/3)};var bb=function(d6,d5,d4){var d3;if(d5==="LINES"){d3=dZ.LINES}else{if(d5==="LINE_LOOP"){d3=dZ.LINE_LOOP}else{d3=dZ.LINE_STRIP}}var d2=new aH;d2.scale(1,-1,1);d2.apply(dA.array());d2.transpose();dZ.useProgram(bL);a0("uViewUS",bL,"uView",false,d2.array());c6("aVertexUS",bL,"aVertex",3,b2);dZ.bufferData(dZ.ARRAY_BUFFER,new d(d6),dZ.STREAM_DRAW);c6("aColorUS",bL,"aColor",4,bu);dZ.bufferData(dZ.ARRAY_BUFFER,new d(d4),dZ.STREAM_DRAW);dZ.drawArrays(d3,0,d6.length/3)};var df=function(d7,d6,d5,d4){var d3;if(d6==="TRIANGLES"){d3=dZ.TRIANGLES}else{if(d6==="TRIANGLE_FAN"){d3=dZ.TRIANGLE_FAN}else{d3=dZ.TRIANGLE_STRIP}}var d2=new aH;d2.scale(1,-1,1);d2.apply(dA.array());d2.transpose();dZ.useProgram(dp);a0("model3d",dp,"model",false,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);a0("view3d",dp,"view",false,d2.array());dZ.enable(dZ.POLYGON_OFFSET_FILL);dZ.polygonOffset(1,1);dT("color3d",dp,"color",[-1,0,0,0]);c6("vertex3d",dp,"Vertex",3,am);dZ.bufferData(dZ.ARRAY_BUFFER,new d(d7),dZ.STREAM_DRAW);if(dK&&a6!==null){bo(d5)}c6("aColor3d",dp,"aColor",4,az);dZ.bufferData(dZ.ARRAY_BUFFER,new d(d5),dZ.STREAM_DRAW);ca("normal3d",dp,"Normal");if(dK){dQ("usingTexture3d",dp,"usingTexture",dK);c6("aTexture3d",dp,"aTexture",2,Z);dZ.bufferData(dZ.ARRAY_BUFFER,new d(d4),dZ.STREAM_DRAW)}dZ.drawArrays(d3,0,d7.length/3);dZ.disable(dZ.POLYGON_OFFSET_FILL)};function cM(){bf();c7();dZ.closePath()}bJ.prototype.endShape=function(d9){if(a2.length===0){return}var d5=d9===2;if(d5){a2.push(a2[0])}var d4=[];var d2=[];var eb=[];var ee=[];var d7=[];var ea;dl=true;var d8,d6,d3;var ed=a2.length;for(d8=0;d8<ed;d8++){ea=a2[d8];for(d6=0;d6<3;d6++){d2.push(ea[d6])}}for(d8=0;d8<ed;d8++){ea=a2[d8];for(d6=5;d6<9;d6++){eb.push(ea[d6])}}for(d8=0;d8<ed;d8++){ea=a2[d8];for(d6=9;d6<13;d6++){ee.push(ea[d6])}}for(d8=0;d8<ed;d8++){ea=a2[d8];d7.push(ea[3]);d7.push(ea[4])}if(dG&&(dI===20||dI===c)){if(ed>3){var ec=[],ef=1-aC;dZ.beginPath();dZ.moveTo(a2[1][0],a2[1][1]);for(d8=1;d8+2<ed;d8++){ea=a2[d8];ec[0]=[ea[0],ea[1]];ec[1]=[ea[0]+(ef*a2[d8+1][0]-ef*a2[d8-1][0])/6,ea[1]+(ef*a2[d8+1][1]-ef*a2[d8-1][1])/6];ec[2]=[a2[d8+1][0]+(ef*a2[d8][0]-ef*a2[d8+2][0])/6,a2[d8+1][1]+(ef*a2[d8][1]-ef*a2[d8+2][1])/6];ec[3]=[a2[d8+1][0],a2[d8+1][1]];dZ.bezierCurveTo(ec[1][0],ec[1][1],ec[2][0],ec[2][1],ec[3][0],ec[3][1])}cM()}}else{if(T&&(dI===20||dI===c)){dZ.beginPath();for(d8=0;d8<ed;d8++){ea=a2[d8];if(a2[d8]["isVert"]){if(a2[d8]["moveTo"]){dZ.moveTo(ea[0],ea[1])}else{dZ.lineTo(ea[0],ea[1])}}else{dZ.bezierCurveTo(a2[d8][0],a2[d8][1],a2[d8][2],a2[d8][3],a2[d8][4],a2[d8][5])}}cM()}else{if(dI===2){for(d8=0;d8<ed;d8++){ea=a2[d8];if(b8){cQ.stroke(ea[6])}cQ.point(ea[0],ea[1])}}else{if(dI===4){for(d8=0;d8+1<ed;d8+=2){ea=a2[d8];if(b8){cQ.stroke(a2[d8+1][6])}cQ.line(ea[0],ea[1],a2[d8+1][0],a2[d8+1][1])}}else{if(dI===9){for(d8=0;d8+2<ed;d8+=3){ea=a2[d8];dZ.beginPath();dZ.moveTo(ea[0],ea[1]);dZ.lineTo(a2[d8+1][0],a2[d8+1][1]);dZ.lineTo(a2[d8+2][0],a2[d8+2][1]);dZ.lineTo(ea[0],ea[1]);if(aA){cQ.fill(a2[d8+2][5]);bf()}if(b8){cQ.stroke(a2[d8+2][6]);c7()}dZ.closePath()}}else{if(dI===10){for(d8=0;d8+1<ed;d8++){ea=a2[d8];dZ.beginPath();dZ.moveTo(a2[d8+1][0],a2[d8+1][1]);dZ.lineTo(ea[0],ea[1]);if(b8){cQ.stroke(a2[d8+1][6])}if(aA){cQ.fill(a2[d8+1][5])}if(d8+2<ed){dZ.lineTo(a2[d8+2][0],a2[d8+2][1]);if(b8){cQ.stroke(a2[d8+2][6])}if(aA){cQ.fill(a2[d8+2][5])}}cM()}}else{if(dI===11){if(ed>2){dZ.beginPath();dZ.moveTo(a2[0][0],a2[0][1]);dZ.lineTo(a2[1][0],a2[1][1]);dZ.lineTo(a2[2][0],a2[2][1]);if(aA){cQ.fill(a2[2][5]);bf()}if(b8){cQ.stroke(a2[2][6]);c7()}dZ.closePath();for(d8=3;d8<ed;d8++){ea=a2[d8];dZ.beginPath();dZ.moveTo(a2[0][0],a2[0][1]);dZ.lineTo(a2[d8-1][0],a2[d8-1][1]);dZ.lineTo(ea[0],ea[1]);if(aA){cQ.fill(ea[5]);bf()}if(b8){cQ.stroke(ea[6]);c7()}dZ.closePath()}}}else{if(dI===16){for(d8=0;d8+3<ed;d8+=4){ea=a2[d8];dZ.beginPath();dZ.moveTo(ea[0],ea[1]);for(d6=1;d6<4;d6++){dZ.lineTo(a2[d8+d6][0],a2[d8+d6][1])}dZ.lineTo(ea[0],ea[1]);if(aA){cQ.fill(a2[d8+3][5]);bf()}if(b8){cQ.stroke(a2[d8+3][6]);c7()}dZ.closePath()}}else{if(dI===17){if(ed>3){for(d8=0;d8+1<ed;d8+=2){ea=a2[d8];dZ.beginPath();if(d8+3<ed){dZ.moveTo(a2[d8+2][0],a2[d8+2][1]);dZ.lineTo(ea[0],ea[1]);dZ.lineTo(a2[d8+1][0],a2[d8+1][1]);dZ.lineTo(a2[d8+3][0],a2[d8+3][1]);if(aA){cQ.fill(a2[d8+3][5])}if(b8){cQ.stroke(a2[d8+3][6])}}else{dZ.moveTo(ea[0],ea[1]);dZ.lineTo(a2[d8+1][0],a2[d8+1][1])}cM()}}}else{dZ.beginPath();dZ.moveTo(a2[0][0],a2[0][1]);for(d8=1;d8<ed;d8++){ea=a2[d8];if(ea.isVert){if(ea.moveTo){dZ.moveTo(ea[0],ea[1])}else{dZ.lineTo(ea[0],ea[1])}}}cM()}}}}}}}}}dG=false;T=false;b5=[];cW=0;if(d5){a2.pop()}};bt.prototype.endShape=function(d9){if(a2.length===0){return}var d5=d9===2;var d4=[];var d2=[];var eb=[];var ee=[];var d7=[];var ea;dl=true;var d8,d6,d3;var ed=a2.length;for(d8=0;d8<ed;d8++){ea=a2[d8];for(d6=0;d6<3;d6++){d2.push(ea[d6])}}for(d8=0;d8<ed;d8++){ea=a2[d8];for(d6=5;d6<9;d6++){eb.push(ea[d6])}}for(d8=0;d8<ed;d8++){ea=a2[d8];for(d6=9;d6<13;d6++){ee.push(ea[d6])}}for(d8=0;d8<ed;d8++){ea=a2[d8];d7.push(ea[3]);d7.push(ea[4])}if(d5){d2.push(a2[0][0]);d2.push(a2[0][1]);d2.push(a2[0][2]);for(d8=5;d8<9;d8++){eb.push(a2[0][d8])}for(d8=9;d8<13;d8++){ee.push(a2[0][d8])}d7.push(a2[0][3]);d7.push(a2[0][4])}if(dG&&(dI===20||dI===c)){d4=d2;if(b8){bb(d4,null,ee)}if(aA){df(d2,null,eb)}}else{if(T&&(dI===20||dI===c)){d4=d2;d4.splice(d4.length-3);ee.splice(ee.length-4);if(b8){bb(d4,null,ee)}if(aA){df(d2,"TRIANGLES",eb)}}else{if(dI===2){for(d8=0;d8<ed;d8++){ea=a2[d8];for(d6=0;d6<3;d6++){d4.push(ea[d6])}}dS(d4,ee)}else{if(dI===4){for(d8=0;d8<ed;d8++){ea=a2[d8];for(d6=0;d6<3;d6++){d4.push(ea[d6])}}for(d8=0;d8<ed;d8++){ea=a2[d8];for(d6=5;d6<9;d6++){eb.push(ea[d6])}}bb(d4,"LINES",ee)}else{if(dI===9){if(ed>2){for(d8=0;d8+2<ed;d8+=3){d2=[];d7=[];d4=[];eb=[];ee=[];for(d6=0;d6<3;d6++){for(d3=0;d3<3;d3++){d4.push(a2[d8+d6][d3]);d2.push(a2[d8+d6][d3])}}for(d6=0;d6<3;d6++){for(d3=3;d3<5;d3++){d7.push(a2[d8+d6][d3])}}for(d6=0;d6<3;d6++){for(d3=5;d3<9;d3++){eb.push(a2[d8+d6][d3]);ee.push(a2[d8+d6][d3+4])}}if(b8){bb(d4,"LINE_LOOP",ee)}if(aA||dK){df(d2,"TRIANGLES",eb,d7)}}}}else{if(dI===10){if(ed>2){for(d8=0;d8+2<ed;d8++){d4=[];d2=[];ee=[];eb=[];d7=[];for(d6=0;d6<3;d6++){for(d3=0;d3<3;d3++){d4.push(a2[d8+d6][d3]);d2.push(a2[d8+d6][d3])}}for(d6=0;d6<3;d6++){for(d3=3;d3<5;d3++){d7.push(a2[d8+d6][d3])}}for(d6=0;d6<3;d6++){for(d3=5;d3<9;d3++){ee.push(a2[d8+d6][d3+4]);eb.push(a2[d8+d6][d3])}}if(aA||dK){df(d2,"TRIANGLE_STRIP",eb,d7)}if(b8){bb(d4,"LINE_LOOP",ee)}}}}else{if(dI===11){if(ed>2){for(d8=0;d8<3;d8++){ea=a2[d8];for(d6=0;d6<3;d6++){d4.push(ea[d6])}}for(d8=0;d8<3;d8++){ea=a2[d8];for(d6=9;d6<13;d6++){ee.push(ea[d6])}}if(b8){bb(d4,"LINE_LOOP",ee)}for(d8=2;d8+1<ed;d8++){d4=[];ee=[];d4.push(a2[0][0]);d4.push(a2[0][1]);d4.push(a2[0][2]);ee.push(a2[0][9]);ee.push(a2[0][10]);ee.push(a2[0][11]);ee.push(a2[0][12]);for(d6=0;d6<2;d6++){for(d3=0;d3<3;d3++){d4.push(a2[d8+d6][d3])}}for(d6=0;d6<2;d6++){for(d3=9;d3<13;d3++){ee.push(a2[d8+d6][d3])}}if(b8){bb(d4,"LINE_STRIP",ee)}}if(aA||dK){df(d2,"TRIANGLE_FAN",eb,d7)}}}else{if(dI===16){for(d8=0;d8+3<ed;d8+=4){d4=[];for(d6=0;d6<4;d6++){ea=a2[d8+d6];for(d3=0;d3<3;d3++){d4.push(ea[d3])}}if(b8){bb(d4,"LINE_LOOP",ee)}if(aA){d2=[];eb=[];d7=[];for(d6=0;d6<3;d6++){d2.push(a2[d8][d6])}for(d6=5;d6<9;d6++){eb.push(a2[d8][d6])}for(d6=0;d6<3;d6++){d2.push(a2[d8+1][d6])}for(d6=5;d6<9;d6++){eb.push(a2[d8+1][d6])}for(d6=0;d6<3;d6++){d2.push(a2[d8+3][d6])}for(d6=5;d6<9;d6++){eb.push(a2[d8+3][d6])}for(d6=0;d6<3;d6++){d2.push(a2[d8+2][d6])}for(d6=5;d6<9;d6++){eb.push(a2[d8+2][d6])}if(dK){d7.push(a2[d8+0][3]);d7.push(a2[d8+0][4]);d7.push(a2[d8+1][3]);d7.push(a2[d8+1][4]);d7.push(a2[d8+3][3]);d7.push(a2[d8+3][4]);d7.push(a2[d8+2][3]);d7.push(a2[d8+2][4])}df(d2,"TRIANGLE_STRIP",eb,d7)}}}else{if(dI===17){var ec=[];if(ed>3){for(d8=0;d8<2;d8++){ea=a2[d8];for(d6=0;d6<3;d6++){d4.push(ea[d6])}}for(d8=0;d8<2;d8++){ea=a2[d8];for(d6=9;d6<13;d6++){ee.push(ea[d6])}}bb(d4,"LINE_STRIP",ee);if(ed>4&&ed%2>0){ec=d2.splice(d2.length-3);a2.pop()}for(d8=0;d8+3<ed;d8+=2){d4=[];ee=[];for(d6=0;d6<3;d6++){d4.push(a2[d8+1][d6])}for(d6=0;d6<3;d6++){d4.push(a2[d8+3][d6])}for(d6=0;d6<3;d6++){d4.push(a2[d8+2][d6])}for(d6=0;d6<3;d6++){d4.push(a2[d8+0][d6])}for(d6=9;d6<13;d6++){ee.push(a2[d8+1][d6])}for(d6=9;d6<13;d6++){ee.push(a2[d8+3][d6])}for(d6=9;d6<13;d6++){ee.push(a2[d8+2][d6])}for(d6=9;d6<13;d6++){ee.push(a2[d8+0][d6])}if(b8){bb(d4,"LINE_STRIP",ee)}}if(aA||dK){df(d2,"TRIANGLE_LIST",eb,d7)}}}else{if(ed===1){for(d6=0;d6<3;d6++){d4.push(a2[0][d6])}for(d6=9;d6<13;d6++){ee.push(a2[0][d6])}dS(d4,ee)}else{for(d8=0;d8<ed;d8++){ea=a2[d8];for(d6=0;d6<3;d6++){d4.push(ea[d6])}for(d6=5;d6<9;d6++){ee.push(ea[d6])}}if(b8&&d5){bb(d4,"LINE_LOOP",ee)}else{if(b8&&!d5){bb(d4,"LINE_STRIP",ee)}}if(aA||dK){df(d2,"TRIANGLE_FAN",eb,d7)}}}}}}}}}dK=false;dZ.useProgram(dp);dQ("usingTexture3d",dp,"usingTexture",dK)}}dG=false;T=false;b5=[];cW=0};var aP=function(d5,d4){var d6=1/d5;var d3=d6*d6;var d2=d3*d6;d4.set(0,0,0,1,d2,d3,d6,0,6*d2,2*d3,0,0,6*d2,0,0,0)};var di=function(){if(!aE){cX=new aH;aE=new aH;cG=true}var d2=aC;cX.set((d2-1)/2,(d2+3)/2,(-3-d2)/2,(1-d2)/2,1-d2,(-5-d2)/2,d2+2,(d2-1)/2,(d2-1)/2,0,(1-d2)/2,0,0,1,0,0);aP(J,aE);if(!b7){aI=new aH}aI.set(cX);aI.preApply(b7);aE.apply(cX)};bJ.prototype.bezierVertex=function(){T=true;var d2=[];if(dl){throw"vertex() must be used at least once before calling bezierVertex()"}for(var d3=0;d3<arguments.length;d3++){d2[d3]=arguments[d3]}a2.push(d2);a2[a2.length-1]["isVert"]=false};bt.prototype.bezierVertex=function(){T=true;var d9=[];if(dl){throw"vertex() must be used at least once before calling bezierVertex()"}if(arguments.length===9){if(br===c){br=new aH}var ee=a2.length-1;aP(cs,br);br.apply(N);var eg=br.array();var d5=a2[ee][0],ef=a2[ee][1],d8=a2[ee][2];var eb=eg[4]*d5+eg[5]*arguments[0]+eg[6]*arguments[3]+eg[7]*arguments[6];var ea=eg[8]*d5+eg[9]*arguments[0]+eg[10]*arguments[3]+eg[11]*arguments[6];var d7=eg[12]*d5+eg[13]*arguments[0]+eg[14]*arguments[3]+eg[15]*arguments[6];var eh=eg[4]*ef+eg[5]*arguments[1]+eg[6]*arguments[4]+eg[7]*arguments[7];var ed=eg[8]*ef+eg[9]*arguments[1]+eg[10]*arguments[4]+eg[11]*arguments[7];var ec=eg[12]*ef+eg[13]*arguments[1]+eg[14]*arguments[4]+eg[15]*arguments[7];var d4=eg[4]*d8+eg[5]*arguments[2]+eg[6]*arguments[5]+eg[7]*arguments[8];var d3=eg[8]*d8+eg[9]*arguments[2]+eg[10]*arguments[5]+eg[11]*arguments[8];var d2=eg[12]*d8+eg[13]*arguments[2]+eg[14]*arguments[5]+eg[15]*arguments[8];for(var d6=0;d6<cs;d6++){d5+=eb;eb+=ea;ea+=d7;ef+=eh;eh+=ed;ed+=ec;d8+=d4;d4+=d3;d3+=d2;cQ.vertex(d5,ef,d8)}cQ.vertex(arguments[6],arguments[7],arguments[8])}};cQ.texture=function(d5){var d3=dP.$ensureContext();if(d5.__texture){d3.bindTexture(d3.TEXTURE_2D,d5.__texture)}else{if(d5.localName==="canvas"){d3.bindTexture(d3.TEXTURE_2D,c1);d3.texImage2D(d3.TEXTURE_2D,0,d3.RGBA,d3.RGBA,d3.UNSIGNED_BYTE,d5);d3.texParameteri(d3.TEXTURE_2D,d3.TEXTURE_MAG_FILTER,d3.LINEAR);d3.texParameteri(d3.TEXTURE_2D,d3.TEXTURE_MIN_FILTER,d3.LINEAR);d3.generateMipmap(d3.TEXTURE_2D);cm.width=d5.width;cm.height=d5.height}else{var d4=d3.createTexture(),d7=u.createElement("canvas"),d2=d7.getContext("2d"),d6;if(d5.width&d5.width-1===0){d7.width=d5.width}else{d6=1;while(d6<d5.width){d6*=2}d7.width=d6}if(d5.height&d5.height-1===0){d7.height=d5.height}else{d6=1;while(d6<d5.height){d6*=2}d7.height=d6}d2.drawImage(d5.sourceImg,0,0,d5.width,d5.height,0,0,d7.width,d7.height);d3.bindTexture(d3.TEXTURE_2D,d4);d3.texParameteri(d3.TEXTURE_2D,d3.TEXTURE_MIN_FILTER,d3.LINEAR_MIPMAP_LINEAR);d3.texParameteri(d3.TEXTURE_2D,d3.TEXTURE_MAG_FILTER,d3.LINEAR);d3.texParameteri(d3.TEXTURE_2D,d3.TEXTURE_WRAP_T,d3.CLAMP_TO_EDGE);d3.texParameteri(d3.TEXTURE_2D,d3.TEXTURE_WRAP_S,d3.CLAMP_TO_EDGE);d3.texImage2D(d3.TEXTURE_2D,0,d3.RGBA,d3.RGBA,d3.UNSIGNED_BYTE,d7);d3.generateMipmap(d3.TEXTURE_2D);d5.__texture=d4;cm.width=d5.width;cm.height=d5.height}}dK=true;d3.useProgram(dp);dQ("usingTexture3d",dp,"usingTexture",dK)};cQ.textureMode=function(d2){dV=d2};var al=function(en,d8,ee,el,d7,ed,ej,d6,ec,eh,d5,ea){var eo=el;var d9=d7;var ef=ed;var eb=aE.array();var em=eb[4]*en+eb[5]*el+eb[6]*ej+eb[7]*eh;var ek=eb[8]*en+eb[9]*el+eb[10]*ej+eb[11]*eh;var ei=eb[12]*en+eb[13]*el+eb[14]*ej+eb[15]*eh;var er=eb[4]*d8+eb[5]*d7+eb[6]*d6+eb[7]*d5;var eq=eb[8]*d8+eb[9]*d7+eb[10]*d6+eb[11]*d5;var ep=eb[12]*d8+eb[13]*d7+eb[14]*d6+eb[15]*d5;var d4=eb[4]*ee+eb[5]*ed+eb[6]*ec+eb[7]*ea;var d3=eb[8]*ee+eb[9]*ed+eb[10]*ec+eb[11]*ea;var d2=eb[12]*ee+eb[13]*ed+eb[14]*ec+eb[15]*ea;cQ.vertex(eo,d9,ef);for(var eg=0;eg<J;eg++){eo+=em;em+=ek;ek+=ei;d9+=er;er+=eq;eq+=ep;ef+=d4;d4+=d3;d3+=d2;cQ.vertex(eo,d9,ef)}};bJ.prototype.curveVertex=function(d2,d3){dG=true;cQ.vertex(d2,d3)};bt.prototype.curveVertex=function(d2,d5,d4){dG=true;if(!cG){di()}var d3=[];d3[0]=d2;d3[1]=d5;d3[2]=d4;b5.push(d3);cW++;if(cW>3){al(b5[cW-4][0],b5[cW-4][1],b5[cW-4][2],b5[cW-3][0],b5[cW-3][1],b5[cW-3][2],b5[cW-2][0],b5[cW-2][1],b5[cW-2][2],b5[cW-1][0],b5[cW-1][1],b5[cW-1][2])}};bJ.prototype.curve=function(){if(arguments.length===8){cQ.beginShape();cQ.curveVertex(arguments[0],arguments[1]);cQ.curveVertex(arguments[2],arguments[3]);cQ.curveVertex(arguments[4],arguments[5]);cQ.curveVertex(arguments[6],arguments[7]);cQ.endShape()}};bt.prototype.curve=function(){if(arguments.length===12){cQ.beginShape();cQ.curveVertex(arguments[0],arguments[1],arguments[2]);cQ.curveVertex(arguments[3],arguments[4],arguments[5]);cQ.curveVertex(arguments[6],arguments[7],arguments[8]);cQ.curveVertex(arguments[9],arguments[10],arguments[11]);cQ.endShape()}};cQ.curveTightness=function(d2){aC=d2};cQ.curveDetail=function(d2){J=d2;di()};cQ.rectMode=function(d2){bD=d2};cQ.imageMode=function(d2){switch(d2){case 0:bc=aQ;break;case 1:bc=bV;break;case 3:bc=aG;break;default:throw"Invalid imageMode"}};cQ.ellipseMode=function(d2){cH=d2};cQ.arc=function(ee,ec,d5,eg,d4,ed){if(d5<=0||ed<d4){return}if(cH===1){d5=d5-ee;eg=eg-ec}else{if(cH===2){ee=ee-d5;ec=ec-eg;d5=d5*2;eg=eg*2}else{if(cH===3){ee=ee-d5/2;ec=ec-eg/2}}}while(d4<0){d4+=6.283185307179586;ed+=6.283185307179586}if(ed-d4>6.283185307179586){d4=0;ed=6.283185307179586}var ef=d5/2;var eh=eg/2;var d9=ee+ef;var d7=ec+eh;var d3=0|-0.5+d4*cQ.RAD_TO_DEG*2;var eb=0|0.5+ed*cQ.RAD_TO_DEG*2;var ea,d8;if(aA){var d6=b8;b8=false;cQ.beginShape();cQ.vertex(d9,d7);for(ea=d3;ea<=eb;ea++){d8=ea%720;cQ.vertex(d9+bd[d8]*ef,d7+ab[d8]*eh)}cQ.endShape(2);b8=d6}if(b8){var d2=aA;aA=false;cQ.beginShape();for(ea=d3;ea<=eb;ea++){d8=ea%720;cQ.vertex(d9+bd[d8]*ef,d7+ab[d8]*eh)}cQ.endShape();aA=d2}};bJ.prototype.line=function(d3,ea,d2,d8){if(!b8){return}d3=o.round(d3);d2=o.round(d2);ea=o.round(ea);d8=o.round(d8);if(d3===d2&&ea===d8){cQ.point(d3,ea);return}var d4=c,eb=c,d7=true,d9=dA.array(),d5=[1,0,0,0,1,0];for(var d6=0;d6<6&&d7;d6++){d7=d9[d6]===d5[d6]}if(d7){if(d3===d2){if(ea>d8){d4=ea;ea=d8;d8=d4}d8++;if(dN%2===1){dZ.translate(0.5,0)}}else{if(ea===d8){if(d3>d2){d4=d3;d3=d2;d2=d4}d2++;if(dN%2===1){dZ.translate(0,0.5)}}}if(dN===1){eb=dZ.lineCap;dZ.lineCap="butt"}}dZ.beginPath();dZ.moveTo(d3||0,ea||0);dZ.lineTo(d2||0,d8||0);c7();if(d7){if(d3===d2&&dN%2===1){dZ.translate(-0.5,0)}else{if(ea===d8&&dN%2===1){dZ.translate(0,-0.5)}}if(dN===1){dZ.lineCap=eb}}};bt.prototype.line=function(d4,d7,d9,d3,d5,d8){if(d5===c||d8===c){d8=0;d5=d3;d3=d9;d9=0}if(d4===d3&&d7===d5&&d9===d8){cQ.point(d4,d7,d9);return}var d6=[d4,d7,d9,d3,d5,d8];var d2=new aH;d2.scale(1,-1,1);d2.apply(dA.array());d2.transpose();if(dN>0&&b8){dZ.useProgram(dH);a0("model2d",dH,"model",false,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);a0("view2d",dH,"view",false,d2.array());dT("color2d",dH,"color",cU);dQ("picktype2d",dH,"picktype",0);c6("vertex2d",dH,"Vertex",3,b2);ca("aTextureCoord2d",dH,"aTextureCoord");dZ.bufferData(dZ.ARRAY_BUFFER,new d(d6),dZ.STREAM_DRAW);dZ.drawArrays(dZ.LINES,0,2)}};bJ.prototype.bezier=function(){if(arguments.length!==8){throw"You must use 8 parameters for bezier() in 2D mode"}cQ.beginShape();cQ.vertex(arguments[0],arguments[1]);cQ.bezierVertex(arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7]);cQ.endShape()};bt.prototype.bezier=function(){if(arguments.length!==12){throw"You must use 12 parameters for bezier() in 3D mode"}cQ.beginShape();cQ.vertex(arguments[0],arguments[1],arguments[2]);cQ.bezierVertex(arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8],arguments[9],arguments[10],arguments[11]);cQ.endShape()};cQ.bezierDetail=function(d2){cs=d2};cQ.bezierPoint=function(d3,d2,d6,d5,d4){return(1-d4)*(1-d4)*(1-d4)*d3+3*(1-d4)*(1-d4)*d4*d2+3*(1-d4)*d4*d4*d6+d4*d4*d4*d5};cQ.bezierTangent=function(d3,d2,d6,d5,d4){return 3*d4*d4*(-d3+3*d2-3*d6+d5)+6*d4*(d3-2*d2+d6)+3*(-d3+d2)};cQ.curvePoint=function(d3,d2,d6,d5,d4){return 0.5*(2*d2+(-d3+d6)*d4+(2*d3-5*d2+4*d6-d5)*d4*d4+(-d3+3*d2-3*d6+d5)*d4*d4*d4)};cQ.curveTangent=function(d3,d2,d6,d5,d4){return 0.5*(-d3+d6+2*(2*d3-5*d2+4*d6-d5)*d4+3*(-d3+3*d2-3*d6+d5)*d4*d4)};cQ.triangle=function(d5,d7,d3,d6,d2,d4){cQ.beginShape(9);cQ.vertex(d5,d7,0);cQ.vertex(d3,d6,0);cQ.vertex(d2,d4,0);cQ.endShape()};cQ.quad=function(d7,d9,d5,d8,d3,d6,d2,d4){cQ.beginShape(16);cQ.vertex(d7,d9,0);cQ.vertex(d5,d8,0);cQ.vertex(d3,d6,0);cQ.vertex(d2,d4,0);cQ.endShape()};var bG=function(d8,d7,d2,d9,eb,d6,ea,d3){if(d3===c){d6=eb;ea=eb;d3=eb}var d4=d2/2,d5=d9/2;if(eb>d4||eb>d5){eb=o.min(d4,d5)}if(d6>d4||d6>d5){d6=o.min(d4,d5)}if(ea>d4||ea>d5){ea=o.min(d4,d5)}if(d3>d4||d3>d5){d3=o.min(d4,d5)}if(!aA||b8){dZ.translate(0.5,0.5)}dZ.beginPath();dZ.moveTo(d8+eb,d7);dZ.lineTo(d8+d2-d6,d7);dZ.quadraticCurveTo(d8+d2,d7,d8+d2,d7+d6);dZ.lineTo(d8+d2,d7+d9-ea);dZ.quadraticCurveTo(d8+d2,d7+d9,d8+d2-ea,d7+d9);dZ.lineTo(d8+d3,d7+d9);dZ.quadraticCurveTo(d8,d7+d9,d8,d7+d9-d3);dZ.lineTo(d8,d7+eb);dZ.quadraticCurveTo(d8,d7,d8+eb,d7);if(!aA||b8){dZ.translate(-0.5,-0.5)}bf();c7()};bJ.prototype.rect=function(d3,d9,d6,d2,d4,d7,d5,d8){if(!d6&&!d2){return}if(bD===1){d6-=d3;d2-=d9}else{if(bD===2){d6*=2;d2*=2;d3-=d6/2;d9-=d2/2}else{if(bD===3){d3-=d6/2;d9-=d2/2}}}d3=o.round(d3);d9=o.round(d9);d6=o.round(d6);d2=o.round(d2);if(d4!==c){bG(d3,d9,d6,d2,d4,d7,d5,d8);return}if(b8&&dN%2===1){dZ.translate(0.5,0.5)}dZ.beginPath();dZ.rect(d3,d9,d6,d2);bf();c7();if(b8&&dN%2===1){dZ.translate(-0.5,-0.5)}};bt.prototype.rect=function(ea,d9,d2,ec,ee,d7,ed,d3){if(ee!==c){throw"rect() with rounded corners is not supported in 3D mode"}if(bD===1){d2-=ea;ec-=d9}else{if(bD===2){d2*=2;ec*=2;ea-=d2/2;d9-=ec/2}else{if(bD===3){ea-=d2/2;d9-=ec/2}}}var d6=new aH;d6.translate(ea,d9,0);d6.scale(d2,ec,1);d6.transpose();var d8=new aH;d8.scale(1,-1,1);d8.apply(dA.array());d8.transpose();if(dN>0&&b8){dZ.useProgram(dH);a0("model2d",dH,"model",false,d6.array());a0("view2d",dH,"view",false,d8.array());dT("color2d",dH,"color",cU);dQ("picktype2d",dH,"picktype",0);c6("vertex2d",dH,"Vertex",3,av);ca("aTextureCoord2d",dH,"aTextureCoord");dZ.drawArrays(dZ.LINE_LOOP,0,ae.length/3)}if(aA){dZ.useProgram(dp);a0("model3d",dp,"model",false,d6.array());a0("view3d",dp,"view",false,d8.array());dZ.enable(dZ.POLYGON_OFFSET_FILL);dZ.polygonOffset(1,1);dT("color3d",dp,"color",bg);if(dC>0){var eb=new aH;eb.set(d8);var d4=new aH;d4.set(d6);eb.mult(d4);var d5=new aH;d5.set(eb);d5.invert();d5.transpose();a0("normalTransform3d",dp,"normalTransform",false,d5.array());c6("normal3d",dp,"Normal",3,bW)}else{ca("normal3d",dp,"Normal")}c6("vertex3d",dp,"Vertex",3,av);dZ.drawArrays(dZ.TRIANGLE_FAN,0,ae.length/3);dZ.disable(dZ.POLYGON_OFFSET_FILL)}};bJ.prototype.ellipse=function(d8,d7,d3,ea){d8=d8||0;d7=d7||0;if(d3<=0&&ea<=0){return}if(cH===2){d3*=2;ea*=2}else{if(cH===1){d3=d3-d8;ea=ea-d7;d8+=d3/2;d7+=ea/2}else{if(cH===0){d8+=d3/2;d7+=ea/2}}}if(d3===ea){dZ.beginPath();dZ.arc(d8,d7,d3/2,0,6.283185307179586,false);bf();c7()}else{var d9=d3/2,d6=ea/2,d2=0.5522847498307933,d5=d2*d9,d4=d2*d6;cQ.beginShape();cQ.vertex(d8+d9,d7);cQ.bezierVertex(d8+d9,d7-d4,d8+d5,d7-d6,d8,d7-d6);cQ.bezierVertex(d8-d5,d7-d6,d8-d9,d7-d4,d8-d9,d7);cQ.bezierVertex(d8-d9,d7+d4,d8-d5,d7+d6,d8,d7+d6);cQ.bezierVertex(d8+d5,d7+d6,d8+d9,d7+d4,d8+d9,d7);cQ.endShape()}};bt.prototype.ellipse=function(ef,ee,d4,eh){ef=ef||0;ee=ee||0;if(d4<=0&&eh<=0){return}if(cH===2){d4*=2;eh*=2}else{if(cH===1){d4=d4-ef;eh=eh-ee;ef+=d4/2;ee+=eh/2}else{if(cH===0){ef+=d4/2;ee+=eh/2}}}var eg=d4/2,eb=eh/2,d2=0.5522847498307933,d6=d2*eg,d5=d2*eb;cQ.beginShape();cQ.vertex(ef+eg,ee);cQ.bezierVertex(ef+eg,ee-d5,0,ef+d6,ee-eb,0,ef,ee-eb,0);cQ.bezierVertex(ef-d6,ee-eb,0,ef-eg,ee-d5,0,ef-eg,ee,0);cQ.bezierVertex(ef-eg,ee+d5,0,ef-d6,ee+eb,0,ef,ee+eb,0);cQ.bezierVertex(ef+d6,ee+eb,0,ef+eg,ee+d5,0,ef+eg,ee,0);cQ.endShape();if(aA){var d7=0,ec=0,d9,d8;for(d9=0;d9<a2.length;d9++){d7+=a2[d9][0];ec+=a2[d9][1]}d7/=a2.length;ec/=a2.length;var ea=[],d3=[],ed=[];ea[0]=d7;ea[1]=ec;ea[2]=0;ea[3]=0;ea[4]=0;ea[5]=bg[0];ea[6]=bg[1];ea[7]=bg[2];ea[8]=bg[3];ea[9]=cU[0];ea[10]=cU[1];ea[11]=cU[2];ea[12]=cU[3];ea[13]=aZ;ea[14]=aY;ea[15]=aX;a2.unshift(ea);for(d9=0;d9<a2.length;d9++){for(d8=0;d8<3;d8++){d3.push(a2[d9][d8])}for(d8=5;d8<9;d8++){ed.push(a2[d9][d8])}}df(d3,"TRIANGLE_FAN",ed)}};cQ.normal=function(d2,d4,d3){if(arguments.length!==3||!(typeof d2==="number"&&typeof d4==="number"&&typeof d3==="number")){throw"normal() requires three numeric arguments."}aZ=d2;aY=d4;aX=d3;if(dI!==0){if(aT===0){aT=1}else{if(aT===1){aT=2}}}};cQ.save=function(d3,d2){if(d2!==c){return l.open(d2.toDataURL(),"_blank")}return l.open(cQ.externals.canvas.toDataURL(),"_blank")};var cq=0;cQ.saveFrame=function(d2){if(d2===c){d2="screen-####.png"}var d3=d2.replace(/#+/,function(d5){var d4=""+cq++;while(d4.length<d5.length){d4="0"+d4}return d4});cQ.save(d3)};var b6=u.createElement("canvas").getContext("2d");var Q=[c,c,c];function bq(d9,d3,d8){var d5=Q.shift();if(d5===c){d5={};d5.canvas=u.createElement("canvas");d5.context=d5.canvas.getContext("2d")}Q.push(d5);var d4=d5.canvas,d6=d5.context,d7=d3||d9.width,d2=d8||d9.height;d4.width=d7;d4.height=d2;if(!d9){d6.clearRect(0,0,d7,d2)}else{if("data" in d9){d6.putImageData(d9,0,0)}else{d6.clearRect(0,0,d7,d2);d6.drawImage(d9,0,0,d7,d2)}}return d5}function bU(d2){return{getLength:function(d3){return function(){if(d3.isRemote){throw"Image is loaded remotely. Cannot get length."}else{return d3.imageData.data.length?d3.imageData.data.length/4:0}}}(d2),getPixel:function(d3){return function(d4){var d6=d4*4,d5=d3.imageData.data;if(d3.isRemote){throw"Image is loaded remotely. Cannot get pixels."}return(d5[d6+3]&255)<<24|(d5[d6]&255)<<16|(d5[d6+1]&255)<<8|d5[d6+2]&255}}(d2),setPixel:function(d3){return function(d4,d7){var d6=d4*4,d5=d3.imageData.data;if(d3.isRemote){throw"Image is loaded remotely. Cannot set pixel."}d5[d6+0]=d7>>16&255;d5[d6+1]=d7>>8&255;d5[d6+2]=d7&255;d5[d6+3]=d7>>24&255;d3.__isDirty=true}}(d2),toArray:function(d3){return function(){var d4=[],d7=d3.imageData.data,d6=d3.width*d3.height;if(d3.isRemote){throw"Image is loaded remotely. Cannot get pixels."}for(var d5=0,d8=0;d5<d6;d5++,d8+=4){d4.push((d7[d8+3]&255)<<24|(d7[d8]&255)<<16|(d7[d8+1]&255)<<8|d7[d8+2]&255)}return d4}}(d2),set:function(d3){return function(d4){var d8,d7,d9;if(this.isRemote){throw"Image is loaded remotely. Cannot set pixels."}d7=d3.imageData.data;for(var d5=0,d6=d4.length;d5<d6;d5++){d9=d4[d5];d8=d5*4;d7[d8+0]=d9>>16&255;d7[d8+1]=d9>>8&255;d7[d8+2]=d9&255;d7[d8+3]=d9>>24&255}d3.__isDirty=true}}(d2)}}var cA=function(d5,d8,d6){this.__isDirty=false;if(d5 instanceof HTMLImageElement){this.fromHTMLImageData(d5)}else{if(d8||d6){this.width=d5||1;this.height=d8||1;var d3=this.sourceImg=u.createElement("canvas");d3.width=this.width;d3.height=this.height;var d9=this.imageData=d3.getContext("2d").createImageData(this.width,this.height);this.format=d6===2||d6===4?d6:1;if(this.format===1){for(var d4=3,d7=this.imageData.data,d2=d7.length;d4<d2;d4+=4){d7[d4]=255}}this.__isDirty=true;this.updatePixels()}else{this.width=0;this.height=0;this.imageData=b6.createImageData(1,1);this.format=2}}this.pixels=bU(this)};cA.prototype={__isPImage:true,updatePixels:function(){var d2=this.sourceImg;if(d2&&d2 instanceof HTMLCanvasElement&&this.__isDirty){d2.getContext("2d").putImageData(this.imageData,0,0)}this.__isDirty=false},fromHTMLImageData:function(d2){var d3=bq(d2);try{var d5=d3.context.getImageData(0,0,d2.width,d2.height);this.fromImageData(d5)}catch(d4){if(d2.width&&d2.height){this.isRemote=true;this.width=d2.width;this.height=d2.height}}this.sourceImg=d2},get:function(d2,d5,d3,d4){if(!arguments.length){return cQ.get(this)}if(arguments.length===2){return cQ.get(d2,d5,this)}if(arguments.length===4){return cQ.get(d2,d5,d3,d4,this)}},set:function(d2,d4,d3){cQ.set(d2,d4,d3,this);this.__isDirty=true},blend:function(ea,d6,d5,d3,d8,eb,d9,d7,d2,d4){if(arguments.length===9){cQ.blend(this,ea,d6,d5,d3,d8,eb,d9,d7,d2,this)}else{if(arguments.length===10){cQ.blend(ea,d6,d5,d3,d8,eb,d9,d7,d2,d4,this)}}delete this.sourceImg},copy:function(d9,d6,d5,d4,d3,ea,d8,d7,d2){if(arguments.length===8){cQ.blend(this,d9,d6,d5,d4,d3,ea,d8,d7,0,this)}else{if(arguments.length===9){cQ.blend(d9,d6,d5,d4,d3,ea,d8,d7,d2,0,this)}}delete this.sourceImg},filter:function(d3,d2){if(arguments.length===2){cQ.filter(d3,d2,this)}else{if(arguments.length===1){cQ.filter(d3,null,this)}}delete this.sourceImg},save:function(d2){cQ.save(d2,this)},resize:function(d2,d4){if(this.isRemote){throw"Image is loaded remotely. Cannot resize."}if(this.width!==0||this.height!==0){if(d2===0&&d4!==0){d2=o.floor(this.width/this.height*d4)}else{if(d4===0&&d2!==0){d4=o.floor(this.height/this.width*d2)}}var d3=bq(this.imageData).canvas;var d5=bq(d3,d2,d4).context.getImageData(0,0,d2,d4);this.fromImageData(d5)}},mask:function(d2){var d5=this.toImageData(),d4,d3;if(d2 instanceof cA||d2.__isPImage){if(d2.width===this.width&&d2.height===this.height){d2=d2.toImageData();for(d4=2,d3=this.width*this.height*4;d4<d3;d4+=4){d5.data[d4+1]=d2.data[d4]}}else{throw"mask must have the same dimensions as PImage."}}else{if(d2 instanceof Array){if(this.width*this.height===d2.length){for(d4=0,d3=d2.length;d4<d3;++d4){d5.data[d4*4+3]=d2[d4]}}else{throw"mask array must be the same length as PImage pixels array."}}}this.fromImageData(d5)},loadPixels:h,toImageData:function(){if(this.isRemote){return this.sourceImg}if(!this.__isDirty){return this.imageData}var d2=bq(this.imageData);return d2.context.getImageData(0,0,this.width,this.height)},toDataURL:function(){if(this.isRemote){throw"Image is loaded remotely. Cannot create dataURI."}var d2=bq(this.imageData);return d2.canvas.toDataURL()},fromImageData:function(d6){var d3=d6.width,d5=d6.height,d4=u.createElement("canvas"),d2=d4.getContext("2d");this.width=d4.width=d3;this.height=d4.height=d5;d2.putImageData(d6,0,0);this.format=2;this.imageData=d6;this.sourceImg=d4}};cQ.PImage=cA;cQ.createImage=function(d2,d3,d4){return new cA(d2,d3,d4)};cQ.loadImage=function(d3,d4,d6){if(d4){d3=d3+"."+d4}var d5;if(cK.imageCache.images[d3]){d5=new cA(cK.imageCache.images[d3]);d5.loaded=true;return d5}d5=new cA;var d2=u.createElement("img");d5.sourceImg=d2;d2.onload=function(ea,d8,d7){var eb=ea;var d9=d8;var ec=d7;return function(){d9.fromHTMLImageData(eb);d9.loaded=true;if(ec){ec()}}}(d2,d5,d6);d2.src=d3;return d5};cQ.requestImage=cQ.loadImage;function c3(d2,d5){var d3;if(d2>=cQ.width||d2<0||d5<0||d5>=cQ.height){return 0}if(dM){var d4=((0|d2)+cQ.width*(0|d5))*4;d3=cQ.imageData.data;return(d3[d4+3]&255)<<24|(d3[d4]&255)<<16|(d3[d4+1]&255)<<8|d3[d4+2]&255}d3=cQ.toImageData(0|d2,0|d5,1,1).data;return(d3[3]&255)<<24|(d3[0]&255)<<16|(d3[1]&255)<<8|d3[2]&255}function c2(d2,d6,d3){if(d3.isRemote){throw"Image is loaded remotely. Cannot get x,y."}var d5=d6*d3.width*4+d2*4,d4=d3.imageData.data;return(d4[d5+3]&255)<<24|(d4[d5]&255)<<16|(d4[d5+1]&255)<<8|d4[d5+2]&255}function c0(d2,d6,d3,d4){var d5=new cA(d3,d4,2);d5.fromImageData(cQ.toImageData(d2,d6,d3,d4));return d5}function cZ(d7,d6,d8,ed,ej){if(ej.isRemote){throw"Image is loaded remotely. Cannot get x,y,w,h."}var eh=new cA(d8,ed,2),d4=eh.imageData.data,d5=ej.width,ee=ej.height,eg=ej.imageData.data;var d2=o.max(0,-d6),d3=o.max(0,-d7),d9=o.min(ed,ee-d6),ea=o.min(d8,d5-d7);for(var ec=d2;ec<d9;++ec){var ef=((d6+ec)*d5+(d7+d3))*4;var ei=(ec*d8+d3)*4;for(var eb=d3;eb<ea;++eb){d4[ei++]=eg[ef++];d4[ei++]=eg[ef++];d4[ei++]=eg[ef++];d4[ei++]=eg[ef++]}}eh.__isDirty=true;return eh}cQ.get=function(d2,d6,d3,d5,d4){if(d4!==undefined){return cZ(d2,d6,d3,d5,d4)}if(d5!==undefined){return c0(d2,d6,d3,d5)}if(d3!==undefined){return c2(d2,d6,d3)}if(d6!==undefined){return c3(d2,d6)}if(d2!==undefined){return cZ(0,0,d2.width,d2.height,d2)}return c0(0,0,cQ.width,cQ.height)};cQ.createGraphics=function(d2,d4,d3){var d5=new B;d5.size(d2,d4,d3);return d5};function M(){if(dM){dZ=ad;dM=false;cQ.updatePixels()}}function ck(){function d3(d7,d5){function d6(){M();dZ[d5].apply(dZ,arguments)}d7[d5]=d6}function d2(d8,d6){function d5(){M();return dZ[d6]}function d7(d9){M();dZ[d6]=d9}cQ.defineProperty(d8,d6,{get:d5,set:d7})}for(var d4 in dZ){if(typeof dZ[d4]==="function"){d3(this,d4)}else{d2(this,d4)}}}function cw(){if(dM){return}cQ.loadPixels();if(ch===null){ad=dZ;ch=new ck}dM=true;dZ=ch;dU=0}function bp(d2,d4,d3){if(d2<cQ.width&&d2>=0&&d4>=0&&d4<cQ.height){cw();cQ.pixels.setPixel((0|d2)+cQ.width*(0|d4),d3);if(++dU>bT){M()}}}function bn(d2,d8,d5,d3){if(d3.isRemote){throw"Image is loaded remotely. Cannot set x,y."}var d7=cQ.color.toArray(d5);var d6=d8*d3.width*4+d2*4;var d4=d3.imageData.data;d4[d6]=d7[0];d4[d6+1]=d7[1];d4[d6+2]=d7[2];d4[d6+3]=d7[3]}cQ.set=function(d2,d7,d5,d4){var d3,d6;if(arguments.length===3){if(typeof d5==="number"){bp(d2,d7,d5)}else{if(d5 instanceof cA||d5.__isPImage){cQ.image(d5,d2,d7)}}}else{if(arguments.length===4){bn(d2,d7,d5,d4)}}};cQ.imageData={};cQ.pixels={getLength:function(){return cQ.imageData.data.length?cQ.imageData.data.length/4:0},getPixel:function(d2){var d4=d2*4,d3=cQ.imageData.data;return d3[d4+3]<<24&4278190080|d3[d4+0]<<16&16711680|d3[d4+1]<<8&65280|d3[d4+2]&255},setPixel:function(d2,d5){var d4=d2*4,d3=cQ.imageData.data;d3[d4+0]=(d5&16711680)>>>16;d3[d4+1]=(d5&65280)>>>8;d3[d4+2]=d5&255;d3[d4+3]=(d5&4278190080)>>>24},toArray:function(){var d2=[],d4=cQ.imageData.width*cQ.imageData.height,d5=cQ.imageData.data;for(var d3=0,d6=0;d3<d4;d3++,d6+=4){d2.push(d5[d6+3]<<24&4278190080|d5[d6+0]<<16&16711680|d5[d6+1]<<8&65280|d5[d6+2]&255)}return d2},set:function(d2){for(var d3=0,d4=d2.length;d3<d4;d3++){this.setPixel(d3,d2[d3])}}};cQ.loadPixels=function(){cQ.imageData=dP.$ensureContext().getImageData(0,0,cQ.width,cQ.height)};cQ.updatePixels=function(){if(cQ.imageData){dP.$ensureContext().putImageData(cQ.imageData,0,0)}};cQ.hint=function(d3){var d2=dP.$ensureContext();if(d3===4){d2.disable(d2.DEPTH_TEST);d2.depthMask(false);d2.clear(d2.DEPTH_BUFFER_BIT)}else{if(d3===-4){d2.enable(d2.DEPTH_TEST);d2.depthMask(true)}}};var bw=function(d5,d4,d3,d2){var d6;if(d5 instanceof cA||d5.__isPImage){d6=d5;if(!d6.loaded){throw"Error using image in background(): PImage not loaded."}if(d6.width!==cQ.width||d6.height!==cQ.height){throw"Background image must be the same dimensions as the canvas."}}else{d6=cQ.color(d5,d4,d3,d2)}aV=d6};bJ.prototype.background=function(d5,d4,d3,d2){if(d5!==c){bw(d5,d4,d3,d2)}if(aV instanceof cA||aV.__isPImage){ax();dZ.setTransform(1,0,0,1,0,0);cQ.image(aV,0,0);cJ()}else{ax();dZ.setTransform(1,0,0,1,0,0);if(cQ.alpha(aV)!==bM){dZ.clearRect(0,0,cQ.width,cQ.height)}dZ.fillStyle=cQ.color.toString(aV);dZ.fillRect(0,0,cQ.width,cQ.height);ak=true;cJ()}};bt.prototype.background=function(d5,d4,d3,d2){if(arguments.length>0){bw(d5,d4,d3,d2)}var d6=cQ.color.toGLArray(aV);dZ.clearColor(d6[0],d6[1],d6[2],d6[3]);dZ.clear(dZ.COLOR_BUFFER_BIT|dZ.DEPTH_BUFFER_BIT)};bJ.prototype.image=function(d5,ea,d8,eb,d6){ea=o.round(ea);d8=o.round(d8);if(d5.width>0){var ec=eb||d5.width;var d9=d6||d5.height;var d2=bc(ea||0,d8||0,eb||d5.width,d6||d5.height,arguments.length<4);var d7=!!d5.sourceImg&&a6===null;if(d7){var d3=d5.sourceImg;if(d5.__isDirty){d5.updatePixels()}dZ.drawImage(d3,0,0,d3.width,d3.height,d2.x,d2.y,d2.w,d2.h)}else{var d4=d5.toImageData();if(a6!==null){a6(d4);d5.__isDirty=true}dZ.drawImage(bq(d4).canvas,0,0,d5.width,d5.height,d2.x,d2.y,d2.w,d2.h)}}};bt.prototype.image=function(d4,d2,d6,d3,d5){if(d4.width>0){d2=o.round(d2);d6=o.round(d6);d3=d3||d4.width;d5=d5||d4.height;cQ.beginShape(cQ.QUADS);cQ.texture(d4);cQ.vertex(d2,d6,0,0,0);cQ.vertex(d2,d6+d5,0,0,d5);cQ.vertex(d2+d3,d6+d5,0,d3,d5);cQ.vertex(d2+d3,d6,0,d3,0);cQ.endShape()}};cQ.tint=function(d5,d4,d2,ea){var d7=cQ.color(d5,d4,d2,ea);var d3=cQ.red(d7)/bB;var d6=cQ.green(d7)/bA;var d8=cQ.blue(d7)/by;var d9=cQ.alpha(d7)/bM;a6=function(ee){var ed=ee.data,ec=4*ee.width*ee.height;for(var eb=0;eb<ec;){ed[eb++]*=d3;ed[eb++]*=d6;ed[eb++]*=d8;ed[eb++]*=d9}};bo=function(ec){for(var eb=0;eb<ec.length;){ec[eb++]=d3;ec[eb++]=d6;ec[eb++]=d8;ec[eb++]=d9}}};cQ.noTint=function(){a6=null;bo=null};cQ.copy=function(d2,d7,d6,d8,d4,ea,d9,d3,d5){if(d5===c){d5=d3;d3=d9;d9=ea;ea=d4;d4=d8;d8=d6;d6=d7;d7=d2;d2=cQ}cQ.blend(d2,d7,d6,d8,d4,ea,d9,d3,d5,0)};cQ.blend=function(d2,ec,eb,ef,d7,eh,eg,d3,d9,d8,d5){if(d2.isRemote){throw"Image is loaded remotely. Cannot blend image."}if(d8===c){d8=d9;d9=d3;d3=eg;eg=eh;eh=d7;d7=ef;ef=eb;eb=ec;ec=d2;d2=cQ}var d4=ec+ef,ea=eb+d7,ee=eh+d3,d6=eg+d9,ed=d5||cQ;if(d5===c||d8===c){cQ.loadPixels()}d2.loadPixels();if(d2===cQ&&cQ.intersect(ec,eb,d4,ea,eh,eg,ee,d6)){cQ.blit_resize(cQ.get(ec,eb,d4-ec,ea-eb),0,0,d4-ec-1,ea-eb-1,ed.imageData.data,ed.width,ed.height,eh,eg,ee,d6,d8)}else{cQ.blit_resize(d2,ec,eb,d4,ea,ed.imageData.data,ed.width,ed.height,eh,eg,ee,d6,d8)}if(d5===c){cQ.updatePixels()}};var bh=function(d6){var d2=cQ.floor(d6*3.5),d4,d3;d2=d2<1?1:d2<248?d2:248;if(cQ.shared.blurRadius!==d2){cQ.shared.blurRadius=d2;cQ.shared.blurKernelSize=1+(cQ.shared.blurRadius<<1);cQ.shared.blurKernel=new d(cQ.shared.blurKernelSize);var d8=cQ.shared.blurKernel;var d7=cQ.shared.blurKernelSize;var d5=cQ.shared.blurRadius;for(d4=0;d4<d7;d4++){d8[d4]=0}var d9=(d2-1)*(d2-1);for(d4=1;d4<d2;d4++){d8[d2+d4]=d8[d3]=d9}d8[d2]=d2*d2}};var b1=function(eg,el){var d4,d7,ed,ei,ej,es,ek;var en,ef,er,eq,eh;var ea=el.pixels.getLength();var em=new d(ea);var ev=new d(ea);var d9=new d(ea);var eu=new d(ea);var et=0;var ec,eb,ep,d6;bh(eg);var d3=el.height;var d2=el.width;var eo=cQ.shared.blurKernelSize;var ee=cQ.shared.blurRadius;var d8=cQ.shared.blurKernel;var d5=el.imageData.data;for(eb=0;eb<d3;eb++){for(ec=0;ec<d2;ec++){ei=ed=d7=ej=d4=0;en=ec-ee;if(en<0){eh=-en;en=0}else{if(en>=d2){break}eh=0}for(ep=eh;ep<eo;ep++){if(en>=d2){break}d6=(en+et)*4;ek=d8[ep];ej+=ek*d5[d6+3];d7+=ek*d5[d6];ed+=ek*d5[d6+1];ei+=ek*d5[d6+2];d4+=ek;en++}ef=et+ec;eu[ef]=ej/d4;em[ef]=d7/d4;ev[ef]=ed/d4;d9[ef]=ei/d4}et+=d2}et=0;er=-ee;eq=er*d2;for(eb=0;eb<d3;eb++){for(ec=0;ec<d2;ec++){ei=ed=d7=ej=d4=0;if(er<0){eh=ef=-er;en=ec}else{if(er>=d3){break}eh=0;ef=er;en=ec+eq}for(ep=eh;ep<eo;ep++){if(ef>=d3){break}ek=d8[ep];ej+=ek*eu[en];d7+=ek*em[en];ed+=ek*ev[en];ei+=ek*d9[en];d4+=ek;ef++;en+=d2}d6=(ec+et)*4;d5[d6]=d7/d4;d5[d6+1]=ed/d4;d5[d6+2]=ei/d4;d5[d6+3]=ej/d4}et+=d2;eq+=d2;er++}};var b9=function(ej,ed){var d9=0;var en=ed.pixels.getLength();var ee=new m(en);var eh,d3,ec,eb,d5;var ei,d6,d8,ea,d4,ef,em,d2,ek,d7,el,eg;if(!ej){while(d9<en){eh=d9;d3=d9+ed.width;while(d9<d3){ec=eb=ed.pixels.getPixel(d9);d6=d9-1;ei=d9+1;d8=d9-ed.width;ea=d9+ed.width;if(d6<eh){d6=d9}if(ei>=d3){ei=d9}if(d8<0){d8=0}if(ea>=en){ea=d9}em=ed.pixels.getPixel(d8);ef=ed.pixels.getPixel(d6);d2=ed.pixels.getPixel(ea);d4=ed.pixels.getPixel(ei);d5=77*(ec>>16&255)+151*(ec>>8&255)+28*(ec&255);d7=77*(ef>>16&255)+151*(ef>>8&255)+28*(ef&255);ek=77*(d4>>16&255)+151*(d4>>8&255)+28*(d4&255);el=77*(em>>16&255)+151*(em>>8&255)+28*(em&255);eg=77*(d2>>16&255)+151*(d2>>8&255)+28*(d2&255);if(d7>d5){eb=ef;d5=d7}if(ek>d5){eb=d4;d5=ek}if(el>d5){eb=em;d5=el}if(eg>d5){eb=d2;d5=eg}ee[d9++]=eb}}}else{while(d9<en){eh=d9;d3=d9+ed.width;while(d9<d3){ec=eb=ed.pixels.getPixel(d9);d6=d9-1;ei=d9+1;d8=d9-ed.width;ea=d9+ed.width;if(d6<eh){d6=d9}if(ei>=d3){ei=d9}if(d8<0){d8=0}if(ea>=en){ea=d9}em=ed.pixels.getPixel(d8);ef=ed.pixels.getPixel(d6);d2=ed.pixels.getPixel(ea);d4=ed.pixels.getPixel(ei);d5=77*(ec>>16&255)+151*(ec>>8&255)+28*(ec&255);d7=77*(ef>>16&255)+151*(ef>>8&255)+28*(ef&255);ek=77*(d4>>16&255)+151*(d4>>8&255)+28*(d4&255);el=77*(em>>16&255)+151*(em>>8&255)+28*(em&255);eg=77*(d2>>16&255)+151*(d2>>8&255)+28*(d2&255);if(d7<d5){eb=ef;d5=d7}if(ek<d5){eb=d4;d5=ek}if(el<d5){eb=em;d5=el}if(eg<d5){eb=d2;d5=eg}ee[d9++]=eb}}}ed.pixels.set(ee)};cQ.filter=function(d9,d8,d5){var ec,d7,d3,eb;if(arguments.length===3){d5.loadPixels();ec=d5}else{cQ.loadPixels();ec=cQ}if(d8===c){d8=null}if(ec.isRemote){throw"Image is loaded remotely. Cannot filter image."}var ed=ec.pixels.getLength();switch(d9){case 11:var ee=d8||1;b1(ee,ec);break;case 12:if(ec.format===4){for(eb=0;eb<ed;eb++){d7=255-ec.pixels.getPixel(eb);ec.pixels.setPixel(eb,4278190080|d7<<16|d7<<8|d7)}ec.format=1}else{for(eb=0;eb<ed;eb++){d7=ec.pixels.getPixel(eb);d3=77*(d7>>16&255)+151*(d7>>8&255)+28*(d7&255)>>8;ec.pixels.setPixel(eb,d7&4278190080|d3<<16|d3<<8|d3)}}break;case 13:for(eb=0;eb<ed;eb++){ec.pixels.setPixel(eb,ec.pixels.getPixel(eb)^16777215)}break;case 15:if(d8===null){throw"Use filter(POSTERIZE, int levels) instead of filter(POSTERIZE)"}var eh=cQ.floor(d8);if(eh<2||eh>255){throw"Levels must be between 2 and 255 for filter(POSTERIZE, levels)"}var ea=eh-1;for(eb=0;eb<ed;eb++){var d2=ec.pixels.getPixel(eb)>>16&255;var ef=ec.pixels.getPixel(eb)>>8&255;var d4=ec.pixels.getPixel(eb)&255;d2=(d2*eh>>8)*255/ea;ef=(ef*eh>>8)*255/ea;d4=(d4*eh>>8)*255/ea;ec.pixels.setPixel(eb,4278190080&ec.pixels.getPixel(eb)|d2<<16|ef<<8|d4)}break;case 14:for(eb=0;eb<ed;eb++){ec.pixels.setPixel(eb,ec.pixels.getPixel(eb)|4278190080)}ec.format=1;break;case 16:if(d8===null){d8=0.5}if(d8<0||d8>1){throw"Level must be between 0 and 1 for filter(THRESHOLD, level)"}var d6=cQ.floor(d8*255);for(eb=0;eb<ed;eb++){var eg=cQ.max((ec.pixels.getPixel(eb)&16711680)>>16,cQ.max((ec.pixels.getPixel(eb)&65280)>>8,ec.pixels.getPixel(eb)&255));ec.pixels.setPixel(eb,ec.pixels.getPixel(eb)&4278190080|(eg<d6?0:16777215))}break;case 17:b9(true,ec);break;case 18:b9(false,ec);break}ec.updatePixels()};cQ.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};cQ.intersect=function(d4,eb,d3,ea,ef,d8,ee,d7){var ed=d3-d4+1;var d6=ea-eb+1;var d2=ee-ef+1;var d9=d7-d8+1;if(ef<d4){d2+=ef-d4;if(d2>ed){d2=ed}}else{var ec=ed+d4-ef;if(d2>ec){d2=ec}}if(d8<eb){d9+=d8-eb;if(d9>d6){d9=d6}}else{var d5=d6+eb-d8;if(d9>d5){d9=d5}}return !(d2<=0||d9<=0)};var dJ={};dJ[1]=cQ.modes.blend;dJ[2]=cQ.modes.add;dJ[4]=cQ.modes.subtract;dJ[8]=cQ.modes.lightest;dJ[16]=cQ.modes.darkest;dJ[0]=cQ.modes.replace;dJ[32]=cQ.modes.difference;dJ[64]=cQ.modes.exclusion;dJ[128]=cQ.modes.multiply;dJ[256]=cQ.modes.screen;dJ[512]=cQ.modes.overlay;dJ[1024]=cQ.modes.hard_light;dJ[2048]=cQ.modes.soft_light;dJ[4096]=cQ.modes.dodge;dJ[8192]=cQ.modes.burn;cQ.blit_resize=function(ef,er,el,eq,ek,ew,eb,ej,ep,eg,eo,ee,eh){var eu,et;if(er<0){er=0}if(el<0){el=0}if(eq>=ef.width){eq=ef.width-1}if(ek>=ef.height){ek=ef.height-1}var eA=eq-er;var eF=ek-el;var d2=eo-ep;var ec=ee-eg;if(d2<=0||ec<=0||eA<=0||eF<=0||ep>=eb||eg>=ej||er>=ef.width||el>=ef.height){return}var d9=o.floor(eA/d2*32768);var d6=o.floor(eF/ec*32768);var ey=cQ.shared;ey.srcXOffset=o.floor(ep<0?-ep*d9:er*32768);ey.srcYOffset=o.floor(eg<0?-eg*d6:el*32768);if(ep<0){d2+=ep;ep=0}if(eg<0){ec+=eg;eg=0}d2=o.min(d2,eb-ep);ec=o.min(ec,ej-eg);var em=eg*eb+ep;var eI;ey.srcBuffer=ef.imageData.data;ey.iw=ef.width;ey.iw1=ef.width-1;ey.ih1=ef.height-1;var en=cQ.filter_bilinear,eC=cQ.filter_new_scanline,ea=dJ[eh],ez,eE,ex,eB,d4,d5,d3=4278190080,eD=16711680,es=65280,d8=255,eH=32767,ev=15,ed=1,ei=9,d7=ey.srcBuffer,eG=o.min;for(et=0;et<ec;et++){ey.sX=ey.srcXOffset;ey.fracV=ey.srcYOffset&eH;ey.ifV=eH-ey.fracV;ey.v1=(ey.srcYOffset>>ev)*ey.iw;ey.v2=eG((ey.srcYOffset>>ev)+1,ey.ih1)*ey.iw;for(eu=0;eu<d2;eu++){eE=(em+eu)*4;eI=ew[eE+3]<<24&d3|ew[eE]<<16&eD|ew[eE+1]<<8&es|ew[eE+2]&d8;ey.fracU=ey.sX&eH;ey.ifU=eH-ey.fracU;ey.ul=ey.ifU*ey.ifV>>ev;ey.ll=ey.ifU*ey.fracV>>ev;ey.ur=ey.fracU*ey.ifV>>ev;ey.lr=ey.fracU*ey.fracV>>ev;ey.u1=ey.sX>>ev;ey.u2=eG(ey.u1+1,ey.iw1);ex=(ey.v1+ey.u1)*4;eB=(ey.v1+ey.u2)*4;d4=(ey.v2+ey.u1)*4;d5=(ey.v2+ey.u2)*4;ey.cUL=d7[ex+3]<<24&d3|d7[ex]<<16&eD|d7[ex+1]<<8&es|d7[ex+2]&d8;ey.cUR=d7[eB+3]<<24&d3|d7[eB]<<16&eD|d7[eB+1]<<8&es|d7[eB+2]&d8;ey.cLL=d7[d4+3]<<24&d3|d7[d4]<<16&eD|d7[d4+1]<<8&es|d7[d4+2]&d8;ey.cLR=d7[d5+3]<<24&d3|d7[d5]<<16&eD|d7[d5+1]<<8&es|d7[d5+2]&d8;ey.r=ey.ul*((ey.cUL&eD)>>16)+ey.ll*((ey.cLL&eD)>>16)+ey.ur*((ey.cUR&eD)>>16)+ey.lr*((ey.cLR&eD)>>16)<<ed&eD;ey.g=ey.ul*(ey.cUL&es)+ey.ll*(ey.cLL&es)+ey.ur*(ey.cUR&es)+ey.lr*(ey.cLR&es)>>>ev&es;ey.b=ey.ul*(ey.cUL&d8)+ey.ll*(ey.cLL&d8)+ey.ur*(ey.cUR&d8)+ey.lr*(ey.cLR&d8)>>>ev;ey.a=ey.ul*((ey.cUL&d3)>>>24)+ey.ll*((ey.cLL&d3)>>>24)+ey.ur*((ey.cUR&d3)>>>24)+ey.lr*((ey.cLR&d3)>>>24)<<ei&d3;ez=ea(eI,ey.a|ey.r|ey.g|ey.b);ew[eE]=(ez&eD)>>>16;ew[eE+1]=(ez&es)>>>8;ew[eE+2]=ez&d8;ew[eE+3]=(ez&d3)>>>24;ey.sX+=d9}em+=eb;ey.srcYOffset+=d6}};cQ.loadFont=function(d3,d4){if(d3===c){throw"font name required in loadFont."}if(d3.indexOf(".svg")===-1){if(d4===c){d4=P.size}return f.get(d3,d4)}var d2=cQ.loadGlyphs(d3);return{name:d3,css:"12px sans-serif",glyph:true,units_per_em:d2.units_per_em,horiz_adv_x:1/d2.units_per_em*d2.horiz_adv_x,ascent:d2.ascent,descent:d2.descent,width:function(d9){var d7=0;var d5=d9.length;for(var d6=0;d6<d5;d6++){try{d7+=parseFloat(cQ.glyphLook(cQ.glyphTable[d3],d9[d6]).horiz_adv_x)}catch(d8){B.debug(d8)}}return d7/cQ.glyphTable[d3].units_per_em}}};cQ.createFont=function(d2,d3){return cQ.loadFont(d2,d3)};cQ.textFont=function(d2,d4){if(d4!==c){if(!d2.glyph){d2=f.get(d2.name,d4)}dR=d4}P=d2;R=P.name;aU=P.ascent;ds=P.descent;dY=P.leading;var d3=dP.$ensureContext();d3.font=P.css};cQ.textSize=function(d3){if(d3!==dR){P=f.get(R,d3);dR=d3;aU=P.ascent;ds=P.descent;dY=P.leading;var d2=dP.$ensureContext();d2.font=P.css}};cQ.textAscent=function(){return aU};cQ.textDescent=function(){return ds};cQ.textLeading=function(d2){dY=d2};cQ.textAlign=function(d3,d2){G=d3;cV=d2||0};function bm(d2){if(d2 instanceof String){return d2}if(typeof d2==="number"){if(d2===(0|d2)){return d2.toString()}return cQ.nf(d2,0,3)}if(d2===null||d2===c){return""}return d2.toString()}bJ.prototype.textWidth=function(d6){var d2=bm(d6).split(/\r?\n/g),d4=0;var d3,d5=d2.length;dZ.font=P.css;for(d3=0;d3<d5;++d3){d4=o.max(d4,P.measureTextWidth(d2[d3]))}return d4|0};bt.prototype.textWidth=function(d7){var d2=bm(d7).split(/\r?\n/g),d5=0;var d4,d6=d2.length;if(cy===c){cy=u.createElement("canvas")}var d3=cy.getContext("2d");d3.font=P.css;for(d4=0;d4<d6;++d4){d5=o.max(d5,d3.measureText(d2[d4]).width)}return d5|0};cQ.glyphLook=function(d2,d3){try{switch(d3){case"1":return d2.one;case"2":return d2.two;case"3":return d2.three;case"4":return d2.four;case"5":return d2.five;case"6":return d2.six;case"7":return d2.seven;case"8":return d2.eight;case"9":return d2.nine;case"0":return d2.zero;case" ":return d2.space;case"$":return d2.dollar;case"!":return d2.exclam;case'"':return d2.quotedbl;case"#":return d2.numbersign;case"%":return d2.percent;case"&":return d2.ampersand;case"'":return d2.quotesingle;case"(":return d2.parenleft;case")":return d2.parenright;case"*":return d2.asterisk;case"+":return d2.plus;case",":return d2.comma;case"-":return d2.hyphen;case".":return d2.period;case"/":return d2.slash;case"_":return d2.underscore;case":":return d2.colon;case";":return d2.semicolon;case"<":return d2.less;case"=":return d2.equal;case">":return d2.greater;case"?":return d2.question;case"@":return d2.at;case"[":return d2.bracketleft;case"\\":return d2.backslash;case"]":return d2.bracketright;case"^":return d2.asciicircum;case"`":return d2.grave;case"{":return d2.braceleft;case"|":return d2.bar;case"}":return d2.braceright;case"~":return d2.asciitilde;default:return d2[d3]}}catch(d4){B.debug(d4)}};bJ.prototype.text$line=function(ea,ed,ec,eb,d7){var d9=0,d8=0;if(!P.glyph){if(ea&&"fillText" in dZ){if(ak){dZ.fillStyle=cQ.color.toString(aS);ak=false}if(d7===39||d7===3){d9=P.measureTextWidth(ea);if(d7===39){d8=-d9}else{d8=-d9/2}}dZ.fillText(ea,ed+d8,ec)}}else{var d2=cQ.glyphTable[R];ax();dZ.translate(ed,ec+dR);if(d7===39||d7===3){d9=d2.width(ea);if(d7===39){d8=-d9}else{d8=-d9/2}}var ee=d2.units_per_em,d6=1/ee*dR;dZ.scale(d6,d6);for(var d3=0,d4=ea.length;d3<d4;d3++){try{cQ.glyphLook(d2,ea[d3]).draw()}catch(d5){B.debug(d5)}}cJ()}};bt.prototype.text$line=function(d9,ed,ec,ea,d7){if(cy===c){cy=u.createElement("canvas")}var d3=dZ;dZ=cy.getContext("2d");dZ.font=P.css;var d8=P.measureTextWidth(d9);cy.width=d8;cy.height=dR;dZ=cy.getContext("2d");dZ.font=P.css;dZ.textBaseline="top";bJ.prototype.text$line(d9,0,0,0,37);var d2=cy.width/cy.height;dZ=d3;dZ.bindTexture(dZ.TEXTURE_2D,bK);dZ.texImage2D(dZ.TEXTURE_2D,0,dZ.RGBA,dZ.RGBA,dZ.UNSIGNED_BYTE,cy);dZ.texParameteri(dZ.TEXTURE_2D,dZ.TEXTURE_MAG_FILTER,dZ.LINEAR);dZ.texParameteri(dZ.TEXTURE_2D,dZ.TEXTURE_MIN_FILTER,dZ.LINEAR);dZ.texParameteri(dZ.TEXTURE_2D,dZ.TEXTURE_WRAP_T,dZ.CLAMP_TO_EDGE);dZ.texParameteri(dZ.TEXTURE_2D,dZ.TEXTURE_WRAP_S,dZ.CLAMP_TO_EDGE);var d6=0;if(d7===39){d6=-d8}else{if(d7===3){d6=-d8/2}}var d4=new aH;var d5=dR*0.5;d4.translate(ed+d6-d5/2,ec-d5,ea);d4.scale(-d2*d5,-d5,d5);d4.translate(-1,-1,-1);d4.transpose();var eb=new aH;eb.scale(1,-1,1);eb.apply(dA.array());eb.transpose();dZ.useProgram(dH);c6("vertex2d",dH,"Vertex",3,cB);c6("aTextureCoord2d",dH,"aTextureCoord",2,V);dQ("uSampler2d",dH,"uSampler",[0]);dQ("picktype2d",dH,"picktype",1);a0("model2d",dH,"model",false,d4.array());a0("view2d",dH,"view",false,eb.array());dT("color2d",dH,"color",bg);dZ.bindBuffer(dZ.ELEMENT_ARRAY_BUFFER,K);dZ.drawElements(dZ.TRIANGLES,6,dZ.UNSIGNED_SHORT,0)};function a9(d5,d8,d7,d6){var ea,d4;if(d5.indexOf("\n")<0){ea=[d5];d4=1}else{ea=d5.split(/\r?\n/g);d4=ea.length}var d2=0;if(cV===101){d2=aU+ds}else{if(cV===3){d2=aU/2-(d4-1)*dY/2}else{if(cV===102){d2=-(ds+(d4-1)*dY)}}}for(var d3=0;d3<d4;++d3){var d9=ea[d3];dP.text$line(d9,d8,d7+d2,d6,G);d2+=dY}}function a4(ei,ed,ec,eh,ef,eb){if(ei.length===0||eh===0||ef===0){return}if(dR>ef){return}var ee=-1;var d6=0;var d2=0;var d8=[];for(var d7=0,ek=ei.length;d7<ek;d7++){var d9=ei[d7];var en=d9===" ";var eg=P.measureTextWidth(d9);if(d9!=="\n"&&d2+eg<=eh){if(en){ee=d7}d2+=eg}else{if(ee+1===d6){if(d7>0){ee=d7}else{return}}if(d9==="\n"){d8.push({text:ei.substring(d6,d7),width:d2});d6=d7+1}else{d8.push({text:ei.substring(d6,ee+1),width:d2});d6=ee+1}d2=0;d7=d6-1}}if(d6<ek){d8.push({text:ei.substring(d6),width:d2})}var em=1,ea=aU;if(G===3){em=eh/2}else{if(G===39){em=eh}}var ej=d8.length,d3=o.min(ej,o.floor(ef/dY));if(cV===101){ea=aU+ds}else{if(cV===3){ea=ef/2-dY*(d3/2-1)}else{if(cV===102){ea=ds+dY}}}var d4,d5,el;for(d4=0;d4<ej;d4++){el=d4*dY;if(ea+el>ef-ds){break}d5=d8[d4];dP.text$line(d5.text,ed+em,ec+ea+el,eb,G)}}cQ.text=function(){if(cC===5){return}if(arguments.length===3){a9(bm(arguments[0]),arguments[1],arguments[2],0)}else{if(arguments.length===4){a9(bm(arguments[0]),arguments[1],arguments[2],arguments[3])}else{if(arguments.length===5){a4(bm(arguments[0]),arguments[1],arguments[2],arguments[3],arguments[4],0)}else{if(arguments.length===6){a4(bm(arguments[0]),arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])}}}}};cQ.textMode=function(d2){cC=d2};cQ.loadGlyphs=function(d8){var ea,d9,d6,d4,eh,eg,ef,ei,ec,ej,ed,ee="[0-9\\-]+",eb;var d7=function(ep,eo){var em=0,el=[],ek,en=new RegExp(ep,"g");ek=el[em]=en.exec(eo);while(ek){em++;ek=el[em]=en.exec(eo)}return el};var d3=function(ep){var eq=d7("[A-Za-z][0-9\\- ]+|Z",ep);var eo=function(){ax();return dP.$ensureContext()};var em=function(){bf();c7();cJ()};eb="return {draw:function(){var curContext=beforePathDraw();curContext.beginPath();";ea=0;d9=0;d6=0;d4=0;eh=0;eg=0;ep=0;ei=0;ec="";ej=eq.length-1;for(var el=0;el<ej;el++){var ek=eq[el][0],en=d7(ee,ek);switch(ek[0]){case"M":ea=parseFloat(en[0][0]);d9=parseFloat(en[1][0]);eb+="curContext.moveTo("+ea+","+-d9+");";break;case"L":ea=parseFloat(en[0][0]);d9=parseFloat(en[1][0]);eb+="curContext.lineTo("+ea+","+-d9+");";break;case"H":ea=parseFloat(en[0][0]);eb+="curContext.lineTo("+ea+","+-d9+");";break;case"V":d9=parseFloat(en[0][0]);eb+="curContext.lineTo("+ea+","+-d9+");";break;case"T":eh=parseFloat(en[0][0]);eg=parseFloat(en[1][0]);if(ec==="Q"||ec==="T"){ep=o.sqrt(o.pow(ea-d6,2)+o.pow(d4-d9,2));ei=o.PI+o.atan2(d6-ea,d4-d9);d6=ea+o.sin(ei)*ep;d4=d9+o.cos(ei)*ep}else{d6=ea;d4=d9}eb+="curContext.quadraticCurveTo("+d6+","+-d4+","+eh+","+-eg+");";ea=eh;d9=eg;break;case"Q":d6=parseFloat(en[0][0]);d4=parseFloat(en[1][0]);eh=parseFloat(en[2][0]);eg=parseFloat(en[3][0]);eb+="curContext.quadraticCurveTo("+d6+","+-d4+","+eh+","+-eg+");";ea=eh;d9=eg;break;case"Z":eb+="curContext.closePath();";break}ec=ek[0]}eb+="afterPathDraw();";eb+="curContext.translate("+ed+",0);";eb+="}}";return(new Function("beforePathDraw","afterPathDraw",eb))(eo,em)};var d2=function(en){var em=en.getElementsByTagName("font");cQ.glyphTable[d8].horiz_adv_x=em[0].getAttribute("horiz-adv-x");var ep=en.getElementsByTagName("font-face")[0];cQ.glyphTable[d8].units_per_em=parseFloat(ep.getAttribute("units-per-em"));cQ.glyphTable[d8].ascent=parseFloat(ep.getAttribute("ascent"));cQ.glyphTable[d8].descent=parseFloat(ep.getAttribute("descent"));var er=en.getElementsByTagName("glyph"),el=er.length;for(var eq=0;eq<el;eq++){var ek=er[eq].getAttribute("unicode");var eo=er[eq].getAttribute("glyph-name");ed=er[eq].getAttribute("horiz-adv-x");if(ed===null){ed=cQ.glyphTable[d8].horiz_adv_x}ef=er[eq].getAttribute("d");if(ef!==c){eb=d3(ef);cQ.glyphTable[d8][eo]={name:eo,unicode:ek,horiz_adv_x:ed,draw:eb.draw}}}};var d5=function(){var em;try{em=u.implementation.createDocument("","",null)}catch(eo){B.debug(eo.message);return}try{em.async=false;em.load(d8);d2(em.getElementsByTagName("svg")[0])}catch(el){B.debug(el);try{var ek=new l.XMLHttpRequest;ek.open("GET",d8,false);ek.send(null);d2(ek.responseXML.documentElement)}catch(en){B.debug(el)}}};cQ.glyphTable[d8]={};d5(d8);return cQ.glyphTable[d8]};cQ.param=function(d4){var d3="data-processing-"+d4;if(X.hasAttribute(d3)){return X.getAttribute(d3)}for(var d5=0,d2=X.childNodes.length;d5<d2;++d5){var d6=X.childNodes.item(d5);if(d6.nodeType!==1||d6.tagName.toLowerCase()!=="param"){continue}if(d6.getAttribute("name")===d4){return d6.getAttribute("value")}}if(cK.params.hasOwnProperty(d4)){return cK.params[d4]}return null};function cF(d3){if(d3==="3D"){dP=new bt}else{if(d3==="2D"){dP=new bJ}else{dP=new b4}}for(var d2 in b4.prototype){if(b4.prototype.hasOwnProperty(d2)&&d2.indexOf("$")<0){cQ[d2]=dP[d2]}}dP.$init()}function cO(d2){return function(){cF("2D");return dP[d2].apply(this,arguments)}}b4.prototype.translate=cO("translate");b4.prototype.scale=cO("scale");b4.prototype.pushMatrix=cO("pushMatrix");b4.prototype.popMatrix=cO("popMatrix");b4.prototype.resetMatrix=cO("resetMatrix");b4.prototype.applyMatrix=cO("applyMatrix");b4.prototype.rotate=cO("rotate");b4.prototype.rotateZ=cO("rotateZ");b4.prototype.redraw=cO("redraw");b4.prototype.toImageData=cO("toImageData");b4.prototype.ambientLight=cO("ambientLight");b4.prototype.directionalLight=cO("directionalLight");b4.prototype.lightFalloff=cO("lightFalloff");b4.prototype.lightSpecular=cO("lightSpecular");b4.prototype.pointLight=cO("pointLight");b4.prototype.noLights=cO("noLights");b4.prototype.spotLight=cO("spotLight");b4.prototype.beginCamera=cO("beginCamera");b4.prototype.endCamera=cO("endCamera");b4.prototype.frustum=cO("frustum");b4.prototype.box=cO("box");b4.prototype.sphere=cO("sphere");b4.prototype.ambient=cO("ambient");b4.prototype.emissive=cO("emissive");b4.prototype.shininess=cO("shininess");b4.prototype.specular=cO("specular");b4.prototype.fill=cO("fill");b4.prototype.stroke=cO("stroke");b4.prototype.strokeWeight=cO("strokeWeight");b4.prototype.smooth=cO("smooth");b4.prototype.noSmooth=cO("noSmooth");b4.prototype.point=cO("point");b4.prototype.vertex=cO("vertex");b4.prototype.endShape=cO("endShape");b4.prototype.bezierVertex=cO("bezierVertex");b4.prototype.curveVertex=cO("curveVertex");b4.prototype.curve=cO("curve");b4.prototype.line=cO("line");b4.prototype.bezier=cO("bezier");b4.prototype.rect=cO("rect");b4.prototype.ellipse=cO("ellipse");b4.prototype.background=cO("background");b4.prototype.image=cO("image");b4.prototype.textWidth=cO("textWidth");b4.prototype.text$line=cO("text$line");b4.prototype.$ensureContext=cO("$ensureContext");b4.prototype.$newPMatrix=cO("$newPMatrix");b4.prototype.size=function(d2,d4,d3){cF(d3===2?"3D":"2D");cQ.size(d2,d4,d3)};b4.prototype.$init=h;bJ.prototype.$init=function(){cQ.size(cQ.width,cQ.height);dZ.lineCap="round";cQ.noSmooth();cQ.disableContextMenu()};bt.prototype.$init=function(){cQ.use3DContext=true};dj.prototype.$ensureContext=function(){return dZ};function dq(d3,d5){var d4=d3,d2=0,d6=0;cQ.pmouseX=cQ.mouseX;cQ.pmouseY=cQ.mouseY;if(d4.offsetParent){do{d2+=d4.offsetLeft;d6+=d4.offsetTop}while(!!(d4=d4.offsetParent))}d4=d3;do{d2-=d4.scrollLeft||0;d6-=d4.scrollTop||0}while(!!(d4=d4.parentNode));d2+=W;d6+=dg;d2+=aM;d6+=bQ;d2+=l.pageXOffset;d6+=l.pageYOffset;return{X:d2,Y:d6}}function aB(d2,d3){var d4=dq(d2,d3);cQ.mouseX=d3.pageX-d4.X;cQ.mouseY=d3.pageY-d4.Y}function co(d3){var d5=dq(d3.changedTouches[0].target,d3.changedTouches[0]),d2;for(d2=0;d2<d3.touches.length;d2++){var d7=d3.touches[d2];d7.offsetX=d7.pageX-d5.X;d7.offsetY=d7.pageY-d5.Y}for(d2=0;d2<d3.targetTouches.length;d2++){var d4=d3.targetTouches[d2];d4.offsetX=d4.pageX-d5.X;d4.offsetY=d4.pageY-d5.Y}for(d2=0;d2<d3.changedTouches.length;d2++){var d6=d3.changedTouches[d2];d6.offsetX=d6.pageX-d5.X;d6.offsetY=d6.pageY-d5.Y}return d3}bH(X,"touchstart",function(d4){X.setAttribute("style","-webkit-user-select: none");X.setAttribute("onclick","void(0)");X.setAttribute("style","-webkit-tap-highlight-color:rgba(0,0,0,0)");for(var d3=0,d2=an.length;d3<d2;d3++){var d5=an[d3].type;if(d5==="mouseout"||d5==="mousemove"||d5==="mousedown"||d5==="mouseup"||d5==="DOMMouseScroll"||d5==="mousewheel"||d5==="touchstart"){c8(an[d3])}}if(cQ.touchStart!==c||cQ.touchMove!==c||cQ.touchEnd!==c||cQ.touchCancel!==c){bH(X,"touchstart",function(d6){if(cQ.touchStart!==c){d6=co(d6);cQ.touchStart(d6)}});bH(X,"touchmove",function(d6){if(cQ.touchMove!==c){d6.preventDefault();d6=co(d6);cQ.touchMove(d6)}});bH(X,"touchend",function(d6){if(cQ.touchEnd!==c){d6=co(d6);cQ.touchEnd(d6)}});bH(X,"touchcancel",function(d6){if(cQ.touchCancel!==c){d6=co(d6);cQ.touchCancel(d6)}})}else{bH(X,"touchstart",function(d6){aB(X,d6.touches[0]);cQ.__mousePressed=true;cQ.mouseDragging=false;cQ.mouseButton=37;if(typeof cQ.mousePressed==="function"){cQ.mousePressed()}});bH(X,"touchmove",function(d6){d6.preventDefault();aB(X,d6.touches[0]);if(typeof cQ.mouseMoved==="function"&&!cQ.__mousePressed){cQ.mouseMoved()}if(typeof cQ.mouseDragged==="function"&&cQ.__mousePressed){cQ.mouseDragged();cQ.mouseDragging=true}});bH(X,"touchend",function(d6){cQ.__mousePressed=false;if(typeof cQ.mouseClicked==="function"&&!cQ.mouseDragging){cQ.mouseClicked()}if(typeof cQ.mouseReleased==="function"){cQ.mouseReleased()}})}X.dispatchEvent(d4)});(function(){var d2=true,d3=function(d4){d4.preventDefault();d4.stopPropagation()};cQ.disableContextMenu=function(){if(!d2){return}bH(X,"contextmenu",d3);d2=false};cQ.enableContextMenu=function(){if(d2){return}c8({elem:X,type:"contextmenu",fn:d3});d2=true}})();bH(X,"mousemove",function(d2){aB(X,d2);if(typeof cQ.mouseMoved==="function"&&!cQ.__mousePressed){cQ.mouseMoved()}if(typeof cQ.mouseDragged==="function"&&cQ.__mousePressed){cQ.mouseDragged();cQ.mouseDragging=true}});bH(X,"mouseout",function(d2){if(typeof cQ.mouseOut==="function"){cQ.mouseOut()}});bH(X,"mouseover",function(d2){aB(X,d2);if(typeof cQ.mouseOver==="function"){cQ.mouseOver()}});bH(X,"mousedown",function(d2){cQ.__mousePressed=true;cQ.mouseDragging=false;switch(d2.which){case 1:cQ.mouseButton=37;break;case 2:cQ.mouseButton=3;break;case 3:cQ.mouseButton=39;break}if(typeof cQ.mousePressed==="function"){cQ.mousePressed()}});bH(X,"mouseup",function(d2){cQ.__mousePressed=false;if(typeof cQ.mouseClicked==="function"&&!cQ.mouseDragging){cQ.mouseClicked()}if(typeof cQ.mouseReleased==="function"){cQ.mouseReleased()}});var ah=function(d2){var d3=0;if(d2.wheelDelta){d3=d2.wheelDelta/120;if(l.opera){d3=-d3}}else{if(d2.detail){d3=-d2.detail/3}}cQ.mouseScroll=d3;if(d3&&typeof cQ.mouseScrolled==="function"){cQ.mouseScrolled()}};bH(u,"DOMMouseScroll",ah);bH(u,"mousewheel",ah);if(typeof X==="string"){X=u.getElementById(X)}if(!X.getAttribute("tabindex")){X.setAttribute("tabindex",0)}function dv(d3){var d2=d3.which||d3.keyCode;switch(d2){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 d2}function cv(d3){var d4=d3.which||d3.keyCode;var d2=d3.shiftKey||d3.ctrlKey||d3.altKey||d3.metaKey;switch(d4){case 13:d4=d2?13:10;break;case 8:d4=d2?127:8;break}return new bI(d4)}function cL(d2){if(typeof d2.preventDefault==="function"){d2.preventDefault()}else{if(typeof d2.stopPropagation==="function"){d2.stopPropagation()}}return false}function dx(){var d2;for(d2 in aa){if(aa.hasOwnProperty(d2)){cQ.__keyPressed=true;return}}cQ.__keyPressed=false}function cr(){cQ.__keyPressed=false;aa=[];dz=null}function bi(d2,d3){aa[d2]=d3;dz=null;cQ.key=d3;cQ.keyCode=d2;cQ.keyPressed();cQ.keyCode=0;cQ.keyTyped();dx()}function ct(d3){var d2=dv(d3);if(d2===127){bi(d2,new bI(127));return}if(dO.indexOf(d2)<0){dz=d2;return}var d4=new bI(65535);cQ.key=d4;cQ.keyCode=d2;aa[d2]=d4;cQ.keyPressed();dz=null;dx();return cL(d3)}function dm(d3){if(dz===null){return}var d2=dz,d4=cv(d3);bi(d2,d4);return cL(d3)}function cj(d3){var d2=dv(d3),d4=aa[d2];if(d4===c){return}cQ.key=d4;cQ.keyCode=d2;cQ.keyReleased();delete aa[d2];dx()}if(!cP){if(a1 instanceof B.Sketch){cK=a1}else{if(typeof a1==="function"){cK=new B.Sketch(a1)}else{if(!a1){cK=new B.Sketch(function(){})}else{throw"PJS compile is not supported"}}}cQ.externals.sketch=cK;cF();X.onfocus=function(){cQ.focused=true};X.onblur=function(){cQ.focused=false;if(!cK.options.globalKeyEvents){cr()}};if(cK.options.pauseOnBlur){bH(l,"focus",function(){if(aw){cQ.loop()}});bH(l,"blur",function(){if(aw&&aq){cQ.noLoop();aw=true}cr()})}var aN=cK.options.globalKeyEvents?l:X;bH(aN,"keydown",ct);bH(aN,"keypress",dm);bH(aN,"keyup",cj);for(var cY in B.lib){if(B.lib.hasOwnProperty(cY)){if(B.lib[cY].hasOwnProperty("attach")){B.lib[cY].attach(cQ)}else{if(B.lib[cY] instanceof Function){B.lib[cY].call(this)}}}}var dt=100;var b0=function(d5){if(!(cK.imageCache.pending||f.preloading.pending(dt))){if(l.opera){var d4,d3,d2=cK.imageCache.operaCache;for(d4 in d2){if(d2.hasOwnProperty(d4)){d3=d2[d4];if(d3!==null){u.body.removeChild(d3)}delete d2[d4]}}}cK.attach(d5,b);cK.onLoad(d5);if(d5.setup){d5.setup();d5.resetMatrix();cK.onSetup()}M();if(d5.draw){if(!aw){d5.redraw()}else{d5.loop()}}}else{l.setTimeout(function(){b0(d5)},dt)}};v(this);b0(cQ)}else{cK=new B.Sketch;cF();cQ.size=function(d2,d4,d3){if(d3&&d3===2){cF("3D")}else{cF("2D")}cQ.size(d2,d4,d3)}}};B.debug=s;B.prototype=b;var E=function(){var M={},J="undefined",K="function",G=!1,L=!0,H=512,I="log";if(typeof tinylog!==J&&typeof tinylog[I]===K){M[I]=tinylog[I]}else{if(typeof u!==J&&!u.fake){(function(){var ah=u,af="div",V="style",Z="title",U={zIndex:10000,position:"fixed",bottom:"0px",width:"100%",height:"15%",fontFamily:"sans-serif",color:"#ccc",backgroundColor:"black"},X={position:"relative",fontFamily:"monospace",overflow:"auto",height:"100%",paddingTop:"5px"},ab={height:"5px",marginTop:"-5px",cursor:"n-resize",backgroundColor:"darkgrey"},ag={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"},R={minHeight:"16px"},Y={fontSize:"12px",margin:"0 8px 0 8px",maxWidth:"100%",whiteSpace:"pre-wrap",overflow:"auto"},W=ah.defaultView,ae=ah.documentElement,N=ae[V],P=function(){var aj=arguments.length,ai,al,ak;while(aj--){al=arguments[aj--];ai=arguments[aj][V];for(ak in al){if(al.hasOwnProperty(ak)){ai[ak]=al[ak]}}}},ac=function(ak,aj,ai){if(ak.addEventListener){ak.addEventListener(aj,ai,G)}else{if(ak.attachEvent){ak.attachEvent("on"+aj,ai)}}return[ak,aj,ai]},O=function(ak,aj,ai){if(ak.removeEventListener){ak.removeEventListener(aj,ai,G)}else{if(ak.detachEvent){ak.detachEvent("on"+aj,ai)}}},T=function(aj){var ai=aj.childNodes,ak=ai.length;while(ak--){aj.removeChild(ai.item(0))}},ad=function(aj,ai){return aj.appendChild(ai)},aa=function(ai){return ah.createElement(ai)},S=function(ai){return ah.createTextNode(ai)},Q=M[I]=function(ax){var ao,ap=N.paddingBottom,ak=aa(af),au=ak[V],av=ad(ak,aa(af)),am=ad(ak,aa(af)),al=ad(ak,aa(af)),aw=G,an=G,aj=G,aq=0,ai=function(){N.paddingBottom=ak.clientHeight+"px"},at=function(ay){var az=W.innerHeight,aA=av.clientHeight;if(ay<0){ay=0}else{if(ay+aA>az){ay=az-aA}}au.height=ay/az*100+"%";ai()},ar=[ac(ah,"mousemove",function(ay){if(aw){at(W.innerHeight-ay.clientY);am.scrollTop=aj}}),ac(ah,"mouseup",function(){if(aw){aw=aj=G}}),ac(av,"dblclick",function(ay){ay.preventDefault();if(an){at(an);an=G}else{an=ak.clientHeight;au.height="0px"}}),ac(av,"mousedown",function(ay){ay.preventDefault();aw=L;aj=am.scrollTop}),ac(av,"contextmenu",function(){aw=G}),ac(al,"click",function(){ao()})];ao=function(){var ay=ar.length;while(ay--){O.apply(M,ar[ay])}ae.removeChild(ak);N.paddingBottom=ap;T(am);T(ak);M[I]=Q};P(ak,U,am,X,av,ab,al,ag);al[Z]="Close Log";ad(al,S("\u2716"));av[Z]="Double-click to toggle log minimization";ae.insertBefore(ak,ae.firstChild);M[I]=function(aA){if(aq===H){am.removeChild(am.firstChild)}else{aq++}var az=ad(am,aa(af)),ay=ad(az,aa(af));az[Z]=(new Date).toLocaleTimeString();P(az,R,ay,Y);ad(ay,S(aA));am.scrollTop=am.scrollHeight};M[I](ax);ai()}})()}else{if(typeof print===K){M[I]=print}}}return M}();B.logger=E;B.version="1.3.6-API";B.lib={};B.registerLibrary=function(G,H){B.lib[G]=H;if(H.hasOwnProperty("init")){H.init(b)}};B.instances=z;B.getInstanceById=function(G){return z[g[G]]};B.Sketch=function(G){this.attachFunction=G;this.options={pauseOnBlur:false,globalKeyEvents:false};this.onLoad=h;this.onSetup=h;this.onPause=h;this.onLoop=h;this.onFrameStart=h;this.onFrameEnd=h;this.onExit=h;this.params={};this.imageCache={pending:0,images:{},operaCache:{},add:function(I,H){if(this.images[I]){return}if(!F){this.images[I]=null}if(!H){H=new Image;H.onload=function(K){return function(){K.pending--}}(this);this.pending++;H.src=I}this.images[I]=H;if(l.opera){var J=u.createElement("div");J.appendChild(H);J.style.position="absolute";J.style.opacity=0;J.style.width="1px";J.style.height="1px";if(!this.operaCache[I]){u.body.appendChild(J);this.operaCache[I]=J}}}};this.sourceCode=undefined;this.attach=function(I){if(typeof this.attachFunction==="function"){this.attachFunction(I)}else{if(this.sourceCode){var H=(new Function("return ("+this.sourceCode+");"))();H(I);this.attachFunction=H}else{throw"Unable to attach sketch to the processing instance"}}}};if(F){l.Processing=B}else{this.Processing=B}})(window,window.document,Math); |