diff --git a/config.jsonc b/config.jsonc index e18f704c..6004a21d 100644 --- a/config.jsonc +++ b/config.jsonc @@ -706,6 +706,11 @@ "aliases": [], "categories": [] }, + "Shadow Fight": { + "path": "shadow-fight", + "aliases": [], + "categories": [] + }, "Slope": { "path": "slope", "aliases": [], diff --git a/games/shadow-fight/appmanifest.json b/games/shadow-fight/appmanifest.json new file mode 100644 index 00000000..12530078 --- /dev/null +++ b/games/shadow-fight/appmanifest.json @@ -0,0 +1,36 @@ +{ + "name": "Shadow_Fight_TWP", + "short_name": "Shadow_Fight_TWP", + "description": "street fighter style template", + "start_url": "index.html", + "display": "fullscreen", + "orientation": "any", + "background_color": "#ffffff", + "icons": [ + { + "src": "icons/icon-16.png", + "sizes": "16x16", + "type": "image/png" + }, + { + "src": "icons/icon-32.png", + "sizes": "32x32", + "type": "image/png" + }, + { + "src": "icons/icon-114.png", + "sizes": "114x114", + "type": "image/png" + }, + { + "src": "icons/icon-128.png", + "sizes": "128x128", + "type": "image/png" + }, + { + "src": "icons/icon-256.png", + "sizes": "256x256", + "type": "image/png" + } + ] +} \ No newline at end of file diff --git a/games/shadow-fight/box2d.wasm b/games/shadow-fight/box2d.wasm new file mode 100644 index 00000000..106566ad Binary files /dev/null and b/games/shadow-fight/box2d.wasm differ diff --git a/games/shadow-fight/box2d.wasm.js b/games/shadow-fight/box2d.wasm.js new file mode 100644 index 00000000..630d78b3 --- /dev/null +++ b/games/shadow-fight/box2d.wasm.js @@ -0,0 +1,577 @@ +self.Box2DWasmModule = function(Box2D) { + Box2D = Box2D || {}; + var Module = Box2D; + +var b;b||(b=eval("(function() { try { return Box2D || {} } catch(e) { return {} } })()"));var aa={},ba;for(ba in b)b.hasOwnProperty(ba)&&(aa[ba]=b[ba]);var ca=!1,da=!1,ea=!1,fa=!1; +if(b.ENVIRONMENT)if("WEB"===b.ENVIRONMENT)ca=!0;else if("WORKER"===b.ENVIRONMENT)da=!0;else if("NODE"===b.ENVIRONMENT)ea=!0;else if("SHELL"===b.ENVIRONMENT)fa=!0;else throw Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");else ca="object"===typeof window,da="function"===typeof importScripts,ea="object"===typeof process&&"function"===typeof require&&!ca&&!da,fa=!ca&&!ea&&!da; +if(ea){b.print||(b.print=console.log);b.printErr||(b.printErr=console.warn);var ga,ha;b.read=function(a,c){ga||(ga=require("fs"));ha||(ha=require("path"));a=ha.normalize(a);var d=ga.readFileSync(a);return c?d:d.toString()};b.readBinary=function(a){a=b.read(a,!0);a.buffer||(a=new Uint8Array(a));assert(a.buffer);return a};b.load=function(a){ia(read(a))};b.thisProgram||(b.thisProgram=1 0) var gc = undefined");else if(ca||da)b.read=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.send(null);return c.responseText},da&&(b.readBinary=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}), +b.readAsync=function(a,c,d){var e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onload=function(){200==e.status||0==e.status&&e.response?c(e.response):d()};e.onerror=d;e.send(null)},"undefined"!=typeof arguments&&(b.arguments=arguments),"undefined"!==typeof console?(b.print||(b.print=function(a){console.log(a)}),b.printErr||(b.printErr=function(a){console.warn(a)})):b.print||(b.print=function(){}),da&&(b.load=importScripts),"undefined"===typeof b.setWindowTitle&&(b.setWindowTitle= +function(a){document.title=a});else throw"Unknown runtime environment. Where are we?";function ia(a){eval.call(null,a)}!b.load&&b.read&&(b.load=function(a){ia(b.read(a))});b.print||(b.print=function(){});b.printErr||(b.printErr=b.print);b.arguments||(b.arguments=[]);b.thisProgram||(b.thisProgram="./this.program");b.quit||(b.quit=function(a,c){throw c;});b.print=b.print;b.h=b.printErr;b.preRun=[];b.postRun=[];for(ba in aa)aa.hasOwnProperty(ba)&&(b[ba]=aa[ba]); +var aa=void 0,f={f:function(a){return tempRet0=a},H:function(){return tempRet0},L:function(){return ka},K:function(a){ka=a},s:function(a){switch(a){case "i1":case "i8":return 1;case "i16":return 2;case "i32":return 4;case "i64":return 8;case "float":return 4;case "double":return 8;default:return"*"===a[a.length-1]?f.j:"i"===a[0]?(a=parseInt(a.substr(1)),assert(0===a%8),a/8):0}},F:function(a){return Math.max(f.s(a),f.j)},M:16,aa:function(a,c){"double"===c||"i64"===c?a&7&&(assert(4===(a&7)),a+=4):assert(0=== +(a&3));return a},U:function(a,c,d){return d||"i64"!=a&&"double"!=a?a?Math.min(c||(a?f.F(a):0),f.j):Math.min(c,8):8},l:function(a,c,d){return d&&d.length?b["dynCall_"+a].apply(null,[c].concat(d)):b["dynCall_"+a].call(null,c)},d:[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],v:function(a){for(var c=0;c>2];a=(c+a+15|0)&-16;ma[oa>>2]=a;return a>=pa&&!qa()?(ma[oa>>2]=c,0):c},p:function(a,c){return Math.ceil(a/(c?c:16))*(c?c:16)},$:function(a,c,d){return d?+(a>>>0)+4294967296*+(c>>>0):+(a>>>0)+4294967296*+(c|0)},i:1024,j:4,N:0};f.addFunction=f.v;f.removeFunction=f.J;var ra=0;function assert(a,c){a||ta("Assertion failed: "+c)} +function ua(a){var c;c="i32";"*"===c.charAt(c.length-1)&&(c="i32");switch(c){case "i1":return va[a>>0];case "i8":return va[a>>0];case "i16":return ya[a>>1];case "i32":return ma[a>>2];case "i64":return ma[a>>2];case "float":return za[a>>2];case "double":return Aa[a>>3];default:ta("invalid type for setValue: "+c)}return null} +function Ba(a,c,d){var e,g,l;"number"===typeof a?(g=!0,l=a):(g=!1,l=a.length);var m="string"===typeof c?c:null,D;4==d?D=e:D=["function"===typeof Ca?Ca:f.u,f.t,f.u,f.D][void 0===d?2:d](Math.max(l,m?1:c.length));if(g){e=D;assert(0==(D&3));for(a=D+(l&-4);e>2]=0;for(a=D+l;e>0]=0;return D}if("i8"===m)return a.subarray||a.slice?Da.set(a,D):Da.set(new Uint8Array(a),D),D;e=0;for(var na,wa;e>0]=G;break;case "i8":va[g>>0]=G;break;case "i16":ya[g>>1]=G;break;case "i32":ma[g>>2]=G;break;case "i64":tempI64=[G>>>0,(tempDouble=G,1<=+Ea(tempDouble)?0>>0:~~+Ia((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)];ma[g>>2]=tempI64[0];ma[g+4>>2]=tempI64[1];break;case "float":za[g>>2]=G;break;case "double":Aa[g>>3]=G;break;default:ta("invalid type for setValue: "+ +Ga)}wa!==d&&(na=f.s(d),wa=d);e+=na}}return D}function Ja(a){var c;if(0===c||!a)return"";for(var d=0,e,g=0;;){e=Da[a+g>>0];d|=e;if(0==e&&!c)break;g++;if(c&&g==c)break}c||(c=g);e="";if(128>d){for(;0=l&&(l=65536+((l&1023)<<10)|a.charCodeAt(++g)&1023);if(127>=l){if(d>=e)break;c[d++]=l}else{if(2047>=l){if(d+1>=e)break;c[d++]=192|l>>6}else{if(65535>=l){if(d+2>=e)break;c[d++]=224|l>>12}else{if(2097151>=l){if(d+3>=e)break;c[d++]=240|l>>18}else{if(67108863>=l){if(d+4>=e)break;c[d++]=248|l>>24}else{if(d+5>=e)break;c[d++]=252|l>>30;c[d++]=128|l>>24&63}c[d++]=128|l>>18&63}c[d++]=128|l>>12&63}c[d++]= +128|l>>6&63}c[d++]=128|l&63}}c[d]=0}}function Oa(a){for(var c=0,d=0;d=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++d)&1023);127>=e?++c:c=2047>=e?c+2:65535>=e?c+3:2097151>=e?c+4:67108863>=e?c+5:c+6}return c}"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le"); +function Pa(a){return a.replace(/__Z[\w\d_]+/g,function(a){var d;a:{var e=b.___cxa_demangle||b.__cxa_demangle;if(e)try{var g=a.substr(1),l=Oa(g)+1,m=Ca(l);La(g,Da,m,l);var D=Ca(4),na=e(m,0,0,D);if(0===ua(D)&&na){d=Ja(na);break a}}catch(wa){}finally{m&&Qa(m),D&&Qa(D),na&&Qa(na)}else f.g("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");d=a}return a===d?a:a+" ["+d+"]"})} +function Ra(){var a;a:{a=Error();if(!a.stack){try{throw Error(0);}catch(c){a=c}if(!a.stack){a="(no stack trace available)";break a}}a=a.stack.toString()}b.extraStackTrace&&(a+="\n"+b.extraStackTrace());return Pa(a)}var Sa=65536,Ua=16777216,Va=16777216;function Wa(a,c){0>2]>c)return!1;var d=pa;for(pa=Math.max(pa,Va);pa>2];)536870912>=pa?pa=Wa(2*pa,a):pa=Math.min(Wa((3*pa+2147483648)/4,a),c);a=b.reallocBuffer(pa);if(!a||a.byteLength!=pa)return pa=d,!1;b.buffer=buffer=a;Za();return!0}var eb; +try{eb=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),eb(new ArrayBuffer(4))}catch(fb){eb=function(a){return a.byteLength}}var gb=b.TOTAL_STACK||5242880,pa=b.TOTAL_MEMORY||16777216;pa>>16)*e+d*(c>>>16)<<16)|0});Math.Y=Math.imul; +if(!Math.fround){var sb=new Float32Array(1);Math.fround=function(a){sb[0]=a;return sb[0]}}Math.S=Math.fround;Math.clz32||(Math.clz32=function(a){a=a>>>0;for(var c=0;32>c;c++)if(a&1<<31-c)return c;return 32});Math.P=Math.clz32;Math.trunc||(Math.trunc=function(a){return 0>a?Math.ceil(a):Math.floor(a)});Math.trunc=Math.trunc;var Ea=Math.abs,Ia=Math.ceil,Ha=Math.floor,Fa=Math.min,tb=0,vb=null,wb=null;function xb(){tb++;b.monitorRunDependencies&&b.monitorRunDependencies(tb)} +function yb(){tb--;b.monitorRunDependencies&&b.monitorRunDependencies(tb);if(0==tb&&(null!==vb&&(clearInterval(vb),vb=null),wb)){var a=wb;wb=null;a()}}b.preloadedImages={};b.preloadedAudios={};var zb=null; +(function(a){function c(c){c=Wa(c,a.usingWasm?Sa:Ua);var d=a.buffer,e=d.byteLength;if(a.usingWasm)try{return-1!==a.wasmMemory.grow((c-e)/65536)?a.buffer=a.wasmMemory.buffer:null}catch(g){return null}else return lb.__growWasmMemory((c-e)/65536),a.buffer!==d?a.buffer:null}function d(a,c){var d=Ta;if(0>a.indexOf("."))d=(d||{})[a];else var e=a.split("."),d=(d||{})[e[0]],d=(d||{})[e[1]];c&&(d=(d||{})[c]);void 0===d&&ta("bad lookupImport to ("+a+")."+c);return d}function e(c){var d=a.buffer;c.byteLength< +d.byteLength&&a.printErr("the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here");var d=new Int8Array(d),e=new Int8Array(c);zb||d.set(e.subarray(a.STATIC_BASE,a.STATIC_BASE+a.STATIC_BUMP),a.STATIC_BASE);e.set(d);b.buffer=buffer=c;Za()}function g(){try{var c;if(a.wasmBinary)c=a.wasmBinary,c=new Uint8Array(c);else if(a.readBinary)c=a.readBinary(G);else throw"on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)"; +return c}catch(d){ta(d)}}function l(){return a.wasmBinary||"function"!==typeof fetch?new Promise(function(a){a(g())}):fetch(G,{Q:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+G+"'";return a.arrayBuffer()})}function m(c,d,e){if("function"!==typeof a.asm||a.asm===Ma)a.asmPreload?a.asm=a.asmPreload:eval(a.read(Ga));return"function"!==typeof a.asm?(a.printErr("asm evalling did not set the module properly"),!1):a.asm(c,d,e)}function D(c,d){function g(c){lb=c.exports; +lb.memory&&e(lb.memory);a.asm=lb;a.usingWasm=!0;yb()}if("object"!==typeof WebAssembly)return a.printErr("no native wasm support detected"),!1;if(!(a.wasmMemory instanceof WebAssembly.Memory))return a.printErr("no native wasm Memory in use"),!1;d.memory=a.wasmMemory;Ta.global={NaN:NaN,Infinity:Infinity};Ta["global.Math"]=c.Math;Ta.env=d;xb();if(a.instantiateWasm)try{return a.instantiateWasm(Ta,g)}catch(m){return a.printErr("Module.instantiateWasm callback failed with error: "+m),!1}l().then(function(a){return WebAssembly.instantiate(a, +Ta)}).then(function(a){g(a.instance)}).catch(function(c){a.printErr("failed to asynchronously prepare wasm: "+c);ta(c)});return{}}var na=a.wasmJSMethod||"native-wasm";a.wasmJSMethod=na;var wa=a.wasmTextFile||"Box2D_v2.3.1_min.wasm.wast",G=a.wasmBinaryFile||"Box2D_v2.3.1_min.wasm.wasm",Ga=a.asmjsCodeFile||"Box2D_v2.3.1_min.wasm.temp.asm.js";"function"===typeof a.locateFile&&(wa=a.locateFile(wa),G=a.locateFile(G),Ga=a.locateFile(Ga));var Ta={global:null,env:null,asm2wasm:{"f64-rem":function(a,c){return a% +c},"f64-to-int":function(a){return a|0},"i32s-div":function(a,c){return(a|0)/(c|0)|0},"i32u-div":function(a,c){return(a>>>0)/(c>>>0)>>>0},"i32s-rem":function(a,c){return(a|0)%(c|0)|0},"i32u-rem":function(a,c){return(a>>>0)%(c>>>0)>>>0},"debugger":function(){debugger}},parent:a},lb=null;a.asmPreload=a.asm;var ub=a.reallocBuffer;a.reallocBuffer=function(a){return"asmjs"===qc?ub(a):c(a)};var qc="";a.asm=function(c,l,G){if(!l.table){var Ma=a.wasmTableSize;void 0===Ma&&(Ma=1024);var mb=a.wasmMaxTableSize; +l.table="object"===typeof WebAssembly&&"function"===typeof WebAssembly.Table?void 0!==mb?new WebAssembly.Table({initial:Ma,maximum:mb,element:"anyfunc"}):new WebAssembly.Table({initial:Ma,element:"anyfunc"}):Array(Ma);a.wasmTable=l.table}l.memoryBase||(l.memoryBase=a.STATIC_BASE);l.tableBase||(l.tableBase=0);for(var V,Ma=na.split(","),mb=0;mb>2]}var Lb={},Mb={};b._sbrk=Nb;var Ob=1; +function Pb(){var a=Eb;if(!a)return(f.f(0),0)|0;var c=Gb[a],d=c.type;if(!d)return(f.f(0),a)|0;var e=Array.prototype.slice.call(arguments);b.___cxa_is_pointer_type(d);Pb.buffer||(Pb.buffer=Ca(4));ma[Pb.buffer>>2]=a;for(var a=Pb.buffer,g=0;g>2],c.w=a,(f.f(e[g]),a)|0;a=ma[a>>2];return(f.f(d),a)|0}b._llvm_bswap_i32=Qb; +function Rb(a,c){Jb=c;try{var d=Kb(),e=Kb(),g=Kb(),l=0;Rb.buffer||(Rb.e=[null,[],[]],Rb.q=function(a,c){var d=Rb.e[a];assert(d);if(0===c||10===c){var e=1===a?b.print:b.printErr,g;a:{for(var l=g=0;d[l];)++l;if(16m?l+=String.fromCharCode(m):(m-=65536,l+=String.fromCharCode(55296|m>>10,56320|m&1023)))):l+=String.fromCharCode(m)}}e(g);d.length=0}else d.push(c)});for(var m=0;m>2],na=ma[e+(8*m+4)>>2],wa=0;wa>2]=cb;b.wasmTableSize=1152;b.wasmMaxTableSize=1152;b.A={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:Infinity,byteLength:eb}; +b.B={abort:ta,assert:assert,enlargeMemory:qa,getTotalMemory:function(){return pa},abortOnCannotGrowMemory:function(){ta("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+pa+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")},invoke_iiii:function(a,c,d,e){try{return b.dynCall_iiii(a,c,d,e)}catch(g){if("number"!== +typeof g&&"longjmp"!==g)throw g;b.setThrew(1,0)}},jsCall_iiii:function(a,c,d,e){return f.d[a](c,d,e)},invoke_viifii:function(a,c,d,e,g,l){try{b.dynCall_viifii(a,c,d,e,g,l)}catch(m){if("number"!==typeof m&&"longjmp"!==m)throw m;b.setThrew(1,0)}},jsCall_viifii:function(a,c,d,e,g,l){f.d[a](c,d,e,g,l)},invoke_viiiii:function(a,c,d,e,g,l){try{b.dynCall_viiiii(a,c,d,e,g,l)}catch(m){if("number"!==typeof m&&"longjmp"!==m)throw m;b.setThrew(1,0)}},jsCall_viiiii:function(a,c,d,e,g,l){f.d[a](c,d,e,g,l)},invoke_vi:function(a, +c){try{b.dynCall_vi(a,c)}catch(d){if("number"!==typeof d&&"longjmp"!==d)throw d;b.setThrew(1,0)}},jsCall_vi:function(a,c){f.d[a](c)},invoke_vii:function(a,c,d){try{b.dynCall_vii(a,c,d)}catch(e){if("number"!==typeof e&&"longjmp"!==e)throw e;b.setThrew(1,0)}},jsCall_vii:function(a,c,d){f.d[a](c,d)},invoke_ii:function(a,c){try{return b.dynCall_ii(a,c)}catch(d){if("number"!==typeof d&&"longjmp"!==d)throw d;b.setThrew(1,0)}},jsCall_ii:function(a,c){return f.d[a](c)},invoke_fif:function(a,c,d){try{return b.dynCall_fif(a, +c,d)}catch(e){if("number"!==typeof e&&"longjmp"!==e)throw e;b.setThrew(1,0)}},jsCall_fif:function(a,c,d){return f.d[a](c,d)},invoke_viii:function(a,c,d,e){try{b.dynCall_viii(a,c,d,e)}catch(g){if("number"!==typeof g&&"longjmp"!==g)throw g;b.setThrew(1,0)}},jsCall_viii:function(a,c,d,e){f.d[a](c,d,e)},invoke_viifi:function(a,c,d,e,g){try{b.dynCall_viifi(a,c,d,e,g)}catch(l){if("number"!==typeof l&&"longjmp"!==l)throw l;b.setThrew(1,0)}},jsCall_viifi:function(a,c,d,e,g){f.d[a](c,d,e,g)},invoke_v:function(a){try{b.dynCall_v(a)}catch(c){if("number"!== +typeof c&&"longjmp"!==c)throw c;b.setThrew(1,0)}},jsCall_v:function(a){f.d[a]()},invoke_viif:function(a,c,d,e){try{b.dynCall_viif(a,c,d,e)}catch(g){if("number"!==typeof g&&"longjmp"!==g)throw g;b.setThrew(1,0)}},jsCall_viif:function(a,c,d,e){f.d[a](c,d,e)},invoke_viiiiii:function(a,c,d,e,g,l,m){try{b.dynCall_viiiiii(a,c,d,e,g,l,m)}catch(D){if("number"!==typeof D&&"longjmp"!==D)throw D;b.setThrew(1,0)}},jsCall_viiiiii:function(a,c,d,e,g,l,m){f.d[a](c,d,e,g,l,m)},invoke_iii:function(a,c,d){try{return b.dynCall_iii(a, +c,d)}catch(e){if("number"!==typeof e&&"longjmp"!==e)throw e;b.setThrew(1,0)}},jsCall_iii:function(a,c,d){return f.d[a](c,d)},invoke_iiiiii:function(a,c,d,e,g,l){try{return b.dynCall_iiiiii(a,c,d,e,g,l)}catch(m){if("number"!==typeof m&&"longjmp"!==m)throw m;b.setThrew(1,0)}},jsCall_iiiiii:function(a,c,d,e,g,l){return f.d[a](c,d,e,g,l)},invoke_fiiiif:function(a,c,d,e,g,l){try{return b.dynCall_fiiiif(a,c,d,e,g,l)}catch(m){if("number"!==typeof m&&"longjmp"!==m)throw m;b.setThrew(1,0)}},jsCall_fiiiif:function(a, +c,d,e,g,l){return f.d[a](c,d,e,g,l)},invoke_viiii:function(a,c,d,e,g){try{b.dynCall_viiii(a,c,d,e,g)}catch(l){if("number"!==typeof l&&"longjmp"!==l)throw l;b.setThrew(1,0)}},jsCall_viiii:function(a,c,d,e,g){f.d[a](c,d,e,g)},_emscripten_asm_const_iiiii:function(a,c,d,e,g){return Ab[a](c,d,e,g)},_emscripten_asm_const_diiiid:function(a,c,d,e,g,l){return Ab[a](c,d,e,g,l)},_pthread_key_create:function(a){if(0==a)return 22;ma[a>>2]=Ob;Mb[Ob]=0;Ob++;return 0},_abort:function(){b.abort()},___gxx_personality_v0:function(){}, +_emscripten_asm_const_iiidii:function(a,c,d,e,g,l){return Ab[a](c,d,e,g,l)},___assert_fail:function(a,c,d,e){ra=!0;throw"Assertion failed: "+Ja(a)+", at: "+[c?Ja(c):"unknown filename",d,e?Ja(e):"unknown function"]+" at "+Ra();},__ZSt18uncaught_exceptionv:Db,___setErrNo:function(a){b.___errno_location&&(ma[b.___errno_location()>>2]=a);return a},___cxa_begin_catch:function(a){var c=Gb[a];c&&!c.C&&(c.C=!0,Db.e--);c&&(c.da=!1);Fb.push(a);a:{if(a&&!Gb[a])for(var d in Gb)if(Gb[d].w===a){c=d;break a}c=a}c&& +Gb[c].ba++;return a},_emscripten_memcpy_big:function(a,c,d){Da.set(Da.subarray(c,c+d),a);return a},___resumeException:function(a){Eb||(Eb=a);throw a+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.";},___cxa_find_matching_catch:Pb,_pthread_getspecific:function(a){return Mb[a]||0},_pthread_once:Hb,___syscall54:function(a,c){Jb=c;return 0},_emscripten_asm_const_iii:function(a,c,d){return Ab[a](c, +d)},_emscripten_asm_const_iiidi:function(a,c,d,e,g){return Ab[a](c,d,e,g)},_pthread_setspecific:function(a,c){if(!(a in Mb))return 22;Mb[a]=c;return 0},_emscripten_asm_const_iiii:function(a,c,d,e){return Ab[a](c,d,e)},___syscall6:function(a,c){Jb=c;try{var d=Lb.G();FS.close(d);return 0}catch(e){return"undefined"!==typeof FS&&e instanceof FS.o||ta(e),-e.r}},___syscall140:function(a,c){Jb=c;try{var d=Lb.G();Kb();var e=Kb(),g=Kb(),l=Kb();FS.Z(d,e,l);ma[g>>2]=d.position;d.I&&0===e&&0===l&&(d.I=null); +return 0}catch(m){return"undefined"!==typeof FS&&m instanceof FS.o||ta(m),-m.r}},___cxa_pure_virtual:function(){ra=!0;throw"Pure virtual function called!";},___syscall146:Rb,DYNAMICTOP_PTR:oa,tempDoublePtr:Bb,ABORT:ra,STACKTOP:ka,STACK_MAX:bb};var Sb=b.asm(b.A,b.B,buffer);b.asm=Sb; +var Tb=b._emscripten_bind_b2WheelJoint_GetSpringDampingRatio_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetSpringDampingRatio_0.apply(null,arguments)},Ub=b._emscripten_bind_b2ContactEdge_set_next_1=function(){return b.asm._emscripten_bind_b2ContactEdge_set_next_1.apply(null,arguments)},Vb=b._emscripten_bind_b2ChainShape_get_m_count_0=function(){return b.asm._emscripten_bind_b2ChainShape_get_m_count_0.apply(null,arguments)},Wb=b._emscripten_bind_b2PrismaticJointDef_get_motorSpeed_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_motorSpeed_0.apply(null, +arguments)},Xb=b._emscripten_bind_b2PulleyJoint_SetUserData_1=function(){return b.asm._emscripten_bind_b2PulleyJoint_SetUserData_1.apply(null,arguments)},Yb=b._emscripten_bind_b2Shape_ComputeAABB_3=function(){return b.asm._emscripten_bind_b2Shape_ComputeAABB_3.apply(null,arguments)},Zb=b._emscripten_bind_b2FrictionJointDef_set_userData_1=function(){return b.asm._emscripten_bind_b2FrictionJointDef_set_userData_1.apply(null,arguments)},$b=b._emscripten_bind_b2MouseJoint_IsActive_0=function(){return b.asm._emscripten_bind_b2MouseJoint_IsActive_0.apply(null, +arguments)},ac=b._emscripten_bind_b2World_IsLocked_0=function(){return b.asm._emscripten_bind_b2World_IsLocked_0.apply(null,arguments)},bc=b._emscripten_bind_b2Draw_GetFlags_0=function(){return b.asm._emscripten_bind_b2Draw_GetFlags_0.apply(null,arguments)},cc=b._emscripten_bind_b2FrictionJoint_IsActive_0=function(){return b.asm._emscripten_bind_b2FrictionJoint_IsActive_0.apply(null,arguments)},dc=b._emscripten_bind_b2Color_set_g_1=function(){return b.asm._emscripten_bind_b2Color_set_g_1.apply(null, +arguments)},ec=b._emscripten_bind_b2PolygonShape_RayCast_4=function(){return b.asm._emscripten_bind_b2PolygonShape_RayCast_4.apply(null,arguments)},fc=b._emscripten_bind_b2World_GetTreeBalance_0=function(){return b.asm._emscripten_bind_b2World_GetTreeBalance_0.apply(null,arguments)},gc=b._emscripten_bind_b2ChainShape_get_m_vertices_0=function(){return b.asm._emscripten_bind_b2ChainShape_get_m_vertices_0.apply(null,arguments)},hc=b._emscripten_bind_JSDraw_DrawSolidCircle_4=function(){return b.asm._emscripten_bind_JSDraw_DrawSolidCircle_4.apply(null, +arguments)},ic=b._emscripten_bind_b2RevoluteJoint_GetLocalAnchorA_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetLocalAnchorA_0.apply(null,arguments)},jc=b._emscripten_bind_b2FixtureDef_get_filter_0=function(){return b.asm._emscripten_bind_b2FixtureDef_get_filter_0.apply(null,arguments)},kc=b._emscripten_bind_b2FrictionJointDef_get_type_0=function(){return b.asm._emscripten_bind_b2FrictionJointDef_get_type_0.apply(null,arguments)},lc=b._emscripten_bind_b2MotorJointDef_set_type_1=function(){return b.asm._emscripten_bind_b2MotorJointDef_set_type_1.apply(null, +arguments)},mc=b._emscripten_bind_b2FixtureDef_set_userData_1=function(){return b.asm._emscripten_bind_b2FixtureDef_set_userData_1.apply(null,arguments)},nc=b._emscripten_bind_b2EdgeShape_set_m_hasVertex3_1=function(){return b.asm._emscripten_bind_b2EdgeShape_set_m_hasVertex3_1.apply(null,arguments)},oc=b._emscripten_bind_b2JointEdge_set_joint_1=function(){return b.asm._emscripten_bind_b2JointEdge_set_joint_1.apply(null,arguments)},pc=b._emscripten_bind_b2Fixture___destroy___0=function(){return b.asm._emscripten_bind_b2Fixture___destroy___0.apply(null, +arguments)},rc=b._emscripten_bind_b2World_SetWarmStarting_1=function(){return b.asm._emscripten_bind_b2World_SetWarmStarting_1.apply(null,arguments)},sc=b._emscripten_bind_JSDraw_DrawCircle_3=function(){return b.asm._emscripten_bind_JSDraw_DrawCircle_3.apply(null,arguments)},tc=b._emscripten_bind_b2WeldJoint_IsActive_0=function(){return b.asm._emscripten_bind_b2WeldJoint_IsActive_0.apply(null,arguments)},uc=b._emscripten_bind_b2DestructionListener___destroy___0=function(){return b.asm._emscripten_bind_b2DestructionListener___destroy___0.apply(null, +arguments)},vc=b._emscripten_bind_b2BodyDef_set_type_1=function(){return b.asm._emscripten_bind_b2BodyDef_set_type_1.apply(null,arguments)},wc=b._emscripten_bind_b2ChainShape_ComputeAABB_3=function(){return b.asm._emscripten_bind_b2ChainShape_ComputeAABB_3.apply(null,arguments)},xc=b._emscripten_bind_b2PulleyJoint_GetUserData_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetUserData_0.apply(null,arguments)},yc=b._emscripten_bind_b2WeldJoint_GetReactionTorque_1=function(){return b.asm._emscripten_bind_b2WeldJoint_GetReactionTorque_1.apply(null, +arguments)},zc=b._emscripten_bind_b2MotorJointDef_get_maxForce_0=function(){return b.asm._emscripten_bind_b2MotorJointDef_get_maxForce_0.apply(null,arguments)},Ac=b._emscripten_bind_b2DistanceJointDef_get_userData_0=function(){return b.asm._emscripten_bind_b2DistanceJointDef_get_userData_0.apply(null,arguments)},Bc=b._emscripten_bind_b2BodyDef_get_position_0=function(){return b.asm._emscripten_bind_b2BodyDef_get_position_0.apply(null,arguments)},Cc=b._emscripten_bind_b2RevoluteJointDef_set_userData_1= +function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_userData_1.apply(null,arguments)},Dc=b._emscripten_bind_b2WorldManifold_b2WorldManifold_0=function(){return b.asm._emscripten_bind_b2WorldManifold_b2WorldManifold_0.apply(null,arguments)},Ec=b._emscripten_bind_b2WheelJointDef_get_collideConnected_0=function(){return b.asm._emscripten_bind_b2WheelJointDef_get_collideConnected_0.apply(null,arguments)},Fc=b._emscripten_bind_b2MouseJointDef_set_userData_1=function(){return b.asm._emscripten_bind_b2MouseJointDef_set_userData_1.apply(null, +arguments)};b.stackSave=function(){return b.asm.stackSave.apply(null,arguments)}; +var Gc=b._emscripten_bind_b2FixtureDef_set_restitution_1=function(){return b.asm._emscripten_bind_b2FixtureDef_set_restitution_1.apply(null,arguments)},Hc=b._emscripten_bind_b2RevoluteJoint_GetUserData_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetUserData_0.apply(null,arguments)},Ic=b._emscripten_bind_b2Mat33_get_ey_0=function(){return b.asm._emscripten_bind_b2Mat33_get_ey_0.apply(null,arguments)},Jc=b._emscripten_bind_b2MouseJoint_GetCollideConnected_0=function(){return b.asm._emscripten_bind_b2MouseJoint_GetCollideConnected_0.apply(null, +arguments)},Kc=b._emscripten_bind_b2World_GetGravity_0=function(){return b.asm._emscripten_bind_b2World_GetGravity_0.apply(null,arguments)},Lc=b._emscripten_bind_b2Mat33_set_ey_1=function(){return b.asm._emscripten_bind_b2Mat33_set_ey_1.apply(null,arguments)},Mc=b._emscripten_bind_b2Profile_get_broadphase_0=function(){return b.asm._emscripten_bind_b2Profile_get_broadphase_0.apply(null,arguments)},Nc=b._emscripten_bind_b2PulleyJointDef_get_bodyA_0=function(){return b.asm._emscripten_bind_b2PulleyJointDef_get_bodyA_0.apply(null, +arguments)},Oc=b._emscripten_bind_b2PrismaticJoint_SetLimits_2=function(){return b.asm._emscripten_bind_b2PrismaticJoint_SetLimits_2.apply(null,arguments)},Pc=b._emscripten_bind_b2PulleyJointDef_get_localAnchorA_0=function(){return b.asm._emscripten_bind_b2PulleyJointDef_get_localAnchorA_0.apply(null,arguments)},Qc=b._emscripten_bind_b2DistanceJoint_GetAnchorA_0=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetAnchorA_0.apply(null,arguments)},Rc=b._emscripten_bind_b2DistanceJointDef_set_userData_1= +function(){return b.asm._emscripten_bind_b2DistanceJointDef_set_userData_1.apply(null,arguments)},Sc=b._emscripten_bind_b2DistanceJointDef_set_dampingRatio_1=function(){return b.asm._emscripten_bind_b2DistanceJointDef_set_dampingRatio_1.apply(null,arguments)},Tc=b._emscripten_bind_b2RopeJointDef_set_collideConnected_1=function(){return b.asm._emscripten_bind_b2RopeJointDef_set_collideConnected_1.apply(null,arguments)},Uc=b._emscripten_bind_b2ChainShape_set_m_nextVertex_1=function(){return b.asm._emscripten_bind_b2ChainShape_set_m_nextVertex_1.apply(null, +arguments)},Vc=b._emscripten_bind_JSContactListener_EndContact_1=function(){return b.asm._emscripten_bind_JSContactListener_EndContact_1.apply(null,arguments)},Wc=b._emscripten_bind_b2MassData_set_mass_1=function(){return b.asm._emscripten_bind_b2MassData_set_mass_1.apply(null,arguments)},Xc=b._emscripten_bind_b2Vec3_get_x_0=function(){return b.asm._emscripten_bind_b2Vec3_get_x_0.apply(null,arguments)},Yc=b._emscripten_bind_b2ChainShape_CreateChain_2=function(){return b.asm._emscripten_bind_b2ChainShape_CreateChain_2.apply(null, +arguments)},Zc=b._emscripten_bind_b2RopeJoint_GetUserData_0=function(){return b.asm._emscripten_bind_b2RopeJoint_GetUserData_0.apply(null,arguments)},$c=b._emscripten_bind_b2World_DestroyBody_1=function(){return b.asm._emscripten_bind_b2World_DestroyBody_1.apply(null,arguments)},ad=b._emscripten_bind_b2Profile_get_solvePosition_0=function(){return b.asm._emscripten_bind_b2Profile_get_solvePosition_0.apply(null,arguments)},bd=b._emscripten_bind_b2Shape_RayCast_4=function(){return b.asm._emscripten_bind_b2Shape_RayCast_4.apply(null, +arguments)},cd=b._emscripten_bind_b2PulleyJoint_GetGroundAnchorA_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetGroundAnchorA_0.apply(null,arguments)},dd=b._emscripten_bind_b2Mat33___destroy___0=function(){return b.asm._emscripten_bind_b2Mat33___destroy___0.apply(null,arguments)},ed=b._emscripten_bind_b2GearJoint_GetReactionTorque_1=function(){return b.asm._emscripten_bind_b2GearJoint_GetReactionTorque_1.apply(null,arguments)},fd=b._emscripten_bind_b2WeldJointDef_set_collideConnected_1= +function(){return b.asm._emscripten_bind_b2WeldJointDef_set_collideConnected_1.apply(null,arguments)},gd=b._emscripten_bind_b2JointDef_get_collideConnected_0=function(){return b.asm._emscripten_bind_b2JointDef_get_collideConnected_0.apply(null,arguments)};b.getTempRet0=function(){return b.asm.getTempRet0.apply(null,arguments)}; +var hd=b._emscripten_bind_b2FrictionJointDef_get_maxTorque_0=function(){return b.asm._emscripten_bind_b2FrictionJointDef_get_maxTorque_0.apply(null,arguments)},id=b._emscripten_bind_JSQueryCallback_JSQueryCallback_0=function(){return b.asm._emscripten_bind_JSQueryCallback_JSQueryCallback_0.apply(null,arguments)},jd=b._emscripten_bind_b2World_SetAutoClearForces_1=function(){return b.asm._emscripten_bind_b2World_SetAutoClearForces_1.apply(null,arguments)},kd=b._emscripten_bind_b2PrismaticJointDef_set_lowerTranslation_1= +function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_lowerTranslation_1.apply(null,arguments)},ld=b._emscripten_bind_b2Contact_GetTangentSpeed_0=function(){return b.asm._emscripten_bind_b2Contact_GetTangentSpeed_0.apply(null,arguments)},md=b._emscripten_bind_b2BodyDef_set_position_1=function(){return b.asm._emscripten_bind_b2BodyDef_set_position_1.apply(null,arguments)},nd=b._emscripten_bind_b2Transform_get_q_0=function(){return b.asm._emscripten_bind_b2Transform_get_q_0.apply(null,arguments)}, +od=b._emscripten_bind_b2PolygonShape_set_m_count_1=function(){return b.asm._emscripten_bind_b2PolygonShape_set_m_count_1.apply(null,arguments)},pd=b._emscripten_bind_b2Contact_GetNext_0=function(){return b.asm._emscripten_bind_b2Contact_GetNext_0.apply(null,arguments)},qd=b._emscripten_bind_b2MotorJointDef_set_userData_1=function(){return b.asm._emscripten_bind_b2MotorJointDef_set_userData_1.apply(null,arguments)},rd=b._emscripten_bind_b2GearJoint_GetJoint1_0=function(){return b.asm._emscripten_bind_b2GearJoint_GetJoint1_0.apply(null, +arguments)},sd=b._emscripten_bind_b2World_GetProxyCount_0=function(){return b.asm._emscripten_bind_b2World_GetProxyCount_0.apply(null,arguments)},td=b._emscripten_bind_b2MotorJoint_SetMaxTorque_1=function(){return b.asm._emscripten_bind_b2MotorJoint_SetMaxTorque_1.apply(null,arguments)},ud=b._emscripten_bind_b2GearJoint_GetAnchorA_0=function(){return b.asm._emscripten_bind_b2GearJoint_GetAnchorA_0.apply(null,arguments)},vd=b._emscripten_bind_b2MouseJointDef_set_bodyA_1=function(){return b.asm._emscripten_bind_b2MouseJointDef_set_bodyA_1.apply(null, +arguments)},wd=b._emscripten_bind_b2World_SetContactListener_1=function(){return b.asm._emscripten_bind_b2World_SetContactListener_1.apply(null,arguments)},xd=b._emscripten_bind_b2Body_IsAwake_0=function(){return b.asm._emscripten_bind_b2Body_IsAwake_0.apply(null,arguments)},yd=b._emscripten_bind_b2JointEdge_set_other_1=function(){return b.asm._emscripten_bind_b2JointEdge_set_other_1.apply(null,arguments)},zd=b._emscripten_bind_b2MouseJointDef_set_target_1=function(){return b.asm._emscripten_bind_b2MouseJointDef_set_target_1.apply(null, +arguments)},db=b._emscripten_replace_memory=function(){return b.asm._emscripten_replace_memory.apply(null,arguments)},Ad=b._emscripten_bind_b2MotorJoint_SetCorrectionFactor_1=function(){return b.asm._emscripten_bind_b2MotorJoint_SetCorrectionFactor_1.apply(null,arguments)},Bd=b._emscripten_bind_b2FixtureDef_get_density_0=function(){return b.asm._emscripten_bind_b2FixtureDef_get_density_0.apply(null,arguments)},Cd=b._emscripten_bind_b2GearJoint_GetRatio_0=function(){return b.asm._emscripten_bind_b2GearJoint_GetRatio_0.apply(null, +arguments)},Dd=b._emscripten_bind_b2PrismaticJointDef_get_upperTranslation_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_upperTranslation_0.apply(null,arguments)},Ed=b._emscripten_bind_b2RevoluteJoint_GetReferenceAngle_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetReferenceAngle_0.apply(null,arguments)},Fd=b._emscripten_bind_b2MotorJointDef_get_collideConnected_0=function(){return b.asm._emscripten_bind_b2MotorJointDef_get_collideConnected_0.apply(null,arguments)}, +Gd=b._emscripten_enum_b2ManifoldType_e_circles=function(){return b.asm._emscripten_enum_b2ManifoldType_e_circles.apply(null,arguments)},Hd=b._emscripten_bind_b2PulleyJointDef_set_localAnchorB_1=function(){return b.asm._emscripten_bind_b2PulleyJointDef_set_localAnchorB_1.apply(null,arguments)},Id=b._emscripten_bind_b2RevoluteJointDef_Initialize_3=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_Initialize_3.apply(null,arguments)},Jd=b._emscripten_bind_b2FixtureDef_get_userData_0=function(){return b.asm._emscripten_bind_b2FixtureDef_get_userData_0.apply(null, +arguments)},Kd=b._emscripten_bind_b2DistanceJoint_GetUserData_0=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetUserData_0.apply(null,arguments)},Ld=b._emscripten_bind_b2FrictionJointDef_set_collideConnected_1=function(){return b.asm._emscripten_bind_b2FrictionJointDef_set_collideConnected_1.apply(null,arguments)},Md=b._emscripten_bind_b2PrismaticJointDef_get_lowerTranslation_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_lowerTranslation_0.apply(null,arguments)},Nd= +b._emscripten_bind_b2GearJoint_GetCollideConnected_0=function(){return b.asm._emscripten_bind_b2GearJoint_GetCollideConnected_0.apply(null,arguments)},Od=b._emscripten_bind_b2Filter_b2Filter_0=function(){return b.asm._emscripten_bind_b2Filter_b2Filter_0.apply(null,arguments)},Pd=b._emscripten_bind_b2MouseJointDef_set_type_1=function(){return b.asm._emscripten_bind_b2MouseJointDef_set_type_1.apply(null,arguments)},Qd=b._emscripten_bind_b2Body_ApplyAngularImpulse_2=function(){return b.asm._emscripten_bind_b2Body_ApplyAngularImpulse_2.apply(null, +arguments)},Rd=b._emscripten_enum_b2JointType_e_frictionJoint=function(){return b.asm._emscripten_enum_b2JointType_e_frictionJoint.apply(null,arguments)},Sd=b._emscripten_bind_b2RayCastOutput_set_fraction_1=function(){return b.asm._emscripten_bind_b2RayCastOutput_set_fraction_1.apply(null,arguments)},Td=b._emscripten_bind_b2Color_set_r_1=function(){return b.asm._emscripten_bind_b2Color_set_r_1.apply(null,arguments)},Ud=b._emscripten_bind_b2DistanceJointDef_get_length_0=function(){return b.asm._emscripten_bind_b2DistanceJointDef_get_length_0.apply(null, +arguments)},Vd=b._emscripten_bind_b2PulleyJoint_GetBodyB_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetBodyB_0.apply(null,arguments)},Wd=b._emscripten_bind_b2WheelJointDef_set_type_1=function(){return b.asm._emscripten_bind_b2WheelJointDef_set_type_1.apply(null,arguments)},Xd=b._emscripten_bind_b2World_GetTreeQuality_0=function(){return b.asm._emscripten_bind_b2World_GetTreeQuality_0.apply(null,arguments)},Yd=b._emscripten_bind_b2BodyDef_set_gravityScale_1=function(){return b.asm._emscripten_bind_b2BodyDef_set_gravityScale_1.apply(null, +arguments)},Zd=b._emscripten_bind_b2RopeJointDef_set_bodyB_1=function(){return b.asm._emscripten_bind_b2RopeJointDef_set_bodyB_1.apply(null,arguments)},$d=b._emscripten_bind_b2PrismaticJoint_GetLowerLimit_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetLowerLimit_0.apply(null,arguments)},ae=b._emscripten_bind_b2AABB_get_lowerBound_0=function(){return b.asm._emscripten_bind_b2AABB_get_lowerBound_0.apply(null,arguments)},be=b._emscripten_bind_b2WheelJoint_SetMotorSpeed_1=function(){return b.asm._emscripten_bind_b2WheelJoint_SetMotorSpeed_1.apply(null, +arguments)},ce=b._emscripten_bind_b2PrismaticJointDef_get_referenceAngle_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_referenceAngle_0.apply(null,arguments)},de=b._emscripten_bind_b2Body_SetMassData_1=function(){return b.asm._emscripten_bind_b2Body_SetMassData_1.apply(null,arguments)},ee=b._emscripten_bind_b2BodyDef_get_angularVelocity_0=function(){return b.asm._emscripten_bind_b2BodyDef_get_angularVelocity_0.apply(null,arguments)},fe=b._emscripten_bind_b2WeldJoint_SetDampingRatio_1= +function(){return b.asm._emscripten_bind_b2WeldJoint_SetDampingRatio_1.apply(null,arguments)},ge=b._emscripten_bind_b2PrismaticJointDef___destroy___0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef___destroy___0.apply(null,arguments)},he=b._emscripten_bind_b2Contact_IsTouching_0=function(){return b.asm._emscripten_bind_b2Contact_IsTouching_0.apply(null,arguments)},ie=b._emscripten_bind_b2Draw_SetFlags_1=function(){return b.asm._emscripten_bind_b2Draw_SetFlags_1.apply(null,arguments)}, +je=b._emscripten_bind_b2AABB_Contains_1=function(){return b.asm._emscripten_bind_b2AABB_Contains_1.apply(null,arguments)},ke=b._emscripten_bind_b2DistanceJoint_GetNext_0=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetNext_0.apply(null,arguments)},le=b._emscripten_bind_b2EdgeShape_set_m_radius_1=function(){return b.asm._emscripten_bind_b2EdgeShape_set_m_radius_1.apply(null,arguments)},me=b._emscripten_bind_b2DistanceJointDef_get_dampingRatio_0=function(){return b.asm._emscripten_bind_b2DistanceJointDef_get_dampingRatio_0.apply(null, +arguments)},ne=b._emscripten_bind_b2DistanceJoint_GetLocalAnchorA_0=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetLocalAnchorA_0.apply(null,arguments)},oe=b._emscripten_bind_b2PrismaticJoint_GetType_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetType_0.apply(null,arguments)},pe=b._emscripten_bind_b2Fixture_GetRestitution_0=function(){return b.asm._emscripten_bind_b2Fixture_GetRestitution_0.apply(null,arguments)},qe=b._emscripten_bind_b2Transform_set_q_1=function(){return b.asm._emscripten_bind_b2Transform_set_q_1.apply(null, +arguments)},re=b._emscripten_bind_b2PolygonShape___destroy___0=function(){return b.asm._emscripten_bind_b2PolygonShape___destroy___0.apply(null,arguments)},se=b._emscripten_bind_b2AABB_get_upperBound_0=function(){return b.asm._emscripten_bind_b2AABB_get_upperBound_0.apply(null,arguments)},te=b._emscripten_bind_b2Transform___destroy___0=function(){return b.asm._emscripten_bind_b2Transform___destroy___0.apply(null,arguments)},ue=b._emscripten_bind_b2Body_GetLinearVelocity_0=function(){return b.asm._emscripten_bind_b2Body_GetLinearVelocity_0.apply(null, +arguments)},ve=b._emscripten_bind_b2CircleShape_set_m_radius_1=function(){return b.asm._emscripten_bind_b2CircleShape_set_m_radius_1.apply(null,arguments)},we=b._emscripten_bind_b2EdgeShape_set_m_hasVertex0_1=function(){return b.asm._emscripten_bind_b2EdgeShape_set_m_hasVertex0_1.apply(null,arguments)},xe=b._emscripten_bind_b2Contact_GetWorldManifold_1=function(){return b.asm._emscripten_bind_b2Contact_GetWorldManifold_1.apply(null,arguments)},ye=b._emscripten_bind_b2RopeJoint_GetMaxLength_0=function(){return b.asm._emscripten_bind_b2RopeJoint_GetMaxLength_0.apply(null, +arguments)},ze=b._emscripten_bind_b2GearJoint_GetUserData_0=function(){return b.asm._emscripten_bind_b2GearJoint_GetUserData_0.apply(null,arguments)},Ae=b._emscripten_bind_b2MotorJoint_GetCollideConnected_0=function(){return b.asm._emscripten_bind_b2MotorJoint_GetCollideConnected_0.apply(null,arguments)},Be=b._emscripten_bind_b2GearJointDef_set_type_1=function(){return b.asm._emscripten_bind_b2GearJointDef_set_type_1.apply(null,arguments)},Ce=b._emscripten_bind_b2DistanceJoint_SetDampingRatio_1=function(){return b.asm._emscripten_bind_b2DistanceJoint_SetDampingRatio_1.apply(null, +arguments)},De=b._emscripten_bind_b2Contact_GetFixtureA_0=function(){return b.asm._emscripten_bind_b2Contact_GetFixtureA_0.apply(null,arguments)},Ee=b._emscripten_bind_b2PulleyJointDef_get_ratio_0=function(){return b.asm._emscripten_bind_b2PulleyJointDef_get_ratio_0.apply(null,arguments)},Fe=b._emscripten_bind_b2PrismaticJointDef_get_localAnchorB_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_localAnchorB_0.apply(null,arguments)},Ge=b._emscripten_bind_b2CircleShape_set_m_type_1= +function(){return b.asm._emscripten_bind_b2CircleShape_set_m_type_1.apply(null,arguments)},He=b._emscripten_bind_b2DistanceJointDef_set_localAnchorA_1=function(){return b.asm._emscripten_bind_b2DistanceJointDef_set_localAnchorA_1.apply(null,arguments)},Ie=b._emscripten_bind_b2RopeJoint_GetAnchorB_0=function(){return b.asm._emscripten_bind_b2RopeJoint_GetAnchorB_0.apply(null,arguments)},Je=b._emscripten_bind_b2AABB_set_upperBound_1=function(){return b.asm._emscripten_bind_b2AABB_set_upperBound_1.apply(null, +arguments)},Ke=b._emscripten_bind_JSRayCastCallback_ReportFixture_4=function(){return b.asm._emscripten_bind_JSRayCastCallback_ReportFixture_4.apply(null,arguments)},Le=b._emscripten_bind_b2ContactImpulse___destroy___0=function(){return b.asm._emscripten_bind_b2ContactImpulse___destroy___0.apply(null,arguments)},Me=b._emscripten_bind_b2FrictionJointDef_get_localAnchorB_0=function(){return b.asm._emscripten_bind_b2FrictionJointDef_get_localAnchorB_0.apply(null,arguments)},Ne=b._emscripten_bind_b2PulleyJointDef_set_lengthB_1= +function(){return b.asm._emscripten_bind_b2PulleyJointDef_set_lengthB_1.apply(null,arguments)},Oe=b._emscripten_bind_b2RayCastInput___destroy___0=function(){return b.asm._emscripten_bind_b2RayCastInput___destroy___0.apply(null,arguments)},Pe=b._emscripten_bind_b2Body_ApplyForceToCenter_2=function(){return b.asm._emscripten_bind_b2Body_ApplyForceToCenter_2.apply(null,arguments)},Qe=b._emscripten_bind_JSDestructionListener_JSDestructionListener_0=function(){return b.asm._emscripten_bind_JSDestructionListener_JSDestructionListener_0.apply(null, +arguments)},Re=b._emscripten_bind_b2WheelJointDef_set_localAnchorA_1=function(){return b.asm._emscripten_bind_b2WheelJointDef_set_localAnchorA_1.apply(null,arguments)},Se=b._emscripten_bind_b2FrictionJoint_GetBodyB_0=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetBodyB_0.apply(null,arguments)},Te=b._emscripten_bind_b2WeldJointDef_set_bodyA_1=function(){return b.asm._emscripten_bind_b2WeldJointDef_set_bodyA_1.apply(null,arguments)},Ue=b._emscripten_bind_b2DistanceJoint_GetBodyB_0=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetBodyB_0.apply(null, +arguments)},Ve=b._emscripten_enum_b2JointType_e_wheelJoint=function(){return b.asm._emscripten_enum_b2JointType_e_wheelJoint.apply(null,arguments)},We=b._emscripten_bind_b2JointDef___destroy___0=function(){return b.asm._emscripten_bind_b2JointDef___destroy___0.apply(null,arguments)},Xe=b._emscripten_bind_b2ContactEdge___destroy___0=function(){return b.asm._emscripten_bind_b2ContactEdge___destroy___0.apply(null,arguments)},Ye=b._emscripten_bind_b2Filter_get_groupIndex_0=function(){return b.asm._emscripten_bind_b2Filter_get_groupIndex_0.apply(null, +arguments)},Ze=b._emscripten_bind_b2FrictionJointDef_get_localAnchorA_0=function(){return b.asm._emscripten_bind_b2FrictionJointDef_get_localAnchorA_0.apply(null,arguments)},$e=b._emscripten_bind_b2CircleShape_GetChildCount_0=function(){return b.asm._emscripten_bind_b2CircleShape_GetChildCount_0.apply(null,arguments)},af=b._emscripten_bind_b2BodyDef_get_bullet_0=function(){return b.asm._emscripten_bind_b2BodyDef_get_bullet_0.apply(null,arguments)},bf=b._emscripten_bind_b2Color_set_b_1=function(){return b.asm._emscripten_bind_b2Color_set_b_1.apply(null, +arguments)},cf=b._emscripten_bind_b2Mat33_get_ez_0=function(){return b.asm._emscripten_bind_b2Mat33_get_ez_0.apply(null,arguments)},df=b._emscripten_bind_b2MassData_get_center_0=function(){return b.asm._emscripten_bind_b2MassData_get_center_0.apply(null,arguments)},ef=b._emscripten_bind_b2WeldJoint_GetBodyB_0=function(){return b.asm._emscripten_bind_b2WeldJoint_GetBodyB_0.apply(null,arguments)},ff=b._emscripten_bind_b2WheelJoint_GetReactionForce_1=function(){return b.asm._emscripten_bind_b2WheelJoint_GetReactionForce_1.apply(null, +arguments)},gf=b._emscripten_bind_b2World_SetSubStepping_1=function(){return b.asm._emscripten_bind_b2World_SetSubStepping_1.apply(null,arguments)},hf=b._emscripten_bind_b2Vec2_op_add_1=function(){return b.asm._emscripten_bind_b2Vec2_op_add_1.apply(null,arguments)},jf=b._emscripten_bind_JSDraw_DrawSegment_3=function(){return b.asm._emscripten_bind_JSDraw_DrawSegment_3.apply(null,arguments)},kf=b._emscripten_bind_b2Joint_GetCollideConnected_0=function(){return b.asm._emscripten_bind_b2Joint_GetCollideConnected_0.apply(null, +arguments)},lf=b._emscripten_bind_b2MotorJoint_GetReactionTorque_1=function(){return b.asm._emscripten_bind_b2MotorJoint_GetReactionTorque_1.apply(null,arguments)},mf=b._emscripten_bind_b2FrictionJointDef_get_bodyB_0=function(){return b.asm._emscripten_bind_b2FrictionJointDef_get_bodyB_0.apply(null,arguments)},nf=b._emscripten_bind_b2WheelJointDef___destroy___0=function(){return b.asm._emscripten_bind_b2WheelJointDef___destroy___0.apply(null,arguments)},of=b._emscripten_bind_b2BodyDef_get_gravityScale_0= +function(){return b.asm._emscripten_bind_b2BodyDef_get_gravityScale_0.apply(null,arguments)},pf=b._emscripten_bind_b2Vec3_SetZero_0=function(){return b.asm._emscripten_bind_b2Vec3_SetZero_0.apply(null,arguments)},qf=b._emscripten_enum_b2JointType_e_pulleyJoint=function(){return b.asm._emscripten_enum_b2JointType_e_pulleyJoint.apply(null,arguments)},rf=b._emscripten_bind_b2ChainShape_get_m_nextVertex_0=function(){return b.asm._emscripten_bind_b2ChainShape_get_m_nextVertex_0.apply(null,arguments)}, +sf=b._emscripten_bind_b2Contact_SetEnabled_1=function(){return b.asm._emscripten_bind_b2Contact_SetEnabled_1.apply(null,arguments)},tf=b._emscripten_bind_b2Shape_set_m_radius_1=function(){return b.asm._emscripten_bind_b2Shape_set_m_radius_1.apply(null,arguments)},uf=b._emscripten_bind_b2World_SetDebugDraw_1=function(){return b.asm._emscripten_bind_b2World_SetDebugDraw_1.apply(null,arguments)},vf=b._emscripten_bind_b2ContactID_set_key_1=function(){return b.asm._emscripten_bind_b2ContactID_set_key_1.apply(null, +arguments)},Ca=b._malloc=function(){return b.asm._malloc.apply(null,arguments)},wf=b._emscripten_bind_b2WheelJoint_GetMaxMotorTorque_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetMaxMotorTorque_0.apply(null,arguments)},xf=b._emscripten_bind_b2Vec2_Normalize_0=function(){return b.asm._emscripten_bind_b2Vec2_Normalize_0.apply(null,arguments)},yf=b._emscripten_bind_b2WheelJoint_GetJointSpeed_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetJointSpeed_0.apply(null,arguments)},zf= +b._emscripten_bind_b2FrictionJointDef_set_localAnchorA_1=function(){return b.asm._emscripten_bind_b2FrictionJointDef_set_localAnchorA_1.apply(null,arguments)},Af=b._emscripten_bind_b2ChainShape_set_m_vertices_1=function(){return b.asm._emscripten_bind_b2ChainShape_set_m_vertices_1.apply(null,arguments)},Bf=b._emscripten_bind_JSRayCastCallback_JSRayCastCallback_0=function(){return b.asm._emscripten_bind_JSRayCastCallback_JSRayCastCallback_0.apply(null,arguments)},Cf=b._emscripten_bind_b2RayCastInput_set_p2_1= +function(){return b.asm._emscripten_bind_b2RayCastInput_set_p2_1.apply(null,arguments)},Df=b._emscripten_bind_b2RevoluteJointDef_get_motorSpeed_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_motorSpeed_0.apply(null,arguments)},Ef=b._emscripten_bind_b2Manifold_get_pointCount_0=function(){return b.asm._emscripten_bind_b2Manifold_get_pointCount_0.apply(null,arguments)},Ff=b._emscripten_bind_b2RayCastOutput_get_normal_0=function(){return b.asm._emscripten_bind_b2RayCastOutput_get_normal_0.apply(null, +arguments)},Gf=b._emscripten_bind_b2WeldJoint_GetBodyA_0=function(){return b.asm._emscripten_bind_b2WeldJoint_GetBodyA_0.apply(null,arguments)},Hf=b._emscripten_enum_b2DrawFlag_e_jointBit=function(){return b.asm._emscripten_enum_b2DrawFlag_e_jointBit.apply(null,arguments)},If=b._emscripten_bind_b2FixtureDef_get_isSensor_0=function(){return b.asm._emscripten_bind_b2FixtureDef_get_isSensor_0.apply(null,arguments)},Jf=b._emscripten_bind_b2PrismaticJointDef_Initialize_4=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_Initialize_4.apply(null, +arguments)},Kf=b._emscripten_bind_b2PulleyJointDef_set_bodyB_1=function(){return b.asm._emscripten_bind_b2PulleyJointDef_set_bodyB_1.apply(null,arguments)},Lf=b._emscripten_bind_b2WheelJoint_EnableMotor_1=function(){return b.asm._emscripten_bind_b2WheelJoint_EnableMotor_1.apply(null,arguments)},Mf=b._emscripten_bind_b2RevoluteJoint_GetJointSpeed_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetJointSpeed_0.apply(null,arguments)},Nf=b._emscripten_bind_JSDraw_DrawSolidPolygon_3=function(){return b.asm._emscripten_bind_JSDraw_DrawSolidPolygon_3.apply(null, +arguments)},Of=b._emscripten_bind_b2Rot_Set_1=function(){return b.asm._emscripten_bind_b2Rot_Set_1.apply(null,arguments)},Pf=b._emscripten_bind_b2RevoluteJoint_GetJointAngle_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetJointAngle_0.apply(null,arguments)},Qf=b._emscripten_bind_JSDraw___destroy___0=function(){return b.asm._emscripten_bind_JSDraw___destroy___0.apply(null,arguments)},Rf=b._emscripten_bind_b2MouseJointDef___destroy___0=function(){return b.asm._emscripten_bind_b2MouseJointDef___destroy___0.apply(null, +arguments)},Sf=b._emscripten_bind_b2Mat33_Solve22_1=function(){return b.asm._emscripten_bind_b2Mat33_Solve22_1.apply(null,arguments)},Tf=b._emscripten_bind_b2Profile_set_solvePosition_1=function(){return b.asm._emscripten_bind_b2Profile_set_solvePosition_1.apply(null,arguments)},Uf=b._emscripten_bind_b2ContactFilter___destroy___0=function(){return b.asm._emscripten_bind_b2ContactFilter___destroy___0.apply(null,arguments)},Vf=b._emscripten_bind_b2WheelJoint_GetLocalAnchorA_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetLocalAnchorA_0.apply(null, +arguments)},Wf=b._emscripten_bind_b2ChainShape_set_m_hasPrevVertex_1=function(){return b.asm._emscripten_bind_b2ChainShape_set_m_hasPrevVertex_1.apply(null,arguments)},Xf=b._emscripten_bind_b2Joint_SetUserData_1=function(){return b.asm._emscripten_bind_b2Joint_SetUserData_1.apply(null,arguments)},Yf=b._emscripten_bind_b2DistanceJoint_SetUserData_1=function(){return b.asm._emscripten_bind_b2DistanceJoint_SetUserData_1.apply(null,arguments)},Zf=b._emscripten_bind_b2PrismaticJoint___destroy___0=function(){return b.asm._emscripten_bind_b2PrismaticJoint___destroy___0.apply(null, +arguments)},$f=b._emscripten_bind_b2RopeJointDef_set_bodyA_1=function(){return b.asm._emscripten_bind_b2RopeJointDef_set_bodyA_1.apply(null,arguments)},ag=b._emscripten_bind_b2GearJoint___destroy___0=function(){return b.asm._emscripten_bind_b2GearJoint___destroy___0.apply(null,arguments)},bg=b._emscripten_bind_b2PrismaticJoint_GetJointTranslation_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetJointTranslation_0.apply(null,arguments)},cg=b._emscripten_bind_b2ManifoldPoint_get_id_0= +function(){return b.asm._emscripten_bind_b2ManifoldPoint_get_id_0.apply(null,arguments)},dg=b._emscripten_bind_b2CircleShape_get_m_radius_0=function(){return b.asm._emscripten_bind_b2CircleShape_get_m_radius_0.apply(null,arguments)},eg=b._emscripten_bind_b2PrismaticJoint_GetMotorSpeed_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetMotorSpeed_0.apply(null,arguments)},fg=b._emscripten_bind_b2PulleyJoint_GetGroundAnchorB_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetGroundAnchorB_0.apply(null, +arguments)},gg=b._emscripten_bind_b2Vec3_op_add_1=function(){return b.asm._emscripten_bind_b2Vec3_op_add_1.apply(null,arguments)},hg=b._emscripten_bind_b2FrictionJoint_GetType_0=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetType_0.apply(null,arguments)},ig=b._emscripten_bind_b2MouseJoint_GetMaxForce_0=function(){return b.asm._emscripten_bind_b2MouseJoint_GetMaxForce_0.apply(null,arguments)},jg=b._emscripten_bind_b2MouseJoint_SetTarget_1=function(){return b.asm._emscripten_bind_b2MouseJoint_SetTarget_1.apply(null, +arguments)},kg=b._emscripten_bind_b2MouseJointDef_get_dampingRatio_0=function(){return b.asm._emscripten_bind_b2MouseJointDef_get_dampingRatio_0.apply(null,arguments)},lg=b._emscripten_bind_b2RevoluteJoint_GetMotorSpeed_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetMotorSpeed_0.apply(null,arguments)},mg=b._emscripten_bind_b2ChainShape_set_m_type_1=function(){return b.asm._emscripten_bind_b2ChainShape_set_m_type_1.apply(null,arguments)},ng=b._emscripten_bind_b2RevoluteJointDef_set_bodyB_1= +function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_bodyB_1.apply(null,arguments)},og=b._emscripten_bind_b2Rot_GetXAxis_0=function(){return b.asm._emscripten_bind_b2Rot_GetXAxis_0.apply(null,arguments)},pg=b._emscripten_bind_b2Mat33_b2Mat33_0=function(){return b.asm._emscripten_bind_b2Mat33_b2Mat33_0.apply(null,arguments)},qg=b._emscripten_bind_b2MouseJointDef_get_bodyB_0=function(){return b.asm._emscripten_bind_b2MouseJointDef_get_bodyB_0.apply(null,arguments)},rg=b._emscripten_bind_b2Body_GetWorldVector_1= +function(){return b.asm._emscripten_bind_b2Body_GetWorldVector_1.apply(null,arguments)},sg=b._emscripten_bind_b2WeldJointDef_get_frequencyHz_0=function(){return b.asm._emscripten_bind_b2WeldJointDef_get_frequencyHz_0.apply(null,arguments)},tg=b._emscripten_bind_b2GearJointDef_set_ratio_1=function(){return b.asm._emscripten_bind_b2GearJointDef_set_ratio_1.apply(null,arguments)},ug=b._emscripten_bind_b2Manifold___destroy___0=function(){return b.asm._emscripten_bind_b2Manifold___destroy___0.apply(null, +arguments)},vg=b._emscripten_bind_b2PulleyJointDef_set_lengthA_1=function(){return b.asm._emscripten_bind_b2PulleyJointDef_set_lengthA_1.apply(null,arguments)},wg=b._emscripten_bind_b2Contact_IsEnabled_0=function(){return b.asm._emscripten_bind_b2Contact_IsEnabled_0.apply(null,arguments)};b.stackRestore=function(){return b.asm.stackRestore.apply(null,arguments)}; +var xg=b._emscripten_bind_b2World_CreateJoint_1=function(){return b.asm._emscripten_bind_b2World_CreateJoint_1.apply(null,arguments)},yg=b._emscripten_bind_b2PulleyJointDef_set_ratio_1=function(){return b.asm._emscripten_bind_b2PulleyJointDef_set_ratio_1.apply(null,arguments)},zg=b._emscripten_bind_b2JointEdge_set_prev_1=function(){return b.asm._emscripten_bind_b2JointEdge_set_prev_1.apply(null,arguments)},Ag=b._emscripten_bind_b2PrismaticJoint_GetReactionTorque_1=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetReactionTorque_1.apply(null, +arguments)},Bg=b._emscripten_bind_b2Body_GetLocalPoint_1=function(){return b.asm._emscripten_bind_b2Body_GetLocalPoint_1.apply(null,arguments)},Cg=b._emscripten_bind_b2PrismaticJoint_GetCollideConnected_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetCollideConnected_0.apply(null,arguments)},Dg=b._emscripten_bind_b2DistanceJoint_IsActive_0=function(){return b.asm._emscripten_bind_b2DistanceJoint_IsActive_0.apply(null,arguments)},Eg=b._emscripten_bind_b2RopeJoint_GetLimitState_0=function(){return b.asm._emscripten_bind_b2RopeJoint_GetLimitState_0.apply(null, +arguments)},Fg=b._emscripten_bind_b2Profile_get_solveTOI_0=function(){return b.asm._emscripten_bind_b2Profile_get_solveTOI_0.apply(null,arguments)},Gg=b._emscripten_bind_b2Vec2_b2Vec2_0=function(){return b.asm._emscripten_bind_b2Vec2_b2Vec2_0.apply(null,arguments)},Hg=b._emscripten_bind_b2DistanceJoint_GetAnchorB_0=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetAnchorB_0.apply(null,arguments)},Ig=b._emscripten_bind_b2WheelJointDef_get_maxMotorTorque_0=function(){return b.asm._emscripten_bind_b2WheelJointDef_get_maxMotorTorque_0.apply(null, +arguments)},Jg=b._emscripten_bind_b2Vec2_op_sub_1=function(){return b.asm._emscripten_bind_b2Vec2_op_sub_1.apply(null,arguments)},Kg=b._emscripten_bind_b2CircleShape_get_m_p_0=function(){return b.asm._emscripten_bind_b2CircleShape_get_m_p_0.apply(null,arguments)},Lg=b._emscripten_bind_b2ContactFeature_get_indexA_0=function(){return b.asm._emscripten_bind_b2ContactFeature_get_indexA_0.apply(null,arguments)},Mg=b._emscripten_bind_b2MotorJointDef_b2MotorJointDef_0=function(){return b.asm._emscripten_bind_b2MotorJointDef_b2MotorJointDef_0.apply(null, +arguments)},Ng=b._emscripten_bind_b2RevoluteJoint_EnableLimit_1=function(){return b.asm._emscripten_bind_b2RevoluteJoint_EnableLimit_1.apply(null,arguments)},Og=b._emscripten_bind_b2ContactEdge_get_next_0=function(){return b.asm._emscripten_bind_b2ContactEdge_get_next_0.apply(null,arguments)},Pg=b._emscripten_bind_b2AABB_GetPerimeter_0=function(){return b.asm._emscripten_bind_b2AABB_GetPerimeter_0.apply(null,arguments)},Qg=b._emscripten_bind_b2RevoluteJoint_GetCollideConnected_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetCollideConnected_0.apply(null, +arguments)},Rg=b._emscripten_bind_b2Mat33_get_ex_0=function(){return b.asm._emscripten_bind_b2Mat33_get_ex_0.apply(null,arguments)},Sg=b._emscripten_bind_b2Body_GetPosition_0=function(){return b.asm._emscripten_bind_b2Body_GetPosition_0.apply(null,arguments)},Tg=b._emscripten_bind_b2Profile___destroy___0=function(){return b.asm._emscripten_bind_b2Profile___destroy___0.apply(null,arguments)},Ug=b._emscripten_bind_b2ContactEdge_get_prev_0=function(){return b.asm._emscripten_bind_b2ContactEdge_get_prev_0.apply(null, +arguments)},Vg=b._emscripten_bind_b2DistanceJoint_SetFrequency_1=function(){return b.asm._emscripten_bind_b2DistanceJoint_SetFrequency_1.apply(null,arguments)},Wg=b._emscripten_bind_b2Fixture_GetBody_0=function(){return b.asm._emscripten_bind_b2Fixture_GetBody_0.apply(null,arguments)},Xg=b._emscripten_bind_b2ContactImpulse_set_count_1=function(){return b.asm._emscripten_bind_b2ContactImpulse_set_count_1.apply(null,arguments)},Yg=b._emscripten_bind_b2FixtureDef_set_shape_1=function(){return b.asm._emscripten_bind_b2FixtureDef_set_shape_1.apply(null, +arguments)},Zg=b._emscripten_bind_b2PulleyJointDef_get_bodyB_0=function(){return b.asm._emscripten_bind_b2PulleyJointDef_get_bodyB_0.apply(null,arguments)},$g=b._emscripten_bind_b2ChainShape_GetChildCount_0=function(){return b.asm._emscripten_bind_b2ChainShape_GetChildCount_0.apply(null,arguments)},ah=b._emscripten_bind_b2CircleShape_b2CircleShape_0=function(){return b.asm._emscripten_bind_b2CircleShape_b2CircleShape_0.apply(null,arguments)},bh=b._emscripten_bind_b2RevoluteJoint_GetReactionTorque_1= +function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetReactionTorque_1.apply(null,arguments)},ch=b._emscripten_bind_b2Fixture_SetDensity_1=function(){return b.asm._emscripten_bind_b2Fixture_SetDensity_1.apply(null,arguments)},dh=b._emscripten_bind_b2ChainShape_get_m_prevVertex_0=function(){return b.asm._emscripten_bind_b2ChainShape_get_m_prevVertex_0.apply(null,arguments)},eh=b._emscripten_bind_b2AABB_GetExtents_0=function(){return b.asm._emscripten_bind_b2AABB_GetExtents_0.apply(null,arguments)}, +fh=b._emscripten_bind_b2World_ClearForces_0=function(){return b.asm._emscripten_bind_b2World_ClearForces_0.apply(null,arguments)},gh=b._emscripten_bind_b2Vec3___destroy___0=function(){return b.asm._emscripten_bind_b2Vec3___destroy___0.apply(null,arguments)},hh=b._emscripten_bind_b2WheelJointDef_set_userData_1=function(){return b.asm._emscripten_bind_b2WheelJointDef_set_userData_1.apply(null,arguments)},ih=b._emscripten_bind_b2WeldJoint_SetFrequency_1=function(){return b.asm._emscripten_bind_b2WeldJoint_SetFrequency_1.apply(null, +arguments)},jh=b._emscripten_bind_JSContactListener_PreSolve_2=function(){return b.asm._emscripten_bind_JSContactListener_PreSolve_2.apply(null,arguments)},kh=b._emscripten_bind_b2Body_SetFixedRotation_1=function(){return b.asm._emscripten_bind_b2Body_SetFixedRotation_1.apply(null,arguments)},lh=b._emscripten_bind_b2RayCastOutput_set_normal_1=function(){return b.asm._emscripten_bind_b2RayCastOutput_set_normal_1.apply(null,arguments)},mh=b._emscripten_bind_b2DistanceJoint_GetDampingRatio_0=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetDampingRatio_0.apply(null, +arguments)},nh=b._emscripten_bind_b2RevoluteJoint_SetMaxMotorTorque_1=function(){return b.asm._emscripten_bind_b2RevoluteJoint_SetMaxMotorTorque_1.apply(null,arguments)},oh=b._emscripten_bind_b2RevoluteJoint_EnableMotor_1=function(){return b.asm._emscripten_bind_b2RevoluteJoint_EnableMotor_1.apply(null,arguments)},ph=b._emscripten_bind_b2Contact_GetChildIndexB_0=function(){return b.asm._emscripten_bind_b2Contact_GetChildIndexB_0.apply(null,arguments)},qh=b._emscripten_bind_b2MouseJointDef_set_bodyB_1= +function(){return b.asm._emscripten_bind_b2MouseJointDef_set_bodyB_1.apply(null,arguments)},rh=b._emscripten_bind_b2CircleShape_GetType_0=function(){return b.asm._emscripten_bind_b2CircleShape_GetType_0.apply(null,arguments)},sh=b._emscripten_bind_b2PolygonShape_GetType_0=function(){return b.asm._emscripten_bind_b2PolygonShape_GetType_0.apply(null,arguments)},th=b._emscripten_bind_b2PrismaticJointDef_set_referenceAngle_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_referenceAngle_1.apply(null, +arguments)},uh=b._emscripten_bind_b2RopeJointDef_get_collideConnected_0=function(){return b.asm._emscripten_bind_b2RopeJointDef_get_collideConnected_0.apply(null,arguments)},vh=b._emscripten_bind_b2FixtureDef_set_filter_1=function(){return b.asm._emscripten_bind_b2FixtureDef_set_filter_1.apply(null,arguments)},wh=b._emscripten_bind_b2Body_ApplyTorque_2=function(){return b.asm._emscripten_bind_b2Body_ApplyTorque_2.apply(null,arguments)},xh=b._emscripten_bind_b2RevoluteJoint___destroy___0=function(){return b.asm._emscripten_bind_b2RevoluteJoint___destroy___0.apply(null, +arguments)},yh=b._emscripten_bind_b2FrictionJointDef_get_userData_0=function(){return b.asm._emscripten_bind_b2FrictionJointDef_get_userData_0.apply(null,arguments)},zh=b._emscripten_bind_b2RayCastCallback___destroy___0=function(){return b.asm._emscripten_bind_b2RayCastCallback___destroy___0.apply(null,arguments)},Ah=b._emscripten_bind_b2RevoluteJointDef_set_bodyA_1=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_bodyA_1.apply(null,arguments)},Bh=b._emscripten_bind_b2MotorJoint_SetUserData_1= +function(){return b.asm._emscripten_bind_b2MotorJoint_SetUserData_1.apply(null,arguments)},Ch=b._emscripten_bind_b2PrismaticJoint_GetLocalAxisA_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetLocalAxisA_0.apply(null,arguments)},Dh=b._emscripten_bind_b2MotorJoint_GetBodyB_0=function(){return b.asm._emscripten_bind_b2MotorJoint_GetBodyB_0.apply(null,arguments)},Eh=b._emscripten_bind_b2Transform_Set_2=function(){return b.asm._emscripten_bind_b2Transform_Set_2.apply(null,arguments)},Fh= +b._emscripten_bind_b2MotorJoint_GetBodyA_0=function(){return b.asm._emscripten_bind_b2MotorJoint_GetBodyA_0.apply(null,arguments)};b.stackAlloc=function(){return b.asm.stackAlloc.apply(null,arguments)}; +var Gh=b._emscripten_bind_b2Draw_AppendFlags_1=function(){return b.asm._emscripten_bind_b2Draw_AppendFlags_1.apply(null,arguments)},Hh=b._emscripten_bind_b2EdgeShape_GetChildCount_0=function(){return b.asm._emscripten_bind_b2EdgeShape_GetChildCount_0.apply(null,arguments)},Ih=b._emscripten_bind_b2Contact_ResetFriction_0=function(){return b.asm._emscripten_bind_b2Contact_ResetFriction_0.apply(null,arguments)},Jh=b._emscripten_bind_b2Profile_set_solveTOI_1=function(){return b.asm._emscripten_bind_b2Profile_set_solveTOI_1.apply(null, +arguments)},Kh=b._emscripten_bind_b2PrismaticJointDef_set_type_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_type_1.apply(null,arguments)},Lh=b._emscripten_bind_b2AABB_GetCenter_0=function(){return b.asm._emscripten_bind_b2AABB_GetCenter_0.apply(null,arguments)},Mh=b._emscripten_bind_b2WheelJoint_SetSpringFrequencyHz_1=function(){return b.asm._emscripten_bind_b2WheelJoint_SetSpringFrequencyHz_1.apply(null,arguments)},Nh=b._emscripten_bind_b2FrictionJointDef___destroy___0=function(){return b.asm._emscripten_bind_b2FrictionJointDef___destroy___0.apply(null, +arguments)},Oh=b._emscripten_bind_b2PrismaticJoint_GetReactionForce_1=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetReactionForce_1.apply(null,arguments)},Ph=b._emscripten_bind_b2Transform_b2Transform_0=function(){return b.asm._emscripten_bind_b2Transform_b2Transform_0.apply(null,arguments)},Qh=b._emscripten_enum_b2LimitState_e_equalLimits=function(){return b.asm._emscripten_enum_b2LimitState_e_equalLimits.apply(null,arguments)},Rh=b._emscripten_bind_b2ManifoldPoint_set_normalImpulse_1= +function(){return b.asm._emscripten_bind_b2ManifoldPoint_set_normalImpulse_1.apply(null,arguments)},Sh=b._emscripten_bind_b2Body_IsFixedRotation_0=function(){return b.asm._emscripten_bind_b2Body_IsFixedRotation_0.apply(null,arguments)},Th=b._emscripten_enum_b2DrawFlag_e_shapeBit=function(){return b.asm._emscripten_enum_b2DrawFlag_e_shapeBit.apply(null,arguments)},Uh=b._emscripten_bind_b2Contact_GetFriction_0=function(){return b.asm._emscripten_bind_b2Contact_GetFriction_0.apply(null,arguments)},Vh= +b._emscripten_bind_b2Body_GetContactList_0=function(){return b.asm._emscripten_bind_b2Body_GetContactList_0.apply(null,arguments)},Wh=b._emscripten_bind_b2DistanceJointDef_set_length_1=function(){return b.asm._emscripten_bind_b2DistanceJointDef_set_length_1.apply(null,arguments)},Xh=b._emscripten_bind_b2DistanceJoint_GetLocalAnchorB_0=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetLocalAnchorB_0.apply(null,arguments)},Yh=b._emscripten_bind_b2FrictionJoint_GetLocalAnchorB_0=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetLocalAnchorB_0.apply(null, +arguments)},Zh=b._emscripten_bind_b2World_b2World_1=function(){return b.asm._emscripten_bind_b2World_b2World_1.apply(null,arguments)},$h=b._emscripten_bind_b2PrismaticJoint_IsLimitEnabled_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_IsLimitEnabled_0.apply(null,arguments)},ai=b._emscripten_bind_b2DistanceJointDef_get_type_0=function(){return b.asm._emscripten_bind_b2DistanceJointDef_get_type_0.apply(null,arguments)},bi=b._emscripten_bind_b2Draw_ClearFlags_1=function(){return b.asm._emscripten_bind_b2Draw_ClearFlags_1.apply(null, +arguments)},ci=b._emscripten_bind_b2Body_SetAngularDamping_1=function(){return b.asm._emscripten_bind_b2Body_SetAngularDamping_1.apply(null,arguments)},di=b._emscripten_bind_b2Body_IsActive_0=function(){return b.asm._emscripten_bind_b2Body_IsActive_0.apply(null,arguments)},ei=b._emscripten_bind_b2Contact_ResetRestitution_0=function(){return b.asm._emscripten_bind_b2Contact_ResetRestitution_0.apply(null,arguments)},fi=b._emscripten_bind_b2World_GetAllowSleeping_0=function(){return b.asm._emscripten_bind_b2World_GetAllowSleeping_0.apply(null, +arguments)},gi=b._emscripten_bind_b2ManifoldPoint_b2ManifoldPoint_0=function(){return b.asm._emscripten_bind_b2ManifoldPoint_b2ManifoldPoint_0.apply(null,arguments)},hi=b._emscripten_bind_b2EdgeShape_set_m_type_1=function(){return b.asm._emscripten_bind_b2EdgeShape_set_m_type_1.apply(null,arguments)},ii=b._emscripten_enum_b2JointType_e_unknownJoint=function(){return b.asm._emscripten_enum_b2JointType_e_unknownJoint.apply(null,arguments)},ji=b._emscripten_bind_b2RevoluteJointDef_set_enableMotor_1= +function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_enableMotor_1.apply(null,arguments)},ki=b._emscripten_bind_b2PulleyJoint_IsActive_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_IsActive_0.apply(null,arguments)},li=b._emscripten_bind_b2MouseJoint_GetNext_0=function(){return b.asm._emscripten_bind_b2MouseJoint_GetNext_0.apply(null,arguments)},mi=b._emscripten_bind_b2RevoluteJoint_SetUserData_1=function(){return b.asm._emscripten_bind_b2RevoluteJoint_SetUserData_1.apply(null, +arguments)},ni=b._emscripten_bind_b2Manifold_get_localPoint_0=function(){return b.asm._emscripten_bind_b2Manifold_get_localPoint_0.apply(null,arguments)},oi=b._emscripten_bind_b2PulleyJointDef_get_lengthB_0=function(){return b.asm._emscripten_bind_b2PulleyJointDef_get_lengthB_0.apply(null,arguments)},pi=b._emscripten_bind_b2WeldJoint_SetUserData_1=function(){return b.asm._emscripten_bind_b2WeldJoint_SetUserData_1.apply(null,arguments)},qi=b._emscripten_bind_b2ChainShape_CreateLoop_2=function(){return b.asm._emscripten_bind_b2ChainShape_CreateLoop_2.apply(null, +arguments)},ri=b._emscripten_bind_b2GearJointDef_get_joint1_0=function(){return b.asm._emscripten_bind_b2GearJointDef_get_joint1_0.apply(null,arguments)},si=b._emscripten_bind_b2PrismaticJoint_GetMotorForce_1=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetMotorForce_1.apply(null,arguments)},ti=b._emscripten_bind_b2Body_SetUserData_1=function(){return b.asm._emscripten_bind_b2Body_SetUserData_1.apply(null,arguments)},ui=b._emscripten_bind_b2GearJoint_IsActive_0=function(){return b.asm._emscripten_bind_b2GearJoint_IsActive_0.apply(null, +arguments)},vi=b._emscripten_bind_b2EdgeShape_get_m_vertex0_0=function(){return b.asm._emscripten_bind_b2EdgeShape_get_m_vertex0_0.apply(null,arguments)},wi=b._emscripten_enum_b2JointType_e_revoluteJoint=function(){return b.asm._emscripten_enum_b2JointType_e_revoluteJoint.apply(null,arguments)},xi=b._emscripten_bind_b2Vec2_get_x_0=function(){return b.asm._emscripten_bind_b2Vec2_get_x_0.apply(null,arguments)},yi=b._emscripten_bind_b2WeldJointDef_get_collideConnected_0=function(){return b.asm._emscripten_bind_b2WeldJointDef_get_collideConnected_0.apply(null, +arguments)},zi=b._emscripten_bind_b2FrictionJoint_GetMaxTorque_0=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetMaxTorque_0.apply(null,arguments)},Ai=b._emscripten_bind_b2EdgeShape_RayCast_4=function(){return b.asm._emscripten_bind_b2EdgeShape_RayCast_4.apply(null,arguments)},Bi=b._emscripten_bind_b2BodyDef_set_allowSleep_1=function(){return b.asm._emscripten_bind_b2BodyDef_set_allowSleep_1.apply(null,arguments)},Ci=b._emscripten_bind_b2PulleyJoint_GetType_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetType_0.apply(null, +arguments)},Di=b._emscripten_bind_b2WeldJointDef_set_localAnchorA_1=function(){return b.asm._emscripten_bind_b2WeldJointDef_set_localAnchorA_1.apply(null,arguments)},Ei=b._emscripten_bind_b2Profile_set_step_1=function(){return b.asm._emscripten_bind_b2Profile_set_step_1.apply(null,arguments)},Fi=b._emscripten_bind_b2ContactEdge_set_other_1=function(){return b.asm._emscripten_bind_b2ContactEdge_set_other_1.apply(null,arguments)},Gi=b._emscripten_bind_b2PulleyJoint_GetCurrentLengthB_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetCurrentLengthB_0.apply(null, +arguments)},Hi=b._emscripten_bind_b2Vec2_op_mul_1=function(){return b.asm._emscripten_bind_b2Vec2_op_mul_1.apply(null,arguments)},Ii=b._emscripten_bind_b2PrismaticJointDef_get_localAnchorA_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_localAnchorA_0.apply(null,arguments)},Ji=b._emscripten_bind_b2EdgeShape___destroy___0=function(){return b.asm._emscripten_bind_b2EdgeShape___destroy___0.apply(null,arguments)},Ki=b._emscripten_bind_b2PolygonShape_get_m_count_0=function(){return b.asm._emscripten_bind_b2PolygonShape_get_m_count_0.apply(null, +arguments)},Li=b._emscripten_bind_b2RopeJoint_GetAnchorA_0=function(){return b.asm._emscripten_bind_b2RopeJoint_GetAnchorA_0.apply(null,arguments)},Mi=b._emscripten_bind_b2DistanceJointDef_get_bodyA_0=function(){return b.asm._emscripten_bind_b2DistanceJointDef_get_bodyA_0.apply(null,arguments)},Ni=b._emscripten_bind_b2AABB_Combine_2=function(){return b.asm._emscripten_bind_b2AABB_Combine_2.apply(null,arguments)},Oi=b._emscripten_bind_b2ManifoldPoint_set_tangentImpulse_1=function(){return b.asm._emscripten_bind_b2ManifoldPoint_set_tangentImpulse_1.apply(null, +arguments)},Pi=b._emscripten_bind_b2BodyDef_get_allowSleep_0=function(){return b.asm._emscripten_bind_b2BodyDef_get_allowSleep_0.apply(null,arguments)},Qi=b._emscripten_bind_b2ContactEdge_get_other_0=function(){return b.asm._emscripten_bind_b2ContactEdge_get_other_0.apply(null,arguments)},Ri=b._emscripten_bind_b2RopeJoint_GetLocalAnchorB_0=function(){return b.asm._emscripten_bind_b2RopeJoint_GetLocalAnchorB_0.apply(null,arguments)},Si=b._emscripten_bind_b2PulleyJointDef___destroy___0=function(){return b.asm._emscripten_bind_b2PulleyJointDef___destroy___0.apply(null, +arguments)},Ti=b._emscripten_bind_b2MouseJoint_GetBodyB_0=function(){return b.asm._emscripten_bind_b2MouseJoint_GetBodyB_0.apply(null,arguments)},Ui=b._emscripten_bind_b2PolygonShape_TestPoint_2=function(){return b.asm._emscripten_bind_b2PolygonShape_TestPoint_2.apply(null,arguments)},Vi=b._emscripten_bind_b2JointEdge_get_other_0=function(){return b.asm._emscripten_bind_b2JointEdge_get_other_0.apply(null,arguments)},Wi=b._emscripten_bind_b2PolygonShape_b2PolygonShape_0=function(){return b.asm._emscripten_bind_b2PolygonShape_b2PolygonShape_0.apply(null, +arguments)},Xi=b._emscripten_bind_b2PolygonShape_Set_2=function(){return b.asm._emscripten_bind_b2PolygonShape_Set_2.apply(null,arguments)},Yi=b._emscripten_bind_b2GearJoint_GetReactionForce_1=function(){return b.asm._emscripten_bind_b2GearJoint_GetReactionForce_1.apply(null,arguments)},Zi=b._emscripten_bind_b2DistanceJointDef_get_localAnchorA_0=function(){return b.asm._emscripten_bind_b2DistanceJointDef_get_localAnchorA_0.apply(null,arguments)},$i=b._emscripten_bind_b2Fixture_SetUserData_1=function(){return b.asm._emscripten_bind_b2Fixture_SetUserData_1.apply(null, +arguments)},aj=b._emscripten_bind_b2Contact_SetTangentSpeed_1=function(){return b.asm._emscripten_bind_b2Contact_SetTangentSpeed_1.apply(null,arguments)},bj=b._emscripten_bind_b2PrismaticJointDef_b2PrismaticJointDef_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_b2PrismaticJointDef_0.apply(null,arguments)},cj=b._emscripten_bind_b2BodyDef_get_active_0=function(){return b.asm._emscripten_bind_b2BodyDef_get_active_0.apply(null,arguments)},dj=b._emscripten_bind_b2Body_GetAngularVelocity_0= +function(){return b.asm._emscripten_bind_b2Body_GetAngularVelocity_0.apply(null,arguments)},ej=b._emscripten_bind_b2CircleShape_set_m_p_1=function(){return b.asm._emscripten_bind_b2CircleShape_set_m_p_1.apply(null,arguments)},fj=b._emscripten_bind_b2Draw___destroy___0=function(){return b.asm._emscripten_bind_b2Draw___destroy___0.apply(null,arguments)},gj=b._emscripten_bind_b2WheelJointDef_Initialize_4=function(){return b.asm._emscripten_bind_b2WheelJointDef_Initialize_4.apply(null,arguments)},hj= +b._emscripten_bind_b2WeldJointDef_set_dampingRatio_1=function(){return b.asm._emscripten_bind_b2WeldJointDef_set_dampingRatio_1.apply(null,arguments)},ij=b._emscripten_bind_b2ChainShape_b2ChainShape_0=function(){return b.asm._emscripten_bind_b2ChainShape_b2ChainShape_0.apply(null,arguments)},jj=b._emscripten_bind_b2Joint_GetAnchorB_0=function(){return b.asm._emscripten_bind_b2Joint_GetAnchorB_0.apply(null,arguments)},kj=b._emscripten_bind_b2PrismaticJointDef_get_userData_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_userData_0.apply(null, +arguments)},lj=b._emscripten_bind_b2MotorJoint_GetMaxForce_0=function(){return b.asm._emscripten_bind_b2MotorJoint_GetMaxForce_0.apply(null,arguments)},mj=b._emscripten_bind_b2RevoluteJoint_GetBodyA_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetBodyA_0.apply(null,arguments)},nj=b._emscripten_bind_b2ContactID_set_cf_1=function(){return b.asm._emscripten_bind_b2ContactID_set_cf_1.apply(null,arguments)},oj=b._emscripten_bind_b2Body_GetGravityScale_0=function(){return b.asm._emscripten_bind_b2Body_GetGravityScale_0.apply(null, +arguments)},pj=b._emscripten_bind_b2Vec3_Set_3=function(){return b.asm._emscripten_bind_b2Vec3_Set_3.apply(null,arguments)},qj=b._emscripten_bind_b2RevoluteJointDef_set_localAnchorA_1=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_localAnchorA_1.apply(null,arguments)},rj=b._emscripten_bind_b2FrictionJointDef_set_localAnchorB_1=function(){return b.asm._emscripten_bind_b2FrictionJointDef_set_localAnchorB_1.apply(null,arguments)},sj=b._emscripten_bind_b2PulleyJoint_GetNext_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetNext_0.apply(null, +arguments)},tj=b._emscripten_bind_b2ChainShape_get_m_type_0=function(){return b.asm._emscripten_bind_b2ChainShape_get_m_type_0.apply(null,arguments)},uj=b._emscripten_bind_b2PulleyJointDef_get_groundAnchorB_0=function(){return b.asm._emscripten_bind_b2PulleyJointDef_get_groundAnchorB_0.apply(null,arguments)},vj=b._emscripten_bind_JSDraw_DrawTransform_1=function(){return b.asm._emscripten_bind_JSDraw_DrawTransform_1.apply(null,arguments)},wj=b._emscripten_bind_b2GearJointDef_get_bodyA_0=function(){return b.asm._emscripten_bind_b2GearJointDef_get_bodyA_0.apply(null, +arguments)},xj=b._emscripten_bind_b2DistanceJointDef_set_frequencyHz_1=function(){return b.asm._emscripten_bind_b2DistanceJointDef_set_frequencyHz_1.apply(null,arguments)},yj=b._emscripten_bind_b2RevoluteJointDef_get_localAnchorB_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_localAnchorB_0.apply(null,arguments)},zj=b._emscripten_bind_b2RevoluteJointDef_get_referenceAngle_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_referenceAngle_0.apply(null,arguments)},Aj= +b._emscripten_bind_JSContactFilter___destroy___0=function(){return b.asm._emscripten_bind_JSContactFilter___destroy___0.apply(null,arguments)},Bj=b._emscripten_bind_b2RevoluteJointDef_get_enableMotor_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_enableMotor_0.apply(null,arguments)},Cb=b._memset=function(){return b.asm._memset.apply(null,arguments)},Cj=b._emscripten_bind_b2PolygonShape_get_m_radius_0=function(){return b.asm._emscripten_bind_b2PolygonShape_get_m_radius_0.apply(null, +arguments)},Dj=b._emscripten_enum_b2BodyType_b2_kinematicBody=function(){return b.asm._emscripten_enum_b2BodyType_b2_kinematicBody.apply(null,arguments)},Ej=b._emscripten_bind_b2Rot_set_s_1=function(){return b.asm._emscripten_bind_b2Rot_set_s_1.apply(null,arguments)},Fj=b._emscripten_enum_b2ManifoldType_e_faceA=function(){return b.asm._emscripten_enum_b2ManifoldType_e_faceA.apply(null,arguments)},Gj=b._emscripten_enum_b2ManifoldType_e_faceB=function(){return b.asm._emscripten_enum_b2ManifoldType_e_faceB.apply(null, +arguments)},Hj=b._emscripten_bind_b2RevoluteJointDef_get_bodyB_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_bodyB_0.apply(null,arguments)},Ij=b._emscripten_bind_b2FixtureDef_b2FixtureDef_0=function(){return b.asm._emscripten_bind_b2FixtureDef_b2FixtureDef_0.apply(null,arguments)},Jj=b._emscripten_bind_b2PrismaticJoint_SetUserData_1=function(){return b.asm._emscripten_bind_b2PrismaticJoint_SetUserData_1.apply(null,arguments)},Kj=b._emscripten_bind_b2WorldManifold_set_points_2= +function(){return b.asm._emscripten_bind_b2WorldManifold_set_points_2.apply(null,arguments)},Lj=b._emscripten_bind_b2EdgeShape_get_m_hasVertex3_0=function(){return b.asm._emscripten_bind_b2EdgeShape_get_m_hasVertex3_0.apply(null,arguments)},Mj=b._emscripten_enum_b2ShapeType_e_edge=function(){return b.asm._emscripten_enum_b2ShapeType_e_edge.apply(null,arguments)},Nj=b._emscripten_bind_b2RevoluteJoint_GetMaxMotorTorque_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetMaxMotorTorque_0.apply(null, +arguments)},Oj=b._emscripten_bind_b2BodyDef_set_active_1=function(){return b.asm._emscripten_bind_b2BodyDef_set_active_1.apply(null,arguments)},Pj=b._emscripten_bind_b2EdgeShape_Set_2=function(){return b.asm._emscripten_bind_b2EdgeShape_Set_2.apply(null,arguments)},Qj=b._emscripten_bind_b2FixtureDef_set_isSensor_1=function(){return b.asm._emscripten_bind_b2FixtureDef_set_isSensor_1.apply(null,arguments)},Rj=b._emscripten_bind_b2Body_GetWorldPoint_1=function(){return b.asm._emscripten_bind_b2Body_GetWorldPoint_1.apply(null, +arguments)},Sj=b._emscripten_bind_b2ManifoldPoint_get_normalImpulse_0=function(){return b.asm._emscripten_bind_b2ManifoldPoint_get_normalImpulse_0.apply(null,arguments)},Tj=b._emscripten_bind_JSContactFilter_ShouldCollide_2=function(){return b.asm._emscripten_bind_JSContactFilter_ShouldCollide_2.apply(null,arguments)},Uj=b._emscripten_bind_b2Joint_GetReactionTorque_1=function(){return b.asm._emscripten_bind_b2Joint_GetReactionTorque_1.apply(null,arguments)},Vj=b._emscripten_bind_b2RevoluteJointDef_set_type_1= +function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_type_1.apply(null,arguments)},Wj=b._emscripten_bind_b2RayCastInput_set_p1_1=function(){return b.asm._emscripten_bind_b2RayCastInput_set_p1_1.apply(null,arguments)},Xj=b._emscripten_bind_b2RopeJointDef_b2RopeJointDef_0=function(){return b.asm._emscripten_bind_b2RopeJointDef_b2RopeJointDef_0.apply(null,arguments)},Yj=b._emscripten_bind_b2BodyDef_get_linearDamping_0=function(){return b.asm._emscripten_bind_b2BodyDef_get_linearDamping_0.apply(null, +arguments)},Zj=b._emscripten_bind_b2World_Step_3=function(){return b.asm._emscripten_bind_b2World_Step_3.apply(null,arguments)},ak=b._emscripten_bind_b2CircleShape_RayCast_4=function(){return b.asm._emscripten_bind_b2CircleShape_RayCast_4.apply(null,arguments)},bk=b._emscripten_bind_b2Profile_get_step_0=function(){return b.asm._emscripten_bind_b2Profile_get_step_0.apply(null,arguments)},ck=b._emscripten_bind_b2AABB_RayCast_2=function(){return b.asm._emscripten_bind_b2AABB_RayCast_2.apply(null,arguments)}, +dk=b._emscripten_bind_b2Mat22_SetZero_0=function(){return b.asm._emscripten_bind_b2Mat22_SetZero_0.apply(null,arguments)};b.setTempRet0=function(){return b.asm.setTempRet0.apply(null,arguments)}; +var ek=b._emscripten_bind_b2DistanceJoint_GetLength_0=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetLength_0.apply(null,arguments)},fk=b._emscripten_bind_b2PulleyJoint_GetLengthB_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetLengthB_0.apply(null,arguments)},gk=b._emscripten_bind_b2PrismaticJoint_GetUpperLimit_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetUpperLimit_0.apply(null,arguments)},hk=b._emscripten_bind_b2WorldManifold_set_separations_2=function(){return b.asm._emscripten_bind_b2WorldManifold_set_separations_2.apply(null, +arguments)},ik=b._emscripten_bind_b2WheelJoint_SetMaxMotorTorque_1=function(){return b.asm._emscripten_bind_b2WheelJoint_SetMaxMotorTorque_1.apply(null,arguments)},jk=b._emscripten_bind_b2MotorJoint_GetUserData_0=function(){return b.asm._emscripten_bind_b2MotorJoint_GetUserData_0.apply(null,arguments)},kk=b._emscripten_bind_b2FrictionJoint_GetReactionTorque_1=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetReactionTorque_1.apply(null,arguments)},lk=b._emscripten_bind_b2Shape_get_m_type_0= +function(){return b.asm._emscripten_bind_b2Shape_get_m_type_0.apply(null,arguments)},mk=b._emscripten_bind_b2MouseJoint_SetDampingRatio_1=function(){return b.asm._emscripten_bind_b2MouseJoint_SetDampingRatio_1.apply(null,arguments)},nk=b._emscripten_bind_b2World_GetAutoClearForces_0=function(){return b.asm._emscripten_bind_b2World_GetAutoClearForces_0.apply(null,arguments)},ok=b._emscripten_bind_b2WorldManifold_set_normal_1=function(){return b.asm._emscripten_bind_b2WorldManifold_set_normal_1.apply(null, +arguments)},pk=b._emscripten_enum_b2ShapeType_e_circle=function(){return b.asm._emscripten_enum_b2ShapeType_e_circle.apply(null,arguments)},qk=b._emscripten_bind_b2BodyDef_set_fixedRotation_1=function(){return b.asm._emscripten_bind_b2BodyDef_set_fixedRotation_1.apply(null,arguments)},rk=b._emscripten_bind_b2Vec2_b2Vec2_2=function(){return b.asm._emscripten_bind_b2Vec2_b2Vec2_2.apply(null,arguments)},sk=b._emscripten_bind_b2Manifold_get_type_0=function(){return b.asm._emscripten_bind_b2Manifold_get_type_0.apply(null, +arguments)},tk=b._emscripten_bind_b2Body_Dump_0=function(){return b.asm._emscripten_bind_b2Body_Dump_0.apply(null,arguments)},uk=b._emscripten_bind_b2RevoluteJoint_GetLowerLimit_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetLowerLimit_0.apply(null,arguments)},vk=b._emscripten_bind_b2Body_GetWorldCenter_0=function(){return b.asm._emscripten_bind_b2Body_GetWorldCenter_0.apply(null,arguments)},wk=b._emscripten_bind_b2WheelJointDef_set_maxMotorTorque_1=function(){return b.asm._emscripten_bind_b2WheelJointDef_set_maxMotorTorque_1.apply(null, +arguments)},xk=b._emscripten_bind_b2BodyDef_set_linearVelocity_1=function(){return b.asm._emscripten_bind_b2BodyDef_set_linearVelocity_1.apply(null,arguments)},yk=b._emscripten_bind_b2JointDef_set_collideConnected_1=function(){return b.asm._emscripten_bind_b2JointDef_set_collideConnected_1.apply(null,arguments)},zk=b._emscripten_bind_b2MotorJoint___destroy___0=function(){return b.asm._emscripten_bind_b2MotorJoint___destroy___0.apply(null,arguments)},Ak=b._emscripten_bind_b2Body_GetUserData_0=function(){return b.asm._emscripten_bind_b2Body_GetUserData_0.apply(null, +arguments)},Bk=b._emscripten_bind_b2Body_GetAngularDamping_0=function(){return b.asm._emscripten_bind_b2Body_GetAngularDamping_0.apply(null,arguments)},Ck=b._emscripten_bind_b2Fixture_RayCast_3=function(){return b.asm._emscripten_bind_b2Fixture_RayCast_3.apply(null,arguments)},Dk=b._emscripten_bind_b2JointDef_set_bodyA_1=function(){return b.asm._emscripten_bind_b2JointDef_set_bodyA_1.apply(null,arguments)},Ek=b._emscripten_bind_b2GearJointDef_get_collideConnected_0=function(){return b.asm._emscripten_bind_b2GearJointDef_get_collideConnected_0.apply(null, +arguments)},Fk=b._emscripten_bind_b2RopeJointDef_get_maxLength_0=function(){return b.asm._emscripten_bind_b2RopeJointDef_get_maxLength_0.apply(null,arguments)},Gk=b._emscripten_bind_b2MouseJointDef_get_bodyA_0=function(){return b.asm._emscripten_bind_b2MouseJointDef_get_bodyA_0.apply(null,arguments)},Hk=b._emscripten_bind_b2Body_SetBullet_1=function(){return b.asm._emscripten_bind_b2Body_SetBullet_1.apply(null,arguments)},Ik=b._emscripten_bind_b2DistanceJoint_GetType_0=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetType_0.apply(null, +arguments)},Jk=b._emscripten_bind_b2FixtureDef_get_restitution_0=function(){return b.asm._emscripten_bind_b2FixtureDef_get_restitution_0.apply(null,arguments)},Kk=b._emscripten_bind_b2Fixture_GetType_0=function(){return b.asm._emscripten_bind_b2Fixture_GetType_0.apply(null,arguments)},Lk=b._emscripten_bind_b2WheelJointDef_set_enableMotor_1=function(){return b.asm._emscripten_bind_b2WheelJointDef_set_enableMotor_1.apply(null,arguments)},Mk=b._emscripten_bind_b2RevoluteJoint_GetBodyB_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetBodyB_0.apply(null, +arguments)},Nk=b._emscripten_bind_b2Profile_set_solveInit_1=function(){return b.asm._emscripten_bind_b2Profile_set_solveInit_1.apply(null,arguments)},Ok=b._emscripten_bind_b2RopeJointDef_set_type_1=function(){return b.asm._emscripten_bind_b2RopeJointDef_set_type_1.apply(null,arguments)},Pk=b._emscripten_bind_b2PrismaticJointDef_get_bodyB_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_bodyB_0.apply(null,arguments)},Qk=b._emscripten_bind_b2GearJoint_GetJoint2_0=function(){return b.asm._emscripten_bind_b2GearJoint_GetJoint2_0.apply(null, +arguments)},Rk=b._emscripten_bind_b2PulleyJointDef_get_userData_0=function(){return b.asm._emscripten_bind_b2PulleyJointDef_get_userData_0.apply(null,arguments)},Sk=b._emscripten_bind_b2PrismaticJointDef_set_bodyB_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_bodyB_1.apply(null,arguments)},Tk=b._emscripten_bind_b2FrictionJointDef_b2FrictionJointDef_0=function(){return b.asm._emscripten_bind_b2FrictionJointDef_b2FrictionJointDef_0.apply(null,arguments)},Uk=b._emscripten_bind_b2PulleyJoint_GetCurrentLengthA_0= +function(){return b.asm._emscripten_bind_b2PulleyJoint_GetCurrentLengthA_0.apply(null,arguments)},Vk=b._emscripten_bind_b2Manifold_get_localNormal_0=function(){return b.asm._emscripten_bind_b2Manifold_get_localNormal_0.apply(null,arguments)},Wk=b._emscripten_bind_b2Vec3_b2Vec3_0=function(){return b.asm._emscripten_bind_b2Vec3_b2Vec3_0.apply(null,arguments)},Xk=b._emscripten_bind_b2Body_SetSleepingAllowed_1=function(){return b.asm._emscripten_bind_b2Body_SetSleepingAllowed_1.apply(null,arguments)}, +Yk=b._emscripten_bind_b2DistanceJoint___destroy___0=function(){return b.asm._emscripten_bind_b2DistanceJoint___destroy___0.apply(null,arguments)},Zk=b._emscripten_bind_b2PrismaticJoint_GetAnchorA_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetAnchorA_0.apply(null,arguments)},$k=b._emscripten_bind_b2Manifold_set_pointCount_1=function(){return b.asm._emscripten_bind_b2Manifold_set_pointCount_1.apply(null,arguments)},al=b._emscripten_bind_b2PrismaticJoint_IsMotorEnabled_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_IsMotorEnabled_0.apply(null, +arguments)},bl=b._emscripten_bind_b2WeldJoint_GetFrequency_0=function(){return b.asm._emscripten_bind_b2WeldJoint_GetFrequency_0.apply(null,arguments)},cl=b._emscripten_bind_b2Joint_GetUserData_0=function(){return b.asm._emscripten_bind_b2Joint_GetUserData_0.apply(null,arguments)},dl=b._emscripten_bind_b2WorldManifold_get_points_1=function(){return b.asm._emscripten_bind_b2WorldManifold_get_points_1.apply(null,arguments)},el=b._emscripten_bind_b2RevoluteJointDef_get_lowerAngle_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_lowerAngle_0.apply(null, +arguments)},fl=b._emscripten_bind_b2Manifold_set_type_1=function(){return b.asm._emscripten_bind_b2Manifold_set_type_1.apply(null,arguments)},gl=b._emscripten_bind_b2Vec3_b2Vec3_3=function(){return b.asm._emscripten_bind_b2Vec3_b2Vec3_3.apply(null,arguments)},hl=b._emscripten_bind_b2RopeJointDef_set_maxLength_1=function(){return b.asm._emscripten_bind_b2RopeJointDef_set_maxLength_1.apply(null,arguments)},il=b._emscripten_bind_b2ChainShape_TestPoint_2=function(){return b.asm._emscripten_bind_b2ChainShape_TestPoint_2.apply(null, +arguments)},jl=b._emscripten_bind_b2PrismaticJoint_GetReferenceAngle_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetReferenceAngle_0.apply(null,arguments)},kl=b._emscripten_bind_b2RayCastInput_get_p2_0=function(){return b.asm._emscripten_bind_b2RayCastInput_get_p2_0.apply(null,arguments)},ll=b._emscripten_bind_b2BodyDef_set_angle_1=function(){return b.asm._emscripten_bind_b2BodyDef_set_angle_1.apply(null,arguments)},ml=b._emscripten_bind_b2WeldJoint_GetUserData_0=function(){return b.asm._emscripten_bind_b2WeldJoint_GetUserData_0.apply(null, +arguments)},nl=b._emscripten_bind_b2WheelJointDef_get_localAnchorA_0=function(){return b.asm._emscripten_bind_b2WheelJointDef_get_localAnchorA_0.apply(null,arguments)},ol=b._emscripten_bind_b2PulleyJointDef_set_type_1=function(){return b.asm._emscripten_bind_b2PulleyJointDef_set_type_1.apply(null,arguments)},pl=b._emscripten_bind_b2Body_IsBullet_0=function(){return b.asm._emscripten_bind_b2Body_IsBullet_0.apply(null,arguments)},ql=b._emscripten_bind_b2MotorJointDef_set_bodyA_1=function(){return b.asm._emscripten_bind_b2MotorJointDef_set_bodyA_1.apply(null, +arguments)},rl=b._emscripten_bind_b2Fixture_TestPoint_1=function(){return b.asm._emscripten_bind_b2Fixture_TestPoint_1.apply(null,arguments)},sl=b._emscripten_bind_b2Mat33_GetSymInverse33_1=function(){return b.asm._emscripten_bind_b2Mat33_GetSymInverse33_1.apply(null,arguments)},tl=b._emscripten_bind_JSDraw_DrawPolygon_3=function(){return b.asm._emscripten_bind_JSDraw_DrawPolygon_3.apply(null,arguments)},ul=b._emscripten_bind_b2PolygonShape_ComputeMass_2=function(){return b.asm._emscripten_bind_b2PolygonShape_ComputeMass_2.apply(null, +arguments)},vl=b._emscripten_bind_b2PrismaticJoint_EnableMotor_1=function(){return b.asm._emscripten_bind_b2PrismaticJoint_EnableMotor_1.apply(null,arguments)},wl=b._emscripten_bind_b2PrismaticJointDef_set_upperTranslation_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_upperTranslation_1.apply(null,arguments)},xl=b._emscripten_bind_b2MouseJoint_SetFrequency_1=function(){return b.asm._emscripten_bind_b2MouseJoint_SetFrequency_1.apply(null,arguments)},yl=b._emscripten_bind_b2EdgeShape_get_m_vertex1_0= +function(){return b.asm._emscripten_bind_b2EdgeShape_get_m_vertex1_0.apply(null,arguments)},zl=b._emscripten_bind_b2BodyDef_set_awake_1=function(){return b.asm._emscripten_bind_b2BodyDef_set_awake_1.apply(null,arguments)},Al=b._emscripten_bind_b2Vec2_get_y_0=function(){return b.asm._emscripten_bind_b2Vec2_get_y_0.apply(null,arguments)},Bl=b._emscripten_bind_b2Filter_set_categoryBits_1=function(){return b.asm._emscripten_bind_b2Filter_set_categoryBits_1.apply(null,arguments)},Cl=b._emscripten_bind_b2Body_CreateFixture_2= +function(){return b.asm._emscripten_bind_b2Body_CreateFixture_2.apply(null,arguments)},Dl=b._emscripten_bind_b2Body_SetActive_1=function(){return b.asm._emscripten_bind_b2Body_SetActive_1.apply(null,arguments)},El=b._emscripten_bind_b2ContactFeature_get_indexB_0=function(){return b.asm._emscripten_bind_b2ContactFeature_get_indexB_0.apply(null,arguments)},Fl=b._emscripten_bind_b2Fixture_GetUserData_0=function(){return b.asm._emscripten_bind_b2Fixture_GetUserData_0.apply(null,arguments)},Gl=b._emscripten_bind_b2PolygonShape_ComputeAABB_3= +function(){return b.asm._emscripten_bind_b2PolygonShape_ComputeAABB_3.apply(null,arguments)},Hl=b._emscripten_bind_b2ContactFeature_get_typeA_0=function(){return b.asm._emscripten_bind_b2ContactFeature_get_typeA_0.apply(null,arguments)},Il=b._emscripten_bind_b2MouseJointDef_set_maxForce_1=function(){return b.asm._emscripten_bind_b2MouseJointDef_set_maxForce_1.apply(null,arguments)},Jl=b._emscripten_bind_b2PrismaticJoint_GetLocalAnchorA_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetLocalAnchorA_0.apply(null, +arguments)},Kl=b._emscripten_bind_b2EdgeShape_TestPoint_2=function(){return b.asm._emscripten_bind_b2EdgeShape_TestPoint_2.apply(null,arguments)},Ll=b._emscripten_bind_b2WorldManifold_Initialize_5=function(){return b.asm._emscripten_bind_b2WorldManifold_Initialize_5.apply(null,arguments)},Ml=b._emscripten_bind_b2PolygonShape_get_m_centroid_0=function(){return b.asm._emscripten_bind_b2PolygonShape_get_m_centroid_0.apply(null,arguments)},Nl=b._emscripten_bind_b2ChainShape___destroy___0=function(){return b.asm._emscripten_bind_b2ChainShape___destroy___0.apply(null, +arguments)},Ol=b._emscripten_bind_b2GearJoint_SetUserData_1=function(){return b.asm._emscripten_bind_b2GearJoint_SetUserData_1.apply(null,arguments)},Pl=b._emscripten_bind_b2Vec3_set_z_1=function(){return b.asm._emscripten_bind_b2Vec3_set_z_1.apply(null,arguments)},Ql=b._emscripten_bind_b2PrismaticJointDef_set_enableLimit_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_enableLimit_1.apply(null,arguments)},Rl=b._emscripten_bind_b2DistanceJoint_GetFrequency_0=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetFrequency_0.apply(null, +arguments)},Sl=b._emscripten_bind_b2PrismaticJointDef_get_collideConnected_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_collideConnected_0.apply(null,arguments)},Tl=b._emscripten_bind_b2Body_SetGravityScale_1=function(){return b.asm._emscripten_bind_b2Body_SetGravityScale_1.apply(null,arguments)},Ul=b._emscripten_enum_b2ContactFeatureType_e_face=function(){return b.asm._emscripten_enum_b2ContactFeatureType_e_face.apply(null,arguments)},Vl=b._emscripten_bind_b2RevoluteJoint_GetUpperLimit_0= +function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetUpperLimit_0.apply(null,arguments)},Wl=b._emscripten_bind_b2PulleyJointDef_get_lengthA_0=function(){return b.asm._emscripten_bind_b2PulleyJointDef_get_lengthA_0.apply(null,arguments)},Xl=b._emscripten_bind_b2Vec3_set_x_1=function(){return b.asm._emscripten_bind_b2Vec3_set_x_1.apply(null,arguments)},Yl=b._emscripten_bind_b2PulleyJointDef_get_type_0=function(){return b.asm._emscripten_bind_b2PulleyJointDef_get_type_0.apply(null,arguments)}, +Zl=b._emscripten_bind_JSDestructionListener_SayGoodbyeJoint_1=function(){return b.asm._emscripten_bind_JSDestructionListener_SayGoodbyeJoint_1.apply(null,arguments)},$l=b._emscripten_bind_b2Shape___destroy___0=function(){return b.asm._emscripten_bind_b2Shape___destroy___0.apply(null,arguments)},am=b._emscripten_bind_b2Joint_GetReactionForce_1=function(){return b.asm._emscripten_bind_b2Joint_GetReactionForce_1.apply(null,arguments)},bm=b._emscripten_bind_b2FixtureDef_set_friction_1=function(){return b.asm._emscripten_bind_b2FixtureDef_set_friction_1.apply(null, +arguments)},cm=b._emscripten_bind_b2ContactID___destroy___0=function(){return b.asm._emscripten_bind_b2ContactID___destroy___0.apply(null,arguments)},dm=b._emscripten_bind_b2EdgeShape_get_m_hasVertex0_0=function(){return b.asm._emscripten_bind_b2EdgeShape_get_m_hasVertex0_0.apply(null,arguments)},em=b._emscripten_bind_b2World_GetBodyCount_0=function(){return b.asm._emscripten_bind_b2World_GetBodyCount_0.apply(null,arguments)},fm=b._emscripten_bind_b2JointEdge_get_prev_0=function(){return b.asm._emscripten_bind_b2JointEdge_get_prev_0.apply(null, +arguments)},gm=b._emscripten_bind_b2MotorJointDef_get_linearOffset_0=function(){return b.asm._emscripten_bind_b2MotorJointDef_get_linearOffset_0.apply(null,arguments)},hm=b._emscripten_bind_b2MotorJointDef_Initialize_2=function(){return b.asm._emscripten_bind_b2MotorJointDef_Initialize_2.apply(null,arguments)},im=b._emscripten_bind_b2PrismaticJoint_GetAnchorB_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetAnchorB_0.apply(null,arguments)},jm=b._emscripten_bind_b2Body_SetLinearVelocity_1= +function(){return b.asm._emscripten_bind_b2Body_SetLinearVelocity_1.apply(null,arguments)},km=b._emscripten_enum_b2BodyType_b2_staticBody=function(){return b.asm._emscripten_enum_b2BodyType_b2_staticBody.apply(null,arguments)},lm=b._emscripten_bind_b2RevoluteJointDef_set_upperAngle_1=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_upperAngle_1.apply(null,arguments)},mm=b._emscripten_bind_b2RevoluteJointDef_get_type_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_type_0.apply(null, +arguments)},nm=b._emscripten_bind_b2GearJointDef_get_type_0=function(){return b.asm._emscripten_bind_b2GearJointDef_get_type_0.apply(null,arguments)},om=b._emscripten_bind_b2ChainShape_GetType_0=function(){return b.asm._emscripten_bind_b2ChainShape_GetType_0.apply(null,arguments)},pm=b._emscripten_bind_b2RayCastInput_get_maxFraction_0=function(){return b.asm._emscripten_bind_b2RayCastInput_get_maxFraction_0.apply(null,arguments)},qm=b._emscripten_bind_b2GearJoint_GetBodyA_0=function(){return b.asm._emscripten_bind_b2GearJoint_GetBodyA_0.apply(null, +arguments)},rm=b._emscripten_bind_b2Body_GetLocalVector_1=function(){return b.asm._emscripten_bind_b2Body_GetLocalVector_1.apply(null,arguments)},sm=b._emscripten_bind_b2PrismaticJoint_EnableLimit_1=function(){return b.asm._emscripten_bind_b2PrismaticJoint_EnableLimit_1.apply(null,arguments)},tm=b._emscripten_bind_b2FrictionJointDef_get_maxForce_0=function(){return b.asm._emscripten_bind_b2FrictionJointDef_get_maxForce_0.apply(null,arguments)},um=b._emscripten_bind_b2BodyDef_set_angularVelocity_1= +function(){return b.asm._emscripten_bind_b2BodyDef_set_angularVelocity_1.apply(null,arguments)},wm=b._emscripten_bind_b2Body_SetLinearDamping_1=function(){return b.asm._emscripten_bind_b2Body_SetLinearDamping_1.apply(null,arguments)},xm=b._emscripten_bind_b2WheelJoint_GetBodyB_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetBodyB_0.apply(null,arguments)},ym=b._emscripten_bind_b2GearJointDef_get_joint2_0=function(){return b.asm._emscripten_bind_b2GearJointDef_get_joint2_0.apply(null,arguments)}, +zm=b._emscripten_bind_b2PrismaticJoint_IsActive_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_IsActive_0.apply(null,arguments)},Am=b._emscripten_bind_b2Vec3_get_z_0=function(){return b.asm._emscripten_bind_b2Vec3_get_z_0.apply(null,arguments)},Bm=b._emscripten_bind_b2Filter_get_categoryBits_0=function(){return b.asm._emscripten_bind_b2Filter_get_categoryBits_0.apply(null,arguments)},Cm=b._emscripten_bind_b2Color_get_r_0=function(){return b.asm._emscripten_bind_b2Color_get_r_0.apply(null, +arguments)},Dm=b._emscripten_enum_b2JointType_e_weldJoint=function(){return b.asm._emscripten_enum_b2JointType_e_weldJoint.apply(null,arguments)},Em=b._emscripten_bind_b2World_SetContinuousPhysics_1=function(){return b.asm._emscripten_bind_b2World_SetContinuousPhysics_1.apply(null,arguments)},Fm=b._emscripten_bind_b2MouseJointDef_get_target_0=function(){return b.asm._emscripten_bind_b2MouseJointDef_get_target_0.apply(null,arguments)},Gm=b._emscripten_bind_b2Body_SetTransform_2=function(){return b.asm._emscripten_bind_b2Body_SetTransform_2.apply(null, +arguments)},Hm=b._emscripten_bind_b2PulleyJointDef_set_userData_1=function(){return b.asm._emscripten_bind_b2PulleyJointDef_set_userData_1.apply(null,arguments)},Im=b._emscripten_bind_b2FrictionJointDef_set_maxForce_1=function(){return b.asm._emscripten_bind_b2FrictionJointDef_set_maxForce_1.apply(null,arguments)},Jm=b._emscripten_bind_b2DistanceJointDef_b2DistanceJointDef_0=function(){return b.asm._emscripten_bind_b2DistanceJointDef_b2DistanceJointDef_0.apply(null,arguments)},Km=b._emscripten_bind_b2BodyDef_get_type_0= +function(){return b.asm._emscripten_bind_b2BodyDef_get_type_0.apply(null,arguments)},Lm=b._emscripten_bind_b2Mat33_GetInverse22_1=function(){return b.asm._emscripten_bind_b2Mat33_GetInverse22_1.apply(null,arguments)},Mm=b._emscripten_bind_b2PulleyJoint_GetAnchorB_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetAnchorB_0.apply(null,arguments)},Nm=b._emscripten_bind_b2WheelJoint_GetReactionTorque_1=function(){return b.asm._emscripten_bind_b2WheelJoint_GetReactionTorque_1.apply(null,arguments)}, +Om=b._emscripten_bind_b2RevoluteJointDef_b2RevoluteJointDef_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_b2RevoluteJointDef_0.apply(null,arguments)},Pm=b._emscripten_bind_b2ContactFeature_set_typeA_1=function(){return b.asm._emscripten_bind_b2ContactFeature_set_typeA_1.apply(null,arguments)},Qm=b._emscripten_bind_b2Fixture_Dump_1=function(){return b.asm._emscripten_bind_b2Fixture_Dump_1.apply(null,arguments)},Rm=b._emscripten_bind_b2RevoluteJointDef_get_enableLimit_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_enableLimit_0.apply(null, +arguments)},Sm=b._emscripten_bind_b2Manifold_set_localPoint_1=function(){return b.asm._emscripten_bind_b2Manifold_set_localPoint_1.apply(null,arguments)},Tm=b._emscripten_bind_b2JointDef_get_userData_0=function(){return b.asm._emscripten_bind_b2JointDef_get_userData_0.apply(null,arguments)},Um=b._emscripten_bind_b2BodyDef_set_bullet_1=function(){return b.asm._emscripten_bind_b2BodyDef_set_bullet_1.apply(null,arguments)},Vm=b._emscripten_bind_b2WorldManifold___destroy___0=function(){return b.asm._emscripten_bind_b2WorldManifold___destroy___0.apply(null, +arguments)},Wm=b._emscripten_bind_b2RayCastOutput___destroy___0=function(){return b.asm._emscripten_bind_b2RayCastOutput___destroy___0.apply(null,arguments)},Xm=b._emscripten_bind_JSContactListener___destroy___0=function(){return b.asm._emscripten_bind_JSContactListener___destroy___0.apply(null,arguments)},Ym=b._emscripten_bind_b2World_DrawDebugData_0=function(){return b.asm._emscripten_bind_b2World_DrawDebugData_0.apply(null,arguments)}; +b.___cxa_can_catch=function(){return b.asm.___cxa_can_catch.apply(null,arguments)}; +var Zm=b._emscripten_bind_b2RopeJointDef_get_localAnchorA_0=function(){return b.asm._emscripten_bind_b2RopeJointDef_get_localAnchorA_0.apply(null,arguments)},$m=b._emscripten_bind_b2Profile_set_solveVelocity_1=function(){return b.asm._emscripten_bind_b2Profile_set_solveVelocity_1.apply(null,arguments)},an=b._emscripten_bind_b2GearJointDef_get_userData_0=function(){return b.asm._emscripten_bind_b2GearJointDef_get_userData_0.apply(null,arguments)},bn=b._emscripten_bind_b2Filter_set_groupIndex_1=function(){return b.asm._emscripten_bind_b2Filter_set_groupIndex_1.apply(null, +arguments)},cn=b._emscripten_bind_b2JointDef_b2JointDef_0=function(){return b.asm._emscripten_bind_b2JointDef_b2JointDef_0.apply(null,arguments)},dn=b._emscripten_bind_b2Rot_set_c_1=function(){return b.asm._emscripten_bind_b2Rot_set_c_1.apply(null,arguments)},en=b._emscripten_bind_b2GearJointDef_b2GearJointDef_0=function(){return b.asm._emscripten_bind_b2GearJointDef_b2GearJointDef_0.apply(null,arguments)},fn=b._emscripten_bind_b2JointDef_get_bodyB_0=function(){return b.asm._emscripten_bind_b2JointDef_get_bodyB_0.apply(null, +arguments)},gn=b._emscripten_bind_b2DistanceJoint_GetReactionForce_1=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetReactionForce_1.apply(null,arguments)},hn=b._emscripten_bind_b2PrismaticJoint_GetJointSpeed_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetJointSpeed_0.apply(null,arguments)},jn=b._emscripten_bind_b2MouseJointDef_set_frequencyHz_1=function(){return b.asm._emscripten_bind_b2MouseJointDef_set_frequencyHz_1.apply(null,arguments)},kn=b._emscripten_bind_b2PulleyJointDef_get_groundAnchorA_0= +function(){return b.asm._emscripten_bind_b2PulleyJointDef_get_groundAnchorA_0.apply(null,arguments)},ln=b._emscripten_bind_b2Joint_GetAnchorA_0=function(){return b.asm._emscripten_bind_b2Joint_GetAnchorA_0.apply(null,arguments)},mn=b._emscripten_bind_b2Contact_GetRestitution_0=function(){return b.asm._emscripten_bind_b2Contact_GetRestitution_0.apply(null,arguments)},nn=b._emscripten_bind_b2ContactEdge_get_contact_0=function(){return b.asm._emscripten_bind_b2ContactEdge_get_contact_0.apply(null,arguments)}, +on=b._emscripten_bind_b2RevoluteJointDef_get_userData_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_userData_0.apply(null,arguments)},pn=b._emscripten_bind_b2Body_ResetMassData_0=function(){return b.asm._emscripten_bind_b2Body_ResetMassData_0.apply(null,arguments)},qn=b._emscripten_bind_b2Fixture_GetAABB_1=function(){return b.asm._emscripten_bind_b2Fixture_GetAABB_1.apply(null,arguments)},rn=b._emscripten_bind_b2PrismaticJointDef_set_collideConnected_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_collideConnected_1.apply(null, +arguments)},sn=b._emscripten_bind_b2Body_GetMassData_1=function(){return b.asm._emscripten_bind_b2Body_GetMassData_1.apply(null,arguments)},tn=b._emscripten_bind_b2RevoluteJointDef_get_localAnchorA_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_localAnchorA_0.apply(null,arguments)},un=b._emscripten_bind_b2EdgeShape_ComputeMass_2=function(){return b.asm._emscripten_bind_b2EdgeShape_ComputeMass_2.apply(null,arguments)},vn=b._emscripten_bind_b2GearJointDef_get_bodyB_0=function(){return b.asm._emscripten_bind_b2GearJointDef_get_bodyB_0.apply(null, +arguments)},wn=b._emscripten_enum_b2LimitState_e_atLowerLimit=function(){return b.asm._emscripten_enum_b2LimitState_e_atLowerLimit.apply(null,arguments)},xn=b._emscripten_bind_b2ManifoldPoint_set_id_1=function(){return b.asm._emscripten_bind_b2ManifoldPoint_set_id_1.apply(null,arguments)},yn=b._emscripten_bind_b2WheelJointDef_get_bodyB_0=function(){return b.asm._emscripten_bind_b2WheelJointDef_get_bodyB_0.apply(null,arguments)},zn=b._emscripten_bind_b2WeldJoint_GetLocalAnchorB_0=function(){return b.asm._emscripten_bind_b2WeldJoint_GetLocalAnchorB_0.apply(null, +arguments)},An=b._emscripten_bind_b2RevoluteJointDef_set_localAnchorB_1=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_localAnchorB_1.apply(null,arguments)},Bn=b._emscripten_bind_b2Body_DestroyFixture_1=function(){return b.asm._emscripten_bind_b2Body_DestroyFixture_1.apply(null,arguments)},Cn=b._emscripten_bind_b2Profile_set_broadphase_1=function(){return b.asm._emscripten_bind_b2Profile_set_broadphase_1.apply(null,arguments)},Dn=b._emscripten_bind_b2WheelJointDef_get_localAnchorB_0= +function(){return b.asm._emscripten_bind_b2WheelJointDef_get_localAnchorB_0.apply(null,arguments)},En=b._emscripten_bind_b2ContactImpulse_get_count_0=function(){return b.asm._emscripten_bind_b2ContactImpulse_get_count_0.apply(null,arguments)},Fn=b._emscripten_bind_b2World_GetJointCount_0=function(){return b.asm._emscripten_bind_b2World_GetJointCount_0.apply(null,arguments)},Gn=b._emscripten_bind_b2WheelJoint_GetMotorSpeed_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetMotorSpeed_0.apply(null, +arguments)},Hn=b._emscripten_bind_b2WheelJointDef_get_dampingRatio_0=function(){return b.asm._emscripten_bind_b2WheelJointDef_get_dampingRatio_0.apply(null,arguments)},In=b._emscripten_bind_b2RayCastOutput_get_fraction_0=function(){return b.asm._emscripten_bind_b2RayCastOutput_get_fraction_0.apply(null,arguments)},Jn=b._emscripten_bind_b2AABB___destroy___0=function(){return b.asm._emscripten_bind_b2AABB___destroy___0.apply(null,arguments)},Kn=b._emscripten_bind_b2GearJoint_SetRatio_1=function(){return b.asm._emscripten_bind_b2GearJoint_SetRatio_1.apply(null, +arguments)},Ln=b._emscripten_bind_b2Body_ApplyLinearImpulse_3=function(){return b.asm._emscripten_bind_b2Body_ApplyLinearImpulse_3.apply(null,arguments)},Mn=b._emscripten_bind_b2Filter___destroy___0=function(){return b.asm._emscripten_bind_b2Filter___destroy___0.apply(null,arguments)},Nn=b._emscripten_bind_b2RopeJointDef_get_userData_0=function(){return b.asm._emscripten_bind_b2RopeJointDef_get_userData_0.apply(null,arguments)}; +b.___cxa_is_pointer_type=function(){return b.asm.___cxa_is_pointer_type.apply(null,arguments)}; +var On=b._emscripten_bind_b2BodyDef_get_fixedRotation_0=function(){return b.asm._emscripten_bind_b2BodyDef_get_fixedRotation_0.apply(null,arguments)},Pn=b._emscripten_bind_b2PrismaticJointDef_set_motorSpeed_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_motorSpeed_1.apply(null,arguments)},Qn=b._emscripten_bind_b2ChainShape_SetPrevVertex_1=function(){return b.asm._emscripten_bind_b2ChainShape_SetPrevVertex_1.apply(null,arguments)},Rn=b._emscripten_bind_b2MotorJoint_IsActive_0=function(){return b.asm._emscripten_bind_b2MotorJoint_IsActive_0.apply(null, +arguments)},Sn=b._emscripten_bind_b2MouseJoint_GetReactionTorque_1=function(){return b.asm._emscripten_bind_b2MouseJoint_GetReactionTorque_1.apply(null,arguments)},Tn=b._emscripten_bind_b2DistanceJointDef_set_collideConnected_1=function(){return b.asm._emscripten_bind_b2DistanceJointDef_set_collideConnected_1.apply(null,arguments)},Un=b._emscripten_bind_b2WheelJoint_GetUserData_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetUserData_0.apply(null,arguments)},Vn=b._emscripten_bind_b2Vec3_op_sub_1= +function(){return b.asm._emscripten_bind_b2Vec3_op_sub_1.apply(null,arguments)},Wn=b._emscripten_bind_b2WheelJoint_GetNext_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetNext_0.apply(null,arguments)},Xn=b._emscripten_bind_b2Shape_GetType_0=function(){return b.asm._emscripten_bind_b2Shape_GetType_0.apply(null,arguments)},Yn=b._emscripten_bind_b2AABB_IsValid_0=function(){return b.asm._emscripten_bind_b2AABB_IsValid_0.apply(null,arguments)},Zn=b._emscripten_bind_b2WheelJoint_GetBodyA_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetBodyA_0.apply(null, +arguments)},$n=b._emscripten_enum_b2ShapeType_e_chain=function(){return b.asm._emscripten_enum_b2ShapeType_e_chain.apply(null,arguments)},ao=b._emscripten_bind_b2PulleyJoint_GetLengthA_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetLengthA_0.apply(null,arguments)},bo=b._emscripten_bind_b2DistanceJointDef_get_frequencyHz_0=function(){return b.asm._emscripten_bind_b2DistanceJointDef_get_frequencyHz_0.apply(null,arguments)},co=b._emscripten_bind_b2RevoluteJoint_SetMotorSpeed_1=function(){return b.asm._emscripten_bind_b2RevoluteJoint_SetMotorSpeed_1.apply(null, +arguments)},eo=b._emscripten_bind_b2World___destroy___0=function(){return b.asm._emscripten_bind_b2World___destroy___0.apply(null,arguments)},fo=b._emscripten_bind_b2ChainShape_set_m_prevVertex_1=function(){return b.asm._emscripten_bind_b2ChainShape_set_m_prevVertex_1.apply(null,arguments)},go=b._emscripten_bind_b2ChainShape_get_m_hasNextVertex_0=function(){return b.asm._emscripten_bind_b2ChainShape_get_m_hasNextVertex_0.apply(null,arguments)},ho=b._emscripten_bind_b2ChainShape_SetNextVertex_1=function(){return b.asm._emscripten_bind_b2ChainShape_SetNextVertex_1.apply(null, +arguments)},io=b._emscripten_bind_b2Body_SetType_1=function(){return b.asm._emscripten_bind_b2Body_SetType_1.apply(null,arguments)},jo=b._emscripten_bind_b2Body_GetMass_0=function(){return b.asm._emscripten_bind_b2Body_GetMass_0.apply(null,arguments)},ko=b._emscripten_bind_b2Rot_b2Rot_0=function(){return b.asm._emscripten_bind_b2Rot_b2Rot_0.apply(null,arguments)},lo=b._emscripten_bind_b2Rot_b2Rot_1=function(){return b.asm._emscripten_bind_b2Rot_b2Rot_1.apply(null,arguments)},mo=b._emscripten_enum_b2JointType_e_distanceJoint= +function(){return b.asm._emscripten_enum_b2JointType_e_distanceJoint.apply(null,arguments)},no=b._emscripten_bind_b2WheelJoint_SetSpringDampingRatio_1=function(){return b.asm._emscripten_bind_b2WheelJoint_SetSpringDampingRatio_1.apply(null,arguments)},oo=b._emscripten_bind_b2MouseJoint_GetType_0=function(){return b.asm._emscripten_bind_b2MouseJoint_GetType_0.apply(null,arguments)},po=b._emscripten_bind_b2MouseJoint_GetTarget_0=function(){return b.asm._emscripten_bind_b2MouseJoint_GetTarget_0.apply(null, +arguments)},qo=b._emscripten_bind_JSQueryCallback___destroy___0=function(){return b.asm._emscripten_bind_JSQueryCallback___destroy___0.apply(null,arguments)},ro=b._emscripten_bind_b2Fixture_Refilter_0=function(){return b.asm._emscripten_bind_b2Fixture_Refilter_0.apply(null,arguments)},so=b._emscripten_bind_b2RevoluteJointDef_set_lowerAngle_1=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_lowerAngle_1.apply(null,arguments)},to=b._emscripten_bind_b2JointEdge___destroy___0=function(){return b.asm._emscripten_bind_b2JointEdge___destroy___0.apply(null, +arguments)},uo=b._emscripten_bind_b2PulleyJoint_GetRatio_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetRatio_0.apply(null,arguments)},vo=b._emscripten_bind_JSContactListener_BeginContact_1=function(){return b.asm._emscripten_bind_JSContactListener_BeginContact_1.apply(null,arguments)},wo=b._emscripten_bind_b2MotorJointDef_set_linearOffset_1=function(){return b.asm._emscripten_bind_b2MotorJointDef_set_linearOffset_1.apply(null,arguments)},xo=b._emscripten_enum_b2JointType_e_motorJoint= +function(){return b.asm._emscripten_enum_b2JointType_e_motorJoint.apply(null,arguments)},yo=b._emscripten_bind_b2EdgeShape_get_m_vertex2_0=function(){return b.asm._emscripten_bind_b2EdgeShape_get_m_vertex2_0.apply(null,arguments)},zo=b._emscripten_bind_b2JointEdge_get_next_0=function(){return b.asm._emscripten_bind_b2JointEdge_get_next_0.apply(null,arguments)},Ao=b._emscripten_bind_b2RayCastInput_set_maxFraction_1=function(){return b.asm._emscripten_bind_b2RayCastInput_set_maxFraction_1.apply(null, +arguments)},Bo=b._emscripten_bind_b2MouseJoint_GetBodyA_0=function(){return b.asm._emscripten_bind_b2MouseJoint_GetBodyA_0.apply(null,arguments)},Co=b._emscripten_bind_b2BodyDef_get_awake_0=function(){return b.asm._emscripten_bind_b2BodyDef_get_awake_0.apply(null,arguments)},Do=b._emscripten_bind_b2AABB_b2AABB_0=function(){return b.asm._emscripten_bind_b2AABB_b2AABB_0.apply(null,arguments)},Eo=b._emscripten_bind_b2Fixture_SetFriction_1=function(){return b.asm._emscripten_bind_b2Fixture_SetFriction_1.apply(null, +arguments)},Fo=b._emscripten_enum_b2DrawFlag_e_centerOfMassBit=function(){return b.asm._emscripten_enum_b2DrawFlag_e_centerOfMassBit.apply(null,arguments)},Go=b._emscripten_bind_b2World_CreateBody_1=function(){return b.asm._emscripten_bind_b2World_CreateBody_1.apply(null,arguments)},Ho=b._emscripten_bind_b2RopeJointDef_set_userData_1=function(){return b.asm._emscripten_bind_b2RopeJointDef_set_userData_1.apply(null,arguments)},Io=b._emscripten_bind_b2WeldJoint_GetNext_0=function(){return b.asm._emscripten_bind_b2WeldJoint_GetNext_0.apply(null, +arguments)},Jo=b._emscripten_bind_b2WeldJoint_GetType_0=function(){return b.asm._emscripten_bind_b2WeldJoint_GetType_0.apply(null,arguments)},Ko=b._emscripten_enum_b2ContactFeatureType_e_vertex=function(){return b.asm._emscripten_enum_b2ContactFeatureType_e_vertex.apply(null,arguments)},Lo=b._emscripten_bind_b2Rot___destroy___0=function(){return b.asm._emscripten_bind_b2Rot___destroy___0.apply(null,arguments)},Mo=b._emscripten_bind_b2Filter_get_maskBits_0=function(){return b.asm._emscripten_bind_b2Filter_get_maskBits_0.apply(null, +arguments)},No=b._emscripten_bind_b2Mat22_get_ex_0=function(){return b.asm._emscripten_bind_b2Mat22_get_ex_0.apply(null,arguments)},Oo=b._emscripten_bind_b2Body_GetFixtureList_0=function(){return b.asm._emscripten_bind_b2Body_GetFixtureList_0.apply(null,arguments)},Po=b._emscripten_bind_b2PulleyJoint___destroy___0=function(){return b.asm._emscripten_bind_b2PulleyJoint___destroy___0.apply(null,arguments)},Qo=b._emscripten_bind_b2MouseJointDef_set_dampingRatio_1=function(){return b.asm._emscripten_bind_b2MouseJointDef_set_dampingRatio_1.apply(null, +arguments)},Ro=b._emscripten_bind_JSRayCastCallback___destroy___0=function(){return b.asm._emscripten_bind_JSRayCastCallback___destroy___0.apply(null,arguments)},So=b._emscripten_bind_b2ContactListener___destroy___0=function(){return b.asm._emscripten_bind_b2ContactListener___destroy___0.apply(null,arguments)},To=b._emscripten_bind_b2PrismaticJointDef_set_localAnchorB_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_localAnchorB_1.apply(null,arguments)}; +b.establishStackSpace=function(){return b.asm.establishStackSpace.apply(null,arguments)}; +var Uo=b._emscripten_bind_b2FrictionJoint___destroy___0=function(){return b.asm._emscripten_bind_b2FrictionJoint___destroy___0.apply(null,arguments)},Vo=b._emscripten_bind_b2WeldJoint_Dump_0=function(){return b.asm._emscripten_bind_b2WeldJoint_Dump_0.apply(null,arguments)},Wo=b._emscripten_bind_b2MotorJoint_SetMaxForce_1=function(){return b.asm._emscripten_bind_b2MotorJoint_SetMaxForce_1.apply(null,arguments)},Xo=b._emscripten_bind_b2MouseJoint_GetFrequency_0=function(){return b.asm._emscripten_bind_b2MouseJoint_GetFrequency_0.apply(null, +arguments)},Yo=b._emscripten_bind_b2FrictionJoint_GetLocalAnchorA_0=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetLocalAnchorA_0.apply(null,arguments)},Zo=b._emscripten_bind_b2RevoluteJointDef_set_collideConnected_1=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_collideConnected_1.apply(null,arguments)},$o=b._emscripten_bind_b2GearJointDef_set_collideConnected_1=function(){return b.asm._emscripten_bind_b2GearJointDef_set_collideConnected_1.apply(null,arguments)},ap= +b._emscripten_bind_b2Vec2_IsValid_0=function(){return b.asm._emscripten_bind_b2Vec2_IsValid_0.apply(null,arguments)},bp=b._emscripten_bind_b2PrismaticJointDef_set_bodyA_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_bodyA_1.apply(null,arguments)},cp=b._emscripten_bind_b2World_GetWarmStarting_0=function(){return b.asm._emscripten_bind_b2World_GetWarmStarting_0.apply(null,arguments)},dp=b._emscripten_bind_b2RevoluteJointDef_set_enableLimit_1=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_enableLimit_1.apply(null, +arguments)},ep=b._emscripten_bind_b2WeldJointDef___destroy___0=function(){return b.asm._emscripten_bind_b2WeldJointDef___destroy___0.apply(null,arguments)},fp=b._emscripten_bind_b2Mat22_Solve_1=function(){return b.asm._emscripten_bind_b2Mat22_Solve_1.apply(null,arguments)},gp=b._emscripten_bind_b2Color_get_g_0=function(){return b.asm._emscripten_bind_b2Color_get_g_0.apply(null,arguments)},hp=b._emscripten_bind_VoidPtr___destroy___0=function(){return b.asm._emscripten_bind_VoidPtr___destroy___0.apply(null, +arguments)},ip=b._emscripten_bind_b2RopeJoint_GetNext_0=function(){return b.asm._emscripten_bind_b2RopeJoint_GetNext_0.apply(null,arguments)},jp=b._emscripten_bind_b2EdgeShape_get_m_type_0=function(){return b.asm._emscripten_bind_b2EdgeShape_get_m_type_0.apply(null,arguments)},kp=b._emscripten_bind_b2PolygonShape_GetChildCount_0=function(){return b.asm._emscripten_bind_b2PolygonShape_GetChildCount_0.apply(null,arguments)},lp=b._emscripten_bind_b2GearJointDef_get_ratio_0=function(){return b.asm._emscripten_bind_b2GearJointDef_get_ratio_0.apply(null, +arguments)},mp=b._emscripten_bind_b2Mat33_Solve33_1=function(){return b.asm._emscripten_bind_b2Mat33_Solve33_1.apply(null,arguments)},np=b._emscripten_bind_b2WeldJointDef_set_userData_1=function(){return b.asm._emscripten_bind_b2WeldJointDef_set_userData_1.apply(null,arguments)},op=b._emscripten_bind_b2PrismaticJoint_GetLocalAnchorB_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetLocalAnchorB_0.apply(null,arguments)},pp=b._emscripten_bind_b2RevoluteJointDef___destroy___0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef___destroy___0.apply(null, +arguments)},qp=b._emscripten_bind_b2MotorJointDef_get_correctionFactor_0=function(){return b.asm._emscripten_bind_b2MotorJointDef_get_correctionFactor_0.apply(null,arguments)},rp=b._emscripten_bind_b2ContactFeature_get_typeB_0=function(){return b.asm._emscripten_bind_b2ContactFeature_get_typeB_0.apply(null,arguments)},sp=b._emscripten_bind_b2ContactID_get_key_0=function(){return b.asm._emscripten_bind_b2ContactID_get_key_0.apply(null,arguments)},tp=b._emscripten_bind_b2MotorJoint_GetReactionForce_1= +function(){return b.asm._emscripten_bind_b2MotorJoint_GetReactionForce_1.apply(null,arguments)},up=b._emscripten_bind_b2Rot_GetAngle_0=function(){return b.asm._emscripten_bind_b2Rot_GetAngle_0.apply(null,arguments)},vp=b._emscripten_bind_b2World_SetAllowSleeping_1=function(){return b.asm._emscripten_bind_b2World_SetAllowSleeping_1.apply(null,arguments)},wp=b._emscripten_bind_b2RopeJoint_GetType_0=function(){return b.asm._emscripten_bind_b2RopeJoint_GetType_0.apply(null,arguments)},xp=b._emscripten_bind_b2MotorJoint_SetAngularOffset_1= +function(){return b.asm._emscripten_bind_b2MotorJoint_SetAngularOffset_1.apply(null,arguments)},yp=b._emscripten_bind_b2MotorJoint_GetLinearOffset_0=function(){return b.asm._emscripten_bind_b2MotorJoint_GetLinearOffset_0.apply(null,arguments)},zp=b._emscripten_bind_b2FrictionJoint_GetCollideConnected_0=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetCollideConnected_0.apply(null,arguments)},Ap=b._emscripten_bind_b2WheelJointDef_set_motorSpeed_1=function(){return b.asm._emscripten_bind_b2WheelJointDef_set_motorSpeed_1.apply(null, +arguments)},Bp=b._emscripten_bind_b2MotorJoint_GetAnchorA_0=function(){return b.asm._emscripten_bind_b2MotorJoint_GetAnchorA_0.apply(null,arguments)},Cp=b._emscripten_bind_b2Fixture_GetDensity_0=function(){return b.asm._emscripten_bind_b2Fixture_GetDensity_0.apply(null,arguments)},Dp=b._emscripten_bind_b2MouseJointDef_get_type_0=function(){return b.asm._emscripten_bind_b2MouseJointDef_get_type_0.apply(null,arguments)},Ep=b._emscripten_bind_b2Vec2_Set_2=function(){return b.asm._emscripten_bind_b2Vec2_Set_2.apply(null, +arguments)},Fp=b._emscripten_bind_b2WeldJointDef_get_type_0=function(){return b.asm._emscripten_bind_b2WeldJointDef_get_type_0.apply(null,arguments)},Gp=b._emscripten_bind_b2MouseJointDef_b2MouseJointDef_0=function(){return b.asm._emscripten_bind_b2MouseJointDef_b2MouseJointDef_0.apply(null,arguments)},Hp=b._emscripten_bind_b2Rot_get_s_0=function(){return b.asm._emscripten_bind_b2Rot_get_s_0.apply(null,arguments)},Ip=b._emscripten_bind_b2FrictionJoint_SetMaxTorque_1=function(){return b.asm._emscripten_bind_b2FrictionJoint_SetMaxTorque_1.apply(null, +arguments)},Jp=b._emscripten_bind_b2MouseJointDef_get_frequencyHz_0=function(){return b.asm._emscripten_bind_b2MouseJointDef_get_frequencyHz_0.apply(null,arguments)},Kp=b._emscripten_bind_b2FrictionJoint_SetUserData_1=function(){return b.asm._emscripten_bind_b2FrictionJoint_SetUserData_1.apply(null,arguments)},Lp=b._emscripten_bind_b2RayCastInput_get_p1_0=function(){return b.asm._emscripten_bind_b2RayCastInput_get_p1_0.apply(null,arguments)},Mp=b._emscripten_bind_b2DistanceJointDef_get_collideConnected_0= +function(){return b.asm._emscripten_bind_b2DistanceJointDef_get_collideConnected_0.apply(null,arguments)},Np=b._emscripten_bind_b2RevoluteJointDef_set_referenceAngle_1=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_referenceAngle_1.apply(null,arguments)},Op=b._emscripten_bind_b2ContactFeature___destroy___0=function(){return b.asm._emscripten_bind_b2ContactFeature___destroy___0.apply(null,arguments)},Pp=b._emscripten_bind_b2Color___destroy___0=function(){return b.asm._emscripten_bind_b2Color___destroy___0.apply(null, +arguments)},Qp=b._emscripten_bind_b2DistanceJointDef_set_bodyB_1=function(){return b.asm._emscripten_bind_b2DistanceJointDef_set_bodyB_1.apply(null,arguments)},Rp=b._emscripten_bind_b2ChainShape_get_m_hasPrevVertex_0=function(){return b.asm._emscripten_bind_b2ChainShape_get_m_hasPrevVertex_0.apply(null,arguments)},Sp=b._emscripten_bind_b2PulleyJointDef_b2PulleyJointDef_0=function(){return b.asm._emscripten_bind_b2PulleyJointDef_b2PulleyJointDef_0.apply(null,arguments)},Tp=b._emscripten_bind_b2RevoluteJoint_GetType_0= +function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetType_0.apply(null,arguments)},Up=b._emscripten_bind_b2MassData_b2MassData_0=function(){return b.asm._emscripten_bind_b2MassData_b2MassData_0.apply(null,arguments)},Vp=b._emscripten_bind_b2Vec3_set_y_1=function(){return b.asm._emscripten_bind_b2Vec3_set_y_1.apply(null,arguments)},Wp=b._emscripten_bind_b2BodyDef_set_angularDamping_1=function(){return b.asm._emscripten_bind_b2BodyDef_set_angularDamping_1.apply(null,arguments)},Xp=b._emscripten_bind_b2AABB_Combine_1= +function(){return b.asm._emscripten_bind_b2AABB_Combine_1.apply(null,arguments)},Yp=b._emscripten_bind_b2WheelJointDef_set_bodyB_1=function(){return b.asm._emscripten_bind_b2WheelJointDef_set_bodyB_1.apply(null,arguments)},Zp=b._emscripten_bind_b2PrismaticJoint_GetBodyA_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetBodyA_0.apply(null,arguments)},$p=b._emscripten_bind_b2PrismaticJoint_GetMaxMotorForce_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetMaxMotorForce_0.apply(null, +arguments)},aq=b._emscripten_bind_b2RevoluteJointDef_get_upperAngle_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_upperAngle_0.apply(null,arguments)},bq=b._emscripten_bind_b2Body_IsSleepingAllowed_0=function(){return b.asm._emscripten_bind_b2Body_IsSleepingAllowed_0.apply(null,arguments)},cq=b._emscripten_bind_b2MotorJoint_GetCorrectionFactor_0=function(){return b.asm._emscripten_bind_b2MotorJoint_GetCorrectionFactor_0.apply(null,arguments)},dq=b._emscripten_bind_b2Profile_get_solve_0= +function(){return b.asm._emscripten_bind_b2Profile_get_solve_0.apply(null,arguments)},eq=b._emscripten_bind_JSDestructionListener_SayGoodbyeFixture_1=function(){return b.asm._emscripten_bind_JSDestructionListener_SayGoodbyeFixture_1.apply(null,arguments)},fq=b._emscripten_bind_b2PolygonShape_GetVertexCount_0=function(){return b.asm._emscripten_bind_b2PolygonShape_GetVertexCount_0.apply(null,arguments)},gq=b._emscripten_bind_b2Rot_get_c_0=function(){return b.asm._emscripten_bind_b2Rot_get_c_0.apply(null, +arguments)},hq=b._emscripten_bind_b2AABB_set_lowerBound_1=function(){return b.asm._emscripten_bind_b2AABB_set_lowerBound_1.apply(null,arguments)},iq=b._emscripten_bind_b2Fixture_SetFilterData_1=function(){return b.asm._emscripten_bind_b2Fixture_SetFilterData_1.apply(null,arguments)},jq=b._emscripten_bind_b2MouseJoint_SetMaxForce_1=function(){return b.asm._emscripten_bind_b2MouseJoint_SetMaxForce_1.apply(null,arguments)},kq=b._emscripten_bind_b2WheelJoint_IsMotorEnabled_0=function(){return b.asm._emscripten_bind_b2WheelJoint_IsMotorEnabled_0.apply(null, +arguments)},lq=b._emscripten_bind_b2JointDef_set_userData_1=function(){return b.asm._emscripten_bind_b2JointDef_set_userData_1.apply(null,arguments)},mq=b._emscripten_bind_b2ManifoldPoint_get_tangentImpulse_0=function(){return b.asm._emscripten_bind_b2ManifoldPoint_get_tangentImpulse_0.apply(null,arguments)},nq=b._emscripten_bind_b2RevoluteJointDef_get_maxMotorTorque_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_maxMotorTorque_0.apply(null,arguments)},oq=b._emscripten_bind_b2WeldJointDef_get_dampingRatio_0= +function(){return b.asm._emscripten_bind_b2WeldJointDef_get_dampingRatio_0.apply(null,arguments)},pq=b._emscripten_bind_b2Rot_SetIdentity_0=function(){return b.asm._emscripten_bind_b2Rot_SetIdentity_0.apply(null,arguments)},qq=b._emscripten_bind_b2EdgeShape_b2EdgeShape_0=function(){return b.asm._emscripten_bind_b2EdgeShape_b2EdgeShape_0.apply(null,arguments)},rq=b._emscripten_bind_b2FrictionJoint_GetReactionForce_1=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetReactionForce_1.apply(null, +arguments)},sq=b._emscripten_bind_b2MouseJoint_GetUserData_0=function(){return b.asm._emscripten_bind_b2MouseJoint_GetUserData_0.apply(null,arguments)},tq=b._emscripten_bind_b2DistanceJointDef_set_type_1=function(){return b.asm._emscripten_bind_b2DistanceJointDef_set_type_1.apply(null,arguments)},uq=b._emscripten_bind_b2WeldJoint_GetAnchorA_0=function(){return b.asm._emscripten_bind_b2WeldJoint_GetAnchorA_0.apply(null,arguments)},vq=b._emscripten_bind_b2WeldJoint___destroy___0=function(){return b.asm._emscripten_bind_b2WeldJoint___destroy___0.apply(null, +arguments)},wq=b._emscripten_bind_b2Manifold_b2Manifold_0=function(){return b.asm._emscripten_bind_b2Manifold_b2Manifold_0.apply(null,arguments)},xq=b._emscripten_bind_JSContactListener_PostSolve_2=function(){return b.asm._emscripten_bind_JSContactListener_PostSolve_2.apply(null,arguments)},yq=b._emscripten_bind_b2PulleyJoint_GetBodyA_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetBodyA_0.apply(null,arguments)},zq=b._emscripten_bind_b2RopeJointDef_get_type_0=function(){return b.asm._emscripten_bind_b2RopeJointDef_get_type_0.apply(null, +arguments)},Aq=b._emscripten_bind_b2CircleShape_ComputeMass_2=function(){return b.asm._emscripten_bind_b2CircleShape_ComputeMass_2.apply(null,arguments)},Bq=b._emscripten_bind_b2DistanceJointDef_get_localAnchorB_0=function(){return b.asm._emscripten_bind_b2DistanceJointDef_get_localAnchorB_0.apply(null,arguments)},Cq=b._emscripten_bind_b2GearJointDef___destroy___0=function(){return b.asm._emscripten_bind_b2GearJointDef___destroy___0.apply(null,arguments)},Dq=b._emscripten_bind_b2PulleyJointDef_set_localAnchorA_1= +function(){return b.asm._emscripten_bind_b2PulleyJointDef_set_localAnchorA_1.apply(null,arguments)},Eq=b._emscripten_enum_b2BodyType_b2_dynamicBody=function(){return b.asm._emscripten_enum_b2BodyType_b2_dynamicBody.apply(null,arguments)},Fq=b._emscripten_bind_b2CircleShape_TestPoint_2=function(){return b.asm._emscripten_bind_b2CircleShape_TestPoint_2.apply(null,arguments)},Gq=b._emscripten_bind_b2MotorJointDef_get_maxTorque_0=function(){return b.asm._emscripten_bind_b2MotorJointDef_get_maxTorque_0.apply(null, +arguments)},Hq=b._emscripten_bind_b2Body_GetLinearVelocityFromLocalPoint_1=function(){return b.asm._emscripten_bind_b2Body_GetLinearVelocityFromLocalPoint_1.apply(null,arguments)},Iq=b._emscripten_bind_b2FrictionJointDef_set_bodyB_1=function(){return b.asm._emscripten_bind_b2FrictionJointDef_set_bodyB_1.apply(null,arguments)},Jq=b._emscripten_bind_b2MouseJoint_GetAnchorB_0=function(){return b.asm._emscripten_bind_b2MouseJoint_GetAnchorB_0.apply(null,arguments)},Kq=b._emscripten_bind_b2RopeJointDef_get_localAnchorB_0= +function(){return b.asm._emscripten_bind_b2RopeJointDef_get_localAnchorB_0.apply(null,arguments)},Lq=b._emscripten_bind_b2GearJoint_GetBodyB_0=function(){return b.asm._emscripten_bind_b2GearJoint_GetBodyB_0.apply(null,arguments)},Mq=b._emscripten_bind_b2ChainShape_Clear_0=function(){return b.asm._emscripten_bind_b2ChainShape_Clear_0.apply(null,arguments)},Nq=b._emscripten_bind_b2CircleShape___destroy___0=function(){return b.asm._emscripten_bind_b2CircleShape___destroy___0.apply(null,arguments)},Oq= +b._emscripten_bind_b2MotorJoint_GetType_0=function(){return b.asm._emscripten_bind_b2MotorJoint_GetType_0.apply(null,arguments)},Pq=b._emscripten_bind_b2World_GetContactCount_0=function(){return b.asm._emscripten_bind_b2World_GetContactCount_0.apply(null,arguments)},Qq=b._emscripten_bind_b2Contact_SetRestitution_1=function(){return b.asm._emscripten_bind_b2Contact_SetRestitution_1.apply(null,arguments)},Rq=b._emscripten_bind_b2BodyDef_get_angularDamping_0=function(){return b.asm._emscripten_bind_b2BodyDef_get_angularDamping_0.apply(null, +arguments)},Sq=b._emscripten_bind_b2EdgeShape_get_m_vertex3_0=function(){return b.asm._emscripten_bind_b2EdgeShape_get_m_vertex3_0.apply(null,arguments)},Tq=b._emscripten_bind_b2MassData_set_center_1=function(){return b.asm._emscripten_bind_b2MassData_set_center_1.apply(null,arguments)},Uq=b._emscripten_bind_b2Transform_SetIdentity_0=function(){return b.asm._emscripten_bind_b2Transform_SetIdentity_0.apply(null,arguments)},Vq=b._emscripten_bind_b2GearJointDef_set_joint1_1=function(){return b.asm._emscripten_bind_b2GearJointDef_set_joint1_1.apply(null, +arguments)},Wq=b._emscripten_bind_b2EdgeShape_set_m_vertex2_1=function(){return b.asm._emscripten_bind_b2EdgeShape_set_m_vertex2_1.apply(null,arguments)},Xq=b._emscripten_bind_b2Contact_SetFriction_1=function(){return b.asm._emscripten_bind_b2Contact_SetFriction_1.apply(null,arguments)},Yq=b._emscripten_bind_b2MouseJointDef_set_collideConnected_1=function(){return b.asm._emscripten_bind_b2MouseJointDef_set_collideConnected_1.apply(null,arguments)},Zq=b._emscripten_bind_b2ContactFeature_set_indexB_1= +function(){return b.asm._emscripten_bind_b2ContactFeature_set_indexB_1.apply(null,arguments)},$q=b._emscripten_bind_b2Body_GetLinearVelocityFromWorldPoint_1=function(){return b.asm._emscripten_bind_b2Body_GetLinearVelocityFromWorldPoint_1.apply(null,arguments)},ar=b._emscripten_bind_b2WeldJoint_GetCollideConnected_0=function(){return b.asm._emscripten_bind_b2WeldJoint_GetCollideConnected_0.apply(null,arguments)},br=b._emscripten_bind_b2Mat22_GetInverse_0=function(){return b.asm._emscripten_bind_b2Mat22_GetInverse_0.apply(null, +arguments)},cr=b._emscripten_bind_b2WheelJointDef_set_frequencyHz_1=function(){return b.asm._emscripten_bind_b2WheelJointDef_set_frequencyHz_1.apply(null,arguments)},dr=b._emscripten_bind_b2World_GetSubStepping_0=function(){return b.asm._emscripten_bind_b2World_GetSubStepping_0.apply(null,arguments)},er=b._emscripten_bind_b2Rot_GetYAxis_0=function(){return b.asm._emscripten_bind_b2Rot_GetYAxis_0.apply(null,arguments)}; +b._emscripten_get_global_libc=function(){return b.asm._emscripten_get_global_libc.apply(null,arguments)}; +var fr=b._emscripten_bind_b2WheelJointDef_get_localAxisA_0=function(){return b.asm._emscripten_bind_b2WheelJointDef_get_localAxisA_0.apply(null,arguments)},gr=b._emscripten_bind_b2RopeJoint_GetBodyB_0=function(){return b.asm._emscripten_bind_b2RopeJoint_GetBodyB_0.apply(null,arguments)},hr=b._emscripten_bind_b2EdgeShape_GetType_0=function(){return b.asm._emscripten_bind_b2EdgeShape_GetType_0.apply(null,arguments)},ir=b._emscripten_bind_b2Mat22_set_ex_1=function(){return b.asm._emscripten_bind_b2Mat22_set_ex_1.apply(null, +arguments)},jr=b._emscripten_bind_b2ManifoldPoint___destroy___0=function(){return b.asm._emscripten_bind_b2ManifoldPoint___destroy___0.apply(null,arguments)},kr=b._emscripten_enum_b2JointType_e_prismaticJoint=function(){return b.asm._emscripten_enum_b2JointType_e_prismaticJoint.apply(null,arguments)},lr=b._emscripten_bind_b2WeldJointDef_get_referenceAngle_0=function(){return b.asm._emscripten_bind_b2WeldJointDef_get_referenceAngle_0.apply(null,arguments)},mr=b._emscripten_bind_b2Vec2_Length_0=function(){return b.asm._emscripten_bind_b2Vec2_Length_0.apply(null, +arguments)},nr=b._emscripten_bind_b2Vec2_SetZero_0=function(){return b.asm._emscripten_bind_b2Vec2_SetZero_0.apply(null,arguments)},or=b._emscripten_bind_b2RopeJoint___destroy___0=function(){return b.asm._emscripten_bind_b2RopeJoint___destroy___0.apply(null,arguments)},pr=b._emscripten_bind_b2World_DestroyJoint_1=function(){return b.asm._emscripten_bind_b2World_DestroyJoint_1.apply(null,arguments)},qr=b._emscripten_bind_b2JointDef_set_bodyB_1=function(){return b.asm._emscripten_bind_b2JointDef_set_bodyB_1.apply(null, +arguments)},rr=b._emscripten_bind_b2Mat22_Set_2=function(){return b.asm._emscripten_bind_b2Mat22_Set_2.apply(null,arguments)},sr=b._emscripten_bind_b2JointEdge_set_next_1=function(){return b.asm._emscripten_bind_b2JointEdge_set_next_1.apply(null,arguments)},tr=b._emscripten_bind_b2WeldJoint_GetAnchorB_0=function(){return b.asm._emscripten_bind_b2WeldJoint_GetAnchorB_0.apply(null,arguments)},ur=b._emscripten_enum_b2DrawFlag_e_aabbBit=function(){return b.asm._emscripten_enum_b2DrawFlag_e_aabbBit.apply(null, +arguments)},vr=b._emscripten_bind_b2EdgeShape_ComputeAABB_3=function(){return b.asm._emscripten_bind_b2EdgeShape_ComputeAABB_3.apply(null,arguments)},wr=b._emscripten_bind_b2PolygonShape_set_m_centroid_1=function(){return b.asm._emscripten_bind_b2PolygonShape_set_m_centroid_1.apply(null,arguments)},xr=b._emscripten_bind_b2WheelJointDef_set_collideConnected_1=function(){return b.asm._emscripten_bind_b2WheelJointDef_set_collideConnected_1.apply(null,arguments)},yr=b._emscripten_bind_b2World_GetJointList_0= +function(){return b.asm._emscripten_bind_b2World_GetJointList_0.apply(null,arguments)},zr=b._emscripten_bind_b2MotorJointDef_get_type_0=function(){return b.asm._emscripten_bind_b2MotorJointDef_get_type_0.apply(null,arguments)},Ar=b._emscripten_bind_b2RopeJoint_GetLocalAnchorA_0=function(){return b.asm._emscripten_bind_b2RopeJoint_GetLocalAnchorA_0.apply(null,arguments)},Br=b._emscripten_bind_b2BodyDef_set_linearDamping_1=function(){return b.asm._emscripten_bind_b2BodyDef_set_linearDamping_1.apply(null, +arguments)},Cr=b._emscripten_bind_b2FrictionJoint_GetUserData_0=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetUserData_0.apply(null,arguments)},Dr=b._emscripten_bind_b2Shape_TestPoint_2=function(){return b.asm._emscripten_bind_b2Shape_TestPoint_2.apply(null,arguments)},Er=b._emscripten_bind_b2Manifold_set_localNormal_1=function(){return b.asm._emscripten_bind_b2Manifold_set_localNormal_1.apply(null,arguments)},Fr=b._emscripten_bind_b2JointDef_get_bodyA_0=function(){return b.asm._emscripten_bind_b2JointDef_get_bodyA_0.apply(null, +arguments)},Gr=b._emscripten_bind_b2Body_GetLinearDamping_0=function(){return b.asm._emscripten_bind_b2Body_GetLinearDamping_0.apply(null,arguments)},Hr=b._emscripten_bind_b2WeldJointDef_set_frequencyHz_1=function(){return b.asm._emscripten_bind_b2WeldJointDef_set_frequencyHz_1.apply(null,arguments)},Ir=b._emscripten_bind_b2BodyDef_set_userData_1=function(){return b.asm._emscripten_bind_b2BodyDef_set_userData_1.apply(null,arguments)},Jr=b._emscripten_bind_b2PrismaticJointDef_set_enableMotor_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_enableMotor_1.apply(null, +arguments)},Kr=b._emscripten_bind_b2Vec2_Skew_0=function(){return b.asm._emscripten_bind_b2Vec2_Skew_0.apply(null,arguments)},Lr=b._emscripten_bind_b2MouseJoint_GetDampingRatio_0=function(){return b.asm._emscripten_bind_b2MouseJoint_GetDampingRatio_0.apply(null,arguments)},Mr=b._emscripten_bind_b2RevoluteJoint_GetAnchorA_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetAnchorA_0.apply(null,arguments)},Nr=b._emscripten_bind_b2ContactFeature_set_typeB_1=function(){return b.asm._emscripten_bind_b2ContactFeature_set_typeB_1.apply(null, +arguments)},Or=b._emscripten_bind_b2WheelJoint_GetAnchorA_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetAnchorA_0.apply(null,arguments)},Pr=b._emscripten_bind_b2MotorJoint_GetMaxTorque_0=function(){return b.asm._emscripten_bind_b2MotorJoint_GetMaxTorque_0.apply(null,arguments)};b.setThrew=function(){return b.asm.setThrew.apply(null,arguments)}; +var Qr=b._emscripten_bind_b2PrismaticJointDef_set_userData_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_userData_1.apply(null,arguments)},Rr=b._emscripten_bind_b2FrictionJointDef_set_type_1=function(){return b.asm._emscripten_bind_b2FrictionJointDef_set_type_1.apply(null,arguments)},Sr=b._emscripten_bind_b2FrictionJointDef_Initialize_3=function(){return b.asm._emscripten_bind_b2FrictionJointDef_Initialize_3.apply(null,arguments)},Nb=b._sbrk=function(){return b.asm._sbrk.apply(null, +arguments)},Tr=b._emscripten_bind_b2FrictionJointDef_get_collideConnected_0=function(){return b.asm._emscripten_bind_b2FrictionJointDef_get_collideConnected_0.apply(null,arguments)},Ib=b._memcpy=function(){return b.asm._memcpy.apply(null,arguments)},Ur=b._emscripten_bind_b2FrictionJoint_GetAnchorA_0=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetAnchorA_0.apply(null,arguments)},Vr=b._emscripten_enum_b2DrawFlag_e_pairBit=function(){return b.asm._emscripten_enum_b2DrawFlag_e_pairBit.apply(null, +arguments)},Wr=b._emscripten_bind_b2MassData_get_I_0=function(){return b.asm._emscripten_bind_b2MassData_get_I_0.apply(null,arguments)},Xr=b._emscripten_bind_b2WheelJointDef_get_motorSpeed_0=function(){return b.asm._emscripten_bind_b2WheelJointDef_get_motorSpeed_0.apply(null,arguments)},Yr=b._emscripten_bind_b2Filter_set_maskBits_1=function(){return b.asm._emscripten_bind_b2Filter_set_maskBits_1.apply(null,arguments)},Zr=b._emscripten_bind_b2WheelJoint_GetCollideConnected_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetCollideConnected_0.apply(null, +arguments)},$r=b._emscripten_bind_b2EdgeShape_get_m_radius_0=function(){return b.asm._emscripten_bind_b2EdgeShape_get_m_radius_0.apply(null,arguments)},as=b._emscripten_bind_b2World_GetTreeHeight_0=function(){return b.asm._emscripten_bind_b2World_GetTreeHeight_0.apply(null,arguments)},bs=b._emscripten_bind_b2Mat22_b2Mat22_2=function(){return b.asm._emscripten_bind_b2Mat22_b2Mat22_2.apply(null,arguments)},cs=b._emscripten_bind_b2PrismaticJoint_GetNext_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetNext_0.apply(null, +arguments)},ds=b._emscripten_bind_b2Mat22_b2Mat22_0=function(){return b.asm._emscripten_bind_b2Mat22_b2Mat22_0.apply(null,arguments)},es=b._emscripten_bind_b2PrismaticJointDef_get_bodyA_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_bodyA_0.apply(null,arguments)},gs=b._emscripten_bind_b2RopeJointDef_set_localAnchorA_1=function(){return b.asm._emscripten_bind_b2RopeJointDef_set_localAnchorA_1.apply(null,arguments)},hs=b._emscripten_bind_b2ChainShape_set_m_hasNextVertex_1=function(){return b.asm._emscripten_bind_b2ChainShape_set_m_hasNextVertex_1.apply(null, +arguments)},is=b._emscripten_bind_b2Mat22_set_ey_1=function(){return b.asm._emscripten_bind_b2Mat22_set_ey_1.apply(null,arguments)},js=b._emscripten_bind_b2MotorJointDef_set_angularOffset_1=function(){return b.asm._emscripten_bind_b2MotorJointDef_set_angularOffset_1.apply(null,arguments)},ks=b._emscripten_bind_b2CircleShape_get_m_type_0=function(){return b.asm._emscripten_bind_b2CircleShape_get_m_type_0.apply(null,arguments)},ls=b._emscripten_bind_b2Body_GetType_0=function(){return b.asm._emscripten_bind_b2Body_GetType_0.apply(null, +arguments)},ms=b._emscripten_bind_b2ContactEdge_b2ContactEdge_0=function(){return b.asm._emscripten_bind_b2ContactEdge_b2ContactEdge_0.apply(null,arguments)},ns=b._emscripten_bind_b2BodyDef___destroy___0=function(){return b.asm._emscripten_bind_b2BodyDef___destroy___0.apply(null,arguments)},ps=b._emscripten_bind_b2FrictionJointDef_set_maxTorque_1=function(){return b.asm._emscripten_bind_b2FrictionJointDef_set_maxTorque_1.apply(null,arguments)},Qa=b._free=function(){return b.asm._free.apply(null,arguments)}, +qs=b._emscripten_bind_b2PulleyJointDef_set_groundAnchorB_1=function(){return b.asm._emscripten_bind_b2PulleyJointDef_set_groundAnchorB_1.apply(null,arguments)},rs=b._emscripten_bind_b2RevoluteJointDef_get_collideConnected_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_collideConnected_0.apply(null,arguments)},ss=b._emscripten_bind_b2DistanceJointDef_set_bodyA_1=function(){return b.asm._emscripten_bind_b2DistanceJointDef_set_bodyA_1.apply(null,arguments)}; +b.runPostSets=function(){return b.asm.runPostSets.apply(null,arguments)}; +var ts=b._emscripten_bind_b2RevoluteJoint_SetLimits_2=function(){return b.asm._emscripten_bind_b2RevoluteJoint_SetLimits_2.apply(null,arguments)},us=b._emscripten_bind_b2WeldJointDef_set_type_1=function(){return b.asm._emscripten_bind_b2WeldJointDef_set_type_1.apply(null,arguments)},vs=b._emscripten_bind_b2MotorJointDef___destroy___0=function(){return b.asm._emscripten_bind_b2MotorJointDef___destroy___0.apply(null,arguments)},xs=b._emscripten_bind_b2FrictionJoint_GetNext_0=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetNext_0.apply(null, +arguments)},ys=b._emscripten_bind_b2Shape_set_m_type_1=function(){return b.asm._emscripten_bind_b2Shape_set_m_type_1.apply(null,arguments)},zs=b._emscripten_bind_b2WheelJoint_GetJointTranslation_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetJointTranslation_0.apply(null,arguments)},As=b._emscripten_bind_b2WheelJoint_GetMotorTorque_1=function(){return b.asm._emscripten_bind_b2WheelJoint_GetMotorTorque_1.apply(null,arguments)},Bs=b._emscripten_bind_b2RopeJoint_SetUserData_1=function(){return b.asm._emscripten_bind_b2RopeJoint_SetUserData_1.apply(null, +arguments)},Cs=b._emscripten_bind_b2RopeJointDef___destroy___0=function(){return b.asm._emscripten_bind_b2RopeJointDef___destroy___0.apply(null,arguments)},Ds=b._emscripten_bind_b2WheelJoint_IsActive_0=function(){return b.asm._emscripten_bind_b2WheelJoint_IsActive_0.apply(null,arguments)},Es=b._emscripten_bind_b2PrismaticJointDef_get_enableMotor_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_enableMotor_0.apply(null,arguments)},Fs=b._emscripten_bind_b2MotorJointDef_set_bodyB_1= +function(){return b.asm._emscripten_bind_b2MotorJointDef_set_bodyB_1.apply(null,arguments)},Gs=b._emscripten_bind_JSDestructionListener___destroy___0=function(){return b.asm._emscripten_bind_JSDestructionListener___destroy___0.apply(null,arguments)},Hs=b._emscripten_bind_b2Transform_b2Transform_2=function(){return b.asm._emscripten_bind_b2Transform_b2Transform_2.apply(null,arguments)},Is=b._emscripten_bind_b2WeldJoint_GetReactionForce_1=function(){return b.asm._emscripten_bind_b2WeldJoint_GetReactionForce_1.apply(null, +arguments)},Js=b._emscripten_bind_b2ChainShape_RayCast_4=function(){return b.asm._emscripten_bind_b2ChainShape_RayCast_4.apply(null,arguments)},Ks=b._emscripten_bind_b2Vec2_set_y_1=function(){return b.asm._emscripten_bind_b2Vec2_set_y_1.apply(null,arguments)},Ls=b._emscripten_bind_b2PrismaticJoint_SetMotorSpeed_1=function(){return b.asm._emscripten_bind_b2PrismaticJoint_SetMotorSpeed_1.apply(null,arguments)},Ms=b._emscripten_bind_b2ContactID_get_cf_0=function(){return b.asm._emscripten_bind_b2ContactID_get_cf_0.apply(null, +arguments)},Ns=b._emscripten_bind_b2DistanceJointDef_Initialize_4=function(){return b.asm._emscripten_bind_b2DistanceJointDef_Initialize_4.apply(null,arguments)},Os=b._emscripten_bind_b2ChainShape_get_m_radius_0=function(){return b.asm._emscripten_bind_b2ChainShape_get_m_radius_0.apply(null,arguments)},Ps=b._emscripten_bind_b2WeldJointDef_set_localAnchorB_1=function(){return b.asm._emscripten_bind_b2WeldJointDef_set_localAnchorB_1.apply(null,arguments)},Qs=b._emscripten_bind_b2ChainShape_set_m_radius_1= +function(){return b.asm._emscripten_bind_b2ChainShape_set_m_radius_1.apply(null,arguments)},Rs=b._emscripten_bind_b2DistanceJoint_GetReactionTorque_1=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetReactionTorque_1.apply(null,arguments)},Ss=b._emscripten_bind_b2World_Dump_0=function(){return b.asm._emscripten_bind_b2World_Dump_0.apply(null,arguments)},Ts=b._emscripten_bind_b2RevoluteJoint_GetLocalAnchorB_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetLocalAnchorB_0.apply(null, +arguments)},Us=b._emscripten_bind_JSContactFilter_JSContactFilter_0=function(){return b.asm._emscripten_bind_JSContactFilter_JSContactFilter_0.apply(null,arguments)},Vs=b._emscripten_bind_b2Profile_set_solve_1=function(){return b.asm._emscripten_bind_b2Profile_set_solve_1.apply(null,arguments)},Ws=b._emscripten_bind_b2FixtureDef_set_density_1=function(){return b.asm._emscripten_bind_b2FixtureDef_set_density_1.apply(null,arguments)},Xs=b._emscripten_bind_b2WeldJoint_GetDampingRatio_0=function(){return b.asm._emscripten_bind_b2WeldJoint_GetDampingRatio_0.apply(null, +arguments)},Ys=b._emscripten_bind_b2Color_get_b_0=function(){return b.asm._emscripten_bind_b2Color_get_b_0.apply(null,arguments)},Zs=b._emscripten_bind_b2MouseJointDef_get_userData_0=function(){return b.asm._emscripten_bind_b2MouseJointDef_get_userData_0.apply(null,arguments)},$s=b._emscripten_bind_b2CircleShape_ComputeAABB_3=function(){return b.asm._emscripten_bind_b2CircleShape_ComputeAABB_3.apply(null,arguments)},at=b._emscripten_bind_b2RopeJoint_GetReactionForce_1=function(){return b.asm._emscripten_bind_b2RopeJoint_GetReactionForce_1.apply(null, +arguments)},bt=b._emscripten_bind_b2PrismaticJointDef_get_enableLimit_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_enableLimit_0.apply(null,arguments)},ct=b._emscripten_bind_b2ManifoldPoint_set_localPoint_1=function(){return b.asm._emscripten_bind_b2ManifoldPoint_set_localPoint_1.apply(null,arguments)},dt=b._emscripten_bind_b2Fixture_GetFilterData_0=function(){return b.asm._emscripten_bind_b2Fixture_GetFilterData_0.apply(null,arguments)},et=b._emscripten_bind_b2World_GetBodyList_0= +function(){return b.asm._emscripten_bind_b2World_GetBodyList_0.apply(null,arguments)},ft=b._emscripten_bind_b2Body_GetJointList_0=function(){return b.asm._emscripten_bind_b2Body_GetJointList_0.apply(null,arguments)},gt=b._emscripten_bind_b2Joint_GetNext_0=function(){return b.asm._emscripten_bind_b2Joint_GetNext_0.apply(null,arguments)},ht=b._emscripten_bind_b2Joint_GetType_0=function(){return b.asm._emscripten_bind_b2Joint_GetType_0.apply(null,arguments)},it=b._emscripten_bind_b2World_RayCast_3=function(){return b.asm._emscripten_bind_b2World_RayCast_3.apply(null, +arguments)},jt=b._emscripten_bind_b2MassData_set_I_1=function(){return b.asm._emscripten_bind_b2MassData_set_I_1.apply(null,arguments)},kt=b._emscripten_bind_b2MassData___destroy___0=function(){return b.asm._emscripten_bind_b2MassData___destroy___0.apply(null,arguments)},lt=b._emscripten_bind_b2Profile_get_collide_0=function(){return b.asm._emscripten_bind_b2Profile_get_collide_0.apply(null,arguments)},mt=b._emscripten_bind_b2Color_b2Color_3=function(){return b.asm._emscripten_bind_b2Color_b2Color_3.apply(null, +arguments)},nt=b._emscripten_bind_b2Color_b2Color_0=function(){return b.asm._emscripten_bind_b2Color_b2Color_0.apply(null,arguments)},ot=b._emscripten_bind_b2WheelJointDef_get_frequencyHz_0=function(){return b.asm._emscripten_bind_b2WheelJointDef_get_frequencyHz_0.apply(null,arguments)},pt=b._emscripten_bind_b2WeldJointDef_Initialize_3=function(){return b.asm._emscripten_bind_b2WeldJointDef_Initialize_3.apply(null,arguments)},qt=b._emscripten_bind_b2RevoluteJoint_GetMotorTorque_1=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetMotorTorque_1.apply(null, +arguments)},rt=b._emscripten_enum_b2JointType_e_gearJoint=function(){return b.asm._emscripten_enum_b2JointType_e_gearJoint.apply(null,arguments)},st=b._emscripten_bind_b2FixtureDef_get_friction_0=function(){return b.asm._emscripten_bind_b2FixtureDef_get_friction_0.apply(null,arguments)},tt=b._emscripten_bind_b2PrismaticJointDef_set_localAnchorA_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_localAnchorA_1.apply(null,arguments)},ut=b._emscripten_bind_b2Contact_GetManifold_0=function(){return b.asm._emscripten_bind_b2Contact_GetManifold_0.apply(null, +arguments)},vt=b._emscripten_bind_b2QueryCallback___destroy___0=function(){return b.asm._emscripten_bind_b2QueryCallback___destroy___0.apply(null,arguments)},wt=b._emscripten_bind_b2WeldJointDef_get_localAnchorA_0=function(){return b.asm._emscripten_bind_b2WeldJointDef_get_localAnchorA_0.apply(null,arguments)},xt=b._emscripten_bind_b2MouseJoint_SetUserData_1=function(){return b.asm._emscripten_bind_b2MouseJoint_SetUserData_1.apply(null,arguments)},yt=b._emscripten_bind_b2MotorJointDef_set_correctionFactor_1= +function(){return b.asm._emscripten_bind_b2MotorJointDef_set_correctionFactor_1.apply(null,arguments)},zt=b._emscripten_bind_b2ChainShape_GetChildEdge_2=function(){return b.asm._emscripten_bind_b2ChainShape_GetChildEdge_2.apply(null,arguments)},At=b._emscripten_enum_b2JointType_e_mouseJoint=function(){return b.asm._emscripten_enum_b2JointType_e_mouseJoint.apply(null,arguments)},Bt=b._emscripten_bind_b2MotorJointDef_get_angularOffset_0=function(){return b.asm._emscripten_bind_b2MotorJointDef_get_angularOffset_0.apply(null, +arguments)},Ct=b._emscripten_bind_b2WheelJoint_SetUserData_1=function(){return b.asm._emscripten_bind_b2WheelJoint_SetUserData_1.apply(null,arguments)},Dt=b._emscripten_bind_b2Body_ApplyForce_3=function(){return b.asm._emscripten_bind_b2Body_ApplyForce_3.apply(null,arguments)},Et=b._emscripten_bind_b2ChainShape_set_m_count_1=function(){return b.asm._emscripten_bind_b2ChainShape_set_m_count_1.apply(null,arguments)},Ft=b._emscripten_bind_b2DistanceJoint_GetCollideConnected_0=function(){return b.asm._emscripten_bind_b2DistanceJoint_GetCollideConnected_0.apply(null, +arguments)},Gt=b._emscripten_bind_b2RevoluteJoint_IsMotorEnabled_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_IsMotorEnabled_0.apply(null,arguments)},Ht=b._emscripten_bind_b2PolygonShape_GetVertex_1=function(){return b.asm._emscripten_bind_b2PolygonShape_GetVertex_1.apply(null,arguments)},It=b._emscripten_bind_b2World_SetGravity_1=function(){return b.asm._emscripten_bind_b2World_SetGravity_1.apply(null,arguments)},Jt=b._emscripten_bind_b2MouseJointDef_get_collideConnected_0=function(){return b.asm._emscripten_bind_b2MouseJointDef_get_collideConnected_0.apply(null, +arguments)},Qb=b._llvm_bswap_i32=function(){return b.asm._llvm_bswap_i32.apply(null,arguments)},Kt=b._emscripten_bind_b2Fixture_SetRestitution_1=function(){return b.asm._emscripten_bind_b2Fixture_SetRestitution_1.apply(null,arguments)},Lt=b._emscripten_bind_b2Body_GetTransform_0=function(){return b.asm._emscripten_bind_b2Body_GetTransform_0.apply(null,arguments)},Mt=b._emscripten_enum_b2ShapeType_e_typeCount=function(){return b.asm._emscripten_enum_b2ShapeType_e_typeCount.apply(null,arguments)},Nt= +b._emscripten_bind_b2Mat33_set_ex_1=function(){return b.asm._emscripten_bind_b2Mat33_set_ex_1.apply(null,arguments)},Ot=b._emscripten_bind_b2PulleyJointDef_get_localAnchorB_0=function(){return b.asm._emscripten_bind_b2PulleyJointDef_get_localAnchorB_0.apply(null,arguments)},Pt=b._emscripten_bind_b2RevoluteJointDef_get_bodyA_0=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_get_bodyA_0.apply(null,arguments)},Qt=b._emscripten_bind_b2PrismaticJoint_GetBodyB_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetBodyB_0.apply(null, +arguments)},Rt=b._emscripten_bind_b2WheelJointDef_set_bodyA_1=function(){return b.asm._emscripten_bind_b2WheelJointDef_set_bodyA_1.apply(null,arguments)},St=b._emscripten_bind_b2MotorJointDef_set_maxForce_1=function(){return b.asm._emscripten_bind_b2MotorJointDef_set_maxForce_1.apply(null,arguments)},Tt=b._emscripten_bind_b2BodyDef_get_angle_0=function(){return b.asm._emscripten_bind_b2BodyDef_get_angle_0.apply(null,arguments)},Ut=b._emscripten_bind_b2FixtureDef_get_shape_0=function(){return b.asm._emscripten_bind_b2FixtureDef_get_shape_0.apply(null, +arguments)},Vt=b._emscripten_bind_b2Body_SetAngularVelocity_1=function(){return b.asm._emscripten_bind_b2Body_SetAngularVelocity_1.apply(null,arguments)},Wt=b._emscripten_bind_b2WeldJointDef_get_userData_0=function(){return b.asm._emscripten_bind_b2WeldJointDef_get_userData_0.apply(null,arguments)},Xt=b._emscripten_bind_b2FrictionJoint_SetMaxForce_1=function(){return b.asm._emscripten_bind_b2FrictionJoint_SetMaxForce_1.apply(null,arguments)},Yt=b._emscripten_bind_b2Mat33_b2Mat33_3=function(){return b.asm._emscripten_bind_b2Mat33_b2Mat33_3.apply(null, +arguments)},Zt=b._emscripten_bind_b2Vec3_get_y_0=function(){return b.asm._emscripten_bind_b2Vec3_get_y_0.apply(null,arguments)},$t=b._emscripten_bind_b2JointDef_get_type_0=function(){return b.asm._emscripten_bind_b2JointDef_get_type_0.apply(null,arguments)},au=b._emscripten_bind_JSQueryCallback_ReportFixture_1=function(){return b.asm._emscripten_bind_JSQueryCallback_ReportFixture_1.apply(null,arguments)},bu=b._emscripten_bind_b2PulleyJoint_GetCollideConnected_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetCollideConnected_0.apply(null, +arguments)},cu=b._emscripten_bind_b2Body_CreateFixture_1=function(){return b.asm._emscripten_bind_b2Body_CreateFixture_1.apply(null,arguments)},du=b._emscripten_bind_JSDraw_JSDraw_0=function(){return b.asm._emscripten_bind_JSDraw_JSDraw_0.apply(null,arguments)},eu=b._emscripten_bind_b2MouseJoint_GetAnchorA_0=function(){return b.asm._emscripten_bind_b2MouseJoint_GetAnchorA_0.apply(null,arguments)},fu=b._emscripten_bind_b2Transform_get_p_0=function(){return b.asm._emscripten_bind_b2Transform_get_p_0.apply(null, +arguments)},gu=b._emscripten_bind_b2WorldManifold_get_normal_0=function(){return b.asm._emscripten_bind_b2WorldManifold_get_normal_0.apply(null,arguments)},hu=b._emscripten_bind_b2World_GetProfile_0=function(){return b.asm._emscripten_bind_b2World_GetProfile_0.apply(null,arguments)},iu=b._emscripten_bind_b2DistanceJointDef___destroy___0=function(){return b.asm._emscripten_bind_b2DistanceJointDef___destroy___0.apply(null,arguments)},ju=b._emscripten_bind_b2GearJointDef_set_bodyA_1=function(){return b.asm._emscripten_bind_b2GearJointDef_set_bodyA_1.apply(null, +arguments)},ku=b._emscripten_bind_b2JointDef_set_type_1=function(){return b.asm._emscripten_bind_b2JointDef_set_type_1.apply(null,arguments)},lu=b._emscripten_bind_b2ContactEdge_set_contact_1=function(){return b.asm._emscripten_bind_b2ContactEdge_set_contact_1.apply(null,arguments)},mu=b._emscripten_bind_b2MotorJointDef_get_userData_0=function(){return b.asm._emscripten_bind_b2MotorJointDef_get_userData_0.apply(null,arguments)},nu=b._emscripten_bind_b2World_GetContactList_0=function(){return b.asm._emscripten_bind_b2World_GetContactList_0.apply(null, +arguments)},ou=b._emscripten_bind_b2Mat33_set_ez_1=function(){return b.asm._emscripten_bind_b2Mat33_set_ez_1.apply(null,arguments)},pu=b._emscripten_bind_b2JointEdge_b2JointEdge_0=function(){return b.asm._emscripten_bind_b2JointEdge_b2JointEdge_0.apply(null,arguments)},qu=b._emscripten_bind_b2FrictionJointDef_get_bodyA_0=function(){return b.asm._emscripten_bind_b2FrictionJointDef_get_bodyA_0.apply(null,arguments)},ru=b._emscripten_bind_b2WheelJointDef_get_type_0=function(){return b.asm._emscripten_bind_b2WheelJointDef_get_type_0.apply(null, +arguments)},su=b._emscripten_bind_b2RevoluteJoint_GetReactionForce_1=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetReactionForce_1.apply(null,arguments)},tu=b._emscripten_bind_b2PulleyJointDef_set_collideConnected_1=function(){return b.asm._emscripten_bind_b2PulleyJointDef_set_collideConnected_1.apply(null,arguments)},uu=b._emscripten_bind_b2RopeJoint_GetCollideConnected_0=function(){return b.asm._emscripten_bind_b2RopeJoint_GetCollideConnected_0.apply(null,arguments)},vu=b._emscripten_bind_b2GearJointDef_set_joint2_1= +function(){return b.asm._emscripten_bind_b2GearJointDef_set_joint2_1.apply(null,arguments)},wu=b._emscripten_bind_b2EdgeShape_set_m_vertex3_1=function(){return b.asm._emscripten_bind_b2EdgeShape_set_m_vertex3_1.apply(null,arguments)},xu=b._emscripten_bind_b2GearJoint_GetAnchorB_0=function(){return b.asm._emscripten_bind_b2GearJoint_GetAnchorB_0.apply(null,arguments)},yu=b._emscripten_bind_b2RopeJoint_IsActive_0=function(){return b.asm._emscripten_bind_b2RopeJoint_IsActive_0.apply(null,arguments)}, +zu=b._emscripten_bind_b2Fixture_GetFriction_0=function(){return b.asm._emscripten_bind_b2Fixture_GetFriction_0.apply(null,arguments)},Au=b._emscripten_bind_b2Fixture_GetNext_0=function(){return b.asm._emscripten_bind_b2Fixture_GetNext_0.apply(null,arguments)},Bu=b._emscripten_bind_b2RopeJointDef_get_bodyA_0=function(){return b.asm._emscripten_bind_b2RopeJointDef_get_bodyA_0.apply(null,arguments)},Cu=b._emscripten_bind_b2WeldJointDef_get_localAnchorB_0=function(){return b.asm._emscripten_bind_b2WeldJointDef_get_localAnchorB_0.apply(null, +arguments)},Du=b._emscripten_bind_b2WeldJointDef_set_referenceAngle_1=function(){return b.asm._emscripten_bind_b2WeldJointDef_set_referenceAngle_1.apply(null,arguments)},Eu=b._emscripten_bind_b2DistanceJointDef_set_localAnchorB_1=function(){return b.asm._emscripten_bind_b2DistanceJointDef_set_localAnchorB_1.apply(null,arguments)},Fu=b._emscripten_bind_b2Mat33_SetZero_0=function(){return b.asm._emscripten_bind_b2Mat33_SetZero_0.apply(null,arguments)},Gu=b._emscripten_bind_b2MotorJointDef_get_bodyB_0= +function(){return b.asm._emscripten_bind_b2MotorJointDef_get_bodyB_0.apply(null,arguments)},Hu=b._emscripten_bind_b2WheelJointDef_b2WheelJointDef_0=function(){return b.asm._emscripten_bind_b2WheelJointDef_b2WheelJointDef_0.apply(null,arguments)},Iu=b._emscripten_bind_b2PrismaticJointDef_get_localAxisA_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_localAxisA_0.apply(null,arguments)},Ju=b._emscripten_bind_b2Mat22_get_ey_0=function(){return b.asm._emscripten_bind_b2Mat22_get_ey_0.apply(null, +arguments)},Ku=b._emscripten_bind_b2Mat22_SetIdentity_0=function(){return b.asm._emscripten_bind_b2Mat22_SetIdentity_0.apply(null,arguments)},Lu=b._emscripten_bind_b2Joint_IsActive_0=function(){return b.asm._emscripten_bind_b2Joint_IsActive_0.apply(null,arguments)},Mu=b._emscripten_bind_b2PulleyJoint_GetReactionForce_1=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetReactionForce_1.apply(null,arguments)},Nu=b._emscripten_bind_b2Shape_get_m_radius_0=function(){return b.asm._emscripten_bind_b2Shape_get_m_radius_0.apply(null, +arguments)},Ou=b._emscripten_bind_b2Mat22_b2Mat22_4=function(){return b.asm._emscripten_bind_b2Mat22_b2Mat22_4.apply(null,arguments)},Pu=b._emscripten_bind_b2PrismaticJointDef_set_localAxisA_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_localAxisA_1.apply(null,arguments)},Qu=b._emscripten_bind_b2PolygonShape_SetAsBox_4=function(){return b.asm._emscripten_bind_b2PolygonShape_SetAsBox_4.apply(null,arguments)},Ru=b._emscripten_bind_b2EdgeShape_set_m_vertex1_1=function(){return b.asm._emscripten_bind_b2EdgeShape_set_m_vertex1_1.apply(null, +arguments)},Su=b._emscripten_bind_b2Body_GetWorld_0=function(){return b.asm._emscripten_bind_b2Body_GetWorld_0.apply(null,arguments)},Tu=b._emscripten_enum_b2LimitState_e_inactiveLimit=function(){return b.asm._emscripten_enum_b2LimitState_e_inactiveLimit.apply(null,arguments)},Uu=b._emscripten_bind_b2Vec2_set_x_1=function(){return b.asm._emscripten_bind_b2Vec2_set_x_1.apply(null,arguments)},Vu=b._emscripten_bind_b2Body_SetAwake_1=function(){return b.asm._emscripten_bind_b2Body_SetAwake_1.apply(null, +arguments)},Wu=b._emscripten_bind_b2WeldJoint_GetLocalAnchorA_0=function(){return b.asm._emscripten_bind_b2WeldJoint_GetLocalAnchorA_0.apply(null,arguments)},Xu=b._emscripten_bind_b2Vec2___destroy___0=function(){return b.asm._emscripten_bind_b2Vec2___destroy___0.apply(null,arguments)},Yu=b._emscripten_enum_b2ShapeType_e_polygon=function(){return b.asm._emscripten_enum_b2ShapeType_e_polygon.apply(null,arguments)},Zu=b._emscripten_bind_b2Body_GetInertia_0=function(){return b.asm._emscripten_bind_b2Body_GetInertia_0.apply(null, +arguments)},$u=b._emscripten_bind_b2PulleyJoint_GetAnchorA_0=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetAnchorA_0.apply(null,arguments)},av=b._emscripten_bind_b2BodyDef_get_linearVelocity_0=function(){return b.asm._emscripten_bind_b2BodyDef_get_linearVelocity_0.apply(null,arguments)},bv=b._emscripten_bind_b2DistanceJointDef_get_bodyB_0=function(){return b.asm._emscripten_bind_b2DistanceJointDef_get_bodyB_0.apply(null,arguments)},cv=b._emscripten_bind_b2Mat22___destroy___0=function(){return b.asm._emscripten_bind_b2Mat22___destroy___0.apply(null, +arguments)},dv=b._emscripten_bind_b2RevoluteJoint_GetNext_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetNext_0.apply(null,arguments)},ev=b._emscripten_bind_b2WeldJointDef_get_bodyA_0=function(){return b.asm._emscripten_bind_b2WeldJointDef_get_bodyA_0.apply(null,arguments)},fv=b._emscripten_bind_b2MotorJoint_GetAnchorB_0=function(){return b.asm._emscripten_bind_b2MotorJoint_GetAnchorB_0.apply(null,arguments)},gv=b._emscripten_bind_b2Fixture_GetShape_0=function(){return b.asm._emscripten_bind_b2Fixture_GetShape_0.apply(null, +arguments)},hv=b._emscripten_bind_b2PulleyJoint_GetReactionTorque_1=function(){return b.asm._emscripten_bind_b2PulleyJoint_GetReactionTorque_1.apply(null,arguments)},iv=b._emscripten_bind_b2Vec3_op_mul_1=function(){return b.asm._emscripten_bind_b2Vec3_op_mul_1.apply(null,arguments)},jv=b._emscripten_bind_b2PolygonShape_set_m_type_1=function(){return b.asm._emscripten_bind_b2PolygonShape_set_m_type_1.apply(null,arguments)},kv=b._emscripten_bind_b2WheelJoint_GetType_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetType_0.apply(null, +arguments)},lv=b._emscripten_bind_b2MotorJoint_GetAngularOffset_0=function(){return b.asm._emscripten_bind_b2MotorJoint_GetAngularOffset_0.apply(null,arguments)},mv=b._emscripten_bind_b2RevoluteJoint_IsActive_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_IsActive_0.apply(null,arguments)},nv=b._emscripten_bind_b2GearJoint_GetNext_0=function(){return b.asm._emscripten_bind_b2GearJoint_GetNext_0.apply(null,arguments)},ov=b._emscripten_bind_b2MouseJointDef_get_maxForce_0=function(){return b.asm._emscripten_bind_b2MouseJointDef_get_maxForce_0.apply(null, +arguments)},pv=b._emscripten_bind_b2DestructionListenerWrapper___destroy___0=function(){return b.asm._emscripten_bind_b2DestructionListenerWrapper___destroy___0.apply(null,arguments)},qv=b._emscripten_bind_b2PrismaticJointDef_set_maxMotorForce_1=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_set_maxMotorForce_1.apply(null,arguments)},rv=b._emscripten_bind_b2WheelJoint_GetLocalAxisA_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetLocalAxisA_0.apply(null,arguments)},sv=b._emscripten_bind_b2Body_GetNext_0= +function(){return b.asm._emscripten_bind_b2Body_GetNext_0.apply(null,arguments)},tv=b._emscripten_bind_b2MouseJoint_GetReactionForce_1=function(){return b.asm._emscripten_bind_b2MouseJoint_GetReactionForce_1.apply(null,arguments)},uv=b._emscripten_bind_b2RopeJoint_GetBodyA_0=function(){return b.asm._emscripten_bind_b2RopeJoint_GetBodyA_0.apply(null,arguments)},vv=b._emscripten_bind_b2ContactFeature_set_indexA_1=function(){return b.asm._emscripten_bind_b2ContactFeature_set_indexA_1.apply(null,arguments)}, +wv=b._emscripten_bind_b2Profile_get_solveInit_0=function(){return b.asm._emscripten_bind_b2Profile_get_solveInit_0.apply(null,arguments)},xv=b._emscripten_bind_b2Fixture_IsSensor_0=function(){return b.asm._emscripten_bind_b2Fixture_IsSensor_0.apply(null,arguments)},yv=b._emscripten_bind_b2FrictionJoint_GetAnchorB_0=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetAnchorB_0.apply(null,arguments)},zv=b._emscripten_bind_b2World_QueryAABB_2=function(){return b.asm._emscripten_bind_b2World_QueryAABB_2.apply(null, +arguments)},Av=b._emscripten_bind_b2Profile_set_collide_1=function(){return b.asm._emscripten_bind_b2Profile_set_collide_1.apply(null,arguments)},Bv=b._emscripten_bind_b2BodyDef_get_userData_0=function(){return b.asm._emscripten_bind_b2BodyDef_get_userData_0.apply(null,arguments)},Cv=b._emscripten_bind_b2MotorJoint_SetLinearOffset_1=function(){return b.asm._emscripten_bind_b2MotorJoint_SetLinearOffset_1.apply(null,arguments)},Dv=b._emscripten_bind_b2FrictionJoint_GetMaxForce_0=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetMaxForce_0.apply(null, +arguments)},Ev=b._emscripten_bind_b2WheelJointDef_get_userData_0=function(){return b.asm._emscripten_bind_b2WheelJointDef_get_userData_0.apply(null,arguments)},Fv=b._emscripten_bind_b2RevoluteJoint_IsLimitEnabled_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_IsLimitEnabled_0.apply(null,arguments)},Gv=b._emscripten_bind_b2World_SetDestructionListener_1=function(){return b.asm._emscripten_bind_b2World_SetDestructionListener_1.apply(null,arguments)},Hv=b._emscripten_bind_b2RevoluteJointDef_set_maxMotorTorque_1= +function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_maxMotorTorque_1.apply(null,arguments)},Iv=b._emscripten_bind_b2WeldJointDef_set_bodyB_1=function(){return b.asm._emscripten_bind_b2WeldJointDef_set_bodyB_1.apply(null,arguments)},Jv=b._emscripten_bind_b2Transform_set_p_1=function(){return b.asm._emscripten_bind_b2Transform_set_p_1.apply(null,arguments)},Kv=b._emscripten_bind_b2DistanceJoint_SetLength_1=function(){return b.asm._emscripten_bind_b2DistanceJoint_SetLength_1.apply(null,arguments)}, +Lv=b._emscripten_bind_b2ManifoldPoint_get_localPoint_0=function(){return b.asm._emscripten_bind_b2ManifoldPoint_get_localPoint_0.apply(null,arguments)},Mv=b._emscripten_bind_b2JointEdge_get_joint_0=function(){return b.asm._emscripten_bind_b2JointEdge_get_joint_0.apply(null,arguments)},Nv=b._emscripten_bind_b2Body_GetLocalCenter_0=function(){return b.asm._emscripten_bind_b2Body_GetLocalCenter_0.apply(null,arguments)},Ov=b._emscripten_bind_b2FixtureDef___destroy___0=function(){return b.asm._emscripten_bind_b2FixtureDef___destroy___0.apply(null, +arguments)},Pv=b._emscripten_bind_b2MouseJoint___destroy___0=function(){return b.asm._emscripten_bind_b2MouseJoint___destroy___0.apply(null,arguments)},Qv=b._emscripten_enum_b2JointType_e_ropeJoint=function(){return b.asm._emscripten_enum_b2JointType_e_ropeJoint.apply(null,arguments)},Rv=b._emscripten_bind_b2Profile_get_solveVelocity_0=function(){return b.asm._emscripten_bind_b2Profile_get_solveVelocity_0.apply(null,arguments)},Sv=b._emscripten_bind_b2WeldJointDef_get_bodyB_0=function(){return b.asm._emscripten_bind_b2WeldJointDef_get_bodyB_0.apply(null, +arguments)},Tv=b._emscripten_bind_b2World_GetContinuousPhysics_0=function(){return b.asm._emscripten_bind_b2World_GetContinuousPhysics_0.apply(null,arguments)},Uv=b._emscripten_bind_b2Joint_GetBodyA_0=function(){return b.asm._emscripten_bind_b2Joint_GetBodyA_0.apply(null,arguments)},Vv=b._emscripten_bind_b2MotorJointDef_set_maxTorque_1=function(){return b.asm._emscripten_bind_b2MotorJointDef_set_maxTorque_1.apply(null,arguments)},Wv=b._emscripten_bind_b2PulleyJointDef_Initialize_7=function(){return b.asm._emscripten_bind_b2PulleyJointDef_Initialize_7.apply(null, +arguments)},Xv=b._emscripten_bind_b2GearJointDef_set_bodyB_1=function(){return b.asm._emscripten_bind_b2GearJointDef_set_bodyB_1.apply(null,arguments)},Yv=b._emscripten_bind_b2RopeJoint_GetReactionTorque_1=function(){return b.asm._emscripten_bind_b2RopeJoint_GetReactionTorque_1.apply(null,arguments)},Zv=b._emscripten_bind_b2WheelJointDef_set_dampingRatio_1=function(){return b.asm._emscripten_bind_b2WheelJointDef_set_dampingRatio_1.apply(null,arguments)},$v=b._emscripten_bind_b2GearJoint_GetType_0= +function(){return b.asm._emscripten_bind_b2GearJoint_GetType_0.apply(null,arguments)},aw=b._emscripten_bind_b2MotorJoint_GetNext_0=function(){return b.asm._emscripten_bind_b2MotorJoint_GetNext_0.apply(null,arguments)},bw=b._emscripten_bind_b2EdgeShape_set_m_vertex0_1=function(){return b.asm._emscripten_bind_b2EdgeShape_set_m_vertex0_1.apply(null,arguments)},cw=b._emscripten_bind_b2RevoluteJoint_GetAnchorB_0=function(){return b.asm._emscripten_bind_b2RevoluteJoint_GetAnchorB_0.apply(null,arguments)}, +dw=b._emscripten_bind_b2RopeJointDef_set_localAnchorB_1=function(){return b.asm._emscripten_bind_b2RopeJointDef_set_localAnchorB_1.apply(null,arguments)},ew=b._emscripten_bind_b2PrismaticJoint_GetUserData_0=function(){return b.asm._emscripten_bind_b2PrismaticJoint_GetUserData_0.apply(null,arguments)},fw=b._emscripten_bind_b2GearJointDef_set_userData_1=function(){return b.asm._emscripten_bind_b2GearJointDef_set_userData_1.apply(null,arguments)},gw=b._emscripten_bind_b2Fixture_SetSensor_1=function(){return b.asm._emscripten_bind_b2Fixture_SetSensor_1.apply(null, +arguments)},hw=b._emscripten_bind_b2MotorJointDef_set_collideConnected_1=function(){return b.asm._emscripten_bind_b2MotorJointDef_set_collideConnected_1.apply(null,arguments)},iw=b._emscripten_bind_b2Contact_GetFixtureB_0=function(){return b.asm._emscripten_bind_b2Contact_GetFixtureB_0.apply(null,arguments)},jw=b._emscripten_bind_b2ChainShape_ComputeMass_2=function(){return b.asm._emscripten_bind_b2ChainShape_ComputeMass_2.apply(null,arguments)},kw=b._emscripten_bind_b2WeldJointDef_b2WeldJointDef_0= +function(){return b.asm._emscripten_bind_b2WeldJointDef_b2WeldJointDef_0.apply(null,arguments)},lw=b._emscripten_bind_b2Contact_GetChildIndexA_0=function(){return b.asm._emscripten_bind_b2Contact_GetChildIndexA_0.apply(null,arguments)},mw=b._emscripten_bind_b2RopeJointDef_get_bodyB_0=function(){return b.asm._emscripten_bind_b2RopeJointDef_get_bodyB_0.apply(null,arguments)},nw=b._emscripten_bind_b2BodyDef_b2BodyDef_0=function(){return b.asm._emscripten_bind_b2BodyDef_b2BodyDef_0.apply(null,arguments)}, +ow=b._emscripten_bind_b2MassData_get_mass_0=function(){return b.asm._emscripten_bind_b2MassData_get_mass_0.apply(null,arguments)},pw=b._emscripten_bind_b2WorldManifold_get_separations_1=function(){return b.asm._emscripten_bind_b2WorldManifold_get_separations_1.apply(null,arguments)},qw=b._emscripten_bind_b2Joint_GetBodyB_0=function(){return b.asm._emscripten_bind_b2Joint_GetBodyB_0.apply(null,arguments)},rw=b._emscripten_bind_b2Shape_GetChildCount_0=function(){return b.asm._emscripten_bind_b2Shape_GetChildCount_0.apply(null, +arguments)},sw=b._emscripten_bind_b2WheelJointDef_set_localAxisA_1=function(){return b.asm._emscripten_bind_b2WheelJointDef_set_localAxisA_1.apply(null,arguments)},tw=b._emscripten_bind_b2Joint_Dump_0=function(){return b.asm._emscripten_bind_b2Joint_Dump_0.apply(null,arguments)},uw=b._emscripten_bind_b2World_SetContactFilter_1=function(){return b.asm._emscripten_bind_b2World_SetContactFilter_1.apply(null,arguments)},vw=b._emscripten_bind_b2RevoluteJointDef_set_motorSpeed_1=function(){return b.asm._emscripten_bind_b2RevoluteJointDef_set_motorSpeed_1.apply(null, +arguments)},ww=b._emscripten_bind_b2MotorJointDef_get_bodyA_0=function(){return b.asm._emscripten_bind_b2MotorJointDef_get_bodyA_0.apply(null,arguments)},xw=b._emscripten_bind_b2WheelJointDef_get_enableMotor_0=function(){return b.asm._emscripten_bind_b2WheelJointDef_get_enableMotor_0.apply(null,arguments)},yw=b._emscripten_bind_b2Vec2_LengthSquared_0=function(){return b.asm._emscripten_bind_b2Vec2_LengthSquared_0.apply(null,arguments)},zw=b._emscripten_bind_b2FrictionJointDef_set_bodyA_1=function(){return b.asm._emscripten_bind_b2FrictionJointDef_set_bodyA_1.apply(null, +arguments)},Aw=b._emscripten_bind_b2WheelJoint_GetSpringFrequencyHz_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetSpringFrequencyHz_0.apply(null,arguments)},Bw=b._emscripten_bind_b2ContactEdge_set_prev_1=function(){return b.asm._emscripten_bind_b2ContactEdge_set_prev_1.apply(null,arguments)},Cw=b._emscripten_bind_b2Shape_ComputeMass_2=function(){return b.asm._emscripten_bind_b2Shape_ComputeMass_2.apply(null,arguments)},Dw=b._emscripten_bind_b2FrictionJoint_GetBodyA_0=function(){return b.asm._emscripten_bind_b2FrictionJoint_GetBodyA_0.apply(null, +arguments)},Ew=b._emscripten_bind_b2WheelJointDef_set_localAnchorB_1=function(){return b.asm._emscripten_bind_b2WheelJointDef_set_localAnchorB_1.apply(null,arguments)},Fw=b._emscripten_bind_b2Body_GetAngle_0=function(){return b.asm._emscripten_bind_b2Body_GetAngle_0.apply(null,arguments)},Gw=b._emscripten_bind_b2PrismaticJointDef_get_maxMotorForce_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_maxMotorForce_0.apply(null,arguments)},Hw=b._emscripten_bind_b2DistanceJoint_GetBodyA_0= +function(){return b.asm._emscripten_bind_b2DistanceJoint_GetBodyA_0.apply(null,arguments)},Iw=b._emscripten_bind_b2WheelJoint_GetLocalAnchorB_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetLocalAnchorB_0.apply(null,arguments)},Jw=b._emscripten_bind_b2PulleyJointDef_set_bodyA_1=function(){return b.asm._emscripten_bind_b2PulleyJointDef_set_bodyA_1.apply(null,arguments)},Kw=b._emscripten_bind_b2WheelJoint_GetAnchorB_0=function(){return b.asm._emscripten_bind_b2WheelJoint_GetAnchorB_0.apply(null, +arguments)},Lw=b._emscripten_bind_b2PolygonShape_SetAsBox_2=function(){return b.asm._emscripten_bind_b2PolygonShape_SetAsBox_2.apply(null,arguments)},Mw=b._emscripten_bind_b2PrismaticJointDef_get_type_0=function(){return b.asm._emscripten_bind_b2PrismaticJointDef_get_type_0.apply(null,arguments)},Nw=b._emscripten_bind_b2Color_Set_3=function(){return b.asm._emscripten_bind_b2Color_Set_3.apply(null,arguments)},Ow=b._emscripten_bind_b2WheelJointDef_get_bodyA_0=function(){return b.asm._emscripten_bind_b2WheelJointDef_get_bodyA_0.apply(null, +arguments)},Pw=b._emscripten_enum_b2LimitState_e_atUpperLimit=function(){return b.asm._emscripten_enum_b2LimitState_e_atUpperLimit.apply(null,arguments)},Qw=b._emscripten_bind_b2PulleyJointDef_set_groundAnchorA_1=function(){return b.asm._emscripten_bind_b2PulleyJointDef_set_groundAnchorA_1.apply(null,arguments)},Rw=b._emscripten_bind_b2PolygonShape_get_m_type_0=function(){return b.asm._emscripten_bind_b2PolygonShape_get_m_type_0.apply(null,arguments)},Sw=b._emscripten_bind_b2PrismaticJoint_SetMaxMotorForce_1= +function(){return b.asm._emscripten_bind_b2PrismaticJoint_SetMaxMotorForce_1.apply(null,arguments)},Tw=b._emscripten_bind_b2PulleyJointDef_get_collideConnected_0=function(){return b.asm._emscripten_bind_b2PulleyJointDef_get_collideConnected_0.apply(null,arguments)},Uw=b._emscripten_bind_JSContactListener_JSContactListener_0=function(){return b.asm._emscripten_bind_JSContactListener_JSContactListener_0.apply(null,arguments)},Vw=b._emscripten_bind_b2WheelJoint___destroy___0=function(){return b.asm._emscripten_bind_b2WheelJoint___destroy___0.apply(null, +arguments)},Ww=b._emscripten_bind_b2PolygonShape_set_m_radius_1=function(){return b.asm._emscripten_bind_b2PolygonShape_set_m_radius_1.apply(null,arguments)},Xw=b._emscripten_bind_b2Fixture_GetMassData_1=function(){return b.asm._emscripten_bind_b2Fixture_GetMassData_1.apply(null,arguments)},Yw=b._emscripten_bind_b2RopeJoint_SetMaxLength_1=function(){return b.asm._emscripten_bind_b2RopeJoint_SetMaxLength_1.apply(null,arguments)};b.dynCall_iiii=function(){return b.asm.dynCall_iiii.apply(null,arguments)}; +b.dynCall_viifii=function(){return b.asm.dynCall_viifii.apply(null,arguments)};b.dynCall_viiiii=function(){return b.asm.dynCall_viiiii.apply(null,arguments)};b.dynCall_vi=function(){return b.asm.dynCall_vi.apply(null,arguments)};b.dynCall_vii=function(){return b.asm.dynCall_vii.apply(null,arguments)};b.dynCall_ii=function(){return b.asm.dynCall_ii.apply(null,arguments)};b.dynCall_fif=function(){return b.asm.dynCall_fif.apply(null,arguments)}; +b.dynCall_viii=function(){return b.asm.dynCall_viii.apply(null,arguments)};b.dynCall_viifi=function(){return b.asm.dynCall_viifi.apply(null,arguments)};b.dynCall_v=function(){return b.asm.dynCall_v.apply(null,arguments)};b.dynCall_viif=function(){return b.asm.dynCall_viif.apply(null,arguments)};b.dynCall_viiiiii=function(){return b.asm.dynCall_viiiiii.apply(null,arguments)};b.dynCall_iii=function(){return b.asm.dynCall_iii.apply(null,arguments)}; +b.dynCall_iiiiii=function(){return b.asm.dynCall_iiiiii.apply(null,arguments)};b.dynCall_fiiiif=function(){return b.asm.dynCall_fiiiif.apply(null,arguments)};b.dynCall_viiii=function(){return b.asm.dynCall_viiii.apply(null,arguments)};f.t=b.stackAlloc;f.L=b.stackSave;f.K=b.stackRestore;f.R=b.establishStackSpace;f.f=b.setTempRet0;f.H=b.getTempRet0;b.asm=Sb; +if(zb)if("function"===typeof b.locateFile?zb=b.locateFile(zb):b.memoryInitializerPrefixURL&&(zb=b.memoryInitializerPrefixURL+zb),ea||fa){var Zw=b.readBinary(zb);Da.set(Zw,f.i)}else{var ax=function(){b.readAsync(zb,$w,function(){throw"could not load memory initializer "+zb;})};xb();var $w=function(a){a.byteLength&&(a=new Uint8Array(a));Da.set(a,f.i);b.memoryInitializerRequest&&delete b.memoryInitializerRequest.response;yb()};if(b.memoryInitializerRequest){var bx=function(){var a=b.memoryInitializerRequest; +200!==a.status&&0!==a.status?(console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+a.status+", retrying "+zb),ax()):$w(a.response)};b.memoryInitializerRequest.response?setTimeout(bx,0):b.memoryInitializerRequest.addEventListener("load",bx)}else ax()}b.then=function(a){if(b.calledRun)a(b);else{var c=b.onRuntimeInitialized;b.onRuntimeInitialized=function(){c&&c();a(b)}}return b}; +function ja(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}ja.prototype=Error();ja.prototype.constructor=ja;var cx=null,wb=function dx(){b.calledRun||ex();b.calledRun||(wb=dx)}; +b.callMain=b.O=function(a){function c(){for(var a=0;3>a;a++)e.push(0)}a=a||[];pb||(pb=!0,hb(jb));var d=a.length+1,e=[Ba(rb(b.thisProgram),"i8",0)];c();for(var g=0;g","",0.7,0,0,1,1,0,true,4]],[[564,152,0,120.36000061,16.559999466,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],41,25,[1],[],["2 Players",false,16,16,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@°+=*$£€<>","",0.7,0,0,1,1,0,true,4]],[[564,177,0,120.36000061,16.559999466,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],41,46,[2],[],["Exit",false,16,16,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@°+=*$£€<>","",0.7,0,0,1,1,0,true,4]],[[-351,-195,0,196.92817688,66.351959229,0,0,[1,1,1,1],0,0,0,0,[],null,null,null],44,61,[],[],["Text",false,"Arial",9.75,0,false,false,[0,0,0],0,0,0,true,0]],[[90.98005222935814,109.27910135953516,0,38.887267635035435,34.4143888716307,0,0.19262675534632093,[1,1,1,1],0.5,0.5,0,0,[[1,1,1,1,1,1]],null,null,null],81,114,[],[],[true,"Default",0,true]],[[326.88737967313745,118.42652834204904,0,38.887267635035435,34.4143888716307,0,6.129848229347256,[1,1,1,1],0.5,0.5,0,0,[[1,1,1,1,1,1]],null,null,null],81,115,[],[],[true,"Default",0,true]],[[300.7641276727146,48.09204705718301,0,7.713702192131451,7.713702192131451,0,0,[1,1,1,0.11],0.5,0.5,0,0,[[0.1,0.3,0.3,3,4,7,20,400,0.3]],null,null,null],83,117,[],[[0,0,1,true,true]],[true,"Animation 1",0,true]],[[224.01291236802072,490.1466148022798,0,501.14820490428656,310.3349553606679,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],84,118,[],[[0,0,1,true,true]],[true,"Animation 1",0,true]],[[208.07973801299153,121.05338273684333,0,150.1953734063037,61.86461415634097,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],89,126,[],[],[true,"Animation 1",0,true]]],[],0]],[],[]],["jogo",854,244,false,"jogo",488190852432851,[["bg",0,815950515112332,true,[255,255,255],false,1,1,1,false,false,1,0,0,[[[454,-69,0,1480,640,0,0,[1,1,1,1],0.5,0.5,0,0,[[0,1,1]],null,null,null],52,2,[],[],[true,"Animation 1",0,true]],[[281,205,0,244.8999795835026,244.8999795835026,0,0,[1,1,1,0.5],0.47333333333333333,1.0033333333333334,0,0,[[0,1,1]],null,null,null],50,74,[],[[200,600,600,0,false,false,true],[true,400,0,0,false,false]],[true,"Animation 1",0,true]],[[541,203,0,244.8999795835026,244.8999795835026,0,0,[1,1,1,0.5],0.5,1.0033333333333334,0,0,[[0,1,1]],null,null,null],54,68,[],[[200,600,600,0,false,false,true]],[true,"Animation 1",0,true]],[[-9,202,0,875,35,0,0,[1,1,1,1],0,0,0,0,[],null,null,null],5,8,[],[[true,""]],[false,0,1,1,0,0,1,1,0]],[[421.9025792352792,216,0,1676.1757226557481,202.16265300525885,0,0,[1,1,1,1],0.5,1,0,0,[],null,null,null],47,72,[],[],[true,"Animation 1",0,true]],[[-62,200,0,1168.889948,492.451302,0,0,[1,1,1,0.66],0.5023334747560458,0.6606243705941591,0,0,[[0,1,1],[1.34]],null,null,null],53,6,[],[[200,600,600,0,false,false,true]],[true,"Animation 1",0,true]],[[1254.7545383819875,-82.98258000435914,0,1168.889948,492.451302,0,0,[1,1,1,0.66],0.5057276198557489,0.6727089627391742,0,0,[[0,1,1],[1.3]],null,null,null],55,69,[],[[200,600,600,0,false,false,true]],[true,"Animation 1",0,true]],[[529,429,0,2138.844406,497.962356,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],51,1,[],[],[true,"Animation 1",0,true]]],[],0],["gameplay",1,246741775162532,true,[255,255,255],true,1,1,1,false,false,1,0,0,[[[285.839355469,199.999786377,0,32,102,0,0,[1,1,1,1],0.5,1,0,0,[],null,null,null],17,7,["parado",0,950,950,0,0],[[150,1500,1500,350,800,800,false,0,false,true],[true],[1]],[false,"Default",0,true]],[[280.99899292,198,0,124.99999999999999,32,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],14,9,[],[],[true,"Default",0,false]],[[542.630493164,199.969085693,0,32,102,0,6.281082304380025,[1,1,1,1],0.5,1,0,0,[],null,null,null],18,3,["parado",0,950,950,0,0,0,0,0,0,0],[[150,1500,1500,350,800,800,false,0,false,true],[true],[1]],[false,"Default",0,true]],[[540.465026855,198,0,124.99999999999999,32,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],15,26,[],[],[true,"Default",0,false]],[[510.987677122361,368.236318770612,0,9.975354244721954,29.472637541223953,0,0,[1,1,1,0.3],0.5,0.5,0,0,[],null,null,null],56,70,[],[[100,0,0,false,false,false,true],[0,0,0.1,true,true]],[true,"Default",0,true]],[[798,371,0,22,65,0,0,[1,1,1,0.3],0.5,0.5,0,0,[],null,null,null],57,71,[],[[0,0,1,true,true],[400,0,0,false,false,false,true]],[true,"Default",0,true]]],[],0],["efeitos",2,287379886160366,true,[255,255,255],true,1,1,1,false,false,1,0,0,[],[],0],["HUD",3,416055838072605,true,[255,255,255],true,0,0,1,false,false,0,0,0,[[[210.50026027110374,-18.31763475341326,0,331.33259475243767,82.99567285165705,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],59,75,[],[],[true,"Animation 1",0,true]],[[209.6869490294892,137.91289382665755,0,262.2957071170796,18.92180905810116,0,0,[1,1,1,1],0.5,7,0,0,[],null,null,null],31,16,[],[],[true,"Default",1,false]],[[210,14,0,34,16,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],27,17,[],[],[true,"Default",0,false]],[[194,14,0,115,12,0,0,[1,1,1,1],0.991304,0.5,0,0,[],null,null,null],29,19,[],[],[true,"Default",0,false]],[[226,14,0,115,12,0,0,[1,1,1,1],0.00869565,0.5,0,0,[],null,null,null],30,20,[],[],[true,"Default",0,false]],[[-78.29989256369046,-112.63705701347445,0,32.495475769,45.841835022,0,0,[1,1,1,1],0.5,0.506329,0,0,[[0,1,1]],null,null,null],26,21,[],[],[true,"Default",0,false]],[[546.7177186568097,240.688764328444,0,35,15,0,0,[1,1,1,1],0.514286,0.533333,0,0,[],null,null,null],28,22,[],[],[false,"Default",0,false]],[[467.0877377243041,-22.06083553478019,0,32.495475769,45.841835022,0,0,[1,1,1,1],0.5,0.506329,0,0,[[0,1,1]],null,null,null],26,23,[],[],[true,"Default",1,false]],[[541.8778729675741,-19.08090532651252,0,35,15,0,0,[1,1,1,1],0.514286,0.533333,0,0,[],null,null,null],28,24,[],[],[false,"Default",0,false]],[[565.7598675590948,79.85586456512243,0,196.927780151,141.104415894,0,0,[1,1,1,1],0,0,0,0,[],null,null,null],32,30,[],[],["Text",false,"Arial",9.75,0,false,false,[0.35294117647058826,0.35294117647058826,0.35294117647058826],0,0,0,true,0]],[[610.5360606467345,-37.19973879996187,0,196.927780151,141.104415894,0,0,[1,1,1,1],0,0,0,0,[],null,null,null],32,31,[],[],["Text",false,"Arial",9.75,0,false,false,[0.35294117647058826,0.35294117647058826,0.35294117647058826],2,0,0,true,0]],[[22.831247869176913,12.355375561498343,0,-33.490617,16.167807,0,0,[1,1,1,1],0.517241,0.5,0,0,[],null,null,null],34,34,[],[],[true,"Default",2,false]],[[400.14940461772323,11.911590017198623,0,33.49061731169099,16.167807183426834,0,0,[1,1,1,1],0.517241,0.5,0,0,[],null,null,null],35,35,[],[],[true,"Default",2,false]],[[-1276,-456,0,272.192077637,62.76789856,0,0,[1,1,1,1],0,0,0,0,[],null,null,null],33,36,[],[],["Round 1",false,16,16,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@°+=*$£€<>","",2,0,0,1,0,0,true,0]],[[80.26462066951562,159.7603397399814,0,48.19397075581396,48.19397075581396,0,0,[1,1,1,0.600000024],0.5,0.5,0,0,[],null,null,null],40,41,[],[],[true,"Default",0,true]],[[30,200,0,48.19397075581396,48.19397075581396,0,0,[1,1,1,0.600000024],0.5,0.5,0,0,[],null,null,null],37,43,[],[],[true,"Default",0,true]],[[130,200,0,48.19397075581396,48.19397075581396,0,0,[1,1,1,0.600000024],0.5,0.5,0,0,[],null,null,null],38,37,[],[],[true,"Default",0,true]],[[297.2127700967353,197.81771298619478,0,50,50,0,0,[1,1,1,0.600000024],0.5,0.5,0,0,[],null,null,null],39,38,[],[],[true,"Default",0,true]],[[378.60082968040166,197.09854589125678,0,50,50,0,0,[1,1,1,0.600000024],0.5,0.5,0,0,[],null,null,null],36,44,[],[],[true,"Default",0,true]],[[210.74084666933297,-21.07789711817955,0,323.32901179158563,83.9646286156059,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],58,73,[],[],[true,"Animation 1",0,true]],[[211.5733457961586,11.742020543578763,0,47.88050969254667,24.918584282549567,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],58,76,[],[],[true,"Animation 1",0,true]],[[-166.0821891285683,-194.5224254529351,0,119.10290167596283,55.44145439583094,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],60,77,[],[],[true,"Animation 1",0,true]],[[211.39619373804598,236.2030785381969,0,173.19014693857247,14.781123651762226,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],61,78,[],[],[true,"Animation 1",0,true]],[[69.4252949421261,63.27512222037534,0,123.57677890999953,61.95907561371521,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],73,101,[],[[0,3,1,true,true]],[true,"Default",0,true]],[[346.39989910576986,59.55541818811099,0,134.24156222969756,62.08885470344334,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],74,102,[],[[0,3,1,true,true]],[true,"Default",0,true]],[[209.88072401495896,128.15868942491142,0,153.99004474432243,36.90920522359005,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],75,103,[],[],[true,"Default",0,true]],[[208.6455925727231,128.668258012745,0,102.41621873804792,30.045574374682413,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],76,104,[],[],[true,"Default",0,true]],[[211.1041466927943,15.558694571719181,0,44.49498628292479,22.462099184627622,0,0,[1,1,1,1],0.5,0.5,0,0,[[1]],null,null,null],62,111,[],[[true]],[true,"Animation 1",0,true]],[[202.4017474024174,74.58875910489955,0,80.5130977568931,35.204107521232615,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],80,112,[],[[true]],[true,"Animation 1",0,true]],[[219,119,0,501.14820490428656,310.3349553606679,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],84,119,[],[[0,0,1,true,true]],[true,"Animation 1",0,true]],[[274,719,0,250,250,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],90,127,[],[],[true,"Animation 1",0,true]]],[],0]],[],[["pixellate","Pixellate",[1]]]],["objetos",1708,960,false,null,178475860766820,[["Layer 0",0,476837741419908,true,[255,204,51],false,1,1,1,false,false,1,0,0,[[[320.224243164,10.247901917,0,16,16,0,0,[1,1,1,0.600000024],1,0.5,0,0,[],null,null,null],8,28,[],[[false]],[false,"Default",0,true]],[[342,-119,0,16,16,0,0,[1,1,1,0.600000024],1,0.5,0,0,[],null,null,null],9,27,[],[[false]],[false,"Default",0,true]],[[295.708374023,37.801528931,0,16,16,0,0,[1,1,1,0.600000024],1.25,0.5,0,0,[],null,null,null],10,32,[],[[false]],[false,"Default",0,true]],[[344.507751465,38.601882935,0,16,16,0,0,[1,1,1,0.600000024],1.25,0.5,0,0,[],null,null,null],11,33,[],[[false]],[false,"Default",0,true]],[[327.963134766,248.554321289,0,58,28,0,0,[1,1,1,1],0.517241,0.5,0,0,[],null,null,null],34,29,[],[],[true,"Default",2,true]],[[-65,8.8913,0,61,102,0,0,[1,1,1,1],0.47541,0.98913,0,0,[[0]],null,null,null],16,45,[],[],[true,"parado",0,true]],[[188,328.8913,0,61,102,0,0,[1,1,1,1],0.47541,0.98913,0,0,[[0]],null,null,null],19,40,[],[],[true,"parado",0,true]],[[392,459,0,32,80,0,0,[1,1,1,1],0.5,1,0,0,[],null,null,null],17,4,["parado",0,950,950,0,0],[[150,1500,1500,350,800,800,false,0,false,true],[true],[1]],[true,"Default",0,true]],[[387,457,0,454,14.000030518,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],14,12,[],[],[true,"Default",0,true]],[[560,459,0,32,80,0,0,[1,1,1,1],0.5,1,0,0,[],null,null,null],18,13,["parado",0,950,950,0,0,0,0,0,0,0],[[150,1500,1500,350,800,800,false,0,false,true],[true],[1]],[true,"Default",0,true]],[[559,458,0,454,14,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],15,18,[],[],[true,"Default",0,true]],[[40,213.8913,0,61,102,0,0,[1,1,1,1],0.47541,0.98913,0,0,[[0]],null,null,null],20,47,[],[],[true,"parado",0,true]],[[184,428.8913,0,61,102,0,0,[1,1,1,1],0.47541,0.98913,0,0,[[0]],null,null,null],21,48,[],[],[true,"parado",0,true]],[[620,-349,0,30,30,0,0,[1,1,1,0],0.5,0.5,0,0,[],null,null,null],12,5,[],[[false]],[true,"Default",0,false]],[[283,-399,0,66,66,0,0,[1,1,1,0],0.5,0.5,0,0,[],null,null,null],13,49,[],[[false]],[true,"Default",0,false]],[[38,323.8913,0,61,102,0,0,[1,1,1,1],0.47541,0.98913,0,0,[[0]],null,null,null],22,57,[],[],[true,"parado",0,true]],[[41,426.8913,0,61,102,0,0,[1,1,1,1],0.47541,0.98913,0,0,[[0]],null,null,null],23,58,[],[],[true,"parado",0,true]],[[44.581278556870245,-11.603963870126266,0,61,102,0,0,[1,1,1,1],0.47541,0.98913,0,0,[[0]],null,null,null],24,59,[],[],[true,"parado",0,true]],[[184,209.8913,0,61,102,0,0,[1,1,1,1],0.47541,0.98913,0,0,[[0]],null,null,null],25,60,[],[],[true,"parado",0,true]],[[47,-274,0,25,14,0,0,[1,1,1,1],0.5,0.5,0,0,[[0.2,1,1]],null,null,null],72,88,[],[[0,0,0.2,true,true],[400,0,0,false,true,false,true]],[true,"Animation 1",0,true]]],[],0]],[],[]],["select",420,244,false,"select",544709765494488,[["Layer 0",0,362939467738296,true,[255,255,255],false,1,1,1,false,false,1,0,0,[[[-7,-7,0,435.200134277,256.640075684,0,0,[1,1,1,1],0,0,0,0,[],null,null,null],42,51,[0,3,0,0],[],[true,0,1,1,0,0,1,1,0]],[[150,120,0,32.495475769,45.841835022,0,0,[1,1,1,1],0.5,0.506329,0,0,[[0,1,1]],null,null,null],26,50,[],[],[true,"Default",0,false]],[[184,120,0,32.495475769,45.841835022,0,0,[1,1,1,1],0.5,0.506329,0,0,[[1.2,1,1]],null,null,null],26,54,[],[],[true,"Default",2,false]],[[218,120,0,32.495475769,45.841835022,0,0,[1,1,1,1],0.5,0.506329,0,0,[[0.6,1,1]],null,null,null],26,55,[],[],[true,"Default",3,false]],[[252,120,0,32.495475769,45.841835022,0,0,[1,1,1,1],0.5,0.506329,0,0,[[0.6,0.8,0.8]],null,null,null],26,56,[],[],[true,"Default",4,false]],[[396.63973999,296.639953613,0,32.256000519,45.504001617,0,0,[1,1,1,1],0.5,0.506329,0,0,[],null,null,null],43,53,[],[],[true,"Default",1,true]],[[61.534973145,283.077392578,0,32.255878448,45.503829956,0,0,[1,1,1,1],0.5,0.506329,0,0,[],null,null,null],43,52,[],[],[true,"Default",0,true]],[[3.270225525,2.715293884,0,196.92817688,114.991889954,0,0,[1,1,1,1],0,0,0,0,[],null,null,null],44,62,[],[],["Text",false,"Arial",9.75,0,false,false,[0,0,0],0,0,0,true,0]],[[219.870544434,2.435211182,0,196.92817688,123.312225342,0,0,[1,1,1,1],0,0,0,0,[],null,null,null],44,63,[],[],["Text",false,"Arial",9.75,0,false,false,[0,0,0],2,0,0,true,0]],[[79.600013733,210,0,147.560028076,46.639862061,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],41,64,[0],[],["Vs CPU",false,16,16,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@°+=*$£€<>","",0.7,0,0,0,0,0,true,4]],[[338.999816895,210,0,152.360366821,46.639862061,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],41,65,[0],[],["Vs CPU",false,16,16,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@°+=*$£€<>","",0.7,0,0,2,0,0,true,4]]],[],0]],[],[]],["winblue",840,488,false,"Event sheet 1",659091547300905,[["Layer 0",0,596218244764609,true,[94,94,94],false,1,1,1,false,false,1,0,0,[[[443.2389622153286,134.73987053204246,0,925.4477574105753,318.9150871426642,0,0,[1,1,1,0.95],0.5,0.5,0,0,[],null,null,null],45,89,[],[[5,0,2,0,0,0,2,0,true]],[true,"Default",0,true]],[[-36.19814807800524,-18.324430038672144,0,598.1558411872625,495.05680093347235,0,0,[1,1,1,0.67],0.02254428341384862,0.12087912087912088,0,0,[],null,null,null],66,91,[],[[5,0,-10,0,0,0,-100,0,true]],[true,"Default",0,true]],[[569.4851908228154,176.7616800219303,0,115.771799,167.905063,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],63,92,[],[],[true,"Default",0,true]],[[301.01131329511134,168.11051918252693,0,107.61324762224399,156.07262931549047,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],64,93,[],[],[true,"Default",0,true]],[[99.65477419323628,232.17720721327728,0,179.29720577414992,15.302338012930669,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],70,94,[],[],[true,"Default",0,true]],[[208.37813586440382,51.976703239405005,0,392.7661206419074,66.22889131058555,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],77,105,[],[],[true,"Default",0,true]],[[136.23710548071074,156.76330211774953,0,67.701513,67.24714,0,6.274580054133863,[1,1,1,1],0.5,0.5,0,0,[[0.49,1,1]],null,null,null],78,106,[],[],[true,"Default",0,true]],[[69.01753223867047,156.96759793054952,0,67.70151295237282,67.24714038222267,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],67,109,[],[[true]],[true,"Default",0,true]],[[330.6752447354504,125.36730037193772,0,31.904172854441764,34.4143888716307,0,0.19888061330514173,[1,1,1,1],0.5,0.5,0,0,[[1,1,1,1,1,1]],null,null,null],81,90,[],[],[true,"Default",0,true]],[[217.5338157478804,119.94572367278104,0,501.14820490428656,310.3349553606679,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],84,120,[],[[0,0,1,true,true]],[true,"Animation 1",0,true]]],[],0]],[],[]],["winorange",840,488,false,"Event sheet 2",861578574761763,[["Layer 0",0,124151485729395,true,[94,94,94],false,1,1,1,false,false,1,0,0,[[[-4.207445681908894,102.53092317103918,0,870.7080223459706,348.059375164652,0,0,[1,1,1,0.95],0.5,0.5,0,0,[],null,null,null],45,95,[],[[5,0,2,0,0,0,2,0,true]],[true,"Default",0,true]],[[453,-5,0,600.0005160781266,615.9330297955439,0,0,[1,1,1,0.67],0.9821138211382113,0.11911911911911911,0,0,[],null,null,null],65,96,[],[[5,0,10,0,0,0,100,0,true]],[true,"Default",0,true]],[[559,-182,0,199.57509752253287,215.06918715365637,0,0,[1,1,1,0.67],0.02254428341384862,0.12087912087912088,0,0,[],null,null,null],66,97,[],[[5,0,-10,0,0,0,-100,0,true]],[true,"Default",0,true]],[[74,162,0,119.72697979663988,173.64130348837844,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],63,98,[],[],[true,"Default",0,true]],[[-113.97181159966888,125.14493335065205,0,115.77179921179213,167.90506283200907,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],64,99,[],[],[true,"Default",0,true]],[[317.1202378948549,149.89924138912855,0,67.701513,67.24714,0,6.274580054133863,[1,1,1,1],0.5,0.5,0,0,[[0.49,1,1]],null,null,null],78,107,[],[],[true,"Default",0,true]],[[212.46518495338248,35.24512744267319,0,342.40687436029475,44.94600976089786,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],79,108,[],[],[true,"Default",0,true]],[[258.80831081906535,148.88214614939687,0,67.70151295237282,67.24714038222267,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],67,110,[],[[true]],[true,"Default",0,true]],[[317,225,0,179.29720577414992,15.302338012930669,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],70,100,[],[],[true,"Default",0,true]],[[39.365588703975625,118.4737961380129,0,38.887267635035435,34.4143888716307,0,6.010437871807548,[1,1,1,1],0.5,0.5,0,0,[[1,1,1,1,1,1]],null,null,null],81,113,[],[],[true,"Default",0,true]],[[202,120,0,501.14820490428656,310.3349553606679,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],84,121,[],[[0,0,1,true,true]],[true,"Animation 1",0,true]]],[],0]],[],[]],["intro",840,488,false,"Event sheet 3",785332433511092,[["Layer 0",0,665305049050377,true,[94,94,94],false,1,1,1,false,false,1,0,0,[[[402,226.5,0,1197.1311360492873,724.0215998897875,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],85,122,[],[],[true,"Default",0,true]],[[210,122,0,260.9214316842638,21.74345264083054,0,0,[1,1,1,1],0.5,0.5,0,0,[],null,null,null],86,123,[],[],[true,"Default",0,true]],[[210,122,0,64.52477490645975,21.161835211412892,0,0,[1,1,1,1],0.504,0.512195,0,0,[],null,null,null],87,124,[],[],[true,"Default",0,true]]],[],0]],[],[]]],[["jogo",[[2,"comum",false],[1,"bgeffect",0,0,false,false,556476296909077,false,121],[0,0,false,null,450535756823962,1,[[-1,23,null,1,false,false,false,141069780448855,null]],[[-1,24,null,412755621018314,0,null,[[11,863177864399805],[7,[0]]]],[-1,24,null,824398842226900,0,null,[[11,754743954925292],[7,[1]]]],[2,25,null,808861309861983,0,null,[[1,[2]],[13,[7,[3,[3,175591682901144]]]]]],[2,25,null,913683745207522,0,null,[[1,[4]],[13,[7,[3,[3,628998898533056]]]]]],[14,26,null,300617022871654,0,null],[15,26,null,954164539971091,0,null],[-1,27,null,321888029214400,0,null,[[0,[1]]]],[2,25,null,134345333447725,0,null,[[1,[5]],[13]]]],[[0,0,false,null,920558135137178,2,[[1,28,null,0,false,true,false,748865061498733,null,[[1,[6]]]]],[]],[0,0,false,null,828055069575125,3,[[-1,29,null,0,false,true,false,688177912032592,null,[[3,2]]]],[]],[0,0,false,null,553001309025060,4,[[32,30,null,0,false,false,true,229859562874397,null,[[0,[7]]]]],[[32,31,null,475097054172502,0,null,[[7,[8]]]]]],[0,0,false,null,294125539207812,5,[[32,30,null,0,false,false,true,206201396752492,null,[[0,[9]]]]],[[32,31,null,945711579289695,0,null,[[7,[10]]]]]],[0,0,false,null,293827158042940,6,[[-1,32,null,0,false,false,false,343093415839213,null,[[11,361400748529732],[8,1],[7,[1]]]]],[[32,33,null,978978609415156,0,null,[[3,0]]]]],[0,0,false,null,446106149422330,7,[],[[-1,34,null,192436708340290,2,null,[[0,[11]]]],[32,33,null,393514006074553,0,null,[[3,0]]]]]]],[0,0,false,null,671311232552017,8,[[-1,35,null,0,false,false,false,398612029628227,null,[[0,[1]]]],[-1,32,null,0,false,false,false,204102998358406,null,[[11,863177864399805],[8,4],[7,[12]]]]],[[-1,36,null,118714339831634,0,null,[[11,863177864399805],[7,[1]]]]]],[0,0,false,null,449770507970677,9,[[-1,32,null,0,false,false,false,349131608910969,null,[[11,863177864399805],[8,3],[7,[13]]]],[-1,37,null,0,false,false,false,432824774548847,null]],[[33,38,null,206209196907067,0,null,[[7,[14]]]],[-1,34,null,554475973977597,2,null,[[0,[13]]]],[33,39,null,882702815441648,0,null,[[3,0]]]]],[3,[true,"EventosEmLooping"],false,null,325264316756530,11,[[-1,40,null,0,false,false,false,0,false,[[1,[15]]]]],[],[[0,0,false,null,384760929198923,12,[[91,41,null,0,false,false,false,470521735194273,null]],[[91,42,null,992394219341185,0,null,[[4,17],[7,[12]]]],[14,43,null,762628287186802,0,null,[[0,[16,[1,17,44,false]]],[0,[16,[1,14,45,false]]]]]],[[0,0,false,null,483338276154115,13,[[17,46,null,0,false,false,false,308810426541081,null,[[10,2],[8,2],[7,[12]]]]],[[17,47,null,704697293436623,0,null,[[10,2],[7,[12]]]]]]]],[0,0,false,null,668065600914359,14,[[92,41,null,0,false,false,false,777949049497491,null]],[[92,42,null,859320255851966,0,null,[[4,18],[7,[12]]]],[15,43,null,605259631418105,0,null,[[0,[16,[1,18,44,false]]],[0,[16,[1,15,45,false]]]]]],[[0,0,false,null,180939689653018,15,[[18,46,null,0,false,false,false,542107706755718,null,[[10,2],[8,2],[7,[12]]]]],[[18,47,null,424666613867862,0,null,[[10,2],[7,[12]]]]]]]],[0,0,false,null,331363708990671,16,[[29,48,null,0,false,false,false,251571281843827,null,[[8,3],[0,[12]]]]],[[29,49,null,249002106220128,0,null,[[0,[12]]]]]],[0,0,false,null,521133831640566,17,[[30,48,null,0,false,false,false,740691489705591,null,[[8,3],[0,[12]]]]],[[30,49,null,823170263016389,0,null,[[0,[12]]]]]],[0,0,false,null,313187286024110,18,[[91,41,null,0,false,false,false,110513361334511,null],[92,41,null,0,false,false,false,369581155011369,null]],[],[[0,0,true,null,264473504008283,19,[[17,46,null,0,false,false,false,664147329154722,null,[[10,2],[8,2],[7,[17]]]],[18,46,null,0,false,false,false,261043577317838,null,[[10,2],[8,2],[7,[17]]]]],[[27,50,null,358273040283796,0,null,[[1,[18]],[3,1]]]]]]]]],[3,[true,"Jogador1"],false,null,450898656974350,20,[[-1,40,null,0,false,false,false,0,false,[[1,[19]]]]],[],[[0,0,false,null,787939096216266,21,[[17,51,"Platform",0,false,false,false,375141114353930,null],[-1,32,null,0,false,false,false,877612384745223,null,[[11,863177864399805],[8,0],[7,[12]]]]],[[17,52,"Platform",650287867513779,0,null,[[0,[20,[2,17,false,2]]]]]],[[0,0,false,null,171192964429909,22,[[17,53,null,0,false,true,false,997531460498055,null,[[10,1]]],[17,53,null,0,false,true,false,600716875572951,null,[[10,5]]],[17,46,null,0,false,false,false,374169984873505,null,[[10,2],[8,4],[7,[12]]]]],[],[[0,0,false,null,755405750273121,23,[[17,46,null,0,false,false,false,434920776057827,null,[[10,0],[8,0],[7,[21]]]]],[[91,50,null,599091196452645,0,null,[[1,[21]],[3,1]]]]],[0,0,false,null,101045466984528,24,[[17,46,null,0,false,false,false,399219236665529,null,[[10,0],[8,0],[7,[22]]]]],[],[[0,0,false,null,164336333919843,25,[[-1,32,null,0,false,false,false,415819909784536,null,[[11,754743954925292],[8,0],[7,[12]]]]],[[91,50,null,554837251923180,0,null,[[1,[23]],[3,1]]]]],[0,0,false,null,496435967318730,26,[[-1,54,null,0,false,false,false,642031793043633,null]],[[91,50,null,851570005609799,0,null,[[1,[24,[1,91,44,false],[1,92,44,false]]],[3,1]]]]]]],[0,0,false,null,927163551430193,27,[[17,46,null,0,false,false,false,320879447673613,null,[[10,0],[8,0],[7,[25]]]]],[],[[0,0,false,null,356370460655677,28,[[-1,32,null,0,false,false,false,906560731340287,null,[[11,754743954925292],[8,0],[7,[12]]]]],[[91,50,null,769135843030208,0,null,[[1,[23]],[3,1]]]]],[0,0,false,null,345778829221305,29,[[-1,54,null,0,false,false,false,160657751018330,null]],[[91,50,null,887381146931688,0,null,[[1,[26,[1,91,44,false],[1,92,44,false]]],[3,1]]]]]]],[0,0,true,null,222341440255054,30,[[0,55,null,0,false,false,false,560075096173220,null,[[9,65]]]],[],[[0,0,false,null,912844348523773,31,[[17,46,null,0,false,true,false,962095181012649,null,[[10,0],[8,0],[7,[27]]]],[17,46,null,0,false,true,false,349526921238621,null,[[10,0],[8,0],[7,[28]]]],[17,46,null,0,false,true,false,560661280719896,null,[[10,0],[8,0],[7,[29]]]]],[],[[0,0,false,null,519998228668036,32,[[91,56,null,0,false,true,false,707132734295956,null]],[],[[0,0,true,null,145433491602820,33,[[92,57,null,0,false,false,false,445136143236478,null,[[1,[27]]]],[92,57,null,0,false,false,false,417434549264427,null,[[1,[28]]]],[92,57,null,0,false,false,false,787443442531222,null,[[1,[30]]]],[92,57,null,0,false,false,false,589312303300157,null,[[1,[31]]]],[92,57,null,0,false,false,false,581382890774177,null,[[1,[32]]]],[92,57,null,0,false,false,false,377358943292030,null,[[1,[33]]]],[92,57,null,0,false,false,false,985700285253116,null,[[1,[34]]]],[92,57,null,0,false,false,false,698773621104108,null,[[1,[35]]]]],[],[[0,0,false,null,609921552662005,34,[[-1,58,null,0,false,false,false,265566590385415,null,[[7,[36,[1,17,44,false]]],[8,5],[7,[16,[1,18,44,false]]]]],[-1,37,null,0,false,false,false,826020665184749,null]],[[17,47,null,921304356615681,0,null,[[10,0],[7,[37]]]],[91,50,null,741550778997794,0,null,[[1,[37]],[3,1]]],[17,59,"Platform",725306130735541,0,null,[[0,[12]]]]]]]],[0,0,true,null,699733840803408,35,[[92,60,null,1,false,false,false,266950360652077,null,[[1,[28]]]],[92,60,null,1,false,false,false,728406511514651,null,[[1,[27]]]]],[[-1,34,null,447295370232786,2,null,[[0,[38]]]],[17,47,null,232147200543698,0,null,[[10,0],[7,[22]]]]]],[0,0,false,null,885870988771355,36,[[91,61,null,0,false,false,false,783888271756610,null,[[4,92]]],[91,57,null,0,false,true,false,911445859302552,null,[[1,[37]]]]],[[17,62,"Platform",457946930820959,0,null,[[3,0]]],[17,47,null,281184995166043,0,null,[[10,0],[7,[22]]]]]],[0,0,false,null,382074972866127,37,[[91,61,null,0,false,true,false,318240873525285,null,[[4,92]]],[91,57,null,0,false,true,false,963027164703230,null,[[1,[37]]]]],[[17,62,"Platform",133744952511455,0,null,[[3,0]]],[17,47,null,953279883691376,0,null,[[10,0],[7,[22]]]]]]]],[0,0,false,null,542597257252689,38,[[91,56,null,0,false,false,false,563779387408845,null],[91,57,null,0,false,true,false,811218698427975,null,[[1,[37]]]]],[[17,62,"Platform",763221728290620,0,null,[[3,0]]],[17,47,null,556142175367684,0,null,[[10,0],[7,[22]]]]]]]]]],[0,0,true,null,201482259520756,39,[[0,55,null,0,false,false,false,183598500638663,null,[[9,68]]]],[],[[0,0,false,null,697819279194128,40,[[17,46,null,0,false,true,false,890896187460071,null,[[10,0],[8,0],[7,[27]]]],[17,46,null,0,false,true,false,177249394028271,null,[[10,0],[8,0],[7,[28]]]],[17,46,null,0,false,true,false,421672066439327,null,[[10,0],[8,0],[7,[29]]]]],[],[[0,0,false,null,552036490219496,41,[[91,56,null,0,false,true,false,158847244258230,null],[91,57,null,0,false,true,false,772925348127887,null,[[1,[37]]]]],[[17,62,"Platform",810680971171635,0,null,[[3,1]]],[17,47,null,179960406818084,0,null,[[10,0],[7,[25]]]]]],[0,0,false,null,488062427775996,42,[[91,56,null,0,false,false,false,493587490941676,null]],[],[[0,0,true,null,352856964450024,43,[[92,57,null,0,false,false,false,844211654754125,null,[[1,[28]]]],[92,57,null,0,false,false,false,406799594641517,null,[[1,[27]]]],[92,57,null,0,false,false,false,955889537694943,null,[[1,[30]]]],[92,57,null,0,false,false,false,873268111479470,null,[[1,[31]]]],[92,57,null,0,false,false,false,732212517654398,null,[[1,[32]]]],[92,57,null,0,false,false,false,616065650045199,null,[[1,[33]]]],[92,57,null,0,false,false,false,436619510589389,null,[[1,[34]]]],[92,57,null,0,false,false,false,448455059756089,null,[[1,[35]]]]],[],[[0,0,false,null,782859993602904,44,[[-1,58,null,0,false,false,false,504029987770591,null,[[7,[39,[1,17,44,false]]],[8,3],[7,[16,[1,18,44,false]]]]],[-1,37,null,0,false,false,false,238938485921604,null]],[[17,47,null,634604833959945,0,null,[[10,0],[7,[37]]]],[91,50,null,826617046141598,0,null,[[1,[37]],[3,1]]],[17,59,"Platform",833376679286743,0,null,[[0,[12]]]]]]]],[0,0,true,null,717772584744733,45,[[92,60,null,1,false,false,false,256603149615804,null,[[1,[28]]]],[92,60,null,1,false,false,false,811538783203243,null,[[1,[27]]]]],[[-1,34,null,904549503578176,2,null,[[0,[38]]]],[17,47,null,756285257952483,0,null,[[10,0],[7,[25]]]]]],[0,0,false,null,114785712916226,46,[[91,61,null,0,false,false,false,984415702106799,null,[[4,92]]],[91,57,null,0,false,true,false,355723567493659,null,[[1,[37]]]]],[[17,62,"Platform",950048280638906,0,null,[[3,1]]],[17,47,null,746029220726183,0,null,[[10,0],[7,[25]]]]]],[0,0,false,null,484481734900937,47,[[91,61,null,0,false,true,false,958747092840825,null,[[4,92]]],[17,53,null,0,false,true,false,313855355490889,null,[[10,4]]]],[[17,62,"Platform",622931011365808,0,null,[[3,1]]],[17,47,null,688686102294950,0,null,[[10,0],[7,[25]]]]]]]]]]]],[0,0,true,null,487041858887072,48,[[71,63,null,0,false,false,false,435584658458580,null,[[4,37]]]],[],[[0,0,false,null,253232870112971,49,[[17,46,null,0,false,true,false,726614422379340,null,[[10,0],[8,0],[7,[27]]]],[17,46,null,0,false,true,false,416211043524809,null,[[10,0],[8,0],[7,[28]]]],[17,46,null,0,false,true,false,674029748916250,null,[[10,0],[8,0],[7,[29]]]]],[],[[0,0,false,null,133836365953403,50,[[91,56,null,0,false,true,false,468190833594695,null]],[],[[0,0,true,null,565200323872538,51,[[92,57,null,0,false,false,false,935411851356332,null,[[1,[27]]]],[92,57,null,0,false,false,false,328408115926542,null,[[1,[28]]]],[92,57,null,0,false,false,false,705853974857900,null,[[1,[30]]]],[92,57,null,0,false,false,false,102409895922721,null,[[1,[31]]]],[92,57,null,0,false,false,false,361281902376393,null,[[1,[32]]]],[92,57,null,0,false,false,false,667434148754981,null,[[1,[33]]]],[92,57,null,0,false,false,false,947666942976669,null,[[1,[34]]]],[92,57,null,0,false,false,false,720556550527572,null,[[1,[35]]]]],[],[[0,0,false,null,729941828059609,52,[[-1,58,null,0,false,false,false,130212409207231,null,[[7,[36,[1,17,44,false]]],[8,5],[7,[16,[1,18,44,false]]]]],[-1,37,null,0,false,false,false,666293143568009,null]],[[17,47,null,994735278827995,0,null,[[10,0],[7,[37]]]],[91,50,null,502037541228733,0,null,[[1,[37]],[3,1]]],[17,59,"Platform",255678325009331,0,null,[[0,[12]]]]]]]],[0,0,true,null,215342125463170,53,[[92,60,null,1,false,false,false,172380598539175,null,[[1,[28]]]],[92,60,null,1,false,false,false,373505068394225,null,[[1,[27]]]]],[[-1,34,null,980737849926222,2,null,[[0,[38]]]],[17,47,null,803582850531852,0,null,[[10,0],[7,[22]]]]]],[0,0,false,null,846598006967954,54,[[91,61,null,0,false,false,false,267626797305901,null,[[4,92]]],[91,57,null,0,false,true,false,174853574282576,null,[[1,[37]]]]],[[17,62,"Platform",368971878548391,0,null,[[3,0]]],[17,47,null,302232092794448,0,null,[[10,0],[7,[22]]]]]],[0,0,false,null,763001985864940,55,[[91,61,null,0,false,true,false,832530326106335,null,[[4,92]]],[91,57,null,0,false,true,false,350489352161814,null,[[1,[37]]]]],[[17,62,"Platform",782011226357245,0,null,[[3,0]]],[17,47,null,948864903744370,0,null,[[10,0],[7,[22]]]]]]]],[0,0,false,null,752924436869109,56,[[91,56,null,0,false,false,false,813560183296088,null],[91,57,null,0,false,true,false,499744746006472,null,[[1,[37]]]]],[[17,62,"Platform",727345798056537,0,null,[[3,0]]],[17,47,null,851058235005841,0,null,[[10,0],[7,[22]]]]]]]]]],[0,0,true,null,952202474688516,57,[[71,63,null,0,false,false,false,960128557227543,null,[[4,38]]]],[],[[0,0,false,null,448135333261126,58,[[17,46,null,0,false,true,false,863383018010006,null,[[10,0],[8,0],[7,[27]]]],[17,46,null,0,false,true,false,593821676420434,null,[[10,0],[8,0],[7,[28]]]],[17,46,null,0,false,true,false,275908752226018,null,[[10,0],[8,0],[7,[29]]]]],[],[[0,0,false,null,294877825738072,59,[[91,56,null,0,false,true,false,331149519505614,null],[91,57,null,0,false,true,false,753841844860676,null,[[1,[37]]]]],[[17,62,"Platform",431046856719464,0,null,[[3,1]]],[17,47,null,400153131342603,0,null,[[10,0],[7,[25]]]]]],[0,0,false,null,122992382885097,60,[[91,56,null,0,false,false,false,439116017182647,null]],[],[[0,0,true,null,912249719840131,61,[[92,57,null,0,false,false,false,484156094531393,null,[[1,[28]]]],[92,57,null,0,false,false,false,195096107339002,null,[[1,[27]]]],[92,57,null,0,false,false,false,336329476699711,null,[[1,[30]]]],[92,57,null,0,false,false,false,561084795673546,null,[[1,[31]]]],[92,57,null,0,false,false,false,316405983991541,null,[[1,[32]]]],[92,57,null,0,false,false,false,140841472483022,null,[[1,[33]]]],[92,57,null,0,false,false,false,120907830544577,null,[[1,[34]]]],[92,57,null,0,false,false,false,289498581297116,null,[[1,[35]]]]],[],[[0,0,false,null,198586702771632,62,[[-1,58,null,0,false,false,false,229030675812444,null,[[7,[39,[1,17,44,false]]],[8,3],[7,[16,[1,18,44,false]]]]],[-1,37,null,0,false,false,false,312582088967912,null]],[[17,47,null,542510332784705,0,null,[[10,0],[7,[37]]]],[91,50,null,851511031775900,0,null,[[1,[37]],[3,1]]],[17,59,"Platform",757517041803493,0,null,[[0,[12]]]]]]]],[0,0,true,null,823012235223401,63,[[92,60,null,1,false,false,false,856491171489675,null,[[1,[28]]]],[92,60,null,1,false,false,false,660533957600186,null,[[1,[27]]]]],[[-1,34,null,253217963602520,2,null,[[0,[38]]]],[17,47,null,290367749225364,0,null,[[10,0],[7,[25]]]]]],[0,0,false,null,764528309774027,64,[[91,61,null,0,false,false,false,901023495034351,null,[[4,92]]],[91,57,null,0,false,true,false,976870391264409,null,[[1,[37]]]]],[[17,62,"Platform",670715387885571,0,null,[[3,1]]],[17,47,null,894542397970987,0,null,[[10,0],[7,[25]]]]]],[0,0,false,null,987790784871840,65,[[91,61,null,0,false,true,false,303091303740006,null,[[4,92]]],[17,53,null,0,false,true,false,565994178938868,null,[[10,4]]]],[[17,62,"Platform",396609121644562,0,null,[[3,1]]],[17,47,null,637889487609741,0,null,[[10,0],[7,[25]]]]]]]]]]]],[0,0,true,null,163247472302846,66,[[0,55,null,0,false,false,false,259023754900292,null,[[9,87]]],[71,64,null,1,false,false,false,571074079758751,null,[[4,40]]]],[],[[0,0,false,null,260043700580947,67,[[17,46,null,0,false,true,false,904509330069237,null,[[10,0],[8,0],[7,[27]]]],[17,46,null,0,false,true,false,114079110987423,null,[[10,0],[8,0],[7,[28]]]],[17,46,null,0,false,true,false,560575495666641,null,[[10,0],[8,0],[7,[29]]]],[17,53,null,0,false,true,false,462428478405377,null,[[10,4]]],[91,57,null,0,false,true,false,600962659483281,null,[[1,[34]]]],[91,57,null,0,false,true,false,169858714310656,null,[[1,[40]]]]],[[17,62,"Platform",486646268577345,0,null,[[3,2]]]],[[0,0,false,null,486225545327439,68,[[17,46,null,0,false,false,false,798825214012621,null,[[10,0],[8,0],[7,[22]]]]],[[17,47,null,903897325072517,0,null,[[10,0],[7,[41]]]]]],[0,0,false,null,390867274626400,69,[[17,46,null,0,false,false,false,714090618182767,null,[[10,0],[8,0],[7,[25]]]]],[[17,47,null,473257265786321,0,null,[[10,0],[7,[42]]]]]]]]]],[0,0,true,null,443555050146848,70,[[0,65,null,1,false,false,false,136595795510963,null,[[9,70]]],[71,64,null,1,false,false,false,636073350133894,null,[[4,39]]]],[],[[0,0,false,null,501358645911054,71,[[91,57,null,0,false,true,false,922628532091668,null,[[1,[27]]]],[91,57,null,0,false,true,false,470226262037158,null,[[1,[28]]]],[91,57,null,0,false,true,false,181827036026977,null,[[1,[34]]]],[91,57,null,0,false,true,false,323240831431234,null,[[1,[35]]]],[91,57,null,0,false,true,false,338487208126519,null,[[1,[37]]]]],[],[[0,0,false,null,470315642654528,72,[[17,46,null,0,false,true,false,717972639700914,null,[[10,0],[8,0],[7,[29]]]]],[[17,47,null,670646770518221,0,null,[[10,0],[7,[27]]]],[17,59,"Platform",956256508847965,0,null,[[0,[12]]]],[91,50,null,270832516102646,0,null,[[1,[27]],[3,1]]]]],[0,0,false,null,775672151805051,73,[[17,46,null,0,false,false,false,973903557313041,null,[[10,0],[8,0],[7,[29]]]]],[[91,50,null,738156130702791,0,null,[[1,[34]],[3,1]]]]]]]]],[0,0,true,null,501045317634737,74,[[0,65,null,1,false,false,false,264231017993789,null,[[9,71]]],[71,64,null,1,false,false,false,932605327838131,null,[[4,36]]]],[],[[0,0,false,null,336084853188502,75,[[91,57,null,0,false,true,false,450665464130813,null,[[1,[27]]]],[91,57,null,0,false,true,false,237793677629428,null,[[1,[28]]]],[91,57,null,0,false,true,false,735524722707189,null,[[1,[34]]]],[91,57,null,0,false,true,false,175628030439961,null,[[1,[35]]]],[91,57,null,0,false,true,false,784767964012981,null,[[1,[37]]]]],[],[[0,0,false,null,399845845540435,76,[[17,46,null,0,false,true,false,209756894844034,null,[[10,0],[8,0],[7,[29]]]]],[[17,47,null,581562200019492,0,null,[[10,0],[7,[28]]]],[17,59,"Platform",812523306765041,0,null,[[0,[12]]]],[91,50,null,694944708070546,0,null,[[1,[28]],[3,1]]]]],[0,0,false,null,937363507032528,77,[[17,46,null,0,false,false,false,584374979885208,null,[[10,0],[8,0],[7,[29]]]]],[[91,50,null,634165376097109,0,null,[[1,[35]],[3,1]]]]]]]]],[0,0,false,null,385953905722103,78,[[17,46,null,0,false,true,false,805138529521342,null,[[10,0],[8,0],[7,[27]]]],[17,46,null,0,false,true,false,982418834220094,null,[[10,0],[8,0],[7,[28]]]]],[],[[0,0,false,null,710924778153435,79,[[-1,29,null,0,false,false,false,994723952903303,null,[[3,2]]]],[[17,47,null,717119357527071,0,null,[[10,0],[7,[21]]]]]],[0,0,false,null,354952352262292,80,[[0,55,null,0,false,true,false,396735264510012,null,[[9,65]]],[0,55,null,0,false,true,false,871428914262905,null,[[9,68]]],[0,55,null,0,false,true,false,528182452872276,null,[[9,83]]],[91,57,null,0,false,true,false,676872700496261,null,[[1,[34]]]],[91,57,null,0,false,true,false,685621756114172,null,[[1,[35]]]],[-1,29,null,0,false,true,false,631130403042662,null,[[3,2]]]],[[17,47,null,805662267864981,0,null,[[10,0],[7,[21]]]]]]]],[0,0,false,null,787793899594201,81,[[0,55,null,0,false,false,false,373015178480207,null,[[9,83]]],[-1,32,null,0,false,false,false,143189085303088,null,[[11,754743954925292],[8,0],[7,[1]]]]],[],[[0,0,false,null,696791733641035,82,[[17,46,null,0,false,true,false,184472935684908,null,[[10,0],[8,0],[7,[27]]]],[17,46,null,0,false,true,false,607653952943914,null,[[10,0],[8,0],[7,[28]]]],[17,53,null,0,false,true,false,647451141579445,null,[[10,4]]],[-1,37,null,0,false,false,false,730175187228747,null]],[[17,59,"Platform",674775700425290,0,null,[[0,[12]]]],[17,47,null,311569536644215,0,null,[[10,0],[7,[29]]]],[91,50,null,604089625131119,0,null,[[1,[29]],[3,1]]]]]]],[0,0,false,null,998297842083790,83,[[91,60,null,1,false,false,false,228032557445786,null,[[1,[34]]]],[-1,32,null,0,false,false,false,554053014945839,null,[[11,754743954925292],[8,0],[7,[1]]]]],[],[[0,0,false,null,242476349934654,84,[[0,55,null,0,false,false,false,787549913401554,null,[[9,83]]]],[[91,50,null,855190297678473,0,null,[[1,[29]],[3,1]]],[91,66,null,261714942815895,0,null,[[0,[1]]]]]],[0,0,false,null,913970347496530,85,[[0,55,null,0,false,true,false,663506790682313,null,[[9,83]]]],[[17,47,null,841442322147761,0,null,[[10,0],[7,[21]]]]]]]],[0,0,false,null,307627496289914,86,[[91,60,null,1,false,false,false,625121852357240,null,[[1,[35]]]]],[],[[0,0,false,null,326736074860712,87,[[0,55,null,0,false,false,false,926625546962792,null,[[9,83]]]],[[91,50,null,325249550537716,0,null,[[1,[29]],[3,1]]],[91,66,null,941936990367844,0,null,[[0,[1]]]]]],[0,0,false,null,127628309865730,88,[[0,55,null,0,false,true,false,217482238601137,null,[[9,83]]]],[[17,47,null,300209964214754,0,null,[[10,0],[7,[21]]]]]]]]]],[0,0,false,null,959346065001582,89,[[17,53,null,0,false,false,false,738051002650221,null,[[10,1]]]],[],[[0,0,false,null,552085738678376,90,[[91,56,null,0,false,false,false,242297300062837,null]],[],[[0,0,false,null,770630475936927,91,[[17,67,null,0,false,false,false,857166041320372,null,[[8,3],[0,[3,[3,548949025892520]]]]]],[[17,62,"Platform",243973035849360,0,null,[[3,1]]]]],[0,0,false,null,634151607924522,92,[[-1,54,null,0,false,false,false,372926529414995,null]],[[18,62,"Platform",876340491212140,0,null,[[3,0]]]]]]],[0,0,false,null,233943253204311,93,[[-1,54,null,0,false,false,false,779059329789438,null]],[],[[0,0,false,null,319041710381866,94,[[17,67,null,0,false,false,false,117586179906390,null,[[8,5],[0,[3,[3,962875178820567]]]]]],[[17,62,"Platform",642268175641289,0,null,[[3,0]]]]],[0,0,false,null,521228868585192,95,[[-1,54,null,0,false,false,false,510684172767204,null]],[[18,62,"Platform",660855491384753,0,null,[[3,1]]]]]]],[0,0,false,null,911358161548081,96,[[-1,37,null,0,false,false,false,676944780592049,null]],[],[[0,0,false,null,310058401925271,97,[[17,46,null,0,false,false,false,373714692512131,null,[[10,2],[8,4],[7,[12]]]]],[[17,47,null,709018484471041,0,null,[[10,0],[7,[43]]]],[8,68,null,776147573809675,0,null],[17,69,null,874989714393382,0,null,[[10,2],[7,[44]]]],[2,25,null,739198467094995,0,null,[[1,[5]],[13]]],[91,50,null,330944072858457,0,null,[[1,[45]],[3,1]]]]],[0,0,false,null,428255177524992,98,[[-1,54,null,0,false,false,false,855077711401808,null]],[[91,50,null,502862612190686,0,null,[[1,[46]],[3,1]]]]]]]]],[0,0,false,null,387604759236090,99,[[17,53,null,0,false,false,false,483486225189483,null,[[10,5]]],[-1,37,null,0,false,false,false,776746980130846,null]],[[-1,70,null,634612201673208,0,null,[[11,717575276874391],[7,[1]]]],[1,71,null,564493374195175,0,null,[[2,["equip-unlock",false]],[3,0],[0,[12]],[1,[47]]]],[-1,70,null,982317072142823,0,null,[[11,361400748529732],[7,[1]]]],[2,25,null,971941771038281,0,null,[[1,[5]],[13]]],[-1,27,null,763833785269268,0,null,[[0,[48]]]],[-1,34,null,839835378643123,2,null,[[0,[1]]]],[-1,27,null,301762286067200,0,null,[[0,[1]]]],[17,47,null,182124240041841,0,null,[[10,0],[7,[49]]]],[1,71,null,974430159584776,0,null,[[2,["new-best-score",false]],[3,0],[0,[12]],[1,[47]]]],[80,72,"Tween",993124865530482,1,null,[[1,[47]],[3,1],[0,[50]],[0,[51]],[0,[52]],[18,0],[3,0],[3,0],[3,0]]],[91,50,null,908820633322903,0,null,[[1,[53]],[3,1]]],[-1,34,null,135888584335132,2,null,[[0,[13]]]],[2,25,null,616802176251338,0,null,[[1,[54]],[13]]]]]]],[0,0,false,null,471586412081398,100,[[17,51,"Platform",0,false,true,false,407365069825358,null],[-1,32,null,0,false,false,false,900810715265682,null,[[11,863177864399805],[8,0],[7,[12]]]]],[[17,52,"Platform",728770459428702,0,null,[[0,[55,[2,17,false,2]]]]]],[[0,0,false,null,775529586123291,101,[[17,53,null,0,false,true,false,489276285207524,null,[[10,1]]],[17,53,null,0,false,true,false,978668529165125,null,[[10,5]]],[17,46,null,0,false,false,false,405175734442646,null,[[10,2],[8,4],[7,[12]]]]],[],[[0,0,false,null,151248235227798,102,[[17,46,null,0,false,false,false,558533196435724,null,[[10,0],[8,0],[7,[21]]]]],[[17,47,null,638003817672230,0,null,[[10,0],[7,[56]]]],[91,50,null,787896879053987,0,null,[[1,[56]],[3,1]]]]],[0,0,false,null,687388374065286,103,[[17,46,null,0,false,false,false,902570985951991,null,[[10,0],[8,0],[7,[41]]]]],[[17,62,"Platform",972710030606806,0,null,[[3,0]]]],[[0,0,false,null,705625826561842,104,[[-1,37,null,0,false,false,false,166736626442422,null]],[[91,50,null,685142747131180,0,null,[[1,[56]],[3,1]]]]]]],[0,0,false,null,816822626761699,105,[[17,46,null,0,false,false,false,893097912695596,null,[[10,0],[8,0],[7,[57]]]]],[[17,62,"Platform",388942222183955,0,null,[[3,0]]]]],[0,0,false,null,754890578441174,106,[[17,46,null,0,false,false,false,514947669864701,null,[[10,0],[8,0],[7,[42]]]]],[[17,62,"Platform",766796925390704,0,null,[[3,1]]]],[[0,0,false,null,107979368720634,107,[[-1,37,null,0,false,false,false,140846575487773,null]],[[91,50,null,471696038117760,0,null,[[1,[56]],[3,1]]]]]]],[0,0,false,null,882877576311265,108,[[17,46,null,0,false,false,false,523792958842051,null,[[10,0],[8,0],[7,[58]]]]],[[17,62,"Platform",986662238523134,0,null,[[3,1]]]]],[0,0,false,null,851611700912375,109,[[0,65,null,1,false,false,false,672468448300132,null,[[9,70]]],[-1,32,null,0,false,false,false,751052562739561,null,[[11,754743954925292],[8,0],[7,[1]]]]],[],[[0,0,false,null,253078847569846,110,[[17,46,null,0,false,false,false,585431403015031,null,[[10,0],[8,0],[7,[41]]]]],[[17,47,null,371726278078293,0,null,[[10,0],[7,[57]]]],[91,50,null,553549639752429,0,null,[[1,[31]],[3,1]]]]],[0,0,false,null,306653699567075,111,[[17,46,null,0,false,false,false,623254058218627,null,[[10,0],[8,0],[7,[42]]]]],[[17,47,null,147521052523381,0,null,[[10,0],[7,[58]]]],[91,50,null,350637268657017,0,null,[[1,[31]],[3,1]]]]],[0,0,false,null,981404654121527,112,[[17,46,null,0,false,false,false,937111670507005,null,[[10,0],[8,0],[7,[56]]]]],[[17,47,null,765341133006098,0,null,[[10,0],[7,[59]]]],[91,50,null,823798731225828,0,null,[[1,[30]],[3,1]]]]]]],[0,0,false,null,745258359029299,113,[[0,65,null,1,false,false,false,722498116605546,null,[[9,71]]],[-1,32,null,0,false,false,false,546340467755191,null,[[11,754743954925292],[8,0],[7,[1]]]]],[],[[0,0,false,null,718685805351824,114,[[17,46,null,0,false,false,false,444298242751574,null,[[10,0],[8,0],[7,[41]]]]],[[17,47,null,948114566262471,0,null,[[10,0],[7,[57]]]],[91,50,null,852820854723316,0,null,[[1,[32]],[3,1]]]]],[0,0,false,null,553841551860926,115,[[17,46,null,0,false,false,false,776411097295489,null,[[10,0],[8,0],[7,[42]]]]],[[17,47,null,647607177636142,0,null,[[10,0],[7,[58]]]],[91,50,null,768922095046342,0,null,[[1,[32]],[3,1]]]]],[0,0,false,null,176857699175218,116,[[17,46,null,0,false,false,false,992930921799765,null,[[10,0],[8,0],[7,[56]]]]],[[17,47,null,329378858569871,0,null,[[10,0],[7,[60]]]],[91,50,null,152733570664099,0,null,[[1,[33]],[3,1]]]]]]]]],[0,0,false,null,772695162271191,117,[[17,53,null,0,false,false,false,472995383754582,null,[[10,1]]]],[],[[0,0,false,null,560114233884247,118,[[91,56,null,0,false,false,false,954099070916515,null]],[],[[0,0,false,null,477138681858372,119,[[17,67,null,0,false,false,false,178015160094104,null,[[8,3],[0,[3,[3,548949025892520]]]]]],[[17,62,"Platform",864022515880157,0,null,[[3,1]]]]],[0,0,false,null,119280390041394,120,[[-1,54,null,0,false,false,false,655204133561674,null]],[[18,62,"Platform",678744730009464,0,null,[[3,0]]]]]]],[0,0,false,null,554312588529663,121,[[-1,54,null,0,false,false,false,672608520084040,null]],[],[[0,0,false,null,948412487920105,122,[[17,67,null,0,false,false,false,665598515460882,null,[[8,5],[0,[3,[3,962875178820567]]]]]],[[17,62,"Platform",569066942226441,0,null,[[3,0]]]]],[0,0,false,null,669813994758469,123,[[-1,54,null,0,false,false,false,432480487898492,null]],[[18,62,"Platform",940003210484276,0,null,[[3,1]]]]]]],[0,0,false,null,826078403216410,124,[[-1,37,null,0,false,false,false,487123968746363,null]],[[17,73,"Platform",969366363125517,0,null,[[0,[61]]]],[17,47,null,152325988764044,0,null,[[10,0],[7,[43]]]],[17,69,null,263029077687150,0,null,[[10,2],[7,[44]]]],[8,68,null,622874691947197,0,null],[2,25,null,748879175473450,0,null,[[1,[5]],[13]]],[91,50,null,859854766012182,0,null,[[1,[45]],[3,1]]]]]]]]],[0,0,false,null,556605394450757,125,[[91,60,null,1,false,false,false,183808690615243,null,[[1,[27]]]]],[[-1,34,null,703755210516897,2,null,[[0,[62]]]],[17,47,null,535725975934638,0,null,[[10,0],[7,[21]]]]]],[0,0,false,null,302199870126200,126,[[91,60,null,1,false,false,false,426770543369315,null,[[1,[28]]]]],[[-1,34,null,762577661637257,2,null,[[0,[62]]]],[17,47,null,798733034672910,0,null,[[10,0],[7,[21]]]]]],[0,0,true,null,455465031796398,127,[[91,60,null,1,false,false,false,994146036151020,null,[[1,[63]]]]],[[-1,34,null,209954763577403,2,null,[[0,[64]]]],[17,74,null,159442795014335,0,null,[[10,1],[3,0]]]]],[0,0,true,null,916686321477288,128,[[91,60,null,1,false,false,false,513800751008098,null,[[1,[45]]]],[91,60,null,1,false,false,false,465675364299524,null,[[1,[40]]]]],[[17,74,null,914874217013142,0,null,[[10,1],[3,0]]]]],[0,0,false,null,577126807021718,129,[[17,46,null,0,false,false,false,733933918431701,null,[[10,2],[8,3],[7,[12]]]],[-1,37,null,0,false,false,false,912908779655993,null]],[[18,74,null,658215180177771,0,null,[[10,5],[3,1]]],[-1,34,null,270204185514505,2,null,[[0,[52]]]],[17,47,null,213311360758301,0,null,[[10,0],[7,[46]]]],[17,74,null,790620317075395,0,null,[[10,1],[3,0]]]],[[0,0,false,null,897259125248325,130,[[17,46,null,0,false,false,false,965144315921577,null,[[10,0],[8,0],[7,[46]]]]],[[91,50,null,828980014601416,0,null,[[1,[46]],[3,1]]]]]]],[0,0,true,null,371046916596158,131,[[91,57,null,0,false,false,false,238973075637897,null,[[1,[27]]]],[91,57,null,0,false,false,false,773712828299187,null,[[1,[28]]]],[91,57,null,0,false,false,false,710669443665561,null,[[1,[32]]]],[91,57,null,0,false,false,false,114506836326844,null,[[1,[33]]]],[91,57,null,0,false,false,false,566064902028761,null,[[1,[30]]]],[91,57,null,0,false,false,false,288895427019353,null,[[1,[31]]]],[91,57,null,0,false,false,false,296618406095551,null,[[1,[31]]]],[91,57,null,0,false,false,false,496487315007304,null,[[1,[35]]]],[91,57,null,0,false,false,false,234046984600854,null,[[1,[34]]]],[91,57,null,0,false,false,false,425182321186434,null,[[1,[53]]]]],[[91,75,null,342008834324709,0,null]]],[0,0,true,null,682324612211936,132,[[91,60,null,1,false,false,false,573266137675341,null,[[1,[27]]]],[91,60,null,1,false,false,false,532268373950153,null,[[1,[34]]]],[91,60,null,1,false,false,false,298197862122920,null,[[1,[31]]]],[91,60,null,1,false,false,false,317355332777562,null,[[1,[30]]]]],[],[[0,0,false,null,250404354630996,133,[[91,61,null,0,false,true,false,104883925252161,null,[[4,18]]]],[[2,25,null,183975126244805,0,null,[[1,[65]],[13,[7,[66]]]]]]]]],[0,0,true,null,810364049188904,134,[[91,60,null,1,false,false,false,930674916926412,null,[[1,[28]]]],[91,60,null,1,false,false,false,758007173340035,null,[[1,[35]]]],[91,60,null,1,false,false,false,843660131240129,null,[[1,[32]]]],[91,60,null,1,false,false,false,916025426617583,null,[[1,[33]]]]],[],[[0,0,false,null,842899346168202,135,[[91,61,null,0,false,true,false,498982928818230,null,[[4,18]]]],[[2,25,null,170762927417814,0,null,[[1,[65]],[13,[7,[67]]]]]]]]],[0,0,false,null,127403727583958,136,[[17,76,"Platform",1,false,false,false,877971871726802,null],[17,53,null,0,false,false,false,863702423353816,null,[[10,1]]]],[[17,74,null,985670685517753,0,null,[[10,1],[3,0]]]]]]],[3,[true,"Jogador2"],false,null,658816398194855,137,[[-1,40,null,0,false,false,false,0,false,[[1,[68]]]]],[],[[0,0,false,null,341597952178378,138,[[18,51,"Platform",0,false,false,false,157298141184513,null],[-1,32,null,0,false,false,false,315656012457081,null,[[11,863177864399805],[8,0],[7,[12]]]]],[[18,52,"Platform",692793863135470,0,null,[[0,[20,[2,18,false,2]]]]]],[[0,0,false,null,204468816740506,139,[[18,53,null,0,false,true,false,752467613926458,null,[[10,1]]],[18,53,null,0,false,true,false,328788176840438,null,[[10,5]]],[18,46,null,0,false,false,false,741895426022029,null,[[10,2],[8,4],[7,[12]]]]],[],[[0,0,false,null,449922046708571,140,[[18,46,null,0,false,false,false,667656464845893,null,[[10,0],[8,0],[7,[21]]]]],[[92,50,null,464447977416924,0,null,[[1,[21]],[3,1]]]]],[0,0,false,null,941907931527040,141,[[18,46,null,0,false,false,false,224404386869161,null,[[10,0],[8,0],[7,[22]]]]],[],[[0,0,false,null,449080043687285,142,[[-1,32,null,0,false,false,false,627292131193268,null,[[11,754743954925292],[8,0],[7,[12]]]]],[[92,50,null,790859383867165,0,null,[[1,[23]],[3,1]]]]],[0,0,false,null,682971581331069,143,[[-1,54,null,0,false,false,false,212446356992358,null]],[[92,50,null,557034395421011,0,null,[[1,[69,[1,91,44,false],[1,92,44,false]]],[3,1]]]]]]],[0,0,false,null,715111120046051,144,[[18,46,null,0,false,false,false,453980725828478,null,[[10,0],[8,0],[7,[25]]]]],[],[[0,0,false,null,125963137365461,145,[[-1,32,null,0,false,false,false,179775994643178,null,[[11,754743954925292],[8,0],[7,[12]]]]],[[92,50,null,595936592660158,0,null,[[1,[23]],[3,1]]]]],[0,0,false,null,808017726494215,146,[[-1,54,null,0,false,false,false,738256486557504,null]],[[92,50,null,554375657496069,0,null,[[1,[70,[1,91,44,false],[1,92,44,false]]],[3,1]]]]]]],[0,0,false,null,510439607565800,147,[[0,55,null,0,false,false,false,732840156531744,null,[[9,37]]],[-1,32,null,0,false,false,false,671827079094798,null,[[11,159870632320207],[8,0],[7,[12]]]]],[],[[0,0,false,null,111074576065581,148,[[18,46,null,0,false,true,false,686507448508991,null,[[10,0],[8,0],[7,[27]]]],[18,46,null,0,false,true,false,425490932543569,null,[[10,0],[8,0],[7,[28]]]],[18,46,null,0,false,true,false,441926042522476,null,[[10,0],[8,0],[7,[29]]]]],[],[[0,0,false,null,872693658922373,149,[[92,56,null,0,false,true,false,567219487116322,null]],[],[[0,0,true,null,196023242606137,150,[[91,57,null,0,false,false,false,752498163543494,null,[[1,[27]]]],[91,57,null,0,false,false,false,233732338115039,null,[[1,[28]]]],[91,57,null,0,false,false,false,910836724095043,null,[[1,[30]]]],[91,57,null,0,false,false,false,809060338526147,null,[[1,[31]]]],[91,57,null,0,false,false,false,411642830747023,null,[[1,[32]]]],[91,57,null,0,false,false,false,436529546185990,null,[[1,[33]]]],[91,57,null,0,false,false,false,568673319312433,null,[[1,[34]]]],[91,57,null,0,false,false,false,269040099318995,null,[[1,[35]]]]],[],[[0,0,false,null,799842156947416,151,[[-1,58,null,0,false,false,false,542410903728616,null,[[7,[36,[1,17,44,false]]],[8,5],[7,[16,[1,18,44,false]]]]],[-1,37,null,0,false,false,false,290922025851767,null]],[[18,47,null,237219165978607,0,null,[[10,0],[7,[37]]]],[92,50,null,292792614008217,0,null,[[1,[37]],[3,1]]],[18,59,"Platform",740895142402626,0,null,[[0,[12]]]]]]]],[0,0,true,null,689992995786425,152,[[91,60,null,1,false,false,false,932335491282902,null,[[1,[28]]]],[91,60,null,1,false,false,false,782271293543437,null,[[1,[27]]]]],[[-1,34,null,683299118041987,2,null,[[0,[38]]]],[18,47,null,436694037349043,0,null,[[10,0],[7,[22]]]]]],[0,0,false,null,530137680074521,153,[[92,61,null,0,false,false,false,461465593298524,null,[[4,91]]],[92,57,null,0,false,true,false,445769563469893,null,[[1,[37]]]]],[[18,62,"Platform",597680249856685,0,null,[[3,0]]],[18,47,null,510805453145216,0,null,[[10,0],[7,[22]]]]]],[0,0,false,null,871890115329089,154,[[92,61,null,0,false,true,false,242653216796158,null,[[4,91]]],[92,57,null,0,false,true,false,161228364682035,null,[[1,[37]]]]],[[18,62,"Platform",118890592628804,0,null,[[3,0]]],[18,47,null,517017714088593,0,null,[[10,0],[7,[22]]]]]]]],[0,0,false,null,681171612116170,155,[[92,56,null,0,false,false,false,490930871164840,null],[92,57,null,0,false,true,false,889380456409789,null,[[1,[37]]]]],[[18,62,"Platform",860575187518936,0,null,[[3,0]]],[18,47,null,860766564226903,0,null,[[10,0],[7,[22]]]]]]]]]],[0,0,false,null,791609825159492,156,[[0,55,null,0,false,false,false,293255205733346,null,[[9,39]]],[-1,32,null,0,false,false,false,403217875584257,null,[[11,159870632320207],[8,0],[7,[12]]]]],[],[[0,0,false,null,663366785675644,157,[[18,46,null,0,false,true,false,907008894751036,null,[[10,0],[8,0],[7,[27]]]],[18,46,null,0,false,true,false,249742824820854,null,[[10,0],[8,0],[7,[28]]]],[18,46,null,0,false,true,false,145873471026218,null,[[10,0],[8,0],[7,[29]]]]],[],[[0,0,false,null,321748930323641,158,[[92,56,null,0,false,true,false,345736361977796,null],[92,57,null,0,false,true,false,482059207979590,null,[[1,[37]]]]],[[18,62,"Platform",428817475755359,0,null,[[3,1]]],[18,47,null,718497140808799,0,null,[[10,0],[7,[25]]]]]],[0,0,false,null,762352923763568,159,[[92,56,null,0,false,false,false,252888963225745,null]],[],[[0,0,true,null,491081160652485,160,[[91,57,null,0,false,false,false,451261467085857,null,[[1,[27]]]],[91,57,null,0,false,false,false,701248667770374,null,[[1,[28]]]],[91,57,null,0,false,false,false,991663473661498,null,[[1,[30]]]],[91,57,null,0,false,false,false,373736616311275,null,[[1,[31]]]],[91,57,null,0,false,false,false,532029518071779,null,[[1,[32]]]],[91,57,null,0,false,false,false,130690271581008,null,[[1,[33]]]],[91,57,null,0,false,false,false,755219733019148,null,[[1,[34]]]],[91,57,null,0,false,false,false,686569047651889,null,[[1,[35]]]]],[],[[0,0,false,null,845142205023978,161,[[-1,58,null,0,false,false,false,301513222518469,null,[[7,[36,[1,17,44,false]]],[8,5],[7,[16,[1,18,44,false]]]]],[-1,37,null,0,false,false,false,803040000064195,null]],[[18,47,null,168128188658227,0,null,[[10,0],[7,[37]]]],[92,50,null,905477870459847,0,null,[[1,[37]],[3,1]]],[18,59,"Platform",363240884490079,0,null,[[0,[12]]]]]]]],[0,0,true,null,826160666589469,162,[[91,60,null,1,false,false,false,877129528461009,null,[[1,[28]]]],[91,60,null,1,false,false,false,215204835816774,null,[[1,[27]]]]],[[-1,34,null,546217313052647,2,null,[[0,[38]]]],[18,47,null,301756996072031,0,null,[[10,0],[7,[25]]]]]],[0,0,false,null,600485781585590,163,[[92,61,null,0,false,false,false,875061750387287,null,[[4,91]]],[92,57,null,0,false,true,false,540245402935064,null,[[1,[37]]]]],[[18,62,"Platform",505537197654035,0,null,[[3,1]]],[18,47,null,483970989671455,0,null,[[10,0],[7,[25]]]]]],[0,0,false,null,255678110996774,164,[[92,61,null,0,false,true,false,553901343660679,null,[[4,91]]],[92,57,null,0,false,true,false,903630567623963,null,[[1,[37]]]]],[[18,62,"Platform",950231630582947,0,null,[[3,1]]],[18,47,null,220314061215698,0,null,[[10,0],[7,[25]]]]]]]]]]]],[0,0,false,null,823844987874669,165,[[0,55,null,0,false,false,false,733357094304964,null,[[9,38]]],[-1,32,null,0,false,false,false,359712383985522,null,[[11,159870632320207],[8,0],[7,[12]]]]],[],[[0,0,false,null,436421573746870,166,[[18,46,null,0,false,true,false,132013330884381,null,[[10,0],[8,0],[7,[27]]]],[18,46,null,0,false,true,false,149392932549477,null,[[10,0],[8,0],[7,[34]]]],[18,46,null,0,false,true,false,312781155511481,null,[[10,0],[8,0],[7,[71]]]],[18,46,null,0,false,true,false,107978718513872,null,[[10,0],[8,0],[7,[28]]]],[92,57,null,0,false,true,false,957460696589189,null,[[1,[34]]]],[92,57,null,0,false,true,false,469992602321809,null,[[1,[35]]]],[92,57,null,0,false,true,false,490101464448251,null,[[1,[37]]]]],[[18,62,"Platform",480685976746148,0,null,[[3,2]]]],[[0,0,false,null,512093282247102,167,[[18,46,null,0,false,false,false,457518190155253,null,[[10,0],[8,0],[7,[22]]]]],[[18,47,null,353796632773242,0,null,[[10,0],[7,[41]]]]]],[0,0,false,null,475250513094681,168,[[18,46,null,0,false,false,false,901320975899980,null,[[10,0],[8,0],[7,[25]]]]],[[18,47,null,433328380544168,0,null,[[10,0],[7,[42]]]]]]]]]],[0,0,false,null,528355117634912,169,[[0,65,null,1,false,false,false,847607615123001,null,[[9,75]]],[-1,32,null,0,false,false,false,487783689702231,null,[[11,159870632320207],[8,0],[7,[12]]]]],[],[[0,0,false,null,776086254297101,170,[[92,57,null,0,false,true,false,525616637650111,null,[[1,[27]]]],[92,57,null,0,false,true,false,708833569480850,null,[[1,[28]]]],[92,57,null,0,false,true,false,577264760968562,null,[[1,[34]]]],[92,57,null,0,false,true,false,385614066545483,null,[[1,[35]]]],[92,57,null,0,false,true,false,387955477783579,null,[[1,[37]]]]],[],[[0,0,false,null,130713368177035,171,[[18,46,null,0,false,true,false,181183824884689,null,[[10,0],[8,0],[7,[29]]]]],[[18,47,null,115740679553493,0,null,[[10,0],[7,[27]]]],[18,59,"Platform",750188351774490,0,null,[[0,[12]]]],[92,50,null,861461193640486,0,null,[[1,[27]],[3,1]]]]],[0,0,false,null,893096879785164,172,[[18,46,null,0,false,false,false,366839317381013,null,[[10,0],[8,0],[7,[29]]]]],[[92,50,null,337367074602189,0,null,[[1,[34]],[3,1]]]]]]]]],[0,0,false,null,567733814217727,173,[[0,65,null,1,false,false,false,491506311928204,null,[[9,76]]],[-1,32,null,0,false,false,false,162347148038583,null,[[11,159870632320207],[8,0],[7,[12]]]]],[],[[0,0,false,null,841391204082949,174,[[92,57,null,0,false,true,false,227277341704208,null,[[1,[27]]]],[92,57,null,0,false,true,false,272007086283462,null,[[1,[28]]]],[92,57,null,0,false,true,false,444958305931028,null,[[1,[34]]]],[92,57,null,0,false,true,false,407299450968019,null,[[1,[35]]]],[92,57,null,0,false,true,false,346789705558105,null,[[1,[35]]]]],[],[[0,0,false,null,298484929334023,175,[[18,46,null,0,false,true,false,877141273120255,null,[[10,0],[8,0],[7,[29]]]]],[[18,47,null,890142715216732,0,null,[[10,0],[7,[28]]]],[18,59,"Platform",494461411965672,0,null,[[0,[12]]]],[92,50,null,954962253990595,0,null,[[1,[28]],[3,1]]]]],[0,0,false,null,256847565873387,176,[[18,46,null,0,false,false,false,851917955158032,null,[[10,0],[8,0],[7,[29]]]]],[[92,50,null,752870159282250,0,null,[[1,[35]],[3,1]]]]]]]]],[0,0,false,null,109660480894815,177,[[18,46,null,0,false,true,false,893481778854130,null,[[10,0],[8,0],[7,[27]]]],[18,46,null,0,false,true,false,165815863943905,null,[[10,0],[8,0],[7,[28]]]]],[],[[0,0,false,null,647274342413843,178,[[-1,32,null,0,false,false,false,345426503988994,null,[[11,159870632320207],[8,0],[7,[12]]]]],[],[[0,0,false,null,774606490753127,179,[[0,55,null,0,false,true,false,541672733826947,null,[[9,37]]],[0,55,null,0,false,true,false,791110360983241,null,[[9,39]]],[0,55,null,0,false,true,false,658321515138815,null,[[9,40]]],[92,57,null,0,false,true,false,971009461027266,null,[[1,[34]]]],[92,57,null,0,false,true,false,198890079070380,null,[[1,[35]]]]],[[18,47,null,375340095402776,0,null,[[10,0],[7,[21]]]]]]]],[0,0,false,null,537859857540584,180,[[-1,32,null,0,false,false,false,265021709476985,null,[[11,159870632320207],[8,0],[7,[1]]]]],[],[[0,0,false,null,784328236807485,181,[[92,57,null,0,false,true,false,972083181404550,null,[[1,[34]]]],[92,57,null,0,false,true,false,584279902337010,null,[[1,[35]]]],[18,53,null,0,false,true,false,447621181651808,null,[[10,7]]],[18,53,null,0,false,true,false,744440260026432,null,[[10,6]]],[18,53,null,0,false,true,false,604857599732776,null,[[10,8]]],[18,53,null,0,false,true,false,899895142308983,null,[[10,10]]]],[[18,47,null,369535450811130,0,null,[[10,0],[7,[21]]]]]]]]]],[0,0,false,null,168697408965384,182,[[0,55,null,0,false,false,false,264069982735505,null,[[9,40]]],[-1,32,null,0,false,false,false,786804794823273,null,[[11,754743954925292],[8,0],[7,[1]]]]],[],[[0,0,false,null,346174664138828,183,[[18,46,null,0,false,true,false,260609256957120,null,[[10,0],[8,0],[7,[27]]]],[18,46,null,0,false,true,false,543732563463912,null,[[10,0],[8,0],[7,[28]]]],[18,53,null,0,false,true,false,331985769112898,null,[[10,4]]],[-1,37,null,0,false,false,false,253481531365657,null]],[[18,59,"Platform",735921710185327,0,null,[[0,[12]]]],[18,47,null,750943793166027,0,null,[[10,0],[7,[29]]]],[92,50,null,544969898771086,0,null,[[1,[29]],[3,1]]]]]]],[0,0,false,null,843834630566217,184,[[92,60,null,1,false,false,false,471584248260839,null,[[1,[34]]]],[-1,32,null,0,false,false,false,686699848419346,null,[[11,754743954925292],[8,0],[7,[1]]]]],[],[[0,0,false,null,786584209490615,185,[[0,55,null,0,false,false,false,530207742325139,null,[[9,40]]]],[[92,50,null,907067970398961,0,null,[[1,[29]],[3,1]]],[92,66,null,164311899050846,0,null,[[0,[1]]]]]],[0,0,false,null,552281339293380,186,[[0,55,null,0,false,true,false,642380063086602,null,[[9,40]]]],[[18,47,null,182792588025698,0,null,[[10,0],[7,[21]]]]]]]],[0,0,false,null,294463722232187,187,[[92,60,null,1,false,false,false,975907447897631,null,[[1,[35]]]],[-1,32,null,0,false,false,false,408592031703258,null,[[11,754743954925292],[8,0],[7,[1]]]]],[],[[0,0,false,null,858350797442518,188,[[0,55,null,0,false,false,false,561207649952878,null,[[9,40]]]],[[92,50,null,206362896674685,0,null,[[1,[29]],[3,1]]],[92,66,null,419532732933102,0,null,[[0,[1]]]]]],[0,0,false,null,527317495227637,189,[[0,55,null,0,false,true,false,760096020832840,null,[[9,40]]]],[[18,47,null,626966355583830,0,null,[[10,0],[7,[21]]]]]]]]]],[0,0,false,null,922580903154724,190,[[18,53,null,0,false,false,false,465625798789116,null,[[10,1]]]],[],[[0,0,false,null,463078637953798,191,[[92,56,null,0,false,false,false,359648844435040,null]],[],[[0,0,false,null,517536347165764,192,[[18,67,null,0,false,false,false,961061202369469,null,[[8,3],[0,[3,[3,548949025892520]]]]]],[[18,62,"Platform",290684982572349,0,null,[[3,1]]]]],[0,0,false,null,433509639113031,193,[[-1,54,null,0,false,false,false,474810225187908,null]],[[17,62,"Platform",869967063005300,0,null,[[3,0]]]]]]],[0,0,false,null,479203043577771,194,[[-1,54,null,0,false,false,false,575375936407701,null]],[],[[0,0,false,null,568367094155470,195,[[18,67,null,0,false,false,false,585243363077148,null,[[8,5],[0,[3,[3,962875178820567]]]]]],[[18,62,"Platform",502947339025297,0,null,[[3,0]]]]],[0,0,false,null,342979048059009,196,[[-1,54,null,0,false,false,false,662303406431579,null]],[[17,62,"Platform",753652773668814,0,null,[[3,1]]]]]]],[0,0,false,null,689403257538782,197,[[-1,37,null,0,false,false,false,848011306323046,null]],[],[[0,0,false,null,873100148956979,198,[[18,46,null,0,false,false,false,781648078372240,null,[[10,2],[8,4],[7,[12]]]]],[[18,47,null,790256625720014,0,null,[[10,0],[7,[43]]]],[18,69,null,198804629846564,0,null,[[10,2],[7,[44]]]],[92,50,null,452560349560660,0,null,[[1,[45]],[3,1]]],[9,68,null,418188402486777,0,null],[2,25,null,625623898759533,0,null,[[1,[5]],[13]]]]],[0,0,false,null,187691033771036,199,[[-1,54,null,0,false,false,false,216527941774019,null]],[[92,50,null,767277071311439,0,null,[[1,[46]],[3,1]]]]]]]]],[0,0,false,null,750998436091979,200,[[18,53,null,0,false,false,false,683532257596780,null,[[10,5]]],[-1,37,null,0,false,false,false,628169412797040,null]],[[1,71,null,139741325924736,0,null,[[2,["equip-unlock",false]],[3,0],[0,[12]],[1,[47]]]],[-1,70,null,970081782782146,0,null,[[11,781872158660275],[7,[1]]]],[-1,70,null,530229583424928,0,null,[[11,361400748529732],[7,[1]]]],[2,25,null,175047149138241,0,null,[[1,[5]],[13]]],[-1,27,null,877184401848148,0,null,[[0,[48]]]],[-1,34,null,164492647306778,2,null,[[0,[1]]]],[-1,27,null,484781175292393,0,null,[[0,[1]]]],[18,47,null,801414701150257,0,null,[[10,0],[7,[49]]]],[92,50,null,574222233100205,0,null,[[1,[53]],[3,1]]],[1,71,null,184835022878259,0,null,[[2,["new-best-score",false]],[3,0],[0,[12]],[1,[47]]]],[80,72,"Tween",355823598889600,1,null,[[1,[47]],[3,1],[0,[50]],[0,[51]],[0,[52]],[18,0],[3,0],[3,0],[3,0]]],[-1,34,null,226403758361425,2,null,[[0,[13]]]],[2,25,null,870717094074026,0,null,[[1,[54]],[13]]]]]]],[0,0,false,null,482239621250795,201,[[18,51,"Platform",0,false,true,false,181783717344366,null],[-1,32,null,0,false,false,false,668425257480702,null,[[11,863177864399805],[8,0],[7,[12]]]]],[[18,52,"Platform",651123677820313,0,null,[[0,[55,[2,18,false,2]]]]]],[[0,0,false,null,464950494089088,202,[[18,53,null,0,false,true,false,961342271416356,null,[[10,1]]],[18,53,null,0,false,true,false,150910272737917,null,[[10,5]]],[18,46,null,0,false,false,false,936335714782972,null,[[10,2],[8,4],[7,[12]]]]],[],[[0,0,false,null,343221124158741,203,[[18,46,null,0,false,false,false,332475017559064,null,[[10,0],[8,0],[7,[21]]]]],[[18,47,null,822896103285123,0,null,[[10,0],[7,[56]]]],[92,50,null,967435817163622,0,null,[[1,[56]],[3,1]]]]],[0,0,false,null,635114467548521,204,[[18,46,null,0,false,false,false,548330456761959,null,[[10,0],[8,0],[7,[41]]]]],[[18,62,"Platform",834665036101887,0,null,[[3,0]]]],[[0,0,false,null,765841553508955,205,[[-1,37,null,0,false,false,false,645104513370549,null]],[[92,50,null,951318831630080,0,null,[[1,[56]],[3,1]]]]]]],[0,0,false,null,303263939118202,206,[[18,46,null,0,false,false,false,613002724398637,null,[[10,0],[8,0],[7,[57]]]]],[[18,62,"Platform",713936803101032,0,null,[[3,0]]]]],[0,0,false,null,129702900984731,207,[[18,46,null,0,false,false,false,159401126099975,null,[[10,0],[8,0],[7,[42]]]]],[[18,62,"Platform",387171311997227,0,null,[[3,1]]]],[[0,0,false,null,500316119467054,208,[[-1,37,null,0,false,false,false,329406360052458,null]],[[92,50,null,164118285954650,0,null,[[1,[56]],[3,1]]]]]]],[0,0,false,null,527729293814221,209,[[18,46,null,0,false,false,false,552049399298484,null,[[10,0],[8,0],[7,[58]]]]],[[18,62,"Platform",881955272578168,0,null,[[3,1]]]]],[0,0,false,null,231227776249647,210,[[0,65,null,1,false,false,false,802619607007137,null,[[9,75]]],[-1,32,null,0,false,false,false,997559554604981,null,[[11,754743954925292],[8,0],[7,[1]]]]],[],[[0,0,false,null,650977392524268,211,[[18,46,null,0,false,false,false,682075894499919,null,[[10,0],[8,0],[7,[41]]]]],[[18,47,null,508555311494747,0,null,[[10,0],[7,[57]]]],[92,50,null,995153430632810,0,null,[[1,[31]],[3,1]]]]],[0,0,false,null,849983033760362,212,[[18,46,null,0,false,false,false,605085842059663,null,[[10,0],[8,0],[7,[42]]]]],[[18,47,null,882847439854131,0,null,[[10,0],[7,[58]]]],[92,50,null,286758820255140,0,null,[[1,[31]],[3,1]]]]],[0,0,false,null,623924894585498,213,[[18,46,null,0,false,false,false,499879223875980,null,[[10,0],[8,0],[7,[56]]]]],[[18,47,null,176361682953202,0,null,[[10,0],[7,[59]]]],[92,50,null,647678898734436,0,null,[[1,[30]],[3,1]]]]]]],[0,0,false,null,726703724176641,214,[[0,65,null,1,false,false,false,627127134322601,null,[[9,76]]],[-1,32,null,0,false,false,false,787689158431568,null,[[11,754743954925292],[8,0],[7,[1]]]]],[],[[0,0,false,null,207462184253004,215,[[18,46,null,0,false,false,false,108987112624857,null,[[10,0],[8,0],[7,[41]]]]],[[18,47,null,310658270083977,0,null,[[10,0],[7,[57]]]],[92,50,null,247623654748529,0,null,[[1,[32]],[3,1]]]]],[0,0,false,null,516676764481985,216,[[18,46,null,0,false,false,false,791716112295729,null,[[10,0],[8,0],[7,[42]]]]],[[18,47,null,334134012097390,0,null,[[10,0],[7,[58]]]],[92,50,null,490982259382284,0,null,[[1,[32]],[3,1]]]]],[0,0,false,null,352126071543185,217,[[18,46,null,0,false,false,false,757566428574446,null,[[10,0],[8,0],[7,[56]]]]],[[18,47,null,258125911932589,0,null,[[10,0],[7,[60]]]],[92,50,null,429825184623070,0,null,[[1,[33]],[3,1]]]]]]]]],[0,0,false,null,436963168886863,218,[[18,53,null,0,false,false,false,385603687617986,null,[[10,1]]]],[],[[0,0,false,null,832543809191049,219,[[92,56,null,0,false,false,false,193451807320272,null]],[],[[0,0,false,null,457501245407197,220,[[18,67,null,0,false,false,false,136102962065173,null,[[8,3],[0,[3,[3,548949025892520]]]]]],[[18,62,"Platform",681509666152033,0,null,[[3,1]]]]],[0,0,false,null,956406156969761,221,[[-1,54,null,0,false,false,false,133439411250601,null]],[[17,62,"Platform",149456039976086,0,null,[[3,0]]]]]]],[0,0,false,null,993562489376157,222,[[-1,54,null,0,false,false,false,602993100751801,null]],[],[[0,0,false,null,136291583345838,223,[[18,67,null,0,false,false,false,698129626477716,null,[[8,5],[0,[3,[3,962875178820567]]]]]],[[18,62,"Platform",532249911011022,0,null,[[3,0]]]]],[0,0,false,null,702625089619846,224,[[-1,54,null,0,false,false,false,560340861368408,null]],[[17,62,"Platform",281821031594026,0,null,[[3,1]]]]]]],[0,0,false,null,997577155642522,225,[[-1,37,null,0,false,false,false,252828818199300,null]],[[2,25,null,398723378930276,0,null,[[1,[5]],[13]]],[18,73,"Platform",430680011506272,0,null,[[0,[61]]]],[92,50,null,636776960810929,0,null,[[1,[45]],[3,1]]],[18,69,null,207301738058672,0,null,[[10,2],[7,[44]]]],[18,47,null,734494506107291,0,null,[[10,0],[7,[43]]]],[9,68,null,434728411373494,0,null]]]]]]],[0,0,false,null,697678873062029,226,[[92,60,null,1,false,false,false,412110191127633,null,[[1,[27]]]]],[[-1,34,null,181670180947235,2,null,[[0,[62]]]],[18,47,null,298317170191536,0,null,[[10,0],[7,[21]]]]],[[0,0,false,null,952392619806083,227,[[18,53,null,0,false,false,false,757877628095412,null,[[10,9]]]],[[18,74,null,310896927588289,0,null,[[10,9],[3,0]]],[-1,34,null,167230730649474,2,null,[[0,[72,[4,77]]]]],[2,25,null,735420271314401,0,null,[[1,[73]],[13,[7,[74,[4,77]]]]]]]]]],[0,0,false,null,975788106187238,228,[[92,60,null,1,false,false,false,538592278758517,null,[[1,[28]]]]],[[-1,34,null,841298965156031,2,null,[[0,[62]]]],[18,47,null,215800723238326,0,null,[[10,0],[7,[21]]]]],[[0,0,false,null,585520218726617,229,[[18,53,null,0,false,false,false,356816165199522,null,[[10,10]]]],[[18,74,null,734543536831417,0,null,[[10,10],[3,0]]],[-1,34,null,419668026444994,2,null,[[0,[72,[4,77]]]]],[2,25,null,839563719659914,0,null,[[1,[73]],[13,[7,[74,[4,77]]]]]]]]]],[0,0,true,null,954407912424509,230,[[92,60,null,1,false,false,false,673416145474885,null,[[1,[63]]]]],[[-1,34,null,628980440574619,2,null,[[0,[64]]]],[18,74,null,876801879402527,0,null,[[10,1],[3,0]]]]],[0,0,true,null,764482802946937,231,[[92,60,null,1,false,false,false,921416305846989,null,[[1,[45]]]],[92,60,null,1,false,false,false,851517463105724,null,[[1,[40]]]]],[[18,74,null,996108355647470,0,null,[[10,1],[3,0]]]]],[0,0,false,null,201022969855497,232,[[18,46,null,0,false,false,false,470860206068796,null,[[10,2],[8,3],[7,[12]]]],[-1,37,null,0,false,false,false,154104058402686,null]],[[17,74,null,568158947871933,0,null,[[10,5],[3,1]]],[-1,34,null,969625579086069,2,null,[[0,[52]]]],[18,47,null,193160121271479,0,null,[[10,0],[7,[46]]]],[18,74,null,645422502608141,0,null,[[10,1],[3,0]]]],[[0,0,false,null,324034298468023,233,[[18,46,null,0,false,false,false,349381824995934,null,[[10,0],[8,0],[7,[46]]]]],[[92,50,null,733827778159964,0,null,[[1,[46]],[3,1]]]]]]],[0,0,true,null,537554840403318,234,[[92,57,null,0,false,false,false,157932804615125,null,[[1,[27]]]],[92,57,null,0,false,false,false,142113443302891,null,[[1,[28]]]],[92,57,null,0,false,false,false,970220467935727,null,[[1,[32]]]],[92,57,null,0,false,false,false,972194954437726,null,[[1,[33]]]],[92,57,null,0,false,false,false,169550118257353,null,[[1,[31]]]],[92,57,null,0,false,false,false,234212440878132,null,[[1,[35]]]],[92,57,null,0,false,false,false,965386954844561,null,[[1,[34]]]],[92,57,null,0,false,false,false,127319326954852,null,[[1,[49]]]]],[[92,75,null,738427045818097,0,null]]],[0,0,true,null,401191974725146,235,[[92,60,null,1,false,false,false,768625799319861,null,[[1,[27]]]],[92,60,null,1,false,false,false,611694607035131,null,[[1,[34]]]],[92,60,null,1,false,false,false,340259651050025,null,[[1,[31]]]],[92,60,null,1,false,false,false,466785585701383,null,[[1,[30]]]]],[],[[0,0,false,null,372543723342992,236,[[92,61,null,0,false,false,false,855443894215373,null,[[4,17]]]],[]],[0,0,false,null,517244543922976,237,[[92,61,null,0,false,false,false,181185010538752,null,[[4,17]]],[-1,37,null,0,false,false,false,692196775720492,null]],[[1,78,null,896708366873035,0,null,[[3,0],[1,[75,[4,77]]],[3,0],[0,[12]],[1,[47]]]]]]]],[0,0,true,null,159753828760029,238,[[92,60,null,1,false,false,false,656540081873665,null,[[1,[28]]]],[92,60,null,1,false,false,false,673062011302082,null,[[1,[35]]]],[92,60,null,1,false,false,false,324998689214864,null,[[1,[33]]]],[92,60,null,1,false,false,false,896267622199062,null,[[1,[32]]]]],[],[[0,0,false,null,735746606068268,240,[[92,61,null,0,false,false,false,283726894844627,null,[[4,17]]],[-1,37,null,0,false,false,false,694143780363107,null]],[[1,78,null,333810567896884,0,null,[[3,0],[1,[75,[4,77]]],[3,0],[0,[12]],[1,[47]]]]]]]],[0,0,false,null,529603641529904,241,[[18,76,"Platform",1,false,false,false,409907643859182,null],[18,53,null,0,false,false,false,373982442442095,null,[[10,1]]]],[[18,74,null,246069473543143,0,null,[[10,1],[3,0]]]]]]],[3,[true,"ColisoresP1"],false,null,247565680357825,242,[[-1,40,null,0,false,false,false,0,false,[[1,[76]]]]],[],[[0,0,false,null,993056076522510,243,[[2,79,null,2,false,false,false,308273001725306,null,[[1,[77]]]]],[[91,80,null,112164501337641,0,null,[[4,8],[5,[78]],[7,[1]],[16,false]]],[91,80,null,678017682528795,0,null,[[4,10],[5,[78]],[7,[1]],[16,false]]]],[[0,0,false,null,679487421717783,244,[[91,56,null,0,false,false,false,903313579958870,null]],[[8,81,null,550617992152650,0,null,[[3,0]]],[10,81,null,204550412964406,0,null,[[3,0]]]]],[0,0,false,null,155078210033441,245,[],[[8,49,null,907345202627315,0,null,[[0,[79,[1,8,82,false]]]]],[8,83,null,842313875818619,0,null,[[0,[80,[1,8,84,false]]]]],[8,85,"Pin",323590580209581,0,null,[[4,91],[3,0]]],[10,49,null,441239149247539,0,null,[[0,[81,[1,10,82,false]]]]],[10,83,null,766644304558643,0,null,[[0,[81,[1,10,84,false]]]]],[10,85,"Pin",232850788194011,0,null,[[4,91],[3,0]]]]]]],[0,0,false,null,724184961798299,246,[[17,76,"Platform",1,false,false,false,708053495996151,null]],[[10,68,null,460196529515070,0,null],[8,68,null,326594430068247,0,null]]],[0,0,false,null,388091089259409,247,[[91,57,null,0,false,false,false,256246352348729,null,[[1,[27]]]],[91,86,null,0,false,false,false,170933365196867,null,[[8,0],[0,[1]]]],[-1,37,null,0,false,false,false,127066458809817,null]],[[2,25,null,512429246739486,0,null,[[1,[77]],[13]]]]],[0,0,false,null,631112431938309,248,[[91,57,null,0,false,false,false,495260274005762,null,[[1,[28]]]],[91,86,null,0,false,false,false,374927866708394,null,[[8,0],[0,[1]]]],[-1,37,null,0,false,false,false,968103527589119,null]],[[2,25,null,754900677385187,0,null,[[1,[77]],[13]]]]],[0,0,false,null,630854330348775,249,[[91,57,null,0,false,false,false,950727565075224,null,[[1,[30]]]],[91,86,null,0,false,false,false,467821001496304,null,[[8,0],[0,[1]]]],[-1,37,null,0,false,false,false,691082141778931,null]],[[2,25,null,336718598760959,0,null,[[1,[77]],[13]]]]],[0,0,false,null,265383030660704,250,[[91,57,null,0,false,false,false,398808406136724,null,[[1,[31]]]],[91,86,null,0,false,false,false,805610351482673,null,[[8,0],[0,[13]]]],[-1,37,null,0,false,false,false,531989955893428,null]],[[2,25,null,423213825277138,0,null,[[1,[77]],[13]]]]],[0,0,false,null,563774105852009,251,[[91,57,null,0,false,false,false,763318378882930,null,[[1,[33]]]],[91,86,null,0,false,false,false,326531645890560,null,[[8,0],[0,[1]]]],[-1,37,null,0,false,false,false,975415675666493,null]],[[2,25,null,382000764451154,0,null,[[1,[77]],[13]]]]],[0,0,false,null,647645781278222,252,[[91,57,null,0,false,false,false,538620279810148,null,[[1,[32]]]],[91,86,null,0,false,false,false,992984829333447,null,[[8,0],[0,[13]]]],[-1,37,null,0,false,false,false,179052633824856,null]],[[2,25,null,268867763272441,0,null,[[1,[77]],[13]]]]],[0,0,false,null,582532405077592,253,[[91,57,null,0,false,false,false,836679716427605,null,[[1,[34]]]],[91,86,null,0,false,false,false,370032646119634,null,[[8,0],[0,[13]]]],[-1,37,null,0,false,false,false,856891971110687,null]],[[2,25,null,328070149034536,0,null,[[1,[77]],[13]]]]],[0,0,false,null,448668048699769,254,[[91,57,null,0,false,false,false,427396925423157,null,[[1,[35]]]],[91,86,null,0,false,false,false,652669074402160,null,[[8,0],[0,[1]]]],[-1,37,null,0,false,false,false,592233135848229,null]],[[2,25,null,446748016488235,0,null,[[1,[77]],[13]]]]],[0,0,true,null,667745132299375,255,[[91,60,null,1,false,false,false,331231091295850,null,[[1,[27]]]],[91,60,null,1,false,false,false,447451624810927,null,[[1,[28]]]],[91,60,null,1,false,false,false,157100157781696,null,[[1,[34]]]],[91,60,null,1,false,false,false,675201869949102,null,[[1,[35]]]]],[[8,68,null,374478975400981,0,null],[-1,34,null,178113563335361,2,null,[[0,[62]]]],[10,68,null,538454479656241,0,null]]],[0,0,false,null,773498809434770,259,[[8,87,null,0,false,false,true,947870614543686,null,[[4,11]]]],[[11,68,null,636366271206121,0,null],[1,78,null,167595665578357,0,null,[[3,0],[1,[75,[4,77]]],[3,0],[0,[12]],[1,[47]]]],[18,74,null,848587674129486,0,null,[[10,1],[3,1]]],[8,80,null,152919533015260,0,null,[[4,13],[5,[78]],[7,[12]],[16,false]]],[13,85,"Pin",498723966734900,0,null,[[4,92],[3,0]]]]],[0,0,false,null,923484768563990,260,[],[]],[0,0,false,null,786340715255039,263,[[8,87,null,0,false,false,true,628963625022754,null,[[4,18]]]],[],[[0,0,false,null,267561020153667,264,[[92,57,null,0,false,true,false,543712124795306,null,[[1,[37]]]]],[[1,78,null,167595665578357,0,null,[[3,0],[1,[75,[4,77]]],[3,0],[0,[12]],[1,[47]]]],[18,74,null,231691827082979,0,null,[[10,1],[3,1]]],[8,80,null,169896974311351,0,null,[[4,13],[5,[78]],[7,[12]],[16,false]]],[13,85,"Pin",254353623046292,0,null,[[4,92],[3,0]]]]],[0,0,false,null,105668151246963,265,[[92,57,null,0,false,false,false,767561941429601,null,[[1,[37]]]]],[[18,74,null,780389962029706,0,null,[[10,4],[3,1]]],[8,80,null,177624437753391,0,null,[[4,12],[5,[78]],[7,[12]],[16,false]]],[12,85,"Pin",325011400878770,0,null,[[4,92],[3,0]]],[-1,34,null,134881617800447,2,null,[[0,[52]]]],[18,47,null,735989521226622,0,null,[[10,0],[7,[21]]]],[18,74,null,157023860111004,0,null,[[10,4],[3,1]]]],[[0,0,false,null,415572217191679,266,[[-1,37,null,0,false,false,false,518932906243724,null]],[[1,78,null,167595665578357,0,null,[[3,0],[1,[75,[4,77]]],[3,0],[0,[12]],[1,[47]]]]]]]]]],[0,0,false,null,429082392714433,267,[[17,46,null,0,false,true,false,425223487677400,null,[[10,0],[8,0],[7,[37]]]]],[[17,74,null,738743001573081,0,null,[[10,4],[3,0]]]]],[0,0,false,null,163793921039255,268,[[17,53,null,0,false,false,false,565424097460613,null,[[10,4]]]],[],[[0,0,false,null,585964774632296,269,[[91,56,null,0,false,true,false,910793917540770,null]],[],[[0,0,false,null,177350741396246,270,[[17,67,null,0,false,false,false,353765166959265,null,[[8,5],[0,[3,[3,962875178820567]]]]]],[[17,62,"Platform",608553715912222,0,null,[[3,0]]]]],[0,0,false,null,460811675272843,271,[[-1,54,null,0,false,false,false,706458372586243,null]],[[18,62,"Platform",923712195733783,0,null,[[3,1]]]]]]],[0,0,false,null,242138232061904,272,[[-1,54,null,0,false,false,false,433648825375395,null]],[],[[0,0,false,null,237967919278941,273,[[17,67,null,0,false,false,false,322215733751922,null,[[8,3],[0,[3,[3,548949025892520]]]]]],[[17,62,"Platform",556982780625695,0,null,[[3,1]]]]],[0,0,false,null,270592937371188,274,[[-1,54,null,0,false,false,false,209107271165295,null]],[[18,62,"Platform",465837178005251,0,null,[[3,0]]]]]]]]],[0,0,false,null,324061767978574,275,[[18,46,null,0,false,true,false,616769102470177,null,[[10,0],[8,0],[7,[37]]]]],[[18,74,null,794750382579554,0,null,[[10,4],[3,0]]]]],[0,0,false,null,984722961018865,276,[[18,53,null,0,false,false,false,685821086199719,null,[[10,4]]]],[],[[0,0,false,null,348665505528456,278,[[92,56,null,0,false,true,false,755242295203858,null]],[],[[0,0,false,null,629308400483493,279,[[18,67,null,0,false,false,false,256053245983024,null,[[8,5],[0,[3,[3,962875178820567]]]]]],[[18,62,"Platform",894944557576153,0,null,[[3,0]]]]],[0,0,false,null,865746524643989,280,[[-1,54,null,0,false,false,false,449497704805364,null]],[[17,62,"Platform",770980823907347,0,null,[[3,1]]]]]]],[0,0,false,null,729423476523118,281,[[-1,54,null,0,false,false,false,223539830779216,null]],[],[[0,0,false,null,539235401393427,282,[[18,67,null,0,false,false,false,129106900241803,null,[[8,3],[0,[3,[3,548949025892520]]]]]],[[18,62,"Platform",802102695091032,0,null,[[3,1]]]]],[0,0,false,null,735380170968241,283,[[-1,54,null,0,false,false,false,265518637081245,null]],[[17,62,"Platform",804011450404355,0,null,[[3,0]]]]]]]]],[0,0,false,null,970953678069339,284,[[91,61,null,0,false,false,false,752624475196387,null,[[4,92]]]],[],[[0,0,false,null,309307191233942,285,[[17,51,"Platform",0,false,false,false,417854403331093,null],[18,51,"Platform",0,false,false,false,988035908480016,null]],[],[[0,0,true,null,511093009948450,286,[[91,57,null,0,false,false,false,468495100772976,null,[[1,[23]]]],[91,57,null,0,false,false,false,122162603101145,null,[[1,[82]]]],[92,57,null,0,false,false,false,492822604033216,null,[[1,[23]]]],[92,57,null,0,false,false,false,321932347692528,null,[[1,[82]]]]],[],[[0,0,false,null,932855844729372,287,[[91,56,null,0,false,true,false,540367146327117,null]],[[17,88,null,865508032496006,0,null,[[0,[83,[1,17,44,false],[4,89]]]]],[18,88,null,182888005171096,0,null,[[0,[84,[1,18,44,false],[4,89]]]]]]],[0,0,false,null,339003261438452,288,[[91,56,null,0,false,false,false,612208503165599,null]],[[17,88,null,704577362551084,0,null,[[0,[84,[1,17,44,false],[4,89]]]]],[18,88,null,415289535979192,0,null,[[0,[83,[1,18,44,false],[4,89]]]]]]],[0,0,false,null,820694263153045,289,[[92,56,null,0,false,false,false,242603593904565,null]],[[17,88,null,141179739562588,0,null,[[0,[83,[1,17,44,false],[4,89]]]]],[18,88,null,720904455443842,0,null,[[0,[84,[1,18,44,false],[4,89]]]]]]],[0,0,false,null,107704893642549,290,[[92,56,null,0,false,true,false,183252182231647,null]],[[17,88,null,962994511736736,0,null,[[0,[84,[1,17,44,false],[4,89]]]]],[18,88,null,818041970916727,0,null,[[0,[83,[1,18,44,false],[4,89]]]]]]]]],[0,0,false,null,328147749999511,291,[[91,57,null,0,false,false,false,990041251393160,null,[[1,[21]]]],[92,57,null,0,false,false,false,888601495283145,null,[[1,[21]]]]],[],[[0,0,false,null,364012661204228,292,[[91,56,null,0,false,true,false,541912184686067,null]],[[17,88,null,200992392608353,0,null,[[0,[83,[1,17,44,false],[4,89]]]]],[18,88,null,365217245547427,0,null,[[0,[84,[1,18,44,false],[4,89]]]]]]],[0,0,false,null,232106520584618,293,[[91,56,null,0,false,false,false,639403717581413,null]],[[17,88,null,434095478772473,0,null,[[0,[84,[1,17,44,false],[4,89]]]]],[18,88,null,771023661279838,0,null,[[0,[83,[1,18,44,false],[4,89]]]]]]],[0,0,false,null,141254088872424,294,[[92,56,null,0,false,false,false,225922810228075,null]],[[17,88,null,345159221632936,0,null,[[0,[83,[1,17,44,false],[4,89]]]]],[18,88,null,791423232364058,0,null,[[0,[84,[1,18,44,false],[4,89]]]]]]],[0,0,false,null,244010564888850,295,[[92,56,null,0,false,true,false,232425510448369,null]],[[17,88,null,118787581249433,0,null,[[0,[84,[1,17,44,false],[4,89]]]]],[18,88,null,585186844453930,0,null,[[0,[83,[1,18,44,false],[4,89]]]]]]]]]]],[0,0,false,null,881502928537990,296,[[17,51,"Platform",0,false,true,false,963360972059204,null],[18,51,"Platform",0,false,true,false,824963354595433,null]],[[17,59,"Platform",406880349333491,0,null,[[0,[12]]]],[18,59,"Platform",610695660010964,0,null,[[0,[12]]]]]]]]]],[3,[true,"ColisoresP2"],false,null,212271869374328,297,[[-1,40,null,0,false,false,false,0,false,[[1,[85]]]]],[],[[0,0,false,null,931602954991460,298,[[2,79,null,2,false,false,false,804284624147745,null,[[1,[86]]]]],[[92,80,null,208925484373749,0,null,[[4,9],[5,[78]],[7,[1]],[16,false]]],[92,80,null,954577676521422,0,null,[[4,11],[5,[78]],[7,[1]],[16,false]]]],[[0,0,false,null,738955488924517,299,[[92,56,null,0,false,false,false,186847117205377,null]],[[9,81,null,815016129632582,0,null,[[3,0]]],[11,81,null,867100119778968,0,null,[[3,0]]]]],[0,0,false,null,506275476977622,300,[],[[9,49,null,646959329329814,0,null,[[0,[79,[1,9,82,false]]]]],[9,83,null,144189272562241,0,null,[[0,[80,[1,9,84,false]]]]],[9,85,"Pin",379011873868473,0,null,[[4,92],[3,0]]],[11,49,null,323045323031880,0,null,[[0,[81,[1,11,82,false]]]]],[11,83,null,674765351364326,0,null,[[0,[81,[1,11,84,false]]]]],[11,85,"Pin",415805007278996,0,null,[[4,92],[3,0]]]]]]],[0,0,false,null,342553227761825,301,[[18,76,"Platform",1,false,false,false,202212937798567,null]],[[11,68,null,604776426152044,0,null],[9,68,null,822469799507502,0,null]]],[0,0,false,null,301299392208220,302,[[92,57,null,0,false,false,false,955714111976590,null,[[1,[27]]]],[92,86,null,0,false,false,false,724374824460587,null,[[8,0],[0,[1]]]],[-1,37,null,0,false,false,false,796011434835724,null]],[[2,25,null,757421958983826,0,null,[[1,[86]],[13]]]]],[0,0,false,null,755834357404953,303,[[92,57,null,0,false,false,false,928269231871982,null,[[1,[28]]]],[92,86,null,0,false,false,false,766717448513254,null,[[8,0],[0,[1]]]],[-1,37,null,0,false,false,false,899194143168398,null]],[[2,25,null,403290195442337,0,null,[[1,[86]],[13]]]]],[0,0,false,null,849637686963675,304,[[92,57,null,0,false,false,false,600532586509177,null,[[1,[30]]]],[92,86,null,0,false,false,false,171044246053373,null,[[8,0],[0,[1]]]],[-1,37,null,0,false,false,false,966756342274177,null]],[[2,25,null,729731645405011,0,null,[[1,[86]],[13]]]]],[0,0,false,null,896068688338259,305,[[92,57,null,0,false,false,false,515857027903917,null,[[1,[31]]]],[92,86,null,0,false,false,false,890301753688948,null,[[8,0],[0,[13]]]],[-1,37,null,0,false,false,false,925788118476479,null]],[[2,25,null,323205026163477,0,null,[[1,[86]],[13]]]]],[0,0,false,null,896816826964678,306,[[92,57,null,0,false,false,false,196680494683023,null,[[1,[33]]]],[92,86,null,0,false,false,false,949102546512468,null,[[8,0],[0,[1]]]],[-1,37,null,0,false,false,false,438206736339361,null]],[[2,25,null,413174657540963,0,null,[[1,[86]],[13]]]]],[0,0,false,null,596683588136114,307,[[92,57,null,0,false,false,false,118403553019859,null,[[1,[32]]]],[92,86,null,0,false,false,false,478659465388394,null,[[8,0],[0,[13]]]],[-1,37,null,0,false,false,false,420926358215548,null]],[[2,25,null,213120687101131,0,null,[[1,[86]],[13]]]]],[0,0,false,null,338696830400261,308,[[92,57,null,0,false,false,false,716009456740070,null,[[1,[34]]]],[92,86,null,0,false,false,false,965023400164279,null,[[8,0],[0,[13]]]],[-1,37,null,0,false,false,false,362000585706663,null]],[[2,25,null,373609430741018,0,null,[[1,[86]],[13]]]]],[0,0,false,null,332938295041818,309,[[92,57,null,0,false,false,false,617018610259269,null,[[1,[35]]]],[92,86,null,0,false,false,false,550795197730726,null,[[8,0],[0,[1]]]],[-1,37,null,0,false,false,false,277223027076694,null]],[[2,25,null,576393975814850,0,null,[[1,[86]],[13]]]]],[0,0,true,null,972486027629317,310,[[92,60,null,1,false,false,false,510022515565652,null,[[1,[27]]]],[92,60,null,1,false,false,false,386575881590638,null,[[1,[28]]]],[92,60,null,1,false,false,false,513728791411656,null,[[1,[34]]]],[92,60,null,1,false,false,false,681658239688859,null,[[1,[35]]]]],[[9,68,null,216979079121632,0,null],[-1,34,null,574648947794928,2,null,[[0,[62]]]],[11,68,null,116767274450331,0,null]]],[0,0,false,null,472218518117951,314,[[9,87,null,0,false,false,true,426885084043262,null,[[4,10]]]],[[10,68,null,571137217855748,0,null],[1,78,null,996526839426802,0,null,[[3,0],[1,[75,[4,77]]],[3,0],[0,[12]],[1,[47]]]],[17,74,null,251973979790040,0,null,[[10,1],[3,1]]],[9,80,null,691825289846730,0,null,[[4,13],[5,[78]],[7,[12]],[16,false]]],[13,85,"Pin",341075316989153,0,null,[[4,91],[3,0]]]]],[0,0,false,null,582669434115873,316,[[9,87,null,0,false,false,true,169247574977734,null,[[4,17]]]],[],[[0,0,false,null,802903933546944,317,[[91,57,null,0,false,true,false,384969656524086,null,[[1,[37]]]]],[[17,74,null,122690319283148,0,null,[[10,1],[3,1]]],[1,78,null,167595665578357,0,null,[[3,0],[1,[75,[4,77]]],[3,0],[0,[12]],[1,[47]]]],[9,80,null,766180278611595,0,null,[[4,13],[5,[78]],[7,[12]],[16,false]]],[13,85,"Pin",163462949148795,0,null,[[4,91],[3,0]]]]],[0,0,false,null,630127556554908,318,[[91,57,null,0,false,false,false,133706970521398,null,[[1,[37]]]]],[[17,74,null,694718469130908,0,null,[[10,4],[3,1]]],[9,80,null,774142103486209,0,null,[[4,12],[5,[78]],[7,[12]],[16,false]]],[12,85,"Pin",881638286050388,0,null,[[4,91],[3,0]]],[-1,34,null,220358583614734,2,null,[[0,[52]]]],[17,47,null,628044056384745,0,null,[[10,0],[7,[21]]]],[17,74,null,545360859491565,0,null,[[10,4],[3,0]]]]],[0,0,false,null,796711149212471,319,[[91,57,null,0,false,false,false,540221526787683,null,[[1,[37]]]],[-1,37,null,0,false,false,false,103820934375661,null]],[[1,78,null,365822563944554,0,null,[[3,0],[1,[75,[4,77]]],[3,0],[0,[12]],[1,[47]]]]]]]]]],[3,[true,"PosicaoCamera"],false,null,498707500711886,320,[[-1,40,null,0,false,false,false,0,false,[[1,[87]]]]],[],[[0,0,false,null,192773998713861,321,[[-1,58,null,0,false,false,false,869839903098264,null,[[7,[16,[1,17,44,false]]],[8,4],[7,[88,[4,90],[3,897985244779237]]]]]],[[17,88,null,433160842951836,0,null,[[0,[88,[4,90],[3,897985244779237]]]]]]],[0,0,false,null,758028701807117,322,[[-1,58,null,0,false,false,false,311298313752340,null,[[7,[16,[1,17,44,false]]],[8,2],[7,[89,[4,91],[3,897985244779237]]]]]],[[17,88,null,373369728159820,0,null,[[0,[89,[4,91],[3,897985244779237]]]]]]],[0,0,false,null,594440262731629,323,[[-1,58,null,0,false,false,false,615693559629686,null,[[7,[16,[1,18,44,false]]],[8,4],[7,[88,[4,90],[3,897985244779237]]]]]],[[18,88,null,130120538251996,0,null,[[0,[88,[4,90],[3,897985244779237]]]]]]],[0,0,false,null,363686630299969,324,[[-1,58,null,0,false,false,false,383579787704917,null,[[7,[16,[1,18,44,false]]],[8,2],[7,[89,[4,91],[3,897985244779237]]]]]],[[18,88,null,258714396670319,0,null,[[0,[89,[4,91],[3,897985244779237]]]]]]]]],[3,[true,"EspelhandoPersonagens"],false,null,449625656872959,325,[[-1,40,null,0,false,false,false,0,false,[[1,[90]]]]],[],[[0,0,false,null,122545233145898,326,[[17,67,null,0,false,false,false,830824773497296,null,[[8,2],[0,[16,[1,18,44,false]]]]]],[[91,81,null,204737673177676,0,null,[[3,1]]]]],[0,0,false,null,273937201187900,327,[[17,67,null,0,false,false,false,791510051596753,null,[[8,4],[0,[16,[1,18,44,false]]]]]],[[91,81,null,152492851301582,0,null,[[3,0]]]]],[0,0,false,null,161013802155083,328,[[18,67,null,0,false,false,false,674778212514695,null,[[8,4],[0,[16,[1,17,44,false]]]]]],[[92,81,null,313119134355724,0,null,[[3,0]]]]],[0,0,false,null,224742536582187,329,[[18,67,null,0,false,false,false,501270938051932,null,[[8,2],[0,[16,[1,17,44,false]]]]]],[[92,81,null,300058182895072,0,null,[[3,1]]]]]]],[3,[true,"Funcoes"],false,null,275832544525552,330,[[-1,40,null,0,false,false,false,0,false,[[1,[91]]]]],[],[[0,0,false,null,744430141016355,331,[[2,79,null,2,false,false,false,559661291932645,null,[[1,[5]]]]],[[29,49,null,833635633975516,0,null,[[0,[92,[2,17,false,3],[2,17,false,2]]]]],[30,49,null,983540261336395,0,null,[[0,[92,[2,18,false,3],[2,18,false,2]]]]],[34,66,null,611921680743883,0,null,[[0,[3,[3,717575276874391]]]]],[35,66,null,977496929691456,0,null,[[0,[3,[3,781872158660275]]]]]]],[0,0,false,null,297568913061867,332,[[2,79,null,2,false,false,false,492805489659635,null,[[1,[54]]]]],[],[[0,0,false,null,701397456970554,333,[[-1,32,null,0,false,false,false,435509727417558,null,[[11,717575276874391],[8,0],[7,[13]]]]],[[-1,92,null,409276870149971,0,null,[[6,"winorange"]]]]],[0,0,true,null,850359770761987,334,[[-1,32,null,0,false,false,false,252564119257931,null,[[11,781872158660275],[8,0],[7,[13]]]]],[[-1,92,null,510932630520527,0,null,[[6,"winblue"]]]]],[0,0,false,null,618282047423937,335,[[-1,54,null,0,false,false,false,764959042512607,null]],[[-1,93,null,905974066130957,0,null]]]]],[0,0,false,null,847314090931964,336,[[2,79,null,2,false,false,false,562633333071491,null,[[1,[2]]]]],[],[[0,0,false,null,131932643522699,337,[[2,94,null,0,false,false,false,542501982609406,null,[[0,[12]],[8,0],[7,[12]]]]],[[-1,95,null,726543226057291,0,null,[[4,16],[5,[93]],[0,[44]],[0,[44]],[16,false]]]]],[0,0,false,null,250204634080886,338,[[2,94,null,0,false,false,false,177333244771619,null,[[0,[12]],[8,0],[7,[1]]]]],[[-1,95,null,368008911699557,0,null,[[4,20],[5,[93]],[0,[44]],[0,[44]],[16,false]]]]],[0,0,false,null,244474912385962,339,[[2,94,null,0,false,false,false,402428943970466,null,[[0,[12]],[8,0],[7,[13]]]]],[[-1,95,null,379926915222400,0,null,[[4,22],[5,[93]],[0,[44]],[0,[44]],[16,false]]]]],[0,0,false,null,759717657150799,340,[[2,94,null,0,false,false,false,779498227422106,null,[[0,[12]],[8,0],[7,[94]]]]],[[-1,95,null,899865805869553,0,null,[[4,23],[5,[93]],[0,[44]],[0,[44]],[16,false]]]]]]],[0,0,false,null,988260877895281,341,[[2,79,null,2,false,false,false,842003502832882,null,[[1,[4]]]]],[],[[0,0,false,null,653980728666112,342,[[2,94,null,0,false,false,false,392849326673546,null,[[0,[12]],[8,0],[7,[12]]]]],[[-1,95,null,652969360348573,0,null,[[4,24],[5,[93]],[0,[44]],[0,[44]],[16,false]]]]],[0,0,false,null,197821584892164,343,[[2,94,null,0,false,false,false,285470088667030,null,[[0,[12]],[8,0],[7,[1]]]]],[[-1,95,null,152147561630901,0,null,[[4,25],[5,[93]],[0,[44]],[0,[44]],[16,false]]]]],[0,0,false,null,211316846404615,344,[[2,94,null,0,false,false,false,530602543841705,null,[[0,[12]],[8,0],[7,[13]]]]],[[-1,95,null,953020049105190,0,null,[[4,19],[5,[93]],[0,[44]],[0,[44]],[16,false]]]]],[0,0,false,null,359727960821525,345,[[2,94,null,0,false,false,false,561259989253524,null,[[0,[12]],[8,0],[7,[94]]]]],[[-1,95,null,904869620813266,0,null,[[4,21],[5,[93]],[0,[44]],[0,[44]],[16,false]]]]]]],[0,0,false,null,909880137087913,346,[[2,79,null,2,false,false,false,496442613024322,null,[[1,[95]]]]],[[1,78,null,637286802103927,0,null,[[3,0],[1,[96,[1,2,96,false]]],[3,0],[0,[3,[3,362461472136926]]],[1,[6]]]]]],[0,0,false,null,500939924568573,347,[[2,79,null,2,false,false,false,631176914765750,null,[[1,[65]]]]],[[1,78,null,330953607329543,0,null,[[3,0],[1,[96,[1,2,96,false]]],[3,0],[0,[3,[3,574429891740472]]],[1,[97]]]]]],[0,0,false,null,319737484348263,348,[[92,97,null,1,false,false,false,215491260087500,null]],[],[[0,0,false,null,788471927132406,349,[[-1,32,null,0,false,false,false,690101420258822,null,[[11,628998898533056],[8,0],[7,[3,[3,175591682901144]]]]]],[[92,98,null,468730907247432,0,null,[[1,[98]],[0,[13]],[0,[99]]]]]]]]]],[0,0,false,null,379559927413294,350,[[13,60,null,1,false,false,false,256051851506080,null,[[1,[100]]]]],[[13,68,null,788872221557312,0,null]]],[0,0,false,null,717697471921219,351,[[12,60,null,1,false,false,false,701575593863841,null,[[1,[100]]]]],[[12,68,null,752604298762257,0,null]]],[0,0,false,null,535053664275540,352,[[-1,23,null,1,false,false,false,681699523219273,null]],[[-1,24,null,308927020324835,0,null,[[11,556476296909077],[7,[101,[4,99]]]]],[94,98,null,928351667274840,0,null,[[1,[102]],[0,[12]],[0,[3,[3,556476296909077]]]]],[47,100,null,207103860747726,0,null],[47,66,null,267898307785475,0,null,[[0,[103,[4,99]]]]],[80,101,null,801898765511530,0,null,[[0,[12]],[0,[12]]]]]],[0,0,false,null,735970884685033,353,[[-1,102,null,0,false,false,false,761205518352229,null]],[[53,103,"MoveTo",837631273504445,0,null,[[0,[16,[1,15,44,false]]],[0,[16,[1,15,45,false]]],[3,0]]],[50,103,"MoveTo",106098040840525,0,null,[[0,[16,[1,14,44,false]]],[0,[16,[1,50,45,false]]],[3,0]]],[55,103,"MoveTo",170874299842878,0,null,[[0,[16,[1,14,44,false]]],[0,[16,[1,14,45,false]]],[3,0]]],[54,103,"MoveTo",976367398214633,0,null,[[0,[16,[1,15,44,false]]],[0,[16,[1,54,45,false]]],[3,0]]]]],[0,0,false,null,726430554213878,354,[[-1,35,null,0,false,false,false,133244381822549,null,[[0,[104,[4,99]]]]]],[[-1,95,null,657850052195288,0,null,[[4,56],[5,[105,[4,99]]],[0,[106,[1,14,44,false],[4,99]]],[0,[16,[1,14,45,false]]],[16,false]]]]],[0,0,false,null,897496404905152,355,[[56,97,null,1,false,false,false,917536988483925,null]],[[56,104,"Bullet",206659071235420,0,null,[[0,[107]]]],[56,105,"Bullet",244965098435655,0,null,[[0,[108,[4,99]]]]],[56,106,null,637242255900121,0,null,[[0,[109,[4,99]]]]],[56,107,"Fade",539319812126146,0,null,[[0,[110,[4,99]]]]],[56,108,null,708418351859031,0,null,[[0,[111,[4,99]]]]]]],[0,0,false,null,351414323279624,356,[[-1,35,null,0,false,false,false,792098250044857,null,[[0,[104,[4,99]]]]]],[[-1,95,null,827714026694045,0,null,[[4,57],[5,[105,[4,99]]],[0,[106,[1,15,44,false],[4,99]]],[0,[16,[1,15,45,false]]],[16,false]]]]],[0,0,false,null,582902714387835,357,[[57,97,null,1,false,false,false,138456374479719,null]],[[57,104,"Bullet",509760406215977,0,null,[[0,[107]]]],[57,105,"Bullet",846710608653027,0,null,[[0,[108,[4,99]]]]],[57,106,null,232312290403721,0,null,[[0,[109,[4,99]]]]],[57,107,"Fade",916819811785197,0,null,[[0,[110,[4,99]]]]],[57,108,null,394019670646677,0,null,[[0,[111,[4,99]]]]]]],[0,0,false,null,431268331253573,358,[[13,97,null,1,false,false,false,765229607433568,null],[-1,109,null,0,true,false,false,149766310310777,null,[[0,[112,[4,99]]]]]],[[13,80,null,620705626580057,0,null,[[4,72],[5,[13]],[7,[12]],[16,false]]],[72,110,null,348006206868165,0,null,[[0,[113,[4,99]]]]],[72,105,"Bullet",762422865801781,0,null,[[0,[114,[4,99]]]]],[72,111,"Bullet",159777024492476,0,null,[[0,[115,[4,99]]]]],[72,108,null,516943458013640,0,null,[[0,[116,[4,99]]]]]]],[0,0,false,null,609462480422533,359,[[12,97,null,1,false,false,false,927913014702689,null],[-1,109,null,0,true,false,false,516993436150740,null,[[0,[112,[4,99]]]]]],[[12,80,null,415369744995312,0,null,[[4,72],[5,[13]],[7,[12]],[16,false]]],[72,110,null,185353496954284,0,null,[[0,[113,[4,99]]]]],[72,105,"Bullet",536740945088074,0,null,[[0,[114,[4,99]]]]],[72,111,"Bullet",336883763304821,0,null,[[0,[115,[4,99]]]]],[72,108,null,105879226315709,0,null,[[0,[116,[4,99]]]]]]],[0,0,false,null,754210098589434,360,[[-1,23,null,1,false,false,false,554323272589946,null],[-1,32,null,0,false,false,false,668382670271466,null,[[11,361400748529732],[8,0],[7,[1]]]]],[[74,112,null,429508493750092,0,null,[[3,1]]],[73,112,null,818288342159725,0,null,[[3,1]]],[75,112,null,231164068561523,0,null,[[3,1]]],[76,112,null,896930677486305,0,null,[[3,0]]],[75,100,null,677218667207899,0,null],[75,66,null,586830762241420,0,null,[[0,[12]]]],[1,71,null,859416592610125,0,null,[[2,["one",false]],[3,0],[0,[12]],[1,[47]]]],[-1,34,null,469546431997957,2,null,[[0,[1]]]],[1,71,null,131074921075850,0,null,[[2,["game-start",false]],[3,0],[0,[117]],[1,[47]]]],[75,112,null,319683271427734,0,null,[[3,0]]],[-1,34,null,442730746586531,2,null,[[0,[1]]]],[1,71,null,256633076791079,0,null,[[2,["fight",false]],[3,0],[0,[12]],[1,[47]]]],[76,112,null,328791388588128,0,null,[[3,1]]],[-1,34,null,847476986046187,2,null,[[0,[1]]]],[76,112,null,649477458618827,0,null,[[3,0]]]]],[0,0,false,null,939550684356029,361,[[-1,23,null,1,false,false,false,626176123356478,null],[-1,32,null,0,false,false,false,199163207346970,null,[[11,361400748529732],[8,0],[7,[13]]]]],[[74,112,null,368240586490118,0,null,[[3,0]]],[73,112,null,858765261824631,0,null,[[3,0]]],[75,112,null,296337724670079,0,null,[[3,1]]],[76,112,null,337658746840540,0,null,[[3,0]]],[75,100,null,802552879305667,0,null],[75,66,null,586165095155343,0,null,[[0,[1]]]],[1,71,null,990291925751067,0,null,[[2,["two",false]],[3,0],[0,[12]],[1,[47]]]],[-1,34,null,328414447570993,2,null,[[0,[1]]]],[1,71,null,704660037585894,0,null,[[2,["game-start",false]],[3,0],[0,[117]],[1,[47]]]],[75,112,null,910262470039018,0,null,[[3,0]]],[-1,34,null,846686478461289,2,null,[[0,[1]]]],[1,71,null,456104840123462,0,null,[[2,["fight",false]],[3,0],[0,[12]],[1,[47]]]],[76,112,null,548069112494814,0,null,[[3,1]]],[-1,34,null,670116460267843,2,null,[[0,[1]]]],[76,112,null,925351016825216,0,null,[[3,0]]]]],[0,0,false,null,751114944370442,362,[[-1,23,null,1,false,false,false,114463447349474,null],[-1,32,null,0,false,false,false,510661026553456,null,[[11,361400748529732],[8,0],[7,[94]]]]],[[74,112,null,886186841068351,0,null,[[3,0]]],[73,112,null,158329347580287,0,null,[[3,0]]],[75,112,null,497611395208680,0,null,[[3,1]]],[76,112,null,548849268437189,0,null,[[3,0]]],[75,100,null,363395363359837,0,null],[75,66,null,159107731353551,0,null,[[0,[13]]]],[1,71,null,130144689526417,0,null,[[2,["final",false]],[3,0],[0,[12]],[1,[47]]]],[-1,34,null,192522657622206,2,null,[[0,[1]]]],[1,71,null,339238161402363,0,null,[[2,["game-start",false]],[3,0],[0,[117]],[1,[47]]]],[75,112,null,440603380053548,0,null,[[3,0]]],[-1,34,null,315863791382993,2,null,[[0,[1]]]],[1,71,null,106360561783616,0,null,[[2,["fight",false]],[3,0],[0,[12]],[1,[47]]]],[76,112,null,697106606731781,0,null,[[3,1]]],[-1,34,null,812120169553624,2,null,[[0,[1]]]],[76,112,null,484169150164084,0,null,[[3,0]]]]],[0,0,false,null,339907774330293,363,[[0,55,null,0,false,false,false,257160320696546,null,[[9,87]]],[-1,37,null,0,false,false,false,351931997658357,null]],[[1,78,null,962519689530656,0,null,[[3,0],[1,[118,[4,77]]],[3,0],[0,[119]],[1,[47]]]],[1,78,null,212436076157815,0,null,[[3,0],[1,[120,[4,77]]],[3,0],[0,[12]],[1,[47]]]]]],[0,0,false,null,323739908127453,364,[[0,55,null,0,false,false,false,417880791656868,null,[[9,38]]],[-1,32,null,0,false,false,false,924558007627906,null,[[11,159870632320207],[8,0],[7,[12]]]],[-1,37,null,0,false,false,false,785303200142887,null]],[[1,78,null,247716532901490,0,null,[[3,0],[1,[118,[4,77]]],[3,0],[0,[119]],[1,[47]]]]]],[0,0,false,null,618987294044393,365,[[0,55,null,0,false,false,false,784411777270900,null,[[9,75]]],[-1,32,null,0,false,false,false,563862458085233,null,[[11,159870632320207],[8,0],[7,[12]]]],[-1,37,null,0,false,false,false,757108062732070,null]],[[1,78,null,744989456465772,0,null,[[3,0],[1,[120,[4,77]]],[3,0],[0,[12]],[1,[47]]]]]],[0,0,false,null,851833604533407,366,[[0,55,null,0,false,false,false,142420149854045,null,[[9,76]]],[-1,32,null,0,false,false,false,899928296790864,null,[[11,159870632320207],[8,0],[7,[12]]]],[-1,37,null,0,false,false,false,139894524390635,null]],[[1,78,null,999861637752788,0,null,[[3,0],[1,[120,[4,77]]],[3,0],[0,[12]],[1,[47]]]]]],[0,0,false,null,911018539533194,367,[[0,55,null,0,false,false,false,211907911419588,null,[[9,70]]],[-1,37,null,0,false,false,false,124786513212322,null]],[[1,78,null,165318538293429,0,null,[[3,0],[1,[120,[4,77]]],[3,0],[0,[12]],[1,[47]]]]]],[0,0,false,null,160196461323437,368,[[0,55,null,0,false,false,false,523617979206445,null,[[9,71]]],[-1,37,null,0,false,false,false,569138491744196,null]],[[1,78,null,839087624358240,0,null,[[3,0],[1,[120,[4,77]]],[3,0],[0,[12]],[1,[47]]]]]],[0,0,false,null,231507569962894,369,[[71,64,null,1,false,false,false,523123919216782,null,[[4,40]]]],[[1,78,null,463235534744784,0,null,[[3,0],[1,[118,[4,77]]],[3,0],[0,[119]],[1,[47]]]]]],[0,0,false,null,212439714958347,370,[[88,113,null,0,false,true,false,452024497205052,null]],[[93,112,null,811848108553054,0,null,[[3,0]]]]],[0,0,false,null,862026918539103,371,[[-1,32,null,0,false,false,false,245331219556710,null,[[11,159870632320207],[8,0],[7,[1]]]]],[[74,112,null,962646732430911,0,null,[[3,0]]]]]]],["comum",[[1,"FX",0,-5,false,false,574429891740472,false,124],[1,"music",0,-10,false,false,362461472136926,false,125],[1,"P1Select",0,0,false,false,175591682901144,false,126],[1,"P2Select",0,0,false,false,628998898533056,false,127],[1,"distPersonagens",0,30,false,false,897985244779237,false,128],[1,"numeroRound",0,1,false,false,361400748529732,false,129],[1,"roundP1",0,0,false,false,717575276874391,false,130],[1,"roundP2",0,0,false,false,781872158660275,false,131],[1,"roundTime",0,3,false,false,863177864399805,false,132],[1,"golpesExtras",0,1,false,false,754743954925292,false,133],[1,"limiteEsquerda",0,40,false,false,962875178820567,false,134],[1,"limiteDireita",0,800,false,false,548949025892520,false,135],[1,"InteligenciaArtificial",0,1,false,false,159870632320207,false,136],[0,0,false,null,757185758255845,1,[[0,65,null,1,false,false,false,500423124176550,null,[[9,13]]],[0,114,null,0,false,false,false,903679431414661,null,[[0,[121]]]]],[],[[0,0,false,null,960397786327528,2,[[3,115,null,0,false,true,false,289841267090955,null]],[[-1,34,null,306091891933302,2,null,[[0,[64]]]],[3,116,null,248177506108836,0,null,[[3,2],[3,0]]]]],[0,0,false,null,882743782148439,3,[[-1,54,null,0,false,false,false,422706762045957,null]],[[-1,34,null,135013938232190,2,null,[[0,[64]]]],[3,117,null,163502621331169,0,null]]]]],[3,[false,"debug"],false,null,554533957332383,4,[[-1,40,null,0,false,false,false,0,false,[[1,[122]]]]],[],[[0,0,false,null,541555189294727,5,[[0,65,null,1,false,false,false,877386534023373,null,[[9,82]]]],[[-1,93,null,381509921009639,0,null]]]]],[3,[false,"AI_Debug"],false,null,985570986580979,6,[[-1,40,null,0,false,false,false,0,false,[[1,[123]]]]],[],[[0,0,false,null,257754150597014,7,[[0,65,null,1,false,false,false,792213545071422,null,[[9,49]]]],[],[[0,0,false,null,124874866602510,8,[[18,53,null,0,false,true,false,176469987011868,null,[[10,7]]]],[[-1,34,null,671254140677193,2,null,[[0,[64]]]],[18,74,null,523243246668157,0,null,[[10,7],[3,1]]]]],[0,0,false,null,248386785356055,9,[[-1,54,null,0,false,false,false,303945999504283,null]],[[-1,34,null,278347994723028,2,null,[[0,[64]]]],[18,74,null,602748409928923,0,null,[[10,7],[3,0]]]]]]],[0,0,false,null,709076957857064,10,[[0,65,null,1,false,false,false,267317868499972,null,[[9,50]]]],[],[[0,0,false,null,926258568606987,11,[[18,53,null,0,false,true,false,356354361628230,null,[[10,6]]]],[[-1,34,null,988376628981040,2,null,[[0,[64]]]],[18,74,null,981484375880718,0,null,[[10,6],[3,1]]]]],[0,0,false,null,668155934006718,12,[[-1,54,null,0,false,false,false,631856166709493,null]],[[-1,34,null,832449973784307,2,null,[[0,[64]]]],[18,74,null,658078953844564,0,null,[[10,6],[3,0]]]]]]],[0,0,false,null,434555058284211,13,[[0,65,null,1,false,false,false,162275357099098,null,[[9,51]]]],[],[[0,0,false,null,807437472840408,14,[[18,53,null,0,false,true,false,195338956055411,null,[[10,8]]]],[[-1,34,null,324871680333715,2,null,[[0,[64]]]],[18,74,null,208852366918413,0,null,[[10,8],[3,1]]]]],[0,0,false,null,979477869132058,15,[[-1,54,null,0,false,false,false,707652167309154,null]],[[-1,34,null,317888310146149,2,null,[[0,[64]]]],[18,74,null,594074482686161,0,null,[[10,8],[3,0]]]]]]],[0,0,false,null,680966493620921,16,[[0,65,null,1,false,false,false,298477634168586,null,[[9,52]]]],[],[[0,0,false,null,866708403572151,17,[[18,53,null,0,false,true,false,754502366537225,null,[[10,9]]]],[[-1,34,null,975706605809325,2,null,[[0,[64]]]],[18,74,null,712805276871673,0,null,[[10,9],[3,1]]]]],[0,0,false,null,904687182704231,18,[[-1,54,null,0,false,false,false,418513057533142,null]],[[-1,34,null,764534792574024,2,null,[[0,[64]]]],[18,74,null,517645826915769,0,null,[[10,9],[3,0]]]]]]],[0,0,false,null,342277809253007,19,[[0,65,null,1,false,false,false,380599003643574,null,[[9,53]]]],[],[[0,0,false,null,279861186016165,20,[[18,53,null,0,false,true,false,925894757103502,null,[[10,10]]]],[[-1,34,null,479590597638542,2,null,[[0,[64]]]],[18,74,null,929734277935688,0,null,[[10,10],[3,1]]]]],[0,0,false,null,101206848365687,21,[[-1,54,null,0,false,false,false,510881759225733,null]],[[-1,34,null,446853512464767,2,null,[[0,[64]]]],[18,74,null,300118032143544,0,null,[[10,10],[3,0]]]]]]]]],[3,[true,"CPU_AI"],false,null,780684474599992,22,[[-1,40,null,0,false,false,false,0,false,[[1,[124]]]]],[],[[0,0,false,null,808807559875034,23,[[-1,32,null,0,false,false,false,900200314072679,null,[[11,159870632320207],[8,0],[7,[1]]]],[-1,32,null,0,false,false,false,697692901813703,null,[[11,863177864399805],[8,0],[7,[12]]]]],[],[[0,0,false,null,901778426999469,24,[[18,51,"Platform",0,false,false,false,448272163157622,null]],[],[[0,0,false,null,576424659495857,25,[[18,53,null,0,false,true,false,520544700425802,null,[[10,1]]],[18,53,null,0,false,true,false,204945183917560,null,[[10,5]]],[18,46,null,0,false,false,false,801399896076724,null,[[10,2],[8,4],[7,[12]]]]],[],[[0,0,false,null,397628928242273,26,[[18,53,null,0,false,false,false,738659525891075,null,[[10,7]]]],[],[[0,0,false,null,114686551531007,27,[[18,46,null,0,false,true,false,424655914972574,null,[[10,0],[8,0],[7,[27]]]],[18,46,null,0,false,true,false,592953655863478,null,[[10,0],[8,0],[7,[28]]]],[18,46,null,0,false,true,false,405669279614957,null,[[10,0],[8,0],[7,[29]]]]],[],[[0,0,false,null,544363257174328,28,[[92,56,null,0,false,true,false,513041681266183,null]],[],[[0,0,true,null,260724039572820,29,[[91,57,null,0,false,false,false,721317044253726,null,[[1,[27]]]],[91,57,null,0,false,false,false,615046542735084,null,[[1,[30]]]],[91,57,null,0,false,false,false,598867186272884,null,[[1,[31]]]],[91,57,null,0,false,false,false,978750943140357,null,[[1,[32]]]],[91,57,null,0,false,false,false,602006501098969,null,[[1,[33]]]],[91,57,null,0,false,false,false,748443362925699,null,[[1,[34]]]],[91,57,null,0,false,false,false,775046500886541,null,[[1,[35]]]],[91,57,null,0,false,false,false,406748894021155,null,[[1,[28]]]]],[],[[0,0,false,null,340808919247793,30,[[-1,58,null,0,false,false,false,613248527800979,null,[[7,[36,[1,17,44,false]]],[8,5],[7,[16,[1,18,44,false]]]]],[-1,37,null,0,false,false,false,263183839575485,null]],[[18,47,null,492508155768456,0,null,[[10,0],[7,[37]]]],[92,50,null,434648886217638,0,null,[[1,[37]],[3,1]]],[18,59,"Platform",512673684343101,0,null,[[0,[12]]]]]]]],[0,0,true,null,380449593438840,31,[[91,60,null,1,false,false,false,939133146272275,null,[[1,[28]]]],[91,60,null,1,false,false,false,216351023510533,null,[[1,[27]]]]],[[-1,34,null,512393601423909,2,null,[[0,[38]]]],[18,47,null,870460047251319,0,null,[[10,0],[7,[22]]]]]],[0,0,false,null,966722023774497,32,[[92,61,null,0,false,false,false,723542274852282,null,[[4,91]]],[92,57,null,0,false,true,false,446307013848772,null,[[1,[37]]]]],[[18,62,"Platform",497218490131987,0,null,[[3,0]]],[18,47,null,737064564627912,0,null,[[10,0],[7,[22]]]]]],[0,0,false,null,874545420205720,33,[[92,61,null,0,false,true,false,286473313785627,null,[[4,91]]],[92,57,null,0,false,true,false,891696268243174,null,[[1,[37]]]]],[[18,62,"Platform",468269662315330,0,null,[[3,0]]],[18,47,null,933741134810752,0,null,[[10,0],[7,[22]]]]]]]],[0,0,false,null,279735702164747,34,[[92,56,null,0,false,false,false,698063917976234,null]],[[18,62,"Platform",584112110118823,0,null,[[3,0]]],[18,47,null,591609784617430,0,null,[[10,0],[7,[22]]]]]]]]]],[0,0,false,null,582773912222055,35,[[18,53,null,0,false,false,false,920156176847032,null,[[10,6]]]],[],[[0,0,false,null,149594882940647,36,[[18,46,null,0,false,true,false,878083491935100,null,[[10,0],[8,0],[7,[27]]]],[18,46,null,0,false,true,false,294693805289907,null,[[10,0],[8,0],[7,[28]]]],[18,46,null,0,false,true,false,599308969306923,null,[[10,0],[8,0],[7,[29]]]]],[],[[0,0,false,null,611787286192726,37,[[92,56,null,0,false,true,false,354617996355071,null]],[[18,62,"Platform",135463068247574,0,null,[[3,1]]],[18,47,null,516512396104448,0,null,[[10,0],[7,[25]]]]]],[0,0,false,null,356757775345640,38,[[92,56,null,0,false,false,false,954308995284216,null]],[],[[0,0,true,null,112944569207582,39,[[91,57,null,0,false,false,false,698389215379239,null,[[1,[27]]]],[91,57,null,0,false,false,false,145866503081802,null,[[1,[28]]]],[91,57,null,0,false,false,false,520238574605253,null,[[1,[30]]]],[91,57,null,0,false,false,false,494254999328778,null,[[1,[31]]]],[91,57,null,0,false,false,false,795632452893083,null,[[1,[32]]]],[91,57,null,0,false,false,false,322692633654211,null,[[1,[33]]]],[91,57,null,0,false,false,false,255889131993769,null,[[1,[34]]]],[91,57,null,0,false,false,false,106307692037736,null,[[1,[35]]]]],[],[[0,0,false,null,597457476137692,40,[[-1,58,null,0,false,false,false,547414676233437,null,[[7,[36,[1,17,44,false]]],[8,5],[7,[16,[1,18,44,false]]]]],[-1,37,null,0,false,false,false,471388609624791,null]],[[18,47,null,141132477503870,0,null,[[10,0],[7,[37]]]],[92,50,null,827063775065961,0,null,[[1,[37]],[3,1]]],[18,59,"Platform",311491986762300,0,null,[[0,[12]]]]]]]],[0,0,true,null,528487548388012,41,[[91,60,null,1,false,false,false,469103115020373,null,[[1,[28]]]],[91,60,null,1,false,false,false,322463893021606,null,[[1,[27]]]]],[[-1,34,null,992944240054484,2,null,[[0,[38]]]],[18,47,null,436571297515796,0,null,[[10,0],[7,[25]]]]]],[0,0,false,null,887091493455545,42,[[92,61,null,0,false,false,false,251608448171120,null,[[4,91]]],[92,57,null,0,false,true,false,773281041580017,null,[[1,[37]]]]],[[18,62,"Platform",947483280714155,0,null,[[3,1]]],[18,47,null,578062117518326,0,null,[[10,0],[7,[25]]]]]],[0,0,false,null,435553377916607,43,[[92,61,null,0,false,true,false,880519504781250,null,[[4,91]]],[92,57,null,0,false,true,false,763805291199380,null,[[1,[37]]]]],[[18,62,"Platform",367745491324508,0,null,[[3,1]]],[18,47,null,547802247447917,0,null,[[10,0],[7,[25]]]]]]]]]]]],[0,0,false,null,902059576479455,44,[[18,53,null,0,false,false,false,612962884330553,null,[[10,8]]]],[],[[0,0,false,null,671515317617284,45,[[92,57,null,0,false,true,false,811773708294848,null,[[1,[27]]]],[92,57,null,0,false,true,false,690917479987592,null,[[1,[28]]]],[92,57,null,0,false,true,false,321493074246586,null,[[1,[34]]]],[92,57,null,0,false,true,false,842151373393974,null,[[1,[35]]]],[92,57,null,0,false,true,false,383034126925471,null,[[1,[37]]]],[18,53,null,0,false,true,false,827690778644611,null,[[10,9]]],[18,53,null,0,false,true,false,534477672554125,null,[[10,10]]]],[[18,62,"Platform",313025906540697,0,null,[[3,2]]]],[[0,0,false,null,586143334542965,46,[[18,46,null,0,false,false,false,741286144151209,null,[[10,0],[8,0],[7,[22]]]]],[[18,47,null,389529580931414,0,null,[[10,0],[7,[41]]]]]],[0,0,false,null,670606046754222,47,[[18,46,null,0,false,false,false,577620367815836,null,[[10,0],[8,0],[7,[25]]]]],[[18,47,null,969807235016686,0,null,[[10,0],[7,[42]]]]]]]]]],[0,0,false,null,428143332034065,48,[[18,53,null,0,false,false,false,564613262397295,null,[[10,9]]]],[],[[0,0,false,null,692562577056572,49,[[92,57,null,0,false,true,false,755974075445853,null,[[1,[27]]]],[92,57,null,0,false,true,false,367955331127599,null,[[1,[28]]]],[92,57,null,0,false,true,false,344593994998227,null,[[1,[34]]]],[92,57,null,0,false,true,false,848335771168937,null,[[1,[35]]]],[92,57,null,0,false,true,false,341829669193215,null,[[1,[37]]]]],[],[[0,0,false,null,384420277790310,50,[[18,46,null,0,false,true,false,721093838700867,null,[[10,0],[8,0],[7,[29]]]]],[[18,47,null,987012905193180,0,null,[[10,0],[7,[27]]]],[18,59,"Platform",968356881331645,0,null,[[0,[12]]]],[92,50,null,370962575638848,0,null,[[1,[27]],[3,1]]]]],[0,0,false,null,429782069323213,51,[[18,46,null,0,false,false,false,148071699805514,null,[[10,0],[8,0],[7,[29]]]]],[[92,50,null,401667840248172,0,null,[[1,[34]],[3,1]]]]]]]]],[0,0,false,null,916622331273108,52,[[18,53,null,0,false,false,false,171076733417670,null,[[10,10]]]],[],[[0,0,false,null,552577635130663,53,[[92,57,null,0,false,true,false,754752077804556,null,[[1,[27]]]],[92,57,null,0,false,true,false,365106507414817,null,[[1,[28]]]],[92,57,null,0,false,true,false,536882479136831,null,[[1,[34]]]],[92,57,null,0,false,true,false,458006962226963,null,[[1,[35]]]],[92,57,null,0,false,true,false,433890720356807,null,[[1,[37]]]]],[],[[0,0,false,null,921765706213521,54,[[18,46,null,0,false,true,false,561880342920596,null,[[10,0],[8,0],[7,[29]]]]],[[18,47,null,827390391115450,0,null,[[10,0],[7,[28]]]],[18,59,"Platform",429398772691917,0,null,[[0,[12]]]],[92,50,null,502930200564160,0,null,[[1,[28]],[3,1]]]]],[0,0,false,null,279755294718436,55,[[18,46,null,0,false,false,false,611604780455397,null,[[10,0],[8,0],[7,[29]]]]],[[92,50,null,431336169633038,0,null,[[1,[35]],[3,1]]]]]]]]],[0,0,false,null,571649635770655,56,[[92,56,null,0,false,false,false,948222681774421,null]],[],[[0,0,false,null,546996199393530,57,[[18,67,null,0,false,false,false,944355485296440,null,[[8,3],[0,[125,[1,17,44,false]]]]],[18,53,null,0,false,true,false,800197388723540,null,[[10,9]]],[18,53,null,0,false,true,false,732984248528616,null,[[10,10]]],[-1,35,null,0,false,false,false,575167637511728,null,[[0,[48]]]]],[],[[0,0,true,null,246246275049441,58,[[91,57,null,0,false,false,false,720091283168613,null,[[1,[27]]]],[91,57,null,0,false,false,false,760435342709008,null,[[1,[28]]]]],[[2,25,null,267465855286703,0,null,[[1,[73]],[13,[7,[126,[4,77]]]]]]]],[0,0,false,null,481509500133589,59,[[-1,54,null,0,false,false,false,772807483723615,null]],[[2,25,null,908937940349983,0,null,[[1,[73]],[13,[7,[127,[4,77]]]]]]]]]],[0,0,false,null,202364674958997,60,[[18,67,null,0,false,false,false,118697642514790,null,[[8,4],[0,[125,[1,17,44,false]]]]],[-1,35,null,0,false,false,false,311673078761132,null,[[0,[52]]]]],[],[[0,0,true,null,259576100748860,61,[[91,57,null,0,false,false,false,615649875412259,null,[[1,[27]]]],[91,57,null,0,false,false,false,361947495055364,null,[[1,[28]]]]],[[2,25,null,137287065325653,0,null,[[1,[73]],[13,[7,[126,[4,77]]]]]]]],[0,0,false,null,636926490626880,62,[[-1,54,null,0,false,false,false,754190886204247,null]],[[2,25,null,984923751845527,0,null,[[1,[73]],[13,[7,[128,[4,77]]]]]]]]]],[0,0,false,null,821373806130232,63,[[18,76,"Platform",1,false,false,false,462134086067529,null]],[[18,47,null,883638339547405,0,null,[[10,0],[7,[21]]]]]],[0,0,false,null,889490936253182,64,[[18,46,null,0,false,false,false,318487566388078,null,[[10,0],[8,0],[7,[21]]]],[-1,37,null,0,false,false,false,646365274007427,null]],[[-1,34,null,595373221359722,2,null,[[0,[72,[4,77]]]]],[2,25,null,639405509091309,0,null,[[1,[73]],[13,[7,[129,[4,77]]]]]]]]]],[0,0,false,null,527190188212750,65,[[-1,54,null,0,false,false,false,585926790472853,null]],[],[[0,0,false,null,161870457084647,66,[[18,67,null,0,false,false,false,349210320986495,null,[[8,5],[0,[130,[1,17,44,false]]]]],[18,53,null,0,false,true,false,683783829044484,null,[[10,9]]],[18,53,null,0,false,true,false,992027314050050,null,[[10,10]]],[-1,35,null,0,false,false,false,249040205110910,null,[[0,[48]]]]],[],[[0,0,true,null,130633949885606,67,[[91,57,null,0,false,false,false,272589241568074,null,[[1,[27]]]],[91,57,null,0,false,false,false,718216900974973,null,[[1,[28]]]]],[[2,25,null,210789312240267,0,null,[[1,[73]],[13,[7,[131,[4,77]]]]]]]],[0,0,false,null,965443731154811,68,[[-1,54,null,0,false,false,false,422026746314020,null]],[[2,25,null,586988696566110,0,null,[[1,[73]],[13,[7,[127,[4,77]]]]]]]]]],[0,0,false,null,263810089142406,69,[[18,67,null,0,false,false,false,461049170860674,null,[[8,2],[0,[130,[1,17,44,false]]]]],[-1,35,null,0,false,false,false,863436263832285,null,[[0,[52]]]]],[],[[0,0,true,null,240007956643669,70,[[91,57,null,0,false,false,false,816532456812681,null,[[1,[27]]]],[91,57,null,0,false,false,false,659391981734043,null,[[1,[28]]]]],[[2,25,null,962927978898770,0,null,[[1,[73]],[13,[7,[131,[4,77]]]]]]]],[0,0,false,null,282081286898948,71,[[-1,54,null,0,false,false,false,815402927676621,null]],[[2,25,null,623160854791087,0,null,[[1,[73]],[13,[7,[132,[4,77]]]]]]]]]],[0,0,false,null,976443678876317,72,[[18,76,"Platform",1,false,false,false,345255390445500,null]],[[18,47,null,331766376946547,0,null,[[10,0],[7,[21]]]]]],[0,0,false,null,122945094477139,73,[[18,46,null,0,false,false,false,718524037894745,null,[[10,0],[8,0],[7,[21]]]],[-1,37,null,0,false,false,false,951261413274057,null]],[[-1,34,null,809744650947732,2,null,[[0,[72,[4,77]]]]],[2,25,null,804509333366041,0,null,[[1,[73]],[13,[7,[133,[4,77]]]]]]]]]]]]]],[0,0,false,null,351912222612111,74,[[18,51,"Platform",0,false,true,false,507638301299677,null]],[],[[0,0,false,null,902718125173539,75,[[18,53,null,0,false,true,false,298486793261091,null,[[10,5]]],[18,53,null,0,false,true,false,843978416178918,null,[[10,1]]],[18,46,null,0,false,false,false,518232684677516,null,[[10,2],[8,4],[7,[12]]]]],[],[[0,0,false,null,794853130567884,76,[[92,56,null,0,false,false,false,759056478965371,null]],[],[[0,0,false,null,111654794777789,77,[[92,57,null,0,false,true,false,423602416919461,null,[[1,[32]]]],[92,57,null,0,false,true,false,121689138009473,null,[[1,[31]]]]],[],[[0,0,false,null,757748211544342,78,[[-1,37,null,0,false,false,false,326646326507779,null],[18,67,null,0,false,false,false,826254186381656,null,[[8,3],[0,[134,[1,17,44,false]]]]]],[[-1,34,null,724135847297132,2,null,[[0,[135,[4,99]]]]],[2,25,null,808380615341575,0,null,[[1,[73]],[13,[7,[136,[4,77]]]]]]]]]]]],[0,0,false,null,751638142194888,79,[[-1,54,null,0,false,false,false,712972676089071,null]],[],[[0,0,false,null,714165987197879,80,[[92,57,null,0,false,true,false,747239973172496,null,[[1,[32]]]],[92,57,null,0,false,true,false,864808188861893,null,[[1,[31]]]]],[],[[0,0,false,null,977973506054896,81,[[-1,37,null,0,false,false,false,371258004064123,null],[18,67,null,0,false,false,false,561855458311315,null,[[8,5],[0,[134,[1,17,44,false]]]]]],[[-1,34,null,981675608424133,2,null,[[0,[135,[4,99]]]]],[2,25,null,335917570468694,0,null,[[1,[73]],[13,[7,[136,[4,77]]]]]]]]]]]],[0,0,false,null,289095137499991,82,[[18,53,null,0,false,false,false,622236863277208,null,[[10,9]]]],[],[[0,0,false,null,327801126553207,83,[[92,57,null,0,false,true,false,164326611499674,null,[[1,[32]]]],[92,57,null,0,false,true,false,544239218792385,null,[[1,[31]]]]],[[92,50,null,180851865813039,0,null,[[1,[31]],[3,1]]]]]]],[0,0,false,null,546642324621264,84,[[18,53,null,0,false,false,false,929984622067057,null,[[10,10]]]],[],[[0,0,false,null,816290852736682,85,[[92,57,null,0,false,true,false,566376862011379,null,[[1,[32]]]],[92,57,null,0,false,true,false,190419851906334,null,[[1,[31]]]]],[[92,50,null,684066200749544,0,null,[[1,[32]],[3,1]]]]]]]]]]],[0,0,false,null,741627842276661,86,[[2,79,null,2,false,false,false,429558431925223,null,[[1,[73]]]],[92,57,null,0,false,true,false,147033600858712,null,[[1,[37]]]],[92,57,null,0,false,true,false,899316890416900,null,[[1,[27]]]],[92,57,null,0,false,true,false,679270754205121,null,[[1,[28]]]],[92,57,null,0,false,true,false,226517884727390,null,[[1,[31]]]],[92,57,null,0,false,true,false,391880064352133,null,[[1,[32]]]]],[],[[0,0,false,null,341404547171571,87,[[2,94,null,0,false,false,false,798585811835411,null,[[0,[12]],[8,0],[7,[12]]]]],[],[[0,0,false,null,155397617212409,88,[[18,51,"Platform",0,false,false,false,132839978352367,null]],[[18,47,null,593180014961167,0,null,[[10,0],[7,[27]]]],[18,74,null,241139981381983,0,null,[[10,7],[3,0]]],[18,74,null,992839639718334,0,null,[[10,6],[3,0]]],[18,74,null,599189031748040,0,null,[[10,9],[3,1]]]]],[0,0,false,null,536404855944133,89,[[-1,54,null,0,false,false,false,893062810348950,null]],[[18,74,null,702167261695356,0,null,[[10,9],[3,1]]]]]]],[0,0,false,null,600788619904790,90,[[2,94,null,0,false,false,false,204089556585208,null,[[0,[12]],[8,0],[7,[1]]]]],[],[[0,0,false,null,503093145558636,91,[[18,51,"Platform",0,false,false,false,591236721847895,null]],[[18,47,null,270139975288461,0,null,[[10,0],[7,[28]]]],[18,74,null,345726663358023,0,null,[[10,7],[3,0]]],[18,74,null,474306762623161,0,null,[[10,6],[3,0]]],[18,74,null,277895773801978,0,null,[[10,10],[3,1]]]]],[0,0,false,null,301055766394285,92,[[-1,54,null,0,false,false,false,864034989041248,null]],[[18,74,null,305030003110371,0,null,[[10,10],[3,1]]]]]]],[0,0,false,null,104770631655984,93,[[2,94,null,0,false,false,false,732153919827376,null,[[0,[12]],[8,0],[7,[13]]]]],[],[[0,0,false,null,330240032393182,94,[[18,53,null,0,false,true,false,501595978675059,null,[[10,9]]],[18,53,null,0,false,true,false,770752415880976,null,[[10,10]]]],[[18,74,null,547713931572809,0,null,[[10,6],[3,0]]],[18,74,null,973023262420219,0,null,[[10,7],[3,1]]],[-1,34,null,990965895486006,2,null,[[0,[1]]]],[18,74,null,583057017044054,0,null,[[10,7],[3,0]]]]]]],[0,0,false,null,479504737340279,95,[[2,94,null,0,false,false,false,235199169838685,null,[[0,[12]],[8,0],[7,[94]]]]],[],[[0,0,false,null,441069796210935,96,[[18,53,null,0,false,true,false,574156025874702,null,[[10,9]]],[18,53,null,0,false,true,false,353020369774700,null,[[10,10]]]],[[18,74,null,515311998058426,0,null,[[10,7],[3,0]]],[18,74,null,467123025771270,0,null,[[10,6],[3,1]]],[-1,34,null,484837010438678,2,null,[[0,[1]]]],[18,74,null,681002167659622,0,null,[[10,6],[3,0]]]]]]],[0,0,false,null,311438493430741,97,[[2,94,null,0,false,false,false,356133399559590,null,[[0,[12]],[8,0],[7,[0]]]],[92,57,null,0,false,true,false,627311789727040,null,[[1,[37]]]]],[],[[0,0,false,null,748343734312197,98,[[92,57,null,0,false,true,false,431622280577152,null,[[1,[27]]]],[92,57,null,0,false,true,false,934513149290487,null,[[1,[28]]]]],[[18,74,null,151891688282409,0,null,[[10,9],[3,0]]],[18,74,null,918353713347621,0,null,[[10,10],[3,0]]],[18,74,null,317475464527171,0,null,[[10,8],[3,1]]],[18,74,null,608663674714425,0,null,[[10,7],[3,0]]],[18,74,null,528850887162059,0,null,[[10,6],[3,0]]]]],[0,0,false,null,887610189184606,99,[[-1,54,null,0,false,false,false,684658456507399,null]],[[18,74,null,596764570220941,0,null,[[10,9],[3,0]]],[18,74,null,974071183665157,0,null,[[10,10],[3,0]]],[18,74,null,898999801048902,0,null,[[10,8],[3,0]]],[18,74,null,930940612300513,0,null,[[10,7],[3,0]]],[18,74,null,785596825329773,0,null,[[10,6],[3,0]]]]]]]]],[0,0,false,null,358486513784966,100,[[18,118,"Platform",0,false,false,false,782309337718676,null],[-1,32,null,0,false,false,false,332230197868543,null,[[11,159870632320207],[8,0],[7,[1]]]]],[],[[0,0,false,null,819042917826453,101,[[18,53,null,0,false,false,false,398797224531973,null,[[10,8]]]],[[18,74,null,693743278577573,0,null,[[10,8],[3,0]]],[18,74,null,796105220069829,0,null,[[10,9],[3,0]]],[18,74,null,488066485385514,0,null,[[10,10],[3,0]]]]]]]]]]]]],["Menu",[[2,"comum",false],[0,0,false,null,266490177914786,1,[[-1,23,null,1,false,false,false,746538759989537,null]],[[-1,119,null,663041088809224,0,null],[2,25,null,234578080106886,0,null,[[1,[137]],[13]]],[62,101,null,195309715556970,0,null,[[0,[12]],[0,[12]]]],[44,31,null,161547947709588,0,null,[[7,[138]]]],[-1,34,null,391927171325122,2,null,[[0,[52]]]],[69,72,"Tween",421181362255210,1,null,[[1,[47]],[3,0],[0,[139]],[0,[140]],[0,[38]],[18,0],[3,0],[3,0],[3,0]]],[1,71,null,805074436976720,0,null,[[2,["attack2",false]],[3,0],[0,[12]],[1,[47]]]],[-1,34,null,124021326358177,2,null,[[0,[64]]]],[68,72,"Tween",149992458723261,1,null,[[1,[47]],[3,0],[0,[141]],[0,[140]],[0,[38]],[18,0],[3,0],[3,0],[3,0]]],[1,71,null,487004639151025,0,null,[[2,["attack2",false]],[3,0],[0,[12]],[1,[47]]]],[-1,34,null,359231185856059,2,null,[[0,[64]]]],[67,72,"Tween",799090893169595,1,null,[[1,[47]],[3,0],[0,[142]],[0,[140]],[0,[38]],[18,0],[3,0],[3,0],[3,0]]],[1,71,null,245506477937639,0,null,[[2,["attack2",false]],[3,0],[0,[12]],[1,[47]]]],[-1,34,null,983211517185421,2,null,[[0,[64]]]],[62,72,"Tween",359351018268667,1,null,[[1,[47]],[3,1],[0,[143]],[0,[44]],[0,[38]],[18,0],[3,0],[3,0],[3,0]]],[1,71,null,141822531616281,0,null,[[2,["winnergongh",false]],[3,0],[0,[12]],[1,[47]]]]]],[0,0,false,null,739985384132145,2,[[2,79,null,2,false,false,false,647711117309261,null,[[1,[137]]]]],[[41,120,null,564779513129796,0,null,[[0,[144,[2,41,false,0],[2,42,false,0]]]]]]],[0,0,false,null,798508538277075,3,[[0,65,null,1,false,false,false,476225541993151,null,[[9,87]]],[42,121,null,0,false,false,false,676953852404156,null,[[10,0],[8,4],[7,[12]]]]],[[42,122,null,219025525472814,0,null,[[10,0],[7,[1]]]],[2,25,null,988500115982656,0,null,[[1,[137]],[13]]]]],[0,0,false,null,747246225870682,4,[[0,65,null,1,false,false,false,667900477934684,null,[[9,83]]],[42,121,null,0,false,false,false,367631141452891,null,[[10,0],[8,2],[7,[13]]]]],[[42,123,null,826140473816549,0,null,[[10,0],[7,[1]]]],[2,25,null,197563562966851,0,null,[[1,[137]],[13]]]]],[0,0,false,null,676961076306180,5,[[0,65,null,1,false,false,false,953673657351837,null,[[9,13]]]],[],[[0,0,false,null,107493679080603,6,[[42,121,null,0,false,false,false,369818685197963,null,[[10,0],[8,2],[7,[13]]]]],[[-1,24,null,889011567730621,0,null,[[11,159870632320207],[7,[145,[2,42,false,0]]]]],[-1,92,null,663289848706052,0,null,[[6,"select"]]]]],[0,0,false,null,149255590193104,7,[[42,121,null,0,false,false,false,224964782097295,null,[[10,0],[8,0],[7,[13]]]]],[[3,124,null,255345572219742,0,null]]]]],[0,0,false,null,750507500622533,8,[[71,64,null,1,false,false,false,350639871383225,null,[[4,69]]],[88,113,null,0,false,true,false,748584247385193,null]],[[-1,24,null,547210054452433,0,null,[[11,159870632320207],[7,[1]]]],[-1,92,null,384450946717176,0,null,[[6,"jogo"]]]]],[0,0,false,null,690503307714512,9,[[71,64,null,1,false,false,false,598294279016791,null,[[4,89]]],[88,113,null,0,false,false,false,899349691309870,null]],[[-1,24,null,923574187152594,0,null,[[11,159870632320207],[7,[1]]]],[-1,92,null,935736405079670,0,null,[[6,"jogo"]]]]],[0,0,false,null,789718657948826,10,[[71,64,null,1,false,false,false,203524040756391,null,[[4,68]]],[88,113,null,0,false,true,false,244711274594671,null]],[[-1,24,null,760691829258992,0,null,[[11,159870632320207],[7,[12]]]],[-1,92,null,529060310712274,0,null,[[6,"jogo"]]]]],[0,0,false,null,142243082706353,11,[[71,64,null,1,false,false,false,602842763400170,null,[[4,67]]]],[[3,125,null,745100653549388,0,null,[[1,[146]],[1,[147]]]]]],[0,0,false,null,952353321536075,12,[[82,126,null,0,false,false,false,716687347756630,null,[[4,96]]]],[[82,127,null,939126165171886,0,null,[[3,1]]]]],[0,0,false,null,209023609994111,13,[[82,126,null,0,false,true,false,425739063245706,null,[[4,96]]]],[[82,127,null,666248845188293,0,null,[[3,0]]]]],[0,0,false,null,888925378319162,14,[[-1,35,null,0,false,false,false,559195811241920,null,[[0,[148]]]]],[[-1,95,null,212313070695989,0,null,[[4,83],[5,[1]],[0,[149,[1,82,128,false]]],[0,[149,[1,82,129,false]]],[16,false]]]]],[0,0,false,null,150132242467584,15,[[88,113,null,0,false,false,false,105045255867985,null]],[[69,112,null,351050099249924,0,null,[[3,0]]],[68,112,null,220511848102494,0,null,[[3,0]]]]],[0,0,false,null,547400088805244,16,[[88,113,null,0,false,true,false,967497430465566,null]],[[89,112,null,182715449524714,0,null,[[3,0]]]]]]],["select",[[2,"comum",false],[0,0,false,null,961853589990704,1,[[-1,23,null,1,false,false,false,808134298268198,null]],[[2,25,null,633706695791032,0,null,[[1,[150]],[13]]]],[[0,0,false,null,864359805289058,2,[[-1,32,null,0,false,false,false,742140311845221,null,[[11,159870632320207],[8,0],[7,[1]]]]],[[42,130,null,293137385155805,0,null,[[10,3],[3,1]]]]],[0,0,false,null,904520516207635,3,[[44,30,null,0,false,false,true,113521509366529,null,[[0,[151]]]]],[[44,31,null,385647249282287,0,null,[[7,[152]]]]]],[0,0,false,null,611833826384678,4,[[44,30,null,0,false,false,true,888467600769891,null,[[0,[153]]]]],[[44,31,null,159973138789967,0,null,[[7,[154]]]]]]]],[0,0,false,null,441841638926929,5,[[2,79,null,2,false,false,false,468813215534295,null,[[1,[150]]]]],[],[[0,0,false,null,995733886651513,6,[[43,86,null,0,false,false,false,713276274328874,null,[[8,0],[0,[12]]]]],[[43,43,null,939979430283619,0,null,[[0,[155,[4,131],[4,132],[2,42,false,0]]],[0,[99]]]]]],[0,0,false,null,356268622435278,7,[[41,133,null,0,false,false,true,929869933706255,null,[[0,[156]]]]],[[41,38,null,780320563394469,0,null,[[7,[157,[3,175591682901144]]]]]]],[0,0,false,null,671614000346100,8,[[-1,32,null,0,false,false,false,522081171769762,null,[[11,159870632320207],[8,0],[7,[12]]]]],[],[[0,0,false,null,906796744312271,9,[[43,86,null,0,false,false,false,645554353233548,null,[[8,0],[0,[1]]]]],[[43,43,null,759040751260375,0,null,[[0,[155,[4,131],[4,132],[2,42,false,1]]],[0,[99]]]]]],[0,0,false,null,438594957447382,10,[[41,133,null,0,false,false,true,769355000735355,null,[[0,[158]]]]],[[41,38,null,910342358519797,0,null,[[7,[159,[3,628998898533056]]]]]]]]]]],[0,0,false,null,261120500220199,11,[[0,65,null,1,false,false,false,867584700033637,null,[[9,65]]],[42,121,null,0,false,false,false,681874886137135,null,[[10,0],[8,4],[7,[12]]]],[42,134,null,0,false,true,false,537678614897977,null,[[10,2]]]],[[42,122,null,538093769504657,0,null,[[10,0],[7,[1]]]],[-1,24,null,816916264249178,0,null,[[11,175591682901144],[7,[160,[2,42,false,0]]]]],[2,25,null,886455447082838,0,null,[[1,[150]],[13]]]]],[0,0,false,null,828635776454948,12,[[0,65,null,1,false,false,false,397023726602251,null,[[9,68]]],[42,121,null,0,false,false,false,550214810743496,null,[[10,0],[8,2],[7,[94]]]],[42,134,null,0,false,true,false,999538036333589,null,[[10,2]]]],[[42,123,null,392635441903226,0,null,[[10,0],[7,[1]]]],[-1,24,null,286043664266196,0,null,[[11,175591682901144],[7,[160,[2,42,false,0]]]]],[2,25,null,733743687359109,0,null,[[1,[150]],[13]]]]],[0,0,false,null,479395747125237,13,[[0,65,null,1,false,false,false,256056781053735,null,[[9,89]]],[42,134,null,0,false,true,false,683501776615042,null,[[10,2]]]],[[42,130,null,658746963350856,0,null,[[10,2],[3,1]]]],[[0,0,false,null,919203251803246,14,[[43,135,null,0,false,false,true,176724660968873,null,[[0,[161]]]]],[[43,66,null,539303062774428,0,null,[[0,[13]]]]]],[0,0,false,null,420341172701864,15,[[42,134,null,0,false,false,false,271757680180276,null,[[10,3]]]],[],[[0,0,false,null,464991802619590,16,[[-1,32,null,0,false,false,false,232721148425144,null,[[11,159870632320207],[8,0],[7,[1]]]]],[],[[0,0,false,null,902915746651781,17,[[42,121,null,0,false,false,false,249609778811322,null,[[10,0],[8,0],[7,[12]]]]],[[-1,24,null,495079327977646,0,null,[[11,628998898533056],[7,[162,[4,77]]]]]]],[0,0,false,null,845500952834359,18,[[42,121,null,0,false,false,false,305726742823960,null,[[10,0],[8,0],[7,[1]]]]],[[-1,24,null,661797414704284,0,null,[[11,628998898533056],[7,[163,[4,77]]]]]]],[0,0,false,null,157061772692394,19,[[42,121,null,0,false,false,false,556000990138255,null,[[10,0],[8,0],[7,[13]]]]],[[-1,24,null,766200228375531,0,null,[[11,628998898533056],[7,[164,[4,77]]]]]]],[0,0,false,null,901430695308759,20,[[42,121,null,0,false,false,false,121175451007576,null,[[10,0],[8,0],[7,[94]]]]],[[-1,24,null,927681974167501,0,null,[[11,628998898533056],[7,[165,[4,77]]]]]]],[0,0,false,null,909957619218872,21,[],[[-1,34,null,672225295649982,2,null,[[0,[1]]]],[-1,92,null,266733911775175,0,null,[[6,"jogo"]]]]]]],[0,0,false,null,836533681848547,22,[[-1,54,null,0,false,false,false,310500482801708,null]],[[-1,34,null,692402719374948,2,null,[[0,[1]]]],[-1,92,null,354210684425791,0,null,[[6,"jogo"]]]]]]]]],[0,0,false,null,598318301294456,23,[[0,65,null,1,false,false,false,512216294717736,null,[[9,37]]],[42,121,null,0,false,false,false,803200677896789,null,[[10,1],[8,4],[7,[12]]]],[-1,32,null,0,false,false,false,590016572444059,null,[[11,159870632320207],[8,0],[7,[12]]]],[42,134,null,0,false,true,false,124191185746238,null,[[10,3]]]],[[42,122,null,285656243461184,0,null,[[10,1],[7,[1]]]],[-1,24,null,296434686553424,0,null,[[11,628998898533056],[7,[160,[2,42,false,1]]]]],[2,25,null,813397437020086,0,null,[[1,[150]],[13]]]]],[0,0,false,null,718852495327384,24,[[0,65,null,1,false,false,false,333603876010902,null,[[9,39]]],[42,121,null,0,false,false,false,174594988644860,null,[[10,1],[8,2],[7,[94]]]],[-1,32,null,0,false,false,false,373232173516254,null,[[11,159870632320207],[8,0],[7,[12]]]],[42,134,null,0,false,true,false,669449498513893,null,[[10,3]]]],[[42,123,null,799250613173522,0,null,[[10,1],[7,[1]]]],[-1,24,null,318950428258680,0,null,[[11,628998898533056],[7,[160,[2,42,false,1]]]]],[2,25,null,730835898231065,0,null,[[1,[150]],[13]]]]],[0,0,false,null,118506598857237,25,[[0,65,null,1,false,false,false,306165698264454,null,[[9,97]]],[-1,32,null,0,false,false,false,258960446163149,null,[[11,159870632320207],[8,0],[7,[12]]]],[42,134,null,0,false,true,false,155858452558850,null,[[10,3]]]],[[42,130,null,290044201833955,0,null,[[10,3],[3,1]]]],[[0,0,false,null,442701282352310,26,[[43,135,null,0,false,false,true,693090411234416,null,[[0,[166]]]]],[[43,66,null,909363960360525,0,null,[[0,[94]]]]]],[0,0,false,null,212290044172406,27,[[42,134,null,0,false,false,false,466186301358099,null,[[10,2]]]],[[-1,34,null,125049200214017,2,null,[[0,[1]]]],[-1,92,null,354268763211060,0,null,[[6,"jogo"]]]]]]]]],["Event sheet 1",[[0,0,false,null,962040439482652,1,[[-1,23,null,1,false,false,false,532993241491975,null]],[[1,71,null,887361037499651,0,null,[[2,["winnergongh",false]],[3,0],[0,[117]],[1,[47]]]],[-1,34,null,237594584359713,2,null,[[0,[1]]]],[1,71,null,297480725448017,0,null,[[2,["winner",false]],[3,0],[0,[12]],[1,[47]]]]]],[0,0,false,null,664181875098566,2,[[82,126,null,0,false,false,false,916529251329158,null,[[4,96]]]],[[82,127,null,391168511023125,0,null,[[3,1]]]]],[0,0,false,null,297072785611716,3,[[82,126,null,0,false,true,false,795736153583627,null,[[4,96]]]],[[82,127,null,507368808432241,0,null,[[3,0]]]]],[0,0,false,null,744261238954059,4,[[-1,35,null,0,false,false,false,572278240083177,null,[[0,[148]]]]],[[-1,95,null,927597472915279,0,null,[[4,83],[5,[1]],[0,[149,[1,82,128,false]]],[0,[149,[1,82,129,false]]],[16,false]]]]],[0,0,false,null,447045121921565,5,[[71,64,null,1,false,false,false,849689669236721,null,[[4,78]]]],[[-1,92,null,781990365793687,0,null,[[6,"Menu"]]]]],[0,0,false,null,521688698441509,6,[[71,64,null,1,false,false,false,236848026623944,null,[[4,67]]]],[[3,125,null,551236673990795,0,null,[[1,[146]],[1,[147]]]]]]]],["Event sheet 2",[[0,0,false,null,833315064942460,1,[[-1,23,null,1,false,false,false,761432680755447,null]],[[1,71,null,944891263073218,0,null,[[2,["winnergongh",false]],[3,0],[0,[117]],[1,[47]]]],[-1,34,null,964167469858848,2,null,[[0,[1]]]],[1,71,null,573350773602732,0,null,[[2,["winner",false]],[3,0],[0,[12]],[1,[47]]]]]],[0,0,false,null,186791623477035,2,[[82,126,null,0,false,false,false,924899834737672,null,[[4,96]]]],[[82,127,null,115396345760341,0,null,[[3,1]]]]],[0,0,false,null,136469987897288,3,[[82,126,null,0,false,true,false,108322686290661,null,[[4,96]]]],[[82,127,null,835880350323109,0,null,[[3,0]]]]],[0,0,false,null,584307892068591,4,[[-1,35,null,0,false,false,false,322656407834168,null,[[0,[148]]]]],[[-1,95,null,851812795900144,0,null,[[4,83],[5,[1]],[0,[149,[1,82,128,false]]],[0,[149,[1,82,129,false]]],[16,false]]]]],[0,0,false,null,813582122352807,5,[[71,64,null,1,false,false,false,518029398778121,null,[[4,78]]]],[[-1,92,null,960002857853964,0,null,[[6,"Menu"]]]]],[0,0,false,null,757363361327772,6,[[71,64,null,1,false,false,false,415132942782662,null,[[4,67]]]],[[3,125,null,482252919920018,0,null,[[1,[146]],[1,[147]]]]]]]],["Event sheet 3",[[0,0,false,null,734905919013922,1,[[-1,23,null,1,false,false,false,500116937543353,null]],[[85,100,null,292093686005902,0,null],[86,100,null,182709379303772,0,null],[85,66,null,197136464142044,0,null,[[0,[167,[4,99]]]]]]],[0,0,false,null,952292259268962,2,[[71,64,null,1,false,false,false,849713553485983,null,[[4,87]]]],[[87,68,null,318333631064509,0,null],[-1,34,null,401518259625082,2,null,[[0,[38]]]],[1,71,null,964941706797280,0,null,[[2,["bgm",false]],[3,1],[0,[12]],[1,[47]]]],[86,66,null,316730723754439,0,null,[[0,[1]]]],[1,71,null,730825563036697,0,null,[[2,["buttonnn",false]],[3,0],[0,[12]],[1,[168]]]],[85,66,null,825101344206451,0,null,[[0,[167,[4,99]]]]],[-1,34,null,762354650493654,2,null,[[0,[169]]]],[86,66,null,695465566755212,0,null,[[0,[13]]]],[1,71,null,287644831396380,0,null,[[2,["buttonnn",false]],[3,0],[0,[12]],[1,[168]]]],[85,66,null,212393128720340,0,null,[[0,[167,[4,99]]]]],[-1,34,null,902130042935796,2,null,[[0,[169]]]],[86,66,null,799055893635904,0,null,[[0,[94]]]],[1,71,null,924851934547275,0,null,[[2,["buttonnn",false]],[3,0],[0,[12]],[1,[168]]]],[85,66,null,354150821685648,0,null,[[0,[167,[4,99]]]]],[-1,34,null,314376966323546,2,null,[[0,[169]]]],[86,66,null,622696844655054,0,null,[[0,[0]]]],[1,71,null,129964963443064,0,null,[[2,["buttonnn",false]],[3,0],[0,[12]],[1,[168]]]],[85,66,null,631303010057632,0,null,[[0,[167,[4,99]]]]],[-1,34,null,777335825810684,2,null,[[0,[169]]]],[1,71,null,648000719394310,0,null,[[2,["twpsound",false]],[3,0],[0,[12]],[1,[168]]]],[-1,34,null,367407565940281,2,null,[[0,[13]]]],[-1,34,null,336094854297936,2,null,[[0,[1]]]],[-1,92,null,979126237597414,0,null,[[6,"Menu"]]]]]]]],[["chute",[["audio/ogg; codecs=vorbis",".ogg",8443],["audio/mp4",".m4a",9139]],false],["defesa1",[["audio/ogg; codecs=vorbis",".ogg",6119],["audio/mp4",".m4a",5707]],false],["defesa2",[["audio/ogg; codecs=vorbis",".ogg",5541],["audio/mp4",".m4a",5801]],false],["morte",[["audio/ogg; codecs=vorbis",".ogg",7856],["audio/mp4",".m4a",6929]],false],["soco",[["audio/ogg; codecs=vorbis",".ogg",7102],["audio/mp4",".m4a",7092]],false],["chutevento",[["audio/ogg; codecs=vorbis",".ogg",5011],["audio/mp4",".m4a",5188]],false],["socovento",[["audio/ogg; codecs=vorbis",".ogg",6154],["audio/mp4",".m4a",6294]],false],["equip-unlock",[["audio/ogg; codecs=vorbis",".ogg",38057],["audio/mp4",".m4a",38808]],false],["extra-life",[["audio/ogg; codecs=vorbis",".ogg",18761],["audio/mp4",".m4a",25801]],false],["game-start",[["audio/ogg; codecs=vorbis",".ogg",32644],["audio/mp4",".m4a",33660]],false],["game-over",[["audio/ogg; codecs=vorbis",".ogg",35007],["audio/mp4",".m4a",50867]],false],["new-best-score",[["audio/ogg; codecs=vorbis",".ogg",18964],["audio/mp4",".m4a",16864]],false],["powerup_17",[["audio/ogg; codecs=vorbis",".ogg",8620],["audio/mp4",".m4a",4458]],false],["theend",[["audio/ogg; codecs=vorbis",".ogg",27376],["audio/mp4",".m4a",21213]],false],["winnergongh",[["audio/ogg; codecs=vorbis",".ogg",283721],["audio/mp4",".m4a",81224]],false],["punch1",[["audio/webm; codecs=opus",".webm",5886]],false],["punch9",[["audio/webm; codecs=opus",".webm",6322]],false],["punch8",[["audio/webm; codecs=opus",".webm",4832]],false],["punch7",[["audio/webm; codecs=opus",".webm",4832]],false],["punch6",[["audio/webm; codecs=opus",".webm",6199]],false],["punch5",[["audio/webm; codecs=opus",".webm",5840]],false],["punch4",[["audio/webm; codecs=opus",".webm",5466]],false],["punch3",[["audio/webm; codecs=opus",".webm",5479]],false],["punch2",[["audio/webm; codecs=opus",".webm",5698]],false],["punch12",[["audio/webm; codecs=opus",".webm",4380]],false],["punch11",[["audio/webm; codecs=opus",".webm",5548]],false],["punch10",[["audio/webm; codecs=opus",".webm",4781]],false],["finishim",[["audio/webm; codecs=opus",".webm",15401]],false],["final",[["audio/webm; codecs=opus",".webm",20859]],false],["fight",[["audio/webm; codecs=opus",".webm",11864]],false],["jump1",[["audio/webm; codecs=opus",".webm",3945]],false],["jump2",[["audio/webm; codecs=opus",".webm",4626]],false],["jump3",[["audio/webm; codecs=opus",".webm",4023]],false],["jump4",[["audio/webm; codecs=opus",".webm",3503]],false],["jump5",[["audio/webm; codecs=opus",".webm",3237]],false],["one",[["audio/webm; codecs=opus",".webm",12782]],false],["two",[["audio/webm; codecs=opus",".webm",14893]],false],["twpsound",[["audio/mp4",".m4a",34364]],false],["winner",[["audio/webm; codecs=opus",".webm",15478]],false],["winsound",[["audio/webm; codecs=opus",".webm",27749]],false],["youlose",[["audio/webm; codecs=opus",".webm",20190]],false],["youwin",[["audio/webm; codecs=opus",".webm",17562]],false],["attack1",[["audio/webm; codecs=opus",".webm",9755]],false],["attack4",[["audio/webm; codecs=opus",".webm",5251]],false],["attack3",[["audio/webm; codecs=opus",".webm",2848]],false],["attack2",[["audio/webm; codecs=opus",".webm",3192]],false],["new-best-score2",[["audio/ogg; codecs=vorbis",".ogg",18964],["audio/mp4",".m4a",16864]],false],["buttoon",[["audio/webm; codecs=opus",".webm",1713]],false],["buttonnn",[["audio/mp4",".m4a",11987]],false],["offlimits",[["audio/ogg; codecs=vorbis",".ogg",347587],["audio/mp4",".m4a",391273]],false],["bgm",[["audio/ogg; codecs=vorbis",".ogg",300472],["audio/mp4",".m4a",451563]],false]],"media/",false,420,244,4,true,"nearest",false,"0.44",true,false,0,0,128,false,true,1,true,false,[],"icons/",[],true,"91uz14vkkmz","fonts/",[],"high-performance",[],"standard","vsync","com.chronosgames.streetfighter","loading-logo.png"]} \ No newline at end of file diff --git a/games/shadow-fight/icons/icon-256.png b/games/shadow-fight/icons/icon-256.png new file mode 100644 index 00000000..5de38745 Binary files /dev/null and b/games/shadow-fight/icons/icon-256.png differ diff --git a/games/shadow-fight/icons/loading-logo.png b/games/shadow-fight/icons/loading-logo.png new file mode 100644 index 00000000..90a32c82 Binary files /dev/null and b/games/shadow-fight/icons/loading-logo.png differ diff --git a/games/shadow-fight/images/colisorchao-sheet0.png b/games/shadow-fight/images/colisorchao-sheet0.png new file mode 100644 index 00000000..c6b83449 Binary files /dev/null and b/games/shadow-fight/images/colisorchao-sheet0.png differ diff --git a/games/shadow-fight/images/game_bg-sheet0.png b/games/shadow-fight/images/game_bg-sheet0.png new file mode 100644 index 00000000..a6ec7044 Binary files /dev/null and b/games/shadow-fight/images/game_bg-sheet0.png differ diff --git a/games/shadow-fight/images/game_bg-sheet1.png b/games/shadow-fight/images/game_bg-sheet1.png new file mode 100644 index 00000000..aad89480 Binary files /dev/null and b/games/shadow-fight/images/game_bg-sheet1.png differ diff --git a/games/shadow-fight/images/menufundo-sheet0.png b/games/shadow-fight/images/menufundo-sheet0.png new file mode 100644 index 00000000..2797c1c9 Binary files /dev/null and b/games/shadow-fight/images/menufundo-sheet0.png differ diff --git a/games/shadow-fight/images/p1char1-sheet0.png b/games/shadow-fight/images/p1char1-sheet0.png new file mode 100644 index 00000000..5392df8c Binary files /dev/null and b/games/shadow-fight/images/p1char1-sheet0.png differ diff --git a/games/shadow-fight/images/p1char1-sheet1.png b/games/shadow-fight/images/p1char1-sheet1.png new file mode 100644 index 00000000..c6fc22b5 Binary files /dev/null and b/games/shadow-fight/images/p1char1-sheet1.png differ diff --git a/games/shadow-fight/images/p1char1-sheet2.png b/games/shadow-fight/images/p1char1-sheet2.png new file mode 100644 index 00000000..90bd98b0 Binary files /dev/null and b/games/shadow-fight/images/p1char1-sheet2.png differ diff --git a/games/shadow-fight/images/p2char1-sheet0.png b/games/shadow-fight/images/p2char1-sheet0.png new file mode 100644 index 00000000..56562687 Binary files /dev/null and b/games/shadow-fight/images/p2char1-sheet0.png differ diff --git a/games/shadow-fight/images/p2char1-sheet1.png b/games/shadow-fight/images/p2char1-sheet1.png new file mode 100644 index 00000000..e4e14a99 Binary files /dev/null and b/games/shadow-fight/images/p2char1-sheet1.png differ diff --git a/games/shadow-fight/images/p2char1-sheet2.png b/games/shadow-fight/images/p2char1-sheet2.png new file mode 100644 index 00000000..8f41cbc6 Binary files /dev/null and b/games/shadow-fight/images/p2char1-sheet2.png differ diff --git a/games/shadow-fight/images/p2char3-sheet0.png b/games/shadow-fight/images/p2char3-sheet0.png new file mode 100644 index 00000000..35d4670c Binary files /dev/null and b/games/shadow-fight/images/p2char3-sheet0.png differ diff --git a/games/shadow-fight/images/p2char3-sheet1.png b/games/shadow-fight/images/p2char3-sheet1.png new file mode 100644 index 00000000..13549873 Binary files /dev/null and b/games/shadow-fight/images/p2char3-sheet1.png differ diff --git a/games/shadow-fight/images/p2char3-sheet2.png b/games/shadow-fight/images/p2char3-sheet2.png new file mode 100644 index 00000000..aff36be7 Binary files /dev/null and b/games/shadow-fight/images/p2char3-sheet2.png differ diff --git a/games/shadow-fight/images/shared-0-sheet0.png b/games/shadow-fight/images/shared-0-sheet0.png new file mode 100644 index 00000000..27fb76cf Binary files /dev/null and b/games/shadow-fight/images/shared-0-sheet0.png differ diff --git a/games/shadow-fight/images/shared-0-sheet1.png b/games/shadow-fight/images/shared-0-sheet1.png new file mode 100644 index 00000000..15086c6a Binary files /dev/null and b/games/shadow-fight/images/shared-0-sheet1.png differ diff --git a/games/shadow-fight/images/shared-0-sheet2.png b/games/shadow-fight/images/shared-0-sheet2.png new file mode 100644 index 00000000..f57e4fe7 Binary files /dev/null and b/games/shadow-fight/images/shared-0-sheet2.png differ diff --git a/games/shadow-fight/images/shared-0-sheet3.png b/games/shadow-fight/images/shared-0-sheet3.png new file mode 100644 index 00000000..bb616fe2 Binary files /dev/null and b/games/shadow-fight/images/shared-0-sheet3.png differ diff --git a/games/shadow-fight/images/shared-0-sheet4.png b/games/shadow-fight/images/shared-0-sheet4.png new file mode 100644 index 00000000..bc67d2e3 Binary files /dev/null and b/games/shadow-fight/images/shared-0-sheet4.png differ diff --git a/games/shadow-fight/images/shared-0-sheet5.png b/games/shadow-fight/images/shared-0-sheet5.png new file mode 100644 index 00000000..4f658a87 Binary files /dev/null and b/games/shadow-fight/images/shared-0-sheet5.png differ diff --git a/games/shadow-fight/images/shared-0-sheet6.png b/games/shadow-fight/images/shared-0-sheet6.png new file mode 100644 index 00000000..bbedcd4c Binary files /dev/null and b/games/shadow-fight/images/shared-0-sheet6.png differ diff --git a/games/shadow-fight/images/shared-0-sheet7.png b/games/shadow-fight/images/shared-0-sheet7.png new file mode 100644 index 00000000..de84b40b Binary files /dev/null and b/games/shadow-fight/images/shared-0-sheet7.png differ diff --git a/games/shadow-fight/images/shared-1-sheet0.png b/games/shadow-fight/images/shared-1-sheet0.png new file mode 100644 index 00000000..3bccf31b Binary files /dev/null and b/games/shadow-fight/images/shared-1-sheet0.png differ diff --git a/games/shadow-fight/images/tiledbackground-sheet0.png b/games/shadow-fight/images/tiledbackground-sheet0.png new file mode 100644 index 00000000..1db19cf2 Binary files /dev/null and b/games/shadow-fight/images/tiledbackground-sheet0.png differ diff --git a/games/shadow-fight/images/tiledbackground2-sheet0.png b/games/shadow-fight/images/tiledbackground2-sheet0.png new file mode 100644 index 00000000..0aae2fef Binary files /dev/null and b/games/shadow-fight/images/tiledbackground2-sheet0.png differ diff --git a/games/shadow-fight/images/zem-sheet0.png b/games/shadow-fight/images/zem-sheet0.png new file mode 100644 index 00000000..c37e3fa8 Binary files /dev/null and b/games/shadow-fight/images/zem-sheet0.png differ diff --git a/games/shadow-fight/index.html b/games/shadow-fight/index.html new file mode 100644 index 00000000..3ed420f0 --- /dev/null +++ b/games/shadow-fight/index.html @@ -0,0 +1,33 @@ + + + + +Shadow_Fight_TWP + + + + + + + + + + + + + + +
+ + + + + + + + \ No newline at end of file diff --git a/games/shadow-fight/media/attack1.webm b/games/shadow-fight/media/attack1.webm new file mode 100644 index 00000000..0f9e8265 Binary files /dev/null and b/games/shadow-fight/media/attack1.webm differ diff --git a/games/shadow-fight/media/attack2.webm b/games/shadow-fight/media/attack2.webm new file mode 100644 index 00000000..b9786f83 Binary files /dev/null and b/games/shadow-fight/media/attack2.webm differ diff --git a/games/shadow-fight/media/attack3.webm b/games/shadow-fight/media/attack3.webm new file mode 100644 index 00000000..c54fca99 Binary files /dev/null and b/games/shadow-fight/media/attack3.webm differ diff --git a/games/shadow-fight/media/attack4.webm b/games/shadow-fight/media/attack4.webm new file mode 100644 index 00000000..c643c412 Binary files /dev/null and b/games/shadow-fight/media/attack4.webm differ diff --git a/games/shadow-fight/media/bgm.ogg b/games/shadow-fight/media/bgm.ogg new file mode 100644 index 00000000..51f7c0f1 Binary files /dev/null and b/games/shadow-fight/media/bgm.ogg differ diff --git a/games/shadow-fight/media/buttonnn.m4a b/games/shadow-fight/media/buttonnn.m4a new file mode 100644 index 00000000..8e24189b Binary files /dev/null and b/games/shadow-fight/media/buttonnn.m4a differ diff --git a/games/shadow-fight/media/buttoon.webm b/games/shadow-fight/media/buttoon.webm new file mode 100644 index 00000000..d432345f Binary files /dev/null and b/games/shadow-fight/media/buttoon.webm differ diff --git a/games/shadow-fight/media/chute.ogg b/games/shadow-fight/media/chute.ogg new file mode 100644 index 00000000..7addc725 Binary files /dev/null and b/games/shadow-fight/media/chute.ogg differ diff --git a/games/shadow-fight/media/chutevento.ogg b/games/shadow-fight/media/chutevento.ogg new file mode 100644 index 00000000..b72eb1f1 Binary files /dev/null and b/games/shadow-fight/media/chutevento.ogg differ diff --git a/games/shadow-fight/media/defesa1.ogg b/games/shadow-fight/media/defesa1.ogg new file mode 100644 index 00000000..2319bb63 Binary files /dev/null and b/games/shadow-fight/media/defesa1.ogg differ diff --git a/games/shadow-fight/media/defesa2.ogg b/games/shadow-fight/media/defesa2.ogg new file mode 100644 index 00000000..629a496c Binary files /dev/null and b/games/shadow-fight/media/defesa2.ogg differ diff --git a/games/shadow-fight/media/equip-unlock.ogg b/games/shadow-fight/media/equip-unlock.ogg new file mode 100644 index 00000000..da896fca Binary files /dev/null and b/games/shadow-fight/media/equip-unlock.ogg differ diff --git a/games/shadow-fight/media/extra-life.ogg b/games/shadow-fight/media/extra-life.ogg new file mode 100644 index 00000000..a5c5dfa3 Binary files /dev/null and b/games/shadow-fight/media/extra-life.ogg differ diff --git a/games/shadow-fight/media/fight.webm b/games/shadow-fight/media/fight.webm new file mode 100644 index 00000000..e06b1b78 Binary files /dev/null and b/games/shadow-fight/media/fight.webm differ diff --git a/games/shadow-fight/media/final.webm b/games/shadow-fight/media/final.webm new file mode 100644 index 00000000..45bc071b Binary files /dev/null and b/games/shadow-fight/media/final.webm differ diff --git a/games/shadow-fight/media/finishim.webm b/games/shadow-fight/media/finishim.webm new file mode 100644 index 00000000..51aea3a0 Binary files /dev/null and b/games/shadow-fight/media/finishim.webm differ diff --git a/games/shadow-fight/media/game-over.ogg b/games/shadow-fight/media/game-over.ogg new file mode 100644 index 00000000..52f3b05a Binary files /dev/null and b/games/shadow-fight/media/game-over.ogg differ diff --git a/games/shadow-fight/media/game-start.ogg b/games/shadow-fight/media/game-start.ogg new file mode 100644 index 00000000..7d593a65 Binary files /dev/null and b/games/shadow-fight/media/game-start.ogg differ diff --git a/games/shadow-fight/media/jump1.webm b/games/shadow-fight/media/jump1.webm new file mode 100644 index 00000000..3e936566 Binary files /dev/null and b/games/shadow-fight/media/jump1.webm differ diff --git a/games/shadow-fight/media/jump2.webm b/games/shadow-fight/media/jump2.webm new file mode 100644 index 00000000..26fa0630 Binary files /dev/null and b/games/shadow-fight/media/jump2.webm differ diff --git a/games/shadow-fight/media/jump3.webm b/games/shadow-fight/media/jump3.webm new file mode 100644 index 00000000..76c7e703 Binary files /dev/null and b/games/shadow-fight/media/jump3.webm differ diff --git a/games/shadow-fight/media/jump4.webm b/games/shadow-fight/media/jump4.webm new file mode 100644 index 00000000..970ab31b Binary files /dev/null and b/games/shadow-fight/media/jump4.webm differ diff --git a/games/shadow-fight/media/jump5.webm b/games/shadow-fight/media/jump5.webm new file mode 100644 index 00000000..e58f5dd6 Binary files /dev/null and b/games/shadow-fight/media/jump5.webm differ diff --git a/games/shadow-fight/media/morte.ogg b/games/shadow-fight/media/morte.ogg new file mode 100644 index 00000000..e7cea93e Binary files /dev/null and b/games/shadow-fight/media/morte.ogg differ diff --git a/games/shadow-fight/media/new-best-score.ogg b/games/shadow-fight/media/new-best-score.ogg new file mode 100644 index 00000000..92ea031d Binary files /dev/null and b/games/shadow-fight/media/new-best-score.ogg differ diff --git a/games/shadow-fight/media/new-best-score2.ogg b/games/shadow-fight/media/new-best-score2.ogg new file mode 100644 index 00000000..92ea031d Binary files /dev/null and b/games/shadow-fight/media/new-best-score2.ogg differ diff --git a/games/shadow-fight/media/offlimits.ogg b/games/shadow-fight/media/offlimits.ogg new file mode 100644 index 00000000..6ab03a48 Binary files /dev/null and b/games/shadow-fight/media/offlimits.ogg differ diff --git a/games/shadow-fight/media/one.webm b/games/shadow-fight/media/one.webm new file mode 100644 index 00000000..644b444b Binary files /dev/null and b/games/shadow-fight/media/one.webm differ diff --git a/games/shadow-fight/media/powerup_17.ogg b/games/shadow-fight/media/powerup_17.ogg new file mode 100644 index 00000000..9294741b Binary files /dev/null and b/games/shadow-fight/media/powerup_17.ogg differ diff --git a/games/shadow-fight/media/punch1.webm b/games/shadow-fight/media/punch1.webm new file mode 100644 index 00000000..d371654a Binary files /dev/null and b/games/shadow-fight/media/punch1.webm differ diff --git a/games/shadow-fight/media/punch10.webm b/games/shadow-fight/media/punch10.webm new file mode 100644 index 00000000..a23e29a2 Binary files /dev/null and b/games/shadow-fight/media/punch10.webm differ diff --git a/games/shadow-fight/media/punch11.webm b/games/shadow-fight/media/punch11.webm new file mode 100644 index 00000000..c3a6e69e Binary files /dev/null and b/games/shadow-fight/media/punch11.webm differ diff --git a/games/shadow-fight/media/punch12.webm b/games/shadow-fight/media/punch12.webm new file mode 100644 index 00000000..8c22eb00 Binary files /dev/null and b/games/shadow-fight/media/punch12.webm differ diff --git a/games/shadow-fight/media/punch2.webm b/games/shadow-fight/media/punch2.webm new file mode 100644 index 00000000..db858c51 Binary files /dev/null and b/games/shadow-fight/media/punch2.webm differ diff --git a/games/shadow-fight/media/punch3.webm b/games/shadow-fight/media/punch3.webm new file mode 100644 index 00000000..2dd4a9bd Binary files /dev/null and b/games/shadow-fight/media/punch3.webm differ diff --git a/games/shadow-fight/media/punch4.webm b/games/shadow-fight/media/punch4.webm new file mode 100644 index 00000000..2f62ba82 Binary files /dev/null and b/games/shadow-fight/media/punch4.webm differ diff --git a/games/shadow-fight/media/punch5.webm b/games/shadow-fight/media/punch5.webm new file mode 100644 index 00000000..b80572ab Binary files /dev/null and b/games/shadow-fight/media/punch5.webm differ diff --git a/games/shadow-fight/media/punch6.webm b/games/shadow-fight/media/punch6.webm new file mode 100644 index 00000000..e2dbe85b Binary files /dev/null and b/games/shadow-fight/media/punch6.webm differ diff --git a/games/shadow-fight/media/punch7.webm b/games/shadow-fight/media/punch7.webm new file mode 100644 index 00000000..3e683b5e Binary files /dev/null and b/games/shadow-fight/media/punch7.webm differ diff --git a/games/shadow-fight/media/punch8.webm b/games/shadow-fight/media/punch8.webm new file mode 100644 index 00000000..3e683b5e Binary files /dev/null and b/games/shadow-fight/media/punch8.webm differ diff --git a/games/shadow-fight/media/punch9.webm b/games/shadow-fight/media/punch9.webm new file mode 100644 index 00000000..2b1db7c8 Binary files /dev/null and b/games/shadow-fight/media/punch9.webm differ diff --git a/games/shadow-fight/media/soco.ogg b/games/shadow-fight/media/soco.ogg new file mode 100644 index 00000000..0797005a Binary files /dev/null and b/games/shadow-fight/media/soco.ogg differ diff --git a/games/shadow-fight/media/socovento.ogg b/games/shadow-fight/media/socovento.ogg new file mode 100644 index 00000000..17c8b77b Binary files /dev/null and b/games/shadow-fight/media/socovento.ogg differ diff --git a/games/shadow-fight/media/theend.ogg b/games/shadow-fight/media/theend.ogg new file mode 100644 index 00000000..6493089d Binary files /dev/null and b/games/shadow-fight/media/theend.ogg differ diff --git a/games/shadow-fight/media/two.webm b/games/shadow-fight/media/two.webm new file mode 100644 index 00000000..bb036a62 Binary files /dev/null and b/games/shadow-fight/media/two.webm differ diff --git a/games/shadow-fight/media/twpsound.m4a b/games/shadow-fight/media/twpsound.m4a new file mode 100644 index 00000000..534495fb Binary files /dev/null and b/games/shadow-fight/media/twpsound.m4a differ diff --git a/games/shadow-fight/media/winner.webm b/games/shadow-fight/media/winner.webm new file mode 100644 index 00000000..4bc08522 Binary files /dev/null and b/games/shadow-fight/media/winner.webm differ diff --git a/games/shadow-fight/media/winnergongh.ogg b/games/shadow-fight/media/winnergongh.ogg new file mode 100644 index 00000000..060cc714 Binary files /dev/null and b/games/shadow-fight/media/winnergongh.ogg differ diff --git a/games/shadow-fight/media/winsound.webm b/games/shadow-fight/media/winsound.webm new file mode 100644 index 00000000..0970c153 Binary files /dev/null and b/games/shadow-fight/media/winsound.webm differ diff --git a/games/shadow-fight/media/youlose.webm b/games/shadow-fight/media/youlose.webm new file mode 100644 index 00000000..3513a023 Binary files /dev/null and b/games/shadow-fight/media/youlose.webm differ diff --git a/games/shadow-fight/media/youwin.webm b/games/shadow-fight/media/youwin.webm new file mode 100644 index 00000000..a97e5c15 Binary files /dev/null and b/games/shadow-fight/media/youwin.webm differ diff --git a/games/shadow-fight/offline.json b/games/shadow-fight/offline.json new file mode 100644 index 00000000..569fb7ae --- /dev/null +++ b/games/shadow-fight/offline.json @@ -0,0 +1 @@ +{"version":1615580323622,"fileList":["box2d.wasm.js","box2d.wasm","scripts/c3runtime.js","data.json","style.css","scripts/offlineclient.js","images/shared-1-sheet0.png","images/colisorchao-sheet0.png","images/tiledbackground-sheet0.png","images/tiledbackground2-sheet0.png","images/p1char1-sheet0.png","images/p1char1-sheet1.png","images/p1char1-sheet2.png","images/p2char3-sheet0.png","images/p2char3-sheet1.png","images/p2char3-sheet2.png","images/p2char1-sheet0.png","images/p2char1-sheet1.png","images/p2char1-sheet2.png","images/menufundo-sheet0.png","images/zem-sheet0.png","images/game_bg-sheet0.png","images/game_bg-sheet1.png","images/shared-0-sheet0.png","images/shared-0-sheet1.png","images/shared-0-sheet3.png","images/shared-0-sheet6.png","images/shared-0-sheet7.png","images/shared-0-sheet4.png","images/shared-0-sheet5.png","images/shared-0-sheet2.png","scripts/opus.wasm.js","scripts/opus.wasm.wasm","scripts/main.js","workermain.js","scripts/dispatchworker.js","scripts/jobworker.js","scripts/supportcheck.js","media/chute.ogg","media/chute.m4a","media/defesa1.ogg","media/defesa1.m4a","media/defesa2.ogg","media/defesa2.m4a","media/morte.ogg","media/morte.m4a","media/soco.ogg","media/soco.m4a","media/chutevento.ogg","media/chutevento.m4a","media/socovento.ogg","media/socovento.m4a","media/equip-unlock.ogg","media/equip-unlock.m4a","media/extra-life.ogg","media/extra-life.m4a","media/game-start.ogg","media/game-start.m4a","media/game-over.ogg","media/game-over.m4a","media/new-best-score.ogg","media/new-best-score.m4a","media/powerup_17.ogg","media/powerup_17.m4a","media/theend.ogg","media/theend.m4a","media/winnergongh.ogg","media/winnergongh.m4a","media/punch1.webm","media/punch9.webm","media/punch8.webm","media/punch7.webm","media/punch6.webm","media/punch5.webm","media/punch4.webm","media/punch3.webm","media/punch2.webm","media/punch12.webm","media/punch11.webm","media/punch10.webm","media/finishim.webm","media/final.webm","media/fight.webm","media/jump1.webm","media/jump2.webm","media/jump3.webm","media/jump4.webm","media/jump5.webm","media/one.webm","media/two.webm","media/twpsound.m4a","media/winner.webm","media/winsound.webm","media/youlose.webm","media/youwin.webm","media/attack1.webm","media/attack4.webm","media/attack3.webm","media/attack2.webm","media/new-best-score2.ogg","media/new-best-score2.m4a","media/buttoon.webm","media/buttonnn.m4a","media/offlimits.ogg","media/offlimits.m4a","media/bgm.ogg","media/bgm.m4a","icons/icon-16.png","icons/icon-32.png","icons/loading-logo.png","icons/icon-114.png","icons/icon-128.png","icons/icon-256.png","scripts/register-sw.js"]} \ No newline at end of file diff --git a/games/shadow-fight/scripts/c3runtime.js b/games/shadow-fight/scripts/c3runtime.js new file mode 100644 index 00000000..56bb74e4 --- /dev/null +++ b/games/shadow-fight/scripts/c3runtime.js @@ -0,0 +1,4816 @@ +// Generated by Construct 3, the game and app creator :: https://www.construct.net +// ../3rdparty/glmatrix.js +/* + @fileoverview gl-matrix - High performance matrix and vector operations +@author Brandon Jones +@author Colin MacKenzie IV +@version 3.3.0 + +Copyright (c) 2015-2020, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +*/ +'use strict';(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):(global=global||self,factory(global.glMatrix={}))})(this,function(exports){var EPSILON=1E-6;var ARRAY_TYPE=typeof Float32Array!=="undefined"?Float32Array:Array;var RANDOM=Math.random;function setMatrixArrayType(type){ARRAY_TYPE=type}var degree=Math.PI/180;function toRadian(a){return a*degree}function equals(a,b){return Math.abs(a- +b)<=EPSILON*Math.max(1,Math.abs(a),Math.abs(b))}if(!Math.hypot)Math.hypot=function(){var y=0,i=arguments.length;while(i--)y+=arguments[i]*arguments[i];return Math.sqrt(y)};var common=Object.freeze({__proto__:null,EPSILON:EPSILON,get ARRAY_TYPE(){return ARRAY_TYPE},RANDOM:RANDOM,setMatrixArrayType:setMatrixArrayType,toRadian:toRadian,equals:equals});function create(){var out=new ARRAY_TYPE(4);if(ARRAY_TYPE!=Float32Array){out[1]=0;out[2]=0}out[0]=1;out[3]=1;return out}function clone(a){var out=new ARRAY_TYPE(4); +out[0]=a[0];out[1]=a[1];out[2]=a[2];out[3]=a[3];return out}function copy(out,a){out[0]=a[0];out[1]=a[1];out[2]=a[2];out[3]=a[3];return out}function identity(out){out[0]=1;out[1]=0;out[2]=0;out[3]=1;return out}function fromValues(m00,m01,m10,m11){var out=new ARRAY_TYPE(4);out[0]=m00;out[1]=m01;out[2]=m10;out[3]=m11;return out}function set(out,m00,m01,m10,m11){out[0]=m00;out[1]=m01;out[2]=m10;out[3]=m11;return out}function transpose(out,a){if(out===a){var a1=a[1];out[1]=a[2];out[2]=a1}else{out[0]=a[0]; +out[1]=a[2];out[2]=a[1];out[3]=a[3]}return out}function invert(out,a){var a0=a[0],a1=a[1],a2=a[2],a3=a[3];var det=a0*a3-a2*a1;if(!det)return null;det=1/det;out[0]=a3*det;out[1]=-a1*det;out[2]=-a2*det;out[3]=a0*det;return out}function adjoint(out,a){var a0=a[0];out[0]=a[3];out[1]=-a[1];out[2]=-a[2];out[3]=a0;return out}function determinant(a){return a[0]*a[3]-a[2]*a[1]}function multiply(out,a,b){var a0=a[0],a1=a[1],a2=a[2],a3=a[3];var b0=b[0],b1=b[1],b2=b[2],b3=b[3];out[0]=a0*b0+a2*b1;out[1]=a1*b0+ +a3*b1;out[2]=a0*b2+a2*b3;out[3]=a1*b2+a3*b3;return out}function rotate(out,a,rad){var a0=a[0],a1=a[1],a2=a[2],a3=a[3];var s=Math.sin(rad);var c=Math.cos(rad);out[0]=a0*c+a2*s;out[1]=a1*c+a3*s;out[2]=a0*-s+a2*c;out[3]=a1*-s+a3*c;return out}function scale(out,a,v){var a0=a[0],a1=a[1],a2=a[2],a3=a[3];var v0=v[0],v1=v[1];out[0]=a0*v0;out[1]=a1*v0;out[2]=a2*v1;out[3]=a3*v1;return out}function fromRotation(out,rad){var s=Math.sin(rad);var c=Math.cos(rad);out[0]=c;out[1]=s;out[2]=-s;out[3]=c;return out} +function fromScaling(out,v){out[0]=v[0];out[1]=0;out[2]=0;out[3]=v[1];return out}function str(a){return"mat2("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"}function frob(a){return Math.hypot(a[0],a[1],a[2],a[3])}function LDU(L,D,U,a){L[2]=a[2]/a[0];U[0]=a[0];U[1]=a[1];U[3]=a[3]-L[2]*U[1];return[L,D,U]}function add(out,a,b){out[0]=a[0]+b[0];out[1]=a[1]+b[1];out[2]=a[2]+b[2];out[3]=a[3]+b[3];return out}function subtract(out,a,b){out[0]=a[0]-b[0];out[1]=a[1]-b[1];out[2]=a[2]-b[2];out[3]=a[3]-b[3];return out} +function exactEquals(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]}function equals$1(a,b){var a0=a[0],a1=a[1],a2=a[2],a3=a[3];var b0=b[0],b1=b[1],b2=b[2],b3=b[3];return Math.abs(a0-b0)<=EPSILON*Math.max(1,Math.abs(a0),Math.abs(b0))&&Math.abs(a1-b1)<=EPSILON*Math.max(1,Math.abs(a1),Math.abs(b1))&&Math.abs(a2-b2)<=EPSILON*Math.max(1,Math.abs(a2),Math.abs(b2))&&Math.abs(a3-b3)<=EPSILON*Math.max(1,Math.abs(a3),Math.abs(b3))}function multiplyScalar(out,a,b){out[0]=a[0]*b;out[1]=a[1]*b; +out[2]=a[2]*b;out[3]=a[3]*b;return out}function multiplyScalarAndAdd(out,a,b,scale){out[0]=a[0]+b[0]*scale;out[1]=a[1]+b[1]*scale;out[2]=a[2]+b[2]*scale;out[3]=a[3]+b[3]*scale;return out}var mul=multiply;var sub=subtract;var mat2=Object.freeze({__proto__:null,create:create,clone:clone,copy:copy,identity:identity,fromValues:fromValues,set:set,transpose:transpose,invert:invert,adjoint:adjoint,determinant:determinant,multiply:multiply,rotate:rotate,scale:scale,fromRotation:fromRotation,fromScaling:fromScaling, +str:str,frob:frob,LDU:LDU,add:add,subtract:subtract,exactEquals:exactEquals,equals:equals$1,multiplyScalar:multiplyScalar,multiplyScalarAndAdd:multiplyScalarAndAdd,mul:mul,sub:sub});function create$1(){var out=new ARRAY_TYPE(6);if(ARRAY_TYPE!=Float32Array){out[1]=0;out[2]=0;out[4]=0;out[5]=0}out[0]=1;out[3]=1;return out}function clone$1(a){var out=new ARRAY_TYPE(6);out[0]=a[0];out[1]=a[1];out[2]=a[2];out[3]=a[3];out[4]=a[4];out[5]=a[5];return out}function copy$1(out,a){out[0]=a[0];out[1]=a[1];out[2]= +a[2];out[3]=a[3];out[4]=a[4];out[5]=a[5];return out}function identity$1(out){out[0]=1;out[1]=0;out[2]=0;out[3]=1;out[4]=0;out[5]=0;return out}function fromValues$1(a,b,c,d,tx,ty){var out=new ARRAY_TYPE(6);out[0]=a;out[1]=b;out[2]=c;out[3]=d;out[4]=tx;out[5]=ty;return out}function set$1(out,a,b,c,d,tx,ty){out[0]=a;out[1]=b;out[2]=c;out[3]=d;out[4]=tx;out[5]=ty;return out}function invert$1(out,a){var aa=a[0],ab=a[1],ac=a[2],ad=a[3];var atx=a[4],aty=a[5];var det=aa*ad-ab*ac;if(!det)return null;det=1/ +det;out[0]=ad*det;out[1]=-ab*det;out[2]=-ac*det;out[3]=aa*det;out[4]=(ac*aty-ad*atx)*det;out[5]=(ab*atx-aa*aty)*det;return out}function determinant$1(a){return a[0]*a[3]-a[1]*a[2]}function multiply$1(out,a,b){var a0=a[0],a1=a[1],a2=a[2],a3=a[3],a4=a[4],a5=a[5];var b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5];out[0]=a0*b0+a2*b1;out[1]=a1*b0+a3*b1;out[2]=a0*b2+a2*b3;out[3]=a1*b2+a3*b3;out[4]=a0*b4+a2*b5+a4;out[5]=a1*b4+a3*b5+a5;return out}function rotate$1(out,a,rad){var a0=a[0],a1=a[1],a2=a[2], +a3=a[3],a4=a[4],a5=a[5];var s=Math.sin(rad);var c=Math.cos(rad);out[0]=a0*c+a2*s;out[1]=a1*c+a3*s;out[2]=a0*-s+a2*c;out[3]=a1*-s+a3*c;out[4]=a4;out[5]=a5;return out}function scale$1(out,a,v){var a0=a[0],a1=a[1],a2=a[2],a3=a[3],a4=a[4],a5=a[5];var v0=v[0],v1=v[1];out[0]=a0*v0;out[1]=a1*v0;out[2]=a2*v1;out[3]=a3*v1;out[4]=a4;out[5]=a5;return out}function translate(out,a,v){var a0=a[0],a1=a[1],a2=a[2],a3=a[3],a4=a[4],a5=a[5];var v0=v[0],v1=v[1];out[0]=a0;out[1]=a1;out[2]=a2;out[3]=a3;out[4]=a0*v0+a2* +v1+a4;out[5]=a1*v0+a3*v1+a5;return out}function fromRotation$1(out,rad){var s=Math.sin(rad),c=Math.cos(rad);out[0]=c;out[1]=s;out[2]=-s;out[3]=c;out[4]=0;out[5]=0;return out}function fromScaling$1(out,v){out[0]=v[0];out[1]=0;out[2]=0;out[3]=v[1];out[4]=0;out[5]=0;return out}function fromTranslation(out,v){out[0]=1;out[1]=0;out[2]=0;out[3]=1;out[4]=v[0];out[5]=v[1];return out}function str$1(a){return"mat2d("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"}function frob$1(a){return Math.hypot(a[0], +a[1],a[2],a[3],a[4],a[5],1)}function add$1(out,a,b){out[0]=a[0]+b[0];out[1]=a[1]+b[1];out[2]=a[2]+b[2];out[3]=a[3]+b[3];out[4]=a[4]+b[4];out[5]=a[5]+b[5];return out}function subtract$1(out,a,b){out[0]=a[0]-b[0];out[1]=a[1]-b[1];out[2]=a[2]-b[2];out[3]=a[3]-b[3];out[4]=a[4]-b[4];out[5]=a[5]-b[5];return out}function multiplyScalar$1(out,a,b){out[0]=a[0]*b;out[1]=a[1]*b;out[2]=a[2]*b;out[3]=a[3]*b;out[4]=a[4]*b;out[5]=a[5]*b;return out}function multiplyScalarAndAdd$1(out,a,b,scale){out[0]=a[0]+b[0]* +scale;out[1]=a[1]+b[1]*scale;out[2]=a[2]+b[2]*scale;out[3]=a[3]+b[3]*scale;out[4]=a[4]+b[4]*scale;out[5]=a[5]+b[5]*scale;return out}function exactEquals$1(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]}function equals$2(a,b){var a0=a[0],a1=a[1],a2=a[2],a3=a[3],a4=a[4],a5=a[5];var b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5];return Math.abs(a0-b0)<=EPSILON*Math.max(1,Math.abs(a0),Math.abs(b0))&&Math.abs(a1-b1)<=EPSILON*Math.max(1,Math.abs(a1),Math.abs(b1))&& +Math.abs(a2-b2)<=EPSILON*Math.max(1,Math.abs(a2),Math.abs(b2))&&Math.abs(a3-b3)<=EPSILON*Math.max(1,Math.abs(a3),Math.abs(b3))&&Math.abs(a4-b4)<=EPSILON*Math.max(1,Math.abs(a4),Math.abs(b4))&&Math.abs(a5-b5)<=EPSILON*Math.max(1,Math.abs(a5),Math.abs(b5))}var mul$1=multiply$1;var sub$1=subtract$1;var mat2d=Object.freeze({__proto__:null,create:create$1,clone:clone$1,copy:copy$1,identity:identity$1,fromValues:fromValues$1,set:set$1,invert:invert$1,determinant:determinant$1,multiply:multiply$1,rotate:rotate$1, +scale:scale$1,translate:translate,fromRotation:fromRotation$1,fromScaling:fromScaling$1,fromTranslation:fromTranslation,str:str$1,frob:frob$1,add:add$1,subtract:subtract$1,multiplyScalar:multiplyScalar$1,multiplyScalarAndAdd:multiplyScalarAndAdd$1,exactEquals:exactEquals$1,equals:equals$2,mul:mul$1,sub:sub$1});function create$2(){var out=new ARRAY_TYPE(9);if(ARRAY_TYPE!=Float32Array){out[1]=0;out[2]=0;out[3]=0;out[5]=0;out[6]=0;out[7]=0}out[0]=1;out[4]=1;out[8]=1;return out}function fromMat4(out, +a){out[0]=a[0];out[1]=a[1];out[2]=a[2];out[3]=a[4];out[4]=a[5];out[5]=a[6];out[6]=a[8];out[7]=a[9];out[8]=a[10];return out}function clone$2(a){var out=new ARRAY_TYPE(9);out[0]=a[0];out[1]=a[1];out[2]=a[2];out[3]=a[3];out[4]=a[4];out[5]=a[5];out[6]=a[6];out[7]=a[7];out[8]=a[8];return out}function copy$2(out,a){out[0]=a[0];out[1]=a[1];out[2]=a[2];out[3]=a[3];out[4]=a[4];out[5]=a[5];out[6]=a[6];out[7]=a[7];out[8]=a[8];return out}function fromValues$2(m00,m01,m02,m10,m11,m12,m20,m21,m22){var out=new ARRAY_TYPE(9); +out[0]=m00;out[1]=m01;out[2]=m02;out[3]=m10;out[4]=m11;out[5]=m12;out[6]=m20;out[7]=m21;out[8]=m22;return out}function set$2(out,m00,m01,m02,m10,m11,m12,m20,m21,m22){out[0]=m00;out[1]=m01;out[2]=m02;out[3]=m10;out[4]=m11;out[5]=m12;out[6]=m20;out[7]=m21;out[8]=m22;return out}function identity$2(out){out[0]=1;out[1]=0;out[2]=0;out[3]=0;out[4]=1;out[5]=0;out[6]=0;out[7]=0;out[8]=1;return out}function transpose$1(out,a){if(out===a){var a01=a[1],a02=a[2],a12=a[5];out[1]=a[3];out[2]=a[6];out[3]=a01;out[5]= +a[7];out[6]=a02;out[7]=a12}else{out[0]=a[0];out[1]=a[3];out[2]=a[6];out[3]=a[1];out[4]=a[4];out[5]=a[7];out[6]=a[2];out[7]=a[5];out[8]=a[8]}return out}function invert$2(out,a){var a00=a[0],a01=a[1],a02=a[2];var a10=a[3],a11=a[4],a12=a[5];var a20=a[6],a21=a[7],a22=a[8];var b01=a22*a11-a12*a21;var b11=-a22*a10+a12*a20;var b21=a21*a10-a11*a20;var det=a00*b01+a01*b11+a02*b21;if(!det)return null;det=1/det;out[0]=b01*det;out[1]=(-a22*a01+a02*a21)*det;out[2]=(a12*a01-a02*a11)*det;out[3]=b11*det;out[4]=(a22* +a00-a02*a20)*det;out[5]=(-a12*a00+a02*a10)*det;out[6]=b21*det;out[7]=(-a21*a00+a01*a20)*det;out[8]=(a11*a00-a01*a10)*det;return out}function adjoint$1(out,a){var a00=a[0],a01=a[1],a02=a[2];var a10=a[3],a11=a[4],a12=a[5];var a20=a[6],a21=a[7],a22=a[8];out[0]=a11*a22-a12*a21;out[1]=a02*a21-a01*a22;out[2]=a01*a12-a02*a11;out[3]=a12*a20-a10*a22;out[4]=a00*a22-a02*a20;out[5]=a02*a10-a00*a12;out[6]=a10*a21-a11*a20;out[7]=a01*a20-a00*a21;out[8]=a00*a11-a01*a10;return out}function determinant$2(a){var a00= +a[0],a01=a[1],a02=a[2];var a10=a[3],a11=a[4],a12=a[5];var a20=a[6],a21=a[7],a22=a[8];return a00*(a22*a11-a12*a21)+a01*(-a22*a10+a12*a20)+a02*(a21*a10-a11*a20)}function multiply$2(out,a,b){var a00=a[0],a01=a[1],a02=a[2];var a10=a[3],a11=a[4],a12=a[5];var a20=a[6],a21=a[7],a22=a[8];var b00=b[0],b01=b[1],b02=b[2];var b10=b[3],b11=b[4],b12=b[5];var b20=b[6],b21=b[7],b22=b[8];out[0]=b00*a00+b01*a10+b02*a20;out[1]=b00*a01+b01*a11+b02*a21;out[2]=b00*a02+b01*a12+b02*a22;out[3]=b10*a00+b11*a10+b12*a20;out[4]= +b10*a01+b11*a11+b12*a21;out[5]=b10*a02+b11*a12+b12*a22;out[6]=b20*a00+b21*a10+b22*a20;out[7]=b20*a01+b21*a11+b22*a21;out[8]=b20*a02+b21*a12+b22*a22;return out}function translate$1(out,a,v){var a00=a[0],a01=a[1],a02=a[2],a10=a[3],a11=a[4],a12=a[5],a20=a[6],a21=a[7],a22=a[8],x=v[0],y=v[1];out[0]=a00;out[1]=a01;out[2]=a02;out[3]=a10;out[4]=a11;out[5]=a12;out[6]=x*a00+y*a10+a20;out[7]=x*a01+y*a11+a21;out[8]=x*a02+y*a12+a22;return out}function rotate$2(out,a,rad){var a00=a[0],a01=a[1],a02=a[2],a10=a[3], +a11=a[4],a12=a[5],a20=a[6],a21=a[7],a22=a[8],s=Math.sin(rad),c=Math.cos(rad);out[0]=c*a00+s*a10;out[1]=c*a01+s*a11;out[2]=c*a02+s*a12;out[3]=c*a10-s*a00;out[4]=c*a11-s*a01;out[5]=c*a12-s*a02;out[6]=a20;out[7]=a21;out[8]=a22;return out}function scale$2(out,a,v){var x=v[0],y=v[1];out[0]=x*a[0];out[1]=x*a[1];out[2]=x*a[2];out[3]=y*a[3];out[4]=y*a[4];out[5]=y*a[5];out[6]=a[6];out[7]=a[7];out[8]=a[8];return out}function fromTranslation$1(out,v){out[0]=1;out[1]=0;out[2]=0;out[3]=0;out[4]=1;out[5]=0;out[6]= +v[0];out[7]=v[1];out[8]=1;return out}function fromRotation$2(out,rad){var s=Math.sin(rad),c=Math.cos(rad);out[0]=c;out[1]=s;out[2]=0;out[3]=-s;out[4]=c;out[5]=0;out[6]=0;out[7]=0;out[8]=1;return out}function fromScaling$2(out,v){out[0]=v[0];out[1]=0;out[2]=0;out[3]=0;out[4]=v[1];out[5]=0;out[6]=0;out[7]=0;out[8]=1;return out}function fromMat2d(out,a){out[0]=a[0];out[1]=a[1];out[2]=0;out[3]=a[2];out[4]=a[3];out[5]=0;out[6]=a[4];out[7]=a[5];out[8]=1;return out}function fromQuat(out,q){var x=q[0],y= +q[1],z=q[2],w=q[3];var x2=x+x;var y2=y+y;var z2=z+z;var xx=x*x2;var yx=y*x2;var yy=y*y2;var zx=z*x2;var zy=z*y2;var zz=z*z2;var wx=w*x2;var wy=w*y2;var wz=w*z2;out[0]=1-yy-zz;out[3]=yx-wz;out[6]=zx+wy;out[1]=yx+wz;out[4]=1-xx-zz;out[7]=zy-wx;out[2]=zx-wy;out[5]=zy+wx;out[8]=1-xx-yy;return out}function normalFromMat4(out,a){var a00=a[0],a01=a[1],a02=a[2],a03=a[3];var a10=a[4],a11=a[5],a12=a[6],a13=a[7];var a20=a[8],a21=a[9],a22=a[10],a23=a[11];var a30=a[12],a31=a[13],a32=a[14],a33=a[15];var b00=a00* +a11-a01*a10;var b01=a00*a12-a02*a10;var b02=a00*a13-a03*a10;var b03=a01*a12-a02*a11;var b04=a01*a13-a03*a11;var b05=a02*a13-a03*a12;var b06=a20*a31-a21*a30;var b07=a20*a32-a22*a30;var b08=a20*a33-a23*a30;var b09=a21*a32-a22*a31;var b10=a21*a33-a23*a31;var b11=a22*a33-a23*a32;var det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;if(!det)return null;det=1/det;out[0]=(a11*b11-a12*b10+a13*b09)*det;out[1]=(a12*b08-a10*b11-a13*b07)*det;out[2]=(a10*b10-a11*b08+a13*b06)*det;out[3]=(a02*b10-a01*b11-a03* +b09)*det;out[4]=(a00*b11-a02*b08+a03*b07)*det;out[5]=(a01*b08-a00*b10-a03*b06)*det;out[6]=(a31*b05-a32*b04+a33*b03)*det;out[7]=(a32*b02-a30*b05-a33*b01)*det;out[8]=(a30*b04-a31*b02+a33*b00)*det;return out}function projection(out,width,height){out[0]=2/width;out[1]=0;out[2]=0;out[3]=0;out[4]=-2/height;out[5]=0;out[6]=-1;out[7]=1;out[8]=1;return out}function str$2(a){return"mat3("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+")"}function frob$2(a){return Math.hypot(a[0], +a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}function add$2(out,a,b){out[0]=a[0]+b[0];out[1]=a[1]+b[1];out[2]=a[2]+b[2];out[3]=a[3]+b[3];out[4]=a[4]+b[4];out[5]=a[5]+b[5];out[6]=a[6]+b[6];out[7]=a[7]+b[7];out[8]=a[8]+b[8];return out}function subtract$2(out,a,b){out[0]=a[0]-b[0];out[1]=a[1]-b[1];out[2]=a[2]-b[2];out[3]=a[3]-b[3];out[4]=a[4]-b[4];out[5]=a[5]-b[5];out[6]=a[6]-b[6];out[7]=a[7]-b[7];out[8]=a[8]-b[8];return out}function multiplyScalar$2(out,a,b){out[0]=a[0]*b;out[1]=a[1]*b;out[2]=a[2]*b;out[3]= +a[3]*b;out[4]=a[4]*b;out[5]=a[5]*b;out[6]=a[6]*b;out[7]=a[7]*b;out[8]=a[8]*b;return out}function multiplyScalarAndAdd$2(out,a,b,scale){out[0]=a[0]+b[0]*scale;out[1]=a[1]+b[1]*scale;out[2]=a[2]+b[2]*scale;out[3]=a[3]+b[3]*scale;out[4]=a[4]+b[4]*scale;out[5]=a[5]+b[5]*scale;out[6]=a[6]+b[6]*scale;out[7]=a[7]+b[7]*scale;out[8]=a[8]+b[8]*scale;return out}function exactEquals$2(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[7]===b[7]&&a[8]===b[8]} +function equals$3(a,b){var a0=a[0],a1=a[1],a2=a[2],a3=a[3],a4=a[4],a5=a[5],a6=a[6],a7=a[7],a8=a[8];var b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5],b6=b[6],b7=b[7],b8=b[8];return Math.abs(a0-b0)<=EPSILON*Math.max(1,Math.abs(a0),Math.abs(b0))&&Math.abs(a1-b1)<=EPSILON*Math.max(1,Math.abs(a1),Math.abs(b1))&&Math.abs(a2-b2)<=EPSILON*Math.max(1,Math.abs(a2),Math.abs(b2))&&Math.abs(a3-b3)<=EPSILON*Math.max(1,Math.abs(a3),Math.abs(b3))&&Math.abs(a4-b4)<=EPSILON*Math.max(1,Math.abs(a4),Math.abs(b4))&& +Math.abs(a5-b5)<=EPSILON*Math.max(1,Math.abs(a5),Math.abs(b5))&&Math.abs(a6-b6)<=EPSILON*Math.max(1,Math.abs(a6),Math.abs(b6))&&Math.abs(a7-b7)<=EPSILON*Math.max(1,Math.abs(a7),Math.abs(b7))&&Math.abs(a8-b8)<=EPSILON*Math.max(1,Math.abs(a8),Math.abs(b8))}var mul$2=multiply$2;var sub$2=subtract$2;var mat3=Object.freeze({__proto__:null,create:create$2,fromMat4:fromMat4,clone:clone$2,copy:copy$2,fromValues:fromValues$2,set:set$2,identity:identity$2,transpose:transpose$1,invert:invert$2,adjoint:adjoint$1, +determinant:determinant$2,multiply:multiply$2,translate:translate$1,rotate:rotate$2,scale:scale$2,fromTranslation:fromTranslation$1,fromRotation:fromRotation$2,fromScaling:fromScaling$2,fromMat2d:fromMat2d,fromQuat:fromQuat,normalFromMat4:normalFromMat4,projection:projection,str:str$2,frob:frob$2,add:add$2,subtract:subtract$2,multiplyScalar:multiplyScalar$2,multiplyScalarAndAdd:multiplyScalarAndAdd$2,exactEquals:exactEquals$2,equals:equals$3,mul:mul$2,sub:sub$2});function create$3(){var out=new ARRAY_TYPE(16); +if(ARRAY_TYPE!=Float32Array){out[1]=0;out[2]=0;out[3]=0;out[4]=0;out[6]=0;out[7]=0;out[8]=0;out[9]=0;out[11]=0;out[12]=0;out[13]=0;out[14]=0}out[0]=1;out[5]=1;out[10]=1;out[15]=1;return out}function clone$3(a){var out=new ARRAY_TYPE(16);out[0]=a[0];out[1]=a[1];out[2]=a[2];out[3]=a[3];out[4]=a[4];out[5]=a[5];out[6]=a[6];out[7]=a[7];out[8]=a[8];out[9]=a[9];out[10]=a[10];out[11]=a[11];out[12]=a[12];out[13]=a[13];out[14]=a[14];out[15]=a[15];return out}function copy$3(out,a){out[0]=a[0];out[1]=a[1];out[2]= +a[2];out[3]=a[3];out[4]=a[4];out[5]=a[5];out[6]=a[6];out[7]=a[7];out[8]=a[8];out[9]=a[9];out[10]=a[10];out[11]=a[11];out[12]=a[12];out[13]=a[13];out[14]=a[14];out[15]=a[15];return out}function fromValues$3(m00,m01,m02,m03,m10,m11,m12,m13,m20,m21,m22,m23,m30,m31,m32,m33){var out=new ARRAY_TYPE(16);out[0]=m00;out[1]=m01;out[2]=m02;out[3]=m03;out[4]=m10;out[5]=m11;out[6]=m12;out[7]=m13;out[8]=m20;out[9]=m21;out[10]=m22;out[11]=m23;out[12]=m30;out[13]=m31;out[14]=m32;out[15]=m33;return out}function set$3(out, +m00,m01,m02,m03,m10,m11,m12,m13,m20,m21,m22,m23,m30,m31,m32,m33){out[0]=m00;out[1]=m01;out[2]=m02;out[3]=m03;out[4]=m10;out[5]=m11;out[6]=m12;out[7]=m13;out[8]=m20;out[9]=m21;out[10]=m22;out[11]=m23;out[12]=m30;out[13]=m31;out[14]=m32;out[15]=m33;return out}function identity$3(out){out[0]=1;out[1]=0;out[2]=0;out[3]=0;out[4]=0;out[5]=1;out[6]=0;out[7]=0;out[8]=0;out[9]=0;out[10]=1;out[11]=0;out[12]=0;out[13]=0;out[14]=0;out[15]=1;return out}function transpose$2(out,a){if(out===a){var a01=a[1],a02= +a[2],a03=a[3];var a12=a[6],a13=a[7];var a23=a[11];out[1]=a[4];out[2]=a[8];out[3]=a[12];out[4]=a01;out[6]=a[9];out[7]=a[13];out[8]=a02;out[9]=a12;out[11]=a[14];out[12]=a03;out[13]=a13;out[14]=a23}else{out[0]=a[0];out[1]=a[4];out[2]=a[8];out[3]=a[12];out[4]=a[1];out[5]=a[5];out[6]=a[9];out[7]=a[13];out[8]=a[2];out[9]=a[6];out[10]=a[10];out[11]=a[14];out[12]=a[3];out[13]=a[7];out[14]=a[11];out[15]=a[15]}return out}function invert$3(out,a){var a00=a[0],a01=a[1],a02=a[2],a03=a[3];var a10=a[4],a11=a[5], +a12=a[6],a13=a[7];var a20=a[8],a21=a[9],a22=a[10],a23=a[11];var a30=a[12],a31=a[13],a32=a[14],a33=a[15];var b00=a00*a11-a01*a10;var b01=a00*a12-a02*a10;var b02=a00*a13-a03*a10;var b03=a01*a12-a02*a11;var b04=a01*a13-a03*a11;var b05=a02*a13-a03*a12;var b06=a20*a31-a21*a30;var b07=a20*a32-a22*a30;var b08=a20*a33-a23*a30;var b09=a21*a32-a22*a31;var b10=a21*a33-a23*a31;var b11=a22*a33-a23*a32;var det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;if(!det)return null;det=1/det;out[0]=(a11*b11-a12*b10+ +a13*b09)*det;out[1]=(a02*b10-a01*b11-a03*b09)*det;out[2]=(a31*b05-a32*b04+a33*b03)*det;out[3]=(a22*b04-a21*b05-a23*b03)*det;out[4]=(a12*b08-a10*b11-a13*b07)*det;out[5]=(a00*b11-a02*b08+a03*b07)*det;out[6]=(a32*b02-a30*b05-a33*b01)*det;out[7]=(a20*b05-a22*b02+a23*b01)*det;out[8]=(a10*b10-a11*b08+a13*b06)*det;out[9]=(a01*b08-a00*b10-a03*b06)*det;out[10]=(a30*b04-a31*b02+a33*b00)*det;out[11]=(a21*b02-a20*b04-a23*b00)*det;out[12]=(a11*b07-a10*b09-a12*b06)*det;out[13]=(a00*b09-a01*b07+a02*b06)*det;out[14]= +(a31*b01-a30*b03-a32*b00)*det;out[15]=(a20*b03-a21*b01+a22*b00)*det;return out}function adjoint$2(out,a){var a00=a[0],a01=a[1],a02=a[2],a03=a[3];var a10=a[4],a11=a[5],a12=a[6],a13=a[7];var a20=a[8],a21=a[9],a22=a[10],a23=a[11];var a30=a[12],a31=a[13],a32=a[14],a33=a[15];out[0]=a11*(a22*a33-a23*a32)-a21*(a12*a33-a13*a32)+a31*(a12*a23-a13*a22);out[1]=-(a01*(a22*a33-a23*a32)-a21*(a02*a33-a03*a32)+a31*(a02*a23-a03*a22));out[2]=a01*(a12*a33-a13*a32)-a11*(a02*a33-a03*a32)+a31*(a02*a13-a03*a12);out[3]=-(a01* +(a12*a23-a13*a22)-a11*(a02*a23-a03*a22)+a21*(a02*a13-a03*a12));out[4]=-(a10*(a22*a33-a23*a32)-a20*(a12*a33-a13*a32)+a30*(a12*a23-a13*a22));out[5]=a00*(a22*a33-a23*a32)-a20*(a02*a33-a03*a32)+a30*(a02*a23-a03*a22);out[6]=-(a00*(a12*a33-a13*a32)-a10*(a02*a33-a03*a32)+a30*(a02*a13-a03*a12));out[7]=a00*(a12*a23-a13*a22)-a10*(a02*a23-a03*a22)+a20*(a02*a13-a03*a12);out[8]=a10*(a21*a33-a23*a31)-a20*(a11*a33-a13*a31)+a30*(a11*a23-a13*a21);out[9]=-(a00*(a21*a33-a23*a31)-a20*(a01*a33-a03*a31)+a30*(a01*a23-a03* +a21));out[10]=a00*(a11*a33-a13*a31)-a10*(a01*a33-a03*a31)+a30*(a01*a13-a03*a11);out[11]=-(a00*(a11*a23-a13*a21)-a10*(a01*a23-a03*a21)+a20*(a01*a13-a03*a11));out[12]=-(a10*(a21*a32-a22*a31)-a20*(a11*a32-a12*a31)+a30*(a11*a22-a12*a21));out[13]=a00*(a21*a32-a22*a31)-a20*(a01*a32-a02*a31)+a30*(a01*a22-a02*a21);out[14]=-(a00*(a11*a32-a12*a31)-a10*(a01*a32-a02*a31)+a30*(a01*a12-a02*a11));out[15]=a00*(a11*a22-a12*a21)-a10*(a01*a22-a02*a21)+a20*(a01*a12-a02*a11);return out}function determinant$3(a){var a00= +a[0],a01=a[1],a02=a[2],a03=a[3];var a10=a[4],a11=a[5],a12=a[6],a13=a[7];var a20=a[8],a21=a[9],a22=a[10],a23=a[11];var a30=a[12],a31=a[13],a32=a[14],a33=a[15];var b00=a00*a11-a01*a10;var b01=a00*a12-a02*a10;var b02=a00*a13-a03*a10;var b03=a01*a12-a02*a11;var b04=a01*a13-a03*a11;var b05=a02*a13-a03*a12;var b06=a20*a31-a21*a30;var b07=a20*a32-a22*a30;var b08=a20*a33-a23*a30;var b09=a21*a32-a22*a31;var b10=a21*a33-a23*a31;var b11=a22*a33-a23*a32;return b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06} +function multiply$3(out,a,b){var a00=a[0],a01=a[1],a02=a[2],a03=a[3];var a10=a[4],a11=a[5],a12=a[6],a13=a[7];var a20=a[8],a21=a[9],a22=a[10],a23=a[11];var a30=a[12],a31=a[13],a32=a[14],a33=a[15];var b0=b[0],b1=b[1],b2=b[2],b3=b[3];out[0]=b0*a00+b1*a10+b2*a20+b3*a30;out[1]=b0*a01+b1*a11+b2*a21+b3*a31;out[2]=b0*a02+b1*a12+b2*a22+b3*a32;out[3]=b0*a03+b1*a13+b2*a23+b3*a33;b0=b[4];b1=b[5];b2=b[6];b3=b[7];out[4]=b0*a00+b1*a10+b2*a20+b3*a30;out[5]=b0*a01+b1*a11+b2*a21+b3*a31;out[6]=b0*a02+b1*a12+b2*a22+ +b3*a32;out[7]=b0*a03+b1*a13+b2*a23+b3*a33;b0=b[8];b1=b[9];b2=b[10];b3=b[11];out[8]=b0*a00+b1*a10+b2*a20+b3*a30;out[9]=b0*a01+b1*a11+b2*a21+b3*a31;out[10]=b0*a02+b1*a12+b2*a22+b3*a32;out[11]=b0*a03+b1*a13+b2*a23+b3*a33;b0=b[12];b1=b[13];b2=b[14];b3=b[15];out[12]=b0*a00+b1*a10+b2*a20+b3*a30;out[13]=b0*a01+b1*a11+b2*a21+b3*a31;out[14]=b0*a02+b1*a12+b2*a22+b3*a32;out[15]=b0*a03+b1*a13+b2*a23+b3*a33;return out}function translate$2(out,a,v){var x=v[0],y=v[1],z=v[2];var a00,a01,a02,a03;var a10,a11,a12,a13; +var a20,a21,a22,a23;if(a===out){out[12]=a[0]*x+a[4]*y+a[8]*z+a[12];out[13]=a[1]*x+a[5]*y+a[9]*z+a[13];out[14]=a[2]*x+a[6]*y+a[10]*z+a[14];out[15]=a[3]*x+a[7]*y+a[11]*z+a[15]}else{a00=a[0];a01=a[1];a02=a[2];a03=a[3];a10=a[4];a11=a[5];a12=a[6];a13=a[7];a20=a[8];a21=a[9];a22=a[10];a23=a[11];out[0]=a00;out[1]=a01;out[2]=a02;out[3]=a03;out[4]=a10;out[5]=a11;out[6]=a12;out[7]=a13;out[8]=a20;out[9]=a21;out[10]=a22;out[11]=a23;out[12]=a00*x+a10*y+a20*z+a[12];out[13]=a01*x+a11*y+a21*z+a[13];out[14]=a02*x+ +a12*y+a22*z+a[14];out[15]=a03*x+a13*y+a23*z+a[15]}return out}function scale$3(out,a,v){var x=v[0],y=v[1],z=v[2];out[0]=a[0]*x;out[1]=a[1]*x;out[2]=a[2]*x;out[3]=a[3]*x;out[4]=a[4]*y;out[5]=a[5]*y;out[6]=a[6]*y;out[7]=a[7]*y;out[8]=a[8]*z;out[9]=a[9]*z;out[10]=a[10]*z;out[11]=a[11]*z;out[12]=a[12];out[13]=a[13];out[14]=a[14];out[15]=a[15];return out}function rotate$3(out,a,rad,axis){var x=axis[0],y=axis[1],z=axis[2];var len=Math.hypot(x,y,z);var s,c,t;var a00,a01,a02,a03;var a10,a11,a12,a13;var a20, +a21,a22,a23;var b00,b01,b02;var b10,b11,b12;var b20,b21,b22;if(len0){translation[0]=(ax*bw+aw*bx+ay*bz-az*by)*2/magnitude;translation[1]=(ay*bw+aw*by+az*bx-ax*bz)*2/magnitude;translation[2]=(az*bw+aw*bz+ax*by-ay*bx)*2/magnitude}else{translation[0]=(ax* +bw+aw*bx+ay*bz-az*by)*2;translation[1]=(ay*bw+aw*by+az*bx-ax*bz)*2;translation[2]=(az*bw+aw*bz+ax*by-ay*bx)*2}fromRotationTranslation(out,a,translation);return out}function getTranslation(out,mat){out[0]=mat[12];out[1]=mat[13];out[2]=mat[14];return out}function getScaling(out,mat){var m11=mat[0];var m12=mat[1];var m13=mat[2];var m21=mat[4];var m22=mat[5];var m23=mat[6];var m31=mat[8];var m32=mat[9];var m33=mat[10];out[0]=Math.hypot(m11,m12,m13);out[1]=Math.hypot(m21,m22,m23);out[2]=Math.hypot(m31, +m32,m33);return out}function getRotation(out,mat){var scaling=new ARRAY_TYPE(3);getScaling(scaling,mat);var is1=1/scaling[0];var is2=1/scaling[1];var is3=1/scaling[2];var sm11=mat[0]*is1;var sm12=mat[1]*is2;var sm13=mat[2]*is3;var sm21=mat[4]*is1;var sm22=mat[5]*is2;var sm23=mat[6]*is3;var sm31=mat[8]*is1;var sm32=mat[9]*is2;var sm33=mat[10]*is3;var trace=sm11+sm22+sm33;var S=0;if(trace>0){S=Math.sqrt(trace+1)*2;out[3]=.25*S;out[0]=(sm23-sm32)/S;out[1]=(sm31-sm13)/S;out[2]=(sm12-sm21)/S}else if(sm11> +sm22&&sm11>sm33){S=Math.sqrt(1+sm11-sm22-sm33)*2;out[3]=(sm23-sm32)/S;out[0]=.25*S;out[1]=(sm12+sm21)/S;out[2]=(sm31+sm13)/S}else if(sm22>sm33){S=Math.sqrt(1+sm22-sm11-sm33)*2;out[3]=(sm31-sm13)/S;out[0]=(sm12+sm21)/S;out[1]=.25*S;out[2]=(sm23+sm32)/S}else{S=Math.sqrt(1+sm33-sm11-sm22)*2;out[3]=(sm12-sm21)/S;out[0]=(sm31+sm13)/S;out[1]=(sm23+sm32)/S;out[2]=.25*S}return out}function fromRotationTranslationScale(out,q,v,s){var x=q[0],y=q[1],z=q[2],w=q[3];var x2=x+x;var y2=y+y;var z2=z+z;var xx=x*x2; +var xy=x*y2;var xz=x*z2;var yy=y*y2;var yz=y*z2;var zz=z*z2;var wx=w*x2;var wy=w*y2;var wz=w*z2;var sx=s[0];var sy=s[1];var sz=s[2];out[0]=(1-(yy+zz))*sx;out[1]=(xy+wz)*sx;out[2]=(xz-wy)*sx;out[3]=0;out[4]=(xy-wz)*sy;out[5]=(1-(xx+zz))*sy;out[6]=(yz+wx)*sy;out[7]=0;out[8]=(xz+wy)*sz;out[9]=(yz-wx)*sz;out[10]=(1-(xx+yy))*sz;out[11]=0;out[12]=v[0];out[13]=v[1];out[14]=v[2];out[15]=1;return out}function fromRotationTranslationScaleOrigin(out,q,v,s,o){var x=q[0],y=q[1],z=q[2],w=q[3];var x2=x+x;var y2= +y+y;var z2=z+z;var xx=x*x2;var xy=x*y2;var xz=x*z2;var yy=y*y2;var yz=y*z2;var zz=z*z2;var wx=w*x2;var wy=w*y2;var wz=w*z2;var sx=s[0];var sy=s[1];var sz=s[2];var ox=o[0];var oy=o[1];var oz=o[2];var out0=(1-(yy+zz))*sx;var out1=(xy+wz)*sx;var out2=(xz-wy)*sx;var out4=(xy-wz)*sy;var out5=(1-(xx+zz))*sy;var out6=(yz+wx)*sy;var out8=(xz+wy)*sz;var out9=(yz-wx)*sz;var out10=(1-(xx+yy))*sz;out[0]=out0;out[1]=out1;out[2]=out2;out[3]=0;out[4]=out4;out[5]=out5;out[6]=out6;out[7]=0;out[8]=out8;out[9]=out9; +out[10]=out10;out[11]=0;out[12]=v[0]+ox-(out0*ox+out4*oy+out8*oz);out[13]=v[1]+oy-(out1*ox+out5*oy+out9*oz);out[14]=v[2]+oz-(out2*ox+out6*oy+out10*oz);out[15]=1;return out}function fromQuat$1(out,q){var x=q[0],y=q[1],z=q[2],w=q[3];var x2=x+x;var y2=y+y;var z2=z+z;var xx=x*x2;var yx=y*x2;var yy=y*y2;var zx=z*x2;var zy=z*y2;var zz=z*z2;var wx=w*x2;var wy=w*y2;var wz=w*z2;out[0]=1-yy-zz;out[1]=yx+wz;out[2]=zx-wy;out[3]=0;out[4]=yx-wz;out[5]=1-xx-zz;out[6]=zy+wx;out[7]=0;out[8]=zx+wy;out[9]=zy-wx;out[10]= +1-xx-yy;out[11]=0;out[12]=0;out[13]=0;out[14]=0;out[15]=1;return out}function frustum(out,left,right,bottom,top,near,far){var rl=1/(right-left);var tb=1/(top-bottom);var nf=1/(near-far);out[0]=near*2*rl;out[1]=0;out[2]=0;out[3]=0;out[4]=0;out[5]=near*2*tb;out[6]=0;out[7]=0;out[8]=(right+left)*rl;out[9]=(top+bottom)*tb;out[10]=(far+near)*nf;out[11]=-1;out[12]=0;out[13]=0;out[14]=far*near*2*nf;out[15]=0;return out}function perspective(out,fovy,aspect,near,far){var f=1/Math.tan(fovy/2),nf;out[0]=f/aspect; +out[1]=0;out[2]=0;out[3]=0;out[4]=0;out[5]=f;out[6]=0;out[7]=0;out[8]=0;out[9]=0;out[11]=-1;out[12]=0;out[13]=0;out[15]=0;if(far!=null&&far!==Infinity){nf=1/(near-far);out[10]=(far+near)*nf;out[14]=2*far*near*nf}else{out[10]=-1;out[14]=-2*near}return out}function perspectiveFromFieldOfView(out,fov,near,far){var upTan=Math.tan(fov.upDegrees*Math.PI/180);var downTan=Math.tan(fov.downDegrees*Math.PI/180);var leftTan=Math.tan(fov.leftDegrees*Math.PI/180);var rightTan=Math.tan(fov.rightDegrees*Math.PI/ +180);var xScale=2/(leftTan+rightTan);var yScale=2/(upTan+downTan);out[0]=xScale;out[1]=0;out[2]=0;out[3]=0;out[4]=0;out[5]=yScale;out[6]=0;out[7]=0;out[8]=-((leftTan-rightTan)*xScale*.5);out[9]=(upTan-downTan)*yScale*.5;out[10]=far/(near-far);out[11]=-1;out[12]=0;out[13]=0;out[14]=far*near/(near-far);out[15]=0;return out}function ortho(out,left,right,bottom,top,near,far){var lr=1/(left-right);var bt=1/(bottom-top);var nf=1/(near-far);out[0]=-2*lr;out[1]=0;out[2]=0;out[3]=0;out[4]=0;out[5]=-2*bt;out[6]= +0;out[7]=0;out[8]=0;out[9]=0;out[10]=2*nf;out[11]=0;out[12]=(left+right)*lr;out[13]=(top+bottom)*bt;out[14]=(far+near)*nf;out[15]=1;return out}function lookAt(out,eye,center,up){var x0,x1,x2,y0,y1,y2,z0,z1,z2,len;var eyex=eye[0];var eyey=eye[1];var eyez=eye[2];var upx=up[0];var upy=up[1];var upz=up[2];var centerx=center[0];var centery=center[1];var centerz=center[2];if(Math.abs(eyex-centerx)0){len=1/Math.sqrt(len);z0*=len;z1*=len;z2*=len}var x0=upy*z2-upz*z1,x1=upz*z0-upx*z2,x2=upx*z1-upy*z0;len=x0*x0+x1*x1+x2*x2;if(len>0){len=1/Math.sqrt(len);x0*=len;x1*=len;x2*=len}out[0]=x0;out[1]=x1;out[2]= +x2;out[3]=0;out[4]=z1*x2-z2*x1;out[5]=z2*x0-z0*x2;out[6]=z0*x1-z1*x0;out[7]=0;out[8]=z0;out[9]=z1;out[10]=z2;out[11]=0;out[12]=eyex;out[13]=eyey;out[14]=eyez;out[15]=1;return out}function str$3(a){return"mat4("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+")"}function frob$3(a){return Math.hypot(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15])}function add$3(out, +a,b){out[0]=a[0]+b[0];out[1]=a[1]+b[1];out[2]=a[2]+b[2];out[3]=a[3]+b[3];out[4]=a[4]+b[4];out[5]=a[5]+b[5];out[6]=a[6]+b[6];out[7]=a[7]+b[7];out[8]=a[8]+b[8];out[9]=a[9]+b[9];out[10]=a[10]+b[10];out[11]=a[11]+b[11];out[12]=a[12]+b[12];out[13]=a[13]+b[13];out[14]=a[14]+b[14];out[15]=a[15]+b[15];return out}function subtract$3(out,a,b){out[0]=a[0]-b[0];out[1]=a[1]-b[1];out[2]=a[2]-b[2];out[3]=a[3]-b[3];out[4]=a[4]-b[4];out[5]=a[5]-b[5];out[6]=a[6]-b[6];out[7]=a[7]-b[7];out[8]=a[8]-b[8];out[9]=a[9]-b[9]; +out[10]=a[10]-b[10];out[11]=a[11]-b[11];out[12]=a[12]-b[12];out[13]=a[13]-b[13];out[14]=a[14]-b[14];out[15]=a[15]-b[15];return out}function multiplyScalar$3(out,a,b){out[0]=a[0]*b;out[1]=a[1]*b;out[2]=a[2]*b;out[3]=a[3]*b;out[4]=a[4]*b;out[5]=a[5]*b;out[6]=a[6]*b;out[7]=a[7]*b;out[8]=a[8]*b;out[9]=a[9]*b;out[10]=a[10]*b;out[11]=a[11]*b;out[12]=a[12]*b;out[13]=a[13]*b;out[14]=a[14]*b;out[15]=a[15]*b;return out}function multiplyScalarAndAdd$3(out,a,b,scale){out[0]=a[0]+b[0]*scale;out[1]=a[1]+b[1]*scale; +out[2]=a[2]+b[2]*scale;out[3]=a[3]+b[3]*scale;out[4]=a[4]+b[4]*scale;out[5]=a[5]+b[5]*scale;out[6]=a[6]+b[6]*scale;out[7]=a[7]+b[7]*scale;out[8]=a[8]+b[8]*scale;out[9]=a[9]+b[9]*scale;out[10]=a[10]+b[10]*scale;out[11]=a[11]+b[11]*scale;out[12]=a[12]+b[12]*scale;out[13]=a[13]+b[13]*scale;out[14]=a[14]+b[14]*scale;out[15]=a[15]+b[15]*scale;return out}function exactEquals$3(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[7]===b[7]&&a[8]===b[8]&& +a[9]===b[9]&&a[10]===b[10]&&a[11]===b[11]&&a[12]===b[12]&&a[13]===b[13]&&a[14]===b[14]&&a[15]===b[15]}function equals$4(a,b){var a0=a[0],a1=a[1],a2=a[2],a3=a[3];var a4=a[4],a5=a[5],a6=a[6],a7=a[7];var a8=a[8],a9=a[9],a10=a[10],a11=a[11];var a12=a[12],a13=a[13],a14=a[14],a15=a[15];var b0=b[0],b1=b[1],b2=b[2],b3=b[3];var b4=b[4],b5=b[5],b6=b[6],b7=b[7];var b8=b[8],b9=b[9],b10=b[10],b11=b[11];var b12=b[12],b13=b[13],b14=b[14],b15=b[15];return Math.abs(a0-b0)<=EPSILON*Math.max(1,Math.abs(a0),Math.abs(b0))&& +Math.abs(a1-b1)<=EPSILON*Math.max(1,Math.abs(a1),Math.abs(b1))&&Math.abs(a2-b2)<=EPSILON*Math.max(1,Math.abs(a2),Math.abs(b2))&&Math.abs(a3-b3)<=EPSILON*Math.max(1,Math.abs(a3),Math.abs(b3))&&Math.abs(a4-b4)<=EPSILON*Math.max(1,Math.abs(a4),Math.abs(b4))&&Math.abs(a5-b5)<=EPSILON*Math.max(1,Math.abs(a5),Math.abs(b5))&&Math.abs(a6-b6)<=EPSILON*Math.max(1,Math.abs(a6),Math.abs(b6))&&Math.abs(a7-b7)<=EPSILON*Math.max(1,Math.abs(a7),Math.abs(b7))&&Math.abs(a8-b8)<=EPSILON*Math.max(1,Math.abs(a8),Math.abs(b8))&& +Math.abs(a9-b9)<=EPSILON*Math.max(1,Math.abs(a9),Math.abs(b9))&&Math.abs(a10-b10)<=EPSILON*Math.max(1,Math.abs(a10),Math.abs(b10))&&Math.abs(a11-b11)<=EPSILON*Math.max(1,Math.abs(a11),Math.abs(b11))&&Math.abs(a12-b12)<=EPSILON*Math.max(1,Math.abs(a12),Math.abs(b12))&&Math.abs(a13-b13)<=EPSILON*Math.max(1,Math.abs(a13),Math.abs(b13))&&Math.abs(a14-b14)<=EPSILON*Math.max(1,Math.abs(a14),Math.abs(b14))&&Math.abs(a15-b15)<=EPSILON*Math.max(1,Math.abs(a15),Math.abs(b15))}var mul$3=multiply$3;var sub$3= +subtract$3;var mat4=Object.freeze({__proto__:null,create:create$3,clone:clone$3,copy:copy$3,fromValues:fromValues$3,set:set$3,identity:identity$3,transpose:transpose$2,invert:invert$3,adjoint:adjoint$2,determinant:determinant$3,multiply:multiply$3,translate:translate$2,scale:scale$3,rotate:rotate$3,rotateX:rotateX,rotateY:rotateY,rotateZ:rotateZ,fromTranslation:fromTranslation$2,fromScaling:fromScaling$3,fromRotation:fromRotation$3,fromXRotation:fromXRotation,fromYRotation:fromYRotation,fromZRotation:fromZRotation, +fromRotationTranslation:fromRotationTranslation,fromQuat2:fromQuat2,getTranslation:getTranslation,getScaling:getScaling,getRotation:getRotation,fromRotationTranslationScale:fromRotationTranslationScale,fromRotationTranslationScaleOrigin:fromRotationTranslationScaleOrigin,fromQuat:fromQuat$1,frustum:frustum,perspective:perspective,perspectiveFromFieldOfView:perspectiveFromFieldOfView,ortho:ortho,lookAt:lookAt,targetTo:targetTo,str:str$3,frob:frob$3,add:add$3,subtract:subtract$3,multiplyScalar:multiplyScalar$3, +multiplyScalarAndAdd:multiplyScalarAndAdd$3,exactEquals:exactEquals$3,equals:equals$4,mul:mul$3,sub:sub$3});function create$4(){var out=new ARRAY_TYPE(3);if(ARRAY_TYPE!=Float32Array){out[0]=0;out[1]=0;out[2]=0}return out}function clone$4(a){var out=new ARRAY_TYPE(3);out[0]=a[0];out[1]=a[1];out[2]=a[2];return out}function length(a){var x=a[0];var y=a[1];var z=a[2];return Math.hypot(x,y,z)}function fromValues$4(x,y,z){var out=new ARRAY_TYPE(3);out[0]=x;out[1]=y;out[2]=z;return out}function copy$4(out, +a){out[0]=a[0];out[1]=a[1];out[2]=a[2];return out}function set$4(out,x,y,z){out[0]=x;out[1]=y;out[2]=z;return out}function add$4(out,a,b){out[0]=a[0]+b[0];out[1]=a[1]+b[1];out[2]=a[2]+b[2];return out}function subtract$4(out,a,b){out[0]=a[0]-b[0];out[1]=a[1]-b[1];out[2]=a[2]-b[2];return out}function multiply$4(out,a,b){out[0]=a[0]*b[0];out[1]=a[1]*b[1];out[2]=a[2]*b[2];return out}function divide(out,a,b){out[0]=a[0]/b[0];out[1]=a[1]/b[1];out[2]=a[2]/b[2];return out}function ceil(out,a){out[0]=Math.ceil(a[0]); +out[1]=Math.ceil(a[1]);out[2]=Math.ceil(a[2]);return out}function floor(out,a){out[0]=Math.floor(a[0]);out[1]=Math.floor(a[1]);out[2]=Math.floor(a[2]);return out}function min(out,a,b){out[0]=Math.min(a[0],b[0]);out[1]=Math.min(a[1],b[1]);out[2]=Math.min(a[2],b[2]);return out}function max(out,a,b){out[0]=Math.max(a[0],b[0]);out[1]=Math.max(a[1],b[1]);out[2]=Math.max(a[2],b[2]);return out}function round(out,a){out[0]=Math.round(a[0]);out[1]=Math.round(a[1]);out[2]=Math.round(a[2]);return out}function scale$4(out, +a,b){out[0]=a[0]*b;out[1]=a[1]*b;out[2]=a[2]*b;return out}function scaleAndAdd(out,a,b,scale){out[0]=a[0]+b[0]*scale;out[1]=a[1]+b[1]*scale;out[2]=a[2]+b[2]*scale;return out}function distance(a,b){var x=b[0]-a[0];var y=b[1]-a[1];var z=b[2]-a[2];return Math.hypot(x,y,z)}function squaredDistance(a,b){var x=b[0]-a[0];var y=b[1]-a[1];var z=b[2]-a[2];return x*x+y*y+z*z}function squaredLength(a){var x=a[0];var y=a[1];var z=a[2];return x*x+y*y+z*z}function negate(out,a){out[0]=-a[0];out[1]=-a[1];out[2]= +-a[2];return out}function inverse(out,a){out[0]=1/a[0];out[1]=1/a[1];out[2]=1/a[2];return out}function normalize(out,a){var x=a[0];var y=a[1];var z=a[2];var len=x*x+y*y+z*z;if(len>0)len=1/Math.sqrt(len);out[0]=a[0]*len;out[1]=a[1]*len;out[2]=a[2]*len;return out}function dot(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function cross(out,a,b){var ax=a[0],ay=a[1],az=a[2];var bx=b[0],by=b[1],bz=b[2];out[0]=ay*bz-az*by;out[1]=az*bx-ax*bz;out[2]=ax*by-ay*bx;return out}function lerp(out,a,b,t){var ax=a[0]; +var ay=a[1];var az=a[2];out[0]=ax+t*(b[0]-ax);out[1]=ay+t*(b[1]-ay);out[2]=az+t*(b[2]-az);return out}function hermite(out,a,b,c,d,t){var factorTimes2=t*t;var factor1=factorTimes2*(2*t-3)+1;var factor2=factorTimes2*(t-2)+t;var factor3=factorTimes2*(t-1);var factor4=factorTimes2*(3-2*t);out[0]=a[0]*factor1+b[0]*factor2+c[0]*factor3+d[0]*factor4;out[1]=a[1]*factor1+b[1]*factor2+c[1]*factor3+d[1]*factor4;out[2]=a[2]*factor1+b[2]*factor2+c[2]*factor3+d[2]*factor4;return out}function bezier(out,a,b,c,d, +t){var inverseFactor=1-t;var inverseFactorTimesTwo=inverseFactor*inverseFactor;var factorTimes2=t*t;var factor1=inverseFactorTimesTwo*inverseFactor;var factor2=3*t*inverseFactorTimesTwo;var factor3=3*factorTimes2*inverseFactor;var factor4=factorTimes2*t;out[0]=a[0]*factor1+b[0]*factor2+c[0]*factor3+d[0]*factor4;out[1]=a[1]*factor1+b[1]*factor2+c[1]*factor3+d[1]*factor4;out[2]=a[2]*factor1+b[2]*factor2+c[2]*factor3+d[2]*factor4;return out}function random(out,scale){scale=scale||1;var r=RANDOM()*2* +Math.PI;var z=RANDOM()*2-1;var zScale=Math.sqrt(1-z*z)*scale;out[0]=Math.cos(r)*zScale;out[1]=Math.sin(r)*zScale;out[2]=z*scale;return out}function transformMat4(out,a,m){var x=a[0],y=a[1],z=a[2];var w=m[3]*x+m[7]*y+m[11]*z+m[15];w=w||1;out[0]=(m[0]*x+m[4]*y+m[8]*z+m[12])/w;out[1]=(m[1]*x+m[5]*y+m[9]*z+m[13])/w;out[2]=(m[2]*x+m[6]*y+m[10]*z+m[14])/w;return out}function transformMat3(out,a,m){var x=a[0],y=a[1],z=a[2];out[0]=x*m[0]+y*m[3]+z*m[6];out[1]=x*m[1]+y*m[4]+z*m[7];out[2]=x*m[2]+y*m[5]+z*m[8]; +return out}function transformQuat(out,a,q){var qx=q[0],qy=q[1],qz=q[2],qw=q[3];var x=a[0],y=a[1],z=a[2];var uvx=qy*z-qz*y,uvy=qz*x-qx*z,uvz=qx*y-qy*x;var uuvx=qy*uvz-qz*uvy,uuvy=qz*uvx-qx*uvz,uuvz=qx*uvy-qy*uvx;var w2=qw*2;uvx*=w2;uvy*=w2;uvz*=w2;uuvx*=2;uuvy*=2;uuvz*=2;out[0]=x+uvx+uuvx;out[1]=y+uvy+uuvy;out[2]=z+uvz+uuvz;return out}function rotateX$1(out,a,b,rad){var p=[],r=[];p[0]=a[0]-b[0];p[1]=a[1]-b[1];p[2]=a[2]-b[2];r[0]=p[0];r[1]=p[1]*Math.cos(rad)-p[2]*Math.sin(rad);r[2]=p[1]*Math.sin(rad)+ +p[2]*Math.cos(rad);out[0]=r[0]+b[0];out[1]=r[1]+b[1];out[2]=r[2]+b[2];return out}function rotateY$1(out,a,b,rad){var p=[],r=[];p[0]=a[0]-b[0];p[1]=a[1]-b[1];p[2]=a[2]-b[2];r[0]=p[2]*Math.sin(rad)+p[0]*Math.cos(rad);r[1]=p[1];r[2]=p[2]*Math.cos(rad)-p[0]*Math.sin(rad);out[0]=r[0]+b[0];out[1]=r[1]+b[1];out[2]=r[2]+b[2];return out}function rotateZ$1(out,a,b,rad){var p=[],r=[];p[0]=a[0]-b[0];p[1]=a[1]-b[1];p[2]=a[2]-b[2];r[0]=p[0]*Math.cos(rad)-p[1]*Math.sin(rad);r[1]=p[0]*Math.sin(rad)+p[1]*Math.cos(rad); +r[2]=p[2];out[0]=r[0]+b[0];out[1]=r[1]+b[1];out[2]=r[2]+b[2];return out}function angle(a,b){var ax=a[0],ay=a[1],az=a[2],bx=b[0],by=b[1],bz=b[2],mag1=Math.sqrt(ax*ax+ay*ay+az*az),mag2=Math.sqrt(bx*bx+by*by+bz*bz),mag=mag1*mag2,cosine=mag&&dot(a,b)/mag;return Math.acos(Math.min(Math.max(cosine,-1),1))}function zero(out){out[0]=0;out[1]=0;out[2]=0;return out}function str$4(a){return"vec3("+a[0]+", "+a[1]+", "+a[2]+")"}function exactEquals$4(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]}function equals$5(a, +b){var a0=a[0],a1=a[1],a2=a[2];var b0=b[0],b1=b[1],b2=b[2];return Math.abs(a0-b0)<=EPSILON*Math.max(1,Math.abs(a0),Math.abs(b0))&&Math.abs(a1-b1)<=EPSILON*Math.max(1,Math.abs(a1),Math.abs(b1))&&Math.abs(a2-b2)<=EPSILON*Math.max(1,Math.abs(a2),Math.abs(b2))}var sub$4=subtract$4;var mul$4=multiply$4;var div=divide;var dist=distance;var sqrDist=squaredDistance;var len=length;var sqrLen=squaredLength;var forEach=function(){var vec=create$4();return function(a,stride,offset,count,fn,arg){var i,l;if(!stride)stride= +3;if(!offset)offset=0;if(count)l=Math.min(count*stride+offset,a.length);else l=a.length;for(i=offset;i0)len=1/ +Math.sqrt(len);out[0]=x*len;out[1]=y*len;out[2]=z*len;out[3]=w*len;return out}function dot$1(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function cross$1(out,u,v,w){var A=v[0]*w[1]-v[1]*w[0],B=v[0]*w[2]-v[2]*w[0],C=v[0]*w[3]-v[3]*w[0],D=v[1]*w[2]-v[2]*w[1],E=v[1]*w[3]-v[3]*w[1],F=v[2]*w[3]-v[3]*w[2];var G=u[0];var H=u[1];var I=u[2];var J=u[3];out[0]=H*F-I*E+J*D;out[1]=-(G*F)+I*C-J*B;out[2]=G*E-H*C+J*A;out[3]=-(G*D)+H*B-I*A;return out}function lerp$1(out,a,b,t){var ax=a[0];var ay=a[1];var az= +a[2];var aw=a[3];out[0]=ax+t*(b[0]-ax);out[1]=ay+t*(b[1]-ay);out[2]=az+t*(b[2]-az);out[3]=aw+t*(b[3]-aw);return out}function random$1(out,scale){scale=scale||1;var v1,v2,v3,v4;var s1,s2;do{v1=RANDOM()*2-1;v2=RANDOM()*2-1;s1=v1*v1+v2*v2}while(s1>=1);do{v3=RANDOM()*2-1;v4=RANDOM()*2-1;s2=v3*v3+v4*v4}while(s2>=1);var d=Math.sqrt((1-s1)/s2);out[0]=scale*v1;out[1]=scale*v2;out[2]=scale*v3*d;out[3]=scale*v4*d;return out}function transformMat4$1(out,a,m){var x=a[0],y=a[1],z=a[2],w=a[3];out[0]=m[0]*x+m[4]* +y+m[8]*z+m[12]*w;out[1]=m[1]*x+m[5]*y+m[9]*z+m[13]*w;out[2]=m[2]*x+m[6]*y+m[10]*z+m[14]*w;out[3]=m[3]*x+m[7]*y+m[11]*z+m[15]*w;return out}function transformQuat$1(out,a,q){var x=a[0],y=a[1],z=a[2];var qx=q[0],qy=q[1],qz=q[2],qw=q[3];var ix=qw*x+qy*z-qz*y;var iy=qw*y+qz*x-qx*z;var iz=qw*z+qx*y-qy*x;var iw=-qx*x-qy*y-qz*z;out[0]=ix*qw+iw*-qx+iy*-qz-iz*-qy;out[1]=iy*qw+iw*-qy+iz*-qx-ix*-qz;out[2]=iz*qw+iw*-qz+ix*-qy-iy*-qx;out[3]=a[3];return out}function zero$1(out){out[0]=0;out[1]=0;out[2]=0;out[3]= +0;return out}function str$5(a){return"vec4("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"}function exactEquals$5(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]}function equals$6(a,b){var a0=a[0],a1=a[1],a2=a[2],a3=a[3];var b0=b[0],b1=b[1],b2=b[2],b3=b[3];return Math.abs(a0-b0)<=EPSILON*Math.max(1,Math.abs(a0),Math.abs(b0))&&Math.abs(a1-b1)<=EPSILON*Math.max(1,Math.abs(a1),Math.abs(b1))&&Math.abs(a2-b2)<=EPSILON*Math.max(1,Math.abs(a2),Math.abs(b2))&&Math.abs(a3-b3)<=EPSILON*Math.max(1,Math.abs(a3), +Math.abs(b3))}var sub$5=subtract$5;var mul$5=multiply$5;var div$1=divide$1;var dist$1=distance$1;var sqrDist$1=squaredDistance$1;var len$1=length$1;var sqrLen$1=squaredLength$1;var forEach$1=function(){var vec=create$5();return function(a,stride,offset,count,fn,arg){var i,l;if(!stride)stride=4;if(!offset)offset=0;if(count)l=Math.min(count*stride+offset,a.length);else l=a.length;for(i=offset;iEPSILON){out_axis[0]=q[0]/s;out_axis[1]=q[1]/s;out_axis[2]=q[2]/s}else{out_axis[0]=1;out_axis[1]=0;out_axis[2]=0}return rad}function getAngle(a,b){var dotproduct=dot$2(a,b);return Math.acos(2*dotproduct*dotproduct-1)}function multiply$6(out,a,b){var ax=a[0],ay=a[1],az=a[2],aw=a[3];var bx=b[0],by=b[1],bz=b[2],bw=b[3]; +out[0]=ax*bw+aw*bx+ay*bz-az*by;out[1]=ay*bw+aw*by+az*bx-ax*bz;out[2]=az*bw+aw*bz+ax*by-ay*bx;out[3]=aw*bw-ax*bx-ay*by-az*bz;return out}function rotateX$2(out,a,rad){rad*=.5;var ax=a[0],ay=a[1],az=a[2],aw=a[3];var bx=Math.sin(rad),bw=Math.cos(rad);out[0]=ax*bw+aw*bx;out[1]=ay*bw+az*bx;out[2]=az*bw-ay*bx;out[3]=aw*bw-ax*bx;return out}function rotateY$2(out,a,rad){rad*=.5;var ax=a[0],ay=a[1],az=a[2],aw=a[3];var by=Math.sin(rad),bw=Math.cos(rad);out[0]=ax*bw-az*by;out[1]=ay*bw+aw*by;out[2]=az*bw+ax*by; +out[3]=aw*bw-ay*by;return out}function rotateZ$2(out,a,rad){rad*=.5;var ax=a[0],ay=a[1],az=a[2],aw=a[3];var bz=Math.sin(rad),bw=Math.cos(rad);out[0]=ax*bw+ay*bz;out[1]=ay*bw-ax*bz;out[2]=az*bw+aw*bz;out[3]=aw*bw-az*bz;return out}function calculateW(out,a){var x=a[0],y=a[1],z=a[2];out[0]=x;out[1]=y;out[2]=z;out[3]=Math.sqrt(Math.abs(1-x*x-y*y-z*z));return out}function exp(out,a){var x=a[0],y=a[1],z=a[2],w=a[3];var r=Math.sqrt(x*x+y*y+z*z);var et=Math.exp(w);var s=r>0?et*Math.sin(r)/r:0;out[0]=x*s; +out[1]=y*s;out[2]=z*s;out[3]=et*Math.cos(r);return out}function ln(out,a){var x=a[0],y=a[1],z=a[2],w=a[3];var r=Math.sqrt(x*x+y*y+z*z);var t=r>0?Math.atan2(r,w)/r:0;out[0]=x*t;out[1]=y*t;out[2]=z*t;out[3]=.5*Math.log(x*x+y*y+z*z+w*w);return out}function pow(out,a,b){ln(out,a);scale$6(out,out,b);exp(out,out);return out}function slerp(out,a,b,t){var ax=a[0],ay=a[1],az=a[2],aw=a[3];var bx=b[0],by=b[1],bz=b[2],bw=b[3];var omega,cosom,sinom,scale0,scale1;cosom=ax*bx+ay*by+az*bz+aw*bw;if(cosom<0){cosom= +-cosom;bx=-bx;by=-by;bz=-bz;bw=-bw}if(1-cosom>EPSILON){omega=Math.acos(cosom);sinom=Math.sin(omega);scale0=Math.sin((1-t)*omega)/sinom;scale1=Math.sin(t*omega)/sinom}else{scale0=1-t;scale1=t}out[0]=scale0*ax+scale1*bx;out[1]=scale0*ay+scale1*by;out[2]=scale0*az+scale1*bz;out[3]=scale0*aw+scale1*bw;return out}function random$2(out){var u1=RANDOM();var u2=RANDOM();var u3=RANDOM();var sqrt1MinusU1=Math.sqrt(1-u1);var sqrtU1=Math.sqrt(u1);out[0]=sqrt1MinusU1*Math.sin(2*Math.PI*u2);out[1]=sqrt1MinusU1* +Math.cos(2*Math.PI*u2);out[2]=sqrtU1*Math.sin(2*Math.PI*u3);out[3]=sqrtU1*Math.cos(2*Math.PI*u3);return out}function invert$4(out,a){var a0=a[0],a1=a[1],a2=a[2],a3=a[3];var dot=a0*a0+a1*a1+a2*a2+a3*a3;var invDot=dot?1/dot:0;out[0]=-a0*invDot;out[1]=-a1*invDot;out[2]=-a2*invDot;out[3]=a3*invDot;return out}function conjugate(out,a){out[0]=-a[0];out[1]=-a[1];out[2]=-a[2];out[3]=a[3];return out}function fromMat3(out,m){var fTrace=m[0]+m[4]+m[8];var fRoot;if(fTrace>0){fRoot=Math.sqrt(fTrace+1);out[3]= +.5*fRoot;fRoot=.5/fRoot;out[0]=(m[5]-m[7])*fRoot;out[1]=(m[6]-m[2])*fRoot;out[2]=(m[1]-m[3])*fRoot}else{var i=0;if(m[4]>m[0])i=1;if(m[8]>m[i*3+i])i=2;var j=(i+1)%3;var k=(i+2)%3;fRoot=Math.sqrt(m[i*3+i]-m[j*3+j]-m[k*3+k]+1);out[i]=.5*fRoot;fRoot=.5/fRoot;out[3]=(m[j*3+k]-m[k*3+j])*fRoot;out[j]=(m[j*3+i]+m[i*3+j])*fRoot;out[k]=(m[k*3+i]+m[i*3+k])*fRoot}return out}function fromEuler(out,x,y,z){var halfToRad=.5*Math.PI/180;x*=halfToRad;y*=halfToRad;z*=halfToRad;var sx=Math.sin(x);var cx=Math.cos(x); +var sy=Math.sin(y);var cy=Math.cos(y);var sz=Math.sin(z);var cz=Math.cos(z);out[0]=sx*cy*cz-cx*sy*sz;out[1]=cx*sy*cz+sx*cy*sz;out[2]=cx*cy*sz-sx*sy*cz;out[3]=cx*cy*cz+sx*sy*sz;return out}function str$6(a){return"quat("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"}var clone$6=clone$5;var fromValues$6=fromValues$5;var copy$6=copy$5;var set$6=set$5;var add$6=add$5;var mul$6=multiply$6;var scale$6=scale$5;var dot$2=dot$1;var lerp$2=lerp$1;var length$2=length$1;var len$2=length$2;var squaredLength$2=squaredLength$1; +var sqrLen$2=squaredLength$2;var normalize$2=normalize$1;var exactEquals$6=exactEquals$5;var equals$7=equals$6;var rotationTo=function(){var tmpvec3=create$4();var xUnitVec3=fromValues$4(1,0,0);var yUnitVec3=fromValues$4(0,1,0);return function(out,a,b){var dot$1=dot(a,b);if(dot$1<-.999999){cross(tmpvec3,xUnitVec3,a);if(len(tmpvec3)<1E-6)cross(tmpvec3,yUnitVec3,a);normalize(tmpvec3,tmpvec3);setAxisAngle(out,tmpvec3,Math.PI);return out}else if(dot$1>.999999){out[0]=0;out[1]=0;out[2]=0;out[3]=1;return out}else{cross(tmpvec3, +a,b);out[0]=tmpvec3[0];out[1]=tmpvec3[1];out[2]=tmpvec3[2];out[3]=1+dot$1;return normalize$2(out,out)}}}();var sqlerp=function(){var temp1=create$6();var temp2=create$6();return function(out,a,b,c,d,t){slerp(temp1,a,d,t);slerp(temp2,b,c,t);slerp(out,temp1,temp2,2*t*(1-t));return out}}();var setAxes=function(){var matr=create$2();return function(out,view,right,up){matr[0]=right[0];matr[3]=right[1];matr[6]=right[2];matr[1]=up[0];matr[4]=up[1];matr[7]=up[2];matr[2]=-view[0];matr[5]=-view[1];matr[8]= +-view[2];return normalize$2(out,fromMat3(out,matr))}}();var quat=Object.freeze({__proto__:null,create:create$6,identity:identity$4,setAxisAngle:setAxisAngle,getAxisAngle:getAxisAngle,getAngle:getAngle,multiply:multiply$6,rotateX:rotateX$2,rotateY:rotateY$2,rotateZ:rotateZ$2,calculateW:calculateW,exp:exp,ln:ln,pow:pow,slerp:slerp,random:random$2,invert:invert$4,conjugate:conjugate,fromMat3:fromMat3,fromEuler:fromEuler,str:str$6,clone:clone$6,fromValues:fromValues$6,copy:copy$6,set:set$6,add:add$6, +mul:mul$6,scale:scale$6,dot:dot$2,lerp:lerp$2,length:length$2,len:len$2,squaredLength:squaredLength$2,sqrLen:sqrLen$2,normalize:normalize$2,exactEquals:exactEquals$6,equals:equals$7,rotationTo:rotationTo,sqlerp:sqlerp,setAxes:setAxes});function create$7(){var dq=new ARRAY_TYPE(8);if(ARRAY_TYPE!=Float32Array){dq[0]=0;dq[1]=0;dq[2]=0;dq[4]=0;dq[5]=0;dq[6]=0;dq[7]=0}dq[3]=1;return dq}function clone$7(a){var dq=new ARRAY_TYPE(8);dq[0]=a[0];dq[1]=a[1];dq[2]=a[2];dq[3]=a[3];dq[4]=a[4];dq[5]=a[5];dq[6]= +a[6];dq[7]=a[7];return dq}function fromValues$7(x1,y1,z1,w1,x2,y2,z2,w2){var dq=new ARRAY_TYPE(8);dq[0]=x1;dq[1]=y1;dq[2]=z1;dq[3]=w1;dq[4]=x2;dq[5]=y2;dq[6]=z2;dq[7]=w2;return dq}function fromRotationTranslationValues(x1,y1,z1,w1,x2,y2,z2){var dq=new ARRAY_TYPE(8);dq[0]=x1;dq[1]=y1;dq[2]=z1;dq[3]=w1;var ax=x2*.5,ay=y2*.5,az=z2*.5;dq[4]=ax*w1+ay*z1-az*y1;dq[5]=ay*w1+az*x1-ax*z1;dq[6]=az*w1+ax*y1-ay*x1;dq[7]=-ax*x1-ay*y1-az*z1;return dq}function fromRotationTranslation$1(out,q,t){var ax=t[0]*.5,ay= +t[1]*.5,az=t[2]*.5,bx=q[0],by=q[1],bz=q[2],bw=q[3];out[0]=bx;out[1]=by;out[2]=bz;out[3]=bw;out[4]=ax*bw+ay*bz-az*by;out[5]=ay*bw+az*bx-ax*bz;out[6]=az*bw+ax*by-ay*bx;out[7]=-ax*bx-ay*by-az*bz;return out}function fromTranslation$3(out,t){out[0]=0;out[1]=0;out[2]=0;out[3]=1;out[4]=t[0]*.5;out[5]=t[1]*.5;out[6]=t[2]*.5;out[7]=0;return out}function fromRotation$4(out,q){out[0]=q[0];out[1]=q[1];out[2]=q[2];out[3]=q[3];out[4]=0;out[5]=0;out[6]=0;out[7]=0;return out}function fromMat4$1(out,a){var outer= +create$6();getRotation(outer,a);var t=new ARRAY_TYPE(3);getTranslation(t,a);fromRotationTranslation$1(out,outer,t);return out}function copy$7(out,a){out[0]=a[0];out[1]=a[1];out[2]=a[2];out[3]=a[3];out[4]=a[4];out[5]=a[5];out[6]=a[6];out[7]=a[7];return out}function identity$5(out){out[0]=0;out[1]=0;out[2]=0;out[3]=1;out[4]=0;out[5]=0;out[6]=0;out[7]=0;return out}function set$7(out,x1,y1,z1,w1,x2,y2,z2,w2){out[0]=x1;out[1]=y1;out[2]=z1;out[3]=w1;out[4]=x2;out[5]=y2;out[6]=z2;out[7]=w2;return out}var getReal= +copy$6;function getDual(out,a){out[0]=a[4];out[1]=a[5];out[2]=a[6];out[3]=a[7];return out}var setReal=copy$6;function setDual(out,q){out[4]=q[0];out[5]=q[1];out[6]=q[2];out[7]=q[3];return out}function getTranslation$1(out,a){var ax=a[4],ay=a[5],az=a[6],aw=a[7],bx=-a[0],by=-a[1],bz=-a[2],bw=a[3];out[0]=(ax*bw+aw*bx+ay*bz-az*by)*2;out[1]=(ay*bw+aw*by+az*bx-ax*bz)*2;out[2]=(az*bw+aw*bz+ax*by-ay*bx)*2;return out}function translate$3(out,a,v){var ax1=a[0],ay1=a[1],az1=a[2],aw1=a[3],bx1=v[0]*.5,by1=v[1]* +.5,bz1=v[2]*.5,ax2=a[4],ay2=a[5],az2=a[6],aw2=a[7];out[0]=ax1;out[1]=ay1;out[2]=az1;out[3]=aw1;out[4]=aw1*bx1+ay1*bz1-az1*by1+ax2;out[5]=aw1*by1+az1*bx1-ax1*bz1+ay2;out[6]=aw1*bz1+ax1*by1-ay1*bx1+az2;out[7]=-ax1*bx1-ay1*by1-az1*bz1+aw2;return out}function rotateX$3(out,a,rad){var bx=-a[0],by=-a[1],bz=-a[2],bw=a[3],ax=a[4],ay=a[5],az=a[6],aw=a[7],ax1=ax*bw+aw*bx+ay*bz-az*by,ay1=ay*bw+aw*by+az*bx-ax*bz,az1=az*bw+aw*bz+ax*by-ay*bx,aw1=aw*bw-ax*bx-ay*by-az*bz;rotateX$2(out,a,rad);bx=out[0];by=out[1]; +bz=out[2];bw=out[3];out[4]=ax1*bw+aw1*bx+ay1*bz-az1*by;out[5]=ay1*bw+aw1*by+az1*bx-ax1*bz;out[6]=az1*bw+aw1*bz+ax1*by-ay1*bx;out[7]=aw1*bw-ax1*bx-ay1*by-az1*bz;return out}function rotateY$3(out,a,rad){var bx=-a[0],by=-a[1],bz=-a[2],bw=a[3],ax=a[4],ay=a[5],az=a[6],aw=a[7],ax1=ax*bw+aw*bx+ay*bz-az*by,ay1=ay*bw+aw*by+az*bx-ax*bz,az1=az*bw+aw*bz+ax*by-ay*bx,aw1=aw*bw-ax*bx-ay*by-az*bz;rotateY$2(out,a,rad);bx=out[0];by=out[1];bz=out[2];bw=out[3];out[4]=ax1*bw+aw1*bx+ay1*bz-az1*by;out[5]=ay1*bw+aw1*by+ +az1*bx-ax1*bz;out[6]=az1*bw+aw1*bz+ax1*by-ay1*bx;out[7]=aw1*bw-ax1*bx-ay1*by-az1*bz;return out}function rotateZ$3(out,a,rad){var bx=-a[0],by=-a[1],bz=-a[2],bw=a[3],ax=a[4],ay=a[5],az=a[6],aw=a[7],ax1=ax*bw+aw*bx+ay*bz-az*by,ay1=ay*bw+aw*by+az*bx-ax*bz,az1=az*bw+aw*bz+ax*by-ay*bx,aw1=aw*bw-ax*bx-ay*by-az*bz;rotateZ$2(out,a,rad);bx=out[0];by=out[1];bz=out[2];bw=out[3];out[4]=ax1*bw+aw1*bx+ay1*bz-az1*by;out[5]=ay1*bw+aw1*by+az1*bx-ax1*bz;out[6]=az1*bw+aw1*bz+ax1*by-ay1*bx;out[7]=aw1*bw-ax1*bx-ay1*by- +az1*bz;return out}function rotateByQuatAppend(out,a,q){var qx=q[0],qy=q[1],qz=q[2],qw=q[3],ax=a[0],ay=a[1],az=a[2],aw=a[3];out[0]=ax*qw+aw*qx+ay*qz-az*qy;out[1]=ay*qw+aw*qy+az*qx-ax*qz;out[2]=az*qw+aw*qz+ax*qy-ay*qx;out[3]=aw*qw-ax*qx-ay*qy-az*qz;ax=a[4];ay=a[5];az=a[6];aw=a[7];out[4]=ax*qw+aw*qx+ay*qz-az*qy;out[5]=ay*qw+aw*qy+az*qx-ax*qz;out[6]=az*qw+aw*qz+ax*qy-ay*qx;out[7]=aw*qw-ax*qx-ay*qy-az*qz;return out}function rotateByQuatPrepend(out,q,a){var qx=q[0],qy=q[1],qz=q[2],qw=q[3],bx=a[0],by=a[1], +bz=a[2],bw=a[3];out[0]=qx*bw+qw*bx+qy*bz-qz*by;out[1]=qy*bw+qw*by+qz*bx-qx*bz;out[2]=qz*bw+qw*bz+qx*by-qy*bx;out[3]=qw*bw-qx*bx-qy*by-qz*bz;bx=a[4];by=a[5];bz=a[6];bw=a[7];out[4]=qx*bw+qw*bx+qy*bz-qz*by;out[5]=qy*bw+qw*by+qz*bx-qx*bz;out[6]=qz*bw+qw*bz+qx*by-qy*bx;out[7]=qw*bw-qx*bx-qy*by-qz*bz;return out}function rotateAroundAxis(out,a,axis,rad){if(Math.abs(rad)0){magnitude=Math.sqrt(magnitude);var a0=a[0]/magnitude;var a1=a[1]/magnitude;var a2=a[2]/magnitude;var a3=a[3]/magnitude;var b0=a[4];var b1=a[5];var b2=a[6];var b3=a[7];var a_dot_b=a0*b0+a1*b1+a2*b2+a3*b3;out[0]=a0;out[1]=a1;out[2]=a2;out[3]=a3;out[4]=(b0-a0*a_dot_b)/magnitude;out[5]=(b1-a1*a_dot_b)/magnitude;out[6]=(b2- +a2*a_dot_b)/magnitude;out[7]=(b3-a3*a_dot_b)/magnitude}return out}function str$7(a){return"quat2("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+")"}function exactEquals$7(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[7]===b[7]}function equals$8(a,b){var a0=a[0],a1=a[1],a2=a[2],a3=a[3],a4=a[4],a5=a[5],a6=a[6],a7=a[7];var b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5],b6=b[6],b7=b[7];return Math.abs(a0-b0)<=EPSILON* +Math.max(1,Math.abs(a0),Math.abs(b0))&&Math.abs(a1-b1)<=EPSILON*Math.max(1,Math.abs(a1),Math.abs(b1))&&Math.abs(a2-b2)<=EPSILON*Math.max(1,Math.abs(a2),Math.abs(b2))&&Math.abs(a3-b3)<=EPSILON*Math.max(1,Math.abs(a3),Math.abs(b3))&&Math.abs(a4-b4)<=EPSILON*Math.max(1,Math.abs(a4),Math.abs(b4))&&Math.abs(a5-b5)<=EPSILON*Math.max(1,Math.abs(a5),Math.abs(b5))&&Math.abs(a6-b6)<=EPSILON*Math.max(1,Math.abs(a6),Math.abs(b6))&&Math.abs(a7-b7)<=EPSILON*Math.max(1,Math.abs(a7),Math.abs(b7))}var quat2=Object.freeze({__proto__:null, +create:create$7,clone:clone$7,fromValues:fromValues$7,fromRotationTranslationValues:fromRotationTranslationValues,fromRotationTranslation:fromRotationTranslation$1,fromTranslation:fromTranslation$3,fromRotation:fromRotation$4,fromMat4:fromMat4$1,copy:copy$7,identity:identity$5,set:set$7,getReal:getReal,getDual:getDual,setReal:setReal,setDual:setDual,getTranslation:getTranslation$1,translate:translate$3,rotateX:rotateX$3,rotateY:rotateY$3,rotateZ:rotateZ$3,rotateByQuatAppend:rotateByQuatAppend,rotateByQuatPrepend:rotateByQuatPrepend, +rotateAroundAxis:rotateAroundAxis,add:add$7,multiply:multiply$7,mul:mul$7,scale:scale$7,dot:dot$3,lerp:lerp$3,invert:invert$5,conjugate:conjugate$1,length:length$3,len:len$3,squaredLength:squaredLength$3,sqrLen:sqrLen$3,normalize:normalize$3,str:str$7,exactEquals:exactEquals$7,equals:equals$8});function create$8(){var out=new ARRAY_TYPE(2);if(ARRAY_TYPE!=Float32Array){out[0]=0;out[1]=0}return out}function clone$8(a){var out=new ARRAY_TYPE(2);out[0]=a[0];out[1]=a[1];return out}function fromValues$8(x, +y){var out=new ARRAY_TYPE(2);out[0]=x;out[1]=y;return out}function copy$8(out,a){out[0]=a[0];out[1]=a[1];return out}function set$8(out,x,y){out[0]=x;out[1]=y;return out}function add$8(out,a,b){out[0]=a[0]+b[0];out[1]=a[1]+b[1];return out}function subtract$6(out,a,b){out[0]=a[0]-b[0];out[1]=a[1]-b[1];return out}function multiply$8(out,a,b){out[0]=a[0]*b[0];out[1]=a[1]*b[1];return out}function divide$2(out,a,b){out[0]=a[0]/b[0];out[1]=a[1]/b[1];return out}function ceil$2(out,a){out[0]=Math.ceil(a[0]); +out[1]=Math.ceil(a[1]);return out}function floor$2(out,a){out[0]=Math.floor(a[0]);out[1]=Math.floor(a[1]);return out}function min$2(out,a,b){out[0]=Math.min(a[0],b[0]);out[1]=Math.min(a[1],b[1]);return out}function max$2(out,a,b){out[0]=Math.max(a[0],b[0]);out[1]=Math.max(a[1],b[1]);return out}function round$2(out,a){out[0]=Math.round(a[0]);out[1]=Math.round(a[1]);return out}function scale$8(out,a,b){out[0]=a[0]*b;out[1]=a[1]*b;return out}function scaleAndAdd$2(out,a,b,scale){out[0]=a[0]+b[0]*scale; +out[1]=a[1]+b[1]*scale;return out}function distance$2(a,b){var x=b[0]-a[0],y=b[1]-a[1];return Math.hypot(x,y)}function squaredDistance$2(a,b){var x=b[0]-a[0],y=b[1]-a[1];return x*x+y*y}function length$4(a){var x=a[0],y=a[1];return Math.hypot(x,y)}function squaredLength$4(a){var x=a[0],y=a[1];return x*x+y*y}function negate$2(out,a){out[0]=-a[0];out[1]=-a[1];return out}function inverse$2(out,a){out[0]=1/a[0];out[1]=1/a[1];return out}function normalize$4(out,a){var x=a[0],y=a[1];var len=x*x+y*y;if(len> +0)len=1/Math.sqrt(len);out[0]=a[0]*len;out[1]=a[1]*len;return out}function dot$4(a,b){return a[0]*b[0]+a[1]*b[1]}function cross$2(out,a,b){var z=a[0]*b[1]-a[1]*b[0];out[0]=out[1]=0;out[2]=z;return out}function lerp$4(out,a,b,t){var ax=a[0],ay=a[1];out[0]=ax+t*(b[0]-ax);out[1]=ay+t*(b[1]-ay);return out}function random$3(out,scale){scale=scale||1;var r=RANDOM()*2*Math.PI;out[0]=Math.cos(r)*scale;out[1]=Math.sin(r)*scale;return out}function transformMat2(out,a,m){var x=a[0],y=a[1];out[0]=m[0]*x+m[2]* +y;out[1]=m[1]*x+m[3]*y;return out}function transformMat2d(out,a,m){var x=a[0],y=a[1];out[0]=m[0]*x+m[2]*y+m[4];out[1]=m[1]*x+m[3]*y+m[5];return out}function transformMat3$1(out,a,m){var x=a[0],y=a[1];out[0]=m[0]*x+m[3]*y+m[6];out[1]=m[1]*x+m[4]*y+m[7];return out}function transformMat4$2(out,a,m){var x=a[0];var y=a[1];out[0]=m[0]*x+m[4]*y+m[12];out[1]=m[1]*x+m[5]*y+m[13];return out}function rotate$4(out,a,b,rad){var p0=a[0]-b[0],p1=a[1]-b[1],sinC=Math.sin(rad),cosC=Math.cos(rad);out[0]=p0*cosC-p1* +sinC+b[0];out[1]=p0*sinC+p1*cosC+b[1];return out}function angle$1(a,b){var x1=a[0],y1=a[1],x2=b[0],y2=b[1],mag=Math.sqrt(x1*x1+y1*y1)*Math.sqrt(x2*x2+y2*y2),cosine=mag&&(x1*x2+y1*y2)/mag;return Math.acos(Math.min(Math.max(cosine,-1),1))}function zero$2(out){out[0]=0;out[1]=0;return out}function str$8(a){return"vec2("+a[0]+", "+a[1]+")"}function exactEquals$8(a,b){return a[0]===b[0]&&a[1]===b[1]}function equals$9(a,b){var a0=a[0],a1=a[1];var b0=b[0],b1=b[1];return Math.abs(a0-b0)<=EPSILON*Math.max(1, +Math.abs(a0),Math.abs(b0))&&Math.abs(a1-b1)<=EPSILON*Math.max(1,Math.abs(a1),Math.abs(b1))}var len$4=length$4;var sub$6=subtract$6;var mul$8=multiply$8;var div$2=divide$2;var dist$2=distance$2;var sqrDist$2=squaredDistance$2;var sqrLen$4=squaredLength$4;var forEach$2=function(){var vec=create$8();return function(a,stride,offset,count,fn,arg){var i,l;if(!stride)stride=2;if(!offset)offset=0;if(count)l=Math.min(count*stride+offset,a.length);else l=a.length;for(i=offset;i=0&&s<=1&&t>=0&&t<=1}function triangleArea(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(c[0]-a[0])*(b[1]-a[1])}function isLeft(a,b,c){return triangleArea(a,b,c)>0}function isLeftOn(a,b,c){return triangleArea(a,b,c)>=0}function isRight(a,b,c){return triangleArea(a,b,c)<0}function isRightOn(a,b,c){return triangleArea(a,b,c)<=0}var tmpPoint1=[],tmpPoint2=[];function collinear(a,b,c,thresholdAngle){if(!thresholdAngle)return triangleArea(a, +b,c)===0;else{var ab=tmpPoint1,bc=tmpPoint2;ab[0]=b[0]-a[0];ab[1]=b[1]-a[1];bc[0]=c[0]-b[0];bc[1]=c[1]-b[1];var dot=ab[0]*bc[0]+ab[1]*bc[1],magA=Math.sqrt(ab[0]*ab[0]+ab[1]*ab[1]),magB=Math.sqrt(bc[0]*bc[0]+bc[1]*bc[1]),angle=Math.acos(dot/(magA*magB));return anglev[br][0])br=i;if(!isLeft(polygonAt(polygon,br-1),polygonAt(polygon,br),polygonAt(polygon,br+1))){polygonReverse(polygon);return true}else return false}function polygonReverse(polygon){var tmp=[];var N=polygon.length;for(var i=0;i!==N;i++)tmp.push(polygon.pop());for(var i=0;i!==N;i++)polygon[i]=tmp[i]}function polygonIsReflex(polygon, +i){return isRight(polygonAt(polygon,i-1),polygonAt(polygon,i),polygonAt(polygon,i+1))}var tmpLine1=[],tmpLine2=[];function polygonCanSee(polygon,a,b){var p,dist,l1=tmpLine1,l2=tmpLine2;if(isLeftOn(polygonAt(polygon,a+1),polygonAt(polygon,a),polygonAt(polygon,b))&&isRightOn(polygonAt(polygon,a-1),polygonAt(polygon,a),polygonAt(polygon,b)))return false;dist=sqdist(polygonAt(polygon,a),polygonAt(polygon,b));for(var i=0;i!==polygon.length;++i){if((i+1)%polygon.length===a||i===a)continue;if(isLeftOn(polygonAt(polygon, +a),polygonAt(polygon,b),polygonAt(polygon,i+1))&&isRightOn(polygonAt(polygon,a),polygonAt(polygon,b),polygonAt(polygon,i))){l1[0]=polygonAt(polygon,a);l1[1]=polygonAt(polygon,b);l2[0]=polygonAt(polygon,i);l2[1]=polygonAt(polygon,i+1);p=lineInt(l1,l2);if(sqdist(polygonAt(polygon,a),p)0)return polygonSlice(polygon,edges);else return[polygon]}function polygonSlice(polygon, +cutEdges){if(cutEdges.length===0)return[polygon];if(cutEdges instanceof Array&&cutEdges.length&&cutEdges[0]instanceof Array&&cutEdges[0].length===2&&cutEdges[0][0]instanceof Array){var polys=[polygon];for(var i=0;imaxlevel){console.warn("quickDecomp: max level ("+maxlevel+") reached.");return result}for(var i=0;iupperIndex)upperIndex+=polygon.length;closestDist=Number.MAX_VALUE;if(upperIndex3&&i>=0;--i)if(collinear(polygonAt(polygon,i-1),polygonAt(polygon, +i),polygonAt(polygon,i+1),precision)){polygon.splice(i%polygon.length,1);num++}return num}function polygonRemoveDuplicatePoints(polygon,precision){for(var i=polygon.length-1;i>=1;--i){var pi=polygon[i];for(var j=i-1;j>=0;--j)if(points_eq(pi,polygon[j],precision)){polygon.splice(i,1);continue}}}function scalar_eq(a,b,precision){precision=precision||0;return Math.abs(a-b)<=precision}function points_eq(a,b,precision){return scalar_eq(a[0],b[0],precision)&&scalar_eq(a[1],b[1],precision)}self.polyDecomp= +{decomp:polygonDecomp,quickDecomp:polygonQuickDecomp,isSimple:polygonIsSimple,removeCollinearPoints:polygonRemoveCollinearPoints,removeDuplicatePoints:polygonRemoveDuplicatePoints,makeCCW:polygonMakeCCW}}; + + +// c3/lib/c3.js +'use strict';{let isReady=false;let hasAppStarted=false;let buildMode="dev";const C3=self.C3=class C3{constructor(){throw TypeError("static class can't be instantiated");}static SetReady(){isReady=true}static IsReady(){return isReady}static SetAppStarted(){hasAppStarted=true}static HasAppStarted(){return hasAppStarted}static SetBuildMode(m){buildMode=m}static GetBuildMode(){return buildMode}static IsReleaseBuild(){return buildMode==="final"}};C3.isDebug=false;C3.isDebugDefend=false;C3.hardwareConcurrency= +navigator.hardwareConcurrency||2}; + + +// ../lib/queryParser.js +'use strict';{const C3=self.C3;C3.QueryParser=class QueryParser{constructor(queryString){this._queryString=queryString;this._parameters=new Map;this._Parse()}_Parse(){let str=this._queryString;if(str.startsWith("?")||str.startsWith("#"))str=str.substr(1);const arr=str.split("&");for(const p of arr)this._ParseParameter(p)}_ParseParameter(p){if(!p)return;if(!p.includes("=")){this._parameters.set(p,null);return}const i=p.indexOf("=");const parameterName=decodeURIComponent(p.substring(0,i));const parameterValue= +decodeURIComponent(p.substring(i+1));this._parameters.set(parameterName,parameterValue)}LogAll(){for(const e of this._parameters)console.log("[QueryParser] Parameter '"+e[0]+"' = "+(e[1]===null?"null":"'"+e[1]+"'"))}Has(name){return this._parameters.has(name)}Get(name){const ret=this._parameters.get(name);if(typeof ret==="undefined")return null;else return ret}ClearHash(){history.replaceState("",document.title,location.pathname+location.search)}Reparse(str){this._queryString=str;this._parameters.clear(); +this._Parse()}};C3.QueryString=new C3.QueryParser(location.search);C3.LocationHashString=new C3.QueryParser(location.hash);if(C3.QueryString.Get("mode")!=="dev")C3.SetBuildMode("final")}; + + +// ../lib/detect/detect.js +'use strict';{const C3=self.C3;const UNKNOWN="(unknown)";const UA=navigator.userAgent;let Flags={linux:/linux|openbsd|freebsd|netbsd/i.test(UA),chromeOS:/CrOS/.test(UA),windowsTizen:/trident|iemobile|msie|tizen/i.test(UA),genericMS:/trident|iemobile|msie|edge\//i.test(UA),opera:/OPR\//.test(UA),blackberry:/bb10/i.test(UA),edge:/edge\//i.test(UA),trident:/trident/i.test(UA),webkit:/webkit/i.test(UA),safari:/safari\//i.test(UA),chrome:/chrome\//i.test(UA),chromium:/chromium\//i.test(UA),crosswalk:/crosswalk|xwalk/i.test(UA), +nwjs:/nwjs/i.test(UA),amazonwebapp:/amazonwebappplatform/i.test(UA),webview:/wv\)/.test(UA),android:/android/i.test(UA),nokia:/nokiabrowser\/[0-9.]+/i.test(UA)};let Versions={windows:/windows\s+nt\s+\d+\.\d+/i.exec(UA),OSX:/mac\s+os\s+x\s+[0-9_]+/i.exec(UA),android:/android\s+[0-9.]+/i.exec(UA),opera:/OPR\/[0-9.]+/.exec(UA),tizen:/tizen\s+[0-9.]+/i.exec(UA),iphone:/iphone\s+os\s+[0-9_]+/i.exec(UA),ipad:/ipad[^)]*os\s+[0-9_]+/i.exec(UA),winPhone:/windows\s+phone\s+[0-9.]+/i.exec(UA),winPhoneOS:/windows\s+phone\s+os\s+[0-9.]+/i.exec(UA), +chrome:/chrome\/[0-9.]+/i.exec(UA),chromium:/chromium\/[0-9.]+/i.exec(UA),nwjs:/nwjs\/[0-9.]+/i.exec(UA),firefox:/firefox\/[0-9.]+/i.exec(UA),ie:/msie\s+[0-9.]+/i.exec(UA),edge:/edge\/[0-9.]+/i.exec(UA),edgeChromium:/edg\/[0-9.]+/i.exec(UA),silk:/silk\/[0-9.]+/i.exec(UA)};let os=UNKNOWN;let os_version=UNKNOWN;let os_arch=UNKNOWN;let browser=UNKNOWN;let browser_version=UNKNOWN;let browser_arch=UNKNOWN;let engine=UNKNOWN;let context="browser";let is_desktop=false;let is_desktop_app=false;let testResults= +new Map;function runTest(name,value,fn){if(value===true){const result=fn();testResults.set(name,true)}else if(value&&value.length){const result=fn(value[0]);testResults.set(name,true)}else;}runTest("isWindows",Versions.windows,WIN=>{os="Windows";const nt_ver=WIN.split(" ")[2];if(nt_ver)switch(nt_ver){case "5.0":os_version="2000";break;case "5.1":os_version="XP";break;case "5.2":os_version="XP";break;case "6.0":os_version="Vista";break;case "6.1":os_version="7";break;case "6.2":os_version="8";break; +case "6.3":os_version="8.1";break;case "10.0":os_version="10";break}});runTest("isOSX",Versions.OSX,OSX=>{os="Mac OS X";const osx_ver=OSX.split(" ")[3];if(osx_ver)os_version=osx_ver.replace("_",".")});runTest("isLinux",Flags.linux,()=>{os="Linux"});runTest("isChromeOS",Flags.chromeOS,()=>{os="Chrome OS"});runTest("isAndroid",!Flags.windowsTizen&&Versions.android,AND=>{os="Android";const android_ver=AND.split(" ")[1];if(android_ver)os_version=android_ver});runTest("isTizen",Versions.tizen,TIZ=>{os= +"Tizen";const tizen_ver=TIZ.split(" ")[1];if(tizen_ver)os_version=tizen_ver});runTest("isIPhone",!Flags.windowsTizen&&Versions.iphone,IOS=>{os="iOS";const ios_ver=IOS.split(" ")[2];if(ios_ver)os_version=ios_ver.replace("_",".")});runTest("isIPad",!Flags.windowsTizen&&Versions.ipad,IOS=>{os="iOS";const ios_ver=IOS.split(" ")[3];if(ios_ver)os_version=ios_ver.replace("_",".")});runTest("isWindowsPhone",Versions.winPhone,WIN=>{os="Windows Phone";const ver_str=WIN.split(" ")[2];if(ver_str)os_version=ver_str}); +runTest("isWindowsPhoneOS",Versions.winPhoneOS,WIN=>{os="Windows Phone";const ver_str=WIN.split(" ")[3];if(ver_str)os_version=ver_str});runTest("isBlackberry",Flags.blackberry,()=>{os="Blackberry";os_version="10";browser="stock";engine="webkit"});runTest("isChrome",!Flags.edge&&!Flags.opera&&Versions.chrome,CHR=>{browser="Chrome";engine="Chromium";const ver_str=CHR.split("/")[1];if(ver_str)browser_version=ver_str});runTest("isOpera",Versions.opera,OPR=>{browser="Opera";engine="Chromium";const ver_str= +OPR.split("/")[1];if(ver_str)browser_version=ver_str});runTest("isChromium",Versions.chromium,CHR=>{browser="Chromium";engine="Chromium";const ver_str=CHR.split("/")[1];if(ver_str)browser_version=ver_str});runTest("isFirefox",Versions.firefox,FIR=>{browser="Firefox";engine="Gecko";const ver_str=FIR.split("/")[1];if(ver_str)browser_version=ver_str});runTest("isInternetExplorer",Versions.ie,IE=>{browser="Internet Explorer";engine="Trident";const ver_str=IE.split(" ")[1];if(ver_str)browser_version=ver_str}); +runTest("isTrident",browser!=="Internet Explorer"&&Flags.trident,()=>{engine="Trident";const rRv=/rv:[0-9.]+/i.exec(UA);if(rRv&&rRv.length){browser="Internet Explorer";const ver_str=rRv[0].split(":")[1];if(ver_str)browser_version=ver_str}});runTest("isEdge",Versions.edge,EDGE=>{browser="Edge";engine="Edge";const ver_str=EDGE.split("/")[1];if(ver_str)browser_version=ver_str});runTest("isEdgeChromium",Versions.edgeChromium,EDGECHR=>{browser="Edge";engine="Chromium";const ver_str=EDGECHR.split("/")[1]; +if(ver_str)browser_version=ver_str});runTest("isSafari",Flags.safari&&!Flags.nokia&&!Flags.chrome&&!Flags.chromium&&!Flags.genericIE&&!Flags.blackberry,()=>{browser="Safari";engine="WebKit";const rVersion=/version\/[0-9.]+/i.exec(UA);const rChromeiOS=/crios\/[0-9.]+/i.exec(UA);const rFirefoxiOS=/fxios\/[0-9.]+/i.exec(UA);if(rVersion&&rVersion.length){const ver_str=rVersion[0].split("/")[1];if(ver_str)browser_version=ver_str}if(rChromeiOS&&rChromeiOS.length){browser="Chrome for iOS";const ver_str= +rChromeiOS[0].split("/")[1];if(ver_str)browser_version=ver_str}if(rFirefoxiOS&&rFirefoxiOS.length){browser="Firefox for iOS";const ver_str=rFirefoxiOS[0].split("/")[1];if(ver_str)browser_version=ver_str}});runTest("isSilk",Versions.silk,SILK=>{browser="Silk";const ver_str=SILK.split("/")[1];if(ver_str)browser_version=ver_str});runTest("isCrosswalk",Flags.crosswalk,()=>context="crosswalk");runTest("isCordova",self["device"]&&(self["device"]["cordova"]||self["device"]["phonegap"]),()=>context="cordova"); +runTest("isNWJS",Versions.nwjs,NWJS=>{context="nwjs";browser="NW.js";engine="Chromium";const ver_str=NWJS.split("/")[1];if(ver_str)browser_version=ver_str});runTest("isAmazonWebApp",Flags.amazonwebapp,()=>context="webapp");runTest("isHomeScreenWebApp",context!=="nwjs"&&typeof window!=="undefined"&&(window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches||navigator["standalone"]),()=>context="webapp");runTest("isFalseSafari",browser==="Safari"&&(os==="Android"||os==="Tizen"||os=== +"Blackberry"),()=>browser="stock");runTest("isAndroidWebview",browser==="Chrome"&&context==="browser"&&Flags.webview,()=>context="webview");runTest("isFirefoxOS",browser==="Firefox"&&os===UNKNOWN,()=>os="Firefox OS");runTest("isAndroidFallback",os===UNKNOWN&&!Flags.windowsTizen&&Flags.android,()=>os="Android");runTest("isTridentFallback",os===UNKNOWN&&Flags.trident,()=>engine="Trident");runTest("isWebkitFallback",os===UNKNOWN&&Flags.webkit,()=>engine="WebKit");runTest("is64Bit",(is64=>{return is64.test(UA)|| +is64.test(navigator.platform)||navigator.cpuClass==="x64"})(/x86_64|x86-64|win64|x64;|x64\)|x64_|amd64|wow64|ia64|arm64|arch64|sparc64|ppc64|irix64/i),()=>os_arch="64-bit");runTest("is32Bit",(is32=>{return is32.test(UA)||is32.test(navigator.platform)||navigator.cpuClass==="x86"})(/x86;|x86\)|i86|i386|i486|i586|i686|armv1|armv2|armv3|armv4|armv5|armv6|armv7/i),()=>os_arch="32-bit");runTest("is64BitFallback",os_arch===UNKNOWN&&os==="Mac OS X"&&parseFloat(os_version)>=10.7,()=>os_arch="64-bit");runTest("is32BitFallback", +os_arch===UNKNOWN&&os==="Windows"||os==="Android"&&parseFloat(os_version)<5,()=>os_arch="32-bit");runTest("is32BitBrowser",os_arch==="32-bit"||/wow64/i.test(UA),()=>browser_arch="32-bit");runTest("is64BitBrowser",/win64/i.test(UA),()=>browser_arch="64-bit");runTest("isDesktop",(()=>{return os==="Windows"||os==="Mac OS X"||os==="Linux"||os==="Chrome OS"||context==="nwjs"})(),()=>is_desktop=true);if(engine==="Edge"&&typeof Windows!=="undefined"&&typeof Windows["System"]!=="undefined")context="windows-store"; +is_desktop_app=context==="nwjs";const is_ipad_os=os==="Mac OS X"&&navigator["maxTouchPoints"]&&navigator["maxTouchPoints"]>2;if(is_ipad_os){os="iOS";os_version=browser_version;is_desktop=false;is_desktop_app=false}C3.Platform={OS:os,OSVersion:os_version,OSArchitecture:os_arch,Browser:browser,BrowserVersion:browser_version,BrowserVersionNumber:parseFloat(browser_version),BrowserArchitecture:browser_arch,BrowserEngine:engine,Context:context,IsDesktop:is_desktop,IsMobile:!is_desktop,IsDesktopApp:is_desktop_app, +IsChromeWebStore:!!(self["chrome"]&&self["chrome"]["runtime"]&&self["chrome"]["runtime"]["id"]),IsAppleOS:os==="Mac OS X"||os==="iOS",IsIpadOS:is_ipad_os,IsLinux:os==="Linux"}}; + + +// ../lib/storage/kvStorage.js +'use strict';{const VERSION=2;const STORE_NAME="keyvaluepairs";const DATABASE_PROMISE_MAP=new Map;const SUPPORTS_GETALL=typeof IDBObjectStore!=="undefined"&&typeof IDBObjectStore.prototype.getAll==="function";const SUPPORTS_GETALLKEYS=typeof IDBObjectStore!=="undefined"&&typeof IDBObjectStore.prototype.getAllKeys==="function";function asyncifyRequest(request){return new Promise((res,rej)=>{request.onsuccess=()=>res(request.result);request.onerror=()=>rej(request.error)})}function asyncifyTransaction(tx){return new Promise((res, +rej)=>{tx.oncomplete=()=>res();tx.onerror=()=>rej(tx.error);tx.onabort=()=>rej(tx.error)})}function openReadOnlyTransaction(name,method){return openTransaction(name,method)}function openWriteTransaction(name,method){return openTransaction(name,method,true)}async function openTransaction(name,method,write=false,allowRetry=true){const db=await lazyOpenDatabase(name);try{const tx=db.transaction([STORE_NAME],write?"readwrite":"readonly");return method(tx)}catch(err){if(allowRetry&&err["name"]==="InvalidStateError"){DATABASE_PROMISE_MAP.delete(name); +return openTransaction(name,method,write,false)}else throw err;}}function lazyOpenDatabase(name){RequireString(name);let dbPromise=DATABASE_PROMISE_MAP.get(name);if(!(dbPromise instanceof Promise)){dbPromise=openDatabase(name);DATABASE_PROMISE_MAP.set(name,dbPromise);dbPromise.catch(err=>DATABASE_PROMISE_MAP.delete(name))}return dbPromise}async function openDatabase(name){RequireString(name);const openRequest=indexedDB.open(name,VERSION);openRequest.addEventListener("upgradeneeded",e=>{try{const db= +e.target.result;db.createObjectStore(STORE_NAME)}catch(err){console.error(`Failed to create objectstore for database ${name}`,err)}});return asyncifyRequest(openRequest)}function RequireString(x){if(typeof x!=="string")throw new TypeError("expected string");}function getEntriesFromCursor(tx,type){const request=tx.objectStore(STORE_NAME).openCursor();return new Promise(resolve=>{const results=[];request.onsuccess=event=>{const cursor=event.target.result;if(cursor){switch(type){case "entries":results.push([cursor.key, +cursor.value]);break;case "keys":results.push(cursor.key);break;case "values":results.push(cursor.value);break}cursor.continue()}else resolve(results)}})}class KVStorageContainer{constructor(name){RequireString(name);this.name=name}async ready(){await lazyOpenDatabase(this.name)}set(key,value){RequireString(key);return openWriteTransaction(this.name,async tx=>{const request=tx.objectStore(STORE_NAME).put(value,key);const requestPromise=asyncifyRequest(request);const txPromise=asyncifyTransaction(tx); +await Promise.all([txPromise,requestPromise])})}get(key){RequireString(key);return openReadOnlyTransaction(this.name,async tx=>{const request=tx.objectStore(STORE_NAME).get(key);const requestPromise=asyncifyRequest(request);const txPromise=asyncifyTransaction(tx);const [_,value]=await Promise.all([txPromise,requestPromise]);return value})}delete(key){RequireString(key);return openWriteTransaction(this.name,async tx=>{const request=tx.objectStore(STORE_NAME).delete(key);const requestPromise=asyncifyRequest(request); +const txPromise=asyncifyTransaction(tx);await Promise.all([txPromise,requestPromise])})}clear(){return openWriteTransaction(this.name,async tx=>{const request=tx.objectStore(STORE_NAME).clear();const requestPromise=asyncifyRequest(request);const txPromise=asyncifyTransaction(tx);await Promise.all([txPromise,requestPromise])})}keys(){return openReadOnlyTransaction(this.name,async tx=>{let requestPromise;if(SUPPORTS_GETALLKEYS){const request=tx.objectStore(STORE_NAME).getAllKeys();requestPromise=asyncifyRequest(request)}else requestPromise= +getEntriesFromCursor(tx,"keys");const txPromise=asyncifyTransaction(tx);const [_,value]=await Promise.all([txPromise,requestPromise]);return value})}values(){return openReadOnlyTransaction(this.name,async tx=>{let requestPromise;if(SUPPORTS_GETALL){const request=tx.objectStore(STORE_NAME).getAll();requestPromise=asyncifyRequest(request)}else requestPromise=getEntriesFromCursor(tx,"values");const txPromise=asyncifyTransaction(tx);const [_,value]=await Promise.all([txPromise,requestPromise]);return value})}entries(){return openReadOnlyTransaction(this.name, +async tx=>{const requestPromise=getEntriesFromCursor(tx,"entries");const txPromise=asyncifyTransaction(tx);const [_,value]=await Promise.all([txPromise,requestPromise]);return value})}}self.KVStorageContainer=KVStorageContainer}; + + +// ../lib/storage/localForageAdaptor.js +'use strict';{const KVStorageContainer=self.KVStorageContainer;const CRITICAL_ERRORS=[/no available storage method found/i,/an attempt was made to break through the security policy of the user agent/i,/the user denied permission to access the database/i,/a mutation operation was attempted on a database that did not allow mutations/i,/idbfactory\.open\(\) called in an invalid security context/i];const memoryStorage=new WeakMap;let isInMemory=false;if(typeof indexedDB==="undefined"){isInMemory=true; +console.warn("Unable to use local storage because indexedDB is not defined")}function NOT_IMPLEMENTED(name){throw new Error(`"${name}" is not implemented`);}function DISALLOW_CALLBACK(fn){if(typeof fn==="function")throw new Error(`localforage callback API is not implemented; please use the promise API instead`);}function StructuredClone(value){if(typeof value==="object")return new Promise(resolve=>{const {port1,port2}=new MessageChannel;port2.onmessage=ev=>resolve(ev.data);port1.postMessage(value)}); +else return Promise.resolve(value)}class ForageAdaptor{constructor(inst){this._inst=inst;memoryStorage.set(this,new Map)}_MaybeSwitchToMemoryFallback(err){if(isInMemory)return;for(const regex of CRITICAL_ERRORS)if(err&®ex.test(err.message)){console.error("Unable to use local storage, reverting to in-memory store: ",err,err.message);isInMemory=true;break}}async _getItemFallback(name){const value=memoryStorage.get(this).get(name);const ret=await StructuredClone(value);return typeof ret==="undefined"? +null:ret}async _setItemFallback(name,value){value=await StructuredClone(value);memoryStorage.get(this).set(name,value)}_removeItemFallback(name){memoryStorage.get(this).delete(name)}_clearFallback(){memoryStorage.get(this).clear()}_keysFallback(){return Array.from(memoryStorage.get(this).keys())}IsUsingFallback(){return isInMemory}async getItem(key,successCallback){DISALLOW_CALLBACK(successCallback);if(isInMemory)return await this._getItemFallback(key);let result;try{result=await this._inst.get(key)}catch(err){this._MaybeSwitchToMemoryFallback(err); +if(isInMemory)return await this._getItemFallback(key);else{console.error(`Error reading '${key}' from storage, returning null: `,err);return null}}return typeof result==="undefined"?null:result}async setItem(key,value,successCallback){DISALLOW_CALLBACK(successCallback);if(typeof value==="undefined")value=null;if(isInMemory){await this._setItemFallback(key,value);return}try{await this._inst.set(key,value)}catch(err){this._MaybeSwitchToMemoryFallback(err);if(isInMemory)await this._setItemFallback(key, +value);else throw err;}}async removeItem(key,successCallback){DISALLOW_CALLBACK(successCallback);if(isInMemory){this._removeItemFallback(key);return}try{await this._inst.delete(key)}catch(err){this._MaybeSwitchToMemoryFallback(err);if(isInMemory)this._removeItemFallback(key);else console.error(`Error removing '${key}' from storage: `,err)}}async clear(successCallback){DISALLOW_CALLBACK(successCallback);if(isInMemory){this._clearFallback();return}try{await this._inst.clear()}catch(err){this._MaybeSwitchToMemoryFallback(err); +if(isInMemory)this._clearFallback();else console.error(`Error clearing storage: `,err)}}async keys(successCallback){DISALLOW_CALLBACK(successCallback);if(isInMemory)return this._keysFallback();let result=[];try{result=await this._inst.keys()}catch(err){this._MaybeSwitchToMemoryFallback(err);if(isInMemory)return this._keysFallback();else console.error(`Error getting storage keys: `,err)}return result}ready(successCallback){DISALLOW_CALLBACK(successCallback);if(isInMemory)return Promise.resolve(true); +else return this._inst.ready()}createInstance(options){if(typeof options!=="object")throw new TypeError("invalid options object");const name=options["name"];if(typeof name!=="string")throw new TypeError("invalid store name");const inst=new KVStorageContainer(name);return new ForageAdaptor(inst)}length(successCallback){NOT_IMPLEMENTED("localforage.length()")}key(index,successCallback){NOT_IMPLEMENTED("localforage.key()")}iterate(iteratorCallback,successCallback){NOT_IMPLEMENTED("localforage.iterate()")}setDriver(driverName){NOT_IMPLEMENTED("localforage.setDriver()")}config(options){NOT_IMPLEMENTED("localforage.config()")}defineDriver(customDriver){NOT_IMPLEMENTED("localforage.defineDriver()")}driver(){NOT_IMPLEMENTED("localforage.driver()")}supports(driverName){NOT_IMPLEMENTED("localforage.supports()")}dropInstance(){NOT_IMPLEMENTED("localforage.dropInstance()")}disableMemoryMode(){isInMemory= +false}}self["localforage"]=new ForageAdaptor(new KVStorageContainer("localforage"))}; + + +// ../lib/misc/supports.js +'use strict';{const C3=self.C3;C3.Supports={};C3.Supports.WebAnimations=(()=>{try{if(C3.Platform.Browser==="Safari")return false;if(typeof document==="undefined")return false;const e=document.createElement("div");if(typeof e.animate==="undefined")return false;const player=e.animate([{opacity:"0"},{opacity:"1"}],1E3);return typeof player.reverse!=="undefined"}catch(e){return false}})();C3.Supports.DialogElement=typeof HTMLDialogElement!=="undefined";C3.Supports.RequestIdleCallback=!!self.requestIdleCallback; +C3.Supports.ImageBitmap=!!self.createImageBitmap;C3.Supports.ImageBitmapOptions=false;if(C3.Supports.ImageBitmap)try{self.createImageBitmap(new ImageData(32,32),{premultiplyAlpha:"none"}).then(imageBitmap=>{C3.Supports.ImageBitmapOptions=true}).catch(err=>{C3.Supports.ImageBitmapOptions=false})}catch(e){C3.Supports.ImageBitmapOptions=false}C3.Supports.ClipboardReadText=!!(navigator["clipboard"]&&navigator["clipboard"]["readText"]&&C3.Platform.Browser!=="Firefox");C3.Supports.PermissionsQuery=!!(navigator["permissions"]&& +navigator["permissions"]["query"]);C3.Supports.Proxies=typeof Proxy!=="undefined";C3.Supports.DownloadAttribute=(()=>{if(typeof document==="undefined")return false;const a=document.createElement("a");return typeof a.download!=="undefined"})();C3.Supports.CanvasToBlob=(()=>{return typeof HTMLCanvasElement!=="undefined"&&HTMLCanvasElement.prototype.toBlob})();C3.Supports.Fetch=typeof fetch==="function";C3.Supports.PersistentStorage=!!(self.isSecureContext&&C3.Platform.Browser!=="Opera"&&(navigator["storage"]&& +navigator["storage"]["persist"]));C3.Supports.StorageQuotaEstimate=!!(self.isSecureContext&&(navigator["storage"]&&navigator["storage"]["estimate"]));C3.Supports.Fullscreen=(()=>{if(typeof document==="undefined")return false;if(C3.Platform.OS==="iOS")return false;const elem=document.documentElement;return!!(elem.requestFullscreen||elem.msRequestFullscreen||elem.mozRequestFullScreen||elem.webkitRequestFullscreen)})();C3.Supports.ImageDecoder=typeof self["ImageDecoder"]!=="undefined";C3.Supports.NativeFileSystemAPI= +!!self["showOpenFilePicker"];C3.Supports.NavigatorFontsQuery=!!(navigator["fonts"]&&navigator["fonts"]["query"])}; + + +// ../lib/misc/polyfills.js +'use strict';{const C3=self.C3;if(!String.prototype.trimStart){const startWhitespace=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*/;String.prototype.trimStart=function trimStart(){return this.replace(startWhitespace,"")}}if(!String.prototype.trimEnd){const endWhitespace=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*$/; +String.prototype.trimEnd=function trimEnd(){return this.replace(endWhitespace,"")}}if(!String.prototype.replaceAll)String.prototype.replaceAll=function replaceAll(find,replace){return this.replace(new RegExp(C3.EscapeRegex(find),"g"),replace)};if(!Array.prototype.values)Array.prototype.values=function*(){for(const i of this)yield i};if(!Array.prototype.flat){function arrayFlat(arr,depth){return arr.reduce((acc,val)=>{if(depth>0&&Array.isArray(val)){Array.prototype.push.apply(acc,arrayFlat(val,depth- +1));return acc}else{acc.push(val);return acc}},[])}Array.prototype.flat=function(depth=1){return arrayFlat(this,depth)}}if(!RegExp.escape)RegExp.escape=function(s){return String(s).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")};if(navigator["storage"]&&!navigator["storage"]["estimate"]&&navigator["webkitTemporaryStorage"]&&navigator["webkitTemporaryStorage"]["queryUsageAndQuota"])navigator["storage"]["estimate"]=function(){return new Promise((resolve,reject)=>{return navigator["webkitTemporaryStorage"]["queryUsageAndQuota"]((usage, +quota)=>resolve({"usage":usage,"quota":quota}),reject)})};if(typeof HTMLCollection!=="undefined"&&!HTMLCollection.prototype[Symbol.iterator])HTMLCollection.prototype[Symbol.iterator]=function(){let i=0;return{next:()=>{if(i>=this.length)return{done:true};else return{value:this.item(i++),done:false}}}};if(typeof NodeList!=="undefined"&&!NodeList.prototype[Symbol.iterator])NodeList.prototype[Symbol.iterator]=function(){let i=0;return{next:()=>{if(i>=this.length)return{done:true};else return{value:this.item(i++), +done:false}}}};if(typeof DOMTokenList!=="undefined"&&!DOMTokenList.prototype[Symbol.iterator])DOMTokenList.prototype[Symbol.iterator]=function(){let i=0;return{next:()=>{if(i>=this.length)return{done:true};else return{value:this.item(i++),done:false}}}};if(typeof FileList!=="undefined"&&!FileList.prototype[Symbol.iterator])FileList.prototype[Symbol.iterator]=function(){let i=0;return{next:()=>{if(i>=this.length)return{done:true};else return{value:this.item(i++),done:false}}}};if(typeof TextEncoder=== +"undefined"){self.TextEncoder=class TextEncoder{constructor(){Object.defineProperty(this,"encoding",{"value":"utf-8","writable":false})}encode(str){var Len=str.length,resPos=-1;var resArr=new Uint8Array(Len*3);for(var point=0,nextcode=0,i=0;i!==Len;){point=str.charCodeAt(i),i+=1;if(point>=55296&&point<=56319){if(i===Len){resArr[resPos+=1]=239;resArr[resPos+=1]=191;resArr[resPos+=1]=189;break}nextcode=str.charCodeAt(i);if(nextcode>=56320&&nextcode<=57343){point=(point-55296)*1024+nextcode-56320+65536; +i+=1;if(point>65535){resArr[resPos+=1]=30<<3|point>>>18;resArr[resPos+=1]=2<<6|point>>>12&63;resArr[resPos+=1]=2<<6|point>>>6&63;resArr[resPos+=1]=2<<6|point&63;continue}}else{resArr[resPos+=1]=239;resArr[resPos+=1]=191;resArr[resPos+=1]=189;continue}}if(point<=127)resArr[resPos+=1]=0<<7|point;else if(point<=2047){resArr[resPos+=1]=6<<5|point>>>6;resArr[resPos+=1]=2<<6|point&63}else{resArr[resPos+=1]=14<<4|point>>>12;resArr[resPos+=1]=2<<6|point>>>6&63;resArr[resPos+=1]=2<<6|point&63}}return new Uint8Array(resArr.buffer.slice(0, +resPos+1))}toString(){return"[object TextEncoder]"}};TextEncoder[Symbol.toStringTag]="TextEncoder"}if(typeof TextDecoder==="undefined"){function persist(iterable){const itr=iterable[Symbol.iterator]();return{next:_=>itr.next(),[Symbol.iterator](){return this}}}function readNext(bytes){const n=bytes.next();if(n.done)throw new Error("unexpected end of input");if((n.value&192^128)!=0)throw new Error("invalid byte");return n.value&63}const _decoders=new Map;_decoders.set("utf-8",(arr,fatal)=>{let view; +if(arr.buffer)view=new Uint8Array(arr.buffer,arr.byteOffset,arr.byteLength);else if(view instanceof ArrayBuffer)view=new Uint8Array(arr);else throw new Error("Invalid parameter");const bytes=persist(view);const result=[];try{for(const ch of bytes){let val;if(ch<127)val=ch&127;else if(ch<223)val=(ch&31)<<6|readNext(bytes);else if(ch<239)val=(ch&15)<<12|readNext(bytes)<<6|readNext(bytes);else if(ch<247)val=(ch&7)<<18|readNext(bytes)<<12|readNext(bytes)<<6|readNext(bytes);else throw new Error("Invalid character"); +result.push(String.fromCodePoint(val))}}catch(e){if(fatal)throw e;result.push("\ufffd")}return result.join("")});_decoders.set("utf8",_decoders.get("utf-8"));_decoders.set("utf-16le",(arr,fatal)=>{throw new Error("utf-16le decoder not implemented");});self.TextDecoder=class TextDecoder{constructor(label="utf-8",options={}){const decoder=_decoders.get(label);if(!decoder)throw new Error(`TextDecoder polyfill does not support "${label}"`);Object.defineProperty(this,"fatal",{"value":options["fatal"]=== +true,"writable":false});Object.defineProperty(this,"_decoder",{"value":decoder,"writable":false});Object.defineProperty(this,"encoding",{"value":label,"writable":false})}decode(arr){return this["_decoder"](arr,this["fatal"])}toString(){return"[object TextDecoder]"}};TextDecoder[Symbol.toStringTag]="TextDecoder"}if(typeof self.isSecureContext==="undefined")self.isSecureContext=location.protocol==="https:";if(typeof self["globalThis"]==="undefined")self["globalThis"]=self}; + + +// c3/lib/misc/assert.js +'use strict';{const C3=self.C3;function assertFail(msg_){let stack=C3.GetCallStack();let msg="Assertion failure: "+msg_+"\n\nStack trace:\n"+stack;console.error(msg)}self.assert=function assert(cnd_,msg_){if(!cnd_)assertFail(msg_)}}; + + +// ../lib/misc/typeChecks.js +'use strict';{const C3=self.C3;C3.IsNumber=function IsNumber(x){return typeof x==="number"};C3.IsFiniteNumber=function IsFiniteNumber(x){return C3.IsNumber(x)&&isFinite(x)};C3.RequireNumber=function RequireNumber(x){if(!C3.IsNumber(x))throw new TypeError("expected number");};C3.RequireOptionalNumber=function RequireOptionalNumber(x){if(C3.IsNullOrUndefined(x))return};C3.RequireNumberInRange=function RequireNumberInRange(x,low,high){if(!C3.IsNumber(x)||isNaN(x)||low>x||high";if(C3.IsNumber(o))return"";if(C3.IsString(o))return"";if(C3.IsArray(o))return"";if(typeof o==="symbol")return"<"+o.toString()+ +">";if(C3.IsFunction(o)){if(o.name&&o.name!=="Function")return o.name;return""}if(typeof o==="object"){if(o.constructor&&o.constructor.name&&o.constructor.name!=="Object")return o.constructor.name;return""}return""};C3.getType=function getType(o){if(o===null)return"null";if(Array.isArray(o))return"array";return typeof o};C3.range=function*range(a,b){if(!isFinite(Math.abs(a-b)))throw new Error("Invalid parameters");if(a>b)for(let i=a-1;i>=b;i--)yield i; +else for(let i=a;i0||ctorProxyToObject.size>0){let uniqueNames=new Set([...ctorObjectToProxy.keys()].map(o=>C3.getName(o)));let leftoverNames=[...uniqueNames].join(",");console.warn(`An object derived from DefendedBase was not protected with debugDefend(). This will disable some checks. See the coding guidelines! Possible affected class names: ${leftoverNames}`);ctorObjectToProxy.clear();ctorProxyToObject.clear()}} +C3.DefendedBase=class DefendedBase{constructor(){if(!C3.isDebugDefend||!C3.Supports.Proxies)return;let newTarget=new.target;let realObject=Object.create(newTarget.prototype);let proxy=new Proxy(realObject,C3.DefendHandler);ctorObjectToProxy.set(realObject,proxy);ctorProxyToObject.set(proxy,realObject);proxyToObject.set(proxy,realObject);if(checkRafId===-1)checkRafId=requestAnimationFrame(CheckDefendedObjectsUsedCorrectly);return proxy}};C3.debugDefend=function debugDefend(o){if(C3.isDebugDefend&& +C3.Supports.Proxies&&o instanceof C3.DefendedBase){if(!ctorProxyToObject.has(o))return o;let realObject=ctorProxyToObject.get(o);ctorProxyToObject.delete(o);ctorObjectToProxy.delete(realObject);return o}else if(C3.isDebug)return Object.seal(o);else return o};C3.New=function New(Type,...args){let o;try{o=new Type(...args)}catch(e){ctorProxyToObject.clear();ctorObjectToProxy.clear();throw e;}if(C3.isDebugDefend)VerifyObjectPropertiesConsistent(Type,o);return C3.debugDefend(o)};C3.Release=function Release(o){let realObject= +proxyToObject.get(o);if(realObject)releasedObjects.set(realObject,C3.GetCallStack())};C3.WasReleased=function(o){let realObject=proxyToObject.get(o);if(!realObject)return false;return!!releasedObjects.get(realObject)};let typeProperties=new Map;function getObjectPropertySet(o){let ret=new Set;for(let k in o)ret.add(k);return ret}function VerifyObjectPropertiesConsistent(Type,o){let properties=getObjectPropertySet(o);let existingProperties=typeProperties.get(Type);if(existingProperties){let inconsistentProperties= +[];for(let k of existingProperties.values())if(properties.has(k))properties.delete(k);else inconsistentProperties.push(k);C3.appendArray(inconsistentProperties,[...properties]);if(inconsistentProperties.length)console.warn(`[Defence] '${C3.getName(Type)}' constructor creates inconsistent properties: ${inconsistentProperties.join(", ")}`)}else typeProperties.set(Type,properties)}C3.PerfMark=class PerfMark{constructor(name){this._name="";if(name)this.start(name)}start(name){this._name=name;performance.mark(this._name+ +"-Start")}end(){performance.mark(this._name+"-End");performance.measure(this._name,this._name+"-Start",this._name+"-End")}next(name){this.end();this._name=name;performance.mark(this._name+"-Start")}}}; + + +// ../lib/misc/mathutil.js +'use strict';{const C3=self.C3;const TWO_PI=Math.PI*2;const D_TO_R=Math.PI/180;const R_TO_D=180/Math.PI;C3.wrap=function wrap(x,min,max){x=Math.floor(x);min=Math.floor(min);max=Math.floor(max);if(xb)return b;else return x};C3.clampAngle=function clampAngle(a){a%=TWO_PI;if(a<0)a+=TWO_PI;return a};C3.toRadians=function toRadians(x){return x*D_TO_R};C3.toDegrees=function toDegrees(x){return x*R_TO_D};C3.distanceTo=function distanceTo(x1,y1,x2,y2){return Math.hypot(x2-x1,y2-y1)};C3.distanceSquared=function distanceSquared(x1,y1,x2,y2){const dx=x2-x1;const dy=y2-y1;return dx*dx+dy*dy};C3.angleTo=function angleTo(x1,y1,x2,y2){return Math.atan2(y2-y1, +x2-x1)};C3.angleDiff=function angleDiff(a1,a2){if(a1===a2)return 0;let s1=Math.sin(a1);let c1=Math.cos(a1);let s2=Math.sin(a2);let c2=Math.cos(a2);let n=s1*s2+c1*c2;if(n>=1)return 0;if(n<=-1)return Math.PI;return Math.acos(n)};C3.angleRotate=function angleRotate(start,end,step){let ss=Math.sin(start);let cs=Math.cos(start);let se=Math.sin(end);let ce=Math.cos(end);if(Math.acos(ss*se+cs*ce)>step)if(cs*se-ss*ce>0)return C3.clampAngle(start+step);else return C3.clampAngle(start-step);else return C3.clampAngle(end)}; +C3.angleClockwise=function angleClockwise(a1,a2){let s1=Math.sin(a1);let c1=Math.cos(a1);let s2=Math.sin(a2);let c2=Math.cos(a2);return c1*s2-s1*c2<=0};C3.angleLerp=function angleLerp(a,b,x,r=0){let diff=C3.angleDiff(a,b);const revs=TWO_PI*r;if(C3.angleClockwise(b,a))return C3.clampAngle(a+(diff+revs)*x);else return C3.clampAngle(a-(diff+revs)*x)};C3.angleLerpClockwise=function angleLerpClockwise(a,b,x,r=0){const diff=C3.angleDiff(a,b);const revs=TWO_PI*r;if(C3.angleClockwise(b,a))return C3.clampAngle(a+ +(diff+revs)*x);return C3.clampAngle((TWO_PI-diff+revs)*x)};C3.angleLerpAntiClockwise=function angleLerpAntiClockwise(a,b,x,r=0){const diff=C3.angleDiff(a,b);const revs=TWO_PI*r;if(C3.angleClockwise(b,a))return C3.clampAngle((-TWO_PI+diff-revs)*x);return C3.clampAngle(a-(diff+revs)*x)};C3.lerp=function lerp(a,b,x){return a+x*(b-a)};C3.unlerp=function unlerp(a,b,x){if(a===b)return 0;return(x-a)/(b-a)};C3.relerp=function relerp(a,b,x,c,d){return C3.lerp(c,d,C3.unlerp(a,b,x))};C3.qarp=function qarp(a, +b,c,x){return C3.lerp(C3.lerp(a,b,x),C3.lerp(b,c,x),x)};C3.cubic=function cubic(a,b,c,d,x){return C3.lerp(C3.qarp(a,b,c,x),C3.qarp(b,c,d,x),x)};C3.cosp=function cosp(a,b,x){return(a+b+(a-b)*Math.cos(x*Math.PI))/2};C3.isPOT=function isPOT(x){return x>0&&(x-1&x)===0};C3.nextHighestPowerOfTwo=function nextHighestPowerOfTwo(x){--x;for(let i=1;i<32;i<<=1)x=x|x>>i;return x+1};C3.roundToNearestFraction=function roundToNearestFraction(x,n){return Math.round(x*n)/n};C3.floorToNearestFraction=function floorToNearestFraction(x, +n){return Math.floor(x*n)/n};C3.round6dp=function round6dp(x){return Math.round(x*1E6)/1E6};C3.toFixed=function toFixed(n,dp){let ret=n.toFixed(dp);let last=ret.length-1;for(;last>=0&&ret.charAt(last)==="0";--last);if(last>=0&&ret.charAt(last)===".")--last;if(last<0)return ret;return ret.substr(0,last+1)};C3.PackRGB=function PackRGB(red,green,blue){return C3.clamp(red,0,255)|C3.clamp(green,0,255)<<8|C3.clamp(blue,0,255)<<16};const ALPHAEX_SHIFT=1024;const ALPHAEX_MAX=1023;const RGBEX_SHIFT=16384; +const RGBEX_MAX=8191;const RGBEX_MIN=-8192;C3.PackRGBAEx=function PackRGBAEx(red,green,blue,alpha){red=C3.clamp(Math.floor(red*1024),RGBEX_MIN,RGBEX_MAX);green=C3.clamp(Math.floor(green*1024),RGBEX_MIN,RGBEX_MAX);blue=C3.clamp(Math.floor(blue*1024),RGBEX_MIN,RGBEX_MAX);alpha=C3.clamp(Math.floor(alpha*ALPHAEX_MAX),0,ALPHAEX_MAX);if(red<0)red+=RGBEX_SHIFT;if(green<0)green+=RGBEX_SHIFT;if(blue<0)blue+=RGBEX_SHIFT;return-(red*RGBEX_SHIFT*RGBEX_SHIFT*ALPHAEX_SHIFT+green*RGBEX_SHIFT*ALPHAEX_SHIFT+blue* +ALPHAEX_SHIFT+alpha)};C3.PackRGBEx=function PackRGBEx(red,green,blue){return C3.PackRGBAEx(red,green,blue,1)};function isNegativeZero(x){return x===0&&1/x<0}C3.GetRValue=function GetRValue(rgb){if(rgb>=0)return(rgb&255)/255;else{let v=Math.floor(-rgb/(RGBEX_SHIFT*RGBEX_SHIFT*ALPHAEX_SHIFT));if(v>RGBEX_MAX)v-=RGBEX_SHIFT;return v/1024}};C3.GetGValue=function GetGValue(rgb){if(rgb>=0)return((rgb&65280)>>8)/255;else{let v=Math.floor(-rgb%(RGBEX_SHIFT*RGBEX_SHIFT*ALPHAEX_SHIFT)/(RGBEX_SHIFT*ALPHAEX_SHIFT)); +if(v>RGBEX_MAX)v-=RGBEX_SHIFT;return v/1024}};C3.GetBValue=function GetBValue(rgb){if(rgb>=0)return((rgb&16711680)>>16)/255;else{let v=Math.floor(-rgb%(RGBEX_SHIFT*ALPHAEX_SHIFT)/ALPHAEX_SHIFT);if(v>RGBEX_MAX)v-=RGBEX_SHIFT;return v/1024}};C3.GetAValue=function GetAValue(rgb){if(isNegativeZero(rgb))return 0;else if(rgb>=0)return 1;else{const v=Math.floor(-rgb%ALPHAEX_SHIFT);return v/ALPHAEX_MAX}};C3.greatestCommonDivisor=function greatestCommonDivisor(a,b){a=Math.floor(a);b=Math.floor(b);while(b!== +0){let t=b;b=a%b;a=t}return a};const COMMON_ASPECT_RATIOS=[[3,2],[4,3],[5,4],[5,3],[6,5],[14,9],[16,9],[16,10],[21,9]];C3.getAspectRatio=function getAspectRatio(w,h){w=Math.floor(w);h=Math.floor(h);if(w===h)return[1,1];for(let aspect of COMMON_ASPECT_RATIOS){let approxH=w/aspect[0]*aspect[1];if(Math.abs(h-approxH)<1)return aspect.slice(0);approxH=w/aspect[1]*aspect[0];if(Math.abs(h-approxH)<1)return[aspect[1],aspect[0]]}let gcd=C3.greatestCommonDivisor(w,h);return[w/gcd,h/gcd]};C3.segmentsIntersect= +function segmentsIntersect(a1x,a1y,a2x,a2y,b1x,b1y,b2x,b2y){const min_ax=Math.min(a1x,a2x);const max_ax=Math.max(a1x,a2x);const min_bx=Math.min(b1x,b2x);const max_bx=Math.max(b1x,b2x);if(max_axmax_bx)return false;const min_ay=Math.min(a1y,a2y);const max_ay=Math.max(a1y,a2y);const min_by=Math.min(b1y,b2y);const max_by=Math.max(b1y,b2y);if(max_aymax_by)return false;const dpx=b1x-a1x+b2x-a2x;const dpy=b1y-a1y+b2y-a2y;const qax=a2x-a1x;const qay=a2y-a1y;const qbx=b2x-b1x; +const qby=b2y-b1y;const d=Math.abs(qay*qbx-qby*qax);const la=qbx*dpy-qby*dpx;if(Math.abs(la)>d)return false;const lb=qax*dpy-qay*dpx;return Math.abs(lb)<=d};C3.segmentsIntersectPreCalc=function segmentsIntersectPreCalc(a1x,a1y,a2x,a2y,min_ax,max_ax,min_ay,max_ay,b1x,b1y,b2x,b2y){const min_bx=Math.min(b1x,b2x);const max_bx=Math.max(b1x,b2x);if(max_axmax_bx)return false;const min_by=Math.min(b1y,b2y);const max_by=Math.max(b1y,b2y);if(max_aymax_by)return false;const dpx= +b1x-a1x+b2x-a2x;const dpy=b1y-a1y+b2y-a2y;const qax=a2x-a1x;const qay=a2y-a1y;const qbx=b2x-b1x;const qby=b2y-b1y;const d=Math.abs(qay*qbx-qby*qax);const la=qbx*dpy-qby*dpx;if(Math.abs(la)>d)return false;const lb=qax*dpy-qay*dpx;return Math.abs(lb)<=d};C3.segmentIntersectsQuad=function segmentIntersectsQuad(x1,y1,x2,y2,q){const min_x=Math.min(x1,x2);const max_x=Math.max(x1,x2);const min_y=Math.min(y1,y2);const max_y=Math.max(y1,y2);const tlx=q.getTlx(),tly=q.getTly(),trx=q.getTrx(),try_=q.getTry(), +brx=q.getBrx(),bry=q.getBry(),blx=q.getBlx(),bly=q.getBly();return C3.segmentsIntersectPreCalc(x1,y1,x2,y2,min_x,max_x,min_y,max_y,tlx,tly,trx,try_)||C3.segmentsIntersectPreCalc(x1,y1,x2,y2,min_x,max_x,min_y,max_y,trx,try_,brx,bry)||C3.segmentsIntersectPreCalc(x1,y1,x2,y2,min_x,max_x,min_y,max_y,brx,bry,blx,bly)||C3.segmentsIntersectPreCalc(x1,y1,x2,y2,min_x,max_x,min_y,max_y,blx,bly,tlx,tly)};C3.segmentIntersectsAnyN=function segmentIntersectsAnyN(x1,y1,x2,y2,points){const min_x=Math.min(x1,x2); +const max_x=Math.max(x1,x2);const min_y=Math.min(y1,y2);const max_y=Math.max(y1,y2);let i=0;for(let last=points.length-4;i<=last;i+=2)if(C3.segmentsIntersectPreCalc(x1,y1,x2,y2,min_x,max_x,min_y,max_y,points[i],points[i+1],points[i+2],points[i+3]))return true;return C3.segmentsIntersectPreCalc(x1,y1,x2,y2,min_x,max_x,min_y,max_y,points[i],points[i+1],points[0],points[1])};const NO_HIT=2;const PADDING=1E-6;C3.rayIntersect=function rayIntersect(rx1,ry1,rx2,ry2,sx1,sy1,sx2,sy2){const rdx=rx2-rx1;const rdy= +ry2-ry1;const sdx=sx2-sx1;const sdy=sy2-sy1;const det=rdx*sdy-rdy*sdx;if(det===0)return NO_HIT;const gamma=((ry1-ry2)*(sx2-rx1)+rdx*(sy2-ry1))/det;if(0=0&&v>=0&&u+v<=1};C3.triangleCartesianToBarycentric=function triangleCartesianToBarycentric(px,py, +tx1,ty1,tx2,ty2,tx3,ty3){const v0x=tx2-tx1;const v0y=ty2-ty1;const v1x=tx3-tx1;const v1y=ty3-ty1;const v2x=px-tx1;const v2y=py-ty1;const dot00=v0x*v0x+v0y*v0y;const dot01=v0x*v1x+v0y*v1y;const dot11=v1x*v1x+v1y*v1y;const dot20=v2x*v0x+v2y*v0y;const dot21=v2x*v1x+v2y*v1y;const denom=dot00*dot11-dot01*dot01;const v=(dot11*dot20-dot01*dot21)/denom;const w=(dot00*dot21-dot01*dot20)/denom;const u=1-v-w;return[u,v,w]};C3.triangleBarycentricToCartesian=function triangleBarycentricToCartesian(u,v,w,tx1,ty1, +tx2,ty2,tx3,ty3){return[u*tx1+v*tx2+w*tx3,u*ty1+v*ty2+w*ty3]}}; + + +// ../lib/misc/miscutil.js +'use strict';{const C3=self.C3;let mainDocument=null;let baseHref="";if(typeof document!=="undefined"){mainDocument=document;const baseElem=document.querySelector("base");baseHref=baseElem&&baseElem.hasAttribute("href")?baseElem.getAttribute("href"):"";if(baseHref){if(baseHref.startsWith("/"))baseHref=baseHref.substr(1);if(!baseHref.endsWith("/"))baseHref+="/"}}C3.GetBaseHref=function GetBaseHref(){return baseHref};C3.GetBaseURL=function GetBaseURL(){if(!mainDocument)return"";const loc=mainDocument.location; +return C3.GetPathFromURL(loc.origin+loc.pathname)+baseHref};C3.GetPathFromURL=function GetPathFromURL(url){if(!url.length)return url;if(url.endsWith("/")||url.endsWith("\\"))return url;const lastSlash=Math.max(url.lastIndexOf("/"),url.lastIndexOf("\\"));if(lastSlash===-1)return"";return url.substr(0,lastSlash+1)};C3.GetFilenameFromURL=function GetFilenameFromURL(url){if(!url.length)return url;if(url.endsWith("/")||url.endsWith("\\"))return"";const lastSlash=Math.max(url.lastIndexOf("/"),url.lastIndexOf("\\")); +if(lastSlash===-1)return url;return url.substr(lastSlash+1)};C3.DataTransferHasFiles=function DataTransferHasFiles(dataTransfer){if(dataTransfer.types)for(let i=0;i{return file.size!==0}).filter(file=>{return filter(file)}).map(async file=> +{try{return await C3.CloneFile(file)}catch(err){return null}});const files=await Promise.all(ret);return files.filter(file=>file)};C3.IsFileAnImage=function IsFileAnImage(file){if(file.type)return file.type.search(/image\/.*/)!==-1;else{const type=C3.MimeType.GetForFileExtension(C3.GetFileExtension(file.name)).GetString();return type.search(/image\/.*/)!==-1}};C3.IsFileAnSVG=function IsFileAnSVG(file){return file.type==="image/svg+xml"};C3.IsFileAMultiImageContainer=function IsFileAMultiImageContainer(file){if(file.type)return C3.MimeType.Get(file.type).IsAnimatedImage(); +else return C3.MimeType.GetForFileExtension(C3.GetFileExtension(file.name)).IsAnimatedImage()};C3.GetFileExtension=function GetFileExtension(filename){let i=filename.lastIndexOf(".");if(i<1)return"";else return filename.substr(i)};C3.GetFileNamePart=function GetFileNamePart(filename){let i=filename.lastIndexOf(".");if(i<1)return filename;else return filename.substr(0,i)};C3.NormalizeFileSeparator=function NormalizeFileSeparator(path){return path.replace(/\\/g,"/")};C3.ParseFilePath=function ParseFilePath(path){path= +C3.NormalizeFileSeparator(path);let root=/^\w:\//.exec(path);if(root){root=root[0];path=path.slice(3);if(path[0]!=="/")path="/"+path}else root="";path=path.replace(/\/{2,}/g,"/");if(path.length>1&&path.slice(-1)==="/")path=path.slice(0,-1);const start=path.lastIndexOf("/")+1;let dir="",base=path,name,ext="";if(start>0){dir=path.slice(0,start);base=path.slice(start)}name=base;const end=base.lastIndexOf(".");if(end>0){ext=base.slice(end);name=base.slice(0,-ext.length)}const full=root+dir+base;return{dir, +base,name,root,ext,full}};C3.Wait=function Wait(delay,argument){return new Promise((resolve,reject)=>{self.setTimeout(resolve,delay,argument)})};C3.swallowException=function swallowException(f){try{f()}catch(e){if(C3.isDebug)console.warn("Swallowed exception: ",e)}};C3.noop=function noop(){};C3.equalsNoCase=function equalsNoCase(a,b){if(typeof a!=="string"||typeof b!=="string")return false;if(a===b)return true;a=a.normalize();b=b.normalize();if(a.length!==b.length)return false;return a.toLowerCase()=== +b.toLowerCase()};C3.equalsCase=function equalsCase(a,b){if(typeof a!=="string"||typeof b!=="string")return false;if(a===b)return true;return a.normalize()===b.normalize()};C3.typedArraySet16=function typedArraySet16(dest,src,i){dest[i++]=src[0];dest[i++]=src[1];dest[i++]=src[2];dest[i++]=src[3];dest[i++]=src[4];dest[i++]=src[5];dest[i++]=src[6];dest[i++]=src[7];dest[i++]=src[8];dest[i++]=src[9];dest[i++]=src[10];dest[i++]=src[11];dest[i++]=src[12];dest[i++]=src[13];dest[i++]=src[14];dest[i]=src[15]}; +C3.truncateArray=function truncateArray(arr,index){arr.length=index};C3.clearArray=function clearArray(arr){if(!arr)return;if(arr.length===0)return;C3.truncateArray(arr,0)};C3.clear2DArray=function clear2DArray(arr){if(!arr)return;for(let i=0;iarrayLength)C3.extendArray(arr,len,filler)};C3.shallowAssignArray=function shallowAssignArray(dest,src){C3.clearArray(dest);C3.appendArray(dest,src)};C3.appendArray=function appendArray(a,b){if(b.length<1E4)a.push(...b);else for(let i=0,len=b.length;i=arr.length)return; +let len=arr.length-1;for(let i=index;i=0)a.splice(i,1)};C3.arraysEqual=function arraysEqual(a,b){let len=a.length;if(b.length!==len)return false;for(let i=0;i=0&&indexy; +case 5:return x>=y;default:return false}};C3.hasAnyOwnProperty=function hasAnyOwnProperty(o){for(let p in o)if(o.hasOwnProperty(p))return true;return false};C3.PromiseAllWithProgress=function PromiseAllWithProgress(arr,progressCallback){if(!arr.length)return Promise.resolve([]);return new Promise((resolve,reject)=>{const results=[];let numberCompleted=0;let cancelled=false;for(let i=0,len=arr.length;i{if(cancelled)return;results[i]=result;++numberCompleted; +if(numberCompleted===arr.length)resolve(results);else progressCallback(numberCompleted,arr.length)}).catch(err=>{cancelled=true;reject(err)})}})};let memoryCallbacks=[];C3.AddLibraryMemoryCallback=function AddLibraryMemoryCallback(f){memoryCallbacks.push(f)};C3.GetEstimatedLibraryMemoryUsage=function GetEstimatedLibraryMemoryUsage(){let ret=0;for(let f of memoryCallbacks){let m=f();ret+=m}return Math.floor(ret)};let nextTaskId=1;const activeTaskIds=new Map;const taskMessageChannel=new MessageChannel; +taskMessageChannel.port2.onmessage=function OnTask(e){const id=e.data;const callback=activeTaskIds.get(id);activeTaskIds.delete(id);if(callback)callback(e.timeStamp)};C3.RequestUnlimitedAnimationFrame=function RequestUnlimitedAnimationFrame(callback){const id=nextTaskId++;activeTaskIds.set(id,callback);taskMessageChannel.port1.postMessage(id);return id};C3.CancelUnlimitedAnimationFrame=function CancelUnlimitedAnimationFrame(id){activeTaskIds.delete(id)};C3.PostTask=C3.RequestUnlimitedAnimationFrame; +C3.WaitForNextTask=function WaitForNextTask(){return new Promise(resolve=>C3.PostTask(resolve))};const activeRPAFids=new Set;C3.RequestPostAnimationFrame=function RequestPostAnimationFrame(callback){const id=self.requestAnimationFrame(async timestamp=>{await C3.WaitForNextTask();if(!activeRPAFids.has(id))return;activeRPAFids.delete(id);callback(timestamp)});activeRPAFids.add(id);return id};C3.CancelPostAnimationFrame=function CancelPostAnimationFrame(id){if(!activeRPAFids.has(id))return;self.cancelAnimationFrame(id); +activeRPAFids.delete(id)}}; + + +// c3/lib/misc/runtimeutil.js +'use strict';{const C3=self.C3;C3.IsAbsoluteURL=function IsAbsoluteURL(url){return/^(?:[a-z\-]+:)?\/\//.test(url)||url.substr(0,5)==="data:"||url.substr(0,5)==="blob:"};C3.IsRelativeURL=function IsRelativeURL(url){return!C3.IsAbsoluteURL(url)};C3.ThrowIfNotOk=function ThrowIfNotOk(response){if(!response.ok)throw new Error(`fetch '${response.url}' response returned ${response.status} ${response.statusText}`);};C3.FetchOk=function FetchOk(url,init){return fetch(url,init).then(response=>{C3.ThrowIfNotOk(response); +return response})};C3.FetchText=function FetchText(url){return C3.FetchOk(url).then(response=>response.text())};C3.FetchJson=function FetchJson(url){return C3.FetchOk(url).then(response=>response.json())};C3.FetchBlob=function FetchBlob(url){return C3.FetchOk(url).then(response=>response.blob())};C3.FetchArrayBuffer=function FetchArrayBuffer(url){return C3.FetchOk(url).then(response=>response.arrayBuffer())};C3.FetchImage=function FetchImage(url){return new Promise((resolve,reject)=>{const img=new Image; +img.onload=()=>resolve(img);img.onerror=err=>reject(err);img.src=url})};C3.BlobToArrayBuffer=function BlobToArrayBuffer(blob){if(typeof blob["arrayBuffer"]==="function")return blob["arrayBuffer"]();else return new Promise((resolve,reject)=>{const fileReader=new FileReader;fileReader.onload=()=>resolve(fileReader.result);fileReader.onerror=()=>reject(fileReader.error);fileReader.readAsArrayBuffer(blob)})};C3.BlobToString=function BlobToString(blob){if(typeof blob["text"]==="function")return blob["text"](); +else return new Promise((resolve,reject)=>{const fileReader=new FileReader;fileReader.onload=()=>resolve(fileReader.result);fileReader.onerror=()=>reject(fileReader.error);fileReader.readAsText(blob)})};C3.BlobToJson=function BlobToJson(blob){return C3.BlobToString(blob).then(text=>JSON.parse(text))};C3.BlobToImage=async function BlobToImage(blob,decodeImage){let blobUrl=URL.createObjectURL(blob);try{const img=await C3.FetchImage(blobUrl);URL.revokeObjectURL(blobUrl);blobUrl="";if(decodeImage&&typeof img["decode"]=== +"function")await img["decode"]();return img}finally{if(blobUrl)URL.revokeObjectURL(blobUrl)}};C3.CreateCanvas=function CreateCanvas(width,height){if(typeof document!=="undefined"&&typeof document.createElement==="function"){const canvas=document.createElement("canvas");canvas.width=width;canvas.height=height;return canvas}else return new OffscreenCanvas(width,height)};C3.CanvasToBlob=function CanvasToBlob(canvas,type,quality){if(typeof quality!=="number")quality=1;type=type||"image/png";quality=C3.clamp(quality, +0,1);if(canvas.toBlob)return new Promise(resolve=>canvas.toBlob(resolve,type,quality));else if(canvas["convertToBlob"])return canvas["convertToBlob"]({"type":type,"quality":quality});else return C3.Asyncify(()=>C3.CanvasToBlobSync(canvas,type,quality))};C3.CanvasToBlobSync=function CanvasToBlobSync(canvas,type,quality){if(typeof quality!=="number")quality=1;type=type||"image/png";quality=C3.clamp(quality,0,1);return C3.DataURIToBinaryBlobSync(canvas.toDataURL(type,quality))};C3.DataURIToBinaryBlobSync= +function DataURIToBinaryBlobSync(datauri){const o=C3.ParseDataURI(datauri);return C3.BinaryStringToBlob(o.data,o.mime_type)};C3.ParseDataURI=function ParseDataURI(datauri){if(datauri.substr(0,5)!=="data:")throw new URIError("expected data: uri");let comma=datauri.indexOf(",");if(comma<0)throw new URIError("expected comma in data: uri");let typepart=datauri.substring(5,comma);let datapart=datauri.substring(comma+1);let typearr=typepart.split(";");let mimetype=typearr[0]||"";let encoding1=typearr[1]; +let encoding2=typearr[2];let decodeddata;if(encoding1==="base64"||encoding2==="base64")decodeddata=atob(datapart);else decodeddata=decodeURIComponent(datapart);return{mime_type:mimetype,data:decodeddata}};C3.BinaryStringToBlob=function BinaryStringToBlob(binstr,mime_type){let len=binstr.length;let len32=len>>2;let a8=new Uint8Array(len);let a32=new Uint32Array(a8.buffer,0,len32);let i,j;for(i=0,j=0;iC3.DrawableToBlob(imageBitmap,type,quality));else if(C3.Supports.ImageBitmap)return createImageBitmap(imageData).then(imageBitmap=>C3.DrawableToBlob(imageBitmap,type,quality));else{const canvas= +C3.CreateCanvas(imageData.width,imageData.height);const ctx=canvas.getContext("2d");ctx.putImageData(imageData,0,0);return C3.CanvasToBlob(canvas,type,quality)}};C3.CopySet=function CopySet(dest,src){dest.clear();for(const x of src)dest.add(x)};C3.MapToObject=function MapToObject(map){const ret=Object.create(null);for(const [k,v]of map.entries())ret[k]=v;return ret};C3.ObjectToMap=function ObjectToMap(o,map){map.clear();for(const [k,v]of Object.entries(o))map.set(k,v)};C3.ToSuperJSON=function ToSuperJSON(v){if(typeof v=== +"object"&&v!==null)if(v instanceof Set)return{"_c3type_":"set","data":[...v].map(o=>ToSuperJSON(o))};else if(v instanceof Map)return{"_c3type_":"map","data":[...v].map(pair=>[pair[0],ToSuperJSON(pair[1])])};else{const ret=Object.create(null);for(const [key,value]of Object.entries(v))ret[key]=ToSuperJSON(value);return ret}return v};C3.FromSuperJSON=function FromSuperJSON(v){if(typeof v==="object"&v!==null)if(v["_c3type_"]==="set")return new Set(v["data"].map(o=>FromSuperJSON(o)));else if(v["_c3type_"]=== +"map")return new Map(v["data"].map(pair=>[pair[0],FromSuperJSON(pair[1])]));else{const ret=Object.create(null);for(const [key,value]of Object.entries(v))ret[key]=FromSuperJSON(value);return ret}return v};C3.CSSToCamelCase=function(str){let ret="";let isAfterHyphen=false;for(const ch of str)if(ch==="-")isAfterHyphen=true;else if(isAfterHyphen){ret+=ch.toUpperCase();isAfterHyphen=false}else ret+=ch;return ret};C3.IsIterator=function(o){return typeof o==="object"&&typeof o.next==="function"};C3.MakeFilledArray= +function MakeFilledArray(len,data){const ret=[];if(typeof data==="function")for(let i=0;i1)t-=1;if(t<1/6)return p+(q-p)*6*t;if(t<1/2)return q;if(t<2/3)return p+(q-p)*(2/3-t)*6;return p}C3.Color=class Color{constructor(r,g,b,a){this._r=NaN;this._g=NaN;this._b=NaN;this._a=NaN;this._r=0;this._g=0; +this._b=0;this._a=0;if(r instanceof C3.Color)this.set(r);else this.setRgba(r||0,g||0,b||0,a||0)}setRgb(r,g,b){this._r=+r;this._g=+g;this._b=+b;this.clamp();return this}setRgba(r,g,b,a){this._r=+r;this._g=+g;this._b=+b;this._a=+a;this.clamp();return this}set(c){this._r=c._r;this._g=c._g;this._b=c._b;this._a=c._a;return this}copy(c){return this.set(c)}add(c){this._r+=c._r;this._g+=c._g;this._b+=c._b;this._a+=c._a;this.clamp()}addRgb(r,g,b,a=0){this._r+=+r;this._g+=+g;this._b+=+b;this._a+=+a;this.clamp()}diff(c){this.setR(Math.max(this._r, +c._r)-Math.min(this._r,c._r));this.setG(Math.max(this._g,c._g)-Math.min(this._g,c._g));this.setB(Math.max(this._b,c._b)-Math.min(this._b,c._b));this.setA(Math.max(this._a,c._a)-Math.min(this._a,c._a));this.clamp()}copyRgb(c){this._r=c._r;this._g=c._g;this._b=c._b}setR(r){this._r=C3.clamp(+r,0,1)}getR(){return this._r}setG(g){this._g=C3.clamp(+g,0,1)}getG(){return this._g}setB(b){this._b=C3.clamp(+b,0,1)}getB(){return this._b}setA(a){this._a=C3.clamp(+a,0,1)}getA(){return this._a}clone(){return C3.New(C3.Color, +this._r,this._g,this._b,this._a)}toArray(){return[this._r,this._g,this._b,this._a]}toTypedArray(){return new Float64Array(this.toArray())}writeToTypedArray(ta,i){ta[i++]=this._r;ta[i++]=this._g;ta[i++]=this._b;ta[i]=this._a}equals(c){return this._r===c._r&&this._g===c._g&&this._b===c._b&&this._a===c._a}equalsIgnoringAlpha(c){return this._r===c._r&&this._g===c._g&&this._b===c._b}equalsRgb(r,g,b){return this._r===r&&this._g===g&&this._b===b}equalsRgba(r,g,b,a){return this._r===r&&this._g===g&&this._b=== +b&&this._a===a}multiply(c){this._r*=c._r;this._g*=c._g;this._b*=c._b;this._a*=c._a}multiplyAlpha(a){this._r*=a;this._g*=a;this._b*=a;this._a*=a}premultiply(){this._r*=this._a;this._g*=this._a;this._b*=this._a;return this}unpremultiply(){this._r/=this._a;this._g/=this._a;this._b/=this._a;return this}clamp(){this._r=C3.clamp(this._r,0,1);this._g=C3.clamp(this._g,0,1);this._b=C3.clamp(this._b,0,1);this._a=C3.clamp(this._a,0,1);return this}setFromRgbValue(rgb){this._r=C3.GetRValue(rgb);this._g=C3.GetGValue(rgb); +this._b=C3.GetBValue(rgb);this._a=C3.GetAValue(rgb)}getCssRgb(_r,_g,_b){const r=C3.IsFiniteNumber(_r)?_r:this.getR();const g=C3.IsFiniteNumber(_g)?_g:this.getG();const b=C3.IsFiniteNumber(_b)?_b:this.getB();return`rgb(${r*100}%, ${g*100}%, ${b*100}%)`}getCssRgba(_r,_g,_b,_a){const r=C3.IsFiniteNumber(_r)?_r:this.getR();const g=C3.IsFiniteNumber(_g)?_g:this.getG();const b=C3.IsFiniteNumber(_b)?_b:this.getB();const a=C3.IsFiniteNumber(_a)?_a:this.getA();return`rgba(${r*100}%, ${g*100}%, ${b*100}%, ${a})`}toHexString(){const rh= +Math.round(this.getR()*255);const gh=Math.round(this.getG()*255);const bh=Math.round(this.getB()*255);return"#"+padTwoDigits(rh.toString(16))+padTwoDigits(gh.toString(16))+padTwoDigits(bh.toString(16))}parseHexString(str){if(typeof str!=="string")return false;str=str.trim();if(str.charAt(0)==="#")str=str.substr(1);let rv;let gv;let bv;if(str.length===3){rv=parseInt(str[0],16)/15;gv=parseInt(str[1],16)/15;bv=parseInt(str[2],16)/15}else if(str.length===6){rv=parseInt(str.substr(0,2),16)/255;gv=parseInt(str.substr(2, +2),16)/255;bv=parseInt(str.substr(4,2),16)/255}else return false;if(isFinite(rv))this.setR(rv);if(isFinite(gv))this.setG(gv);if(isFinite(bv))this.setB(bv);this.setA(1);return true}toCommaSeparatedRgb(){const rv=Math.round(this.getR()*255);const gv=Math.round(this.getG()*255);const bv=Math.round(this.getB()*255);return`${rv}, ${gv}, ${bv}`}toRgbArray(){const rv=Math.round(this.getR()*255);const gv=Math.round(this.getG()*255);const bv=Math.round(this.getB()*255);return[rv,gv,bv]}parseCommaSeparatedRgb(str){if(typeof str!== +"string")return false;str=str.replace(/^rgb\(|\)|%/,"");const arr=str.split(",");if(arr.length<3)return false;const rv=parseInt(arr[0].trim(),10)/255;const gv=parseInt(arr[1].trim(),10)/255;const bv=parseInt(arr[2].trim(),10)/255;if(isFinite(rv))this.setR(rv);if(isFinite(gv))this.setG(gv);if(isFinite(bv))this.setB(bv);this.setA(1);return true}parseCommaSeparatedPercentageRgb(str){if(typeof str!=="string")return false;str=str.replace(/^rgb\(|\)|%/,"");const arr=str.split(",");if(arr.length<3)return false; +const rv=parseInt(arr[0].trim(),10)/100;const gv=parseInt(arr[1].trim(),10)/100;const bv=parseInt(arr[2].trim(),10)/100;if(isFinite(rv))this.setR(rv);if(isFinite(gv))this.setG(gv);if(isFinite(bv))this.setB(bv);this.setA(1);return true}parseCommaSeparatedRgba(str){if(typeof str!=="string")return false;str=str.replace(/^rgba\(|\)|%/,"");const arr=str.split(",");if(arr.length<4)return false;const rv=parseInt(arr[0].trim(),10)/255;const gv=parseInt(arr[1].trim(),10)/255;const bv=parseInt(arr[2].trim(), +10)/255;const av=parseFloat(arr[3].trim());if(isFinite(rv))this.setR(rv);if(isFinite(gv))this.setG(gv);if(isFinite(bv))this.setB(bv);if(isFinite(av))this.setA(av);return true}parseCommaSeparatedPercentageRgba(str){if(typeof str!=="string")return false;str=str.replace(/^rgba\(|\)|%/,"");const arr=str.split(",");if(arr.length<4)return false;const rv=parseInt(arr[0].trim(),10)/100;const gv=parseInt(arr[1].trim(),10)/100;const bv=parseInt(arr[2].trim(),10)/100;const av=parseFloat(arr[3].trim());if(isFinite(rv))this.setR(rv); +if(isFinite(gv))this.setG(gv);if(isFinite(bv))this.setB(bv);if(isFinite(av))this.setA(av);return true}parseString(str){if(typeof str!=="string")return false;str=str.replace(/\s+/,"");if(str.includes(","))if(str.startsWith("rgb("))if(str.includes("%"))return this.parseCommaSeparatedPercentageRgb(str);else return this.parseCommaSeparatedRgb(str);else if(str.startsWith("rgba("))if(str.includes("%"))return this.parseCommaSeparatedPercentageRgba(str);else return this.parseCommaSeparatedRgba(str);else if(str.startsWith("hsl(")|| +str.startsWith("hsla("))return this.parseHSLString(str);else{const components=str.split(",");if(str.includes("%")){if(components.length===3)return this.parseCommaSeparatedPercentageRgb(str);else if(components.length===4)return this.parseCommaSeparatedPercentageRgba(str);return false}else{if(components.length===3)return this.parseCommaSeparatedRgb(str);else if(components.length===4)return this.parseCommaSeparatedRgba(str);return false}}else return this.parseHexString(str)}toJSON(){return[this._r,this._g, +this._b,this._a]}setFromHSLA(h,s,l,a){let r;let g;let b;h%=360;s=C3.clamp(s,0,100);l=C3.clamp(l,0,100);a=C3.clamp(a,0,1);h/=360;s/=100;l/=100;if(s===0)r=g=b=l;else{const q=l<.5?l*(1+s):l+s-l*s;const p=2*l-q;r=hueToRGB(p,q,h+1/3);g=hueToRGB(p,q,h);b=hueToRGB(p,q,h-1/3)}this.setR(r);this.setG(g);this.setB(b);this.setA(a);return this}parseHSLString(str){const cleanString=str.replace(/ |hsl|hsla|\(|\)|;/gi,"");const hsl=HSL_TEST.exec(cleanString);const hsla=HSLA_TEST.exec(cleanString);if(hsl&&hsl.length=== +4){this.setFromHSLA(+hsl[1],+hsl[2],+hsl[3],1);return true}else if(hsla&&hsla.length===5){this.setFromHSLA(+hsl[1],+hsl[2],+hsl[3],+hsl[4]);return true}return false}toHSLAString(){const r=this._r;const g=this._g;const b=this._b;const a=this._a;const h=C3.Color.GetHue(r,g,b);const s=C3.Color.GetSaturation(r,g,b);const l=C3.Color.GetLuminosity(r,g,b);return`hsla(${h}, ${s}%, ${l}%, ${a})`}toHSLAArray(){const r=this._r;const g=this._g;const b=this._b;return[C3.Color.GetHue(r,g,b),C3.Color.GetSaturation(r, +g,b),C3.Color.GetLuminosity(r,g,b),this._a]}setFromJSON(arr){if(!Array.isArray(arr))return;if(arr.length<3)return;this._r=arr[0];this._g=arr[1];this._b=arr[2];if(arr.length>=4)this._a=arr[3];else this._a=1}set r(r){this.setR(r)}get r(){return this.getR()}set g(g){this.setG(g)}get g(){return this.getG()}set b(b){this.setB(b)}get b(){return this.getB()}set a(a){this.setA(a)}get a(){return this.getA()}setAtIndex(i,v){switch(i){case 0:this.setR(v);break;case 1:this.setG(v);break;case 2:this.setB(v);break; +case 3:this.setA(v);break;default:throw new RangeError("invalid color index");}}getAtIndex(i){switch(i){case 0:return this.getR();case 1:return this.getG();case 2:return this.getB();case 3:return this.getA();default:throw new RangeError("invalid color index");}}static DiffChannel(channel1,channel2){return C3.clamp(Math.max(channel1,channel2)-Math.min(channel1,channel2),0,1)}static Diff(c1,c2){const ret=new C3.Color;ret.setR(Math.max(c1._r,c2._r)-Math.min(c1._r,c2._r));ret.setG(Math.max(c1._g,c2._g)- +Math.min(c1._g,c2._g));ret.setB(Math.max(c1._b,c2._b)-Math.min(c1._b,c2._b));ret.setA(Math.max(c1._a,c2._a)-Math.min(c1._a,c2._a));return ret}static DiffNoAlpha(c1,c2){const ret=new C3.Color(0,0,0,1);ret.setR(Math.max(c1._r,c2._r)-Math.min(c1._r,c2._r));ret.setG(Math.max(c1._g,c2._g)-Math.min(c1._g,c2._g));ret.setB(Math.max(c1._b,c2._b)-Math.min(c1._b,c2._b));return ret}static GetHue(r,g,b){const max=Math.max(r,g,b);const min=Math.min(r,g,b);if(max===min)return 0;let h=0;switch(max){case r:h=(g-b)/ +(max-min)+(g.5?d/(2-max-min):d/(max+min);return Math.round(s*100)}static GetLuminosity(r,g,b){const max=Math.max(r,g,b);const min=Math.min(r,g,b);const l=(max+min)/2;if(!max)return 0;return Math.round(l*100)}};C3.Color.White=Object.freeze(C3.New(C3.Color, +1,1,1,1));C3.Color.Black=Object.freeze(C3.New(C3.Color,0,0,0,1));C3.Color.TransparentBlack=Object.freeze(C3.New(C3.Color,0,0,0,0))}; + + +// ../lib/misc/vector2.js +'use strict';{const C3=self.C3;C3.Vector2=class Vector2{constructor(x,y){this._x=0;this._y=0;if(x instanceof C3.Vector2)this.copy(x);else this.set(x||0,y||0)}set(x,y){this._x=+x;this._y=+y}copy(v){this._x=v._x;this._y=v._y}equals(v){return this._x===v._x&&this._y===v._y}setX(x){this._x=+x}getX(){return this._x}setY(y){this._y=+y}getY(){return this._y}toArray(){return[this._x,this._y]}toTypedArray(){return new Float64Array(this.toArray())}writeToTypedArray(ta,i){ta[i++]=this._x;ta[i]=this._y}offset(x, +y){this._x+=+x;this._y+=+y}scale(x,y){this._x*=x;this._y*=y}divide(x,y){this._x/=x;this._y/=y}round(){this._x=Math.round(this._x);this._y=Math.round(this._y)}floor(){this._x=Math.floor(this._x);this._y=Math.floor(this._y)}ceil(){this._x=Math.ceil(this._x);this._y=Math.ceil(this._y)}angle(){return C3.angleTo(0,0,this._x,this._y)}lengthSquared(){return this._x*this._x+this._y*this._y}length(){return Math.sqrt(this.lengthSquared())}rotatePrecalc(sin_a,cos_a){const temp=this._x*cos_a-this._y*sin_a;this._y= +this._y*cos_a+this._x*sin_a;this._x=temp}rotate(a){if(a===0)return;this.rotatePrecalc(Math.sin(a),Math.cos(a))}rotateAbout(a,x,y){if(a===0||x===this._x&&y===this._y)return;this._x-=x;this._y-=y;this.rotatePrecalc(Math.sin(a),Math.cos(a));this._x+=+x;this._y+=+y}move(a,dist){if(dist===0)return;this._x+=Math.cos(a)*dist;this._y+=Math.sin(a)*dist}normalize(){const m=this.length();if(m!==0&&m!==1){this._x/=m;this._y/=m}}clamp(lower,upper){this._x=C3.clamp(this._x,lower,upper);this._y=C3.clamp(this._y, +lower,upper)}}}; + + +// ../lib/misc/rect.js +'use strict';{const C3=self.C3;C3.Rect=class Rect{constructor(left,top,right,bottom){this._left=NaN;this._top=NaN;this._right=NaN;this._bottom=NaN;this._left=0;this._top=0;this._right=0;this._bottom=0;if(left instanceof C3.Rect)this.copy(left);else this.set(left||0,top||0,right||0,bottom||0)}set(left,top,right,bottom){this._left=+left;this._top=+top;this._right=+right;this._bottom=+bottom}setWH(left,top,width,height){left=+left;top=+top;this._left=left;this._top=top;this._right=left+ +width;this._bottom= +top+ +height}copy(rect){this._left=+rect._left;this._top=+rect._top;this._right=+rect._right;this._bottom=+rect._bottom}clone(){return new C3.Rect(this._left,this._top,this._right,this._bottom)}static Merge(first,second){const ret=new C3.Rect;ret.setLeft(Math.min(first._left,second._left));ret.setTop(Math.min(first._top,second._top));ret.setRight(Math.max(first._right,second._right));ret.setBottom(Math.max(first._bottom,second._bottom));return ret}static FromObject(o){return new C3.Rect(o.left,o.top, +o.right,o.bottom)}equals(rect){return this._left===rect._left&&this._top===rect._top&&this._right===rect._right&&this._bottom===rect._bottom}setLeft(l){this._left=+l}getLeft(){return this._left}setTop(t){this._top=+t}getTop(){return this._top}setRight(r){this._right=+r}getRight(){return this._right}setBottom(b){this._bottom=+b}getBottom(){return this._bottom}toArray(){return[this._left,this._top,this._right,this._bottom]}toTypedArray(){return new Float64Array(this.toArray())}toDOMRect(){return new DOMRect(this._left, +this._top,this.width(),this.height())}writeToTypedArray(ta,i){ta[i++]=this._left;ta[i++]=this._top;ta[i++]=this._right;ta[i]=this._bottom}writeAsQuadToTypedArray(ta,i){ta[i++]=this._left;ta[i++]=this._top;ta[i++]=this._right;ta[i++]=this._top;ta[i++]=this._right;ta[i++]=this._bottom;ta[i++]=this._left;ta[i]=this._bottom}width(){return this._right-this._left}height(){return this._bottom-this._top}midX(){return(this._left+this._right)/2}midY(){return(this._top+this._bottom)/2}offset(x,y){x=+x;y=+y; +this._left+=x;this._top+=y;this._right+=x;this._bottom+=y}offsetLeft(x){this._left+=+x}offsetTop(y){this._top+=+y}offsetRight(x){this._right+=+x}offsetBottom(y){this._bottom+=+y}toSquare(axis){if(axis!=="x")throw new Error("invalid axis, only 'x' supported");if(this._top +r)this._right=+r;if(this._bottom>b)this._bottom=+b}clampFlipped(l,t,r,b){if(this._leftt)this._top=+t;if(this._right>r)this._right=+r;if(this._bottomthis._right)this.swapLeftRight();if(this._top>this._bottom)this.swapTopBottom()}intersectsRect(rect){return!(rect._rightthis._right||rect._top>this._bottom)}intersectsRectOffset(rect,x,y){return!(rect._right+xthis._right||rect._top+y>this._bottom)}containsPoint(x,y){return x>=this._left&&x<=this._right&&y>=this._top&&y<=this._bottom}containsRect(rect){return rect._left>=this._left&&rect._top>=this._top&&rect._right<=this._right&&rect._bottom<=this._bottom}expandToContain(rect){if(rect._leftthis._right)this._right=+rect._right;if(rect._bottom>this._bottom)this._bottom=+rect._bottom}lerpInto(rect){this._left= +C3.lerp(rect._left,rect._right,this._left);this._top=C3.lerp(rect._top,rect._bottom,this._top);this._right=C3.lerp(rect._left,rect._right,this._right);this._bottom=C3.lerp(rect._top,rect._bottom,this._bottom)}}}; + + +// ../lib/misc/quad.js +'use strict';{const C3=self.C3;C3.Quad=class Quad{constructor(tlx,tly,trx,try_,brx,bry,blx,bly){this._tlx=NaN;this._tly=NaN;this._trx=NaN;this._try=NaN;this._brx=NaN;this._bry=NaN;this._blx=NaN;this._bly=NaN;this._tlx=0;this._tly=0;this._trx=0;this._try=0;this._brx=0;this._bry=0;this._blx=0;this._bly=0;if(tlx instanceof C3.Quad)this.copy(tlx);else this.set(tlx||0,tly||0,trx||0,try_||0,brx||0,bry||0,blx||0,bly||0)}set(tlx,tly,trx,try_,brx,bry,blx,bly){this._tlx=+tlx;this._tly=+tly;this._trx=+trx;this._try= ++try_;this._brx=+brx;this._bry=+bry;this._blx=+blx;this._bly=+bly}setRect(left,top,right,bottom){this.set(left,top,right,top,right,bottom,left,bottom)}copy(q){this._tlx=q._tlx;this._tly=q._tly;this._trx=q._trx;this._try=q._try;this._brx=q._brx;this._bry=q._bry;this._blx=q._blx;this._bly=q._bly}equals(q){return this._tlx===q._tlx&&this._tly===q._tly&&this._trx===q._trx&&this._try===q._try&&this._brx===q._brx&&this._bry===q._bry&&this._blx===q._blx&&this._bly===q._bly}setTlx(v){this._tlx=+v}getTlx(){return this._tlx}setTly(v){this._tly= ++v}getTly(){return this._tly}setTrx(v){this._trx=+v}getTrx(){return this._trx}setTry(v){this._try=+v}getTry(){return this._try}setBrx(v){this._brx=+v}getBrx(){return this._brx}setBry(v){this._bry=+v}getBry(){return this._bry}setBlx(v){this._blx=+v}getBlx(){return this._blx}setBly(v){this._bly=+v}getBly(){return this._bly}toDOMQuad(){return new DOMQuad(new DOMPoint(this._tlx,this._tly),new DOMPoint(this._trx,this._try),new DOMPoint(this._brx,this._bry),new DOMPoint(this._blx,this._bly))}toArray(){return[this._tlx, +this._tly,this._trx,this._try,this._brx,this._bry,this._blx,this._bly]}toTypedArray(){return new Float64Array(this.toArray())}writeToTypedArray(ta,i){ta[i++]=this._tlx;ta[i++]=this._tly;ta[i++]=this._trx;ta[i++]=this._try;ta[i++]=this._brx;ta[i++]=this._bry;ta[i++]=this._blx;ta[i]=this._bly}writeToTypedArray3D(ta,i,z){ta[i++]=this._tlx;ta[i++]=this._tly;ta[i++]=z;ta[i++]=this._trx;ta[i++]=this._try;ta[i++]=z;ta[i++]=this._brx;ta[i++]=this._bry;ta[i++]=z;ta[i++]=this._blx;ta[i++]=this._bly;ta[i]=z}offset(x, +y){x=+x;y=+y;this._tlx+=x;this._tly+=y;this._trx+=x;this._try+=y;this._brx+=x;this._bry+=y;this._blx+=x;this._bly+=y}round(){this._tlx=Math.round(this._tlx);this._tly=Math.round(this._tly);this._trx=Math.round(this._trx);this._try=Math.round(this._try);this._brx=Math.round(this._brx);this._bry=Math.round(this._bry);this._blx=Math.round(this._blx);this._bly=Math.round(this._bly)}floor(){this._tlx=Math.floor(this._tlx);this._tly=Math.floor(this._tly);this._trx=Math.floor(this._trx);this._try=Math.floor(this._try); +this._brx=Math.floor(this._brx);this._bry=Math.floor(this._bry);this._blx=Math.floor(this._blx);this._bly=Math.floor(this._bly)}ceil(){this._tlx=Math.ceil(this._tlx);this._tly=Math.ceil(this._tly);this._trx=Math.ceil(this._trx);this._try=Math.ceil(this._try);this._brx=Math.ceil(this._brx);this._bry=Math.ceil(this._bry);this._blx=Math.ceil(this._blx);this._bly=Math.ceil(this._bly)}setFromRect(rect){this._tlx=rect._left;this._tly=rect._top;this._trx=rect._right;this._try=rect._top;this._brx=rect._right; +this._bry=rect._bottom;this._blx=rect._left;this._bly=rect._bottom}setFromRotatedRect(rect,a){if(a===0)this.setFromRect(rect);else this.setFromRotatedRectPrecalc(rect,Math.sin(a),Math.cos(a))}setFromRotatedRectPrecalc(rect,sin_a,cos_a){const left_sin_a=rect._left*sin_a;const top_sin_a=rect._top*sin_a;const right_sin_a=rect._right*sin_a;const bottom_sin_a=rect._bottom*sin_a;const left_cos_a=rect._left*cos_a;const top_cos_a=rect._top*cos_a;const right_cos_a=rect._right*cos_a;const bottom_cos_a=rect._bottom* +cos_a;this._tlx=left_cos_a-top_sin_a;this._tly=top_cos_a+left_sin_a;this._trx=right_cos_a-top_sin_a;this._try=top_cos_a+right_sin_a;this._brx=right_cos_a-bottom_sin_a;this._bry=bottom_cos_a+right_sin_a;this._blx=left_cos_a-bottom_sin_a;this._bly=bottom_cos_a+left_sin_a}getBoundingBox(rect){rect.set(Math.min(this._tlx,this._trx,this._brx,this._blx),Math.min(this._tly,this._try,this._bry,this._bly),Math.max(this._tlx,this._trx,this._brx,this._blx),Math.max(this._tly,this._try,this._bry,this._bly))}containsPoint(x, +y){let v0x=this._trx-this._tlx;let v0y=this._try-this._tly;const v1x=this._brx-this._tlx;const v1y=this._bry-this._tly;const v2x=x-this._tlx;const v2y=y-this._tly;let dot00=v0x*v0x+v0y*v0y;let dot01=v0x*v1x+v0y*v1y;let dot02=v0x*v2x+v0y*v2y;const dot11=v1x*v1x+v1y*v1y;const dot12=v1x*v2x+v1y*v2y;let invDenom=1/(dot00*dot11-dot01*dot01);let u=(dot11*dot02-dot01*dot12)*invDenom;let v=(dot00*dot12-dot01*dot02)*invDenom;if(u>=0&&v>0&&u+v<1)return true;v0x=this._blx-this._tlx;v0y=this._bly-this._tly;dot00= +v0x*v0x+v0y*v0y;dot01=v0x*v1x+v0y*v1y;dot02=v0x*v2x+v0y*v2y;invDenom=1/(dot00*dot11-dot01*dot01);u=(dot11*dot02-dot01*dot12)*invDenom;v=(dot00*dot12-dot01*dot02)*invDenom;return u>=0&&v>0&&u+v<1}midX(){return(this._tlx+this._trx+this._brx+this._blx)/4}midY(){return(this._tly+this._try+this._bry+this._bly)/4}intersectsSegment(x1,y1,x2,y2){if(this.containsPoint(x1,y1)||this.containsPoint(x2,y2))return true;return C3.segmentIntersectsQuad(x1,y1,x2,y2,this)}intersectsQuad(rhs){let midX=rhs.midX();let midY= +rhs.midY();if(this.containsPoint(midX,midY))return true;midX=this.midX();midY=this.midY();if(rhs.containsPoint(midX,midY))return true;const tlx=this._tlx,tly=this._tly,trx=this._trx,try_=this._try,brx=this._brx,bry=this._bry,blx=this._blx,bly=this._bly;return C3.segmentIntersectsQuad(tlx,tly,trx,try_,rhs)||C3.segmentIntersectsQuad(trx,try_,brx,bry,rhs)||C3.segmentIntersectsQuad(brx,bry,blx,bly,rhs)||C3.segmentIntersectsQuad(blx,bly,tlx,tly,rhs)}mirror(){this._swap(0,2);this._swap(1,3);this._swap(6, +4);this._swap(7,5)}flip(){this._swap(0,6);this._swap(1,7);this._swap(2,4);this._swap(3,5)}diag(){this._swap(2,6);this._swap(3,7)}_swap(i,j){const tmp=this._getAtIndex(i);this._setAtIndex(i,this._getAtIndex(j));this._setAtIndex(j,tmp)}_getAtIndex(i){switch(i){case 0:return this._tlx;case 1:return this._tly;case 2:return this._trx;case 3:return this._try;case 4:return this._brx;case 5:return this._bry;case 6:return this._blx;case 7:return this._bly;default:throw new RangeError("invalid quad point index"); +}}_setAtIndex(i,v){v=+v;switch(i){case 0:this._tlx=v;break;case 1:this._tly=v;break;case 2:this._trx=v;break;case 3:this._try=v;break;case 4:this._brx=v;break;case 5:this._bry=v;break;case 6:this._blx=v;break;case 7:this._bly=v;break;default:throw new RangeError("invalid quad point index");}}}}; + + +// c3/lib/misc/collisionPoly.js +'use strict';{const C3=self.C3;const assert=self.assert;const DEFAULT_POLY_POINTS=[0,0,1,0,1,1,0,1];const tempQuad=C3.New(C3.Quad);C3.CollisionPoly=class CollisionPoly extends C3.DefendedBase{constructor(pointsArr,enabled=true){super();if(!pointsArr)pointsArr=DEFAULT_POLY_POINTS;this._ptsArr=Float64Array.from(pointsArr);this._bbox=new C3.Rect;this._isBboxChanged=true;this._enabled=enabled}Release(){}pointsArr(){return this._ptsArr}pointCount(){return this._ptsArr.length/2}setPoints(pointsArr){if(this._ptsArr.length=== +pointsArr.length)this._ptsArr.set(pointsArr);else this._ptsArr=Float64Array.from(pointsArr);this._isBboxChanged=true}setDefaultPoints(){this.setPoints(DEFAULT_POLY_POINTS)}copy(poly){this.setPoints(poly._ptsArr)}setBboxChanged(){this._isBboxChanged=true}_updateBbox(){if(!this._isBboxChanged)return;const ptsArr=this._ptsArr;let left=ptsArr[0];let top=ptsArr[1];let right=left;let bottom=top;for(let i=0,len=ptsArr.length;iright)right= +x;if(ybottom)bottom=y}this._bbox.set(left,top,right,bottom);this._isBboxChanged=false}setFromRect(rc,offX,offY){let ptsArr=this._ptsArr;if(ptsArr.length!==8){ptsArr=new Float64Array(8);this._ptsArr=ptsArr}ptsArr[0]=rc.getLeft()-offX;ptsArr[1]=rc.getTop()-offY;ptsArr[2]=rc.getRight()-offX;ptsArr[3]=rc.getTop()-offY;ptsArr[4]=rc.getRight()-offX;ptsArr[5]=rc.getBottom()-offY;ptsArr[6]=rc.getLeft()-offX;ptsArr[7]=rc.getBottom()-offY;this._bbox.copy(rc);if(offX!==0||offY!==0)this._bbox.offset(-offX, +-offY);this._isBboxChanged=false}setFromQuad(q,offX,offY){tempQuad.copy(q);tempQuad.offset(offX,offY);this.setPoints(tempQuad.toArray());this._isBboxChanged=true}transform(w,h,a){let sina=0;let cosa=1;if(a!==0){sina=Math.sin(a);cosa=Math.cos(a)}this.transformPrecalc(w,h,sina,cosa)}transformPrecalc(w,h,sina,cosa){const ptsArr=this._ptsArr;for(let i=0,len=ptsArr.length;i!filter.includes(ease))}static GetRuntimeEaseNames(){this._CreateEaseMap();return[...PREDEFINED_EASE_MAP.keys()].concat([...CUSTOM_EASE_RUNTIME_MAP.keys()])}static IsNamePredefined(easeName){this._CreateEaseMap();return[...PREDEFINED_EASE_MAP.keys()].includes(easeName)}static _GetEase(easeName){const realEaseName=ALIAS_MAP.get(easeName);if(realEaseName)return EASE_MAP.get(realEaseName); +if(Ease.IsNamePredefined(easeName))return EASE_MAP.get(easeName);if(PRIVATE_EASE_MAP.has(easeName))return PRIVATE_EASE_MAP.get(easeName)}static GetEditorEase(easeName,project){this._CreateEaseMap();const ease=Ease._GetEase(easeName);if(ease)return ease;return CUSTOM_EASE_EDITOR_MAP.get(project).get(easeName)}static GetRuntimeEase(easeName){this._CreateEaseMap();const ease=Ease._GetEase(easeName);if(ease)return ease;return CUSTOM_EASE_RUNTIME_MAP.get(easeName)}static GetEaseFromIndex(index){this._CreateEaseMap(); +const names=this.GetRuntimeEaseNames();return names[index]}static GetIndexForEase(name,project){this._CreateEaseMap();const names=this.GetEditorEaseNames(project);return names.indexOf(name)}static _CreateEaseMap(){if(EASE_MAP.size!==0)return;this._AddPredifinedEase("default",()=>{});this._AddPredifinedEase("noease",this.NoEase);this._AddPredifinedEase("easeinsine",this.EaseInSine);this._AddPredifinedEase("easeoutsine",this.EaseOutSine);this._AddPredifinedEase("easeinoutsine",this.EaseInOutSine);this._AddPredifinedEase("easeinelastic", +this.EaseInElastic);this._AddPredifinedEase("easeoutelastic",this.EaseOutElastic);this._AddPredifinedEase("easeinoutelastic",this.EaseInOutElastic);this._AddPredifinedEase("easeinback",this.EaseInBack);this._AddPredifinedEase("easeoutback",this.EaseOutBack);this._AddPredifinedEase("easeinoutback",this.EaseInOutBack);this._AddPredifinedEase("easeinbounce",this.EaseInBounce);this._AddPredifinedEase("easeoutbounce",this.EaseOutBounce);this._AddPredifinedEase("easeinoutbounce",this.EaseInOutBounce);this._AddPredifinedEase("easeincubic", +this.EaseInCubic);this._AddPredifinedEase("easeoutcubic",this.EaseOutCubic);this._AddPredifinedEase("easeinoutcubic",this.EaseInOutCubic);this._AddPredifinedEase("easeinquad",this.EaseInQuad);this._AddPredifinedEase("easeoutquad",this.EaseOutQuad);this._AddPredifinedEase("easeinoutquad",this.EaseInOutQuad);this._AddPredifinedEase("easeinquart",this.EaseInQuart);this._AddPredifinedEase("easeoutquart",this.EaseOutQuart);this._AddPredifinedEase("easeinoutquart",this.EaseInOutQuart);this._AddPredifinedEase("easeinquint", +this.EaseInQuint);this._AddPredifinedEase("easeoutquint",this.EaseOutQuint);this._AddPredifinedEase("easeinoutquint",this.EaseInOutQuint);this._AddPredifinedEase("easeincirc",this.EaseInCirc);this._AddPredifinedEase("easeoutcirc",this.EaseOutCirc);this._AddPredifinedEase("easeinoutcirc",this.EaseInOutCirc);this._AddPredifinedEase("easeinexpo",this.EaseInExpo);this._AddPredifinedEase("easeoutexpo",this.EaseOutExpo);this._AddPredifinedEase("easeinoutexpo",this.EaseInOutExpo);this._AddPrivateCustomEase("cubicbezier", +this.EaseCubicBezier);this._AddPrivateCustomEase("spline",this.EaseSpline)}static _AddPredifinedEase(name,func){Ease._AddEase(name,func,"predefined")}static _AddPrivateCustomEase(name,func){Ease._AddEase(name,func,"private")}static AddCustomEase(name,func,project){this._CreateEaseMap();Ease._AddEase(name,func,"custom",project)}static RemoveCustomEase(name,project){if(this.IsNamePredefined(name))return;if([...PRIVATE_EASE_MAP.keys()].includes(name))return;const customEaseMap=CUSTOM_EASE_EDITOR_MAP.get(project); +if(customEaseMap)customEaseMap.delete(name)}static _AddEase(name,func,mode,project){switch(mode){case "predefined":EASE_MAP.set(name,func);PREDEFINED_EASE_MAP.set(name,func);break;case "custom":if(project){if(!CUSTOM_EASE_EDITOR_MAP.has(project))CUSTOM_EASE_EDITOR_MAP.set(project,new Map);const customEaseMap=CUSTOM_EASE_EDITOR_MAP.get(project);customEaseMap.set(name,func)}else CUSTOM_EASE_RUNTIME_MAP.set(name,func);break;case "private":EASE_MAP.set(name,func);PRIVATE_EASE_MAP.set(name,func);break; +default:throw new Error("unexpected ease mode");}}static NoEase(t,b,c,d){return c*t/d+b}static EaseInQuad(t,b,c,d){return c*(t/=d)*t+b}static EaseOutQuad(t,b,c,d){return-c*(t/=d)*(t-2)+b}static EaseInOutQuad(t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*(--t*(t-2)-1)+b}static EaseInCubic(t,b,c,d){return c*(t/=d)*t*t+b}static EaseOutCubic(t,b,c,d){return c*((t=t/d-1)*t*t+1)+b}static EaseInOutCubic(t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b}static EaseInQuart(t,b,c,d){return c* +(t/=d)*t*t*t+b}static EaseOutQuart(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b}static EaseInOutQuart(t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b}static EaseInQuint(t,b,c,d){return c*(t/=d)*t*t*t*t+b}static EaseOutQuint(t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b}static EaseInOutQuint(t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b}static EaseInSine(t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b}static EaseOutSine(t,b,c,d){return c*Math.sin(t/ +d*(Math.PI/2))+b}static EaseInOutSine(t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b}static EaseInExpo(t,b,c,d){return t===0?b:c*Math.pow(2,10*(t/d-1))+b}static EaseOutExpo(t,b,c,d){return t===d?b+c:c*(-Math.pow(2,-10*t/d)+1)+b}static EaseInOutExpo(t,b,c,d){if(t===0)return b;if(t===d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b}static EaseInCirc(t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b}static EaseOutCirc(t,b,c,d){return c*Math.sqrt(1-(t=t/ +d-1)*t)+b}static EaseInOutCirc(t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b}static EaseInElastic(t,b,c,d){let s=1.70158;let p=0;let a=c;if(t===0)return b;if((t/=d)===1)return b+c;if(!p)p=d*.3;if(a{return p3-3*p2+3*p1-p0};const b=(p0,p1,p2,p3)=>{return 3*p2-6*p1+3*p0};const c=(p0,p1,p2,p3)=>{return 3*(p1-p0)};const calc_bezier=(aT,a,b,c)=>{return((a*aT+b)*aT+c)*aT};const get_slope=(aT,a,b,c)=>{return 3*a*aT*aT+2*b*aT+c};const get_t_for_x=(aX,p0,p1,p2,p3,samples)=>{if(aX==1)return 1;let intervalStart=0;let currentSampleIndex=1;let currentSampleValue=samples[currentSampleIndex];let lastSampleIndex=SAMPLE_COUNT-1;let lastSampleValue= +samples[SAMPLE_COUNT-1];while(currentSampleIndex!=lastSampleIndex&¤tSampleValue<=aX){currentSampleIndex++;currentSampleValue=samples[currentSampleIndex];intervalStart+=SAMPLE_STEP}currentSampleIndex--;currentSampleValue=samples[currentSampleIndex];const dist=(aX-currentSampleValue)/(samples[currentSampleIndex+1]-currentSampleValue);let guess=intervalStart+dist*SAMPLE_STEP;const va=a(p0,p1,p2,p3);const vb=b(p0,p1,p2,p3);const vc=c(p0,p1,p2,p3);const initSlope=get_slope(guess,va,vb,vc);if(initSlope=== +0)return guess;else if(initSlope>=NEWTON_RAPHSON_MIN_SLOPE){for(let i=0;i0)aB=guess;else aA=guess;precissionLimit=Math.abs(x)>SUBDIVISION_PRECISION;maxIterations=++i0)return;C3.clearArray(this._captureListeners);this._captureListenersSet.clear();C3.clearArray(this._listeners); +this._listenersSet.clear();C3.clearArray(this._queueAddListeners);C3.clearArray(this._queueRemoveCaptureListeners);C3.clearArray(this._queueRemoveListeners);C3.Release(this)}_AddListener(func,capture){if(this._IsFiring()){this._queueAddListeners.push([func,capture]);return}if(capture){if(this._captureListenersSet.has(func))return;this._captureListeners.push(func);this._captureListenersSet.add(func)}else{if(this._listenersSet.has(func))return;this._listeners.push(func);this._listenersSet.add(func)}}_RemoveListener(func, +capture){if(this._IsFiring()){if(capture)this._queueRemoveCaptureListeners.push(func);else this._queueRemoveListeners.push(func);return}if(capture){if(this._captureListenersSet.has(func)){this._captureListenersSet.delete(func);C3.arrayFindRemove(this._captureListeners,func)}}else if(this._listenersSet.has(func)){this._listenersSet.delete(func);C3.arrayFindRemove(this._listeners,func)}}_IsEmpty(){return!this._captureListeners.length&&!this._listeners.length}_IsFiring(){return this._fireDepth>0}_ProcessQueuedListeners(){for(let q of this._queueAddListeners)this._AddListener(...q); +C3.clearArray(this._queueAddListeners);for(const func of this._queueRemoveListeners)this._listenersSet.delete(func);for(const func of this._queueRemoveCaptureListeners)this._captureListenersSet.delete(func);const removeListenersSet=new Set(this._queueRemoveListeners);const removeCaptureListenersSet=new Set(this._queueRemoveCaptureListeners);C3.arrayRemoveAllInSet(this._listeners,removeListenersSet);C3.arrayRemoveAllInSet(this._captureListeners,removeCaptureListenersSet);C3.clearArray(this._queueRemoveCaptureListeners); +C3.clearArray(this._queueRemoveListeners)}_FireCancellable(event){this._IncreaseFireDepth();let isStopped=false;for(let i=0,len=this._captureListeners.length;ifunc(event)))}for(let i=0,len=this._listeners.length;ifunc(event)))}return Promise.all(callbackPromises).then(()=>!event.defaultPrevented)}_FireAndWait_AsyncOptional(event){const results=[];this._IncreaseFireDepth();for(let i=0,len=this._captureListeners.length;i!event.defaultPrevented);else return!event.defaultPrevented}async _FireAndWaitAsync(event){return await this._FireAndWait_AsyncOptional(event)}async _FireAndWaitAsyncSequential(event){this._IncreaseFireDepth();for(let i=0,len=this._captureListeners.length;i< +len;++i){const ret=this._captureListeners[i](event);if(ret instanceof Promise)await ret}for(let i=0,len=this._listeners.length;i0?1:timerTimeout)}function DoAsyncifiedWork(deadline){callbackId= +-1;if(!workQueue.length)return;let startTime=performance.now();let curTime=startTime;let jobCount=0;let estimatedNextJobDuration=0;do{DoNextAsyncifiedJob(workQueue.shift());curTime=performance.now();++jobCount;estimatedNextJobDuration=(curTime-startTime)/jobCount*1.1}while(workQueue.length&&(SUPPORTS_RIC&&highThroughputMode===0&&typeof deadline!=="undefined"?estimatedNextJobDuration{workQueue.push({func:func,resolve:resolve,reject:reject,stack:stack});if(asyncifyDisabled){DoNextAsyncifiedJob(workQueue.pop());return}if(callbackId===-1)SetNewCallback(SETTIMEOUT_INTERVAL)})};C3.Asyncify.SetHighThroughputMode=function SetHighThroughputMode(m){if(m)++highThroughputMode;else{--highThroughputMode;if(highThroughputMode<0)throw new Error("already turned off high throughput mode");}}}; + + +// ../lib/util/idleTimeout.js +'use strict';{const C3=self.C3;const IDLE_CHECK_MIN_INTERVAL=1E3;const IDLE_CHECK_TIMER_OVERSHOOT=100;let cachedNowTime=-1;function ClearTimeCache(){cachedNowTime=-1}C3.FastGetDateNow=function FastGetDateNow(){if(cachedNowTime===-1){cachedNowTime=Date.now();self.setTimeout(ClearTimeCache,16)}return cachedNowTime};let timerId=-1;let nextDeadline=-1;let activeIdleTimeouts=new Set;function CheckActiveIdleTimeouts(){timerId=-1;nextDeadline=-1;let nowTime=Date.now();for(let i of activeIdleTimeouts)if(i._CheckTimeout(nowTime)){let deadline= +i._GetDeadline();if(nextDeadline===-1||deadlinenowTime+IDLE_CHECK_MIN_INTERVAL){self.clearTimeout(timerId);nextDeadline=this._deadline;timerId=self.setTimeout(CheckActiveIdleTimeouts,this._timeout+IDLE_CHECK_TIMER_OVERSHOOT)}}_CheckTimeout(nowTime){if(nowTime>= +this._deadline){if(this._callback()){this._deadline=nowTime+this._timeout;return true}this._isActive=false;return false}return true}_GetDeadline(){return this._deadline}Cancel(){if(this._isActive){activeIdleTimeouts.delete(this);this._isActive=false;if(activeIdleTimeouts.size===0&&timerId!==-1){self.clearTimeout(timerId);timerId=-1;nextDeadline=-1}}}Release(){this.Cancel();this._callback=null}}}; + + +// ../lib/util/disposable.js +'use strict';{const C3=self.C3;C3.Disposable=class Disposable{constructor(disposeAction){this._disposed=false;this._disposeAction=disposeAction}Dispose(){if(this._disposed)return;this._disposed=true;if(this._disposeAction){this._disposeAction();this._disposeAction=null}}IsDisposed(){return this._disposed}Release(){this.Dispose()}static Release(instance){return new Disposable(()=>instance.Release())}static From(eventDispatcher,eventNames,eventHandler,opts,scope){if(typeof opts==="undefined"||opts=== +null)opts=false;else if(typeof opts!=="boolean"&&typeof opts!=="object")throw new TypeError("invalid event listener options");if(scope)eventHandler=eventHandler.bind(scope);if(eventNames.includes(" ")){eventNames=eventNames.split(" ");const disposable=new C3.CompositeDisposable;for(let eventName of eventNames){eventDispatcher.addEventListener(eventName,eventHandler,opts);disposable.Add(C3.New(C3.Disposable,()=>eventDispatcher.removeEventListener(eventName,eventHandler,opts)))}return disposable}else{eventDispatcher.addEventListener(eventNames, +eventHandler,opts);return C3.New(C3.Disposable,()=>eventDispatcher.removeEventListener(eventNames,eventHandler,opts))}}};C3.StubDisposable=class StubDisposable extends C3.Disposable{SetAction(disposeAction){this._disposeAction=disposeAction}};C3.CompositeDisposable=class CompositeDisposable extends C3.Disposable{constructor(...disposables){super();this._disposables=new Set;for(let disposable of disposables)this.Add(disposable)}Add(...disposables){if(this._disposed)throw new Error("already disposed"); +for(let disposable of disposables)this._disposables.add(disposable)}Remove(disposable){if(this._disposed)throw new Error("already disposed");this._disposables.delete(disposable)}RemoveAll(){if(this._disposed)throw new Error("already disposed");if(!this._disposables)return;for(let disposable of this._disposables)disposable.Dispose();this._disposables.clear()}IsDisposed(){return this._disposed}Dispose(){if(this._disposed)throw new Error("already disposed");this._disposed=true;for(let disposable of this._disposables)disposable.Dispose(); +this._disposables.clear();this._disposables=null}Release(){this.Dispose()}}}; + + +// c3/lib/util/kahanSum.js +'use strict';{const C3=self.C3;C3.KahanSum=class KahanSum extends C3.DefendedBase{constructor(){super();this._c=0;this._y=0;this._t=0;this._sum=0}Add(v){v=+v;this._y=v-this._c;this._t=this._sum+this._y;this._c=this._t-this._sum-this._y;this._sum=this._t}Subtract(v){this._sum-=+v}Get(){return this._sum}Reset(){this._c=0;this._y=0;this._t=0;this._sum=0}Set(s){this._c=0;this._y=0;this._t=0;this._sum=+s}Release(){}}}; + + +// c3/lib/util/redblackset.js +'use strict';{const C3=self.C3;const js_cols={};const RED=true;const BLACK=false;js_cols.RBnode=function(tree){this.tree=tree;this.right=this.tree.sentinel;this.left=this.tree.sentinel;this.parent=null;this.color=false;this.key=null};js_cols.RedBlackSet=function(compare_func){this.size=0;this.sentinel=new js_cols.RBnode(this);this.sentinel.color=BLACK;this.root=this.sentinel;this.root.parent=this.sentinel;this.compare=compare_func||this.default_compare};js_cols.RedBlackSet.prototype.default_compare= +function(a,b){if(a0){var x=this.get_(key);if(x==this.sentinel)return null;if(x.right!=this.sentinel)return this.min(x.right).key;var y=x.parent;while(y!=this.sentinel&&x==y.right){x=y;y=y.parent}if(y!=this.sentinel)return y.key;else return null}else return null};js_cols.RedBlackSet.prototype.predecessor=function(key){if(this.size>0){var x= +this.get_(key);if(x==this.sentinel)return null;if(x.left!=this.sentinel)return this.max(x.left).key;var y=x.parent;while(y!=this.sentinel&&x==y.left){x=y;y=y.parent}if(y!=this.sentinel)return y.key;else return null}else return null};js_cols.RedBlackSet.prototype.getMin=function(){return this.min(this.root).key};js_cols.RedBlackSet.prototype.getMax=function(){return this.max(this.root).key};js_cols.RedBlackSet.prototype.get_=function(key){var x=this.root;while(x!=this.sentinel&&this.compare(x.key, +key)!=0)if(this.compare(key,x.key)<0)x=x.left;else x=x.right;return x};js_cols.RedBlackSet.prototype.contains=function(key){return this.get_(key).key!=null};js_cols.RedBlackSet.prototype.getValues=function(){var ret=[];this.forEach(function(x){ret.push(x)});return ret};js_cols.RedBlackSet.prototype.insertAll=function(col){if(js_cols.typeOf(col)=="array")for(var i=0;icolCount)return false;var i=0;if(this.isEmpty())return true;for(var n=this.min(this.root);n!=this.sentinel;n=this.successor_(n))if(js_cols.contains.call(col,col,n.key))i++;return i==this.getCount()};js_cols.RedBlackSet.prototype.intersection=function(col){var result=new js_cols.RedBlackSet(this.compare);if(this.isEmpty())return result;for(var n=this.min(this.root);n!=this.sentinel;n=this.successor_(n))if(col.contains.call(col,n.key,n.key,this))result.insert(n.key); +return result};C3.RedBlackSet=class RedBlackSet extends C3.DefendedBase{constructor(sortFunc){super();this._rbSet=new js_cols.RedBlackSet(sortFunc);this._enableQueue=false;this._queueInsert=new Set;this._queueRemove=new Set}Add(item){if(this._enableQueue)if(this._rbSet.contains(item))this._queueRemove.delete(item);else this._queueInsert.add(item);else this._rbSet.insert(item)}Remove(item){if(this._enableQueue)if(this._rbSet.contains(item))this._queueRemove.add(item);else this._queueInsert.delete(item); +else this._rbSet.remove(item)}Has(item){if(this._enableQueue){if(this._queueInsert.has(item))return true;return!this._queueRemove.has(item)&&this._rbSet.contains(item)}else return this._rbSet.contains(item)}Clear(){this._rbSet.clear();this._queueInsert.clear();this._queueRemove.clear()}toArray(){if(this._enableQueue)throw new Error("cannot be used in queueing mode");return this._rbSet.getValues()}GetSize(){return this._rbSet.getCount()+this._queueInsert.size-this._queueRemove.size}IsEmpty(){return this.GetSize()=== +0}Front(){if(this.IsEmpty())throw new Error("empty set");if(this._enableQueue)throw new Error("cannot be used in queueing mode");const rbSet=this._rbSet;const n=rbSet.min(rbSet.root);return n.key}Shift(){if(this.IsEmpty())throw new Error("empty set");if(this._enableQueue)throw new Error("cannot be used in queueing mode");const item=this.Front();this.Remove(item);return item}SetQueueingEnabled(q){q=!!q;if(this._enableQueue===q)return;this._enableQueue=q;if(!q){for(const item of this._queueRemove)this._rbSet.remove(item); +this._queueRemove.clear();for(const item of this._queueInsert)this._rbSet.insert(item);this._queueInsert.clear()}}ForEach(func){this._rbSet.forEach(func)}*values(){if(this.IsEmpty())return;const rbSet=this._rbSet;for(let n=rbSet.min(rbSet.root);n!=rbSet.sentinel;n=rbSet.successor_(n))yield n.key}[Symbol.iterator](){return this.values()}}}; + + +// ../lib/util/promiseThrottle.js +'use strict';{const C3=self.C3;C3.PromiseThrottle=class PromiseThrottle{constructor(maxParallel=C3.hardwareConcurrency){this._maxParallel=maxParallel;this._queue=[];this._activeCount=0}Add(func){return new Promise((resolve,reject)=>{this._queue.push({func,resolve,reject});this._MaybeStartNext()})}_FindInQueue(func){for(let i=0,len=this._queue.length;i=this._maxParallel)return;this._activeCount++;const job=this._queue.shift();try{const result=await job.func();job.resolve(result)}catch(err){job.reject(err)}this._activeCount--;this._MaybeStartNext()}static async Batch(concurrency, +methods){const results=[];let failed=false;const execute=async _=>{let fn;while(fn=methods.pop()){if(failed)return;try{results.push(await fn())}catch(e){failed=true;throw e;}}};const promises=[];while(concurrency--)promises.push(execute());await Promise.all(promises);return results}}}; + + +// ../lib/util/rateLimiter.js +'use strict';{const C3=self.C3;C3.RateLimiter=class RateLimiter{constructor(callback,interval,intervalOnBattery){this._callback=callback;this._interval=interval;this._intervalOnBattery=intervalOnBattery||interval*2;this._timerId=-1;this._lastCallTime=-Infinity;this._timerCallFunc=()=>this._OnTimer();this._ignoreReset=false;this._canRunImmediate=false;this._callbackArguments=null}SetCanRunImmediate(c){this._canRunImmediate=!!c}_GetInterval(){if(typeof C3.Battery!=="undefined"&&C3.Battery.IsOnBatteryPower())return this._intervalOnBattery; +else return this._interval}Call(...args){if(this._timerId!==-1)return;this._callbackArguments=args;let nowTime=C3.FastGetDateNow();let timeSinceLastCall=nowTime-this._lastCallTime;let interval=this._GetInterval();if(timeSinceLastCall>=interval&&this._canRunImmediate){this._lastCallTime=nowTime;this._RunCallback()}else this._timerId=self.setTimeout(this._timerCallFunc,Math.max(interval-timeSinceLastCall,4))}_RunCallback(){this._ignoreReset=true;const args=this._callbackArguments;this._callbackArguments= +null;if(args)this._callback(...args);else this._callback();this._ignoreReset=false}Reset(){if(this._ignoreReset)return;this._CancelTimer();this._callbackArguments=null;this._lastCallTime=C3.FastGetDateNow()}_OnTimer(){this._timerId=-1;this._lastCallTime=C3.FastGetDateNow();this._RunCallback()}_CancelTimer(){if(this._timerId!==-1){self.clearTimeout(this._timerId);this._timerId=-1}}Release(){this._CancelTimer();this._callback=null;this._callbackArguments=null;this._timerCallFunc=null}}}; + + +// ../lib/util/svgRaster/svgRasterManager.js +'use strict';{const C3=self.C3;C3.SVGRasterManager=class SVGRasterManager{constructor(){this._images=new Map;this._allowNpotSurfaces=false;this._getBaseSizeCallback=null;this._rasterAtSizeCallback=null;this._releaseResultCallback=null;this._redrawCallback=null}SetNpotSurfaceAllowed(a){this._allowNpotSurfaces=!!a}IsNpotSurfaceAllowed(){return this._allowNpotSurfaces}SetGetBaseSizeCallback(f){this._getBaseSizeCallback=f}GetBaseSize(dataSource){if(!this._getBaseSizeCallback)throw new Error("no get base size callback set"); +return this._getBaseSizeCallback(dataSource)}SetRasterAtSizeCallback(f){this._rasterAtSizeCallback=f}RasterAtSize(dataSource,context,surfaceWidth,surfaceHeight,imageWidth,imageHeight){if(!this._rasterAtSizeCallback)throw new Error("no raster at size callback set");return this._rasterAtSizeCallback(dataSource,context,surfaceWidth,surfaceHeight,imageWidth,imageHeight)}SetReleaseResultCallback(f){this._releaseResultCallback=f}ReleaseResult(rasterizedResult){if(!this._releaseResultCallback)throw new Error("no release result callback set"); +this._releaseResultCallback(rasterizedResult)}SetRedrawCallback(f){this._redrawCallback=f}Redraw(){if(!this._redrawCallback)throw new Error("no redraw callback set");this._redrawCallback()}AddImage(dataSource){let ret=this._images.get(dataSource);if(!ret){ret=C3.New(C3.SVGRasterImage,this,dataSource);this._images.set(dataSource,ret)}ret.IncReference();return ret}_RemoveImage(ri){this._images.delete(ri.GetDataSource())}OnTexturesChanged(){for(const ri of this._images.values()){ri.ReleaseRasterizedResult(); +ri.ForceRasterAgain()}}}}; + + +// ../lib/util/svgRaster/svgRasterImage.js +'use strict';{const C3=self.C3;const MAX_SURFACE_SIZE=2048;C3.SVGRasterImage=class SVGRasterImage{constructor(manager,dataSource){this._manager=manager;this._dataSource=dataSource;this._refCount=0;this._baseWidth=0;this._baseHeight=0;this._getBaseSizePromise=this._manager.GetBaseSize(dataSource).then(baseSize=>{this._baseWidth=baseSize[0];this._baseHeight=baseSize[1];this._manager.Redraw()}).catch(err=>{console.error("[SVG] Error loading SVG: ",err);this._hadError=true;this._manager.Redraw()});this._rasterSurfaceWidth= +0;this._rasterSurfaceHeight=0;this._rasterImageWidth=0;this._rasterImageHeight=0;this._isRasterizing=false;this._rasterizedResult=null;this._forceRaster=false;this._hadError=false}Release(){if(this._refCount<=0)throw new Error("already released");this._refCount--;if(this._refCount===0)this._Release()}ReleaseRasterizedResult(){if(this._rasterizedResult){this._manager.ReleaseResult(this._rasterizedResult);this._rasterizedResult=null}}_Release(){this.ReleaseRasterizedResult();this._manager._RemoveImage(this); +this._manager=null}GetDataSource(){return this._dataSource}IncReference(){this._refCount++}HasReferences(){return this._refCount>0}GetRasterizedResult(){return this._rasterizedResult}ForceRasterAgain(){this._forceRaster=true}async StartRasterForSize(context,width,height){if(width===0||height===0||this._hadError)return;if(this._isRasterizing)return;let rasterSurfaceWidth=C3.nextHighestPowerOfTwo(Math.ceil(width));let rasterSurfaceHeight=C3.nextHighestPowerOfTwo(Math.ceil(height));const maxDim=Math.max(rasterSurfaceWidth, +rasterSurfaceHeight);if(maxDim>MAX_SURFACE_SIZE){const scale=MAX_SURFACE_SIZE/maxDim;width*=scale;height*=scale;rasterSurfaceWidth=Math.min(Math.ceil(rasterSurfaceWidth*scale),MAX_SURFACE_SIZE);rasterSurfaceHeight=Math.min(Math.ceil(rasterSurfaceHeight*scale),MAX_SURFACE_SIZE)}if(widthimageAspectRatio){width=rasterSurfaceHeight* +imageAspectRatio;height=rasterSurfaceHeight}else{width=rasterSurfaceWidth;height=rasterSurfaceWidth/imageAspectRatio}}if(this._manager.IsNpotSurfaceAllowed()){rasterSurfaceWidth=Math.ceil(width);rasterSurfaceHeight=Math.ceil(height)}if(rasterSurfaceWidth<=this._rasterSurfaceWidth&&rasterSurfaceHeight<=this._rasterSurfaceHeight&&!this._forceRaster)return;this._isRasterizing=true;this._rasterSurfaceWidth=rasterSurfaceWidth;this._rasterSurfaceHeight=rasterSurfaceHeight;const newRasterizedResult=await this._manager.RasterAtSize(this._dataSource, +context,this._rasterSurfaceWidth,this._rasterSurfaceHeight,width,height);if(!this._manager)return;this.ReleaseRasterizedResult();this._rasterizedResult=newRasterizedResult;this._rasterImageWidth=width;this._rasterImageHeight=height;this._isRasterizing=false;this._forceRaster=false;this._manager.Redraw()}WhenBaseSizeReady(){return this._getBaseSizePromise}GetBaseWidth(){return this._baseWidth}GetBaseHeight(){return this._baseHeight}GetRasterWidth(){return this._rasterImageWidth}GetRasterHeight(){return this._rasterImageHeight}HadError(){return this._hadError}}}; + + +// ../lib/str/str.js +'use strict';{const C3=self.C3;C3.UTF8_BOM="\ufeff";const NUMERIC_CHARS=new Set([..."0123456789"]);C3.IsNumericChar=function IsNumericChar(c){return NUMERIC_CHARS.has(c)};const WHITESPACE_CHARS=new Set([..." \t\n\r\u00a0\u0085\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000"]);C3.IsWhitespaceChar=function IsWhitespaceChar(c){return WHITESPACE_CHARS.has(c)};C3.FilterWhitespace=function FilterWhitespace(str){return[...str].filter(ch=>!C3.IsWhitespaceChar(ch)).join("")}; +C3.IsStringAllWhitespace=function IsStringAllWhitespace(str){for(const ch of str)if(!C3.IsWhitespaceChar(ch))return false;return true};C3.IsUnprintableChar=function IsUnprintableChar(c){return c.length===1&&c.charCodeAt(0)<32};C3.FilterUnprintableChars=function FilterUnprintableChars(str){return[...str].filter(ch=>!C3.IsUnprintableChar(ch)).join("")};const NUMERIC_STRING_CHARS=new Set([..."0123456789.+-e"]);C3.IsStringNumber=function IsStringNumber(str){str=str.trim();if(!str.length)return false; +let firstChar=str.charAt(0);if(firstChar!=="-"&&!NUMERIC_CHARS.has(firstChar))return false;for(let ch of str)if(!NUMERIC_STRING_CHARS.has(ch))return false;return true};C3.RemoveTrailingDigits=function RemoveTrailingDigits(str){let i=str.length;while(i>0){let prev_ch=str.charAt(i-1);if(!C3.IsNumericChar(prev_ch))break;--i}return str.substr(0,i)};C3.IncrementNumberAtEndOf=function IncrementNumberAtEndOf(str){let baseStr=C3.RemoveTrailingDigits(str);let numberStr=str.substr(baseStr.length);if(numberStr)numberStr= +(parseInt(numberStr,10)+1).toString();else numberStr="2";return baseStr+numberStr};const HTML_ENTITY_MAP=new Map([["&","&"],["<","<"],[">",">"],['"',"""],["'","'"]]);function lookupHtmlEntity(s){return HTML_ENTITY_MAP.get(s)}const HTML_ENTITY_REGEX=/[&<>"']/g;C3.EscapeHTML=function EscapeHTML(str){return str.replace(HTML_ENTITY_REGEX,lookupHtmlEntity)};C3.EscapeJS=function EscapeJS(str){let ret=C3.ReplaceAll(str,"\\","\\\\");ret=C3.ReplaceAll(ret,'"','\\"');ret=C3.ReplaceAll(ret, +"\t","\\t");ret=C3.ReplaceAll(ret,"\r","");return C3.ReplaceAll(ret,"\n","\\n")};C3.EscapeXML=function EscapeXML(str){let ret=C3.ReplaceAll(str,"&","&");ret=C3.ReplaceAll(ret,"<","<");ret=C3.ReplaceAll(ret,">",">");return C3.ReplaceAll(ret,'"',""")};const ESCAPE_REGEX=/[-[\]{}()*+?.,\\^$|#\s]/g;C3.EscapeRegex=function EscapeRegex(str){return str.replace(ESCAPE_REGEX,"\\$&")};C3.FindAll=function FindAll(str,find,matchCase=false){if(!find)return[];if(!matchCase){str=str.toLowerCase(); +find=find.toLowerCase()}const findLen=find.length;let startIndex=0;let index=0;let ret=[];while((index=str.indexOf(find,startIndex))>-1){ret.push(index);startIndex=index+findLen}return ret};C3.ReplaceAll=function ReplaceAll(str,find,replace){return str.replaceAll(find,()=>replace)};C3.ReplaceAllCaseInsensitive=function ReplaceAll(str,find,replace){return str.replace(new RegExp(C3.EscapeRegex(find),"gi"),()=>replace)};C3.SetElementContent=function SetElementContent(elem,stringlike){if(typeof stringlike=== +"string")elem.textContent=stringlike;else if(stringlike.isPlainText())elem.textContent=stringlike.toString();else{elem.innerHTML=stringlike.toHTML();if(stringlike instanceof C3.BBString)stringlike.attachLinkHandlers(elem)}};C3.StringLikeEquals=function StringLikeEquals(a,b){if(a instanceof C3.HtmlString||a instanceof C3.BBString)return a.equals(b);else if(b instanceof C3.HtmlString||b instanceof C3.BBString)return b.equals(a);else return a===b};C3.StringSubstitute=function StringSubstitute(str,...arr){let ret= +str;for(let i=0,len=arr.length;i=0&&highestUsedIndex>=0&&lowestMissingIndexlowerB)return 1;else if(lowerA0){secondsTotal-=days*24*3600;parts.push(langPluralSub(".days",null,days))}}if(opts.hours){const hours=Math.floor(secondsTotal/3600);if(hours>0||parts.length){secondsTotal-= +hours*3600;parts.push(langPluralSub(".hours",null,hours))}}if(opts.minutes){const minutes=Math.floor(secondsTotal/60);if(minutes>0||parts.length||!opts.seconds){secondsTotal-=minutes*60;parts.push(langPluralSub(".minutes",null,minutes))}}if(opts.seconds){const seconds=Math.floor(secondsTotal%60);parts.push(langPluralSub(".seconds",null,seconds))}const ret=(opts.approximate?lang(".approx-prefix"):"")+parts.join(lang(".separator"));C3.Lang.PopContext();return ret};C3.ZeroPad=function(n,d){let s=n<0? +"-":"";n=Math.abs(n);let nStr=n.toString();let zeroes=d-nStr.length;for(let i=0;it.toUpperCase())};C3.CompareVersionStrings=function CompareVersionStrings(v1,v2){let a1=v1.split(".").map(s=>s.trim());let a2=v2.split(".").map(s=>s.trim());C3.resizeArray(a1,4,"0");C3.resizeArray(a2,4,"0");a1=a1.map(s=>parseInt(s,10));a2=a2.map(s=>parseInt(s,10));for(let i=0;i<4;++i){const diff= +a1[i]-a2[i];if(diff!==0)return diff<0?-1:1}return 0};C3.CreateGUID=function CreateGUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,c=>{const r=Math.floor(Math.random()*16);const v=c==="x"?r:r&3|8;return v.toString(16)})};C3.StringHammingDistance=function StringHammingDistance(a,b){if(a.length!==b.length)throw new Error("strings must be same length");let ret=0;for(let i=0,len=a.length;ib.length){tmp=a;a=b;b=tmp}row=Array(a.length+1);for(i=0;i<=a.length;i++)row[i]=i;for(i=1;i<=b.length;i++){prev=i;for(j=1;j<=a.length;j++){if(b[i-1]===a[j-1])val=row[j-1];else val=Math.min(row[j-1]+1,Math.min(prev+1,row[j]+1));row[j-1]=prev;prev=val}row[a.length]=prev}return row[a.length]}}; + + +// ../lib/str/bbstring.js +'use strict';{const C3=self.C3;const assert=self.assert;const BB_CODE_MAP=new Map([["b","strong"],["i","em"],["s","s"],["u","u"],["sub","sub"],["sup","sup"],["small","small"],["mark","mark"],["a1","a"],["a2","a"],["a3","a"],["a4","a"],["a5","a"],["a6","a"],["a7","a"],["a8","a"],["a9","a"],["bad",["span","bbCodeBad"]],["good",["span","bbCodeGood"]],["info",["span","bbCodeInfo"]],["h1",["span","bbCodeH1"]],["h2",["span","bbCodeH2"]],["h3",["span","bbCodeH3"]],["h4",["span","bbCodeH4"]],["item",["span", +"bbCodeItem"]]]);const BBREGEX=/\[(\/?)([a-zA-Z0-9]+)\]/g;const CUSTOM_BBREGEX=/\[(\/?)([^\[]*?)\]/g;let linkActions=null;let classIndex=0;function bbToHtmlReplacerFunc(match,closeSlash,tagName){const entry=BB_CODE_MAP.get(tagName);if(entry)if(typeof entry==="string")if(entry==="a"&&!closeSlash){const index=parseInt(tagName.substring(1),10)-1;if(index<0||index>=linkActions.length)throw new Error("invalid bbcode link substitution");const linkAction=linkActions[index];if(typeof linkAction==="string")return``; +else if(typeof linkAction==="function")return``;else throw new TypeError("invalid bbcode link action");}else return"<"+closeSlash+entry+">";else if(Array.isArray(entry)){let tag=entry[0];let className=entry[1];if(closeSlash)return"";else return`<${tag} class="${className}">`}else;else if(tagName==="class")if(closeSlash)return"";else return``;else return match}const LINEBREAK_REGEX=/\n/g;C3.BBString=class BBString{constructor(str, +opts){this._bbstr=opts&&opts.noEscape?str:C3.EscapeHTML(str);this._htmlstr="";this._convertLineBreaks=false;this._linkActions=[];if(opts){this._convertLineBreaks=!!opts.convertLineBreaks;if(opts.links){if(opts.links.length>9)throw new Error("too many links");this._linkActions=opts.links}}this._hasAnyBBtags=this._bbstr.includes("[");this._needsLineBreakConversion=this._convertLineBreaks&&this._bbstr.includes("\n");this._isPlain=!this._hasAnyBBtags&&!this._needsLineBreakConversion&&!this._bbstr.includes("&"); +this._hasParsedFragments=false;this._fragments=[]}toString(){return this._bbstr}valueOf(){return this._bbstr}isPlainText(){return this._isPlain}toPlainText(){if(this._hasAnyBBtags)return this._bbstr.replace(BBREGEX,"");else return this._bbstr}toHTML(){if(this._isPlain)return this._bbstr;if(!this._htmlstr&&this._bbstr){let str=this._bbstr;if(this._hasAnyBBtags){classIndex=0;linkActions=this._linkActions;str=str.replace(BBREGEX,bbToHtmlReplacerFunc);linkActions=null}if(this._needsLineBreakConversion)str= +str.replace(LINEBREAK_REGEX,"
");this._htmlstr=str}return this._htmlstr}attachLinkHandlers(parentElem){if(!this._linkActions.length)return;for(let i=0,len=this._linkActions.length;i0&&bbStr.charAt(index-1)==="\\")continue;const matchStr=result[0];const closeSlash=result[1];const tagName=result[2];const strFrag=bbStr.substring(prevIndex, +index);prevIndex=index+matchStr.length;if(strFrag)this._fragments.push({text:strFrag,styles:styleStack.slice(0)});if(!tagName)continue;if(closeSlash){const lowerTagName=tagName.toLowerCase();for(let i=styleStack.length-1;i>=0;--i)if(styleStack[i].tag===lowerTagName){styleStack.splice(i,1);break}}else{let tag=tagName;let param=null;const eq=tagName.indexOf("=");if(eq!==-1){tag=tagName.substring(0,eq).toLowerCase();param=tagName.substring(eq+1)}else tag=tag.toLowerCase();styleStack.push({tag,param})}}if(prevIndex< +bbStr.length)this._fragments.push({text:bbStr.substring(prevIndex),styles:styleStack.slice(0)});for(const frag of this._fragments)frag.text=this._ProcessBBCodeEscapeSequences(frag.text);this._hasParsedFragments=true;return this._fragments}_ProcessBBCodeEscapeSequences(text){text=C3.ReplaceAll(text,"\\[","[");return C3.ReplaceAll(text,"\\\\","\\")}static StripTags(str){return C3.New(C3.BBString,str,{noEscape:true}).toPlainText()}static StripAnyTags(str){return str.replace(CUSTOM_BBREGEX,"")}}}; + + +// ../lib/str/wordWrap.js +'use strict';{const C3=self.C3;C3.WordWrap=class WordWrap{constructor(){this._lines=[]}GetLines(){return this._lines}GetLineCount(){return this._lines.length}_MeasureLine(line,measureFunc){let width=0;let height=0;for(const frag of line){if(frag.width===-1){const m=measureFunc(frag.text,frag.styles);frag.width=m.width;frag.height=m.height}width+=frag.width;height=Math.max(height,frag.height)}return{width,height}}_AddLine(fragments,width,height){this._lines.push({fragments,width,height})}WordWrap(fragmentArr, +measureFunc,wrapWidth,wrapMode,endOfLineMargin){if(typeof fragmentArr==="string")fragmentArr=[{text:fragmentArr,styles:[]}];C3.clearArray(this._lines);if(!fragmentArr.length||fragmentArr.length===1&&!fragmentArr[0].text.length||wrapWidth<2)return;if(fragmentArr.length===1){const frag=fragmentArr[0];const text=frag.text;const styles=frag.styles;if(text.length<=100&&!text.includes("\n")){let {width,height}=measureFunc(text,styles);width+=endOfLineMargin;if(width<=wrapWidth){this._AddLine([{text,styles, +width,height}],width,height);return}}}let tokenisedFragments;if(wrapMode==="word")tokenisedFragments=this._TokeniseWords(fragmentArr);else{tokenisedFragments=[];for(const frag of fragmentArr)C3.appendArray(tokenisedFragments,[...frag.text].map(ch=>[{text:ch,styles:frag.styles}]))}this._WrapText(tokenisedFragments,measureFunc,wrapWidth,endOfLineMargin)}_TokeniseWords(fragmentArr){const ret=[];let curWord=[];let isCurWhitespace=false;for(const frag of fragmentArr){const text=frag.text;const styles= +frag.styles;for(const ch of text)if(ch==="\n"){if(curWord.length>0)ret.push(curWord);ret.push([{text:"\n",styles}]);curWord=[]}else if(curWord.length===0){curWord.push({text:ch,styles});isCurWhitespace=C3.IsWhitespaceChar(ch)}else{const isWhitespace=C3.IsWhitespaceChar(ch);if(isWhitespace===isCurWhitespace){const curFrag=curWord[curWord.length-1];if(curFrag.styles===styles)curFrag.text+=ch;else curWord.push({text:ch,styles})}else{ret.push(curWord);curWord=[];curWord.push({text:ch,styles});isCurWhitespace= +isWhitespace}}}if(curWord.length>0)ret.push(curWord);return ret}_CopyLine(line){return line.map(f=>({text:f.text,styles:f.styles,width:f.width,height:f.height}))}_AddWordToLine(currentLine,curWord){const lastFrag=currentLine.length?currentLine[currentLine.length-1]:null;let i=0;if(lastFrag&&curWord[0].styles===lastFrag.styles){lastFrag.text+=curWord[0].text;lastFrag.width=-1;lastFrag.height=-1;i=1}for(let len=curWord.length;i=wrapWidth){if(currentLine.length>0)this._AddLine(currentLine,currentLineWidth,currentLineHeight);currentLine=[];if(C3.IsStringAllWhitespace(curWord[0].text)){currentLineWidth=0;currentLineHeight=0}else{this._AddWordToLine(currentLine,curWord);const metrics=this._MeasureLine(currentLine,measureFunc);currentLineWidth=metrics.width;currentLineHeight= +metrics.height}}else{currentLine=tryLine;currentLineWidth=tryLineWidth;currentLineHeight=tryLineHeight}}if(currentLine.length>0)this._AddLine(currentLine,currentLineWidth,currentLineHeight);this._TrimLinesTrailingWhitespace(measureFunc,endOfLineMargin)}_TrimLinesTrailingWhitespace(measureFunc,endOfLineMargin){for(const line of this._lines){const fragments=line.fragments;if(!fragments.length)continue;let lastFrag=fragments[fragments.length-1];const text=lastFrag.text;const trimmedText=text.trimEnd(); +if(!trimmedText){line.width-=lastFrag.width;fragments.pop()}else if(trimmedText.length0){lastFrag=fragments[fragments.length-1];lastFrag.width+=endOfLineMargin;line.width+=endOfLineMargin}}}Clear(){C3.clearArray(this._lines)}GetMaxLineWidth(){return this._lines.reduce((a, +v)=>Math.max(a,v.width),0)}GetTotalLineHeight(){return this._lines.reduce((a,v)=>a+v.height,0)}}}; + + +// ../lib/gfx/gfx.js +'use strict';self.C3.Gfx={}; + + +// ../lib/gfx/rendererBase.js +'use strict';{const C3=self.C3;const PERSPECTIVE_NEAR_Z=1;const PERSPECTIVE_FAR_Z=1E4;const fTempo=[0,0,0,0,0,0,0,0];const glMatrix=self.glMatrix;const vec3=glMatrix.vec3;const mat4=glMatrix.mat4;const tmpVec3=vec3.fromValues(0,0,0);C3.Gfx.RendererBase=class RendererBase{constructor(){this._width=0;this._height=0;this._cam=vec3.fromValues(0,0,100);this._look=vec3.fromValues(0,0,0);this._up=vec3.fromValues(0,1,0);this._worldScale=vec3.fromValues(1,1,1);this._matP=mat4.create();this._matMV=mat4.create(); +this._lastMV=mat4.create();this._allShaderPrograms=[];this._shaderProgramsByName=new Map;this._spTextureFill=null;this._stateGroups=new Map;this._currentStateGroup=null;this._blendModeTable=[];this._namedBlendModeMap=new Map;this._frameNumber=0;this._enableMipmaps=true}FillIndexBufferData(indexData){let i=0,len=indexData.length,fv=0;while(i +0)throw new Error("releasing state group still in use");this._renderer=null;this._shaderProgram=null;this._shaderProgramName=""}Apply(){const renderer=this._renderer;renderer.SetProgram(this._shaderProgram);renderer.SetBlendMode(this._blendMode);renderer.SetColor(this._color);renderer.SetCurrentZ(this._zElevation);renderer._SetCurrentStateGroup(this)}GetKey(){return C3.Gfx.StateGroup.MakeKey(this._shaderProgramName,this._blendMode,this._color,this._zElevation)}AddRef(){++this._refCount}DecRef(){--this._refCount}_GetRefCount(){return this._refCount}OnContextLost(){this._shaderProgram= +null}OnContextRestored(renderer){this._shaderProgram=renderer.GetShaderProgramByName(this._shaderProgramName);if(!this._shaderProgram)throw new Error("failed to restore shader program");}static MakeKey(shaderProgram_or_name,blendMode,c,zElevation){const shaderProgramName=typeof shaderProgram_or_name==="string"?shaderProgram_or_name:shaderProgram_or_name.GetName();return shaderProgramName+","+blendMode+","+c.getR()+","+c.getG()+","+c.getB()+","+c.getA()+","+zElevation}}}; + + +// ../lib/gfx/mesh.js +'use strict';{const C3=self.C3;const tempQuadPos=C3.New(C3.Quad);const tempQuadTex=C3.New(C3.Quad);function interpolateQuad(srcX,srcY,quad){const qtlx=quad.getTlx();const qtly=quad.getTly();const qtrx=quad.getTrx()-qtlx;const qtry=quad.getTry()-qtly;const qblx=quad.getBlx()-qtlx;const qbly=quad.getBly()-qtly;const xix=qtrx*srcX;const xiy=qtry*srcX;const yix=qblx*srcY;const yiy=qbly*srcY;return[qtlx+xix+yix,qtly+xiy+yiy]}class MeshPoint{constructor(mesh){this._mesh=mesh;this._x=NaN;this._y=NaN;this._u= +NaN;this._v=NaN;this._x=0;this._y=0;this._u=0;this._v=0}_Init(x,y,u,v){this._x=x;this._y=y;this._u=u;this._v=v}GetX(){return this._x}SetX(x){if(this._x===x)return;this._x=x;this._mesh._SetPointsChanged()}GetY(){return this._y}SetY(y){if(this._y===y)return;this._y=y;this._mesh._SetPointsChanged()}GetU(){return this._u}SetU(u){this._u=u}GetV(){return this._v}SetV(v){this._v=v}_Interpolate_TexRect(srcPoint,quadPos,rcTex){[this._x,this._y]=interpolateQuad(srcPoint._x,srcPoint._y,quadPos);this._u=C3.lerp(rcTex.getLeft(), +rcTex.getRight(),srcPoint._u);this._v=C3.lerp(rcTex.getTop(),rcTex.getBottom(),srcPoint._v)}_Interpolate_TexQuad(srcPoint,quadPos,quadTex){[this._x,this._y]=interpolateQuad(srcPoint._x,srcPoint._y,quadPos);[this._u,this._v]=interpolateQuad(srcPoint._u,srcPoint._v,quadTex)}SaveToJson(){return{"x":this.GetX(),"y":this.GetY(),"u":this.GetU(),"v":this.GetV()}}LoadFromJson(o){this.SetX(o["x"]);this.SetY(o["y"]);this.SetU(o["u"]);this.SetV(o["v"])}}C3.Gfx.Mesh=class Mesh{constructor(hsize,vsize){if(hsize< +2||vsize<2)throw new Error("invalid mesh size");this._hsize=hsize;this._vsize=vsize;this._pts=[];this._minX=0;this._minY=0;this._maxX=1;this._maxY=1;this._pointsChanged=false;const lastX=hsize-1;const lastY=vsize-1;for(let y=0;y=this._hsize||y<0||y>=this._vsize)return null;return this._pts[y][x]}CalculateTransformedMesh(srcMesh,quadPos,rcTex_or_quad){const isTexRect=rcTex_or_quad instanceof C3.Rect;if(srcMesh.GetHSize()!==this.GetHSize()||srcMesh.GetVSize()!==this.GetVSize())throw new Error("source mesh wrong size");const srcPts=srcMesh._pts; +const destPts=this._pts;for(let y=0,lenY=destPts.length;y[x,y];const pts=this._pts;let prevRow=pts[0];for(let y=1,lenY=pts.length;y{curX=C3.clamp(C3.lerp(curX,nextX,rayHit),0,1);curY=C3.clamp(C3.lerp(curY,nextY,rayHit),0,1);outPts.push(curX,curY)};for(let i=0,len=inPts.length;i1E6)throw new Error("Too many mesh poly points");const srcTlx=curCol*colWidthNorm;const srcTly=curRow*rowHeightNorm;const srcBrx=(curCol+1)*colWidthNorm;const srcBry=(curRow+1)*rowHeightNorm;isUpper=C3.isPointInTriangleInclusive(curX,curY,srcTlx,srcTly,srcBrx,srcTly,srcBrx,srcBry);if(disableCheck!==DISABLE_DIAGONAL){rayHit= +C3.rayIntersectExtended(curX,curY,nextX,nextY,srcTlx,srcTly,srcBrx,srcBry,-RAY_EXT_DIST);if(rayHit>=MIN_RAY_DIST&&rayHit<=MAX_RAY_DIST){addVertexAtRayHit();isUpper=!isUpper;disableCheck=DISABLE_DIAGONAL;continue}}if(curRow>0&&disableCheck!==DISABLE_TOP_EDGE){rayHit=C3.rayIntersectExtended(curX,curY,nextX,nextY,srcTlx,srcTly,srcBrx,srcTly,RAY_EXT_DIST);if(rayHit>=MIN_RAY_DIST&&rayHit<=MAX_RAY_DIST){addVertexAtRayHit();curRow--;isUpper=false;disableCheck=DISABLE_BOTTOM_EDGE;continue}}if(curCol=MIN_RAY_DIST&&rayHit<=MAX_RAY_DIST){addVertexAtRayHit();curCol++;isUpper=false;disableCheck=DISABLE_LEFT_EDGE;continue}}if(curCol>0&&disableCheck!==DISABLE_LEFT_EDGE){rayHit=C3.rayIntersectExtended(curX,curY,nextX,nextY,srcTlx,srcTly,srcTlx,srcBry,RAY_EXT_DIST);if(rayHit>=MIN_RAY_DIST&&rayHit<=MAX_RAY_DIST){addVertexAtRayHit();curCol--;isUpper=true;disableCheck= +DISABLE_RIGHT_EDGE;continue}}if(curRow=MIN_RAY_DIST&&rayHit<=MAX_RAY_DIST){addVertexAtRayHit();curRow++;isUpper=true;disableCheck=DISABLE_TOP_EDGE;continue}}break}}return C3.New(C3.CollisionPoly,outPts)}TransformCollisionPoly(srcPoly,destPoly){const ptsArr=this._TransformPolyPoints(srcPoly);this._SimplifyPoly(ptsArr);destPoly.setPoints(ptsArr)}_TransformPolyPoints(srcPoly){const outPts= +[];const ptsArr=srcPoly.pointsArr();for(let i=0,len=ptsArr.length;iEPSILON||dx==0&&dy===0)outPts.push(curX,curY);curX=nextX;curY=nextY;lastDx=dx;lastDy=dy}if(outPts.lengthrow.map(pt=>pt.SaveToJson()))}}LoadFromJson(o){const cols=this.GetHSize();const rows=this.GetVSize();if(o["cols"]!==cols||o["rows"]!==rows)throw new Error("mesh data wrong size");const meshRows=o["points"];for(let y=0;ymaxTextureSize|| +this._height>maxTextureSize)throw new Error("texture data exceeds maximum texture size");const gl=this._renderer.GetContext();const webglVersion=this._renderer.GetWebGLVersionNumber();this._texture=gl.createTexture();gl.bindTexture(gl.TEXTURE_2D,this._texture);gl.pixelStorei(gl["UNPACK_PREMULTIPLY_ALPHA_WEBGL"],opts.premultiplyAlpha);const formatspec=GetFormatSpecifiers(this._pixelFormat,gl);if(!this._renderer.SupportsNPOTTextures()&&!isPOT&&this._IsTiled()){if(data===null)throw new Error("cannot pass null data when creating a NPOT tiled texture without NPOT support"); +if(data instanceof ArrayBuffer)data=new ImageData(new Uint8ClampedArray(data),this._width,this._height);if(data instanceof ImageData){const tmpCanvas=C3.CreateCanvas(this._width,this._height);const tmpCtx=tmpCanvas.getContext("2d");tmpCtx.putImageData(data,0,0);data=tmpCanvas}const canvas=C3.CreateCanvas(C3.nextHighestPowerOfTwo(this._width),C3.nextHighestPowerOfTwo(this._height));const ctx=canvas.getContext("2d");ctx.imageSmoothingEnabled=this._sampling!=="nearest";ctx.drawImage(data,0,0,this._width, +this._height,0,0,canvas.width,canvas.height);gl.texImage2D(gl.TEXTURE_2D,0,formatspec.internalformat,formatspec.format,formatspec.type,canvas)}else if(webglVersion>=2){let levels;if(this._isMipMapped)levels=Math.floor(Math.log2(Math.max(this._width,this._height))+1);else levels=1;gl.texStorage2D(gl.TEXTURE_2D,levels,formatspec.sizedinternalformat,this._width,this._height);if(data instanceof ArrayBuffer)gl.texSubImage2D(gl.TEXTURE_2D,0,0,0,this._width,this._height,formatspec.format,formatspec.type, +new Uint8Array(data));else if(data!==null)gl.texSubImage2D(gl.TEXTURE_2D,0,0,0,formatspec.format,formatspec.type,data)}else if(data instanceof ArrayBuffer)gl.texImage2D(gl.TEXTURE_2D,0,formatspec.internalformat,this._width,this._height,0,formatspec.format,formatspec.type,new Uint8Array(data));else if(data===null)gl.texImage2D(gl.TEXTURE_2D,0,formatspec.internalformat,this._width,this._height,0,formatspec.format,formatspec.type,null);else gl.texImage2D(gl.TEXTURE_2D,0,formatspec.internalformat,formatspec.format, +formatspec.type,data);if(data!==null)this._SetTextureParameters(gl);gl.bindTexture(gl.TEXTURE_2D,null);this._renderer._ResetLastTexture();this._refCount=1;allTextures.add(this)}_CreateDynamic(width,height,opts){opts=Object.assign({},CREATEFROM_DEFAULT_OPTIONS,opts);if(this._texture)throw new Error("already created texture");this._wrapX=opts.wrapX;this._wrapY=opts.wrapY;this._sampling=opts.sampling;this._pixelFormat=opts.pixelFormat;this._isMipMapped=!!opts.mipMap&&this._renderer.AreMipmapsEnabled(); +this._mipMapQuality=opts.mipMapQuality;if(!VALID_WRAP_MODES.has(this._wrapX)||!VALID_WRAP_MODES.has(this._wrapY))throw new Error("invalid wrap mode");if(!VALID_SAMPLINGS.has(this._sampling))throw new Error("invalid sampling");if(!VALID_PIXEL_FORMATS.has(this._pixelFormat))throw new Error("invalid pixel format");if(!VALID_MIPMAP_QUALITIES.has(this._mipMapQuality))throw new Error("invalid mipmap quality");this._isStatic=false;this._width=Math.floor(width);this._height=Math.floor(height);const isPOT= +C3.isPOT(this._width)&&C3.isPOT(this._height);const maxTextureSize=this._renderer.GetMaxTextureSize();if(this._width<=0||this._height<=0)throw new Error("invalid texture size");if(this._width>maxTextureSize||this._height>maxTextureSize)throw new Error("texture exceeds maximum texture size");if(!this._renderer.SupportsNPOTTextures()&&this._IsTiled()&&!isPOT)throw new Error("non-power-of-two tiled textures not supported");const gl=this._renderer.GetContext();const webglVersion=this._renderer.GetWebGLVersionNumber(); +this._texture=gl.createTexture();gl.bindTexture(gl.TEXTURE_2D,this._texture);gl.pixelStorei(gl["UNPACK_PREMULTIPLY_ALPHA_WEBGL"],opts.premultiplyAlpha);const formatspec=GetFormatSpecifiers(this._pixelFormat,gl);const internalformat=webglVersion>=2?formatspec.sizedinternalformat:formatspec.internalformat;gl.texImage2D(gl.TEXTURE_2D,0,internalformat,this._width,this._height,0,formatspec.format,formatspec.type,null);this._SetTextureParameters(gl);gl.bindTexture(gl.TEXTURE_2D,null);this._renderer._ResetLastTexture(); +this._refCount=1;allTextures.add(this)}_GetMipMapHint(gl){if(this._mipMapQuality==="default")return this._isStatic?gl.NICEST:gl.FASTEST;else if(this._mipMapQuality==="low")return gl.FASTEST;else if(this._mipMapQuality==="high")return gl.NICEST;else throw new Error("invalid mipmap quality");}_IsTiled(){return this._wrapX!=="clamp-to-edge"||this._wrapY!=="clamp-to-edge"}_GetTextureWrapMode(gl,wrapMode){if(wrapMode==="clamp-to-edge")return gl.CLAMP_TO_EDGE;else if(wrapMode==="repeat")return gl.REPEAT; +else if(wrapMode==="mirror-repeat")return gl.MIRRORED_REPEAT;else throw new Error("invalid wrap mode");}_SetTextureParameters(gl){const isPOT=C3.isPOT(this._width)&&C3.isPOT(this._height);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,this._GetTextureWrapMode(gl,this._wrapX));gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,this._GetTextureWrapMode(gl,this._wrapY));if(this._sampling==="nearest"){gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER, +gl.NEAREST);this._isMipMapped=false}else{gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);if((isPOT||this._renderer.SupportsNPOTTextures())&&this._isMipMapped){gl.hint(gl.GENERATE_MIPMAP_HINT,this._GetMipMapHint(gl));gl.generateMipmap(gl.TEXTURE_2D);const useTrilinear=this._sampling==="trilinear"&&!this._renderer.HasMajorPerformanceCaveat();gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,useTrilinear?gl.LINEAR_MIPMAP_LINEAR:gl.LINEAR_MIPMAP_NEAREST)}else{gl.texParameteri(gl.TEXTURE_2D, +gl.TEXTURE_MIN_FILTER,gl.LINEAR);this._isMipMapped=false}}}_Update(data,opts){if((typeof HTMLImageElement==="undefined"||!(data instanceof HTMLImageElement))&&(typeof HTMLVideoElement==="undefined"||!(data instanceof HTMLVideoElement))&&(typeof HTMLCanvasElement==="undefined"||!(data instanceof HTMLCanvasElement))&&(typeof ImageBitmap==="undefined"||!(data instanceof ImageBitmap))&&(typeof OffscreenCanvas==="undefined"||!(data instanceof OffscreenCanvas))&&!(data instanceof ImageData))throw new Error("invalid texture source"); +if(!this._texture||this._refCount<=0)throw new Error("texture not created");if(this._isStatic)throw new Error("cannot update static texture");opts=Object.assign({},UPDATE_DEFAULT_OPTIONS,opts);const dataWidth=data.width||data.videoWidth;const dataHeight=data.height||data.videoHeight;const webglVersion=this._renderer.GetWebGLVersionNumber();const gl=this._renderer.GetContext();gl.bindTexture(gl.TEXTURE_2D,this._texture);gl.pixelStorei(gl["UNPACK_PREMULTIPLY_ALPHA_WEBGL"],opts.premultiplyAlpha);gl.pixelStorei(gl["UNPACK_FLIP_Y_WEBGL"], +!!opts.flipY);const formatspec=GetFormatSpecifiers(this._pixelFormat,gl);const internalformat=webglVersion>=2?formatspec.sizedinternalformat:formatspec.internalformat;try{if(this._width===dataWidth&&this._height===dataHeight){const isPOT=C3.isPOT(this._width)&&C3.isPOT(this._height);gl.texSubImage2D(gl.TEXTURE_2D,0,0,0,formatspec.format,formatspec.type,data);if((isPOT||this._renderer.SupportsNPOTTextures())&&this._isMipMapped){gl.hint(gl.GENERATE_MIPMAP_HINT,this._GetMipMapHint(gl));gl.generateMipmap(gl.TEXTURE_2D)}}else{this._width= +dataWidth;this._height=dataHeight;const isPOT=C3.isPOT(this._width)&&C3.isPOT(this._height);if(!this._renderer.SupportsNPOTTextures()&&this._IsTiled()&&!isPOT)throw new Error("non-power-of-two tiled textures not supported");gl.texImage2D(gl.TEXTURE_2D,0,internalformat,formatspec.format,formatspec.type,data);if((isPOT||this._renderer.SupportsNPOTTextures())&&this._isMipMapped){gl.hint(gl.GENERATE_MIPMAP_HINT,this._GetMipMapHint(gl));gl.generateMipmap(gl.TEXTURE_2D)}}}catch(e){console.error("Error updating WebGL texture: ", +e)}gl.bindTexture(gl.TEXTURE_2D,null);this._renderer._ResetLastTexture()}_Delete(){if(this._refCount>0)throw new Error("texture still has references");if(!this._texture)throw new Error("already deleted texture");allTextures.delete(this);const gl=this._renderer.GetContext();gl.deleteTexture(this._texture);this._texture=null}IsValid(){return!!this._texture}_GetTexture(){return this._texture}GetRenderer(){return this._renderer}AddReference(){this._refCount++}SubtractReference(){if(this._refCount<=0)throw new Error("no more references"); +this._refCount--}GetReferenceCount(){return this._refCount}GetWidth(){return this._width}GetHeight(){return this._height}IsStatic(){return this._isStatic}GetEstimatedMemoryUsage(){let size=this._width*this._height;switch(this._pixelFormat){case "rgba8":size*=4;break;case "rgb8":size*=3;break;case "rgba4":case "rgb5_a1":case "rgb565":size*=2;break}if(this._isMipMapped)size+=Math.floor(size/3);return size}static OnContextLost(){allTextures.clear()}static allTextures(){return allTextures.values()}}}; + + +// ../lib/gfx/webgl/renderTarget.js +'use strict';{const C3=self.C3;const assert=self.assert;const VALID_SAMPLINGS=new Set(["nearest","bilinear","trilinear"]);const DEFAULT_RENDERTARGET_OPTIONS={sampling:"trilinear",alpha:true,readback:true,isDefaultSize:true,multisampling:0};const allRenderTargets=new Set;C3.Gfx.WebGLRenderTarget=class WebGLRenderTarget{constructor(renderer){this._renderer=renderer;this._frameBuffer=null;this._texture=null;this._renderBuffer=null;this._width=0;this._height=0;this._isDefaultSize=true;this._sampling= +"trilinear";this._alpha=true;this._readback=true;this._multisampling=0}_Create(width,height,opts){opts=Object.assign({},DEFAULT_RENDERTARGET_OPTIONS,opts);const webGLVersion=this._renderer.GetWebGLVersionNumber();if(this._texture||this._renderBuffer)throw new Error("already created render target");this._sampling=opts.sampling;this._alpha=!!opts.alpha;this._readback=!!opts.readback;this._isDefaultSize=!!opts.isDefaultSize;this._multisampling=opts.multisampling;if(!VALID_SAMPLINGS.has(this._sampling))throw new Error("invalid sampling"); +if(this._multisampling>0&&(webGLVersion<2||this._readback))throw new Error("invalid use of multisampling");if(webGLVersion<2)this._readback=true;this._width=width;this._height=height;if(this._width<=0||this._height<=0)throw new Error("invalid render target size");const gl=this._renderer.GetContext();this._frameBuffer=gl.createFramebuffer();gl.bindFramebuffer(gl.FRAMEBUFFER,this._frameBuffer);if(this._readback){this._texture=this._renderer.CreateDynamicTexture(this._width,this._height,{sampling:this._sampling, +pixelFormat:this._alpha?"rgba8":"rgb8",mipMap:false});const tex=this._texture._GetTexture();gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,tex,0)}else{this._renderBuffer=gl.createRenderbuffer();gl.bindRenderbuffer(gl.RENDERBUFFER,this._renderBuffer);const internalFormat=this._alpha?gl.RGBA8:gl.RGB8;if(this._multisampling>0){const formatSamples=gl.getInternalformatParameter(gl.RENDERBUFFER,internalFormat,gl.SAMPLES);if(formatSamples&&formatSamples[0]){const maxSamples=formatSamples[0]; +if(this._multisampling>maxSamples)this._multisampling=maxSamples}else this._multisampling=0}if(this._multisampling===0)gl.renderbufferStorage(gl.RENDERBUFFER,internalFormat,this._width,this._height);else gl.renderbufferStorageMultisample(gl.RENDERBUFFER,this._multisampling,internalFormat,this._width,this._height);gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.RENDERBUFFER,this._renderBuffer);gl.bindRenderbuffer(gl.RENDERBUFFER,null)}gl.bindFramebuffer(gl.FRAMEBUFFER,null);allRenderTargets.add(this)}_Resize(width, +height){if(this._width===width&&this._height===height)return;this._width=width;this._height=height;const gl=this._renderer.GetContext();gl.bindFramebuffer(gl.FRAMEBUFFER,this._frameBuffer);if(this._texture)this._texture._Update(new ImageData(this._width,this._height));else{gl.bindRenderbuffer(gl.RENDERBUFFER,this._renderBuffer);gl.renderbufferStorage(gl.RENDERBUFFER,this._alpha?gl.RGBA8:gl.RGB8,this._width,this._height);gl.bindRenderbuffer(gl.RENDERBUFFER,null)}gl.bindFramebuffer(gl.FRAMEBUFFER,null)}_Delete(){if(!this._texture&& +!this._renderBuffer)throw new Error("already deleted render target");allRenderTargets.delete(this);const gl=this._renderer.GetContext();gl.bindFramebuffer(gl.FRAMEBUFFER,this._frameBuffer);if(this._texture){gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,null,0);this._renderer.DeleteTexture(this._texture);this._texture=null}else if(this._renderBuffer){gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.RENDERBUFFER,null);gl.deleteRenderbuffer(this._renderBuffer); +this._renderBuffer=null}gl.bindFramebuffer(gl.FRAMEBUFFER,null);if(this._renderer.GetWebGLVersionNumber()>=2){gl.bindFramebuffer(gl.READ_FRAMEBUFFER,null);gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER,null)}gl.deleteFramebuffer(this._frameBuffer);this._renderer.GetBatchState().currentFramebuffer=null;this._frameBuffer=null}_GetFramebuffer(){return this._frameBuffer}GetWebGLRenderer(){return this._renderer}GetTexture(){return this._texture}IsLinearSampling(){return this._sampling!=="nearest"}HasAlpha(){return this._alpha}IsReadback(){return this._readback}GetWidth(){return this._width}GetHeight(){return this._height}IsDefaultSize(){return this._isDefaultSize}GetMultisampling(){return this._multisampling}GetOptions(){const ret= +{sampling:this._sampling,alpha:this._alpha,readback:this._readback};if(!this._isDefaultSize){ret.width=this._width;ret.height=this._height}return ret}IsCompatibleWithOptions(opts){opts=Object.assign({},DEFAULT_RENDERTARGET_OPTIONS,opts);if(opts.sampling!=="nearest"!==this.IsLinearSampling())return false;if(!!opts.alpha!==this.HasAlpha())return false;if(this._renderer.GetWebGLVersionNumber()>=2)if(!!opts.readback!==this.IsReadback())return false;if(typeof opts.width==="number"||typeof opts.height=== +"number")return!this.IsDefaultSize()&&this.GetWidth()===opts.width&&this.GetHeight()===opts.height;else return this.IsDefaultSize()}_GetWebGLTexture(){if(!this._texture)return null;return this._texture._GetTexture()}GetEstimatedMemoryUsage(){if(this._texture)return this._texture.GetEstimatedMemoryUsage();return this._width*this._height*(this._alpha?4:3)}static async DebugReadPixelsToBlob(renderer,renderTarget){const imageData=await renderer.ReadBackRenderTargetToImageData(renderTarget,true);return await C3.ImageDataToBlob(imageData)}static OnContextLost(){allRenderTargets.clear()}static allRenderTargets(){return allRenderTargets.values()}static ResizeAll(width, +height){for(const rt of allRenderTargets)if(rt.IsDefaultSize())rt._Resize(width,height)}}}; + + +// ../lib/gfx/webgl/shaderProgram.js +'use strict';{const C3=self.C3;const glMatrix=self.glMatrix;const vec3=glMatrix.vec3;const mat4=glMatrix.mat4;const RESERVED_UNIFORM_NAMES=new Set(["aPos","aTex","aPoints","matP","matMV","samplerFront","samplerBack","destStart","destEnd","srcStart","srcEnd","srcOriginStart","srcOriginEnd","pixelSize","seconds","layerScale","layerAngle","layoutStart","layoutEnd","color","color2_","pointTexStart","pointTexEnd","zElevation","tileSize","tileSpacing","outlineThickness"]);C3.Gfx.WebGLShaderProgram=class WebGLShaderProgram{static async Compile(renderer, +fragSrc,vsSource,name){const gl=renderer.GetContext();const fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,fragSrc);gl.compileShader(fragmentShader);const vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,vsSource);gl.compileShader(vertexShader);const shaderProgram=gl.createProgram();gl.attachShader(shaderProgram,fragmentShader);gl.attachShader(shaderProgram,vertexShader);gl.bindAttribLocation(shaderProgram,0,"aPos");gl.bindAttribLocation(shaderProgram, +1,"aTex");gl.bindAttribLocation(shaderProgram,2,"aPoints");gl.linkProgram(shaderProgram);const parallelShaderCompileExt=renderer._GetParallelShaderCompileExtension();if(parallelShaderCompileExt)await renderer._WaitForObjectReady(()=>gl.getProgramParameter(shaderProgram,parallelShaderCompileExt["COMPLETION_STATUS_KHR"]));else await C3.Wait(5);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){const log=gl.getShaderInfoLog(fragmentShader);gl.deleteShader(fragmentShader);gl.deleteShader(vertexShader); +gl.deleteProgram(shaderProgram);throw new Error("Error compiling fragment shader: "+log);}if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){const log=gl.getShaderInfoLog(vertexShader);gl.deleteShader(fragmentShader);gl.deleteShader(vertexShader);gl.deleteProgram(shaderProgram);throw new Error("Error compiling vertex shader: "+log);}if(!gl.getProgramParameter(shaderProgram,gl.LINK_STATUS)){const log=gl.getProgramInfoLog(shaderProgram);gl.deleteShader(fragmentShader);gl.deleteShader(vertexShader); +gl.deleteProgram(shaderProgram);throw new Error("Error linking shader program: "+log);}const infoLog=C3.FilterUnprintableChars(gl.getProgramInfoLog(shaderProgram)||"").trim();if(infoLog&&!C3.IsStringAllWhitespace(infoLog))console.info(`[WebGL] Shader program '${name}' compilation log: `,infoLog);gl.deleteShader(fragmentShader);gl.deleteShader(vertexShader);return shaderProgram}static async Create(renderer,shaderInfo,vsSource,name){const shaderProgram=await C3.Gfx.WebGLShaderProgram.Compile(renderer, +shaderInfo.src,vsSource,name);return new C3.Gfx.WebGLShaderProgram(renderer,shaderProgram,shaderInfo,name)}constructor(renderer,shaderProgram,shaderInfo,name){const gl=renderer.GetContext();const batchState=renderer.GetBatchState();renderer.EndBatch();gl.useProgram(shaderProgram);this._gl=gl;this._renderer=renderer;this._name=name;this._shaderProgram=shaderProgram;this._isDeviceTransform=name==="";const locAPos=gl.getAttribLocation(shaderProgram,"aPos");const locATex=gl.getAttribLocation(shaderProgram, +"aTex");const locAPoints=gl.getAttribLocation(shaderProgram,"aPoints");if(locAPos!==-1){gl.bindBuffer(gl.ARRAY_BUFFER,renderer._vertexBuffer);gl.vertexAttribPointer(locAPos,renderer.GetNumVertexComponents(),gl.FLOAT,false,0,0);gl.enableVertexAttribArray(locAPos)}if(locATex!==-1){gl.bindBuffer(gl.ARRAY_BUFFER,renderer._texcoordBuffer);gl.vertexAttribPointer(locATex,2,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(locATex)}if(locAPoints!==-1){gl.bindBuffer(gl.ARRAY_BUFFER,renderer._pointBuffer);gl.vertexAttribPointer(locAPoints, +4,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(locAPoints)}gl.bindBuffer(gl.ARRAY_BUFFER,null);this._uMatP=new C3.Gfx.WebGLShaderUniform(this,"matP","mat4");this._uMatMV=new C3.Gfx.WebGLShaderUniform(this,"matMV","mat4");this._uColor=new C3.Gfx.WebGLShaderUniform(this,"color","vec4");this._uSamplerFront=new C3.Gfx.WebGLShaderUniform(this,"samplerFront","sampler");this._uPointTexStart=new C3.Gfx.WebGLShaderUniform(this,"pointTexStart","vec2");this._uPointTexEnd=new C3.Gfx.WebGLShaderUniform(this, +"pointTexEnd","vec2");this._uZElevation=new C3.Gfx.WebGLShaderUniform(this,"zElevation","float");this._uTileSize=new C3.Gfx.WebGLShaderUniform(this,"tileSize","vec2");this._uTileSpacing=new C3.Gfx.WebGLShaderUniform(this,"tileSpacing","vec2");this._uColor2=new C3.Gfx.WebGLShaderUniform(this,"color2_","vec4");this._uOutlineThickness=new C3.Gfx.WebGLShaderUniform(this,"outlineThickness","float");this._uSamplerBack=new C3.Gfx.WebGLShaderUniform(this,"samplerBack","sampler");this._uDestStart=new C3.Gfx.WebGLShaderUniform(this, +"destStart","vec2");this._uDestEnd=new C3.Gfx.WebGLShaderUniform(this,"destEnd","vec2");this._uSrcStart=new C3.Gfx.WebGLShaderUniform(this,"srcStart","vec2");this._uSrcEnd=new C3.Gfx.WebGLShaderUniform(this,"srcEnd","vec2");this._uSrcOriginStart=new C3.Gfx.WebGLShaderUniform(this,"srcOriginStart","vec2");this._uSrcOriginEnd=new C3.Gfx.WebGLShaderUniform(this,"srcOriginEnd","vec2");this._uPixelSize=new C3.Gfx.WebGLShaderUniform(this,"pixelSize","vec2");this._uSeconds=new C3.Gfx.WebGLShaderUniform(this, +"seconds","float");this._uLayerScale=new C3.Gfx.WebGLShaderUniform(this,"layerScale","float");this._uLayerAngle=new C3.Gfx.WebGLShaderUniform(this,"layerAngle","float");this._uLayoutStart=new C3.Gfx.WebGLShaderUniform(this,"layoutStart","vec2");this._uLayoutEnd=new C3.Gfx.WebGLShaderUniform(this,"layoutEnd","vec2");this._hasAnyOptionalUniforms=!!(this._uPixelSize.IsUsed()||this._uSeconds.IsUsed()||this._uSamplerBack.IsUsed()||this._uDestStart.IsUsed()||this._uDestEnd.IsUsed()||this._uSrcStart.IsUsed()|| +this._uSrcEnd.IsUsed()||this._uSrcOriginStart.IsUsed()||this._uSrcOriginEnd.IsUsed()||this._uLayerScale.IsUsed()||this._uLayerAngle.IsUsed()||this._uLayoutStart.IsUsed()||this._uLayoutEnd.IsUsed());this._extendBoxHorizontal=shaderInfo.extendBoxHorizontal||0;this._extendBoxVertical=shaderInfo.extendBoxVertical||0;this._crossSampling=!!shaderInfo.crossSampling;this._mustPreDraw=!!shaderInfo.mustPreDraw;this._preservesOpaqueness=!!shaderInfo.preservesOpaqueness;this._animated=!!shaderInfo.animated;const customParameterDefs= +shaderInfo.parameters||[];this._uCustomParameters=[];this._usesDest=this._uDestStart.IsUsed()||this._uDestEnd.IsUsed();this._usesAnySrcRectOrPixelSize=this._uPixelSize.IsUsed()||this._uSrcStart.IsUsed()||this._uSrcEnd.IsUsed()||this._uSrcOriginStart.IsUsed()||this._uSrcOriginEnd.IsUsed();this._needsPostDrawOrExtendBox=this._crossSampling||this._usesDest||this._extendBoxHorizontal!==0||this._extendBoxVertical!==0;this._hasCurrentMatP=false;this._hasCurrentMatMV=false;this._uColor.Init4f(1,1,1,1);this._uColor2.Init4f(1, +1,1,1);this._uSamplerFront.Init1i(0);this._uSamplerBack.Init1i(1);this._uPointTexStart.Init2f(0,0);this._uPointTexEnd.Init2f(1,1);this._uZElevation.Init1f(0);this._uTileSize.Init2f(0,0);this._uTileSpacing.Init2f(0,0);this._uDestStart.Init2f(0,0);this._uDestEnd.Init2f(1,1);this._uSrcStart.Init2f(0,0);this._uSrcEnd.Init2f(0,0);this._uSrcOriginStart.Init2f(0,0);this._uSrcOriginEnd.Init2f(0,0);this._uPixelSize.Init2f(0,0);this._uLayerScale.Init1f(1);this._uLayerAngle.Init1f(0);this._uSeconds.Init1f(0); +this._uLayoutStart.Init2f(0,0);this._uLayoutEnd.Init2f(0,0);this._uOutlineThickness.Init1f(1);for(const p of customParameterDefs){const uniformName=p[0];const paramType=p[2];const shaderUniform=new C3.Gfx.WebGLShaderUniform(this,uniformName,paramType);if(paramType==="color")shaderUniform.Init3f(0,0,0);else shaderUniform.Init1f(0);this._uCustomParameters.push(shaderUniform)}if(this._isDeviceTransform)this._UpdateDeviceTransformUniforms(batchState.currentMatP);else{this.UpdateMatP(batchState.currentMatP, +true);this.UpdateMatMV(batchState.currentMV,true)}const currentShader=batchState.currentShader;gl.useProgram(currentShader?currentShader._shaderProgram:null)}Release(){this._gl.deleteProgram(this._shaderProgram);this._shaderProgram=null;this._renderer._RemoveShaderProgram(this);this._gl=null;this._renderer=null}GetName(){return this._name}GetWebGLContext(){return this._gl}GetShaderProgram(){return this._shaderProgram}UsesDest(){return this._usesDest}UsesCrossSampling(){return this._crossSampling}MustPreDraw(){return this._mustPreDraw}PreservesOpaqueness(){return this._preservesOpaqueness}ExtendsBox(){return this._extendBoxHorizontal!== +0||this._extendBoxVertical!==0}GetBoxExtendHorizontal(){return this._extendBoxHorizontal}GetBoxExtendVertical(){return this._extendBoxVertical}UsesAnySrcRectOrPixelSize(){return this._usesAnySrcRectOrPixelSize}NeedsPostDrawOrExtendsBox(){return this._needsPostDrawOrExtendBox}GetParameterCount(){return this._uCustomParameters.length}GetParameterType(paramIndex){return this._uCustomParameters[paramIndex].GetType()}AreCustomParametersAlreadySetInBatch(params){for(let i=0,len=params.length;i{const fontName=e.font.GetName();for(const f of allRendererTexts)if(f.IsBBCodeEnabled()|| +C3.equalsNoCase(f.GetFontName(),fontName))f._SetTextChanged()});function fillOrStrokeText(ctx,isStroke,text,x,y,maxWidth){if(isStroke)if(C3.Platform.BrowserEngine==="Gecko")ctx.strokeText(text,x,y,maxWidth);else ctx.strokeText(text,x,y);else if(C3.Platform.BrowserEngine==="Gecko")ctx.fillText(text,x,y,maxWidth);else ctx.fillText(text,x,y)}function fillOrStrokeRect(ctx,isStroke,x,y,w,h){if(isStroke)ctx.strokeRect(x,y,w,h);else ctx.fillRect(x,y,w,h)}function ptToPx(pt){return pt*(4/3)}C3.Gfx.RendererText= +class RendererText{constructor(renderer,opts){opts=Object.assign({},DEFAULT_OPTS,opts);this._renderer=renderer;this._fontName="Arial";this._fontSize=16;this._lineHeight=0;this._isBold=false;this._isItalic=false;this._colorStr="black";this._isBBcodeEnabled=false;this.onloadfont=null;this._alreadyLoadedFonts=new Set;this._horizontalAlign="left";this._verticalAlign="top";this._text="";this._bbString=null;this._wrappedText=C3.New(C3.WordWrap);this._wrapMode="word";this._textChanged=false;this._isUpdating= +false;this._isAsync=true;this._drawMaxCharCount=-1;this._drawCharCount=0;this._cssWidth=0;this._cssHeight=0;this._width=0;this._height=0;this._zoom=1;this._changed=false;this._textCanvas=null;this._textContext=null;this._measureContext=null;this._lastCanvasWidth=-1;this._lastCanvasHeight=-1;this._lastTextCanvasFont="";this._lastMeasureCanvasFont="";this._lastTextCanvasFillStyle="";this._lastTextCanvasOpacity=1;this._lastTextCanvasLineWidth=1;this._measureTextCallback=(text,styles)=>this._MeasureText(text, +styles);this._texture=null;this._textureWidth=0;this._textureHeight=0;this._rcTex=new C3.Rect;this._scaleFactor=1;this._needToRecreateTexture=false;this._textureTimeout=new C3.IdleTimeout(()=>{this.ReleaseTexture();this._SetTextCanvasSize(8,8)},opts.timeout);this.ontextureupdate=null;this._wasReleased=false;allRendererTexts.add(this)}Release(){this.onloadfont=null;this._alreadyLoadedFonts.clear();this._bbString=null;this._textCanvas=null;this._textContext=null;this._measureContext=null;this._measureTextCallback= +null;this._textureTimeout.Release();this.ontextureupdate=null;this.ReleaseTexture();this._wrappedText.Clear();this._wrappedText=null;this._renderer=null;this._wasReleased=true;allRendererTexts.delete(this)}_SetChanged(){this._changed=true}_SetTextChanged(){this._SetChanged();this._wrappedText.Clear();this._textChanged=true}SetIsAsync(a){this._isAsync=!!a}IsAsync(){return this._isAsync}SetBBCodeEnabled(e){e=!!e;if(this._isBBcodeEnabled===e)return;this._isBBcodeEnabled=e;if(this._textContext)this._textContext.textBaseline= +this._isBBcodeEnabled?"alphabetic":"top";this._SetTextChanged()}IsBBCodeEnabled(){return this._isBBcodeEnabled}SetFontName(fontName){if(!fontName)fontName="serif";if(this._fontName===fontName)return;this._fontName=fontName;this._SetTextChanged()}GetFontName(){return this._fontName}SetFontSize(fontSize){if(fontSize<.1)fontSize=.1;if(this._fontSize===fontSize)return;this._fontSize=fontSize;this._SetTextChanged()}SetLineHeight(h){if(this._lineHeight===h)return;this._lineHeight=h;this._SetChanged()}SetBold(bold){bold= +!!bold;if(this._isBold===bold)return;this._isBold=bold;this._SetTextChanged()}SetItalic(italic){italic=!!italic;if(this._isItalic===italic)return;this._isItalic=italic;this._SetTextChanged()}SetDrawMaxCharacterCount(n){n=Math.floor(n);if(this._drawMaxCharCount===n)return;this._drawMaxCharCount=n;this._SetChanged()}GetDrawMaxCharacterCount(){return this._drawMaxCharCount}_GetStyleTag(styles,tag){for(let i=styles.length-1;i>=0;--i){const s=styles[i];if(s.tag===tag)return s}return null}_HasStyleTag(styles, +tag){return!!this._GetStyleTag(styles,tag)}_GetFontString(useCssUnits,styles){let ret="";if(this._isBold||this._HasStyleTag(styles,"b"))ret+="bold";if(this._isItalic||this._HasStyleTag(styles,"i"))ret+=" italic";const sizeStyle=this._GetStyleTag(styles,"size");const fontSize=sizeStyle?parseFloat(sizeStyle.param):this._fontSize;if(useCssUnits)ret+=" "+fontSize+"pt";else ret+=" "+fontSize*this._scaleFactor*this._zoom*self.devicePixelRatio+"pt";let fontName=this._fontName;const fontStyle=this._GetStyleTag(styles, +"font");if(fontStyle&&fontStyle.param){fontName=fontStyle.param;if(this.onloadfont&&!this._alreadyLoadedFonts.has(fontName)){this.onloadfont(fontName);this._alreadyLoadedFonts.add(fontName)}}if(fontName)ret+=' "'+fontName+'"';return ret}SetColor(c){if(c instanceof C3.Color)c=c.getCssRgb();if(this._colorStr===c)return;this._colorStr=c;this._SetChanged()}SetColorRgb(r,g,b){tempColor.setRgb(r,g,b);this.SetColor(tempColor)}SetHorizontalAlignment(h){if(!VALID_HORIZ_ALIGNMENTS.has(h))throw new Error("invalid horizontal alignment"); +if(this._horizontalAlign===h)return;this._horizontalAlign=h;this._SetChanged()}SetVerticalAlignment(v){if(!VALID_VERT_ALIGNMENTS.has(v))throw new Error("invalid vertical alignment");if(this._verticalAlign===v)return;this._verticalAlign=v;this._SetChanged()}SetWordWrapMode(m){if(!VALID_WORD_WRAP_MODES.has(m))throw new Error("invalid word wrap mode");if(this._wrapMode===m)return;this._wrapMode=m;this._SetTextChanged()}SetText(text){if(this._text===text)return;this._text=text;this._SetTextChanged()}SetSize(cssWidth, +cssHeight,zoom){if(typeof zoom==="undefined")zoom=1;if(cssWidth<=0||cssWidth<=0)return;if(this._cssWidth===cssWidth&&this._cssHeight===cssHeight&&this._zoom===zoom)return;if(this._zoom===1!==(zoom===1))this._needToRecreateTexture=true;const oldCssWidth=this._cssWidth;const oldZoom=this._zoom;this._cssWidth=cssWidth;this._cssHeight=cssHeight;this._zoom=zoom;const dpr=self.devicePixelRatio;this._width=this._cssWidth*this._zoom*dpr;this._height=this._cssHeight*this._zoom*dpr;const maxDim=Math.max(this._width, +this._height);const maxTextureSize=Math.min(this._renderer.GetMaxTextureSize(),MAX_TEXTURE_SIZE);let scale=1;if(maxDim>maxTextureSize){scale=maxTextureSize/maxDim;this._width=Math.min(this._width*scale,maxTextureSize);this._height=Math.min(this._height*scale,maxTextureSize)}this._scaleFactor=scale;if(this._textureWidth>0&&this._textureHeight>0&&this._zoom===oldZoom)this._rcTex.set(0,0,this._width/this._textureWidth,this._height/this._textureHeight);if(this._cssWidth!==oldCssWidth)this._SetTextChanged(); +else this._SetChanged()}GetWidth(){return this._width}GetHeight(){return this._height}GetTextWidth(){this._MaybeWrapText();return this._wrappedText.GetMaxLineWidth()}GetTextHeight(){this._MaybeWrapText();return this._wrappedText.GetTotalLineHeight()+this._wrappedText.GetLineCount()*(this._lineHeight+EXTRA_LINE_HEIGHT)-this._lineHeight}GetTexture(){this._textureTimeout.Reset();this._MaybeUpdate();return this._texture}_MaybeUpdate(){if(this._texture&&!this._changed&&!this._textChanged)return;if(this._isUpdating)return; +if(this._width<=0||this._height<=0)return;this._changed=false;this._isUpdating=true;if(this._isAsync)C3.Asyncify(()=>this._DoUpdate());else this._DoUpdate()}_DoUpdate(){if(this._wasReleased)return;this._SetTextCanvasSize(Math.ceil(this._width),Math.ceil(this._height));this._MaybeWrapText();this._DrawTextToCanvas();this._UpdateTexture();this._textureTimeout.Reset();this._isUpdating=false}_SetTextCanvasSize(w,h){if(!this._textCanvas)this._textCanvas=C3.CreateCanvas(16,16);let wasReset=false;if(this._lastCanvasWidth!== +w||this._lastCanvasHeight!==h){this._lastCanvasWidth=w;this._lastCanvasHeight=h;this._textCanvas.width=w;this._textCanvas.height=h;wasReset=true}if(!this._textContext){this._textContext=this._textCanvas.getContext("2d");wasReset=true}if(wasReset){this._textContext.textBaseline=this._isBBcodeEnabled?"alphabetic":"top";this._textContext.font=this._lastTextCanvasFont;this._textContext.fillStyle=this._lastTextCanvasFillStyle;this._textContext.strokeStyle=this._lastTextCanvasFillStyle;this._textContext.globalAlpha= +this._lastTextCanvasOpacity;this._textContext.lineWidth=this._lastTextCanvasLineWidth}else this._textContext.clearRect(0,0,w,h)}_MaybeCreateMeasureContext(){if(this._measureContext)return;this._measureContext=C3.CreateCanvas(16,16).getContext("2d")}_SetMeasureFontString(fontString){if(this._lastMeasureCanvasFont===fontString)return;this._lastMeasureCanvasFont=fontString;this._measureContext.font=fontString}_MaybeWrapText(){if(!this._textChanged)return;this._MaybeCreateMeasureContext();if(this._isBBcodeEnabled&& +(!this._bbString||this._bbString.toString()!==this._text))this._bbString=new C3.BBString(this._text,{noEscape:true});this._wrappedText.WordWrap(this._isBBcodeEnabled?this._bbString.toFragmentList():this._text,this._measureTextCallback,this._cssWidth,this._wrapMode,0);this._textChanged=false}_MeasureText(text,styles){this._SetMeasureFontString(this._GetFontString(true,styles));const sizeStyle=this._GetStyleTag(styles,"size");const fontSize=sizeStyle?parseFloat(sizeStyle.param):this._fontSize;return{width:this._measureContext.measureText(text).width, +height:ptToPx(fontSize)}}_SetDrawFontString(fontString){if(this._lastTextCanvasFont===fontString)return;this._lastTextCanvasFont=fontString;this._textContext.font=fontString}_SetDrawCanvasColor(styleStr){if(this._lastTextCanvasFillStyle===styleStr)return;this._lastTextCanvasFillStyle=styleStr;this._textContext.fillStyle=styleStr;this._textContext.strokeStyle=styleStr}_SetDrawCanvasOpacity(o){if(this._lastTextCanvasOpacity===o)return;this._lastTextCanvasOpacity=o;this._textContext.globalAlpha=o}_SetDrawCanvasLineWith(w){if(this._lastTextCanvasLineWidth=== +w)return;this._lastTextCanvasLineWidth=w;this._textContext.lineWidth=w}_DrawTextToCanvas(){this._drawCharCount=0;const scale=this._scaleFactor*this._zoom*self.devicePixelRatio;const lineSpaceHeight=(EXTRA_LINE_HEIGHT+this._lineHeight)*scale;let penY=0;const lines=this._wrappedText.GetLines();const linesTotalHeight=lines.reduce((a,v)=>a+v.height*scale+lineSpaceHeight,0)-this._lineHeight*scale;if(this._verticalAlign==="center")penY=Math.max(this._height/2-linesTotalHeight/2,0);else if(this._verticalAlign=== +"bottom")penY=this._height-linesTotalHeight-2;for(let i=0,len=lines.length;i0&&penY>this._height-EXTRA_LINE_HEIGHT*scale)break}else if(i>0&&penY>=this._height-curLineTextHeight)break;if(startPenY>=0)this._DrawTextLine(line,penY,scale);if(!this._isBBcodeEnabled)penY+=curLineTextHeight;penY+=lineSpaceHeight}}_DrawTextLine(line,penY,scale){let penX=0;if(this._horizontalAlign=== +"center")penX=(this._width-line.width*scale)/2;else if(this._horizontalAlign==="right")penX=this._width-line.width*scale;for(const frag of line.fragments){this._DrawTextFragment(frag,penX,penY,scale,line.height);penX+=frag.width*scale}}_DrawTextFragment(frag,penX,penY,scale,lineHeight){const textContext=this._textContext;const lineFontScale=lineHeight/16;let fragWidth=frag.width*scale;const fragHeight=frag.height*scale;const fragFontScale=frag.height/16;const lineSpaceHeight=(EXTRA_LINE_HEIGHT+this._lineHeight)* +scale;const styles=frag.styles;let text=frag.text;if(this._drawMaxCharCount!==-1){if(this._drawCharCount>=this._drawMaxCharCount)return;if(this._drawCharCount+text.length>this._drawMaxCharCount){text=text.substr(0,this._drawMaxCharCount-this._drawCharCount);fragWidth=this._MeasureText(text,styles).width*scale}this._drawCharCount+=text.length}const backgroundStyle=this._GetStyleTag(styles,"background");const hasUnderline=this._HasStyleTag(styles,"u");const hasStrikethrough=this._HasStyleTag(styles, +"s");if(C3.IsStringAllWhitespace(text)&&!backgroundStyle&&!hasUnderline&&!hasStrikethrough||this._HasStyleTag(styles,"hide"))return;const offsetXStyle=this._GetStyleTag(styles,"offsetx");penX+=offsetXStyle?parseFloat(offsetXStyle.param)*scale:0;const offsetYStyle=this._GetStyleTag(styles,"offsety");penY+=offsetYStyle?parseFloat(offsetYStyle.param)*scale:0;if(backgroundStyle){this._SetDrawCanvasColor(backgroundStyle.param);textContext.fillRect(penX,penY-fragHeight,fragWidth,fragHeight+lineSpaceHeight)}const colorStyle= +this._GetStyleTag(styles,"color");this._SetDrawCanvasColor(colorStyle?colorStyle.param:this._colorStr);const opacityStyle=this._GetStyleTag(styles,"opacity");this._SetDrawCanvasOpacity(opacityStyle?parseFloat(opacityStyle.param)/100:1);const isStroke=this._HasStyleTag(styles,"stroke");if(isStroke)this._SetDrawCanvasLineWith(fragFontScale*this._scaleFactor*this._zoom);if(hasUnderline)fillOrStrokeRect(textContext,isStroke,penX,penY+scale*lineFontScale,fragWidth,scale*lineFontScale);if(hasStrikethrough)fillOrStrokeRect(textContext, +isStroke,penX,penY-fragHeight/4,fragWidth,scale*fragFontScale);this._SetDrawFontString(this._GetFontString(false,styles));fillOrStrokeText(textContext,isStroke,text,penX,penY,fragWidth);if(!isStroke){this._SetDrawCanvasLineWith(fragFontScale*this._scaleFactor*this._zoom);const outlineStyle=this._GetStyleTag(styles,"outline");if(outlineStyle){this._SetDrawCanvasColor(outlineStyle.param);fillOrStrokeText(textContext,true,text,penX,penY,fragWidth)}}}_UpdateTexture(){if(this._renderer.IsContextLost())return; +this._textureWidth=Math.ceil(this._width);this._textureHeight=Math.ceil(this._height);this._rcTex.set(0,0,this._width/this._textureWidth,this._height/this._textureHeight);if(this._needToRecreateTexture){this.ReleaseTexture();this._needToRecreateTexture=false}if(!this._texture)this._texture=this._renderer.CreateDynamicTexture(this._textureWidth,this._textureHeight,{mipMap:this._zoom===1,mipMapQuality:"high"});this._renderer.UpdateTexture(this._textCanvas,this._texture);if(this.ontextureupdate)this.ontextureupdate()}GetTexRect(){return this._rcTex}ReleaseTexture(){if(this._texture){if(!this._renderer.IsContextLost())this._renderer.DeleteTexture(this._texture); +this._texture=null}}static OnContextLost(){for(const rendererText of allRendererTexts)rendererText.ReleaseTexture()}static GetAll(){return allRendererTexts.values()}}}; + + +// ../lib/gfx/webgl/query.js +'use strict';{const C3=self.C3;class WebGLRealTimeElapsedQuery{constructor(renderer){this._gl=renderer.GetContext();this._version=renderer.GetWebGLVersionNumber();this._timerExt=renderer._GetDisjointTimerQueryExtension();this._query=null;this._isActive=false;this._hasResult=false;this._result=0;if(this._version===1)this._query=this._timerExt["createQueryEXT"]();else this._query=this._gl["createQuery"]()}Release(){this._DeleteQueryObject();this._gl=null;this._timerExt=null;this._hasResult=false}_DeleteQueryObject(){if(!this._query)return; +if(this._version===1)this._timerExt["deleteQueryEXT"](this._query);else this._gl["deleteQuery"](this._query);this._query=null}BeginTimeElapsed(){if(this._isActive)throw new Error("query already active");if(this._version===1)this._timerExt["beginQueryEXT"](this._timerExt["TIME_ELAPSED_EXT"],this._query);else this._gl["beginQuery"](this._timerExt["TIME_ELAPSED_EXT"],this._query);this._isActive=true}EndTimeElapsed(){if(!this._isActive)throw new Error("query not active");if(this._version===1)this._timerExt["endQueryEXT"](this._timerExt["TIME_ELAPSED_EXT"]); +else this._gl["endQuery"](this._timerExt["TIME_ELAPSED_EXT"]);this._isActive=false}CheckForResult(){if(!this._query||this._hasResult||this._isActive)return;let available=false;if(this._version===1)available=this._timerExt["getQueryObjectEXT"](this._query,this._timerExt["QUERY_RESULT_AVAILABLE_EXT"]);else available=this._gl["getQueryParameter"](this._query,this._gl["QUERY_RESULT_AVAILABLE"]);const disjoint=this._gl.getParameter(this._timerExt["GPU_DISJOINT_EXT"]);if(available&&!disjoint){if(this._version=== +1)this._result=this._timerExt["getQueryObjectEXT"](this._query,this._timerExt["QUERY_RESULT_EXT"]);else this._result=this._gl["getQueryParameter"](this._query,this._gl["QUERY_RESULT"]);this._result/=1E9;this._hasResult=true}if(available||disjoint)this._DeleteQueryObject()}HasResult(){return this._hasResult}GetResult(){if(!this._hasResult)throw new Error("no result available");return this._result}}C3.Gfx.WebGLTimeElapsedQuery=class WebGLTimeElapsedQuery{constructor(renderer){this._renderer=renderer; +this._frameNumber=renderer.GetFrameNumber();this._isActive=false;this._parentQuery=null;this._isNested=false;this._realQuery=null;this._queries=[]}Release(){for(const q of this._queries)if(q instanceof WebGLRealTimeElapsedQuery)q.Release();C3.clearArray(this._queries);this._parentQuery=null;this._realQuery=null;this._renderer=null}BeginTimeElapsed(){if(this._isActive)throw new Error("query already active");const stack=this._renderer._GetTimeQueryStack();if(stack.length>0){this._isNested=true;this._parentQuery= +stack[stack.length-1];this._parentQuery._EndReal();this._parentQuery._queries.push(this)}else{this._isNested=false;this._parentQuery=null}this._isActive=true;stack.push(this);this._StartReal()}EndTimeElapsed(){if(!this._isActive)throw new Error("query not active");const top=this._renderer._GetTimeQueryStack().pop();if(top!==this)throw new Error("can only end most nested query");this._isActive=false;this._EndReal();if(this._parentQuery){this._parentQuery._StartReal();this._parentQuery=null}}_StartReal(){this._realQuery= +C3.New(WebGLRealTimeElapsedQuery,this._renderer);this._queries.push(this._realQuery);this._realQuery.BeginTimeElapsed()}_EndReal(){this._realQuery.EndTimeElapsed();this._realQuery=null}CheckForResult(){for(const q of this._queries)q.CheckForResult()}IsNested(){return this._isNested}HasResult(){return this._queries.every(q=>q.HasResult())}GetResult(){return this._queries.reduce((a,v)=>a+v.GetResult(),0)}GetFrameNumber(){return this._frameNumber}}}; + + +// ../lib/gfx/webgl/queryResultBuffer.js +'use strict';{const C3=self.C3;C3.Gfx.WebGLQueryResultBuffer=class WebGLQueryResultBuffer{constructor(renderer,maxQueries=1E3){this._renderer=renderer;this._maxQueries=maxQueries;this._buffer=[];this._renderer._AddQueryResultBuffer(this)}Release(){this.Clear();this._renderer._RemoveQueryResultBuffer(this);this._renderer=null}Clear(){for(const q of this._buffer)q.Release();C3.clearArray(this._buffer)}AddTimeElapsedQuery(){const ret=new C3.Gfx.WebGLTimeElapsedQuery(this._renderer);this._buffer.push(ret); +if(this._buffer.length>this._maxQueries){const oldest=this._buffer.shift();oldest.Release()}return ret}CheckForResults(toFrameNumber){for(const q of this._buffer){if(q.GetFrameNumber()>=toFrameNumber)return;if(q.IsNested())return;q.CheckForResult()}}GetFrameRangeResultSum(startFrame,endFrame){if(endFrame<=startFrame)return NaN;let sum=0;for(const q of this._buffer){if(q.GetFrameNumber()>=endFrame)break;if(q.GetFrameNumber()0)this._buffer.splice(0,i);return}}}}}; + + +// ../lib/gfx/webgl/webglRenderer.js +'use strict';{const C3=self.C3;const assert=self.assert;const glMatrix=self.glMatrix;const vec3=glMatrix.vec3;const vec4=glMatrix.vec4;const mat4=glMatrix.mat4;const DEFAULT_WEBGLRENDERER_OPTS={powerPreference:"default",enableGpuProfiling:true,alpha:false,lowLatency:false,maxWebGLVersion:2};const VALID_POWER_PREFERENCES=new Set(["default","low-power","high-performance"]);const MAX_VERTICES=8E3;const MAX_INDICES=MAX_VERTICES/2*3;const MAX_POINTS=8E3;const LAST_POINT=MAX_POINTS-4;const PARTIAL_TEXTURE_UPLOAD_CHUNK_SIZE= +256*1024;function areMat4sEqual(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[7]===b[7]&&a[8]===b[8]&&a[9]===b[9]&&a[10]===b[10]&&a[11]===b[11]&&a[12]===b[12]&&a[13]===b[13]&&a[14]===b[14]&&a[15]===b[15]}const defaultTexCoordsQuad=new C3.Quad(0,0,1,0,1,1,0,1);const tmpVec3=vec3.fromValues(0,0,0);const tmpVec3b=vec3.fromValues(0,0,0);const tmpMat4=mat4.create();const tmpQuad=new C3.Quad;const tmpRect=new C3.Rect;let loseContextExtension=null; +if(C3.isDebug){self.debug_lose_context=function(){if(!loseContextExtension){console.warn("WEBGL_lose_context not supported");return}loseContextExtension.loseContext()};self.debug_restore_context=function(){if(!loseContextExtension){console.warn("WEBGL_lose_context not supported");return}loseContextExtension.restoreContext()}}const pendingPolls=new Set;let pollRafId=-1;function CheckPendingPolls(){pollRafId=-1;for(const info of pendingPolls)if(info.checkFunc()){info.resolve();pendingPolls.delete(info)}if(pendingPolls.size> +0)pollRafId=self.requestAnimationFrame(CheckPendingPolls)}function GetWebGLContext(canvas,attribs,maxWebGLVersion){let gl=null;if(maxWebGLVersion>=2){gl=canvas.getContext("webgl2",attribs);if(gl)return{gl,version:2}}gl=canvas.getContext("webgl",attribs);if(!gl)try{gl=canvas.getContext("experimental-webgl",attribs)}catch(err){console.warn("Error requesting 'experimental-webgl' context: ",err)}return{gl,version:1}}C3.Gfx.WebGLRenderer=class WebGLRenderer extends C3.Gfx.RendererBase{constructor(canvas, +opts){super();opts=Object.assign({},DEFAULT_WEBGLRENDERER_OPTS,opts);if(!VALID_POWER_PREFERENCES.has(opts.powerPreference))throw new Error("invalid power preference");let hasMajorPerformanceCaveat=false;const attribs={"alpha":!!opts.alpha,"depth":false,"antialias":false,"powerPreference":opts.powerPreference,"failIfMajorPerformanceCaveat":true};if(opts.lowLatency){attribs["desynchronized"]=true;attribs["preserveDrawingBuffer"]=true}let ctxInfo=GetWebGLContext(canvas,attribs,opts.maxWebGLVersion); +if(!ctxInfo.gl){hasMajorPerformanceCaveat=true;attribs["failIfMajorPerformanceCaveat"]=false;ctxInfo=GetWebGLContext(canvas,attribs,opts.maxWebGLVersion)}if(!ctxInfo.gl)throw new Error("failed to initialise WebGL context");const gl=ctxInfo.gl;this._gl=gl;this._attribs=gl.getContextAttributes();if(opts.lowLatency&&!this._attribs["desynchronized"])console.info("[WebGLRenderer] Low-latency mode specified but is not supported here");this._versionString=gl.getParameter(gl.VERSION);this._version=ctxInfo.version; +this._is3d=true;this._lastBackbufferWidth=0;this._lastBackbufferHeight=0;this._vertexBuffer=null;this._texcoordBuffer=null;this._indexBuffer=null;this._pointBuffer=null;this._vertexData=new Float32Array(MAX_VERTICES*this.GetNumVertexComponents());this._indexData=new Uint16Array(MAX_INDICES);this._texcoordData=new Float32Array(MAX_VERTICES*2);this._pointData=new Float32Array(MAX_POINTS*4);this._vertexPtr=0;this._texPtr=0;this._pointPtr=0;this._lastVertexPtr=0;this._lastProgram=null;this._spDeviceTransformTextureFill= +null;this._spColorFill=null;this._spLinearGradientFill=null;this._spHardEllipseFill=null;this._spHardEllipseOutline=null;this._spSmoothEllipseFill=null;this._spSmoothEllipseOutline=null;this._spSmoothLineFill=null;this._spPoints=null;this._spTilemapFill=null;this._batch=[];this._batchPtr=0;this._topOfBatch=0;this._currentRenderTarget=null;this._baseZ=0;this._currentZ=0;this._lastPointZ=0;this._batchState=C3.New(C3.Gfx.BatchState,this);this._lastColor=C3.New(C3.Color,1,1,1,1);this._lastTexture0=null; +this._lastTexture1=null;this._lastSrcBlend=0;this._lastDestBlend=0;this._lineWidth=1;this._lineWidthStack=[this._lineWidth];this._lineCap=1;this._lineCapStack=[this._lineCap];this._lineOffset=.5;this._lineOffsetStack=[this._lineOffset];this._isScissorViewport=false;this._viewportScissorWidth=-1;this._viewportScissorHeight=-1;this._lastPointTexCoords=new C3.Rect;this._maxTextureSize=-1;this._minPointSize=0;this._maxPointSize=0;this._highpPrecision=0;this._unmaskedVendor="(unavailable)";this._unmaskedRenderer= +"(unavailable)";this._extensions=[];this._hasMajorPerformanceCaveat=hasMajorPerformanceCaveat;this._isInitialisingAfterContextRestored=false;this._parallelShaderCompileExt=null;this._isGpuProfilingEnabled=!!opts.enableGpuProfiling;this._timerExt=null;this._allQueryResultBuffers=new Set;this._timeQueryStack=[];this.FillIndexBufferData(this._indexData)}async InitState(){const gl=this._gl;const numVertexComponents=this.GetNumVertexComponents();this._lastColor.setRgba(1,1,1,1);this._lastTexture0=null; +this._lastTexture1=null;this._vertexPtr=0;this._pointPtr=0;this._lastVertexPtr=MAX_VERTICES*numVertexComponents-4*numVertexComponents;C3.clearArray(this._batch);this._batchPtr=0;this._topOfBatch=0;this._lastProgram=null;this._currentRenderTarget=null;this._lastPointTexCoords.set(0,0,1,1);this._baseZ=0;this._currentZ=0;this._lastPointZ=0;const batchState=this._batchState;batchState.currentShader=null;batchState.currentFramebuffer=null;vec4.set(batchState.currentColor,1,1,1,1);batchState.clearColor.setRgba(0, +0,0,0);batchState.pointTexCoords.set(0,0,1,1);gl.clearColor(0,0,0,0);gl.clear(gl.COLOR_BUFFER_BIT);gl.enable(gl.BLEND);gl.blendFunc(gl.ONE,gl.ONE_MINUS_SRC_ALPHA);this._lastSrcBlend=gl.ONE;this._lastDestBlend=gl.ONE_MINUS_SRC_ALPHA;this._InitBlendModes(gl);gl.disable(gl.CULL_FACE);gl.disable(gl.STENCIL_TEST);gl.disable(gl.DITHER);gl.disable(gl.DEPTH_TEST);this._pointBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,this._pointBuffer);gl.bufferData(gl.ARRAY_BUFFER,this._pointData.byteLength,gl.DYNAMIC_DRAW); +this._vertexBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,this._vertexBuffer);gl.bufferData(gl.ARRAY_BUFFER,this._vertexData.byteLength,gl.DYNAMIC_DRAW);this._texcoordBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,this._texcoordBuffer);gl.bufferData(gl.ARRAY_BUFFER,this._texcoordData.byteLength,gl.DYNAMIC_DRAW);this._indexBuffer=gl.createBuffer();gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,this._indexBuffer);gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,this._indexData,gl.STATIC_DRAW);gl.activeTexture(gl.TEXTURE0); +gl.bindTexture(gl.TEXTURE_2D,null);this._maxTextureSize=gl.getParameter(gl.MAX_TEXTURE_SIZE);const pointsizes=gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE);this._minPointSize=pointsizes[0];this._maxPointSize=pointsizes[1];const highpVertex=gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.HIGH_FLOAT);const highpFrag=gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.HIGH_FLOAT);if(highpVertex&&highpFrag)this._highpPrecision=Math.min(highpVertex["precision"],highpFrag["precision"]);else this._highpPrecision= +0;if(this._maxPointSize>2048)this._maxPointSize=2048;this._extensions=gl.getSupportedExtensions();const debug_ext=gl.getExtension("WEBGL_debug_renderer_info");if(debug_ext){this._unmaskedVendor=gl.getParameter(debug_ext["UNMASKED_VENDOR_WEBGL"]);this._unmaskedRenderer=gl.getParameter(debug_ext["UNMASKED_RENDERER_WEBGL"])}this._parallelShaderCompileExt=gl.getExtension("KHR_parallel_shader_compile");if(C3.isDebug)loseContextExtension=gl.getExtension("WEBGL_lose_context");if(this._isGpuProfilingEnabled)if(this.GetWebGLVersionNumber()=== +1){if(C3.Platform.BrowserEngine!=="Chromium"||C3.Platform.BrowserVersionNumber>=81||typeof document!=="undefined")this._timerExt=gl.getExtension("EXT_disjoint_timer_query")}else this._timerExt=gl.getExtension("EXT_disjoint_timer_query_webgl2")||gl.getExtension("EXT_disjoint_timer_query");this._ClearAllShaderPrograms();const WebGLShaderProgram=C3.Gfx.WebGLShaderProgram;const vsSource=WebGLShaderProgram.GetDefaultVertexShaderSource(this._is3d,false);const DEFAULT_SHADER_PROGRAMS=[[WebGLShaderProgram.GetTextureFillFragmentShaderSource(), +vsSource,""],[WebGLShaderProgram.GetTextureFillFragmentShaderSource(),vsSource,""],[WebGLShaderProgram.GetPointFragmentShaderSource(),WebGLShaderProgram.GetPointVertexShaderSource(),""],[WebGLShaderProgram.GetColorFillFragmentShaderSource(),vsSource,""],[WebGLShaderProgram.GetLinearGradientFillFragmentShaderSource(),vsSource,""],[WebGLShaderProgram.GetHardEllipseFillFragmentShaderSource(),vsSource,""],[WebGLShaderProgram.GetHardEllipseOutlineFragmentShaderSource(), +vsSource,""],[WebGLShaderProgram.GetSmoothEllipseFillFragmentShaderSource(),vsSource,""],[WebGLShaderProgram.GetSmoothEllipseOutlineFragmentShaderSource(),vsSource,""],[WebGLShaderProgram.GetSmoothLineFillFragmentShaderSource(),vsSource,""],[WebGLShaderProgram.GetTilemapFragmentShaderSource(),WebGLShaderProgram.GetDefaultVertexShaderSource(this._is3d,true),""]];const defaultShaders=await Promise.all(DEFAULT_SHADER_PROGRAMS.map(i=> +this.CreateShaderProgram({src:i[0]},i[1],i[2])));this._spTextureFill=defaultShaders[0];this._spDeviceTransformTextureFill=defaultShaders[1];this._spPoints=defaultShaders[2];this._spColorFill=defaultShaders[3];this._spLinearGradientFill=defaultShaders[4];this._spHardEllipseFill=defaultShaders[5];this._spHardEllipseOutline=defaultShaders[6];this._spSmoothEllipseFill=defaultShaders[7];this._spSmoothEllipseOutline=defaultShaders[8];this._spSmoothLineFill=defaultShaders[9];this._spTilemapFill=defaultShaders[10]; +this._currentStateGroup=null;this.SetTextureFillMode()}Is3D(){return this._is3d}GetNumVertexComponents(){return this._is3d?3:2}SetBaseZ(z){this._baseZ=z}GetBaseZ(){return this._baseZ}SetCurrentZ(z){this._currentZ=z;this._currentStateGroup=null}GetCurrentZ(){return this._currentZ}async CreateShaderProgram(shaderInfo,vsSource,name){const ret=await C3.Gfx.WebGLShaderProgram.Create(this,shaderInfo,vsSource,name);this._AddShaderProgram(ret);return ret}ResetLastProgram(){this._lastProgram=null}SetSize(w, +h,force){if(this._width===w&&this._height===h&&!force)return;this.EndBatch();const gl=this._gl;const batchState=this._batchState;this._width=w;this._height=h;const viewW=this.GetScissoredViewportWidth();const viewH=this.GetScissoredViewportHeight();this._UpdateViewportRenderer(viewW,viewH,this._width,this._height);this._UpdateViewportBatch(viewW,viewH,this._matP);if(this._spDeviceTransformTextureFill){gl.useProgram(this._spDeviceTransformTextureFill.GetShaderProgram());this._spDeviceTransformTextureFill._UpdateDeviceTransformUniforms(this._matP); +this._lastProgram=this._spDeviceTransformTextureFill;this._batchState.currentShader=this._spDeviceTransformTextureFill}gl.bindTexture(gl.TEXTURE_2D,null);gl.activeTexture(gl.TEXTURE1);gl.bindTexture(gl.TEXTURE_2D,null);gl.activeTexture(gl.TEXTURE0);this._lastTexture0=null;this._lastTexture1=null;if(this._currentRenderTarget)this._currentRenderTarget._Resize(this._width,this._height);gl.bindFramebuffer(gl.FRAMEBUFFER,null);this._currentRenderTarget=null;batchState.currentFramebuffer=null}_UpdateViewportRenderer(viewW, +viewH,surfaceW,surfaceH){this._cam[2]=100;mat4.lookAt(this._matMV,this._cam,this._look,this._up);mat4.perspective(this._matP,45,viewW/viewH,this.GetNearZ(),this.GetFarZ());const tl=[0,0];const br=[0,0];const dpr=self.devicePixelRatio;this.Project(0,0,viewW,viewH,tl);this.Project(1,1,viewW,viewH,br);this._worldScale[0]=dpr/(br[0]-tl[0]);this._worldScale[1]=-dpr/(br[1]-tl[1]);this._lastBackbufferWidth=surfaceW;this._lastBackbufferHeight=surfaceH}_UpdateViewportBatch(viewW,viewH,matP){const gl=this._gl; +const batchState=this._batchState;gl.viewport(0,0,viewW,viewH);const allShaderPrograms=this._allShaderPrograms;const currentShader=batchState.currentShader;for(let i=0,len=allShaderPrograms.length;i0){gl.bindBuffer(gl.ARRAY_BUFFER, +this._pointBuffer);gl.bufferSubData(gl.ARRAY_BUFFER,0,this._pointData.subarray(0,this._pointPtr))}if(this._vertexPtr>0){gl.bindBuffer(gl.ARRAY_BUFFER,this._vertexBuffer);gl.bufferSubData(gl.ARRAY_BUFFER,0,this._vertexData.subarray(0,this._vertexPtr));gl.bindBuffer(gl.ARRAY_BUFFER,this._texcoordBuffer);gl.bufferSubData(gl.ARRAY_BUFFER,0,this._texcoordData.subarray(0,this._texPtr))}}_ExecuteBatch(){const batch=this._batch;for(let i=0,len=this._batchPtr;i=this._lastVertexPtr){this.EndBatch();v=0}if(this._topOfBatch===1)this._batch[this._batchPtr-1]._indexCount+=6;else{const b=this.PushBatch();b.InitQuad(this._is3d?v:v/2*3,6);this._topOfBatch=1}}_WriteQuadToVertexBuffer(quad){quad.writeToTypedArray3D(this._vertexData, +this._vertexPtr,this._baseZ+this._currentZ);this._vertexPtr+=12}Quad(quad){this._ExtendQuadBatch();this._WriteQuadToVertexBuffer(quad);defaultTexCoordsQuad.writeToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}Quad2(tlx,tly,trx,try_,brx,bry,blx,bly){this._ExtendQuadBatch();const vd=this._vertexData;let v=this._vertexPtr;const z=this._baseZ+this._currentZ;if(this._is3d){vd[v++]=tlx;vd[v++]=tly;vd[v++]=z;vd[v++]=trx;vd[v++]=try_;vd[v++]=z;vd[v++]=brx;vd[v++]=bry;vd[v++]=z;vd[v++]=blx;vd[v++]= +bly;vd[v++]=z}else{vd[v++]=tlx;vd[v++]=tly;vd[v++]=trx;vd[v++]=try_;vd[v++]=brx;vd[v++]=bry;vd[v++]=blx;vd[v++]=bly}this._vertexPtr=v;defaultTexCoordsQuad.writeToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}Quad3(quad,rcTex){this._ExtendQuadBatch();this._WriteQuadToVertexBuffer(quad);rcTex.writeAsQuadToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}Quad4(quad,uv){this._ExtendQuadBatch();this._WriteQuadToVertexBuffer(quad);uv.writeToTypedArray(this._texcoordData,this._texPtr); +this._texPtr+=8}FullscreenQuad(mode,curTex){mat4.copy(tmpMat4,this._lastMV);vec3.copy(tmpVec3,this._cam);vec3.copy(tmpVec3b,this._look);this._cam[0]=0;this._cam[1]=0;this._cam[2]=100*self.devicePixelRatio;this._look[0]=0;this._look[1]=0;this._look[2]=0;this.ResetModelView();this.UpdateModelView();if(this._isScissorViewport){const left=this._viewportScissorWidth/2;const top=this._viewportScissorHeight/2;tmpRect.set(-left,top,-left+this._viewportScissorWidth,top-this._viewportScissorHeight);tmpQuad.setFromRect(tmpRect); +tmpRect.set(0,0,this._viewportScissorWidth/this._width,this._viewportScissorHeight/this._height);this.Quad3(tmpQuad,tmpRect)}else if(mode==="crop"&&this._currentRenderTarget&&curTex){const left=this._width/2;const top=this._height/2;const srcW=curTex.GetWidth();const srcH=curTex.GetHeight();const destW=this._currentRenderTarget.GetWidth();const destH=this._currentRenderTarget.GetHeight();const copyW=Math.min(destW,srcW);const copyH=Math.min(destH,srcH);const srcOffY=Math.max(srcH-destH,0);const destOffY= +Math.max(destH-srcH,0);tmpRect.set(-left,top-destOffY,-left+copyW,top-copyH-destOffY);tmpQuad.setFromRect(tmpRect);tmpRect.set(0,srcOffY,copyW,copyH+srcOffY);tmpRect.divide(srcW,srcH);this.Quad3(tmpQuad,tmpRect)}else{let [width,height]=this.GetRenderTargetSize(this._currentRenderTarget);const halfW=width/2;const halfH=height/2;this.Rect2(-halfW,halfH,halfW,-halfH)}mat4.copy(this._matMV,tmpMat4);vec3.copy(this._cam,tmpVec3);vec3.copy(this._look,tmpVec3b);this.UpdateModelView()}ConvexPoly(pts){const pts_count= +pts.length/2;if(pts_count<3)throw new Error("need at least 3 points");const tris=pts_count-2;const last_tri=tris-1;const p0x=pts[0];const p0y=pts[1];for(let i=0;i=100)throw new Error("pushed too many line widths - check push/pop pairs");this._lineWidthStack.push(n);this._lineWidth=n}PopLineWidth(){if(this._lineWidthStack.length<=1)throw new Error("cannot pop last line width - check push/pop pairs");this._lineWidthStack.pop();this._lineWidth= +this._lineWidthStack[this._lineWidthStack.length-1]}SetLineCapButt(){this._lineCap=0;this._lineCapStack[this._lineCapStack.length-1]=0}SetLineCapSquare(){this._lineCap=1;this._lineCapStack[this._lineCapStack.length-1]=0}SetLineCapZag(){this._lineCap=2;this._lineCapStack[this._lineCapStack.length-1]=0}PushLineCap(type){if(type==="butt")this.PushLineCapButt();else if(type==="square")this.PushLineCapSquare();else if(type==="zag")this.PushLineCapZag();else throw new Error("invalid line cap");}PushLineCapButt(){if(this._lineCapStack.length>= +100)throw new Error("pushed too many line caps - check push/pop pairs");this._lineCapStack.push(0);this._lineCap=0}PushLineCapSquare(){if(this._lineCapStack.length>=100)throw new Error("pushed too many line caps - check push/pop pairs");this._lineCapStack.push(1);this._lineCap=1}PushLineCapZag(){if(this._lineCapStack.length>=100)throw new Error("pushed too many line caps - check push/pop pairs");this._lineCapStack.push(2);this._lineCap=2}PopLineCap(){if(this._lineCapStack.length<=1)throw new Error("cannot pop last line cap - check push/pop pairs"); +this._lineCapStack.pop();this._lineCap=this._lineCapStack[this._lineCapStack.length-1]}SetLineOffset(n){this._lineOffset=n;this._lineOffsetStack[this._lineOffsetStack.length-1]=n}GetLineOffset(){return this._lineOffset}PushLineOffset(n){if(this._lineOffsetStack.length>=100)throw new Error("pushed too many line offsets - check push/pop pairs");this._lineOffsetStack.push(n);this._lineOffset=n}PopLineOffset(){if(this._lineOffsetStack.length<=1)throw new Error("cannot pop last line offset - check push/pop pairs"); +this._lineOffsetStack.pop();this._lineOffset=this._lineOffsetStack[this._lineOffsetStack.length-1]}SetPointTextureCoords(rect){if(this._lastPointTexCoords.equals(rect))return;this._lastPointTexCoords.copy(rect);const b=this.PushBatch();b.InitSetPointTexCoords(rect);this._topOfBatch=0}Point(x_,y_,size_,opacity_){if(this._pointPtr>=LAST_POINT)this.EndBatch();let p=this._pointPtr;const z=this._baseZ+this._currentZ;if(this._topOfBatch===2&&this._lastPointZ===z)this._batch[this._batchPtr-1]._indexCount++; +else{const b=this.PushBatch();b.InitPoints(p,z);this._topOfBatch=2;this._lastPointZ=z}const pd=this._pointData;pd[p++]=x_;pd[p++]=y_;pd[p++]=size_;pd[p++]=opacity_;this._pointPtr=p}SetProgram(program){if(this._lastProgram===program)return;const b=this.PushBatch();b.InitSetProgram(program);this._lastProgram=program;this._topOfBatch=0;this._currentStateGroup=null}SetTextureFillMode(){this.SetProgram(this._spTextureFill)}SetDeviceTransformTextureFillMode(){this.SetProgram(this._spDeviceTransformTextureFill)}SetColorFillMode(){this.SetProgram(this._spColorFill)}SetLinearGradientFillMode(){this.SetProgram(this._spLinearGradientFill)}SetGradientColor(c){const b= +this.PushBatch();b.InitSetGradientColor(c);this._topOfBatch=0}SetHardEllipseFillMode(){this.SetProgram(this._spHardEllipseFill)}SetHardEllipseOutlineMode(){this.SetProgram(this._spHardEllipseOutline)}SetSmoothEllipseFillMode(){this.SetProgram(this._spSmoothEllipseFill)}SetSmoothEllipseOutlineMode(){this.SetProgram(this._spSmoothEllipseOutline)}SetEllipseParams(pixelW,pixelH,outlineThickness=1){const b=this.PushBatch();b.InitSetEllipseParams(pixelW,pixelH,outlineThickness);this._topOfBatch=0}SetSmoothLineFillMode(){this.SetProgram(this._spSmoothLineFill)}SetTilemapFillMode(){this.SetProgram(this._spTilemapFill)}SetTilemapInfo(srcRect, +textureWidth,textureHeight,tileWidth,tileHeight,tileSpacingX,tileSpacingY){if(this._lastProgram!==this._spTilemapFill)throw new Error("must set tilemap fill mode first");const b=this.PushBatch();b.InitSetTilemapInfo(srcRect,textureWidth,textureHeight,tileWidth,tileHeight,tileSpacingX,tileSpacingY);this._topOfBatch=0}SetProgramParameters(backTex,destRect,srcRect,srcOriginRect,layoutRect,pixelWidth,pixelHeight,layerScale,layerAngle,time,params){const s=this._lastProgram;const hasAnyOptionalUniforms= +s._hasAnyOptionalUniforms;const hasAnyCustomParams=!!params.length;if((!hasAnyOptionalUniforms||s.AreOptionalUniformsAlreadySetInBatch(destRect,srcRect,srcOriginRect,layoutRect,pixelWidth,pixelHeight,layerScale,layerAngle,time))&&(!hasAnyCustomParams||s.AreCustomParametersAlreadySetInBatch(params)))return;const b=this.PushBatch();b.InitSetProgramParameters();if(hasAnyOptionalUniforms){s.SetOptionalUniformsInBatch(destRect,srcRect,srcOriginRect,layoutRect,pixelWidth,pixelHeight,layerScale,layerAngle, +time);const mat4param=b._mat4param;mat4param[0]=pixelWidth;mat4param[1]=pixelHeight;destRect.writeToTypedArray(mat4param,2);mat4param[6]=layerScale;mat4param[7]=layerAngle;srcRect.writeToTypedArray(mat4param,12);const colorParam=b._colorParam;layoutRect.writeToTypedArray(colorParam,0);const tmp=colorParam[1];colorParam[1]=colorParam[3];colorParam[3]=tmp;srcOriginRect.writeToTypedArray(b._srcOriginRect,0);b._startIndex=time;if(s._uSamplerBack.IsUsed())b._texParam=backTex?backTex.GetTexture():null; +else b._texParam=null}if(hasAnyCustomParams){s.SetCustomParametersInBatch(params);C3.shallowAssignArray(b._shaderParams,params)}this._topOfBatch=0}ClearRgba(r,g,b_,a){const b=this.PushBatch();b.InitClearSurface2(r,g,b_,a);this._topOfBatch=0}Clear(c){const b=this.PushBatch();b.InitClearSurface(c);this._topOfBatch=0}ClearRect(x,y,w,h){this.ClearRect4(x,y,w,h,0,0,0,0)}ClearRect2(rc){this.ClearRect4(rc.getLeft(),rc.getTop(),rc.width(),rc.height(),0,0,0,0)}ClearRect3(rc,c){this.ClearRect4(rc.getLeft(), +rc.getTop(),rc.width(),rc.height(),c.getR(),c.getG(),c.getB(),c.getA())}ClearRect4(x,y,w,h,r,g,b,a){if(w<0||h<0)return;const batch=this.PushBatch();batch.InitClearRect(x,y,w,h,r,g,b,a);this._topOfBatch=0}Start(){}Finish(){super.Finish();this._gl.flush()}CheckForQueryResults(){for(const qrb of this._allQueryResultBuffers)qrb.CheckForResults(this._frameNumber)}IsContextLost(){return!this._gl||this._gl.isContextLost()||this._isInitialisingAfterContextRestored}OnContextLost(){C3.Gfx.WebGLRendererTexture.OnContextLost(); +C3.Gfx.WebGLRenderTarget.OnContextLost();C3.Gfx.RendererText.OnContextLost();for(const qrb of this._allQueryResultBuffers)qrb.Clear();this._extensions=[];this._timerExt=null;this._parallelShaderCompileExt=null;this._unmaskedVendor="(unavailable)";this._unmaskedRenderer="(unavailable)";this._lastProgram=null;this._spTextureFill=null;this._spDeviceTransformTextureFill=null;this._spColorFill=null;this._spLinearGradientFill=null;this._spHardEllipseFill=null;this._spHardEllipseOutline=null;this._spSmoothEllipseFill= +null;this._spSmoothEllipseOutline=null;this._spSmoothLineFill=null;this._spPoints=null;this._spTilemapFill=null;for(const stateGroup of this._stateGroups.values())stateGroup.OnContextLost();for(const s of this._allShaderPrograms)s.Release();this._ClearAllShaderPrograms()}async OnContextRestored(){this._isInitialisingAfterContextRestored=true;await this.InitState();this._isInitialisingAfterContextRestored=false;for(const stateGroup of this._stateGroups.values())stateGroup.OnContextRestored(this);this.SetSize(this._width, +this._height,true)}CreateStaticTexture(data,opts){if(this.IsContextLost())throw new Error("context lost");this.EndBatch();const rendererTex=C3.New(C3.Gfx.WebGLRendererTexture,this);rendererTex._CreateStatic(data,opts);return rendererTex}CreateStaticTextureAsync(data,opts){if(this.IsContextLost())return Promise.reject("context lost");opts=Object.assign({},opts);const isTiled=opts.wrapX&&opts.wrapX!=="clamp-to-edge"||opts.wrapY&&opts.wrapY!=="clamp-to-edge";if(C3.Supports.ImageBitmapOptions&&(this.SupportsNPOTTextures()|| +!isTiled)){opts.premultiplyAlpha=false;return createImageBitmap(data,{"premultiplyAlpha":"premultiply"}).then(imageBitmap=>C3.Asyncify(()=>this.CreateStaticTexture(imageBitmap,opts)))}else if(C3.Supports.ImageBitmap)return createImageBitmap(data).then(imageBitmap=>C3.Asyncify(()=>this.CreateStaticTexture(imageBitmap,opts)));else if(data instanceof Blob)return C3.BlobToImage(data,true).then(img=>this.CreateStaticTextureAsync(img,opts));else if(typeof HTMLImageElement!=="undefined"&&data instanceof +HTMLImageElement&&typeof data["decode"]==="function")return data["decode"]().then(()=>C3.Asyncify(()=>this.CreateStaticTexture(data,opts)));else return C3.Asyncify(()=>this.CreateStaticTexture(data,opts))}CreateDynamicTexture(width,height,opts){this.EndBatch();const rendererTex=C3.New(C3.Gfx.WebGLRendererTexture,this);rendererTex._CreateDynamic(width,height,opts);return rendererTex}UpdateTexture(data,rendererTex,opts){this.EndBatch();rendererTex._Update(data,opts)}DeleteTexture(rendererTex){if(!rendererTex)return; +rendererTex.SubtractReference();if(rendererTex.GetReferenceCount()>0)return;this.EndBatch();if(rendererTex===this._lastTexture0){this._gl.bindTexture(this._gl.TEXTURE_2D,null);this._lastTexture0=null}if(rendererTex===this._lastTexture1){this._gl.activeTexture(this._gl.TEXTURE1);this._gl.bindTexture(this._gl.TEXTURE_2D,null);this._gl.activeTexture(this._gl.TEXTURE0);this._lastTexture1=null}rendererTex._Delete()}CreateRenderTarget(opts){let width=this._width;let height=this._height;let isDefaultSize= +true;if(opts){if(typeof opts.width==="number"){width=opts.width;isDefaultSize=false}if(typeof opts.height==="number"){height=opts.height;isDefaultSize=false}}if(width<=0||height<=0)throw new Error("invalid size");this.EndBatch();const renderTarget=C3.New(C3.Gfx.WebGLRenderTarget,this);renderTarget._Create(width,height,Object.assign({isDefaultSize},opts));this._currentRenderTarget=null;this._batchState.currentFramebuffer=null;return renderTarget}SetRenderTarget(renderTarget){if(renderTarget===this._currentRenderTarget)return; +let newViewWidth,newViewHeight,newSurfaceWidth,newSurfaceHeight;if(renderTarget){if(renderTarget.IsDefaultSize())renderTarget._Resize(this._width,this._height);newSurfaceWidth=renderTarget.GetWidth();newSurfaceHeight=renderTarget.GetHeight();newViewWidth=newSurfaceWidth;newViewHeight=newSurfaceHeight}else{newSurfaceWidth=this._width;newSurfaceHeight=this._height;newViewWidth=this.GetScissoredViewportWidth();newViewHeight=this.GetScissoredViewportHeight()}const didSurfaceSizeChange=this._lastBackbufferWidth!== +newSurfaceWidth||this._lastBackbufferHeight!==newSurfaceHeight;if(didSurfaceSizeChange)this._UpdateViewportRenderer(newViewWidth,newViewHeight,newSurfaceWidth,newSurfaceHeight);const b=this.PushBatch();b.InitSetRenderTarget(renderTarget,didSurfaceSizeChange,this._matP);this._currentRenderTarget=renderTarget;this._topOfBatch=0}GetRenderTarget(){return this._currentRenderTarget}GetRenderTargetSize(renderTarget){if(renderTarget)return[renderTarget.GetWidth(),renderTarget.GetHeight()];else return[this._width, +this._height]}CopyRenderTarget(renderTarget,mode="stretch"){if(this._version<2||this._currentRenderTarget&&this._currentRenderTarget.GetMultisampling()>0){this.SetCopyBlend();this.ResetColor();this.DrawRenderTarget(renderTarget,mode)}else{const b=this.PushBatch();b.InitBlitFramebuffer(renderTarget,this._currentRenderTarget,mode);this._topOfBatch=0}}DrawRenderTarget(renderTarget,mode="stretch"){const tex=renderTarget.GetTexture();if(!tex)throw new Error("not a texture-backed render target");this.SetTexture(tex); +this.FullscreenQuad(mode,tex)}InvalidateRenderTarget(renderTarget){if(this._version<2)return;const b=this.PushBatch();b.InitInvalidateFramebuffer(renderTarget._GetFramebuffer());this._topOfBatch=0}DeleteRenderTarget(renderTarget){this.SetRenderTarget(null);this.EndBatch();const renderTex=renderTarget.GetTexture();if(renderTex===this._lastTexture0){this._gl.bindTexture(this._gl.TEXTURE_2D,null);this._lastTexture0=null}if(renderTex===this._lastTexture1){this._gl.activeTexture(this._gl.TEXTURE1);this._gl.bindTexture(this._gl.TEXTURE_2D, +null);this._gl.activeTexture(this._gl.TEXTURE0);this._lastTexture1=null}renderTarget._Delete()}async ReadBackRenderTargetToImageData(renderTarget,forceSynchronous,areaRect){this.EndBatch();const oldRenderTarget=this._currentRenderTarget;let width,height,framebuffer;if(renderTarget){width=renderTarget.GetWidth();height=renderTarget.GetHeight();framebuffer=renderTarget._GetFramebuffer()}else{width=this.GetWidth();height=this.GetHeight();framebuffer=null}let x=0;let y=0;let areaWidth=width;let areaHeight= +height;if(areaRect){x=C3.clamp(Math.floor(areaRect.getLeft()),0,width-1);y=C3.clamp(Math.floor(areaRect.getTop()),0,height-1);let w=areaRect.width();if(w===0)w=width-x;else w=C3.clamp(Math.floor(w),0,width-x);let h=areaRect.height();if(h===0)h=height-y;else h=C3.clamp(Math.floor(h),0,height-y);areaWidth=w;areaHeight=h;y=height-(y+areaHeight)}const gl=this._gl;gl.bindFramebuffer(gl.FRAMEBUFFER,framebuffer);const restorePreviousRenderTarget=()=>{gl.bindFramebuffer(gl.FRAMEBUFFER,null);this._currentRenderTarget= +null;this._batchState.currentFramebuffer=null;this.SetRenderTarget(oldRenderTarget)};let imageData;if(!forceSynchronous&&this.GetWebGLVersionNumber()>=2){gl.bindFramebuffer(gl.READ_FRAMEBUFFER,framebuffer);const pixelBuffer=gl.createBuffer();const bufferSize=areaWidth*areaHeight*4;const PIXEL_PACK_BUFFER=gl["PIXEL_PACK_BUFFER"];gl.bindBuffer(PIXEL_PACK_BUFFER,pixelBuffer);gl.bufferData(PIXEL_PACK_BUFFER,bufferSize,gl["STREAM_READ"]);gl.readPixels(x,y,areaWidth,areaHeight,gl.RGBA,gl.UNSIGNED_BYTE, +0);gl.bindFramebuffer(gl.READ_FRAMEBUFFER,null);gl.bindBuffer(PIXEL_PACK_BUFFER,null);restorePreviousRenderTarget();const sync=gl["fenceSync"](gl["SYNC_GPU_COMMANDS_COMPLETE"],0);await this._WaitForObjectReady(()=>gl["getSyncParameter"](sync,gl["SYNC_STATUS"])===gl["SIGNALED"]);gl["deleteSync"](sync);imageData=new ImageData(areaWidth,areaHeight);gl.bindBuffer(PIXEL_PACK_BUFFER,pixelBuffer);gl["getBufferSubData"](PIXEL_PACK_BUFFER,0,new Uint8Array(imageData.data.buffer),0,bufferSize);gl.bindBuffer(PIXEL_PACK_BUFFER, +null);gl.deleteBuffer(pixelBuffer)}else{imageData=new ImageData(areaWidth,areaHeight);gl.readPixels(x,y,areaWidth,areaHeight,gl.RGBA,gl.UNSIGNED_BYTE,new Uint8Array(imageData.data.buffer));restorePreviousRenderTarget()}return imageData}StartQuery(query){if(!this.SupportsGPUProfiling())return;const b=this.PushBatch();b.InitStartQuery(query);this._topOfBatch=0}EndQuery(query){if(!this.SupportsGPUProfiling())return;const b=this.PushBatch();b.InitEndQuery(query);this._topOfBatch=0}_WaitForObjectReady(checkFunc){const ret= +new Promise(resolve=>pendingPolls.add({resolve,checkFunc}));if(pollRafId===-1)pollRafId=self.requestAnimationFrame(CheckPendingPolls);return ret}IsDesynchronized(){return!!this._attribs["desynchronized"]}GetEstimatedBackBufferMemoryUsage(){return this._width*this._height*(this._attribs["alpha"]?4:3)}GetEstimatedRenderBufferMemoryUsage(){let ret=0;for(const t of C3.Gfx.WebGLRenderTarget.allRenderTargets()){if(t.GetTexture())continue;ret+=t.GetEstimatedMemoryUsage()}return ret}GetEstimatedTextureMemoryUsage(){let ret= +0;for(const t of C3.Gfx.WebGLRendererTexture.allTextures())ret+=t.GetEstimatedMemoryUsage();return ret}GetEstimatedTotalMemoryUsage(){return this.GetEstimatedBackBufferMemoryUsage()+this.GetEstimatedRenderBufferMemoryUsage()+this.GetEstimatedTextureMemoryUsage()}GetWebGLVersionString(){return this._versionString}GetWebGLVersionNumber(){return this._version}SupportsNPOTTextures(){return this.GetWebGLVersionNumber()>=2}GetMaxTextureSize(){return this._maxTextureSize}GetMinPointSize(){return this._minPointSize}GetMaxPointSize(){return this._maxPointSize}SupportsHighP(){return this._highpPrecision!== +0}GetHighPPrecision(){return this._highpPrecision}GetUnmaskedVendor(){return this._unmaskedVendor}GetUnmaskedRenderer(){return this._unmaskedRenderer}GetExtensions(){return this._extensions}HasMajorPerformanceCaveat(){return this._hasMajorPerformanceCaveat}SupportsGPUProfiling(){return!!this._timerExt}_GetDisjointTimerQueryExtension(){return this._timerExt}_GetParallelShaderCompileExtension(){return this._parallelShaderCompileExt}_AddQueryResultBuffer(qrb){this._allQueryResultBuffers.add(qrb)}_RemoveQueryResultBuffer(qrb){this._allQueryResultBuffers.delete(qrb)}_GetTimeQueryStack(){return this._timeQueryStack}GetContext(){return this._gl}_InitBlendModes(gl){this._InitBlendModeData([["normal", +gl.ONE,gl.ONE_MINUS_SRC_ALPHA],["additive",gl.ONE,gl.ONE],["xor",gl.ONE,gl.ONE_MINUS_SRC_ALPHA],["copy",gl.ONE,gl.ZERO],["destination-over",gl.ONE_MINUS_DST_ALPHA,gl.ONE],["source-in",gl.DST_ALPHA,gl.ZERO],["destination-in",gl.ZERO,gl.SRC_ALPHA],["source-out",gl.ONE_MINUS_DST_ALPHA,gl.ZERO],["destination-out",gl.ZERO,gl.ONE_MINUS_SRC_ALPHA],["source-atop",gl.DST_ALPHA,gl.ONE_MINUS_SRC_ALPHA],["destination-atop",gl.ONE_MINUS_DST_ALPHA,gl.SRC_ALPHA]])}CreateRendererText(){return C3.New(C3.Gfx.RendererText, +this)}CreateWebGLText(){return this.CreateRendererText()}}}; + + +// c3/interfaces/IRuntime.js +'use strict';{const C3=self.C3;let runtime=null;const keysDownByKey=new Set;function SortZOrderList(a,b){const layerA=a[0];const layerB=b[0];const diff=layerA-layerB;if(diff!==0)return diff;const indexA=a[1];const indexB=b[1];return indexA-indexB}const tempZOrderList=[];const tempInstances=[];let didWarnInAlertPolyfill=false;self.IRuntime=class IRuntime{constructor(runtime_,objects){runtime=runtime_;Object.defineProperties(this,{assets:{value:runtime.GetAssetManager().GetIAssetManager(),writable:false}, +objects:{value:objects,writable:false},globalVars:{value:{},writable:false},projectName:{value:runtime.GetProjectName(),writable:false},projectVersion:{value:runtime.GetProjectVersion(),writable:false},storage:{value:new self.IStorage(runtime),writable:false},isInWorker:{value:runtime.IsInWorker(),writable:false}});runtime.UserScriptDispatcher().addEventListener("keydown",e=>{if(keysDownByKey.has(e["key"])){e.stopPropagation();return}keysDownByKey.add(e["key"])});runtime.UserScriptDispatcher().addEventListener("keyup", +e=>keysDownByKey.delete(e["key"]));runtime.Dispatcher().addEventListener("window-blur",()=>keysDownByKey.clear());if(runtime.IsInWorker())self["alert"]=message=>{if(!didWarnInAlertPolyfill){didWarnInAlertPolyfill=true;console.warn("[Construct 3] alert() was called from a Web Worker, because the project 'Use worker' setting is enabled. This method is not normally available in a Web Worker. Construct has implemented the alert for you, but note that other features may be missing in worker mode. You may wish to disable 'Use worker', or use a more convenient function like console.log(). For more information please refer to the scripting section of the manual.")}return this.alert(message)}}_InitGlobalVars(globalVarDescriptors){Object.defineProperties(this.globalVars, +globalVarDescriptors)}addEventListener(name,func){runtime.UserScriptDispatcher().addEventListener(name,func)}removeEventListener(name,func){runtime.UserScriptDispatcher().removeEventListener(name,func)}callFunction(name,...params){const eventSheetManager=runtime.GetEventSheetManager();const functionBlock=eventSheetManager.GetFunctionBlockByName(name);if(!functionBlock)throw new Error(`cannot find function name '${name}'`);if(!functionBlock.IsEnabled())return functionBlock.GetDefaultReturnValue(); +if(params.length0){solModifiers=sm;eventSheetManager.PushCleanSol(sm)}}const ret=callEventBlock.RunAsExpressionFunctionCall(callEventBlock.GetSolModifiersIncludingParents(), +functionBlock.GetReturnType(),functionBlock.GetDefaultReturnValue(),...params);if(solModifiers)eventSheetManager.PopSol(solModifiers);return ret}setReturnValue(v){const frame=runtime.GetEventStack().GetCurrentExpFuncStackFrame();if(!frame)throw new Error("not in a function which returns a value");switch(frame.GetFunctionReturnType()){case 1:if(typeof v==="number")frame.SetFunctionReturnValue(v);break;case 2:if(typeof v==="string")frame.SetFunctionReturnValue(v);break;case 3:if(typeof v==="number"|| +typeof v==="string")frame.SetFunctionReturnValue(v);break}}get dt(){return runtime.GetDt()}get gameTime(){return runtime.GetGameTime()}get wallTime(){return runtime.GetWallTime()}random(){return runtime.Random()}get layout(){return runtime.GetMainRunningLayout().GetILayout()}getLayout(nameOrIndex){const layoutManager=runtime.GetLayoutManager();let layout=null;if(typeof nameOrIndex==="number"||typeof nameOrIndex==="string")layout=layoutManager.GetLayout(nameOrIndex);else throw new TypeError("expected string or number"); +if(!layout)throw new Error("invalid layout");return layout.GetILayout()}getAllLayouts(){return runtime.GetLayoutManager().GetAllLayouts().map(layout=>layout.GetILayout())}goToLayout(nameOrIndex){const layoutManager=runtime.GetLayoutManager();let layout=null;if(typeof nameOrIndex==="number"||typeof nameOrIndex==="string")layout=layoutManager.GetLayout(nameOrIndex);else throw new TypeError("expected string or number");if(!layout)throw new Error("invalid layout");if(layoutManager.IsPendingChangeMainLayout())return; +layoutManager.ChangeMainLayout(layout)}get keyboard(){const ret=runtime._GetCommonScriptInterfaces().keyboard;if(!ret)throw new Error("runtime.keyboard used but Keyboard object missing - add it to your project first");return ret}get mouse(){const ret=runtime._GetCommonScriptInterfaces().mouse;if(!ret)throw new Error("runtime.mouse used but Mouse object missing - add it to your project first");return ret}get touch(){const ret=runtime._GetCommonScriptInterfaces().touch;if(!ret)throw new Error("runtime.touch used but Touch object missing - add it to your project first"); +return ret}invokeDownload(url,filename){runtime.InvokeDownload(url,filename)}getInstanceByUid(uid){const ret=runtime.GetInstanceByUID(uid);return ret?ret.GetInterfaceClass():null}sortZOrder(iterable,callback){const layout=runtime.GetCurrentLayout();for(const iinst of iterable){const inst=runtime._UnwrapScriptInterface(iinst);if(!inst||!inst.GetWorldInfo())throw new Error("invalid instance");const wi=inst.GetWorldInfo();tempZOrderList.push([wi.GetLayer().GetIndex(),wi.GetZIndex()]);tempInstances.push(inst)}if(tempZOrderList.length=== +0)return;tempZOrderList.sort(SortZOrderList);tempInstances.sort((a,b)=>callback(a.GetInterfaceClass(),b.GetInterfaceClass()));let anyChanged=false;for(let i=0,len=tempZOrderList.length;i +inst.GetInterfaceClass())}getFirstInstance(){const instances=map.get(this).GetInstances();if(instances.length>0)return instances[0].GetInterfaceClass();else return null}getPickedInstances(){return map.get(this).GetCurrentSol().GetInstances().map(inst=>inst.GetInterfaceClass())}getFirstPickedInstance(){const pickedInstances=map.get(this).GetCurrentSol().GetInstances();if(pickedInstances.length>0)return pickedInstances[0].GetInterfaceClass();else return null}*instances(){for(const inst of map.get(this).GetInstances())yield inst.GetInterfaceClass()}*pickedInstances(){for(const inst of map.get(this).GetCurrentSol().GetInstances())yield inst.GetInterfaceClass()}setInstanceClass(Class){const objectClass= +map.get(this);if(objectClass.GetInstanceCount()>0)throw new Error("setInstanceClass() called too late, because instances have already been created - call in runOnStartup");map.get(this)._SetUserScriptInstanceClass(Class)}createInstance(layerNameOrIndex,x,y){if(typeof layerNameOrIndex!=="number"&&typeof layerNameOrIndex!=="string")throw new TypeError("invalid layer parameter");const objectClass=map.get(this);const runtime=objectClass.GetRuntime();const layer=runtime.GetMainRunningLayout().GetLayer(layerNameOrIndex); +if(!layer)throw new Error("invalid layer");const inst=runtime.CreateInstance(objectClass,layer,x,y);const eventSheetManager=runtime.GetEventSheetManager();eventSheetManager.BlockFlushingInstances(true);inst._TriggerOnCreated();if(inst.IsInContainer())for(const s of inst.siblings())s._TriggerOnCreated();eventSheetManager.BlockFlushingInstances(false);return inst.GetInterfaceClass()}}}; + + +// c3/interfaces/ILayout.js +'use strict';{const map=new WeakMap;self.ILayout=class ILayout{constructor(layout){map.set(this,layout);const effectInstanceArr=[];const effectList=layout.GetEffectList();const effectCount=effectList.GetAllEffectTypes().length;for(let i=0;ilayer.GetILayer())}}}; + + +// c3/interfaces/ILayer.js +'use strict';{const C3=self.C3;const map=new WeakMap;self.ILayer=class ILayer{constructor(layer){map.set(this,layer);const effectInstanceArr=[];const effectList=layer.GetEffectList();const effectCount=effectList.GetAllEffectTypes().length;for(let i=0;i[a[1],a[0]]));const tempColor=C3.New(C3.Color);self.IWorldInstance=class IWorldInstance extends IInstance{constructor(){super(); +const inst=IInstance._GetInitInst();map.set(this,inst);const effectInstanceArr=[];const wi=inst.GetWorldInfo();const instanceEffectList=wi.GetInstanceEffectList();if(instanceEffectList){const effectCount=wi.GetObjectClass().GetEffectList().GetAllEffectTypes().length;for(let i=0;iinst.GetInterfaceClass())}}}; + + +// c3/interfaces/IEffectInstance.js +'use strict';{const C3=self.C3;const map=new WeakMap;self.IEffectInstance=class IEffectInstance{constructor(effectList,index){map.set(this,effectList);const descriptors={index:{value:index,writable:false}};Object.defineProperties(this,descriptors)}get name(){const effectTypes=map.get(this).GetAllEffectTypes();return effectTypes[this.index].GetName()}get isActive(){return map.get(this).IsEffectIndexActive(this.index)}set isActive(a){a=!!a;const fxList=map.get(this);if(fxList.IsEffectIndexActive(this.index)=== +a)return;fxList.SetEffectIndexActive(this.index,a);fxList.UpdateActiveEffects();fxList.GetRuntime().UpdateRender()}setParameter(i,v){i=Math.floor(+i);const fxList=map.get(this);const paramsArr=fxList.GetEffectParametersForIndex(this.index);if(i<0||i>=paramsArr.length)throw new RangeError("invalid effect parameter index");const oldValue=paramsArr[i];if(oldValue instanceof C3.Color){if(!Array.isArray(v)||v.length<3)throw new TypeError("expected array with 3 elements");const r=v[0];const g=v[1];const b= +v[2];if(oldValue.equalsRgb(r,g,b))return;oldValue.setRgb(r,g,b)}else{if(typeof v!=="number")throw new TypeError("expected number");if(oldValue===v)return;paramsArr[i]=v}if(fxList.IsEffectIndexActive(this.index))fxList.GetRuntime().UpdateRender()}getParameter(i){i=Math.floor(+i);const fxList=map.get(this);const paramsArr=fxList.GetEffectParametersForIndex(this.index);if(i<0||i>=paramsArr.length)throw new RangeError("invalid effect parameter index");const ret=paramsArr[i];if(ret instanceof C3.Color)return[ret.getR(), +ret.getG(),ret.getB()];else return ret}}}; + + +// c3/assets/assetManager.js +'use strict';{const C3=self.C3;const VALID_LOAD_POLICIES=new Set(["local","remote"]);const EXT_TO_TYPE=new Map([["mp4","video/mp4"],["webm","video/webm"],["m4a","audio/mp4"],["mp3","audio/mpeg"],["js","application/javascript"],["wasm","application/wasm"],["svg","image/svg+xml"],["html","text/html"]]);function GetTypeFromFileExtension(filename){if(!filename)return"";const parts=filename.split(".");if(parts.length<2)return"";const ext=parts[parts.length-1].toLowerCase();return EXT_TO_TYPE.get(ext)|| +""}function AddScript(url,type){return new Promise((resolve,reject)=>{const elem=document.createElement("script");elem.onload=resolve;elem.onerror=reject;elem.async=false;if(type==="module")elem.type="module";elem.src=url;document.head.appendChild(elem)})}C3.AssetManager=class AssetManager extends C3.DefendedBase{constructor(runtime,opts){super();const exportType=opts["exportType"];this._runtime=runtime;this._scriptsType=opts["scriptsType"];this._localUrlBlobs=new Map;this._localBlobUrlCache=new Map; +this._isCordova=exportType==="cordova";this._isiOSCordova=!!opts["isiOSCordova"];this._isFileProtocol=location.protocol==="file:";this._swClientId=opts["swClientId"];this._supportedAudioFormats=opts["supportedAudioFormats"]||{};this._audioFiles=new Map;this._preloadSounds=false;this._mediaSubfolder="";this._fontsSubfolder="";this._iconsSubfolder="";const isRemoteLoadPolicy=exportType==="html5"||exportType==="scirra-arcade"||exportType==="instant-games";this._defaultLoadPolicy=isRemoteLoadPolicy?"remote": +"local";this._allAssets=[];this._assetsByUrl=new Map;this._webFonts=[];this._loadPromises=[];this._hasFinishedInitialLoad=false;this._totalAssetSizeToLoad=0;this._assetSizeLoaded=0;this._lastLoadProgress=0;this._hasHadErrorLoading=false;this._loadingRateLimiter=C3.New(C3.RateLimiter,()=>this._FireLoadingProgressEvent(),50);this._promiseThrottle=new C3.PromiseThrottle(Math.max(C3.hardwareConcurrency,8));const localUrlBlobs=opts["previewImageBlobs"];if(localUrlBlobs){const projectFileBlobs=opts["previewProjectFileBlobs"]; +if(projectFileBlobs)Object.assign(localUrlBlobs,projectFileBlobs);const projectData=opts["projectData"];if(projectData)localUrlBlobs["data.json"]=projectData;for(const [url,blob]of Object.entries(localUrlBlobs))this._localUrlBlobs.set(url.toLowerCase(),blob)}const localUrlMap=opts["previewProjectFileUrls"];if(localUrlMap)for(const [srcUrl,destUrl]of Object.entries(localUrlMap))this._localBlobUrlCache.set(srcUrl,destUrl);this._iAssetManager=new self.IAssetManager(this)}Release(){this._localUrlBlobs.clear(); +for(const url of this._localBlobUrlCache.values())if(url.startsWith("blob:"))URL.revokeObjectURL(url);this._localBlobUrlCache.clear();for(const asset of this._allAssets)asset.Release();C3.clearArray(this._allAssets);this._assetsByUrl.clear();C3.clearArray(this._loadPromises);this._runtime=null}GetRuntime(){return this._runtime}_SetMediaSubfolder(folder){this._mediaSubfolder=folder}GetMediaSubfolder(){return this._mediaSubfolder}_SetFontsSubfolder(folder){this._fontsSubfolder=folder}GetFontsSubfolder(){return this._fontsSubfolder}_SetIconsSubfolder(folder){this._iconsSubfolder= +folder}GetIconsSubfolder(){return this._iconsSubfolder}_HasLocalUrlBlob(url){return this._localUrlBlobs.has(url.toLowerCase())}_GetLocalUrlBlob(url){return this._localUrlBlobs.get(url.toLowerCase())||null}GetLocalUrlAsBlobUrl(url){if(!this._HasLocalUrlBlob(url))return url;const lowerUrl=url.toLowerCase();let ret=this._localBlobUrlCache.get(lowerUrl);if(!ret){const blob=this._GetLocalUrlBlob(lowerUrl);ret=URL.createObjectURL(blob);this._localBlobUrlCache.set(lowerUrl,ret)}return ret}FetchBlob(url, +loadPolicy){loadPolicy=loadPolicy||this._defaultLoadPolicy;const localBlob=this._GetLocalUrlBlob(url);if(localBlob)return Promise.resolve(localBlob);else if(C3.IsRelativeURL(url)){const lowerUrl=url.toLowerCase();if(this._isCordova&&this._isFileProtocol)return this.CordovaFetchLocalFileAsBlob(lowerUrl);else if(loadPolicy==="local")return this._promiseThrottle.Add(()=>C3.FetchBlob(lowerUrl));else return C3.FetchBlob(lowerUrl)}else return C3.FetchBlob(url)}FetchArrayBuffer(url){const localBlob=this._GetLocalUrlBlob(url); +if(localBlob)return C3.BlobToArrayBuffer(localBlob);else if(C3.IsRelativeURL(url)){const lowerUrl=url.toLowerCase();if(this._isCordova&&this._isFileProtocol)return this.CordovaFetchLocalFileAsArrayBuffer(lowerUrl);else if(this._defaultLoadPolicy==="local")return this._promiseThrottle.Add(()=>C3.FetchArrayBuffer(lowerUrl));else return C3.FetchArrayBuffer(lowerUrl)}else return C3.FetchArrayBuffer(url)}FetchText(url){const localBlob=this._GetLocalUrlBlob(url);if(localBlob)return C3.BlobToString(localBlob); +else if(C3.IsRelativeURL(url)){const lowerUrl=url.toLowerCase();if(this._isCordova&&this._isFileProtocol)return this.CordovaFetchLocalFileAsText(lowerUrl);else if(this._defaultLoadPolicy==="local")return this._promiseThrottle.Add(()=>C3.FetchText(lowerUrl));else return C3.FetchText(lowerUrl)}else return C3.FetchText(url)}async FetchJson(url){const text=await this.FetchText(url);return JSON.parse(text)}_CordovaFetchLocalFileAs(filename,as_){return this._runtime.PostComponentMessageToDOMAsync("runtime", +"cordova-fetch-local-file",{"filename":filename,"as":as_})}CordovaFetchLocalFileAsText(filename){return this._CordovaFetchLocalFileAs(filename,"text")}async CordovaFetchLocalFileAsBlob(filename){const buffer=await this._CordovaFetchLocalFileAs(filename,"buffer");const type=GetTypeFromFileExtension(filename);return new Blob([buffer],{"type":type})}async CordovaFetchLocalFileAsBlobURL(filename){filename=filename.toLowerCase();let blobUrl=this._localBlobUrlCache.get(filename);if(blobUrl)return blobUrl; +const blob=await this.CordovaFetchLocalFileAsBlob(filename);blobUrl=URL.createObjectURL(blob);this._localBlobUrlCache.set(filename,blobUrl);return blobUrl}CordovaFetchLocalFileAsArrayBuffer(filename){return this._CordovaFetchLocalFileAs(filename,"buffer")}GetMediaFileUrl(filename){if(this._HasLocalUrlBlob(filename))return this.GetLocalUrlAsBlobUrl(filename);else return this._mediaSubfolder+filename.toLowerCase()}GetProjectFileUrl(url,subfolder=""){if(C3.IsAbsoluteURL(url)){if(subfolder)throw new Error("cannot specify subfolder with remote URL"); +return Promise.resolve(url)}else if(this._HasLocalUrlBlob(url))return Promise.resolve(this.GetLocalUrlAsBlobUrl(url));else if(this._isCordova&&this._isFileProtocol)return this.CordovaFetchLocalFileAsBlobURL(subfolder+url);else return Promise.resolve(subfolder+url.toLowerCase())}GetProjectFileIframeUrl(url){if(C3.IsAbsoluteURL(url))return Promise.resolve(url);else{const queryIndex=url.indexOf("?");const queryStr=queryIndex===-1?"":url.substr(queryIndex);const urlNoSearch=queryIndex===-1?url:url.substr(0, +queryIndex);if(this._HasLocalUrlBlob(urlNoSearch)){let localUrl=this.GetLocalUrlAsBlobUrl(urlNoSearch);if(!localUrl.startsWith("blob:")&&this._swClientId){const asUrl=new URL(localUrl);const params=new URLSearchParams(queryStr);params.set("__c3_client_id",this._swClientId);asUrl.search=params.toString();localUrl=asUrl.toString()}return Promise.resolve(localUrl)}else if(this._isCordova&&this._isFileProtocol)return this.CordovaFetchLocalFileAsBlobURL(urlNoSearch);else return Promise.resolve(url.toLowerCase())}}LoadProjectFileUrl(url){return this.GetProjectFileUrl(url)}LoadImage(opts){if(opts.loadPolicy&& +!VALID_LOAD_POLICIES.has(opts.loadPolicy))throw new Error("invalid load policy");let asset=this._assetsByUrl.get(opts.url);if(asset)return asset;asset=C3.New(C3.ImageAsset,this,{url:opts.url,size:opts.size||0,loadPolicy:opts.loadPolicy||this._defaultLoadPolicy});this._allAssets.push(asset);this._assetsByUrl.set(asset.GetURL(),asset);if(!this._hasFinishedInitialLoad){this._totalAssetSizeToLoad+=asset.GetSize();this._loadPromises.push(asset.Load().then(()=>this._AddLoadedSize(asset.GetSize())))}return asset}async WaitForAllToLoad(){try{await Promise.all(this._loadPromises); +this._lastLoadProgress=1}catch(err){console.error("Error loading: ",err);this._hasHadErrorLoading=true;this._FireLoadingProgressEvent()}}SetInitialLoadFinished(){this._hasFinishedInitialLoad=true}HasHadErrorLoading(){return this._hasHadErrorLoading}_AddLoadedSize(s){this._assetSizeLoaded+=s;this._loadingRateLimiter.Call()}_FireLoadingProgressEvent(){const event=C3.New(C3.Event,"loadingprogress");this._lastLoadProgress=C3.clamp(this._assetSizeLoaded/this._totalAssetSizeToLoad,0,1);event.progress=this._lastLoadProgress; +this._runtime.Dispatcher().dispatchEvent(event)}GetLoadProgress(){return this._lastLoadProgress}_SetWebFonts(arr){C3.shallowAssignArray(this._webFonts,arr);if(this._webFonts.length)this._loadPromises.push(this._LoadWebFonts())}_LoadWebFonts(){if(typeof FontFace==="undefined")return Promise.resolve();const promises=[];for(const [name,filename,size]of this._webFonts){this._totalAssetSizeToLoad+=size;promises.push(this._LoadWebFont(name,filename).then(()=>this._AddLoadedSize(size)))}return Promise.all(promises)}async _LoadWebFont(name, +filename){try{const url=await this.GetProjectFileUrl(filename,this._fontsSubfolder);const fontFace=new FontFace(name,`url('${url}')`);if(this._runtime.IsInWorker())self.fonts.add(fontFace);else document.fonts.add(fontFace);await fontFace.load()}catch(err){console.warn(`[C3 runtime] Failed to load web font '${name}': `,err)}}IsAudioFormatSupported(type){return!!this._supportedAudioFormats[type]}_SetAudioFiles(arr,preloadSounds){this._preloadSounds=!!preloadSounds;for(const [fileName,projectFilesInfo, +isMusic]of arr)this._audioFiles.set(fileName,{fileName,formats:projectFilesInfo.map(si=>({type:si[0],fileExtension:si[1],fullName:fileName+si[1],fileSize:si[2]})),isMusic})}GetPreferredAudioFile(namePart){const info=this._audioFiles.get(namePart.toLowerCase());if(!info)return null;let webMOpusFile=null;for(const formatInfo of info.formats){if(!webMOpusFile&&formatInfo.type==="audio/webm; codecs=opus")webMOpusFile=formatInfo;if(this.IsAudioFormatSupported(formatInfo.type))return formatInfo}return webMOpusFile}GetProjectAudioFileUrl(namePart){const formatInfo= +this.GetPreferredAudioFile(namePart);if(!formatInfo)return null;return{url:this.GetMediaFileUrl(formatInfo.fullName),type:formatInfo.type}}GetAudioToPreload(){if(this._preloadSounds){const ret=[];for(const info of this._audioFiles.values()){if(info.isMusic)continue;const formatInfo=this.GetPreferredAudioFile(info.fileName);if(!formatInfo)continue;ret.push({originalUrl:info.fileName,url:this.GetMediaFileUrl(formatInfo.fullName),type:formatInfo.type,fileSize:formatInfo.fileSize})}return ret}else return[]}GetIAssetManager(){return this._iAssetManager}GetScriptsType(){return this._scriptsType}async LoadScripts(...urls){const scriptUrls= +await Promise.all(urls.map(url=>this.GetProjectFileUrl(url)));if(this._runtime.IsInWorker())if(this._scriptsType==="classic")importScripts(...scriptUrls);else if(urls.length===1){const url=urls[0];await self.c3_import((C3.IsRelativeURL(url)?"./":"")+url)}else{const scriptStr=urls.map(url=>`import "${C3.IsRelativeURL(url)?"./":""}${url}";`).join("\n");const blobUrl=URL.createObjectURL(new Blob([scriptStr],{type:"application/javascript"}));await self.c3_import(blobUrl)}else await Promise.all(scriptUrls.map(url=> +AddScript(url,this._scriptsType)))}async CompileWebAssembly(url){if(WebAssembly.compileStreaming){const fetchUrl=await this.GetProjectFileUrl(url);return await WebAssembly.compileStreaming(fetch(fetchUrl))}else{const arrayBuffer=await C3.FetchArrayBuffer(url);return await WebAssembly.compile(arrayBuffer)}}async LoadStyleSheet(url){const fetchUrl=await this.GetProjectFileUrl(url);return await this._runtime.PostComponentMessageToDOMAsync("runtime","add-stylesheet",{"url":fetchUrl})}}}; + + +// c3/assets/asset.js +'use strict';{const C3=self.C3;C3.Asset=class Asset extends C3.DefendedBase{constructor(assetManager,opts){super();this._assetManager=assetManager;this._runtime=assetManager.GetRuntime();this._url=opts.url;this._size=opts.size;this._loadPolicy=opts.loadPolicy;this._blob=null;this._isLoaded=false;this._loadPromise=null}Release(){this._loadPromise=null;this._assetManager=null;this._runtime=null;this._blob=null}GetURL(){return this._url}GetSize(){return this._size}Load(){if(this._loadPolicy==="local"|| +this._blob){this._isLoaded=true;return Promise.resolve()}if(this._loadPromise)return this._loadPromise;this._loadPromise=this._assetManager.FetchBlob(this._url,this._loadPolicy).then(blob=>{this._isLoaded=true;this._loadPromise=null;this._blob=blob}).catch(err=>console.error("Error loading resource: ",err));return this._loadPromise}IsLoaded(){return this._isLoaded}GetBlob(){if(this._blob)return Promise.resolve(this._blob);return this._assetManager.FetchBlob(this._url,this._loadPolicy)}}}; + + +// c3/assets/imageAsset.js +'use strict';{const C3=self.C3;const promiseThrottle=new C3.PromiseThrottle;const allImageAssets=new Set;C3.ImageAsset=class ImageAsset extends C3.Asset{constructor(assetManager,opts){super(assetManager,opts);this._texturePromise=null;this._webglTexture=null;this._refCount=0;this._imageWidth=-1;this._imageHeight=-1;allImageAssets.add(this)}Release(){this.ReleaseTexture();if(this._refCount!==0)throw new Error("released image asset which still has texture references");this._texturePromise=null;allImageAssets.delete(this); +super.Release()}static OnWebGLContextLost(){for(const imageAsset of allImageAssets){imageAsset._texturePromise=null;imageAsset._webglTexture=null;imageAsset._refCount=0}}LoadStaticTexture(renderer,opts){this._refCount++;if(this._webglTexture)return Promise.resolve(this._webglTexture);if(this._texturePromise)return this._texturePromise;this._texturePromise=this.GetBlob().then(blob=>promiseThrottle.Add(()=>renderer.CreateStaticTextureAsync(blob,opts).then(texture=>{this._texturePromise=null;if(this._refCount=== +0){renderer.DeleteTexture(texture);return null}this._webglTexture=texture;this._imageWidth=texture.GetWidth();this._imageHeight=texture.GetHeight();return this._webglTexture}))).catch(err=>{console.error("Failed to load texture: ",err);throw err;});return this._texturePromise}ReleaseTexture(){if(this._refCount<=0)throw new Error("texture released too many times");this._refCount--;if(this._refCount===0&&this._webglTexture){const renderer=this._webglTexture.GetRenderer();renderer.DeleteTexture(this._webglTexture); +this._webglTexture=null}}GetTexture(){return this._webglTexture}GetWidth(){return this._imageWidth}GetHeight(){return this._imageHeight}async LoadToDrawable(){const blob=await this.GetBlob();if(C3.Supports.ImageBitmapOptions)return await createImageBitmap(blob,{"premultiplyAlpha":"none"});else if(C3.Supports.ImageBitmap)return await createImageBitmap(blob);else return await C3.BlobToImage(blob)}}}; + + +// c3/layouts/renderCell.js +'use strict';{const C3=self.C3;const assert=self.assert;function SortByInstLastCachedZIndex(a,b){return a.GetWorldInfo()._GetLastCachedZIndex()-b.GetWorldInfo()._GetLastCachedZIndex()}C3.RenderCell=class RenderCell extends C3.DefendedBase{constructor(grid,x,y){super();this._grid=grid;this._x=x;this._y=y;this._instances=[];this._isSorted=true;this._pendingRemoval=new Set;this._isAnyPendingRemoval=false}Release(){C3.clearArray(this._instances);this._pendingRemoval.clear();this._grid=null}Reset(){C3.clearArray(this._instances); +this._isSorted=true;this._pendingRemoval.clear();this._isAnyPendingRemoval=false}SetChanged(){this._isSorted=false}IsEmpty(){if(!this._instances.length)return true;if(this._instances.length>this._pendingRemoval.size)return false;this._FlushPending();return true}Insert(inst){if(this._pendingRemoval.has(inst)){this._pendingRemoval.delete(inst);if(this._pendingRemoval.size===0)this._isAnyPendingRemoval=false;return}this._instances.push(inst);this._isSorted=this._instances.length===1}Remove(inst){this._pendingRemoval.add(inst); +this._isAnyPendingRemoval=true;if(this._pendingRemoval.size>=50)this._FlushPending()}_FlushPending(){if(!this._isAnyPendingRemoval)return;if(this._instances.length===this._pendingRemoval.size){this.Reset();return}C3.arrayRemoveAllInSet(this._instances,this._pendingRemoval);this._pendingRemoval.clear();this._isAnyPendingRemoval=false}_EnsureSorted(){if(this._isSorted)return;this._instances.sort(SortByInstLastCachedZIndex);this._isSorted=true}Dump(result){this._FlushPending();this._EnsureSorted();if(this._instances.length)result.push(this._instances)}}}; + + +// c3/layouts/renderGrid.js +'use strict';{const C3=self.C3;C3.RenderGrid=class RenderGrid extends C3.DefendedBase{constructor(cellWidth,cellHeight){super();this._cellWidth=cellWidth;this._cellHeight=cellHeight;this._cells=C3.New(C3.PairMap)}Release(){this._cells.Release();this._cells=null}GetCell(x,y,createIfMissing){let ret=this._cells.Get(x,y);if(ret)return ret;else if(createIfMissing){ret=C3.New(C3.RenderCell,this,x,y);this._cells.Set(x,y,ret);return ret}else return null}XToCell(x){return Math.floor(x/this._cellWidth)}YToCell(y){return Math.floor(y/ +this._cellHeight)}Update(inst,oldRange,newRange){if(oldRange)for(let x=oldRange.getLeft(),lenx=oldRange.getRight();x<=lenx;++x)for(let y=oldRange.getTop(),leny=oldRange.getBottom();y<=leny;++y){if(newRange&&newRange.containsPoint(x,y))continue;const cell=this.GetCell(x,y,false);if(!cell)continue;cell.Remove(inst);if(cell.IsEmpty())this._cells.Delete(x,y)}if(newRange)for(let x=newRange.getLeft(),lenx=newRange.getRight();x<=lenx;++x)for(let y=newRange.getTop(),leny=newRange.getBottom();y<=leny;++y){if(oldRange&& +oldRange.containsPoint(x,y))continue;this.GetCell(x,y,true).Insert(inst)}}QueryRange(rc,result){let x=this.XToCell(rc.getLeft());const ystart=this.YToCell(rc.getTop());const lenx=this.XToCell(rc.getRight());const leny=this.YToCell(rc.getBottom());for(;x<=lenx;++x)for(let y=ystart;y<=leny;++y){const cell=this.GetCell(x,y,false);if(!cell)continue;cell.Dump(result)}}MarkRangeChanged(rc){let x=rc.getLeft();const ystart=rc.getTop();const lenx=rc.getRight();const leny=rc.getBottom();for(;x<=lenx;++x)for(let y= +ystart;y<=leny;++y){const cell=this.GetCell(x,y,false);if(!cell)continue;cell.SetChanged()}}}}; + + +// c3/layouts/layer.js +'use strict';{const C3=self.C3;const tmpRect=new C3.Rect;const tmpQuad=new C3.Quad;const renderCellArr=[];const tmpDestRect=new C3.Rect;const tmpSrcRect=new C3.Rect;const glMatrix=self.glMatrix;const vec3=glMatrix.vec3;const tempVec3=vec3.fromValues(0,1,0);function SortByInstLastCachedZIndex(a,b){return a.GetWorldInfo()._GetLastCachedZIndex()-b.GetWorldInfo()._GetLastCachedZIndex()}function SortByInstZElevation(a,b){return a.GetWorldInfo().GetZElevation()-b.GetWorldInfo().GetZElevation()}C3.Layer= +class Layer extends C3.DefendedBase{constructor(layout,index,data){super();this._layout=layout;this._runtime=layout.GetRuntime();this._name=data[0];this._index=index;this._sid=data[2];this._isVisible=!!data[3];this._backgroundColor=C3.New(C3.Color);this._backgroundColor.setFromJSON(data[4].map(x=>x/255));this._isTransparent=!!data[5];this._parallaxX=data[6];this._parallaxY=data[7];this._color=C3.New(C3.Color,1,1,1,data[8]);this._premultipliedColor=C3.New(C3.Color);this._isForceOwnTexture=data[9]; +this._useRenderCells=data[10];this._scaleRate=data[11];this._blendMode=data[12];this._curRenderTarget=null;this._scale=1;this._zElevation=data[16];this._angle=0;this._isAngleEnabled=true;this._viewport=C3.New(C3.Rect);this._viewportZ0=C3.New(C3.Rect);this._startupInitialInstances=[];this._initialInstances=[];this._createdGlobalUids=[];this._initialUIDsToInstanceData=new Map;this._instances=[];this._zIndicesUpToDate=false;this._anyInstanceZElevated=false;this._effectList=C3.New(C3.EffectList,this, +data[15]);this._renderGrid=null;this._lastRenderList=[];this._isRenderListUpToDate=false;this._lastRenderCells=C3.New(C3.Rect,0,0,-1,-1);this._curRenderCells=C3.New(C3.Rect,0,0,-1,-1);this._iLayer=new self.ILayer(this);this._UpdatePremultipliedColor();if(this._useRenderCells)this._renderGrid=C3.New(C3.RenderGrid,this._runtime.GetOriginalViewportWidth(),this._runtime.GetOriginalViewportHeight());for(const instData of data[14]){const objectClass=this._runtime.GetObjectClassByIndex(instData[1]);this._layout._AddInitialObjectClass(objectClass); +if(!objectClass.GetDefaultInstanceData()){objectClass.SetDefaultInstanceData(instData);objectClass._SetDefaultLayerIndex(this._index)}this._initialInstances.push(instData);this._initialUIDsToInstanceData.set(instData[2],instData)}C3.shallowAssignArray(this._startupInitialInstances,this._initialInstances)}static Create(layout,index,data){return C3.New(C3.Layer,layout,index,data)}Release(){this._layout=null;this._runtime=null}GetInitialInstanceData(uid){return this._initialUIDsToInstanceData.get(uid)}CreateInitialInstances(createdInstances){const isFirstVisit= +this._layout.IsFirstVisit();let k=0;const initialInstances=this._initialInstances;for(let i=0,len=initialInstances.length;i=0)assignedZIndices.add(cachedZIndex)}let index=-1;for(const inst of this._instances){const wi=inst.GetWorldInfo();if(wi._GetLastCachedZIndex()>=0)continue;++index;while(assignedZIndices.has(index))++index;wi._SetZIndex(index)}}this._instances.sort(SortByInstLastCachedZIndex)}_Start(){}_End(){for(const inst of this._instances)if(!inst.GetObjectClass().IsGlobal())this._runtime.DestroyInstance(inst);this._runtime.FlushPendingInstances();C3.clearArray(this._instances); +this._anyInstanceZElevated=false;this.SetZIndicesChanged()}RecreateInitialObjects(objectClass,rc,offsetX,offsetY,createHierarchy){const eventSheetManager=this._runtime.GetEventSheetManager();const allObjectClasses=this._runtime.GetAllObjectClasses();const isFamily=objectClass.IsFamily();const ret=[];for(const instData of this._initialInstances){const worldData=instData[0];const x=worldData[0];const y=worldData[1];if(!rc.containsPoint(x,y))continue;const objectType=allObjectClasses[instData[1]];if(objectType!== +objectClass)if(isFamily){if(!objectClass.FamilyHasMember(objectType))continue}else continue;let createOnLayer=this;const runningLayout=this._runtime.GetCurrentLayout();if(this.GetLayout()!==runningLayout){createOnLayer=runningLayout.GetLayerByName(this.GetName());if(!createOnLayer)createOnLayer=runningLayout.GetLayerByIndex(this.GetIndex())}const inst=this._runtime.CreateInstanceFromData(instData,createOnLayer,false,undefined,undefined,false,createHierarchy);createOnLayer.SortAndAddSceneGraphInstancesByZIndex(inst); +const wi=inst.GetWorldInfo();wi.OffsetXY(offsetX,offsetY);wi.SetBboxChanged();eventSheetManager.BlockFlushingInstances(true);inst._TriggerOnCreatedOnSelfAndRelated();eventSheetManager.BlockFlushingInstances(false);ret.push(inst)}return ret}GetInstanceCount(){return this._instances.length}GetLayout(){return this._layout}GetName(){return this._name}GetIndex(){return this._index}GetSID(){return this._sid}GetRuntime(){return this._runtime}GetDevicePixelRatio(){return this._runtime.GetDevicePixelRatio()}GetEffectList(){return this._effectList}UsesRenderCells(){return this._useRenderCells}GetRenderGrid(){return this._renderGrid}SetRenderListStale(){this._isRenderListUpToDate= +false}IsVisible(){return this._isVisible}SetVisible(v){v=!!v;if(this._isVisible===v)return;this._isVisible=v;this._runtime.UpdateRender()}GetViewport(){return this._viewport}GetViewportForZ(z,outRect){const viewportZ0=this._viewportZ0;if(z===0)outRect.copy(viewportZ0);else{const scaleFactor=this.Get2DScaleFactorToZ(z);const midX=viewportZ0.midX();const midY=viewportZ0.midY();const halfW=.5*viewportZ0.width()/scaleFactor;const halfH=.5*viewportZ0.height()/scaleFactor;outRect.set(midX-halfW,midY-halfH, +midX+halfW,midY+halfH)}}GetOpacity(){return this._color.getA()}SetOpacity(o){o=C3.clamp(o,0,1);if(this._color.getA()===o)return;this._color.setA(o);this._UpdatePremultipliedColor();this._runtime.UpdateRender()}_UpdatePremultipliedColor(){this._premultipliedColor.copy(this._color);this._premultipliedColor.premultiply()}GetPremultipliedColor(){return this._premultipliedColor}HasDefaultColor(){return this._color.equalsRgba(1,1,1,1)}GetScaleRate(){return this._scaleRate}SetScaleRate(r){if(this._scaleRate=== +r)return;this._scaleRate=r;this._runtime.UpdateRender()}GetParallaxX(){return this._parallaxX}GetParallaxY(){return this._parallaxY}SetParallax(px,py){if(this._parallaxX===px&&this._parallaxY===py)return;this._parallaxX=px;this._parallaxY=py;this._runtime.UpdateRender();if(this._parallaxX!==1||this._parallaxY!==1)for(const inst of this._instances)inst.GetObjectClass()._SetAnyInstanceParallaxed(true)}SetParallaxX(px){this.SetParallax(px,this.GetParallaxY())}SetParallaxY(py){this.SetParallax(this.GetParallaxX(), +py)}SetZElevation(z){z=+z;if(this._zElevation===z)return;this._zElevation=z;this._runtime.UpdateRender()}GetZElevation(){return this._zElevation}SetAngle(a){this._angle=C3.clampAngle(a)}GetAngle(){if(this._isAngleEnabled)return C3.clampAngle(this._layout.GetAngle()+this._angle);else return 0}GetOwnAngle(){return this._angle}HasInstances(){return this._instances.length>0}_GetInstances(){return this._instances}GetBackgroundColor(){return this._backgroundColor}IsTransparent(){return this._isTransparent}SetTransparent(t){this._isTransparent= +!!t}IsForceOwnTexture(){return this._isForceOwnTexture}SetForceOwnTexture(f){this._isForceOwnTexture=!!f}SetBlendMode(bm){if(this._blendMode===bm)return;this._blendMode=bm;this._runtime.UpdateRender()}GetBlendMode(){return this._blendMode}IsTransformCompatibleWith(otherLayer){return this===otherLayer||this._parallaxX===otherLayer._parallaxX&&this._parallaxY===otherLayer._parallaxY&&this._scale===otherLayer._scale&&this._scaleRate===otherLayer._scaleRate&&this._angle===otherLayer._angle}_RemoveAllInstancesInSet(s){if(s.size=== +0)return;const numRemoved=C3.arrayRemoveAllInSet(this._instances,s);if(numRemoved>0){this._MaybeResetAnyInstanceZElevatedFlag();this.SetZIndicesChanged()}}SetZIndicesChanged(){this._zIndicesUpToDate=false;this._isRenderListUpToDate=false}_UpdateZIndices(){if(this._zIndicesUpToDate)return;this._instances.sort(SortByInstZElevation);if(this._useRenderCells)for(let i=0,len=this._instances.length;i1)arr=this._MergeAllSortedZArrays_pass(arr);return arr[0]}_GetRenderCellInstancesToDraw(){this._UpdateZIndices();C3.clearArray(renderCellArr);this._renderGrid.QueryRange(this._viewport,renderCellArr);if(!renderCellArr.length)return[];if(renderCellArr.length===1)return renderCellArr[0]; +return this._MergeAllSortedZArrays(renderCellArr)}_IsOpaque(){return!this.UsesOwnTexture()&&!this.IsTransparent()}ShouldDraw(){return this.IsVisible()&&this.GetOpacity()>0&&(this.HasInstances()||!this.IsTransparent())}UsesOwnTexture(){return this.IsForceOwnTexture()||!this.HasDefaultColor()||this.GetBlendMode()!==0||this._effectList.HasAnyActiveEffect()}GetRenderTarget(){return this._curRenderTarget}_CanFastPathDrawLayer(activeEffectTypes){if(activeEffectTypes.length===0)return true;if(activeEffectTypes.length>= +2)return false;const effectType=activeEffectTypes[0];const shaderProgram=effectType.GetShaderProgram();return!shaderProgram.MustPreDraw()&&!shaderProgram.UsesDest()&&!shaderProgram.UsesCrossSampling()&&this.HasDefaultColor()}Get2DScaleFactorToZ(z){const camZ=this.GetCameraZ();return camZ/(camZ-z)}GetCameraZ(){return 100/this.GetNormalScale()}_SetTransform(renderer,offX=0,offY=0){const renderScale=this._runtime.GetRenderScale();const camX=(this._viewport.midX()+offX)*renderScale;const camY=(this._viewport.midY()+ +offY)*renderScale;const camZ=this.GetCameraZ();renderer.SetCameraXYZ(camX,camY,camZ);renderer.SetLookXYZ(camX,camY,camZ-100);const a=this.GetAngle();const upVector=tempVec3;if(a===0)vec3.set(upVector,0,1,0);else vec3.set(upVector,Math.sin(a),Math.cos(a),0);renderer.ResetModelView(upVector);renderer.Scale(renderScale,renderScale);renderer.UpdateModelView()}Draw(renderer,destinationRenderTarget,isFirstDrawnLayer){const canvasManager=this._runtime.GetCanvasManager();const useOwnTexture=this.UsesOwnTexture(); +let ownRenderTarget=null;let layerQuery=null;if(this._runtime.IsGPUProfiling()&&renderer.SupportsGPUProfiling()){const timingsBuffer=canvasManager.GetLayerTimingsBuffer(this);if(timingsBuffer){layerQuery=timingsBuffer.AddTimeElapsedQuery();renderer.StartQuery(layerQuery)}}if(useOwnTexture){const rtOpts={sampling:this._runtime.GetSampling()};if(canvasManager.GetCurrentFullscreenScalingQuality()==="low"){rtOpts.width=canvasManager.GetDrawWidth();rtOpts.height=canvasManager.GetDrawHeight()}ownRenderTarget= +this._runtime.GetAdditionalRenderTarget(rtOpts);renderer.SetRenderTarget(ownRenderTarget);if(this.IsTransparent())renderer.ClearRgba(0,0,0,0)}else renderer.SetRenderTarget(destinationRenderTarget);if(!this.IsTransparent())renderer.Clear(this._backgroundColor);this._curRenderTarget=ownRenderTarget||destinationRenderTarget;this._SetTransform(renderer);renderer.SetBaseZ(this.GetZElevation());if(this.GetNormalScale()>Number.EPSILON){this._UpdateZIndices();const useRenderCells=this._useRenderCells&&this.GetZElevation()=== +0&&!this._anyInstanceZElevated;if(useRenderCells)this._DrawInstances_RenderCells(renderer);else this._DrawInstances(renderer,this._instances)}renderer.SetBaseZ(0);renderer.SetCurrentZ(0);renderer.SetCameraXYZ(0,0,100);renderer.SetLookXYZ(0,0,0);if(useOwnTexture)this._DrawLayerOwnTextureToRenderTarget(renderer,ownRenderTarget,destinationRenderTarget,isFirstDrawnLayer);if(layerQuery)renderer.EndQuery(layerQuery);this._curRenderTarget=null}_DrawInstances(renderer,instances){const viewport=this._viewport; +const renderTarget=this._curRenderTarget;let lastInst=null;for(let i=0,len=instances.length;i{const firstZIndex=f.GetWorldInfo().GetSceneGraphZIndex();const secondZIndex=s.GetWorldInfo().GetSceneGraphZIndex();return firstZIndex-secondZIndex});for(const instance of instances)this._AddInstance(instance,true)}else this._AddInstance(inst,true)}}}; + + +// c3/layouts/layout.js +'use strict';{const C3=self.C3;const C3Debugger=self.C3Debugger;const assert=self.assert;const tempDestRect=C3.New(C3.Rect);const tempSrcRect=C3.New(C3.Rect);const tempLayoutRect=C3.New(C3.Rect);C3.Layout=class Layout extends C3.DefendedBase{constructor(layoutManager,index,data){super();this._layoutManager=layoutManager;this._runtime=layoutManager.GetRuntime();this._name=data[0];this._originalWidth=data[1];this._originalHeight=data[2];this._width=data[1];this._height=data[2];this._isUnboundedScrolling= +!!data[3];this._eventSheetName=data[4];this._eventSheet=null;this._sid=data[5];this._index=index;this._scrollX=0;this._scrollY=0;this._scale=1;this._angle=0;this._initialObjectClasses=new Set;this._textureLoadedTypes=new Set;this._textureLoadPendingPromises=new Set;this._createdInstances=[];this._initialNonWorld=[];this._layers=[];this._layersByName=new Map;this._layersBySid=new Map;this._effectList=C3.New(C3.EffectList,this,data[8]);this._curRenderTarget=null;this._persistData={};this._isFirstVisit= +true;this._iLayout=new self.ILayout(this);this._userScriptDispatcher=C3.New(C3.Event.Dispatcher);for(const layerData of data[6]){const layer=C3.Layer.Create(this,this._layers.length,layerData);this._layers.push(layer);this._layersByName.set(layer.GetName().toLowerCase(),layer);this._layersBySid.set(layer.GetSID(),layer)}for(const instData of data[7]){const objectClass=this._runtime.GetObjectClassByIndex(instData[1]);if(!objectClass)throw new Error("missing nonworld object class");if(!objectClass.GetDefaultInstanceData())objectClass.SetDefaultInstanceData(instData); +this._initialNonWorld.push(instData);this._AddInitialObjectClass(objectClass)}}Release(){for(const l of this._layers)l.Release();C3.clearArray(this._layers);this._textureLoadPendingPromises.clear();this._eventSheet=null;this._layoutManager=null;this._runtime=null}GetRuntime(){return this._runtime}GetName(){return this._name}GetSID(){return this._sid}GetIndex(){return this._index}GetEffectList(){return this._effectList}GetMinLayerScale(){let m=this._layers[0].GetNormalScale();for(let i=1,len=this._layers.length;i< +len;++i){const layer=this._layers[i];if(layer.GetParallaxX()===0&&layer.GetParallaxY()===0)continue;m=Math.min(m,layer.GetNormalScale())}return m}SetScrollX(x){if(!this._isUnboundedScrolling){const widthBoundary=this._runtime.GetViewportWidth()*(1/this.GetMinLayerScale())/2;if(x>this._width-widthBoundary)x=this._width-widthBoundary;if(xthis._height-heightBoundary)y=this._height-heightBoundary;if(ythis._textureLoadPendingPromises.delete(promise)).catch(()=> +this._textureLoadPendingPromises.delete(promise))}WaitForPendingTextureLoadsToComplete(){return Promise.all([...this._textureLoadPendingPromises])}MaybeUnloadTexturesFor(objectClass){if(objectClass.IsFamily()||objectClass.GetInstanceCount()>0)throw new Error("cannot unload textures");const renderer=this._runtime.GetWebGLRenderer();if(!renderer||!this._textureLoadedTypes.has(objectClass))return;this._textureLoadedTypes.delete(objectClass);objectClass.ReleaseTextures(renderer)}_Unload(nextLayout,renderer){if(nextLayout=== +this||!renderer)return;for(const oc of this._textureLoadedTypes)if(!oc.IsGlobal()&&!nextLayout._initialObjectClasses.has(oc)){oc.ReleaseTextures();this._textureLoadedTypes.delete(oc)}}_OnWebGLContextLost(){this._textureLoadedTypes.clear()}async _StartRunning(isFirstLayout){const runtime=this._runtime;const layoutManager=this._layoutManager;const eventSheetManager=runtime.GetEventSheetManager();if(this._eventSheetName){this._eventSheet=eventSheetManager.GetEventSheetByName(this._eventSheetName);this._eventSheet._UpdateDeepIncludes()}layoutManager._SetMainRunningLayout(this); +this._width=this._originalWidth;this._height=this._originalHeight;this._scrollX=runtime.GetOriginalViewportWidth()/2;this._scrollY=runtime.GetOriginalViewportHeight()/2;this.BoundScrolling();this._MoveGlobalObjectsToThisLayout(isFirstLayout);this._runtime.SetUsingCreatePromises(true);this._CreateInitialInstances();if(!this._isFirstVisit)this._CreatePersistedInstances();this._CreateAndLinkContainerInstances(this._createdInstances);this._CreateInitialNonWorldInstances();layoutManager.ClearPendingChangeLayout(); +runtime.FlushPendingInstances();this._runtime.SetUsingCreatePromises(false);const createPromises=this._runtime.GetCreatePromises();await Promise.all(createPromises);C3.clearArray(createPromises);if(!runtime.IsLoadingState()){for(const inst of this._createdInstances)inst.SetupInitialSceneGraphConnections();for(const inst of this._createdInstances)inst._TriggerOnCreated()}C3.clearArray(this._createdInstances);await Promise.all([...this._initialObjectClasses].map(oc=>oc.PreloadTexturesWithInstances(this._runtime.GetWebGLRenderer()))); +if(isFirstLayout){runtime.Dispatcher().dispatchEvent(new C3.Event("beforefirstlayoutstart"));await runtime.DispatchUserScriptEventAsyncWait(new C3.Event("beforeprojectstart"))}await this.DispatchUserScriptEventAsyncWait(new C3.Event("beforelayoutstart"));if(!runtime.IsLoadingState())await runtime.TriggerAsync(C3.Plugins.System.Cnds.OnLayoutStart,null,null);await this.DispatchUserScriptEventAsyncWait(new C3.Event("afterlayoutstart"));if(isFirstLayout){runtime.Dispatcher().dispatchEvent(new C3.Event("afterfirstlayoutstart")); +await runtime.DispatchUserScriptEventAsyncWait(new C3.Event("afterprojectstart"))}eventSheetManager._RunQueuedTriggers(layoutManager);await this.WaitForPendingTextureLoadsToComplete();this._isFirstVisit=false}_MoveGlobalObjectsToThisLayout(isFirstLayout){for(const objectClass of this._runtime.GetAllObjectClasses()){if(objectClass.IsFamily()||!objectClass.IsWorldType())continue;for(const inst of objectClass.GetInstances()){const wi=inst.GetWorldInfo();const oldLayer=wi.GetLayer();const layerIndex= +C3.clamp(oldLayer.GetIndex(),0,this._layers.length-1);const newLayer=this._layers[layerIndex];wi._SetLayer(newLayer);newLayer._MaybeAddInstance(inst)}}if(!isFirstLayout)for(const layer of this._layers)layer._SortInstancesByLastCachedZIndex(false)}_CreateInitialInstances(){for(const layer of this._layers){layer.CreateInitialInstances(this._createdInstances);layer.UpdateViewport();layer._Start()}}_CreatePersistedInstances(){let uidsChanged=false;for(const [sidStr,typeData]of Object.entries(this._persistData)){const objectClass= +this._runtime.GetObjectClassBySID(parseInt(sidStr,10));if(!objectClass||objectClass.IsFamily()||!objectClass.HasPersistBehavior())continue;for(const instData of typeData){let layer=null;if(objectClass.IsWorldType()){layer=this.GetLayerBySID(instData["w"]["l"]);if(!layer)continue}const inst=this._runtime.CreateInstanceFromData(objectClass,layer,false,0,0,true);inst.LoadFromJson(instData);uidsChanged=true;this._createdInstances.push(inst)}C3.clearArray(typeData)}for(const layer of this._layers){layer._SortInstancesByLastCachedZIndex(true); +layer.SetZIndicesChanged()}if(uidsChanged){this._runtime.FlushPendingInstances();this._runtime._RefreshUidMap()}}_CreateAndLinkContainerInstances(createdInstances){for(const inst of createdInstances){if(!inst.IsInContainer())continue;const wi=inst.GetWorldInfo();const iid=inst.GetIID();for(const containerType of inst.GetObjectClass().GetContainer().objectTypes()){if(containerType===inst.GetObjectClass())continue;const instances=containerType.GetInstances();if(instances.length>iid)inst._AddSibling(instances[iid]); +else{let s;if(wi)s=this._runtime.CreateInstanceFromData(containerType,wi.GetLayer(),true,wi.GetX(),wi.GetY(),true);else s=this._runtime.CreateInstanceFromData(containerType,null,true,0,0,true);this._runtime.FlushPendingInstances();containerType._UpdateIIDs();inst._AddSibling(s);createdInstances.push(s)}}}}_CreateInitialNonWorldInstances(){for(const instData of this._initialNonWorld){const objectClass=this._runtime.GetObjectClassByIndex(instData[1]);if(!objectClass.IsInContainer())this._runtime.CreateInstanceFromData(instData, +null,true)}}_CreateGlobalNonWorlds(){const createdInstances=[];const initialNonWorld=this._initialNonWorld;let k=0;for(let i=0,len=initialNonWorld.length;i=2)return false;const effectType=activeEffectTypes[0];const shaderProgram=effectType.GetShaderProgram();return!shaderProgram.MustPreDraw()}Draw(renderer){const canvasManager=this._runtime.GetCanvasManager();const useOwnTexture=this.UsesOwnTexture();let ownRenderTarget=null;if(useOwnTexture){if(this._runtime.GetCompositingMode()!=="low-latency"){renderer.SetRenderTarget(null);renderer.ClearRgba(0,0,0,0)}const rtOpts={sampling:this._runtime.GetSampling(),readback:this._runtime.UsesAnyBackgroundBlending()|| +this._effectList.HasAnyActiveEffect()};if(canvasManager.GetCurrentFullscreenScalingQuality()==="low"){rtOpts.width=canvasManager.GetDrawWidth();rtOpts.height=canvasManager.GetDrawHeight()}ownRenderTarget=this._runtime.GetAdditionalRenderTarget(rtOpts);renderer.SetRenderTarget(ownRenderTarget)}else renderer.SetRenderTarget(null);if(!this.HasOpaqueBottomLayer())renderer.ClearRgba(0,0,0,0);this._curRenderTarget=ownRenderTarget;let isFirstDrawnLayer=true;for(const layer of this._layers){layer.UpdateViewport(); +if(layer.ShouldDraw()){layer.Draw(renderer,ownRenderTarget,isFirstDrawnLayer);isFirstDrawnLayer=false}}if(useOwnTexture)this._DrawLayoutOwnTextureToRenderTarget(renderer,ownRenderTarget);this._curRenderTarget=null}_DrawLayoutOwnTextureToRenderTarget(renderer,ownRenderTarget){const activeEffectTypes=this._effectList.GetActiveEffectTypes();const runtime=this._runtime;if(this._CanFastPathDrawLayout(activeEffectTypes)){renderer.SetRenderTarget(null);if(activeEffectTypes.length===1){const effectType=activeEffectTypes[0]; +const shaderProgram=effectType.GetShaderProgram();renderer.SetProgram(shaderProgram);tempSrcRect.set(0,0,1,1);tempLayoutRect.set(0,0,runtime.GetViewportWidth(),runtime.GetViewportHeight());const paramArr=this._effectList.GetEffectParametersForIndex(effectType.GetIndex());renderer.SetProgramParameters(null,tempDestRect,tempSrcRect,tempSrcRect,tempLayoutRect,1/runtime.GetDrawWidth(),1/runtime.GetDrawHeight(),this.GetScale(),this.GetAngle(),runtime.GetGameTime(),paramArr);if(shaderProgram.IsAnimated())runtime.UpdateRender()}else renderer.SetTextureFillMode(); +if(activeEffectTypes.length===0)renderer.CopyRenderTarget(ownRenderTarget);else{renderer.SetAlphaBlend();renderer.ResetColor();renderer.DrawRenderTarget(ownRenderTarget)}renderer.InvalidateRenderTarget(ownRenderTarget);runtime.ReleaseAdditionalRenderTarget(ownRenderTarget)}else C3.RenderEffectChain(renderer,runtime,this,null,activeEffectTypes)}_SaveToJson(){const o={"sx":this.GetScrollX(),"sy":this.GetScrollY(),"s":this.GetScale(),"a":this.GetAngle(),"w":this.GetWidth(),"h":this.GetHeight(),"fv":this._isFirstVisit, +"persist":this._persistData,"fx":this._effectList.SaveToJson(),"layers":{}};for(const layer of this._layers)o["layers"][layer.GetSID().toString()]=layer._SaveToJson();return o}_LoadFromJson(o){this._scrollX=o["sx"];this._scrollY=o["sy"];this._scale=o["s"];this._angle=o["a"];this._width=o["w"];this._height=o["h"];this._isFirstVisit=!!o["fv"];this._persistData=o["persist"];this._effectList.LoadFromJson(o["fx"]);for(const [sidStr,data]of Object.entries(o["layers"])){const sid=parseInt(sidStr,10);const layer= +this.GetLayerBySID(sid);if(!layer)continue;layer._LoadFromJson(data)}}GetILayout(){return this._iLayout}UserScriptDispatcher(){return this._userScriptDispatcher}DispatchUserScriptEvent(e){e.layout=this.GetILayout();const runtime=this._runtime;const shouldTime=runtime.IsDebug()&&!runtime.GetEventSheetManager().IsInEventEngine();if(shouldTime)C3Debugger.StartMeasuringScriptTime();this._userScriptDispatcher.dispatchEvent(e);if(shouldTime)C3Debugger.AddScriptTime()}DispatchUserScriptEventAsyncWait(e){e.layout= +this.GetILayout();return this._userScriptDispatcher.dispatchEventAndWaitAsync(e)}}}; + + +// c3/layouts/layoutManager.js +'use strict';{const C3=self.C3;C3.LayoutManager=class LayoutManager extends C3.DefendedBase{constructor(runtime){super();this._runtime=runtime;this._allLayouts=[];this._layoutsByName=new Map;this._layoutsBySid=new Map;this._mainRunningLayout=null;this._runningSubLayouts=[];this._firstLayout=null;this._isEndingLayout=0;this._pendingChangeLayout=null}Release(){this._runtime=null;this._mainRunningLayout=null;this._firstLayout=null;this._pendingChangeLayout=null;C3.clearArray(this._allLayouts);this._layoutsByName.clear(); +this._layoutsBySid.clear();C3.clearArray(this._runningSubLayouts)}Create(layoutData){const layout=C3.New(C3.Layout,this,this._allLayouts.length,layoutData);this._allLayouts.push(layout);this._layoutsByName.set(layout.GetName().toLowerCase(),layout);this._layoutsBySid.set(layout.GetSID(),layout)}GetRuntime(){return this._runtime}SetFirstLayout(layout){this._firstLayout=layout}GetFirstLayout(){if(this._firstLayout)return this._firstLayout;if(this._allLayouts.length)return this._allLayouts[0];throw new Error("no first layout"); +}GetLayoutByName(name){return this._layoutsByName.get(name.toLowerCase())||null}GetLayoutBySID(sid){return this._layoutsBySid.get(sid)||null}GetLayoutByIndex(index){index=C3.clamp(Math.floor(index),0,this._allLayouts.length-1);return this._allLayouts[index]}GetLayout(p){if(typeof p==="number")return this.GetLayoutByIndex(p);else return this.GetLayoutByName(p.toString())}GetAllLayouts(){return this._allLayouts}_SetMainRunningLayout(layout){this._mainRunningLayout=layout}GetMainRunningLayout(){return this._mainRunningLayout}_AddRunningSubLayout(layout){if(this._runningSubLayouts.includes(layout))throw new Error("layout already running"); +this._runningSubLayouts.push(layout)}_RemoveRunningSubLayout(layout){const i=this._runningSubLayouts.indexOf(layout);if(i===-1)throw new Error("layout not running");this._runningSubLayouts.splice(i,1)}*runningLayouts(){if(this._mainRunningLayout)yield this._mainRunningLayout;if(this._runningSubLayouts.length)yield*this._runningSubLayouts}IsLayoutRunning(layout){return this._mainRunningLayout===layout||this._runningSubLayouts.includes(layout)}SetIsEndingLayout(e){if(e)this._isEndingLayout++;else{if(this._isEndingLayout<= +0)throw new Error("already unset");this._isEndingLayout--}}IsEndingLayout(){return this._isEndingLayout>0}ChangeMainLayout(layout){this._pendingChangeLayout=layout}ClearPendingChangeLayout(){this._pendingChangeLayout=null}IsPendingChangeMainLayout(){return!!this._pendingChangeLayout}GetPendingChangeMainLayout(){return this._pendingChangeLayout}}}; + + +// c3/layouts/renderEffectChain.js +'use strict';{const C3=self.C3;class RenderEffectChainState{constructor(){this.renderer=null;this.runtime=null;this.drawWidth=0;this.drawHeight=0;this.surfaceWidth=0;this.surfaceHeight=0;this.layoutRect=new C3.Rect;this.rcTexBounce=new C3.Rect;this.rcTexDest=new C3.Rect;this.rcTexOrigin=new C3.Rect;this.screenRect=new C3.Rect;this.clearRect=new C3.Rect;this.srcRect=new C3.Rect;this.fxTex=[null,null];this.fxIndex=0;this.otherFxIndex=1;this.boxExtendHorizontal=0;this.boxExtendVertical=0;this.layerScale= +0;this.layerAngle=0;this.layout=null;this.layer=null;this.inst=null;this.wi=null;this.renderTarget=null;this.preDraw=false;this.postDraw=false;this.didChangeTransform=false;this.opts=null}Clear(){this.renderer=null;this.runtime=null;this.layout=null;this.layer=null;this.inst=null;this.wi=null;this.renderTarget=null;this.opts=null}ShouldPreDraw(firstEffectType){const shaderProgram=firstEffectType.GetShaderProgram();if(shaderProgram.MustPreDraw())return true;if(this.inst)return shaderProgram.UsesDest()&& +(this.wi.GetAngle()!==0||this.wi.GetWidth()<0||this.wi.GetHeight()<0)||this.boxExtendHorizontal!==0||this.boxExtendVertical!==0||!this.wi.HasDefaultColor()||this.inst.MustPreDraw();else if(this.layer)return!this.layer.HasDefaultColor()}ShouldPostDraw(lastEffectType){const shaderProgram=lastEffectType.GetShaderProgram();return shaderProgram.UsesDest()||shaderProgram.UsesCrossSampling()||this.layout&&this.runtime.GetCanvasManager().GetCurrentFullscreenScalingQuality()==="low"}GetEffectRenderTarget(i){if(i!== +0&&i!==1)throw new Error("invalid effect target");const fxTex=this.fxTex;if(!fxTex[i]){const runtime=this.runtime;const canvasManager=runtime.GetCanvasManager();const opts={sampling:runtime.GetSampling()};if(canvasManager.GetCurrentFullscreenScalingQuality()==="low"){opts.width=canvasManager.GetDrawWidth();opts.height=canvasManager.GetDrawHeight()}fxTex[i]=canvasManager.GetAdditionalRenderTarget(opts)}return fxTex[i]}ReleaseEffectRenderTargets(){const fxTex=this.fxTex;const canvasManager=this.runtime.GetCanvasManager(); +if(fxTex[0]){canvasManager.ReleaseAdditionalRenderTarget(fxTex[0]);fxTex[0]=null}if(fxTex[1]){canvasManager.ReleaseAdditionalRenderTarget(fxTex[1]);fxTex[1]=null}}}const ctxStack=[];let ctxPtr=0;function AllocRenderEffectChainState(){if(ctxPtr===ctxStack.length)ctxStack.push(new RenderEffectChainState);return ctxStack[ctxPtr++]}function ReleaseRenderEffectChainState(ctx){ctx.ReleaseEffectRenderTargets();ctx.Clear();ctxPtr--}const tempQuad=new C3.Quad;let isDebug=false;let isDebugFrame=false;async function DebugLogRenderTargetContents(msg, +renderer,renderTarget){const blob=await C3.Gfx.WebGLRenderTarget.DebugReadPixelsToBlob(renderer,renderTarget);const blobUrl=URL.createObjectURL(blob);console.log("[FX] "+msg+" "+(renderTarget?"":" [to display]")+": ",blobUrl)}C3.RenderEffectChain=function RenderEffectChain(renderer,runtime,effectsObject,renderTarget_,activeEffectTypes,opts_){const ctx=AllocRenderEffectChainState();ctx.renderer=renderer;ctx.runtime=runtime;if(effectsObject instanceof C3.Instance){ctx.inst=effectsObject;ctx.wi=ctx.inst.GetWorldInfo()}else if(effectsObject instanceof +C3.Layer)ctx.layer=effectsObject;else if(effectsObject instanceof C3.Layout)ctx.layout=effectsObject;else throw new Error("invalid effects object");const canvasManager=runtime.GetCanvasManager();ctx.renderTarget=renderTarget_;ctx.drawWidth=canvasManager.GetDrawWidth();ctx.drawHeight=canvasManager.GetDrawHeight();ctx.surfaceWidth=ctx.drawWidth;ctx.surfaceHeight=ctx.drawHeight;ctx.fxIndex=0;ctx.otherFxIndex=1;ctx.boxExtendHorizontal=0;ctx.boxExtendVertical=0;ctx.screenRect.set(0,0,ctx.drawWidth,ctx.drawHeight); +ctx.clearRect.set(0,0,ctx.drawWidth,ctx.drawHeight);ctx.didChangeTransform=false;ctx.opts=opts_;if(ctx.inst){const wi=ctx.wi;ctx.layerScale=wi.GetLayer().GetRenderScale();ctx.layerAngle=wi.GetLayer().GetAngle();ctx.layoutRect.copy(wi.GetBoundingBox())}else if(ctx.layer){const layer=ctx.layer;ctx.layerScale=layer.GetRenderScale();ctx.layerAngle=layer.GetAngle();ctx.layoutRect.copy(layer.GetViewport())}else{const layout=ctx.layout;ctx.layerScale=layout.GetScale();ctx.layerAngle=layout.GetAngle();ctx.layoutRect.set(0, +0,ctx.drawWidth,ctx.drawHeight)}if(ctx.inst)GetInstanceBox(ctx,activeEffectTypes);else{ctx.rcTexBounce.set(0,0,ctx.drawWidth/ctx.surfaceWidth,ctx.drawHeight/ctx.surfaceHeight);ctx.rcTexDest.copy(ctx.rcTexBounce);ctx.rcTexOrigin.copy(ctx.rcTexBounce);ctx.rcTexBounce.swapTopBottom();ctx.rcTexDest.swapTopBottom();ctx.rcTexOrigin.swapTopBottom()}renderer.SetAlphaBlend();renderer.ResetColor();renderer.SetBaseZ(0);renderer.SetCurrentZ(0);ctx.preDraw=ctx.ShouldPreDraw(activeEffectTypes[0]);if(ctx.preDraw)PreDraw(ctx); +renderer.ResetColor();const lastEffectTypeIndex=activeEffectTypes.length-1;ctx.postDraw=ctx.ShouldPostDraw(activeEffectTypes[lastEffectTypeIndex]);for(let i=0,len=activeEffectTypes.length;i","g");C3.TimelineManager=class TimelineManager extends C3.DefendedBase{constructor(runtime){super();this._runtime=runtime;this._timelineDataManager=C3.New(C3.TimelineDataManager);this._pluginInstance=null;this._timelines=[];this._timelinesByName=new Map;this._objectClassToTimelineMap=new Map;this._timelinesCreatedByTemplate=new Map;this._scheduledTimelines=[];this._playingTimelines=[];this._hasRuntimeListeners=false;this._changingLayout= +false;this._isTickingTimelines=false;this._tickFunc=()=>this._OnTick();this._tick2Func=()=>this._OnTick2();this._beforeLayoutChange=()=>this._OnBeforeChangeLayout();this._layoutChange=()=>this._OnAfterChangeLayout();this._instanceDestroy=e=>this._OnInstanceDestroy(e.instance);this._afterLoad=e=>this._OnAfterLoad();this._destroyedWhileLoadingState=[]}Release(){this.RemoveRuntimeListeners();this._tickFunc=null;this._tick2Func=null;this._beforeLayoutChange=null;this._layoutChange=null;this._instanceDestroy= +null;this._afterLoad=null;for(const timeline of this._timelines){timeline.Stop();timeline.Release()}C3.clearArray(this._timelines);this._timelines=null;this._timelineDataManager.Release();this._timelineDataManager=null;C3.clearArray(this._scheduledTimelines);this._scheduledTimelines=null;C3.clearArray(this._playingTimelines);this._playingTimelines=null;this._timelinesByName.clear();this._timelinesByName=null;this._objectClassToTimelineMap.clear();this._objectClassToTimelineMap=null;this._timelinesCreatedByTemplate.clear(); +this._timelinesCreatedByTemplate=null;C3.clearArray(this._destroyedWhileLoadingState);this._destroyedWhileLoadingState=null;this._runtime=null}AddRuntimeListeners(){const dispatcher=this._runtime.Dispatcher();dispatcher.addEventListener("pretick",this._tickFunc);dispatcher.addEventListener("tick2",this._tick2Func);dispatcher.addEventListener("beforelayoutchange",this._beforeLayoutChange);dispatcher.addEventListener("layoutchange",this._layoutChange);dispatcher.addEventListener("instancedestroy",this._instanceDestroy); +dispatcher.addEventListener("afterload",this._afterLoad)}RemoveRuntimeListeners(){const dispatcher=this._runtime.Dispatcher();dispatcher.removeEventListener("pretick",this._tickFunc);dispatcher.removeEventListener("tick2",this._tick2Func);dispatcher.removeEventListener("beforelayoutchange",this._beforeLayoutChange);dispatcher.removeEventListener("layoutchange",this._layoutChange);dispatcher.removeEventListener("instancedestroy",this._instanceDestroy);dispatcher.removeEventListener("afterload",this._afterLoad)}Create(timelineData){this._timelineDataManager.Add(timelineData); +const timeline=C3.TimelineState.CreateInitial(timelineData,this);this.Add(timeline);this.SetTimelineObjectClassesToMap(timeline);this._timelinesCreatedByTemplate.set(timeline.GetName(),0)}CreateFromTemplate(template){const timelineDataManager=this.GetTimelineDataManager();const templateName=template.GetTemplateName();const timelineDataItem=timelineDataManager.Get(templateName);const timeline=C3.TimelineState.CreateFromTemplate(`${templateName}:${this._timelinesCreatedByTemplate.get(templateName)}`, +timelineDataItem,this);this._IncreaseTemplateTimelinesCount(templateName);this.Add(timeline);return timeline}_IncreaseTemplateTimelinesCount(templateName){this._timelinesCreatedByTemplate.set(templateName,this._timelinesCreatedByTemplate.get(templateName)+1)}_SetCreatedTemplateTimelinesCount(){for(const timeline of this._timelines){if(timeline.IsTemplate())continue;const templateName=timeline.GetTemplateName();this._IncreaseTemplateTimelinesCount(templateName)}}_ClearCreatedTemplateTimelinesCount(){for(const templateName of this._timelinesCreatedByTemplate.keys())this._timelinesCreatedByTemplate.set(templateName, +0)}Add(timeline){this._timelines.push(timeline);this._timelinesByName.set(timeline.GetName().toLowerCase(),timeline)}Remove(timeline){if(timeline.IsTemplate())return;C3.arrayFindRemove(this._timelines,timeline);C3.arrayFindRemove(this._scheduledTimelines,timeline);C3.arrayFindRemove(this._playingTimelines,timeline);this._timelinesByName.delete(timeline.GetName().toLowerCase());this.RemoveTimelineFromObjectClassMap(timeline);if(!timeline.IsReleased())timeline.Release()}Trigger(method){this._runtime.Trigger(method, +this._pluginInstance,null)}GetRuntime(){return this._runtime}GetTimelineDataManager(){return this._timelineDataManager}SetPluginInstance(inst){this._pluginInstance=inst}GetPluginInstance(){return this._pluginInstance}*GetTimelines(){for(const timeline of this._timelines)yield timeline}SetTimelineObjectClassToMap(objectClass,timeline){if(!this._objectClassToTimelineMap.has(objectClass))this._objectClassToTimelineMap.set(objectClass,new Set);this._objectClassToTimelineMap.get(objectClass).add(timeline)}SetTimelineObjectClassesToMap(timeline){for(const objectClass of timeline.GetObjectClasses())this.SetTimelineObjectClassToMap(objectClass, +timeline)}RemoveTimelineFromObjectClassMap(timeline){for(const [objectClass,timelines]of this._objectClassToTimelineMap.entries())if(timelines.has(timeline)){timelines.delete(timeline);if(timelines.size===0)this._objectClassToTimelineMap.delete(objectClass)}}GetTimelinesForObjectClass(objectClass){if(!this._objectClassToTimelineMap.has(objectClass))return;return this._objectClassToTimelineMap.get(objectClass)}GetTimelineOfTemplateForInstances(templateTimeline,instancesObject){if(!instancesObject)return; +for(const timeline of this._timelines){const found=instancesObject.every(io=>{return timeline.HasTrackInstance(io.instance,io.trackId)});if(found)if(timeline.GetName().includes(templateTimeline.GetName()))return timeline}}GetTimelineByName(name){return this._timelinesByName.get(name.toLowerCase())||null}GetScheduledOrPlayingTimelineByName(name){for(const timeline of this._scheduledTimelines)if(timeline.GetName()===name)return timeline;for(const timeline of this._playingTimelines)if(timeline.GetName()=== +name)return timeline;return null}*GetTimelinesByName(name){if(NAMES_REGEXP.test(name)){NAMES_REGEXP.lastIndex=0;let match;const uniqueNames=new Set;do{match=NAMES_REGEXP.exec(name);if(match){const names=match[1].split(",");for(const name of names)uniqueNames.add(name)}}while(match);for(const name of uniqueNames.values()){const timeline=this.GetTimelineByName(name);if(timeline)yield timeline}uniqueNames.clear()}else{const timeline=this.GetTimelineByName(name);if(timeline)yield timeline}}*GetTimelinesByTags(tags){for(const timeline of this._timelines)if(timeline.HasTags(tags))yield timeline}AddScheduledTimeline(timeline){if(!this._scheduledTimelines.includes(timeline))this._scheduledTimelines.push(timeline); +this._MaybeEnableRuntimeListeners()}RemovePlayingTimeline(timeline){C3.arrayFindRemove(this._playingTimelines,timeline);this._MaybeDisableRuntimeListeners()}ScheduleTimeline(timeline){if(this._playingTimelines.includes(timeline)){timeline.SetPlaying(true);timeline.SetScheduled(false);timeline.SetMarkedForRemoval(false)}else{timeline.SetPlaying(false);timeline.SetScheduled(true);timeline.SetMarkedForRemoval(false);if(!this._scheduledTimelines.includes(timeline))this._scheduledTimelines.push(timeline)}this._MaybeEnableRuntimeListeners()}DeScheduleTimeline(timeline){timeline.SetPlaying(false); +timeline.SetScheduled(false);timeline.ResolvePlayPromise();C3.arrayFindRemove(this._scheduledTimelines,timeline);this._MaybeDisableRuntimeListeners()}CompleteTimeline(timeline){timeline.SetPlaying(false);timeline.SetScheduled(false);timeline.SetMarkedForRemoval(true)}CompleteTimelineAndResolve(timeline){this.CompleteTimeline(timeline);timeline.ResolvePlayPromise()}_OnTick(){if(this.GetRuntime().IsLoadingState())return;if(!this._hasRuntimeListeners)return;if(this._changingLayout)return;let renderChange= +false;this._isTickingTimelines=true;while(this._scheduledTimelines.length){const timeline=this._scheduledTimelines.pop();timeline.SetInitialState();this._playingTimelines.push(timeline)}const dt=this._runtime.GetDt();const ts=this._runtime.GetTimeScale();for(const t of this._playingTimelines){if(t.IsMarkedForRemoval())continue;const change=t.Tick(dt,ts);if(!renderChange&&change)renderChange=true}this._isTickingTimelines=false;if(renderChange)this.GetRuntime().UpdateRender()}_OnTick2(){if(this.GetRuntime().IsLoadingState())return; +if(!this._hasRuntimeListeners)return;if(this._changingLayout)return;let timelinesToRemove;for(const t of this._playingTimelines){if(!t.IsMarkedForRemoval())continue;if(!timelinesToRemove)timelinesToRemove=new Set;this._MaybeExecuteTimelineFinishTriggers(t);timelinesToRemove.add(t)}if(timelinesToRemove)C3.arrayRemoveAllInSet(this._playingTimelines,timelinesToRemove);this._MaybeDisableRuntimeListeners()}_MaybeExecuteTimelineFinishTriggers(timeline){if(timeline.IsReleased())return;if(!timeline.HasValidTracks())return; +if(timeline.IsComplete()&&timeline.InitialStateSet())timeline.FinishTriggers()}_MaybeEnableRuntimeListeners(){if(this._hasRuntimeListeners)return;this._hasRuntimeListeners=true}_MaybeDisableRuntimeListeners(){if(this._playingTimelines.length)return;if(this._scheduledTimelines.length)return;if(this._isTickingTimelines)return;this._hasRuntimeListeners=false}_OnBeforeChangeLayout(){this._changingLayout=true;while(this._scheduledTimelines.length)this.DeScheduleTimeline(this._scheduledTimelines.pop()); +const timelinesToRemove=new Set;for(const t of this._playingTimelines){const remove=t._OnBeforeChangeLayout();if(remove)timelinesToRemove.add(t)}C3.arrayRemoveAllInSet(this._playingTimelines,timelinesToRemove);this._MaybeDisableRuntimeListeners();for(const timeline of this._timelines)timeline.CleanCaches()}_OnAfterChangeLayout(){this._changingLayout=false}_OnInstanceDestroy(instance){const objectClass=instance.GetObjectClass();const timelines=this.GetTimelinesForObjectClass(objectClass);if(!timelines)return; +if(this._runtime.IsLoadingState())this._destroyedWhileLoadingState.push(instance);else for(const timeline of timelines){if(timeline.IsTemplate())continue;if(timeline.IsReleased()){this.Remove(timeline);continue}if(!timeline.HasValidTracks()){this._MaybeExecuteTimelineFinishTriggers(timeline);this.Remove(timeline)}}}_OnAfterLoad(){for(const destroyedInstance of this._destroyedWhileLoadingState)this._OnInstanceDestroy(destroyedInstance);C3.clearArray(this._destroyedWhileLoadingState)}_SaveToJson(){return{"timelinesJson":this._SaveTimelinesToJson(), +"scheduledTimelinesJson":this._SaveScheduledTimelinesToJson(),"playingTimelinesJson":this._SavePlayingTimelinesToJson(),"hasRuntimeListeners":this._hasRuntimeListeners,"changingLayout":this._changingLayout,"isTickingTimelines":this._isTickingTimelines}}_LoadFromJson(o){if(!o)return;this._ClearCreatedTemplateTimelinesCount();this._LoadTimelinesFromJson(o["timelinesJson"]);this._LoadScheduledTimelinesFromJson(o["scheduledTimelinesJson"]);this._LoadPlayingTimelinesFromJson(o["playingTimelinesJson"]); +this._hasRuntimeListeners=!o["hasRuntimeListeners"];this._changingLayout=!!o["changingLayout"];this._isTickingTimelines=!!o["isTickingTimelines"];this._SetCreatedTemplateTimelinesCount();this._MaybeEnableRuntimeListeners();this._MaybeDisableRuntimeListeners()}_SaveTimelinesToJson(){return this._timelines.map(timelineState=>timelineState._SaveToJson())}_LoadTimelinesFromJson(timelinesJson){for(const timelineJson of timelinesJson){let timeline=this.GetTimelineByName(timelineJson["name"]);if(timeline)timeline._LoadFromJson(timelineJson); +else{const templateName=this._GetTemplateNameFromJson(timelineJson);if(!templateName)continue;const templateTimeline=this.GetTimelineByName(templateName);timeline=this.CreateFromTemplate(templateTimeline);timeline._LoadFromJson(timelineJson)}if(!timeline.HasTracks())this.Remove(timeline)}}_GetTemplateNameFromJson(timelineJson){const name=timelineJson["name"];const nameParts=name.split(":");if(!nameParts||nameParts.length!==2)return null;return nameParts[0]}_SaveScheduledTimelinesToJson(){return this._SaveTimelines(this._scheduledTimelines)}_LoadScheduledTimelinesFromJson(scheduledTimelinesJson){this._LoadTimelines(scheduledTimelinesJson, +this._scheduledTimelines)}_SavePlayingTimelinesToJson(){return this._SaveTimelines(this._playingTimelines)}_LoadPlayingTimelinesFromJson(playingTimelinesJson){this._LoadTimelines(playingTimelinesJson,this._playingTimelines)}_IsTimelineInJson(timeline,json){for(const name of json)if(name===timeline.GetName())return true;return false}_SaveTimelines(collection){return collection.map(t=>t.GetName())}_LoadTimelines(timelinesJson,collection){const timelinesToRemove=new Set;for(const timeline of collection)if(!this._IsTimelineInJson(timeline, +timelinesJson))timelinesToRemove.add(timeline);C3.arrayRemoveAllInSet(collection,timelinesToRemove);const ff=tn=>t=>t.GetName()===tn;for(const name of timelinesJson){const timeline=this.GetTimelineByName(name);if(timeline){const t=collection.find(ff(name));if(!t)collection.push(timeline)}}}}}; + + +// c3/timelines/state/timelineState.js +'use strict';{const C3=self.C3;const PING_PONG_BEGIN=0;const PING_PONG_END=1;C3.TimelineState=class Timeline extends C3.DefendedBase{constructor(name,timelineDataItem,timelineManager){super();this._runtime=timelineManager.GetRuntime();this._timelineManager=timelineManager;this._timelineDataItem=timelineDataItem;this._name=name;this._tracks=[];for(const trackDataItem of this._timelineDataItem.GetTrackData().trackDataItems())this._tracks.push(C3.TrackState.Create(this,trackDataItem));this._playPromise= +null;this._playResolve=null;this._playheadTime=C3.New(C3.KahanSum);this._playheadTime.Set(0);this._playbackRate=1;this._pingPongState=PING_PONG_BEGIN;this._currentRepeatCount=1;this._isPlaying=false;this._isScheduled=false;this._initialStateSet=false;this._complete=true;this._released=false;this._markedForRemoval=false;this._completedTick=-1;this._implicitPause=false;this._isTemplate=false;this._finishedTriggers=false;this._firstTick=false;this._lastDelta=NaN;this._tags=[""];this._stringTags="";this._tagsChanged= +false}static CreateInitial(timelineDataJson,timelineManager){const timelineDataManager=timelineManager.GetTimelineDataManager();const nameId=timelineDataManager.GetNameId();const timelineDataItem=timelineDataManager.Get(timelineDataJson[nameId]);const timeline=C3.New(C3.TimelineState,timelineDataJson[nameId],timelineDataItem,timelineManager);timeline.SetIsTemplate(true);return timeline}static CreateFromTemplate(name,timelineDataItem,timelineManager){return C3.New(C3.TimelineState,name,timelineDataItem, +timelineManager)}static get WORLD_INSTANCE_BOX_CHANGE(){return 1}static get LAYOUT_RENDER_CHANGE(){return C3.nextHighestPowerOfTwo(1)}Release(){if(this.IsReleased())return;this._timelineManager.DeScheduleTimeline(this);this._timelineManager.CompleteTimelineAndResolve(this);for(const track of this._tracks)track.Release();C3.clearArray(this._tracks);this._tracks=null;this._playheadTime.Release();this._playheadTime=null;this._runtime=null;this._timelineManager=null;this._timelineDataItem=null;this._released= +true;this._playPromise=null;this._playResolve=null}GetTimelineManager(){return this._timelineManager}GetRuntime(){return this._runtime}GetTracks(){return this._tracks}GetSimilarPropertyTracks(instance,sourceAdapter,propertyName){const ret=[];for(const track of this._tracks){if(instance!==track.GetInstance())continue;const propertyTrack=track.GetPropertyTrack(propertyName);if(!propertyTrack)continue;if(sourceAdapter.constructor!==propertyTrack.GetSourceAdapter().constructor)continue;ret.push(propertyTrack)}return ret}HasTracks(){return!!this._tracks.length}GetTrackById(trackId){for(const track of this._tracks)if(C3.equalsNoCase(track.GetId(), +trackId))return track;return null}SetName(name){this._name=name}GetName(){return this._name}GetTimelineDataItem(){return this._timelineDataItem}GetTemplateName(){return this._timelineDataItem.GetName()}GetTotalTime(){return this._timelineDataItem.GetTotalTime()}SetTotalTime(tt){this._timelineDataItem.SetTotalTime(tt)}GetStep(){return this._timelineDataItem.GetStep()}SetStep(s){this._timelineDataItem.SetStep(s)}GetInterpolationMode(){return this._timelineDataItem.GetInterpolationMode()}SetInterpolationMode(im){this._timelineDataItem.SetInterpolationMode(im)}GetResultMode(){return this._timelineDataItem.GetResultMode()}SetResultMode(rm){this._timelineDataItem.GetResultMode(rm)}SetEase(e){for(const track of this.GetTracks())track.SetEase(e)}GetLoop(){return this._timelineDataItem.GetLoop()}SetLoop(l){return this._timelineDataItem.SetLoop(l)}GetPingPong(){return this._timelineDataItem.GetPingPong()}SetPingPong(p){return this._timelineDataItem.SetPingPong(p)}GetRepeatCount(){return this._timelineDataItem.GetRepeatCount()}SetPlaybackRate(r){return this._playbackRate= +r}GetPlaybackRate(){return this._playbackRate}IsForwardPlayBack(){if(!this.IsPlaying())return true;return this._playbackRate>0}GetPlayPromise(){if(this._playPromise)return this._playPromise;this._playPromise=new Promise(resolve=>{this._playResolve=resolve});return this._playPromise}ResolvePlayPromise(){if(!this._playPromise)return;this._playResolve();this._playPromise=null;this._playResolve=null}SetTags(tags){this._tags=C3.TimelineState._GetTagArray(tags);this._tagsChanged=true}GetTags(){return this._tags}GetStringTags(){if(this._tagsChanged)this._stringTags= +this._tags.join(" ");this._tagsChanged=false;return this._stringTags}HasTags(tags){if(!this._tags)return false;if(!this._tags.length)return false;const t=C3.TimelineState._GetTagArray(tags);if(!t)return false;if(!t.length)return false;return t.every(C3.TimelineState._HasTag,this)}OnStarted(){C3.Plugins.Timeline.Cnds.SetTriggerTimeline(this);this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimelineStarted);this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimelineStartedByName);this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimelineStartedByTags); +this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnAnyTimelineStarted);C3.Plugins.Timeline.Cnds.SetTriggerTimeline(null)}OnCompleted(){this._completedTick=this._runtime.GetTickCount()}FinishTriggers(){if(this._finishedTriggers)return;this._finishedTriggers=true;C3.Plugins.Timeline.Cnds.SetTriggerTimeline(this);this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimelineFinished);this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimelineFinishedByName);this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimelineFinishedByTags); +this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnAnyTimelineFinished);C3.Plugins.Timeline.Cnds.SetTriggerTimeline(null)}SetPlaying(p){this._isPlaying=p}IsCompletedTick(){return this._completedTick===this._runtime.GetTickCount()}IsPlaying(playingOnly=false){if(this.IsCompletedTick())return true;if(this.IsScheduled()&&!playingOnly)return true;return this._isPlaying}_IsPlaying(){return this.IsPlaying(true)}IsPaused(){return this._IsPaused()}_IsPaused(){if(this.IsReleased())return false;if(this.IsScheduled())return false; +if(this._IsPlaying())return false;if(this.IsComplete())return false;return true}SetScheduled(s){this._isScheduled=s}IsScheduled(){return this._isScheduled}SetComplete(c){this._complete=c;const t=this.GetTime();if(t<=0||t>=this.GetTotalTime())this._complete=true}IsComplete(){return this._complete}IsReleased(){return this._released}SetMarkedForRemoval(mfr){this._markedForRemoval=mfr}IsMarkedForRemoval(){return this._markedForRemoval}SetImplicitPause(ip){this._implicitPause=ip}IsImplicitPause(){return this._implicitPause}SetIsTemplate(it){this._isTemplate= +!!it}IsTemplate(){return this._isTemplate}InitialStateSet(){return this._initialStateSet}GetTime(){return this._playheadTime.Get()}SetTime(time){const lastGlobalTime=this.GetTime();this._SetTime(time);this.SetComplete(false);if(!this.IsComplete())this.SetImplicitPause(true);if(!this._IsPlaying()&&!this.IsScheduled()&&this._initialStateSet);else if(!this._IsPlaying()&&!this.IsScheduled()&&!this._initialStateSet)this.SetInitialStateFromSetTime();else if(this._IsPlaying())this.Stop();else if(this.IsScheduled()){this._timelineManager.DeScheduleTimeline(this); +this.SetInitialStateFromSetTime()}const renderChange=this._Interpolate(time,false,true,true,lastGlobalTime);if(renderChange)this.GetRuntime().UpdateRender();this._OnSetTime()}_SetTime(time){if(time<0)this._playheadTime.Set(0);else if(time>=this.GetTotalTime())this._playheadTime.Set(this.GetTotalTime());else this._playheadTime.Set(time)}_OnSetTime(){if(!C3.Plugins.Timeline||this.constructor!==C3.TimelineState)return;C3.Plugins.Timeline.Cnds.SetTriggerTimeline(this);this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimeSet); +this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimeSetByName);this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimeSetByTags);C3.Plugins.Timeline.Cnds.SetTriggerTimeline(null)}_CanResume(){if(this.GetLoop())return true;else if(this.GetPingPong()&&this._pingPongState===PING_PONG_END)if(this.IsForwardPlayBack()){if(this.GetTime()>=this.GetTotalTime())return false}else{if(this.GetTime()<=0)return false}else if(!this.GetLoop()&&!this.GetPingPong())if(this.IsForwardPlayBack()){if(this.GetTime()>= +this.GetTotalTime())return false}else if(this.GetTime()<=0)return false;return true}Resume(){if(this.IsReleased())return;if(this._CanResume())this.Play(true)}Play(resume=false){if(this.IsReleased())return false;if(this.IsScheduled())return false;if(this._IsPlaying()&&this.IsCompletedTick())return this._SchedulePlayingTimeline();if(this._IsPlaying())return false;if(!this.IsComplete()&&!resume&&!this.IsImplicitPause())return false;return this._ScheduleStoppedTimeline()}_SchedulePlayingTimeline(){this.SetImplicitPause(false); +this._timelineManager.RemovePlayingTimeline(this);this._timelineManager.ScheduleTimeline(this);this.GetPlayPromise();return true}_ScheduleStoppedTimeline(){this.SetImplicitPause(false);this._timelineManager.ScheduleTimeline(this);this.GetPlayPromise();return true}Stop(completed=false){if(this.IsReleased())return;this.SetComplete(completed);this._timelineManager.CompleteTimeline(this);if(this.IsComplete())this.ResolvePlayPromise()}Reset(render=true,beforeChangeLayout=false){if(this.IsReleased())return; +if(!this._IsPlaying()&&this.IsScheduled())return this._timelineManager.DeScheduleTimeline(this);if(this.IsComplete())return;this.Stop(true);if(this.IsForwardPlayBack())this._SetTime(0);else this._SetTime(this.GetTotalTime());let renderChange;const time=this.GetTime();if(beforeChangeLayout)renderChange=this._InterpolateBeforeChangeLayout(time);else renderChange=this._Interpolate(time,false,false,true);if(render)this._OnSetTime();if(renderChange&&render)this.GetRuntime().UpdateRender()}ResetBeforeChangeLayout(){this.Reset(false, +true)}_InterpolateBeforeChangeLayout(time){this._Interpolate(time,false,false,true,NaN,false,true)}_OnBeforeChangeLayout(){if(this.IsReleased())return true;if(this.HasValidGlobalTracks())return false;this._timelineManager.CompleteTimeline(this);this.ResetBeforeChangeLayout();return true}SetInitialStateFromSetTime(){this.SetInitialState(true)}SetInitialState(fromSetTime){if(this.IsMarkedForRemoval())return;if(fromSetTime){this._initialStateSet=true;this._firstTick=true;for(const track of this._tracks)track.SetInitialState()}else{this.SetPlaying(true); +this.SetScheduled(false);this.OnStarted();if(this.IsComplete()){this._completedTick=-1;this._pingPongState=PING_PONG_BEGIN;this._currentRepeatCount=1;this._complete=false;this._finishedTriggers=false;this._initialStateSet=true;this._firstTick=true;if(this.IsForwardPlayBack())this._SetTime(0);else this._SetTime(this.GetTotalTime());for(const track of this._tracks)track.SetInitialState()}else{this._firstTick=true;for(const track of this._tracks)track.SetResumeState()}}}Tick(deltaTime,timeScale){if(deltaTime=== +0&&this._lastDelta===0)return;this._lastDelta=deltaTime;const lastTime=this.GetTime();const newDeltaTime=deltaTime*timeScale*this._playbackRate;this._SetTime(lastTime+newDeltaTime);let complete;if(!this.GetLoop()&&!this.GetPingPong())complete=this._SimpleCompleteCheck();else if(this.GetLoop()&&!this.GetPingPong())complete=this._LoopCompleteCheck();else if(!this.GetLoop()&&this.GetPingPong())complete=this._PingPongCompleteCheck();else if(this.GetLoop()&&this.GetPingPong())complete=this._LoopPingPongCompleteCheck(); +if(complete){for(const track of this._tracks)track.SetEndState();this.Stop(true);this.OnCompleted();return true}else return this._Interpolate(this.GetTime(),true,false,false,lastTime,true)}_Interpolate(time,isTicking=false,setTime=false,ensureValue=false,lastTime=NaN,onTickCall=false,ignoreGlobals=false){let renderChange=false;for(const track of this._tracks)track.BeforeInterpolate();for(const track of this._tracks){let t=time;if(typeof lastTime==="number"){const globalTime=this.GetTime();const localTime= +globalTime-track.GetStartOffset();const lastLocalTime=lastTime-track.GetStartOffset();if(localTime<0&&lastLocalTime>0){t=track.GetStartOffset();this._SetTime(t)}}const change=track.Interpolate(t,isTicking,setTime,ensureValue,this._firstTick,ignoreGlobals);if(!renderChange&&change)renderChange=true}for(const track of this._tracks)track.AfterInterpolate();if(this._firstTick&&onTickCall)this._firstTick=false;return renderChange}_SimpleCompleteCheck(){if(this.IsForwardPlayBack()){if(this.GetTime()>=this.GetTotalTime())if(this._currentRepeatCount< +this.GetRepeatCount()){this._currentRepeatCount++;this._SetTime(0)}else{this._SetTime(this.GetTotalTime());return true}}else if(this.GetTime()<=0)if(this._currentRepeatCount=this.GetTotalTime())this._SetTime(0)}else if(this.GetTime()<=0)this._SetTime(this.GetTotalTime());return false}_PingPongCompleteCheck(){if(this.IsForwardPlayBack()){if(this.GetTime()>= +this.GetTotalTime()){this._SetTime(this.GetTotalTime());this.SetPlaybackRate(this.GetPlaybackRate()*-1);if(this._pingPongState===PING_PONG_END)if(this._currentRepeatCount=this.GetTotalTime()){this._SetTime(this.GetTotalTime());this.SetPlaybackRate(this.GetPlaybackRate()*-1)}}else if(this.GetTime()<=0){this._SetTime(0);this.SetPlaybackRate(this.GetPlaybackRate()*-1)}return false}AddTrack(){const trackDataItem= +this._timelineDataItem.GetTrackData().AddEmptyTrackDataItem();const track=C3.TrackState.Create(this,trackDataItem);this._tracks.push(track);return track}CleanCaches(){for(const track of this._tracks)track.CleanCaches()}ClearTrackInstances(){for(const track of this._tracks)track.ClearInstance()}SetTrackInstance(trackId,instance){if(!instance)return;for(const track of this._tracks)if(trackId){if(track.GetId()!==trackId)continue;track.SetInstance(instance);this._timelineManager.SetTimelineObjectClassToMap(instance.GetObjectClass(), +this);break}else{if(track.HasInstance())continue;track.SetInstance(instance);this._timelineManager.SetTimelineObjectClassToMap(instance.GetObjectClass(),this);break}}HasTrackInstance(instance,trackId){for(const track of this._tracks)if(trackId){if(trackId===track.GetId()&&instance===track.GetInstance())return true}else if(instance===track.GetInstance())return true;return false}HasValidTracks(){return this._tracks.some(t=>t.CanInstanceBeValid())}HasValidGlobalTracks(){return this._tracks.some(t=>{if(!t.CanInstanceBeValid())return false; +const objectClass=t.GetObjectClass();if(!objectClass)return false;return objectClass.IsGlobal()})}GetPropertyTrack(propertyName){for(const track of this.GetTracks())for(const propertyTrack of track.GetPropertyTracks())if(propertyTrack.GetPropertyName()===propertyName)return propertyTrack}GetKeyframeWithTags(tags){let tagsArray=tags?tags.split(" "):[];const tagsSet=new Set(tagsArray.map(t=>t.toLowerCase().trim()));tagsArray=[...tagsSet.values()];for(const track of this.GetTracks())for(const keyframeDataItem of track.GetKeyframeDataItems()){const hasAllTags= +tagsArray.every(t=>keyframeDataItem.HasTag(t));if(hasAllTags)return keyframeDataItem}}GetObjectClasses(){const ret=[];for(const track of this.GetTracks())ret.push(track.GetObjectClass());return ret.filter(oc=>oc)}_SaveToJson(){return{"tracksJson":this._SaveTracksToJson(),"name":this._name,"playheadTime":this.GetTime(),"playbackRate":this._playbackRate,"pingPongState":this._pingPongState,"currentRepeatCount":this._currentRepeatCount,"isPlaying":this._isPlaying,"isScheduled":this._isScheduled,"initialStateSet":this._initialStateSet, +"finishedTriggers":this._finishedTriggers,"complete":this._complete,"released":this._released,"markedForRemoval":this._markedForRemoval,"completedTick":this._completedTick,"implicitPause":this._implicitPause,"isTemplate":this._isTemplate,"tags":this._tags.join(" "),"stringTags":this._stringTags,"tagsChanged":this._tagsChanged,"firstTick":this._firstTick}}_LoadFromJson(o){if(!o)return;this._LoadTracksFromJson(o["tracksJson"]);this._name=o["name"];this._playheadTime.Set(o["playheadTime"]);this._playbackRate= +o["playbackRate"];this._pingPongState=o["pingPongState"];this._currentRepeatCount=o["currentRepeatCount"];this._isPlaying=!!o["isPlaying"];this._isScheduled=!!o["isScheduled"];this._initialStateSet=!!o["initialStateSet"];this._finishedTriggers=o.hasOwnProperty("finishedTriggers")?!!o["finishedTriggers"]:false;this._complete=!!o["complete"];this._released=!!o["released"];this._markedForRemoval=!!o["markedForRemoval"];this._completedTick=o["completedTick"];this._implicitPause=!!o["implicitPause"];this._isTemplate= +!!o["isTemplate"];this._tags=o["tags"].split(" ");this._stringTags=o["stringTags"];this._tagsChanged=!!o["tagsChanged"];this._firstTick=!!o["firstTick"]}_SaveTracksToJson(){return this._tracks.map(trackState=>trackState._SaveToJson())}_LoadTracksFromJson(tracksJson){tracksJson.forEach((trackJson,i)=>{const track=this._tracks[i];track._LoadFromJson(trackJson)});this._tracks.filter(track=>track.CanInstanceBeValid())}static _HasTag(tag){const tags=this.GetTags();if(tag==="")return tags.length===1&&tags[0]=== +"";return tags.includes(tag)}static _GetTagArray(tags){if(C3.IsArray(tags))return tags.slice(0);if(C3.IsString(tags))return tags.split(" ")}}}; + + +// c3/timelines/state/trackState.js +'use strict';{const C3=self.C3;C3.TrackState=class Track extends C3.DefendedBase{constructor(timeline,trackDataItem){super();this._timeline=timeline;this._trackDataItem=trackDataItem;this._trackData=trackDataItem.GetTrackData();this._instanceUid=NaN;this._objectClassIndex=NaN;this._instance=null;this._worldInfo=null;this._isNested=trackDataItem.GetStartOffset()>0;this._initialStateOfNestedSet=false;this._endStateOfNestedSet=false;this._lastKeyframeDataItem=null;this._keyframeDataItems=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemArray(); +this._propertyTracks=[];for(const propertyTrackDataItem of this._trackDataItem.GetPropertyTrackData().propertyTrackDataItems())this._propertyTracks.push(C3.PropertyTrackState.Create(this,propertyTrackDataItem))}static Create(timeline,trackDataItem){return C3.New(C3.TrackState,timeline,trackDataItem)}Release(){this._keyframeDataItems=null;for(const propertyTrack of this._propertyTracks)propertyTrack.Release();C3.clearArray(this._propertyTracks);this._propertyTracks=null;this._timeline=null;this._instance= +null;this._worldInfo=null;this._trackDataItem=null;this._lastKeyframeDataItem=null}CleanCaches(){for(const propertyTrack of this._propertyTracks)propertyTrack.CleanCaches();this._instance=null;this._worldInfo=null}GetTimeline(){return this._timeline}GetRuntime(){return this._timeline.GetRuntime()}GetKeyframeDataItems(){if(this._keyframeDataItems)return this._keyframeDataItems;this._keyframeDataItems=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemArray();return this._keyframeDataItems}GetPropertyTracks(){return this._propertyTracks}GetPropertyTrack(propertyName){for(const propertyTrack of this._propertyTracks)if(propertyTrack.GetPropertyName()=== +propertyName)return propertyTrack}MaybeGetInstance(){if(!this._instance)this.GetInstance()}IsInstanceValid(){if(!this._instance)return false;return!this._instance.IsDestroyed()}CanInstanceBeValid(){const uid=this.GetInstanceUID();const instance=this.GetRuntime().GetInstanceByUID(uid);if(!instance)return false;return!instance.IsDestroyed()}GetObjectClass(){const index=this.GetObjectClassIndex();if(index===-1)return;return this.GetRuntime().GetObjectClassByIndex(index)}ClearInstance(){this._instance= +null;this._instanceUid=-1;this._worldInfo=null;this._objectClassIndex=-1}HasInstance(){return!!this._instance}GetInstance(){if(this._instance&&this.IsInstanceValid())return this._instance;const uid=this.GetInstanceUID();this._instance=this.GetRuntime().GetInstanceByUID(uid);return this._instance}SetInstance(instance){if(this._instance===instance)return;this.CleanCaches();this._instance=instance;this._objectClassIndex=instance.GetObjectClass().GetIndex();this._instanceUid=instance.GetUID();this._worldInfo= +instance.GetWorldInfo();for(const item of this.propertyTrackItems()){const propertyTrack=item.propertyTrack;const sourceAdapter=item.sourceAdapter;const id=propertyTrack.GetSourceAdapterId();switch(id){case "instance-variable":{const index=sourceAdapter.GetEditorIndex();const objectClass=instance.GetObjectClass();const i=objectClass.GetInstanceVariableIndexByName(item.name);const name=objectClass.GetInstanceVariableName(i);const type=objectClass.GetInstanceVariableType(i);if(name===item.name&&type=== +item.type)sourceAdapter.UpdateInstanceVariableIndex(i);break}case "behavior":{const timelineBehaviorType=item.behaviorType;const trackObjectClass=this.GetObjectClass();const objectClass=instance.GetObjectClass();const instanceBehaviorType=sourceAdapter.GetBehaviorType(objectClass);if(timelineBehaviorType&&instanceBehaviorType){const name=timelineBehaviorType.GetName();const templateBehaviorIndex=trackObjectClass.GetBehaviorIndexByName(name);const instanceBehaviorIndex=objectClass.GetBehaviorIndexByName(name); +const propertyIndex=sourceAdapter.GetEditorIndex();sourceAdapter.UpdateBehaviorTypeSid(instanceBehaviorType.GetSID())}break}}}}*propertyTrackItems(){for(const propertyTrack of this._propertyTracks){const sourceAdapter=propertyTrack.GetSourceAdapter();const objectClass=this.GetObjectClass();const ret={propertyTrack:propertyTrack,sourceAdapter:sourceAdapter};switch(propertyTrack.GetSourceAdapterId()){case "world-instance":{ret.property=propertyTrack.GetPropertyName();break}case "instance-variable":{const index= +sourceAdapter.GetEditorIndex();ret.name=objectClass.GetInstanceVariableName(index);ret.type=objectClass.GetInstanceVariableType(index);break}case "effect":{const effectList=objectClass.GetEffectList();const effectType=sourceAdapter.GetEffectType(effectList);ret.effectType=effectType;break}case "behavior":{const behaviorType=sourceAdapter.GetBehaviorType(objectClass);ret.behaviorType=behaviorType;break}case "plugin":{ret.plugin=objectClass.GetPlugin();break}}yield ret}}GetWorldInfo(){if(this._worldInfo&& +this.IsInstanceValid())return this._worldInfo;const instance=this.GetInstance();if(instance)this._worldInfo=instance.GetWorldInfo();return this._worldInfo}GetTrackDataItem(){return this._trackDataItem}GetInstanceUID(){if(this._instanceUid)return this._instanceUid;return this._trackDataItem.GetInstanceUID()}SetInstanceUID(uid){this._trackDataItem.SetInstanceUID(uid)}GetInterpolationMode(){return this._trackDataItem.GetInterpolationMode()}SetInterpolationMode(im){this._trackDataItem.SetInterpolationMode(im)}GetResultMode(){return this._trackDataItem.GetResultMode()}GetId(){return this._trackDataItem.GetId()}GetStartOffset(){return this._trackDataItem.GetStartOffset()}GetLocalTotalTime(){return this._trackDataItem.GetLocalTotalTime()}SetResultMode(rm){this._trackDataItem.SetResultMode(rm)}SetEase(e){for(const keyframeDataItem of this.GetKeyframeDataItems())keyframeDataItem.SetEase(e); +for(const propertyTrack of this.GetPropertyTracks())propertyTrack.SetEase(e)}GetEnable(){return this._trackDataItem.GetEnable()}SetEnable(e){this._trackDataItem.SetEnable(e)}GetObjectClassIndex(){if(!isNaN(this._objectClassIndex))return this._objectClassIndex;return this._trackDataItem.GetObjectClassIndex()}SetObjectClassIndex(objectClassIndex){this._trackDataItem.SetObjectClassIndex(objectClassIndex)}SetOriginalWidth(w){this._trackDataItem.SetOriginalWidth(w)}GetOriginalWidth(){return this._trackDataItem.GetOriginalWidth()}SetOriginalHeight(h){this._trackDataItem.SetOriginalHeight(h)}GetOriginalHeight(){return this._trackDataItem.GetOriginalHeight()}SetInitialState(){this.MaybeGetInstance(); +if(!this.IsInstanceValid())return;for(const propertyTrack of this._propertyTracks)propertyTrack.SetInitialState();const timeline=this.GetTimeline();const isForwardPlayBack=timeline.IsForwardPlayBack();const time=isForwardPlayBack?0:this.GetLocalTotalTime();this._lastKeyframeDataItem=this.GetLastKeyFrameBeforeTime(time);this._initialStateOfNestedSet=false;this._endStateOfNestedSet=false;this.Interpolate(time)}SetResumeState(){this.MaybeGetInstance();if(!this.IsInstanceValid())return;const playbackDirection= +this._timeline.IsForwardPlayBack();const time=this._timeline.GetTime()-this.GetStartOffset();this._lastKeyframeDataItem=this.GetLastKeyFrameBeforeTime(time);for(const propertyTrack of this._propertyTracks)propertyTrack.SetResumeState()}SetEndState(){if(this.GetTimeline().IsComplete())return;this.MaybeGetInstance();if(!this.IsInstanceValid())return;if(!this._isNested){const time=this._timeline.GetTime();const totalTime=this.GetStartOffset()+this.GetLocalTotalTime();if(time>=totalTime)this.Interpolate(this.GetLocalTotalTime(), +true,false,true);else if(time<=0)this.Interpolate(0,true,false,true)}}BeforeInterpolate(){for(const propertyTrack of this._propertyTracks)propertyTrack.BeforeInterpolate()}Interpolate(time,isTicking=false,setTime=false,ensureValue=false,firstTick=false,ignoreGlobals=false){this.MaybeGetInstance();if(!this.IsInstanceValid())return false;if(ignoreGlobals&&this.GetObjectClass().IsGlobal())return false;time=time-this.GetStartOffset();if(time<0)return false;this.MaybeSetInitialStateOfNestedTrack(time, +isTicking);this.MaybeTriggerKeyframeReachedConditions(time,isTicking,firstTick);let boxChange=false;let renderChange=false;for(const propertyTrack of this._propertyTracks){const change=propertyTrack.Interpolate(time,setTime,false,ensureValue);if(!boxChange&&(change&C3.TimelineState.WORLD_INSTANCE_BOX_CHANGE)!==0)boxChange=true;if(!renderChange&&(change&C3.TimelineState.LAYOUT_RENDER_CHANGE)!==0)renderChange=true}this.MaybeSetEndStateOfNestedTrack(time,isTicking);if(boxChange){const worldInfo=this.GetWorldInfo(); +if(worldInfo)worldInfo.SetBboxChanged()}return renderChange}AfterInterpolate(){for(const propertyTrack of this._propertyTracks)propertyTrack.AfterInterpolate()}MaybeSetInitialStateOfNestedTrack(time,isTicking){if(!isTicking)return;if(!this._isNested)return;if(this._initialStateOfNestedSet)return;const timeline=this.GetTimeline();if(timeline.IsForwardPlayBack()){if(time<0)return;for(const propertyTrack of this._propertyTracks)propertyTrack.Interpolate(0,false,false,true)}else{if(time>this.GetLocalTotalTime())return; +for(const propertyTrack of this._propertyTracks)propertyTrack.Interpolate(this.GetLocalTotalTime(),false,false,true)}for(const propertyTrack of this._propertyTracks)propertyTrack.SetInitialState();this._initialStateOfNestedSet=true}MaybeSetEndStateOfNestedTrack(time,isTicking){if(!isTicking)return;if(!this._isNested)return;if(this._endStateOfNestedSet)return;const timeline=this.GetTimeline();if(timeline.IsForwardPlayBack()){if(time>=this.GetLocalTotalTime()){for(const propertyTrack of this._propertyTracks)propertyTrack.Interpolate(this.GetLocalTotalTime(), +false,false,true);this._endStateOfNestedSet=true}}else if(time<=0){for(const propertyTrack of this._propertyTracks)propertyTrack.Interpolate(0,false,false,true);this._endStateOfNestedSet=true}}MaybeTriggerKeyframeReachedConditions(time,isTicking,firstTick){if(firstTick)return;if(!isTicking)return;let keyframeDataItem=this.GetLastKeyFrameBeforeTime(time);if(keyframeDataItem!==this._lastKeyframeDataItem)this.OnKeyframeReached(keyframeDataItem);this._lastKeyframeDataItem=keyframeDataItem;return keyframeDataItem}GetLastKeyFrameBeforeTime(time){const timeline= +this.GetTimeline();let keyframeDataItem=this._trackData.GetKeyFrameDataItemAtTime(time,this._trackDataItem);if(keyframeDataItem)return keyframeDataItem;else if(timeline.IsForwardPlayBack())return this._trackData.GetFirstKeyFrameDataItemLowerOrEqualThan(time,this._trackDataItem);else return this._trackData.GetFirstKeyFrameDataItemHigherOrEqualThan(time,this._trackDataItem)}OnKeyframeReached(keyframeDataItem){if(!C3.Plugins.Timeline||this.GetTimeline().constructor!==C3.TimelineState)return;const timeline= +this.GetTimeline();C3.Plugins.Timeline.Cnds.SetTriggerTimeline(timeline);C3.Plugins.Timeline.Cnds.SetTriggerKeyframe(keyframeDataItem);const timelineManager=timeline.GetTimelineManager();timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnAnyKeyframeReached);timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnKeyframeReached);C3.Plugins.Timeline.Cnds.SetTriggerTimeline(null);C3.Plugins.Timeline.Cnds.SetTriggerKeyframe(null)}AddKeyframe(){const keyframeData=this._trackDataItem.GetKeyframeData();const keyframeDataItem= +keyframeData.AddEmptyKeyframeDataItem();return keyframeDataItem}AddPropertyTrack(){const propertyTrackData=this._trackDataItem.GetPropertyTrackData();const propertyTrackDataItem=propertyTrackData.AddEmptyPropertyTrackDataItem();const propertyTrack=C3.PropertyTrackState.Create(this,propertyTrackDataItem);this._propertyTracks.push(propertyTrack);return propertyTrack}DeleteKeyframes(match){const keyframeData=this._trackDataItem.GetKeyframeData();keyframeData.DeleteKeyframeDataItems(match)}DeletePropertyKeyframes(match){for(const propertyTrack of this._propertyTracks)propertyTrack.DeletePropertyKeyframes(match)}SaveState(){for(const propertyTrack of this._propertyTracks)propertyTrack.SaveState()}CompareInitialStateWithCurrent(){this.MaybeGetInstance(); +if(!this.IsInstanceValid())return;for(const propertyTrack of this._propertyTracks)propertyTrack.CompareInitialStateWithCurrent()}CompareSaveStateWithCurrent(){this.MaybeGetInstance();if(!this.IsInstanceValid())return;let difference=false;for(const propertyTrack of this._propertyTracks){const diff=propertyTrack.CompareSaveStateWithCurrent();if(!difference&&diff)difference=true}if(difference){const keyframeDataItem=this.AddKeyframe();keyframeDataItem.SetTime(this.GetTimeline().GetTime());keyframeDataItem.SetEase("noease"); +keyframeDataItem.SetEnable(true);keyframeDataItem.SetTags("")}}_SaveToJson(){const instance=this.GetInstance();const uid=instance?instance.GetUID():this.GetInstanceUID();return{"propertyTracksJson":this._SavePropertyTracksToJson(),"lastKeyframeDataItemJson":this._SaveLastKeyframeDataItemToJson(),"initialStateOfNestedSet":this._initialStateOfNestedSet,"endStateOfNestedSet":this._endStateOfNestedSet,"instanceUid":uid}}_LoadFromJson(o){if(!o)return;this._LoadPropertyTracksFromJson(o["propertyTracksJson"]); +this._LoadLastKeyframeDataItemFromJson(o["lastKeyframeDataItemJson"]);this._LoadInstanceFromJson(o["instanceUid"]);this._initialStateOfNestedSet=false;if(o.hasOwnProperty["initialStateOfNestedSet"])this._initialStateOfNestedSet=o["initialStateOfNestedSet"];this._endStateOfNestedSet=false;if(o.hasOwnProperty["endStateOfNestedSet"])this._endStateOfNestedSet=o["endStateOfNestedSet"]}_SaveLastKeyframeDataItemToJson(){const keyframeData=this._trackDataItem.GetKeyframeData();return keyframeData.GetKeyframeDataItemIndex(this._lastKeyframeDataItem)}_SavePropertyTracksToJson(){return this._propertyTracks.map(propertyTrackState=> +propertyTrackState._SaveToJson())}_LoadPropertyTracksFromJson(propertyTracksJson){propertyTracksJson.forEach((propertyTrackJson,i)=>{const propertyTrack=this._propertyTracks[i];propertyTrack._LoadFromJson(propertyTrackJson)})}_LoadInstanceFromJson(uid){if(!C3.IsFiniteNumber(uid))return;const instance=this.GetRuntime().GetInstanceByUID(uid);if(!instance)return;const timeline=this.GetTimeline();timeline.ClearTrackInstances();timeline.SetTrackInstance(this._trackDataItem.GetId(),instance)}_LoadLastKeyframeDataItemFromJson(lastKeyframeDataItemIndex){const keyframeData= +this._trackDataItem.GetKeyframeData();this._lastKeyframeDataItem=keyframeData.GetKeyframeDataItemFromIndex(lastKeyframeDataItemIndex)}}}; + + +// c3/timelines/state/propertyTrackState.js +'use strict';{const C3=self.C3;C3.PropertyTrackState=class PropertyTrack extends C3.DefendedBase{constructor(track,propertyTrackDataItem){super();this._track=track;this._propertyTrackDataItem=propertyTrackDataItem;this._propertyTrackData=propertyTrackDataItem.GetPropertyTrackData();this._sourceAdapter=this.GetSourceAdapter();this._propertyKeyframeDataItems=this._propertyTrackDataItem.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray()}static Create(track,propertyTrackDataItem){return C3.New(C3.PropertyTrackState, +track,propertyTrackDataItem)}Release(){this._track=null;if(this._sourceAdapter){this._sourceAdapter.Release();this._sourceAdapter=null}this._propertyKeyframeDataItems=null;this._propertyTrackDataItem=null;this._propertyTrackData=null}GetTrack(){return this._track}GetPropertyTrackDataItem(){return this._propertyTrackDataItem}GetPropertyTrackData(){return this._propertyTrackData}GetTimeline(){return this._track.GetTimeline()}GetRuntime(){return this._track.GetRuntime()}GetInstance(){return this._track.GetInstance()}GetSourceAdapter(){if(this._sourceAdapter)return this._sourceAdapter; +const id=this._propertyTrackDataItem.GetSourceAdapterId();let ret;switch(id){case "behavior":ret=new C3.PropertyTrackState.BehaviorSourceAdapter(this);break;case "effect":ret=new C3.PropertyTrackState.EffectSourceAdapter(this);break;case "instance-variable":ret=new C3.PropertyTrackState.InstanceVariableSourceAdapter(this);break;case "plugin":ret=new C3.PropertyTrackState.PluginSourceAdapter(this);break;case "world-instance":ret=new C3.PropertyTrackState.WorldInstanceSourceAdapter(this);break;case "value":ret= +new C3.PropertyTrackState.ValueSourceAdapter(this);break}this._sourceAdapter=ret;return this._sourceAdapter}GetSourceAdapterId(){return this._propertyTrackDataItem.GetSourceAdapterId()}SetSourceAdapterId(said){this._propertyTrackDataItem.SetSourceAdapterId(said)}GetSourceAdapterArgs(){return this._propertyTrackDataItem.GetSourceAdapterArguments()}SetSourceAdapterArgs(sargs){this._propertyTrackDataItem.SetSourceAdapterArguments(sargs)}GetSourceAdapterValue(){return this.GetSourceAdapter().GetValue()}GetPropertyName(){return this._propertyTrackDataItem.GetProperty()}SetPropertyName(pn){this._propertyTrackDataItem.SetProperty(pn)}GetPropertyType(){return this._propertyTrackDataItem.GetType()}SetPropertyType(pt){this._propertyTrackDataItem.SetType(pt)}GetPropertyKeyframeType(){return this.GetPropertyTrackData().GetFirstPropertyKeyframeDataItem(this._propertyTrackDataItem).GetType()}GetMin(){return this._propertyTrackDataItem.GetMin()}SetMin(min){this._propertyTrackDataItem.SetMin(min)}GetMax(){return this._propertyTrackDataItem.GetMax()}SetMax(max){this._propertyTrackDataItem.SetMax(max)}GetEnable(){return this._propertyTrackDataItem.GetEnable()}SetEnable(e){this._propertyTrackDataItem.SetEnable(e)}GetInterpolationMode(){return this._propertyTrackDataItem.GetInterpolationMode()}SetInterpolationMode(im){this._propertyTrackDataItem.SetInterpolationMode(im)}GetResultMode(){return this._propertyTrackDataItem.GetResultMode()}SetResultMode(rm){this._propertyTrackDataItem.SetResultMode(rm)}SetEase(e){for(const propertyKeyframeDataItem of this.GetPropertyKeyframeDataItems())propertyKeyframeDataItem.SetEase(e)}GetPropertyKeyframeDataItems(){if(this._propertyKeyframeDataItems)return this._propertyKeyframeDataItems; +this._propertyKeyframeDataItems=this._propertyTrackDataItem.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray();return this._propertyKeyframeDataItems}*GetPropertyKeyframeValues(){for(const propertyKeyframeDataItem of this.GetPropertyKeyframeDataItems())yield propertyKeyframeDataItem.GetValueWithResultMode()}CleanCaches(){this.GetSourceAdapter().CleanCaches()}GetCurrentState(){return this.GetSourceAdapter().GetCurrentState()}SetInitialState(){this.GetSourceAdapter().SetInitialState()}SetResumeState(){this.GetSourceAdapter().SetResumeState()}BeforeInterpolate(){this.GetSourceAdapter().BeforeInterpolate()}Interpolate(time, +setTime=false,noChange=false,ensureValue=false){const propertyTrackDataItem=this._propertyTrackDataItem;let start=this._propertyTrackData.GetPropertyKeyFrameDataItemAtTime(time,propertyTrackDataItem);let end;if(start)end=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherThan(time,propertyTrackDataItem);else{start=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(time,propertyTrackDataItem);end=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(time, +propertyTrackDataItem)}return this.GetSourceAdapter().Interpolate(time,start,end,setTime,noChange,ensureValue)}AfterInterpolate(){this.GetSourceAdapter().AfterInterpolate()}static GetStartPropertyKeyframeForTime(time,propertyTrack){const propertyTrackDataItem=propertyTrack.GetPropertyTrackDataItem();const propertyTrackData=propertyTrack._propertyTrackData;let start=propertyTrackData.GetPropertyKeyFrameDataItemAtTime(time,propertyTrackDataItem);if(!start)start=propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(time, +propertyTrackDataItem);return start}static GetEndPropertyKeyframeForTime(time,propertyTrack){const propertyTrackDataItem=propertyTrack.GetPropertyTrackDataItem();const propertyTrackData=propertyTrack._propertyTrackData;let end=propertyTrackData.GetPropertyKeyFrameDataItemAtTime(time,propertyTrackDataItem);if(end)return propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherThan(time,propertyTrackDataItem);else return propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(time,propertyTrackDataItem)}AddPropertyKeyframe(){const propertyKeyframeData= +this._propertyTrackDataItem.GetPropertyKeyframeData();const propertyKeyframeDataItem=propertyKeyframeData.AddEmptyPropertyKeyframeDataItem();return propertyKeyframeDataItem}DeletePropertyKeyframes(match){const propertyKeyframeData=this._propertyTrackDataItem.GetPropertyKeyframeData();propertyKeyframeData.DeletePropertyKeyframeDataItems(match)}SaveState(){this.GetSourceAdapter().SaveState()}CompareInitialStateWithCurrent(){const difference=this.GetSourceAdapter().CompareInitialStateWithCurrent();if(difference){const propertyKeyframeDataItem= +this._propertyTrackData.GetFirstPropertyKeyframeDataItem(this._propertyTrackDataItem);const currentState=this.GetSourceAdapter().GetCurrentState();propertyKeyframeDataItem.SetAbsoluteValue(currentState)}}CompareSaveStateWithCurrent(){const difference=this.GetSourceAdapter().CompareSaveStateWithCurrent();if(difference)this.AddPropertyKeyframeAtCurrentTime();this.GetSourceAdapter().ClearSaveState();return difference}AddPropertyKeyframeAtCurrentTime(){const time=this.GetTimeline().GetTime();const sourceAdapter= +this.GetSourceAdapter();const startPropertyKeyframe=C3.PropertyTrackState.GetStartPropertyKeyframeForTime(time,this);const propertyKeyframeDataItem=this.AddPropertyKeyframe();propertyKeyframeDataItem.SetType(startPropertyKeyframe.GetType());propertyKeyframeDataItem.SetTime(time);propertyKeyframeDataItem.SetEase(startPropertyKeyframe.GetEase());propertyKeyframeDataItem.SetEnable(true);propertyKeyframeDataItem.SetValue(sourceAdapter.GetValueAtTime());propertyKeyframeDataItem.SetAbsoluteValue(sourceAdapter.GetCurrentState())}_SaveToJson(){return{"sourceAdapterJson":this.GetSourceAdapter()._SaveToJson()}}_LoadFromJson(o){if(!o)return; +this.GetSourceAdapter()._LoadFromJson(o["sourceAdapterJson"])}}}; + + +// c3/timelines/state/propertySourceAdapters/propertySourceAdapter.js +'use strict';{const C3=self.C3;const NS=C3.PropertyTrackState;NS.PropertySourceAdapter=class PropertySourceAdapter{constructor(propertyTrack){this._propertyTrack=propertyTrack;this._propertyAdapter=null}Release(){if(this._propertyAdapter){this._propertyAdapter.Release();this._propertyAdapter=null}this._propertyTrack=null}GetPropertyTrack(){return this._propertyTrack}CleanCaches(){if(this._propertyAdapter)this._propertyAdapter.CleanCaches()}GetPropertyAdapter(){if(this._propertyAdapter)return this._propertyAdapter; +this._propertyAdapter=this._CreatePropertyAdapter();return this._propertyAdapter}GetEditorIndex(){}GetIndex(){return this.GetEditorIndex()}GetTarget(){}SetInitialState(){this.GetPropertyAdapter().SetInitialState()}SetResumeState(){this.GetPropertyAdapter().SetResumeState()}BeforeInterpolate(){this.GetPropertyAdapter().BeforeChangeProperty()}Interpolate(time,start,end,setTime,noChange,ensureValue){const interpolateFunc=NS.PropertySourceAdapter.GetInterpolateFunc(this._propertyTrack);const value=interpolateFunc(time, +start,end,this._propertyTrack);if(noChange)return value;return this.GetPropertyAdapter().ChangeProperty(time,value,start,end,setTime,ensureValue)}AfterInterpolate(){this.GetPropertyAdapter().AfterChangeProperty()}SaveState(){this.GetPropertyAdapter().SetSaveState()}ClearSaveState(){this.GetPropertyAdapter().ClearSaveState()}GetCurrentState(){return this.GetPropertyAdapter().GetCurrentState()}CompareInitialStateWithCurrent(){return this.GetPropertyAdapter().CompareInitialStateWithCurrent()}CompareSaveStateWithCurrent(){return this.GetPropertyAdapter().CompareSaveStateWithCurrent()}GetValueAtTime(){return NS.PropertySourceAdapter.GetValueAtTime(this._propertyTrack)}_CreatePropertyAdapter(){const propertyType= +this._propertyTrack.GetPropertyType();const keyframePropertyType=this._propertyTrack.GetPropertyKeyframeType();switch(keyframePropertyType){case "combo":case "boolean":case "text":case "string":{return new NS.PropertyInterpolationAdapter.NoInterpolationAdapter(this)}case "numeric":case "number":case "angle":{if(propertyType==="combo")return new NS.PropertyInterpolationAdapter.NoInterpolationAdapter(this);return new NS.PropertyInterpolationAdapter.NumericInterpolationAdapter(this)}case "color":case "offsetColor":{return new NS.PropertyInterpolationAdapter.ColorInterpolationAdapter(this)}}}_SaveToJson(){return{"propertyAdapterJson":this.GetPropertyAdapter()._SaveToJson()}}_LoadFromJson(o){if(!o)return; +this.GetPropertyAdapter()._LoadFromJson(o["propertyAdapterJson"])}static GetValueAtTime(propertyTrack){const track=propertyTrack.GetTrack();const time=track.GetTimeline().GetTime();const start=NS.GetStartPropertyKeyframeForTime(time,propertyTrack);const end=NS.GetEndPropertyKeyframeForTime(time,propertyTrack);const interpolateFunc=NS.PropertySourceAdapter.GetInterpolateFunc(propertyTrack);return interpolateFunc(time,start,end,propertyTrack)}static GetValue(propertyTrack,initialValue,value){let resultMode= +propertyTrack.GetResultMode();if(propertyTrack.GetPropertyType()==="combo")resultMode="absolute";switch(resultMode){case "relative":return initialValue+value;case "absolute":return value}}static GetInterpolateFunc(propertyTrack){const type=propertyTrack.GetPropertyKeyframeType();switch(type){case "numeric":return NS.NumericTypeAdapter.Interpolate;case "angle":return NS.AngleTypeAdapter.Interpolate;case "boolean":return NS.BooleanTypeAdapter.Interpolate;case "color":return NS.ColorTypeAdapter.Interpolate; +case "text":return NS.TextTypeAdapter.Interpolate}}static GetWillChangeFunc(propertyTrack){const type=propertyTrack.GetPropertyKeyframeType();switch(type){case "numeric":return NS.NumericTypeAdapter.WillChange;case "angle":return NS.AngleTypeAdapter.WillChange;case "boolean":return NS.BooleanTypeAdapter.WillChange;case "color":return NS.ColorTypeAdapter.WillChange;case "text":return NS.TextTypeAdapter.WillChange}}}}; + + +// c3/timelines/state/propertySourceAdapters/worldInstanceSourceAdapter.js +'use strict';{const C3=self.C3;class WorldInstanceSourceAdapter extends C3.PropertyTrackState.PropertySourceAdapter{constructor(propertyTrack){super(propertyTrack)}}C3.PropertyTrackState.WorldInstanceSourceAdapter=WorldInstanceSourceAdapter}; + + +// c3/timelines/state/propertySourceAdapters/instanceVariableSourceAdapter.js +'use strict';{const C3=self.C3;const INDEX=0;class InstanceVariableSourceAdapter extends C3.PropertyTrackState.PropertySourceAdapter{constructor(propertyTrack){super(propertyTrack);this._updatedIndex=NaN}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[INDEX]}GetIndex(){if(this._updatedIndex)return this._updatedIndex;return super.GetIndex()}GetTarget(){return this._propertyTrack.GetTrack().GetInstance()}UpdateInstanceVariableIndex(index){const i=this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[INDEX]; +if(i===index)return;this._updatedIndex=index}Interpolate(time,start,end,setTime,noChange,ensureValue){if(!this.GetPropertyAdapter().CanChange(start.GetValue()))return;return super.Interpolate(time,start,end,setTime,noChange,ensureValue)}_SaveToJson(){return Object.assign(super._SaveToJson(),{"index":this._updatedIndex})}_LoadFromJson(o){if(!o)return;super._LoadFromJson(o);this._updatedIndex=o["index"]}}C3.PropertyTrackState.InstanceVariableSourceAdapter=InstanceVariableSourceAdapter}; + + +// c3/timelines/state/propertySourceAdapters/behaviorSourceAdapter.js +'use strict';{const C3=self.C3;const SID=0;const INDEX=1;const NAME=2;class BehaviorSourceAdapter extends C3.PropertyTrackState.PropertySourceAdapter{constructor(propertyTrack){super(propertyTrack);this._sid=NaN}GetEditorIndex(){const dataItem=this._propertyTrack.GetPropertyTrackDataItem();return dataItem.GetSourceAdapterArguments()[INDEX]}GetTarget(){const dataItem=this._propertyTrack.GetPropertyTrackDataItem();const track=this._propertyTrack.GetTrack();const sid=this._sid?this._sid:dataItem.GetSourceAdapterArguments()[SID]; +const instance=track.GetInstance();const index=instance.GetBehaviorIndexBySID(sid);const behaviorInstance=instance.GetBehaviorInstances()[index];return behaviorInstance.GetSdkInstance()}GetBehaviorType(objectClass){const dataItem=this._propertyTrack.GetPropertyTrackDataItem();const name=dataItem.GetSourceAdapterArguments()[NAME];return objectClass.GetBehaviorTypeByName(name)}UpdateBehaviorTypeSid(sid){const dataItem=this._propertyTrack.GetPropertyTrackDataItem();if(dataItem.GetSourceAdapterArguments()[SID]=== +sid)return;this._sid=sid}Interpolate(time,start,end,setTime,noChange,ensureValue){const track=this._propertyTrack.GetTrack();const instance=track.GetInstance();if(!this.GetBehaviorType(instance.GetObjectClass()))return;return super.Interpolate(time,start,end,setTime,noChange,ensureValue)}_SaveToJson(){return Object.assign(super._SaveToJson(),{"sid":this._sid})}_LoadFromJson(o){if(!o)return;super._LoadFromJson(o);this._sid=o["sid"]}}C3.PropertyTrackState.BehaviorSourceAdapter=BehaviorSourceAdapter}; + + +// c3/timelines/state/propertySourceAdapters/effectSourceAdapter.js +'use strict';{const C3=self.C3;const NAME=0;const INDEX=1;class EffectSourceAdapter extends C3.PropertyTrackState.PropertySourceAdapter{constructor(propertyTrack){super(propertyTrack)}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[INDEX]}GetTarget(){const pTrack=this._propertyTrack;const track=pTrack.GetTrack();const worldInfo=track.GetWorldInfo();const instanceEffectList=worldInfo.GetInstanceEffectList();const effectList=instanceEffectList.GetEffectList(); +const effectType=this.GetEffectType(effectList);const effectIndex=effectType.GetIndex();if(instanceEffectList.IsEffectIndexActive(effectIndex))return instanceEffectList.GetEffectParametersForIndex(effectIndex);return null}GetEffectType(effectList){const pTrack=this._propertyTrack;const name=pTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[NAME];return effectList.GetEffectTypeByName(name)}Interpolate(time,start,end,setTime,noChange,ensureValue){if(!this._IsEffectActive())return;return super.Interpolate(time, +start,end,setTime,noChange,ensureValue)}_IsEffectActive(){const pTrack=this._propertyTrack;const track=pTrack.GetTrack();const worldInfo=track.GetWorldInfo();const instanceEffectList=worldInfo.GetInstanceEffectList();const effectList=instanceEffectList.GetEffectList();const effectType=this.GetEffectType(effectList);if(!effectType)return;const effectIndex=effectType.GetIndex();return instanceEffectList.IsEffectIndexActive(effectIndex)}}C3.PropertyTrackState.EffectSourceAdapter=EffectSourceAdapter}; + + +// c3/timelines/state/propertySourceAdapters/pluginSourceAdapter.js +'use strict';{const C3=self.C3;const INDEX=0;class PluginSourceAdapter extends C3.PropertyTrackState.PropertySourceAdapter{constructor(propertyTrack){super(propertyTrack)}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[INDEX]}GetTarget(){return this._propertyTrack.GetTrack().GetInstance().GetSdkInstance()}Interpolate(time,start,end,setTime,noChange,ensureValue){const track=this._propertyTrack.GetTrack();const templatePlugin=track.GetObjectClass().GetPlugin(); +const currentPlugin=track.GetInstance().GetObjectClass().GetPlugin();if(templatePlugin!==currentPlugin)return;return super.Interpolate(time,start,end,setTime,noChange,ensureValue)}}C3.PropertyTrackState.PluginSourceAdapter=PluginSourceAdapter}; + + +// c3/timelines/state/propertySourceAdapters/valueSourceAdapter.js +'use strict';{const C3=self.C3;class ValueSourceAdapter extends C3.PropertyTrackState.PropertySourceAdapter{constructor(propertyTrack){super(propertyTrack);this._value=0;this._init=false}SetInitialState(){const propertyTrackData=this._propertyTrack.GetPropertyTrackData();let propertyTrackDataItem=this._propertyTrack.GetPropertyTrackDataItem();propertyTrackDataItem=propertyTrackData.GetFirstPropertyKeyframeDataItem(propertyTrackDataItem);this._value=propertyTrackDataItem.GetValueWithResultMode()}SetResumeState(){}GetValue(){if(!this._init)this._propertyTrack.Interpolate(0); +return this._value}Interpolate(time,start,end,setTime,noChange,ensureValue){const interpolateFunc=C3.PropertyTrackState.NumericTypeAdapter.Interpolate;this._value=interpolateFunc(time,start,end,this._propertyTrack);this._init=true}SaveState(){}ClearSaveState(){}GetCurrentState(){return this._value}CompareInitialStateWithCurrent(){return false}CompareSaveStateWithCurrent(){return false}_SaveToJson(){return{"value":this._value,"init":this._init}}_LoadFromJson(o){if(!o)return;this._value=o["value"]; +this._init=o.hasOwnProperty("init")?o["init"]:true}}C3.PropertyTrackState.ValueSourceAdapter=ValueSourceAdapter}; + + +// c3/timelines/state/propertyInterpolationAdapters/propertyInterpolationAdapter.js +'use strict';{const C3=self.C3;C3.PropertyTrackState.PropertyInterpolationAdapter=class PropertyInterpolationAdapter{constructor(sourceAdapter){this._sourceAdapter=sourceAdapter;this._propertyTrack=sourceAdapter.GetPropertyTrack();this._worldInfo=this._propertyTrack.GetTrack().GetWorldInfo();this._property=this._propertyTrack.GetPropertyName();this._firstAbsoluteUpdate=false;this._saveState=null;this._target=null}Release(){this._sourceAdapter=null;this._propertyTrack=null;this._worldInfo=null;this._saveState= +null;this._target=null}CleanCaches(){this._worldInfo=null;this._saveState=null;this._target=null}GetPropertyTrack(){return this._propertyTrack}GetWorldInfo(){if(this._worldInfo)return this._worldInfo;this._worldInfo=this._propertyTrack.GetTrack().GetWorldInfo();return this._worldInfo}SetFirstAbsoluteUpdate(f){this._firstAbsoluteUpdate=!!f}GetFirstAbsoluteUpdate(){return this._firstAbsoluteUpdate}SetInitialState(){}SetResumeState(){}SetSaveState(){this._saveState=this.GetCurrentState()}ClearSaveState(){this._saveState= +null}GetCurrentState(){}CompareInitialStateWithCurrent(){}CompareSaveStateWithCurrent(){}CanChange(value){const targetType=typeof this._Getter();const newType=typeof value;return targetType===newType}BeforeChangeProperty(){}ChangeProperty(time,value,start,end,setTime){}AfterChangeProperty(){}_FirstKeyframeGetter(){const propertyKeyframeDataItem=this._PickTimelinePlaybackMode(()=>{const propertyTrackDataItem=this._propertyTrack.GetPropertyTrackDataItem();const propertyTrackData=this._propertyTrack.GetPropertyTrackData(); +return propertyTrackData.GetFirstPropertyKeyframeDataItem(propertyTrackDataItem)},()=>{const propertyTrackDataItem=this._propertyTrack.GetPropertyTrackDataItem();const propertyTrackData=this._propertyTrack.GetPropertyTrackData();return propertyTrackData.GetLastPropertyKeyframeDataItem(propertyTrackDataItem)});return propertyKeyframeDataItem.GetAbsoluteValue()}_CurrentKeyframeGetter(){const timeline=this._propertyTrack.GetTimeline();const time=timeline.GetTime()-this._propertyTrack.GetTrack().GetStartOffset(); +const propertyKeyframe=this._PickTimelinePlaybackMode(()=>{const propertyTrackDataItem=this._propertyTrack.GetPropertyTrackDataItem();const propertyTrackData=this._propertyTrack.GetPropertyTrackData();return propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(time,propertyTrackDataItem)},()=>{const propertyTrackDataItem=this._propertyTrack.GetPropertyTrackDataItem();const propertyTrackData=this._propertyTrack.GetPropertyTrackData();const ret=propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(time, +propertyTrackDataItem);if(!ret)return propertyTrackData.GetLastPropertyKeyframeDataItem(propertyTrackDataItem);return ret});return propertyKeyframe.GetAbsoluteValue()}_PickTimelinePlaybackMode(forwardFunc,backwardFunc){const timeline=this._propertyTrack.GetTimeline();return timeline.IsForwardPlayBack()?forwardFunc():backwardFunc()}_PickResultMode(relativeFunc,absoluteFunc){const resultMode=this._propertyTrack.GetResultMode();return resultMode==="relative"?relativeFunc():absoluteFunc()}_PickFirstAbsoluteUpdate(firstFunc, +otherFunc){if(this.GetFirstAbsoluteUpdate()){this.SetFirstAbsoluteUpdate(false);return firstFunc()}else return otherFunc()}_GetAbsoluteInitialValue(keyframeValue){}_GetIndex(){return this._sourceAdapter.GetIndex()}_GetTarget(){if(this._target)return this._target;this._target=this._sourceAdapter.GetTarget();return this._target}_PickSource(bFunc,eFunc,ivFunc,pFunc,wiFunc){const id=this._propertyTrack.GetSourceAdapterId();switch(id){case "behavior":return bFunc();case "effect":return eFunc();case "instance-variable":return ivFunc(); +case "plugin":return pFunc();case "world-instance":return wiFunc()}}_SaveToJson(){return{"firstAbsoluteUpdate":this._firstAbsoluteUpdate,"saveState":this._saveState}}_LoadFromJson(o){if(!o)return;this._firstAbsoluteUpdate=o["firstAbsoluteUpdate"];this._saveState=o["saveState"]}_GetPropertyKeyframeStubs(propertyTracks,firstOnly=false){const ret=[];for(const propertyTrack of propertyTracks){const startOffset=propertyTrack.GetTrack().GetStartOffset();for(const propertyKeyframeDataItem of propertyTrack.GetPropertyKeyframeDataItems())if(firstOnly&& +propertyKeyframeDataItem.GetTime()===0)ret.push({time:startOffset+propertyKeyframeDataItem.GetTime(),value:propertyKeyframeDataItem.GetAbsoluteValue()});else if(!firstOnly)ret.push({time:startOffset+propertyKeyframeDataItem.GetTime(),value:propertyKeyframeDataItem.GetAbsoluteValue()})}return ret.sort((f,s)=>f.time-s.time)}_GetLastPropertyKeyframeStub(timeline,time,propertyKeyframeStubs){return this._GetPropertyKeyframeStubLowerThanPlayhead(time,propertyKeyframeStubs)}_GetPropertyKeyframeStubLowerThanPlayhead(time, +propertyKeyframeStubs){for(let i=propertyKeyframeStubs.length-1;i>=0;i--){const stubTime=propertyKeyframeStubs[i].time;if(stubTime<=time)return propertyKeyframeStubs[i]}return null}}}; + + +// c3/timelines/state/propertyInterpolationAdapters/colorInterpolationAdapter.js +'use strict';{const C3=self.C3;const TMP_COLORS_MAP=new Map;const TMP_COLOR=[0,0,0];class ColorInterpolationAdapter extends C3.PropertyTrackState.PropertyInterpolationAdapter{constructor(sourceAdapter){super(sourceAdapter)}SetInitialState(){}SetResumeState(){}GetCurrentState(){const id=this._propertyTrack.GetSourceAdapterId();const target=this._GetTarget();const index=this._GetIndex();switch(id){case "behavior":return this._ToColorArray(target.GetPropertyValueByIndex(index));case "effect":return this._ToColorArray(target[index]); +case "plugin":return this._ToColorArray(target.GetPropertyValueByIndex(index));case "world-instance":return this._ToColorArray(this._Getter())}}CompareInitialStateWithCurrent(){const firstKeyframeColor=this._FirstKeyframeGetter();return!this._CompareColors(firstKeyframeColor,this._Getter())}CompareSaveStateWithCurrent(){if(C3.IsNullOrUndefined(this._saveState))return false;return!this._CompareColors(this._saveState,this._Getter())}_CompareColors(fColor,sColor){return fColor.equalsIgnoringAlpha(sColor)}_FirstKeyframeGetter(){const color= +super._FirstKeyframeGetter();return this._GetColorFromArray(color)}_CurrentKeyframeGetter(){const color=super._CurrentKeyframeGetter();return this._GetColorFromArray(color)}_GetAbsoluteInitialValue(value){}_ToColorArray(color){if(C3.IsInstanceOf(color,C3.Color))return color.toArray().slice(0,3);return color.slice(0,3)}_GetColorFromArray(color){if(C3.IsInstanceOf(color,C3.Color))return color;return new C3.Color(color[0],color[1],color[2],1)}CanChange(value){return true}BeforeChangeProperty(){const instance= +this._propertyTrack.GetInstance();if(!TMP_COLORS_MAP.has(instance))TMP_COLORS_MAP.set(instance,new Map);const instanceMap=TMP_COLORS_MAP.get(instance);const id=this._propertyTrack.GetSourceAdapterId();if(!instanceMap.has(id))instanceMap.set(id,new Map);const sourceMap=instanceMap.get(id);if(!sourceMap.has(this._property))sourceMap.set(this._property,{used:false,color:new C3.Color(0,0,0,1)})}_GetTmpColor(instance,sourceId,propertyName){const tmpColorObj=TMP_COLORS_MAP.get(instance).get(sourceId).get(propertyName); +tmpColorObj.used=true;return tmpColorObj.color}ChangeProperty(time,value,start,end,setTime){const timeline=this._propertyTrack.GetTimeline();const track=this._propertyTrack.GetTrack();const instance=this._propertyTrack.GetInstance();const sourceAdapter=this._propertyTrack.GetSourceAdapter();const sourceAdapterId=this._propertyTrack.GetSourceAdapterId();const property=this._property;const propertyTracks=timeline.GetSimilarPropertyTracks(instance,sourceAdapter,property);if(propertyTracks.length>1){const propertyKeyframeStubs= +this._GetPropertyKeyframeStubs(propertyTracks,true);const stub=this._GetLastPropertyKeyframeStub(timeline,timeline.GetTime(),propertyKeyframeStubs);if(stub){const startOffset=track.GetStartOffset();const t=stub.time-startOffset;if(t===0)this._GetTmpColor(instance,sourceAdapterId,this._property).addRgb(value[0],value[1],value[2]);else{if(t<0)return;const r=value[0];const g=value[1];const b=value[2];const v=this._propertyTrack.Interpolate(t,false,true);const dr=C3.Color.DiffChannel(r,v[0]);const dg= +C3.Color.DiffChannel(g,v[1]);const db=C3.Color.DiffChannel(b,v[2]);this._GetTmpColor(instance,sourceAdapterId,this._property).addRgb(dr,dg,db)}}}else this._Setter(value[0],value[1],value[2]);return C3.TimelineState.LAYOUT_RENDER_CHANGE}AfterChangeProperty(){const instance=this._propertyTrack.GetInstance();if(!TMP_COLORS_MAP.has(instance))return;const instanceMap=TMP_COLORS_MAP.get(instance);const id=this._propertyTrack.GetSourceAdapterId();if(!instanceMap.has(id))return;const sourceMap=instanceMap.get(id); +if(!sourceMap.has(this._property))return;const tmpColorObj=sourceMap.get(this._property);const used=tmpColorObj.used;const color=tmpColorObj.color;if(used)this._Setter(color.getR(),color.getG(),color.getB());if(sourceMap.size===0)instanceMap.delete(id);if(instanceMap.size===0)TMP_COLORS_MAP.delete(instance)}_Getter(){const id=this._propertyTrack.GetSourceAdapterId();const target=this._GetTarget();const index=this._GetIndex();switch(id){case "behavior":return this._GetColorFromArray(target.GetPropertyValueByIndex(index)); +case "effect":return target[index].clone();case "plugin":return this._GetColorFromArray(target.GetPropertyValueByIndex(index));case "world-instance":return this.GetWorldInfo().GetUnpremultipliedColor().clone()}}_Setter(r,g,b){const id=this._propertyTrack.GetSourceAdapterId();const target=this._GetTarget();const index=this._GetIndex();switch(id){case "behavior":TMP_COLOR[0]=r;TMP_COLOR[1]=g;TMP_COLOR[2]=b;target.SetPropertyValueByIndex(index,TMP_COLOR);break;case "effect":target[index].setRgb(r,g, +b);break;case "plugin":TMP_COLOR[0]=r;TMP_COLOR[1]=g;TMP_COLOR[2]=b;target.SetPropertyValueByIndex(index,TMP_COLOR);break;case "world-instance":this.GetWorldInfo().SetUnpremultipliedColorRGB(r,g,b);break}}_SaveToJson(){}_LoadFromJson(o){}}C3.PropertyTrackState.PropertyInterpolationAdapter.ColorInterpolationAdapter=ColorInterpolationAdapter}; + + +// c3/timelines/state/propertyInterpolationAdapters/noInterpolationAdapter.js +'use strict';{const C3=self.C3;class NoInterpolationAdapter extends C3.PropertyTrackState.PropertyInterpolationAdapter{constructor(sourceAdapter){super(sourceAdapter)}SetInitialState(){}SetResumeState(){}GetCurrentState(){return this._Getter()}CompareInitialStateWithCurrent(){const firstKeyframeValue=this._FirstKeyframeGetter();return firstKeyframeValue!==this.GetCurrentState()}CompareSaveStateWithCurrent(){if(C3.IsNullOrUndefined(this._saveState))return false;return this._saveState!==this.GetCurrentState()}ChangeProperty(time, +value,start,end,setTime){const willChangeFunc=C3.PropertyTrackState.PropertySourceAdapter.GetWillChangeFunc(this._propertyTrack);const propertyTrack=this._propertyTrack;const track=propertyTrack.GetTrack();const id=propertyTrack.GetSourceAdapterId();const timeline=propertyTrack.GetTimeline();const instance=track.GetInstance();const sourceAdapter=propertyTrack.GetSourceAdapter();const property=this._property;const propertyTracks=timeline.GetSimilarPropertyTracks(instance,sourceAdapter,property);if(propertyTracks.length> +1){const propertyKeyframeStubs=this._GetPropertyKeyframeStubs(propertyTracks);const t=time+track.GetStartOffset();const stub=this._GetLastPropertyKeyframeStub(timeline,t,propertyKeyframeStubs);if(stub)value=stub.value}const change=willChangeFunc(this._GetIndex(),this._GetTarget(),value,id);if(!change)return;this._Setter(value);switch(id){case "behavior":return;case "effect":return;case "instance-variable":return;case "plugin":return C3.TimelineState.LAYOUT_RENDER_CHANGE}}_Getter(){const id=this._propertyTrack.GetSourceAdapterId(); +const target=this._GetTarget();const index=this._GetIndex();switch(id){case "behavior":return target.GetPropertyValueByIndex(index);case "effect":return target[index];case "instance-variable":return target.GetInstanceVariableValue(index);case "plugin":return target.GetPropertyValueByIndex(index)}}_Setter(value){const id=this._propertyTrack.GetSourceAdapterId();const target=this._GetTarget();const index=this._GetIndex();switch(id){case "behavior":target.SetPropertyValueByIndex(index,value);break;case "effect":target[index]= +value;break;case "instance-variable":target.SetInstanceVariableValue(index,value);break;case "plugin":target.SetPropertyValueByIndex(index,value);break}}}C3.PropertyTrackState.PropertyInterpolationAdapter.NoInterpolationAdapter=NoInterpolationAdapter}; + + +// c3/timelines/state/propertyInterpolationAdapters/numericInterpolationAdapter.js +'use strict';{const C3=self.C3;const NS=C3.PropertyTrackState.PropertyInterpolationAdapter;const INSTANCE_FUNC_MAP=new Map;const add=(prop,setter,absolute_setter,getter,round)=>INSTANCE_FUNC_MAP.set(prop,{setter,absolute_setter,getter,round});add("offsetX",(wi,v)=>wi.OffsetX(v),(wi,v)=>wi.SetX(v),wi=>wi.GetX(),true);add("offsetY",(wi,v)=>wi.OffsetY(v),(wi,v)=>wi.SetY(v),wi=>wi.GetY(),true);add("offsetWidth",(wi,v)=>wi.OffsetWidth(v),(wi,v)=>wi.SetWidth(v),wi=>wi.GetWidth(),true);add("offsetHeight", +(wi,v)=>wi.OffsetHeight(v),(wi,v)=>wi.SetHeight(v),wi=>wi.GetHeight(),true);add("offsetAngle",(wi,v)=>wi.OffsetAngle(v),(wi,v)=>wi.SetAngle(v),wi=>wi.GetAngle(),false);add("offsetOpacity",(wi,v)=>wi.OffsetOpacity(v),(wi,v)=>wi.SetOpacity(v),wi=>wi.GetOpacity(),false);add("offsetOriginX",(wi,v)=>wi.OffsetOriginX(v),(wi,v)=>wi.SetOriginX(v),wi=>wi.GetOriginX(),false);add("offsetOriginY",(wi,v)=>wi.OffsetOriginY(v),(wi,v)=>wi.SetOriginY(v),wi=>wi.GetOriginY(),false);add("offsetZElevation",(wi,v)=>wi.OffsetZElevation(v), +(wi,v)=>wi.SetZElevation(v),wi=>wi.GetZElevation(),true);add("offsetScaleX",(wi,v,t)=>{wi.OffsetWidth(t.GetOriginalWidth()*v)},(wi,v,t)=>{wi.SetWidth(t.GetOriginalWidth()*v)},(wi,t)=>{return wi.GetWidth()/t.GetOriginalWidth()},false);add("offsetScaleY",(wi,v,t)=>{wi.OffsetHeight(t.GetOriginalHeight()*v)},(wi,v,t)=>{wi.SetHeight(t.GetOriginalHeight()*v)},(wi,t)=>{return wi.GetHeight()/t.GetOriginalHeight()},false);class NumericInterpolationAdapter extends C3.PropertyTrackState.PropertyInterpolationAdapter{constructor(sourceAdapter){super(sourceAdapter); +this._lastValue=0;this._instance_getter=null;this._instance_setter=null;this._instance_absolute_setter=null;this._round=false;if(C3.IsInstanceOf(this._propertyTrack.GetTimeline(),C3.Tween))this._typeAdapter=new C3.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTween(this);else this._typeAdapter=new C3.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTimeline(this);const property=this._propertyTrack.GetPropertyName();if(this._propertyTrack.GetSourceAdapterId()=== +"world-instance"){const p=INSTANCE_FUNC_MAP.get(property);this._instance_getter=p.getter;this._instance_setter=p.setter;this._instance_absolute_setter=p.absolute_setter;this._round=p.round}}Release(){this._typeAdapter=null;this._instance_getter=null;this._instance_setter=null;this._instance_absolute_setter=null;super.Release()}GetLastValue(){return this._lastValue}SetLastValue(v){this._lastValue=v}SetInitialState(){const initValue=this._typeAdapter.SetInitialState();if(typeof initValue==="number")this._lastValue= +initValue}SetResumeState(){const resumeValue=this._typeAdapter.SetResumeState();if(typeof resumeValue==="number")this._lastValue=resumeValue}GetCurrentState(){return this._Getter()}CompareInitialStateWithCurrent(){const firstKeyframeValue=this._FirstKeyframeGetter();return firstKeyframeValue!==this.GetCurrentState()}CompareSaveStateWithCurrent(){if(C3.IsNullOrUndefined(this._saveState))return false;return this._saveState!==this.GetCurrentState()}BeforeChangeProperty(){this._typeAdapter.BeforeChangeProperty()}ChangeProperty(time, +value,start,end,setTime,ensureValue){return this._typeAdapter.ChangeProperty(time,value,start,end,setTime,ensureValue)}AfterChangeProperty(){this._typeAdapter.AfterChangeProperty()}_Getter(){const target=this._GetTarget();const index=this._GetIndex();const track=this._propertyTrack.GetTrack();const wi=this.GetWorldInfo();return this._PickSource(()=>target.GetPropertyValueByIndex(index),()=>target[index],()=>target.GetInstanceVariableValue(index),()=>target.GetPropertyValueByIndex(index),()=>this._instance_getter(wi, +track))}_Setter(value,start,end){const target=this._GetTarget();const index=this._GetIndex();const track=this._propertyTrack.GetTrack();const wi=this.GetWorldInfo();this._PickSource(()=>target.OffsetPropertyValueByIndex(index,value),()=>target[index]+=value,()=>target.SetInstanceVariableOffset(index,value),()=>target.OffsetPropertyValueByIndex(index,value),()=>this._instance_setter(wi,value,track))}_SetterAbsolute(value,start,end){const target=this._GetTarget();const index=this._GetIndex();const track= +this._propertyTrack.GetTrack();const wi=this.GetWorldInfo();this._PickSource(()=>target.SetPropertyValueByIndex(index,value),()=>target[index]=value,()=>target.SetInstanceVariableValue(index,value),()=>target.SetPropertyValueByIndex(index,value),()=>this._instance_absolute_setter(wi,value,track))}_MaybeEnsureValue(time,start,end,setTime,lastValue,currentValue){this._typeAdapter._MaybeEnsureValue(time,start,end,setTime,lastValue,currentValue)}_AddDelta(value,start,end){const stringValue=value.toString(); +const decimalsString=stringValue.split(".")[1]||"";const decimalPlaces=decimalsString.length;const v=this._Getter();let rv;if(decimalPlaces===0)rv=this._round?Math.round(v):v;else rv=C3.toFixed(v,decimalPlaces);this._Setter(rv-v,start,end)}_SaveToJson(){return Object.assign(super._SaveToJson(),{"v":this._lastValue})}_LoadFromJson(o){if(!o)return;super._LoadFromJson(o);this._lastValue=o["v"]}}C3.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapter=NumericInterpolationAdapter}; + + +// c3/timelines/state/propertyInterpolationAdapters/numericInterpolationAdapterForTimeline.js +'use strict';{const C3=self.C3;const TMP_ABSOLUTE_VALUES_MAP=new Map;class NumericInterpolationAdapterForTimeline{constructor(numericInterpolationAdapter){this._numericInterpolationAdapter=numericInterpolationAdapter}Release(){this._numericInterpolationAdapter=null}SetInitialState(){const adapter=this._numericInterpolationAdapter;const propertyTrack=this._numericInterpolationAdapter.GetPropertyTrack();return adapter._PickResultMode(()=>{return adapter._PickTimelinePlaybackMode(()=>0,()=>C3.PropertyTrackState.PropertySourceAdapter.GetValueAtTime(propertyTrack))}, +()=>{})}SetResumeState(){}BeforeChangeProperty(){const adapter=this._numericInterpolationAdapter;const propertyTrack=this._numericInterpolationAdapter.GetPropertyTrack();const property=propertyTrack.GetPropertyName();adapter._PickResultMode(()=>{},()=>{const instance=propertyTrack.GetInstance();if(!TMP_ABSOLUTE_VALUES_MAP.has(instance))TMP_ABSOLUTE_VALUES_MAP.set(instance,new Map);const instanceMap=TMP_ABSOLUTE_VALUES_MAP.get(instance);const id=propertyTrack.GetSourceAdapterId();if(!instanceMap.has(id))instanceMap.set(id, +new Map);const sourceMap=instanceMap.get(id);if(!sourceMap.has(property))sourceMap.set(property,{used:false,value:0})})}_GetTmpAbsoluteValueObject(instance,sourceId,propertyName){const tmpAbsoluteValueObj=TMP_ABSOLUTE_VALUES_MAP.get(instance).get(sourceId).get(propertyName);tmpAbsoluteValueObj.used=true;return tmpAbsoluteValueObj}ChangeProperty(time,value,start,end,setTime,ensureValue){const adapter=this._numericInterpolationAdapter;const propertyTrack=this._numericInterpolationAdapter.GetPropertyTrack(); +const property=propertyTrack.GetPropertyName();adapter._PickResultMode(()=>{const lastValue=adapter.GetLastValue();adapter._Setter(value-lastValue,start,end);if(ensureValue)this._MaybeEnsureValue(time,start,end,setTime,lastValue,value);adapter.SetLastValue(value)},()=>{const timeline=propertyTrack.GetTimeline();const track=propertyTrack.GetTrack();const instance=propertyTrack.GetInstance();const sourceAdapter=propertyTrack.GetSourceAdapter();const sourceAdapterId=propertyTrack.GetSourceAdapterId(); +const propertyTracks=timeline.GetSimilarPropertyTracks(instance,sourceAdapter,property);if(propertyTracks.length>1){const propertyKeyframeStubs=adapter._GetPropertyKeyframeStubs(propertyTracks,true);const stub=adapter._GetLastPropertyKeyframeStub(timeline,timeline.GetTime(),propertyKeyframeStubs);if(stub){const startOffset=track.GetStartOffset();const t=stub.time-startOffset;if(t===0){const valueObj=this._GetTmpAbsoluteValueObject(instance,sourceAdapterId,property);valueObj.value+=value}else{if(t< +0)return;const v=propertyTrack.Interpolate(t,false,true);const valueObj=this._GetTmpAbsoluteValueObject(instance,sourceAdapterId,property);valueObj.value+=value-v}}}else adapter._SetterAbsolute(value)});return adapter._PickSource(()=>{},()=>C3.TimelineState.LAYOUT_RENDER_CHANGE,()=>{},()=>C3.TimelineState.LAYOUT_RENDER_CHANGE,()=>C3.TimelineState.LAYOUT_RENDER_CHANGE)}AfterChangeProperty(){const adapter=this._numericInterpolationAdapter;const propertyTrack=this._numericInterpolationAdapter.GetPropertyTrack(); +const property=propertyTrack.GetPropertyName();adapter._PickResultMode(()=>{},()=>{const instance=propertyTrack.GetInstance();if(!TMP_ABSOLUTE_VALUES_MAP.has(instance))return;const instanceMap=TMP_ABSOLUTE_VALUES_MAP.get(instance);const id=propertyTrack.GetSourceAdapterId();if(!instanceMap.has(id))return;const sourceMap=instanceMap.get(id);if(!sourceMap.has(property))return;const tmpValueObj=sourceMap.get(property);const used=tmpValueObj.used;const value=tmpValueObj.value;if(used)adapter._SetterAbsolute(value); +sourceMap.delete(property);if(sourceMap.size===0)instanceMap.delete(id);if(instanceMap.size===0)TMP_ABSOLUTE_VALUES_MAP.delete(instance)})}_MaybeEnsureValue(time,start,end,setTime,lastValue,currentValue){const adapter=this._numericInterpolationAdapter;if(setTime)return;if(start&&time===start.GetTime())adapter._AddDelta(start.GetValueWithResultMode(),start,end);else if(end&&time===end.GetTime())adapter._AddDelta(end.GetValueWithResultMode(),start,end);else if(currentValue-lastValue===0)adapter._AddDelta(start.GetValueWithResultMode(), +start,end)}}C3.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTimeline=NumericInterpolationAdapterForTimeline}; + + +// c3/timelines/state/propertyInterpolationAdapters/numericInterpolationAdapterForTween.js +'use strict';{const C3=self.C3;const TMP_ABSOLUTE_VALUES_MAP=new Map;class NumericInterpolationAdapterForTween{constructor(numericInterpolationAdapter){this._numericInterpolationAdapter=numericInterpolationAdapter}Release(){this._numericInterpolationAdapter=null}SetInitialState(){const adapter=this._numericInterpolationAdapter;adapter.SetFirstAbsoluteUpdate(true);return this._GetAbsoluteInitialValue(adapter._FirstKeyframeGetter())}SetResumeState(){const adapter=this._numericInterpolationAdapter;if(adapter._FirstKeyframeGetter()=== +adapter._CurrentKeyframeGetter())return;adapter.SetFirstAbsoluteUpdate(true);return this._GetAbsoluteInitialValue(adapter._CurrentKeyframeGetter())}BeforeChangeProperty(){}ChangeProperty(time,value,start,end,setTime,ensureValue){const adapter=this._numericInterpolationAdapter;const lastValue=adapter.GetLastValue();adapter._PickResultMode(()=>{adapter._Setter(value-lastValue,start,end);if(ensureValue)this._MaybeEnsureValue(time,start,end,setTime,lastValue,value)},()=>{adapter._PickFirstAbsoluteUpdate(()=> +{adapter._Setter(lastValue,start,end)},()=>{adapter._Setter(value-lastValue,start,end);if(ensureValue)this._MaybeEnsureValue(time,start,end,setTime,lastValue,value)})});adapter.SetLastValue(value);return adapter._PickSource(()=>{},()=>C3.TimelineState.LAYOUT_RENDER_CHANGE,()=>{},()=>C3.TimelineState.LAYOUT_RENDER_CHANGE,()=>C3.TimelineState.LAYOUT_RENDER_CHANGE)}AfterChangeProperty(){}_GetAbsoluteInitialValue(keyframeValue){const adapter=this._numericInterpolationAdapter;return keyframeValue-adapter.GetCurrentState()}_MaybeEnsureValue(time, +start,end,setTime,lastValue,currentValue){const adapter=this._numericInterpolationAdapter;if(setTime)if(start&&time===start.GetTime())adapter._AddDelta(start.GetValueWithResultMode(),start,end);else if(end&&time===end.GetTime())adapter._AddDelta(end.GetValueWithResultMode(),start,end);else{if(!end)adapter._AddDelta(start.GetValueWithResultMode(),start,end)}else if(start&&time===start.GetTime())adapter._AddDelta(start.GetValueWithResultMode(),start,end);else if(end&&time===end.GetTime())adapter._AddDelta(end.GetValueWithResultMode(), +start,end);else if(currentValue-lastValue===0)adapter._AddDelta(start.GetValueWithResultMode(),start,end)}}C3.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTween=NumericInterpolationAdapterForTween}; + + +// c3/timelines/state/propertyTypeAdapters/numericTypeAdapter.js +'use strict';{const C3=self.C3;const Ease=self.Ease;C3.PropertyTrackState.NumericTypeAdapter=class NumericTypeAdapter{constructor(){}static WillChange(index,source,newValue,type){let oldValue;switch(type){case "behavior":oldValue=source.GetPropertyValueByIndex(index);break;case "effect":oldValue=source[index];break;case "instance-variable":oldValue=source.GetInstanceVariableValue(index);break;case "plugin":oldValue=source.GetPropertyValueByIndex(index);break}if(oldValue===newValue)return false;return true}static Interpolate(time, +start,end,propertyTrack){if(!end){let propertyTrackDataItem=propertyTrack.GetPropertyTrackDataItem();const propertyTrackData=propertyTrack.GetPropertyTrackData();propertyTrackDataItem=propertyTrackData.GetLastPropertyKeyframeDataItem(propertyTrackDataItem);return propertyTrackDataItem.GetValueWithResultMode()}let mode=propertyTrack.GetInterpolationMode();if(mode==="default")mode="continuous";if(propertyTrack.GetPropertyType()==="combo")mode="discrete";if(mode==="discrete")return start.GetValueWithResultMode(); +else if(mode==="continuous"||mode==="step"){if(mode==="step"){const step=propertyTrack.GetTimeline().GetStep();if(step!==0){const s=1/step;time=Math.floor(time*s)/s}}const st=start.GetTime();const et=end.GetTime();const sv=start.GetValueWithResultMode();const ev=end.GetValueWithResultMode();if(sv===ev)return sv;const n=C3.normalize(time,st,et);const e=start.GetEase();let ret;const startAddon=start.GetAddOn("cubic-bezier");const endAddon=end.GetAddOn("cubic-bezier");if(startAddon&&startAddon.GetStartEnable()&& +endAddon&&endAddon.GetEndEnable()){const dt=et-st;ret=Ease.GetRuntimeEase(e)(dt*n,0,1,dt);ret=Ease.GetRuntimeEase("cubicbezier")(ret,sv,sv+startAddon.GetStartAnchor(),ev+endAddon.GetEndAnchor(),ev)}else ret=Ease.GetRuntimeEase(e)((et-st)*n,sv,ev-sv,et-st);if(propertyTrack.GetPropertyType()==="integer")return Math.floor(ret);return ret}}}}; + + +// c3/timelines/state/propertyTypeAdapters/angleTypeAdapter.js +'use strict';{const C3=self.C3;C3.PropertyTrackState.AngleTypeAdapter=class AngleTypeAdapter{constructor(){}static WillChange(index,source,newValue,type){let oldValue;switch(type){case "behavior":oldValue=source.GetPropertyValueByIndex(index);break;case "effect":oldValue=source[index];break;case "instance-variable":oldValue=source.GetInstanceVariableValue(index);break;case "plugin":oldValue=source.GetPropertyValueByIndex(index);break}if(oldValue===newValue)return false;return true}static Interpolate(time, +start,end,propertyTrack){if(!end){let propertyTrackDataItem=propertyTrack.GetPropertyTrackDataItem();const propertyTrackData=propertyTrack.GetPropertyTrackData();propertyTrackDataItem=propertyTrackData.GetLastPropertyKeyframeDataItem(propertyTrackDataItem);return propertyTrackDataItem.GetValueWithResultMode()}let mode=propertyTrack.GetInterpolationMode();if(mode==="default")mode="continuous";if(propertyTrack.GetPropertyType()==="combo")mode="discrete";if(mode==="discrete")return start.GetValueWithResultMode(); +else if(mode==="continuous"||mode==="step"){if(mode==="step"){const step=propertyTrack.GetTimeline().GetStep();if(step!==0){const s=1/step;time=Math.floor(time*s)/s}}const st=start.GetTime();const et=end.GetTime();const sv=start.GetValueWithResultMode();const ev=end.GetValueWithResultMode();const angleAddon=start.GetAddOn("angle");if(angleAddon){const revolutions=angleAddon.GetRevolutions();if(sv===ev&&revolutions===0)return sv;const n=C3.normalize(time,st,et);const easeFunc=self.Ease.GetRuntimeEase(start.GetEase()); +const easeRes=easeFunc(n,0,1,1);switch(angleAddon.GetDirection()){case "closest":return C3.angleLerp(sv,ev,easeRes,revolutions);case "clockwise":return C3.angleLerpClockwise(sv,ev,easeRes,revolutions);case "anti-clockwise":return C3.angleLerpAntiClockwise(sv,ev,easeRes,revolutions)}}else{if(sv===ev)return sv;const n=C3.normalize(time,st,et);const easeFunc=self.Ease.GetRuntimeEase(start.GetEase());return C3.angleLerp(sv,ev,easeFunc(n,0,1,1))}}}}}; + + +// c3/timelines/state/propertyTypeAdapters/booleanTypeAdapter.js +'use strict';{const C3=self.C3;C3.PropertyTrackState.BooleanTypeAdapter=class BooleanTypeAdapter{constructor(){}static WillChange(index,source,newValue,type){let oldValue;switch(type){case "behavior":oldValue=source.GetPropertyValueByIndex(index);break;case "effect":oldValue=source[index];break;case "instance-variable":oldValue=source.GetInstanceVariableValue(index);break;case "plugin":oldValue=source.GetPropertyValueByIndex(index);break}if(!!oldValue===!!newValue)return false;return true}static Interpolate(time, +start,end,propertyTrack){if(!end){let propertyTrackDataItem=propertyTrack.GetPropertyTrackDataItem();const propertyTrackData=propertyTrack.GetPropertyTrackData();propertyTrackDataItem=propertyTrackData.GetLastPropertyKeyframeDataItem(propertyTrackDataItem);return propertyTrackDataItem.GetValueWithResultMode()?1:0}return start.GetValueWithResultMode()?1:0}}}; + + +// c3/timelines/state/propertyTypeAdapters/colorTypeAdapter.js +'use strict';{const C3=self.C3;const TEMP_COLOR_ARRAY=[0,0,0];const TEMP_COLOR_ARRAY_2=[0,0,0];const TEMP_COLOR_ARRAY_3=[0,0,0];C3.PropertyTrackState.ColorTypeAdapter=class ColorTypeAdapter{constructor(){}static WillChange(index,source,newValue,type){let oldValue;switch(type){case "behavior":oldValue=source.GetPropertyValueByIndex(index);break;case "effect":oldValue=source[index];break;case "instance-variable":oldValue=source.GetInstanceVariableValue(index);break;case "plugin":oldValue=source.GetPropertyValueByIndex(index); +break}if(Array.isArray(newValue)){TEMP_COLOR_ARRAY[0]=newValue[0];TEMP_COLOR_ARRAY[1]=newValue[1];TEMP_COLOR_ARRAY[2]=newValue[2]}else{TEMP_COLOR_ARRAY_3.parseCommaSeparatedRgb(newValue);TEMP_COLOR_ARRAY[0]=Math.floor(TEMP_COLOR_ARRAY_3.getR()*255);TEMP_COLOR_ARRAY[1]=Math.floor(TEMP_COLOR_ARRAY_3.getG()*255);TEMP_COLOR_ARRAY[2]=Math.floor(TEMP_COLOR_ARRAY_3.getB()*255)}if(Array.isArray(oldValue)){TEMP_COLOR_ARRAY_2[0]=oldValue[0];TEMP_COLOR_ARRAY_2[1]=oldValue[1];TEMP_COLOR_ARRAY_2[2]=oldValue[2]}else{TEMP_COLOR_ARRAY_3.parseCommaSeparatedRgb(oldValue); +TEMP_COLOR_ARRAY_2[0]=Math.floor(TEMP_COLOR_ARRAY_3.getR()*255);TEMP_COLOR_ARRAY_2[1]=Math.floor(TEMP_COLOR_ARRAY_3.getG()*255);TEMP_COLOR_ARRAY_2[2]=Math.floor(TEMP_COLOR_ARRAY_3.getB()*255)}if(TEMP_COLOR_ARRAY[0]!==TEMP_COLOR_ARRAY_2[0])return true;if(TEMP_COLOR_ARRAY[1]!==TEMP_COLOR_ARRAY_2[1])return true;if(TEMP_COLOR_ARRAY[2]!==TEMP_COLOR_ARRAY_2[2])return true;return false}static Interpolate(time,start,end,propertyTrack){if(!end){let propertyTrackDataItem=propertyTrack.GetPropertyTrackDataItem(); +const propertyTrackData=propertyTrack.GetPropertyTrackData();propertyTrackDataItem=propertyTrackData.GetLastPropertyKeyframeDataItem(propertyTrackDataItem);const color=propertyTrackDataItem.GetValueWithResultMode();TEMP_COLOR_ARRAY[0]=color[0];TEMP_COLOR_ARRAY[1]=color[1];TEMP_COLOR_ARRAY[2]=color[2];return TEMP_COLOR_ARRAY}let mode=propertyTrack.GetInterpolationMode();if(mode==="default")mode="continuous";if(mode==="discrete"){const color=start.GetValueWithResultMode();TEMP_COLOR_ARRAY[0]=color[0]; +TEMP_COLOR_ARRAY[1]=color[1];TEMP_COLOR_ARRAY[2]=color[2];return TEMP_COLOR_ARRAY}else if(mode==="continuous"||mode==="step"){if(mode==="step"){const step=propertyTrack.GetTimeline().GetStep();if(step!==0){const s=1/step;time=Math.floor(time*s)/s}}const st=start.GetTime();const et=end.GetTime();const sv=start.GetValueWithResultMode();const ev=end.GetValueWithResultMode();const n=C3.normalize(time,st,et);const e=start.GetEase();const sr=sv[0];const sg=sv[1];const sb=sv[2];const er=ev[0];const eg=ev[1]; +const eb=ev[2];const easeFunc=self.Ease.GetRuntimeEase(e);const d=et-st;const dn=d*n;if(sr===er)TEMP_COLOR_ARRAY[0]=sr;else TEMP_COLOR_ARRAY[0]=easeFunc(dn,sr,er-sr,d);if(sg===eg)TEMP_COLOR_ARRAY[1]=sg;else TEMP_COLOR_ARRAY[1]=easeFunc(dn,sg,eg-sg,d);if(sb===eb)TEMP_COLOR_ARRAY[2]=sb;else TEMP_COLOR_ARRAY[2]=easeFunc(dn,sb,eb-sb,d);return TEMP_COLOR_ARRAY}}}}; + + +// c3/timelines/state/propertyTypeAdapters/textTypeAdapter.js +'use strict';{const C3=self.C3;C3.PropertyTrackState.TextTypeAdapter=class TextTypeAdapter{constructor(){}static WillChange(index,source,newValue,type){let oldValue;switch(type){case "behavior":oldValue=source.GetPropertyValueByIndex(index);break;case "effect":oldValue=source[index];break;case "instance-variable":oldValue=source.GetInstanceVariableValue(index);break;case "plugin":oldValue=source.GetPropertyValueByIndex(index);break}if(oldValue===newValue)return false;return true}static Interpolate(time, +start,end,propertyTrack){if(!end){let propertyTrackDataItem=propertyTrack.GetPropertyTrackDataItem();const propertyTrackData=propertyTrack.GetPropertyTrackData();propertyTrackDataItem=propertyTrackData.GetLastPropertyKeyframeDataItem(propertyTrackDataItem);return propertyTrackDataItem.GetValueWithResultMode()}return start.GetValueWithResultMode()}}}; + + +// c3/timelines/data/timelineDataManager.js +'use strict';{const C3=self.C3;C3.TimelineDataManager=class TimelineDataManager{constructor(){this._timelineDataItems=new Map}Release(){for(const timelineDataItem of this._timelineDataItems.values())timelineDataItem.Release();this._timelineDataItems.clear();this._timelineDataItems=null}Add(data){const timelineDataItem=new C3.TimelineDataItem(data);const name=timelineDataItem.GetName();this._timelineDataItems.set(name,timelineDataItem)}Get(name){return this._timelineDataItems.get(name)}GetNameId(){return 0}static _CreateDataItems(items, +jsonItems,dataItemConstructor,dataContainer){if(!jsonItems)return;for(const jsonItem of jsonItems)C3.TimelineDataManager._CreateDataItem("create",jsonItem,items,dataItemConstructor,dataContainer)}static _LoadDataItemsFromJson(items,jsonItems,dataItemConstructor,dataContainer){if(items.length)jsonItems.forEach((jsonItem,index)=>{items[index]._LoadFromJson(jsonItem)});else jsonItems.forEach(jsonItem=>{C3.TimelineDataManager._CreateDataItem("load",jsonItem,items,dataItemConstructor,dataContainer)})}static _CreateDataItem(mode, +json,items,dataItemConstructor,dataContainer){let dataItem;if(typeof dataItemConstructor==="function")switch(mode){case "load":dataItem=new dataItemConstructor(null,dataContainer);break;case "create":dataItem=new dataItemConstructor(json,dataContainer);break}else if(typeof dataItemConstructor==="object"){const prop=dataItemConstructor.prop;const value=json[prop];const cnstrctr=dataItemConstructor.map.get(value);switch(mode){case "load":dataItem=new cnstrctr(null,dataContainer);break;case "create":dataItem= +new cnstrctr(json,dataContainer);break}}switch(mode){case "load":dataItem._LoadFromJson(json);items.push(dataItem);break;case "create":if(typeof dataItem.GetEnable==="function"&&!dataItem.GetEnable())return dataItem.Release();items.push(dataItem);break}}}}; + + +// c3/timelines/data/timelineData.js +'use strict';{const C3=self.C3;const NAME=0;const TOTAL_TIME=1;const STEP=2;const INTERPOLATION_MODE=3;const RESULT_MODE=4;const TRACKS=5;const LOOP=6;const PING_PONG=7;const REPEAT_COUNT=8;C3.TimelineDataItem=class TimelineDataItem{constructor(timelineDataJson){this._name="";this._totalTime=NaN;this._step=0;this._interpolationMode="default";this._resultMode="default";this._loop=false;this._pingPong=false;this._repeatCount=1;this._trackData=null;if(!timelineDataJson)return;this._name=timelineDataJson[NAME]; +this._totalTime=timelineDataJson[TOTAL_TIME];this._step=timelineDataJson[STEP];this._interpolationMode=timelineDataJson[INTERPOLATION_MODE];this._resultMode=timelineDataJson[RESULT_MODE];this._loop=!!timelineDataJson[LOOP];this._pingPong=!!timelineDataJson[PING_PONG];this._repeatCount=timelineDataJson[REPEAT_COUNT];this._trackData=new C3.TrackData(timelineDataJson[TRACKS],this)}Release(){this._trackData.Release();this._trackData=null}GetTrackData(){if(!this._trackData)this._trackData=new C3.TrackData(null, +this);return this._trackData}GetName(){return this._name}SetName(n){this._name=n}GetTotalTime(){return this._totalTime}SetTotalTime(tt){this._totalTime=tt}GetStep(){return this._step}SetStep(s){this._step=s}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(im){this._interpolationMode=im}GetResultMode(){return this._resultMode}SetResultMode(rm){this._resultMode=rm}GetLoop(){return this._loop}SetLoop(l){this._loop=l}GetPingPong(){return this._pingPong}SetPingPong(p){this._pingPong= +p}GetRepeatCount(){return this._repeatCount}_SaveToJson(){return{"trackDataJson":this._trackData._SaveToJson(),"name":this._name,"totalTime":this._totalTime,"step":this._step,"interpolationMode":this._interpolationMode,"resultMode":this._resultMode,"loop":this._loop,"pingPong":this._pingPong,"repeatCount":this._repeatCount}}_LoadFromJson(o){if(!o)return;this.GetTrackData()._LoadFromJson(o["trackDataJson"]);this._name=o["name"];this._totalTime=o["totalTime"];this._step=o["step"];this._interpolationMode= +o["interpolationMode"];this._resultMode=o["resultMode"];this._loop=o["loop"];this._pingPong=o["pingPong"];this._repeatCount=o["repeatCount"]}}}; + + +// c3/timelines/data/trackData.js +'use strict';{const C3=self.C3;const WI_DATA=0;const OC_INDEX=1;const WI_UID=2;const INTERPOLATION_MODE=1;const RESULT_MODE=2;const ENABLED=3;const KEYFRAMES=4;const PROPERTY_TRACKS=5;const ID=6;const NESTED_DATA=7;const START_OFFSET=0;const LOCAL_TOTAL_TIME=1;const WI_ADDITIONAL_DATA=8;const ORIGINAL_WIDTH=0;const ORIGINAL_HEIGHT=1;class TrackDataItem{constructor(trackDataJson,trackData){this._trackData=trackData;this._instanceData=null;this._additionalInstanceData=null;this._instanceUid=NaN;this._objectClassIndex= +NaN;this._interpolationMode="default";this._resultMode="default";this._enabled=false;this._keyframeData=null;this._propertyTrackData=null;this._id="";this._nestedData=null;this._startOffset=0;this._localTotalTime=this._trackData.GetTimelineDataItem().GetTotalTime();if(!trackDataJson)return;this._instanceData=trackDataJson[WI_DATA];this._instanceUid=trackDataJson[WI_DATA][WI_UID];this._objectClassIndex=trackDataJson[WI_DATA][OC_INDEX];this._interpolationMode=trackDataJson[INTERPOLATION_MODE];this._resultMode= +trackDataJson[RESULT_MODE];this._enabled=!!trackDataJson[ENABLED];if(trackDataJson[ID])this._id=trackDataJson[ID];if(trackDataJson[NESTED_DATA]){this._nestedData=trackDataJson[NESTED_DATA];this._startOffset=trackDataJson[NESTED_DATA][START_OFFSET];this._localTotalTime=trackDataJson[NESTED_DATA][LOCAL_TOTAL_TIME]}if(trackDataJson[WI_ADDITIONAL_DATA])this._additionalInstanceData=trackDataJson[WI_ADDITIONAL_DATA];this._keyframeData=new C3.KeyframeData(trackDataJson[KEYFRAMES],this);this._propertyTrackData= +new C3.PropertyTrackData(trackDataJson[PROPERTY_TRACKS],this)}Release(){this._instanceData=null;this._trackData=null;if(this._keyframeData){this._keyframeData.Release();this._keyframeData=null}if(this._propertyTrackData){this._propertyTrackData.Release();this._propertyTrackData=null}this._nestedData=null}GetTrackData(){return this._trackData}GetKeyframeData(){if(!this._keyframeData)this._keyframeData=new C3.KeyframeData(null,this);return this._keyframeData}GetPropertyTrackData(){if(!this._propertyTrackData)this._propertyTrackData= +new C3.PropertyTrackData(null,this);return this._propertyTrackData}GetInstanceData(){return this._instanceData}GetObjectClassIndex(){return this._objectClassIndex}SetObjectClassIndex(index){this._objectClassIndex=index}GetInstanceUID(){return this._instanceUid}SetInstanceUID(uid){this._instanceUid=uid}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(im){this._interpolationMode=im}GetResultMode(){return this._resultMode}SetResultMode(rm){this._resultMode=rm}GetEnable(){return this._enabled}SetEnable(e){this._enabled= +!!e}GetId(){return this._id}GetStartOffset(){return this._startOffset}GetLocalTotalTime(){return this._localTotalTime}GetOriginalWidth(){return this._additionalInstanceData[ORIGINAL_WIDTH]}SetOriginalWidth(w){if(!this._additionalInstanceData)this._additionalInstanceData=[];this._additionalInstanceData[ORIGINAL_WIDTH]=w}GetOriginalHeight(){if(!this._additionalInstanceData)this._additionalInstanceData=[];return this._additionalInstanceData[ORIGINAL_HEIGHT]}SetOriginalHeight(h){if(!this._additionalInstanceData)this._additionalInstanceData= +[];this._additionalInstanceData[ORIGINAL_HEIGHT]=h}_SaveToJson(){return{"keyframeDataJson":this._keyframeData._SaveToJson(),"propertyTrackDataJson":this._propertyTrackData._SaveToJson(),"instanceData":this._instanceData,"additionalInstanceData":this._additionalInstanceData,"instanceUid":this._instanceUid,"objectClassIndex":this._objectClassIndex,"interpolationMode":this._interpolationMode,"resultMode":this._resultMode,"enabled":this._enabled,"id":this._id,"nestedData":this._nestedData}}_LoadFromJson(o){if(!o)return; +this._instanceData=o["instanceData"];this._instanceUid=o["instanceUid"];this._objectClassIndex=o["objectClassIndex"];this._interpolationMode=o["interpolationMode"];this._resultMode=o["resultMode"];this._enabled=o["enabled"];this._id=o["id"];this._localTotalTime=this._trackData.GetTimelineDataItem().GetTotalTime();if(o["nestedData"]){this._nestedData=o["nestedData"];this._startOffset=this._nestedData[START_OFFSET];this._localTotalTime=this._nestedData[LOCAL_TOTAL_TIME]}if(o["additionalInstanceData"])this._additionalInstanceData= +o["additionalInstanceData"];this.GetKeyframeData()._LoadFromJson(o["keyframeDataJson"]);this.GetPropertyTrackData()._LoadFromJson(o["propertyTrackDataJson"])}}C3.TrackData=class TrackData{constructor(tracksDataJson,timelineDataItem){this._timelineDataItem=timelineDataItem;this._trackDataItems=[];this._keyframeTimeMap=new Map;C3.TimelineDataManager._CreateDataItems(this._trackDataItems,tracksDataJson,TrackDataItem,this)}Release(){this._timelineDataItem=null;for(const trackDataItem of this._trackDataItems)trackDataItem.Release(); +C3.clearArray(this._trackDataItems);this._trackDataItems=null;this._keyframeTimeMap.clear();this._keyframeTimeMap=null}GetTimelineDataItem(){return this._timelineDataItem}AddEmptyTrackDataItem(){const trackDataItem=new TrackDataItem(null,this);this._trackDataItems.push(trackDataItem);return trackDataItem}GetFirstKeyframeDataItem(trackDataItem){return trackDataItem.GetKeyframeData().GetKeyframeDataItemArray()[0]}GetLastKeyframeDataItem(trackDataItem){const keyframeDataItems=trackDataItem.GetKeyframeData().GetKeyframeDataItemArray(); +return keyframeDataItems[keyframeDataItems.length-1]}GetKeyFrameDataItemAtTime(time,trackDataItem){const keyframeDataItemEntry=this._keyframeTimeMap.get(trackDataItem);if(!!keyframeDataItemEntry&&keyframeDataItemEntry.has(time))return keyframeDataItemEntry.get(time);for(const keyframeDataItem of trackDataItem.GetKeyframeData().keyframeDataItems())if(keyframeDataItem.GetTime()===time){if(!keyframeDataItemEntry)this._keyframeTimeMap.set(trackDataItem,new Map);this._keyframeTimeMap.get(trackDataItem).set(time, +keyframeDataItem);return keyframeDataItem}}GetFirstKeyFrameDataItemHigherThan(time,trackDataItem){for(const keyframeDataItem of trackDataItem.GetKeyframeData().keyframeDataItems())if(keyframeDataItem.GetTime()>time)return keyframeDataItem}GetFirstKeyFrameDataItemHigherOrEqualThan(time,trackDataItem){for(const keyframeDataItem of trackDataItem.GetKeyframeData().keyframeDataItems())if(keyframeDataItem.GetTime()>=time)return keyframeDataItem}GetFirstKeyFrameDataItemLowerOrEqualThan(time,trackDataItem){for(const keyframeDataItem of trackDataItem.GetKeyframeData().keyframeDataItemsReverse())if(keyframeDataItem.GetTime()<= +time)return keyframeDataItem}*trackDataItems(){for(const trackDataItem of this._trackDataItems)yield trackDataItem}_SaveToJson(){return{"trackDataItemsJson":this._trackDataItems.map(trackDataItem=>trackDataItem._SaveToJson())}}_LoadFromJson(o){if(!o)return;C3.TimelineDataManager._LoadDataItemsFromJson(this._trackDataItems,o["trackDataItemsJson"],TrackDataItem,this)}}}; + + +// c3/timelines/data/propertyTrackData.js +'use strict';{const C3=self.C3;const SOURCE_DATA=0;const SOURCE=0;const PROPERTY=1;const TYPE=2;const MIN=3;const MAX=4;const INTERPOLATION_MODE=5;const RESULT_MODE=6;const ENABLED=7;const PROPERTY_KEYFRAMES=8;class PropertyTrackDataItem{constructor(propertyTrackDataJson,propertyTrackData){this._propertyTrackData=propertyTrackData;this._sourceAdapterId="";this._sourceAdapterArguments=null;this._property=null;this._type=null;this._min=NaN;this._max=NaN;this._interpolationMode="default";this._resultMode= +"default";this._enabled=false;this._propertyKeyframeData=null;if(!propertyTrackDataJson)return;this._sourceAdapterId=propertyTrackDataJson[SOURCE_DATA][SOURCE];this._sourceAdapterArguments=propertyTrackDataJson[SOURCE_DATA].slice(1);this._property=propertyTrackDataJson[PROPERTY];this._type=propertyTrackDataJson[TYPE];this._min=propertyTrackDataJson[MIN];this._max=propertyTrackDataJson[MAX];this._interpolationMode=propertyTrackDataJson[INTERPOLATION_MODE];this._resultMode=propertyTrackDataJson[RESULT_MODE]; +this._enabled=!!propertyTrackDataJson[ENABLED];this._propertyKeyframeData=new C3.PropertyKeyframeData(propertyTrackDataJson[PROPERTY_KEYFRAMES],this)}Release(){this._propertyKeyframeData.Release();this._propertyKeyframeData=null;this._propertyTrackData=null;this._sourceAdapterArguments=null}GetPropertyTrackData(){return this._propertyTrackData}GetPropertyKeyframeData(){if(!this._propertyKeyframeData)this._propertyKeyframeData=new C3.PropertyKeyframeData(null,this);return this._propertyKeyframeData}GetSourceAdapterId(){return this._sourceAdapterId}SetSourceAdapterId(said){this._sourceAdapterId= +said}GetSourceAdapterArguments(){return this._sourceAdapterArguments}SetSourceAdapterArguments(sargs){this._sourceAdapterArguments=sargs}GetProperty(){return this._property}SetProperty(p){this._property=p}GetType(){return this._type}SetType(t){this._type=t}GetMin(){return this._min}SetMin(min){this._min=min}GetMax(){return this._max}SetMax(max){this._max=max}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(im){this._interpolationMode=im}GetResultMode(){return this._resultMode}SetResultMode(rm){this._resultMode= +rm}GetEnable(){return this._enabled}SetEnable(e){this._enabled=!!e}_SaveToJson(){return{"propertyKeyframeDataJson":this._propertyKeyframeData._SaveToJson(),"sourceAdapterId":this._sourceAdapterId,"sourceAdapterArguments":this._sourceAdapterArguments,"property":this._property,"type":this._type,"min":this._min,"max":this._max,"interpolationMode":this._interpolationMode,"resultMode":this._resultMode,"enabled":this._enabled}}_LoadFromJson(o){if(!o)return;this._sourceAdapterId=o["sourceAdapterId"];this._sourceAdapterArguments= +o["sourceAdapterArguments"];this._property=o["property"];this._type=o["type"];this._min=o["min"];this._max=o["max"];this._interpolationMode=o["interpolationMode"];this._resultMode=o["resultMode"];this._enabled=o["enabled"];this.GetPropertyKeyframeData()._LoadFromJson(o["propertyKeyframeDataJson"])}}C3.PropertyTrackData=class PropertyTrackData{constructor(propertyTracksDataJson,trackDataItem){this._trackDataItem=trackDataItem;this._propertyTrackDataItems=[];this._propertyKeyframeTimeMap=new Map;C3.TimelineDataManager._CreateDataItems(this._propertyTrackDataItems, +propertyTracksDataJson,PropertyTrackDataItem,this)}Release(){this._trackDataItem=null;for(const propertyTrackDataItem of this._propertyTrackDataItems)propertyTrackDataItem.Release();C3.clearArray(this._propertyTrackDataItems);this._propertyTrackDataItems=null;this._propertyKeyframeTimeMap.clear();this._propertyKeyframeTimeMap=null}GetTrackDataItem(){return this._trackDataItem}AddEmptyPropertyTrackDataItem(){const propertyTrackDataItem=new PropertyTrackDataItem(null,this);this._propertyTrackDataItems.push(propertyTrackDataItem); +return propertyTrackDataItem}GetFirstPropertyKeyframeDataItem(propertyTrackDataItem){const propertyKeyframeData=propertyTrackDataItem.GetPropertyKeyframeData();return propertyKeyframeData.GetPropertyKeyframeDataItemArray()[0]}GetLastPropertyKeyframeDataItem(propertyTrackDataItem){const propertyKeyframeData=propertyTrackDataItem.GetPropertyKeyframeData();const propertyKeyframeDataItems=propertyKeyframeData.GetPropertyKeyframeDataItemArray();return propertyKeyframeDataItems[propertyKeyframeDataItems.length- +1]}GetPropertyKeyFrameDataItemAtTime(time,propertyTrackDataItem){const propertyKeyframeDataItemEntry=this._propertyKeyframeTimeMap.get(propertyTrackDataItem);if(!!propertyKeyframeDataItemEntry&&propertyKeyframeDataItemEntry.has(time))return propertyKeyframeDataItemEntry.get(time);const propertyKeyframeData=propertyTrackDataItem.GetPropertyKeyframeData();for(const propertyKeyframeDataItem of propertyKeyframeData.propertyKeyframeDataItems())if(propertyKeyframeDataItem.GetTime()===time){if(!propertyKeyframeDataItemEntry)this._propertyKeyframeTimeMap.set(propertyTrackDataItem, +new Map);this._propertyKeyframeTimeMap.get(propertyTrackDataItem).set(time,propertyKeyframeDataItem);return propertyKeyframeDataItem}}GetFirstPropertyKeyFrameDataItemHigherThan(time,propertyTrackDataItem){const propertyKeyframeData=propertyTrackDataItem.GetPropertyKeyframeData();for(const propertyKeyframeDataItem of propertyKeyframeData.propertyKeyframeDataItems())if(propertyKeyframeDataItem.GetTime()>time)return propertyKeyframeDataItem}GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(time,propertyTrackDataItem){const propertyKeyframeData= +propertyTrackDataItem.GetPropertyKeyframeData();for(const propertyKeyframeDataItem of propertyKeyframeData.propertyKeyframeDataItems())if(propertyKeyframeDataItem.GetTime()>=time)return propertyKeyframeDataItem}GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(time,propertyTrackDataItem){const propertyKeyframeData=propertyTrackDataItem.GetPropertyKeyframeData();for(const propertyKeyframeDataItem of propertyKeyframeData.propertyKeyframeDataItemsReverse())if(propertyKeyframeDataItem.GetTime()<=time)return propertyKeyframeDataItem}*propertyTrackDataItems(){for(const propertyTrackDataItem of this._propertyTrackDataItems)yield propertyTrackDataItem}_SaveToJson(){return{"propertyTrackDataItemsJson":this._propertyTrackDataItems.map(propertyTrackDataItem=> +propertyTrackDataItem._SaveToJson())}}_LoadFromJson(o){if(!o)return;C3.TimelineDataManager._LoadDataItemsFromJson(this._propertyTrackDataItems,o["propertyTrackDataItemsJson"],PropertyTrackDataItem,this)}}}; + + +// c3/timelines/data/keyframeData.js +'use strict';{const C3=self.C3;const TIME=0;const EASE=1;const ENABLE=2;const TAGS=3;class KeyframeDataItem{constructor(keyframeDataJson,keyframeData){this._keyframeData=keyframeData;this._time=-1;this._ease="noease";this._enable=false;this._tags=null;this._lowerTags=null;if(!keyframeDataJson)return;this._time=keyframeDataJson[TIME];this._ease=keyframeDataJson[EASE];this._enable=!!keyframeDataJson[ENABLE];const tagStr=keyframeDataJson[TAGS];this._tags=tagStr?tagStr.split(" "):[];this._lowerTags=new Set(this._tags.map(t=> +t.toLowerCase()))}Release(){this._keyframeData=null;C3.clearArray(this._tags);this._tags=null;this._lowerTags.clear();this._lowerTags=null}GetKeyframeData(){return this._keyframeData}GetTime(){return this._time}SetTime(t){this._time=t}GetEase(){return this._ease}SetEase(e){this._ease=e}GetEnable(){return this._enable}SetEnable(e){this._enable=!!e}GetTags(){return this._tags}SetTags(t){this._tags=t?t.split(" "):[];this._lowerTags=new Set(this._tags.map(t=>t.toLowerCase()))}GetLowerTags(){return this._lowerTags}HasTag(tag){return this._lowerTags.has(tag.toLowerCase())}_SaveToJson(){return{"time":this._time, +"ease":this._ease,"enable":this._enable,"tags":this._tags}}_LoadFromJson(o){if(!o)return;this._time=o["time"];this._ease=o["ease"];this._enable=o["enable"];this._tags=o["tags"];this._lowerTags=new Set(this._tags.map(t=>t.toLowerCase()))}}C3.KeyframeData=class KeyframeData{constructor(keyframesDataJson,trackDataItem){this._trackDataItem=trackDataItem;this._keyframeDataItems=[];C3.TimelineDataManager._CreateDataItems(this._keyframeDataItems,keyframesDataJson,KeyframeDataItem,this)}Release(){this._trackDataItem= +null;for(const keyframeDataItem of this._keyframeDataItems)keyframeDataItem.Release();C3.clearArray(this._keyframeDataItems);this._keyframeDataItems=null}GetTrackDataItem(){return this._trackDataItem}GetKeyframeDataItemCount(){return this._keyframeDataItems.length}GetKeyframeDataItemArray(){return this._keyframeDataItems}AddEmptyKeyframeDataItem(){const keyframeDataItem=new KeyframeDataItem(null,this);this._keyframeDataItems.push(keyframeDataItem);return keyframeDataItem}DeleteKeyframeDataItems(match){for(const keyframeDataItem of this._keyframeDataItems){if(!match(keyframeDataItem))continue; +const index=this._keyframeDataItems.indexOf(keyframeDataItem);if(index===-1)continue;keyframeDataItem.Release();this._keyframeDataItems.splice(index,1)}this.SortKeyframeDataItems()}SortKeyframeDataItems(){this._keyframeDataItems.sort((a,b)=>a.GetTime()-b.GetTime())}GetKeyframeDataItemIndex(keyframeDataItem){return this._keyframeDataItems.indexOf(keyframeDataItem)}GetKeyframeDataItemFromIndex(index){return this._keyframeDataItems[index]}*keyframeDataItems(){for(const keyframeDataItem of this._keyframeDataItems)yield keyframeDataItem}*keyframeDataItemsReverse(){for(let i= +this._keyframeDataItems.length-1;i>=0;i--)yield this._keyframeDataItems[i]}_SaveToJson(){return{"keyframeDataItemsJson":this._keyframeDataItems.map(keyframeDataItem=>keyframeDataItem._SaveToJson())}}_LoadFromJson(o){if(!o)return;C3.TimelineDataManager._LoadDataItemsFromJson(this._keyframeDataItems,o["keyframeDataItemsJson"],KeyframeDataItem,this)}}}; + + +// c3/timelines/data/propertyKeyframeData.js +'use strict';{const C3=self.C3;const VALUE_DATA=0;const VALUE_DATA_VALUE=0;const VALUE_DATA_ABSOLUTE_VALUE=1;const VALUE_DATA_TYPE=2;const TIME=1;const EASE=2;const ENABLE=3;const ADDONS=4;class PropertyKeyframeDataItem{constructor(propertyKeyframeDataJson,propertyKeyframeData){this._propertyKeyframeData=propertyKeyframeData;this._value=null;this._aValue=null;this._type="";this._time=NaN;this._ease="noease";this._enable=false;this._addonData=null;if(!propertyKeyframeDataJson)return;this._value=propertyKeyframeDataJson[VALUE_DATA][VALUE_DATA_VALUE]; +this._aValue=propertyKeyframeDataJson[VALUE_DATA][VALUE_DATA_ABSOLUTE_VALUE];this._type=propertyKeyframeDataJson[VALUE_DATA][VALUE_DATA_TYPE];this._time=propertyKeyframeDataJson[TIME];this._ease=propertyKeyframeDataJson[EASE];this._enable=!!propertyKeyframeDataJson[ENABLE];this._addonData=null;if(!!propertyKeyframeDataJson[ADDONS])this._addonData=new C3.AddonData(propertyKeyframeDataJson[ADDONS],this)}Release(){this._propertyKeyframeData=null;if(this._addonData){this._addonData.Release();this._addonData= +null}}GetAddonData(){return this._addonData}GetValue(){return this._value}SetValue(value){if(this._type==="color"&&C3.IsFiniteNumber(value)){this._value[0]=C3.GetRValue(value);this._value[1]=C3.GetGValue(value);this._value[2]=C3.GetBValue(value)}else this._value=value}GetAbsoluteValue(){return this._aValue}SetAbsoluteValue(aValue){if(this._type==="color"&&C3.IsFiniteNumber(aValue)){this._aValue[0]=C3.GetRValue(aValue);this._aValue[1]=C3.GetGValue(aValue);this._aValue[2]=C3.GetBValue(aValue)}else this._aValue= +aValue}GetValueWithResultMode(){const rm=this._propertyKeyframeData.GetPropertyTrackDataItem().GetResultMode();if(rm==="relative")return this.GetValue();else if(rm==="absolute")return this.GetAbsoluteValue()}GetType(){return this._type}SetType(t){this._type=t}GetTime(){return this._time}SetTime(t){this._time=t}GetEase(){return this._ease}SetEase(e){this._ease=e}GetEnable(){return this._enable}SetEnable(e){this._enable=!!e}GetAddOn(id){if(!this.GetAddonData())return;for(const addonDataItem of this.GetAddonData().addonDataItems())if(addonDataItem.GetId()=== +id)return addonDataItem}_SaveToJson(){const aData=this._addonData;return{"addonDataJson":aData?aData._SaveToJson():aData,"value":this._value,"aValue":this._aValue,"type":this._type,"time":this._time,"ease":this._ease,"enable":this._enable}}_LoadFromJson(o){if(!o)return;if(o["addonDataJson"])this._addonData._SetFromJson(o["addonDataJson"]);this._value=o["value"];this._aValue=o["aValue"];this._type=o["type"];this._time=o["time"];this._ease=o["ease"];this._enable=o["enable"]}}C3.PropertyKeyframeData= +class PropertyKeyframeData{constructor(propertyKeyframesDataJson,propertyTrackDataItem){this._propertyTrackDataItem=propertyTrackDataItem;this._propertyKeyframeDataItems=[];C3.TimelineDataManager._CreateDataItems(this._propertyKeyframeDataItems,propertyKeyframesDataJson,PropertyKeyframeDataItem,this)}Release(){this._propertyTrackDataItem=null;for(const propertyKeyframeDataItem of this._propertyKeyframeDataItems)propertyKeyframeDataItem.Release();C3.clearArray(this._propertyKeyframeDataItems);this._propertyKeyframeDataItems= +null}AddEmptyPropertyKeyframeDataItem(){const propertyKeyframeDataItem=new PropertyKeyframeDataItem(null,this);this._propertyKeyframeDataItems.push(propertyKeyframeDataItem);return propertyKeyframeDataItem}DeletePropertyKeyframeDataItems(match){for(const propertyKeyframeDataItem of this._propertyKeyframeDataItems){if(!match(propertyKeyframeDataItem))continue;const index=this._propertyKeyframeDataItems.indexOf(propertyKeyframeDataItem);if(index===-1)continue;propertyKeyframeDataItem.Release();this._propertyKeyframeDataItems.splice(index, +1)}this.SortPropertyKeyFrameDataItems()}SortPropertyKeyFrameDataItems(){this._propertyKeyframeDataItems.sort((a,b)=>a.GetTime()-b.GetTime())}GetPropertyTrackDataItem(){return this._propertyTrackDataItem}GetPropertyKeyframeDataItemCount(){return this._propertyKeyframeDataItems.length}GetPropertyKeyframeDataItemArray(){return this._propertyKeyframeDataItems}*propertyKeyframeDataItems(){for(const propertyKeyframeDataItem of this._propertyKeyframeDataItems)yield propertyKeyframeDataItem}*propertyKeyframeDataItemsReverse(){for(let i= +this._propertyKeyframeDataItems.length-1;i>=0;i--)yield this._propertyKeyframeDataItems[i]}_SaveToJson(){return{"propertyKeyframeDataItemsJson":this._propertyKeyframeDataItems.map(propertyTrackDataItem=>propertyTrackDataItem._SaveToJson())}}_LoadFromJson(o){if(!o)return;C3.TimelineDataManager._LoadDataItemsFromJson(this._propertyKeyframeDataItems,o["propertyKeyframeDataItemsJson"],PropertyKeyframeDataItem,this)}}}; + + +// c3/timelines/data/propertyKeyframeAddonData.js +'use strict';{const C3=self.C3;const ADDON_ID=0;const ADDON_DATA=1;class AddonDataItem{constructor(addonDataJson,addonData){this._addonData=addonData;this._id=addonDataJson[ADDON_ID];this._data=addonDataJson[ADDON_DATA]}Release(){this._addonData=null;this._data=null}GetAddonData(){return this._addonData}GetId(){return this._id}_SaveToJson(){return{"id":this._id,"data":this._data}}_LoadFromJson(o){if(!o)return;this._id=o["id"];this._data=o["data"]}}const START_ANCHOR=0;const START_ENABLE=1;const END_ANCHOR= +2;const END_ENABLE=3;class AddonDataCubicBezierItem extends AddonDataItem{constructor(addonDataJson,addonData){super(addonDataJson,addonData);this._startAnchor=this._data[START_ANCHOR];this._startEnable=!!this._data[START_ENABLE];this._endAnchor=this._data[END_ANCHOR];this._endEnable=!!this._data[END_ENABLE]}Release(){super.Release()}GetStartAnchor(){return this._startAnchor}GetStartEnable(){return this._startEnable}GetEndAnchor(){return this._endAnchor}GetEndEnable(){return this._endEnable}_SaveToJson(){return Object.assign(super._SaveToJson(), +{"startAnchor":this._startAnchor,"startEnable":!!this._startEnable,"endAnchor":this._endAnchor,"endEnable":!!this._endEnable})}_LoadFromJson(o){if(!o)return;super._LoadFromJson(o);this._startAnchor=o["startAnchor"];this._startEnable=!!o["startEnable"];this._endAnchor=o["endAnchor"];this._endEnable=!!o["endEnable"]}}const DIRECTION=0;const REVOLUTIONS=1;class AddonDataAngleItem extends AddonDataItem{constructor(addonDataJson,addonData){super(addonDataJson,addonData);this._direction=this._data[DIRECTION]; +this._revolutions=this._data[REVOLUTIONS]}Release(){super.Release()}GetDirection(){return this._direction}GetRevolutions(){return this._revolutions}_SaveToJson(){return Object.assign(super._SaveToJson(),{"direction":this._direction,"revolutions":this._revolutions})}_LoadFromJson(o){if(!o)return;super._LoadFromJson(o);this._direction=o["direction"];this._revolutions=o["revolutions"]}}C3.AddonData=class AddonData{constructor(addonsDataJson,propertyKeyframeDataItem){this._propertyKeyframeDataItem=propertyKeyframeDataItem; +this._addonDataItems=[];C3.TimelineDataManager._CreateDataItems(this._addonDataItems,addonsDataJson,{prop:0,map:new Map([["cubic-bezier",AddonDataCubicBezierItem],["angle",AddonDataAngleItem]])},this)}Release(){this._propertyKeyframeDataItem=null;for(const addonDataItem of this._addonDataItems)addonDataItem.Release();C3.clearArray(this._addonDataItems);this._addonDataItems=null}GetPropertyKeyframeDataItem(){return this._propertyKeyframeDataItem}*addonDataItems(){for(const addonDataItem of this._addonDataItems)yield addonDataItem}_SaveToJson(){return{"addonDataItemsJson":this._addonDataItems.map(addonDataItem=> +addonDataItem._SaveToJson())}}_LoadFromJson(o){if(!o)return;C3.TimelineDataManager._LoadDataItemsFromJson(this._addonDataItems,o["addonDataItemsJson"],{prop:"id",map:new Map([["cubic-bezier",AddonDataCubicBezierItem],["angle",AddonDataAngleItem]])},this)}}}; + + +// c3/timelines/tweens/tween.js +'use strict';{const C3=self.C3;const INITIAL_VALUE_MODE_START_VALUE="start-value";const INITIAL_VALUE_MODE_CURRENT_STATE="current-state";let createdTweens=0;C3.Tween=class Tween extends C3.TimelineState{constructor(tweenDataItem,timelineManager){super(`tween-${createdTweens++}`,tweenDataItem,timelineManager);this._id="";this._destroyInstanceOnComplete=false;this._initialValueMode=INITIAL_VALUE_MODE_START_VALUE;this._on_completed_callbacks=null;this._on_started_callbacks=null}GetInstance(){const tracks= +this.GetTracks();if(!tracks||!tracks.length)return;const track=tracks[0];if(!track)return;const instance=track.GetInstance();return track.IsInstanceValid()?instance:null}AddStartedCallback(c){if(!this._on_started_callbacks)this._on_started_callbacks=[];this._on_started_callbacks.push(c)}AddCompletedCallback(c){if(!this._on_completed_callbacks)this._on_completed_callbacks=[];this._on_completed_callbacks.push(c)}RemoveStartedCallback(c){if(!this._on_started_callbacks)return;const index=this._on_started_callbacks.indexOf(c); +if(index!==-1)this._on_started_callbacks.splice(index,1)}RemoveCompletedCallback(c){if(!this._on_completed_callbacks)return;const index=this._on_completed_callbacks.indexOf(c);if(index!==-1)this._on_completed_callbacks.splice(index,1)}SetStartValue(startValue,propertyName){for(const track of this._tracks)for(const propertyTrack of track._propertyTracks){if(propertyTrack.GetPropertyName()!==propertyName)continue;const propertyTrackData=propertyTrack.GetPropertyTrackData();const propertyTrackDataItem= +propertyTrack.GetPropertyTrackDataItem();const propertyKeyframeDataItem=propertyTrackData.GetFirstPropertyKeyframeDataItem(propertyTrackDataItem);propertyKeyframeDataItem.SetValue(startValue);propertyKeyframeDataItem.SetAbsoluteValue(startValue)}}_GetPropertyTrackState(propertyName){for(const track of this._tracks)for(const propertyTrack of track._propertyTracks)if(propertyTrack.GetPropertyName()===propertyName)return propertyTrack}BeforeSetEndValues(properties){for(const propertyName of properties){const propertyTrackState= +this._GetPropertyTrackState(propertyName);this.SetStartValue(propertyTrackState.GetCurrentState(),propertyName)}if(this.IsForwardPlayBack()){this.SetTotalTime(this.GetTotalTime()-this.GetTime());this._SetTime(0)}else{this.SetTotalTime(this.GetTime());this._SetTime(this.GetTotalTime())}this.SetInitialStateFromSetTime()}SetEndValue(endValue,propertyName){const propertyTrackState=this._GetPropertyTrackState(propertyName);const propertyTrackData=propertyTrackState.GetPropertyTrackData();const propertyTrackDataItem= +propertyTrackState.GetPropertyTrackDataItem();const propertyKeyframeDataItem=propertyTrackData.GetLastPropertyKeyframeDataItem(propertyTrackDataItem);propertyKeyframeDataItem.SetTime(this.GetTotalTime());propertyKeyframeDataItem.SetValue(endValue);propertyKeyframeDataItem.SetAbsoluteValue(endValue)}SetId(id){this._id=id}GetId(){return this._id}SetInitialValueMode(initialValueMode){this._initialValueMode=initialValueMode}GetInitialValueMode(){return this._initialValueMode}SetDestroyInstanceOnComplete(releaseOnComplete){this._destroyInstanceOnComplete= +releaseOnComplete}GetDestroyInstanceOnComplete(){return this._destroyInstanceOnComplete}OnStarted(){if(this._on_started_callbacks)for(const c of this._on_started_callbacks)c(this);if(this.IsComplete())return;for(const track of this._tracks)track.CompareSaveStateWithCurrent()}OnCompleted(){this._completedTick=this._runtime.GetTickCount()}FinishTriggers(){if(this._finishedTriggers)return;this._finishedTriggers=true;if(this._on_completed_callbacks)for(const c of this._on_completed_callbacks)c(this)}SetTime(time){this._DeleteIntermediateKeyframes(); +super.SetTime(time)}SetInitialState(fromSetTime){if(!this.InitialStateSet()&&this.GetInitialValueMode()===INITIAL_VALUE_MODE_CURRENT_STATE)for(const track of this._tracks)track.CompareInitialStateWithCurrent();super.SetInitialState(fromSetTime)}Stop(completed=false){super.Stop(completed);if(this.IsComplete())return;for(const track of this._tracks)track.SaveState()}Reset(render=true,beforeChangeLayout=false){this._DeleteIntermediateKeyframes();super.Reset(render,beforeChangeLayout)}_DeleteIntermediateKeyframes(){for(const track of this._tracks){const del= +kf=>{const time=kf.GetTime();const totalTime=this.GetTotalTime();return time!==0&&time!==totalTime};track.DeleteKeyframes(del);track.DeletePropertyKeyframes(del)}}_OnBeforeChangeLayout(){if(this.IsReleased())return true;const instance=this.GetInstance();if(instance&&instance.GetObjectClass().IsGlobal())return false;this._timelineManager.CompleteTimeline(this);this.ResetBeforeChangeLayout();return true}MaybeTriggerKeyframeReachedConditions(){}Tick(deltaTime,timeScale){const instance=this.GetInstance(); +const dt=this.GetRuntime().GetDt(instance);super.Tick(dt,1)}_SaveToJson(){const ret=super._SaveToJson();const tweenDataItem=this.GetTimelineDataItem();return Object.assign(ret,{"tweenDataItemJson":tweenDataItem._SaveToJson(),"id":this._id,"destroyInstanceOnComplete":this._destroyInstanceOnComplete,"initialValueMode":this._initialValueMode})}_LoadFromJson(o){if(!o)return;const tweenDataItem=this.GetTimelineDataItem();tweenDataItem._LoadFromJson(o["tweenDataItemJson"]);super._LoadFromJson(o);this._id= +o["id"];this._destroyInstanceOnComplete=o["destroyInstanceOnComplete"];this._initialValueMode=o["initialValueMode"]}static IsPlaying(tween){return tween.IsPlaying()}static IsPaused(tween){return tween.IsPaused()}static Build(config){const timelineManager=config.runtime.GetTimelineManager();const tweenDataItem=new C3.TimelineDataItem;if(config.json){tweenDataItem._LoadFromJson(config.json["tweenDataItemJson"]);const tween=new C3.Tween(tweenDataItem,timelineManager);tween._LoadFromJson(config.json); +return tween}else{const tween=new C3.Tween(tweenDataItem,timelineManager);if(!C3.IsArray(config.propertyTracksConfig))config.propertyTracksConfig=[config.propertyTracksConfig];tween.SetId(config.id);tween.SetTags(config.tags);tween.SetInitialValueMode(config.initialValueMode);tween.SetDestroyInstanceOnComplete(config.releaseOnComplete);tween.SetLoop(config.loop);tween.SetPingPong(config.pingPong);tween.SetTotalTime(config.time);tween.SetStep(0);tween.SetInterpolationMode("default");tween.SetResultMode(config.propertyTracksConfig[0].resultMode); +const track=tween.AddTrack();track.SetInstanceUID(config.instance.GetUID());track.SetInterpolationMode("default");track.SetResultMode(config.propertyTracksConfig[0].resultMode);track.SetEnable(true);track.SetObjectClassIndex(config.instance.GetObjectClass().GetIndex());track.SetOriginalWidth(config.instance.GetWorldInfo().GetWidth());track.SetOriginalHeight(config.instance.GetWorldInfo().GetHeight());const startKeyframeDataItem=track.AddKeyframe();startKeyframeDataItem.SetTime(0);startKeyframeDataItem.SetEase("noease"); +startKeyframeDataItem.SetEnable(true);startKeyframeDataItem.SetTags("");const endKeyframeDataItem=track.AddKeyframe();endKeyframeDataItem.SetTime(config.time);endKeyframeDataItem.SetEase("noease");endKeyframeDataItem.SetEnable(true);endKeyframeDataItem.SetTags("");for(const propertyTrackConfig of config.propertyTracksConfig){const propertyTrack=track.AddPropertyTrack();propertyTrack.SetSourceAdapterId(propertyTrackConfig.sourceId);propertyTrack.SetSourceAdapterArgs(propertyTrackConfig.sourceArgs); +propertyTrack.SetPropertyName(propertyTrackConfig.property);propertyTrack.SetPropertyType(propertyTrackConfig.type);propertyTrack.SetMin(NaN);propertyTrack.SetMax(NaN);propertyTrack.SetInterpolationMode("default");propertyTrack.SetResultMode(propertyTrackConfig.resultMode);propertyTrack.SetEnable(true);const startPropertyKeyframeDataItem=propertyTrack.AddPropertyKeyframe();startPropertyKeyframeDataItem.SetType(propertyTrackConfig.valueType);startPropertyKeyframeDataItem.SetTime(0);startPropertyKeyframeDataItem.SetEase(propertyTrackConfig.ease); +startPropertyKeyframeDataItem.SetEnable(true);startPropertyKeyframeDataItem.SetValue(propertyTrackConfig.startValue);startPropertyKeyframeDataItem.SetAbsoluteValue(propertyTrackConfig.startValue);const endPropertyKeyframeDataItem=propertyTrack.AddPropertyKeyframe();endPropertyKeyframeDataItem.SetType(propertyTrackConfig.valueType);endPropertyKeyframeDataItem.SetTime(config.time);endPropertyKeyframeDataItem.SetEase(propertyTrackConfig.ease);endPropertyKeyframeDataItem.SetEnable(true);endPropertyKeyframeDataItem.SetValue(propertyTrackConfig.endValue); +endPropertyKeyframeDataItem.SetAbsoluteValue(propertyTrackConfig.endValue)}return tween}}}}; + + +// c3/timelines/transitions/transition.js +'use strict';{const C3=self.C3;const Ease=self.Ease;const NAME=0;const TRANSITION_KEYFRAMES=1;C3.Transition=class Transition extends C3.DefendedBase{constructor(data){super();this._name=data[NAME];this._transitionKeyframes=[];for(const transitionKeyframeData of data[TRANSITION_KEYFRAMES]){const transitionKeyframe=C3.TransitionKeyframe.Create(this,transitionKeyframeData);this._transitionKeyframes.push(transitionKeyframe)}this._precalculatedSamples=new Map;this._transitionKeyframeCache=new Map;this._PreCalcSamples(); +Ease.AddCustomEase(this._name,(t,sv,dv,tt)=>this.Interpolate(t,sv,dv,tt))}static Create(data){return C3.New(C3.Transition,data)}Release(){for(const transitionKeyframe of this._transitionKeyframes)transitionKeyframe.Release();C3.clearArray(this._transitionKeyframes);this._transitionKeyframes=null;this._precalculatedSamples.clear();this._precalculatedSamples=null;this._transitionKeyframeCache.clear();this._transitionKeyframeCache=null}GetTransitionKeyFrameAt(x){const transitionKeyframe=this._transitionKeyframeCache.get(x); +if(transitionKeyframe)return transitionKeyframe;for(const transitionKeyframe of this._transitionKeyframes)if(transitionKeyframe.GetValueX()===x){this._transitionKeyframeCache.set(x,transitionKeyframe);return transitionKeyframe}}GetFirstTransitionKeyFrameHigherThan(x){for(const transitionKeyframe of this._transitionKeyframes)if(transitionKeyframe.GetValueX()>x)return transitionKeyframe}GetFirstTransitionKeyFrameHigherOrEqualThan(x){for(const transitionKeyframe of this._transitionKeyframes)if(transitionKeyframe.GetValueX()>= +x)return transitionKeyframe}GetFirstTransitionKeyFrameLowerOrEqualThan(x){for(let i=this._transitionKeyframes.length-1;i>=0;i--){const transitionKeyframe=this._transitionKeyframes[i];if(transitionKeyframe.GetValueX()<=x)return transitionKeyframe}}Interpolate(time,startValue,deltaValue,totalTime){const n=time/totalTime;let start=this.GetTransitionKeyFrameAt(n);let end=null;if(start)end=this.GetFirstTransitionKeyFrameHigherThan(n);else{start=this.GetFirstTransitionKeyFrameLowerOrEqualThan(n);end=this.GetFirstTransitionKeyFrameHigherOrEqualThan(n)}const delta= +end.GetValueX()-start.GetValueX();const nn=C3.mapToRange(n,start.GetValueX(),end.GetValueX(),0,delta);const startX=start.GetValueX();const startY=start.GetValueY();const anchor1X=start.GetValueX()+start.GetStartAnchorX();const anchor1Y=start.GetValueY()+start.GetStartAnchorY();const anchor2X=end.GetValueX()+end.GetEndAnchorX();const anchor2Y=end.GetValueY()+end.GetEndAnchorY();const endX=end.GetValueX();const endY=end.GetValueY();let ret=Ease.GetRuntimeEase("spline")(nn,startX,startY,anchor1X,anchor1Y, +anchor2X,anchor2Y,endX,endY,this._precalculatedSamples.get(start));ret+=start.GetValueY();return(1-ret)*startValue+ret*(startValue+deltaValue)}_PreCalcSamples(){this._precalculatedSamples.clear();for(let i=0;i=0}GetCurrent(){return this._stack[this._index]}Push(){++this._index; +if(this._index===this._stack.length){const ret=C3.New(C3.Loop,this);this._stack.push(ret);return ret}else{const ret=this._stack[this._index];ret.Reset();return ret}}Pop(){--this._index}FindByName(name){const stack=this._stack;for(let i=this._index;i>=0;--i){const loop=stack[i];if(loop.GetName()===name)return loop}return null}_GetStack(){return this._stack.slice(0,this._index+1)}}}; + + +// c3/events/stacks/loop.js +'use strict';{const C3=self.C3;C3.Loop=class Loop extends C3.DefendedBase{constructor(loopStack){super();this._loopStack=loopStack;this._name="";this._index=0;this._isStopped=false;this._end=NaN}Reset(){this._name="";this._index=0;this._isStopped=false;this._end=NaN}SetName(name){this._name=name}GetName(){return this._name}SetIndex(i){this._index=i}GetIndex(){return this._index}Stop(){this._isStopped=true}IsStopped(){return this._isStopped}SetEnd(e){this._end=e}GetEnd(){return this._end}}}; + + +// c3/events/stacks/arrayStack.js +'use strict';{const C3=self.C3;C3.ArrayStack=class ArrayStack extends C3.DefendedBase{constructor(){super();this._stack=[];this._index=-1}Release(){C3.clearArray(this._stack)}GetCurrent(){return this._stack[this._index]}Push(){++this._index;if(this._index===this._stack.length){const ret=[];this._stack.push(ret);return ret}else return this._stack[this._index]}Pop(){--this._index}}}; + + +// c3/events/eventSheetManager.js +'use strict';{const C3=self.C3;const assert=self.assert;function SortSolArray(a,b){return a.GetIndex()-b.GetIndex()}function IsSolArrayIdentical(a,b){for(let i=0,len=a.length;ithis._InvokeFunctionFromJS(name,params)}Release(){this.ClearAllScheduledWaits();this._eventStack.Release();this._eventStack=null;this._localVarStack.Release();this._localVarStack=null;C3.clearArray(this._queuedTriggers);C3.clearArray(this._queuedDebugTriggers);this._runtime=null;C3.clearArray(this._allSheets);this._sheetsByName.clear()}Create(eventSheetData){const eventSheet=C3.New(C3.EventSheet,this,eventSheetData); +this._allSheets.push(eventSheet);this._sheetsByName.set(eventSheet.GetName().toLowerCase(),eventSheet)}_AddTriggerToPostInit(trig){this._triggersToPostInit.push(trig)}_PostInit(){for(const functionBlock of this._functionBlocksByName.values())functionBlock._PostInit(false);for(const sheet of this._allSheets)sheet._PostInit();for(const sheet of this._allSheets)sheet._UpdateDeepIncludes();for(const trig of this._triggersToPostInit)trig._PostInit(false);C3.clearArray(this._triggersToPostInit);this._localVarStack._SetInitialValues(this._localVarInitialValues)}GetRuntime(){return this._runtime}GetEventSheetByName(name){return this._sheetsByName.get(name.toLowerCase())|| +null}_RegisterGroup(group){this._allGroups.push(group);this._groupsByName.set(group.GetGroupName(),group)}_RegisterEventBlock(eventBlock){this._blocksBySid.set(eventBlock.GetSID(),eventBlock)}_RegisterCondition(condition){this._cndsBySid.set(condition.GetSID(),condition)}_RegisterAction(action){this._actsBySid.set(action.GetSID(),action)}_RegisterFunctionBlock(functionBlock){this._functionBlocksByName.set(functionBlock.GetFunctionName().toLowerCase(),functionBlock)}_RegisterEventVariable(ev){this._eventVarsBySid.set(ev.GetSID(), +ev);if(ev.IsGlobal())this._allGlobalVars.push(ev);else this._allLocalVars.push(ev)}_DeduplicateSolModifierList(arr){if(arr.length>=2)arr.sort(SortSolArray);let candidateList=this._allUniqueSolModifiers.get(arr.length);if(!candidateList){candidateList=[];this._allUniqueSolModifiers.set(arr.length,candidateList)}for(let i=0,len=candidateList.length;iresolve= +r);this._queuedDebugTriggers.push([method,inst,behaviorType,resolve]);return ret}*_RunQueuedDebugTriggersGen(){if(this._runtime.HitBreakpoint())throw new Error("should not be in breakpoint");const layoutManager=this._runtime.GetLayoutManager();while(this._queuedDebugTriggers.length){const [method,inst,behaviorType,resolve]=this._queuedDebugTriggers.shift();const ret=yield*this._DebugTrigger(layoutManager,method,inst,behaviorType);resolve(ret)}}async RunQueuedDebugTriggersAsync(){for(const breakEventObject of this._RunQueuedDebugTriggersGen())await this._runtime.DebugBreak(breakEventObject)}_FastTrigger(layoutManager, +method,inst,value){let ret=false;const layout=layoutManager.GetMainRunningLayout();const eventSheet=layout.GetEventSheet();if(!eventSheet)return;this._executingTriggerDepth++;this._runtime.PushCurrentLayout(layout);const deepIncludes=eventSheet.deepIncludes();for(let i=0,len=deepIncludes.length;i0}_IncTriggerDepth(){return++this._executingTriggerDepth}_DecTriggerDepth(){--this._executingTriggerDepth}IsRunningEvents(){return this._runningEventsDepth>0}IsInEventEngine(){return this.IsRunningEvents()||this.IsInTrigger()}_RunQueuedTriggers(layoutManager){for(const [method,inst,behaviorType]of this._queuedTriggers)this._Trigger(layoutManager, +method,inst,behaviorType);C3.clearArray(this._queuedTriggers)}BlockFlushingInstances(e){if(e)this._blockFlushingDepth++;else this._blockFlushingDepth--}IsFlushingBlocked(){return this._blockFlushingDepth>0}ClearSol(solModifiers){for(let i=0,len=solModifiers.length;iw.ShouldRelease());for(const w of toRelease)w.Release()}ClearAllScheduledWaits(){for(const w of this._scheduledWaits)w.Release();C3.clearArray(this._scheduledWaits)}RemoveInstancesFromScheduledWaits(s){for(const w of this._scheduledWaits)w.RemoveInstances(s)}AddAsyncActionPromise(p){this._asyncActionPromises.push(p)}ClearAsyncActionPromises(){C3.clearArray(this._asyncActionPromises)}GetPromiseForAllAsyncActions(){const ret=Promise.all(this._asyncActionPromises); +this._asyncActionPromises=[];return ret}_SaveToJson(){return{"groups":this._SaveGroupsToJson(),"cnds":this._SaveCndsToJson(),"acts":this._SaveActsToJson(),"vars":this._SaveVarsToJson(),"waits":this._SaveScheduledWaitsToJson()}}_LoadFromJson(o){this._LoadGroupsFromJson(o["groups"]);this._LoadCndsFromJson(o["cnds"]);this._LoadActsFromJson(o["acts"]);this._LoadVarsFromJson(o["vars"]);this._LoadScheduledWaitsFromJson(o["waits"])}_SaveGroupsToJson(){const o={};for(const group of this.GetAllGroups())o[group.GetSID().toString()]= +group.IsGroupActive();return o}_LoadGroupsFromJson(o){for(const [sidStr,data]of Object.entries(o)){const sid=parseInt(sidStr,10);const group=this.GetEventGroupBySID(sid);if(group)group.SetGroupActive(data)}}_SaveCndsToJson(){const o={};for(const [sid,cnd]of this._cndsBySid){const data=cnd._SaveToJson();if(data)o[sid.toString()]=data}return o}_LoadCndsFromJson(o){const map=new Map;for(const [sidStr,data]of Object.entries(o))map.set(parseInt(sidStr,10),data);for(const [sid,cnd]of this._cndsBySid)cnd._LoadFromJson(map.get(sid)|| +null)}_SaveActsToJson(){const o={};for(const [sid,act]of this._actsBySid){const data=act._SaveToJson();if(data)o[sid.toString()]=data}return o}_LoadActsFromJson(o){const map=new Map;for(const [sidStr,data]of Object.entries(o))map.set(parseInt(sidStr,10),data);for(const [sid,act]of this._actsBySid)act._LoadFromJson(map.get(sid)||null)}_SaveVarsToJson(){const o={};for(const [sid,eventVar]of this._eventVarsBySid)if(!eventVar.IsConstant()&&(eventVar.IsGlobal()||eventVar.IsStatic()))o[sid.toString()]= +eventVar.GetValue();return o}_LoadVarsFromJson(o){for(const [sidStr,data]of Object.entries(o)){const sid=parseInt(sidStr,10);const eventVar=this.GetEventVariableBySID(sid);if(eventVar)eventVar.SetValue(data)}}_SaveScheduledWaitsToJson(){return this._scheduledWaits.filter(w=>!w.IsPromise()).map(w=>w._SaveToJson())}_LoadScheduledWaitsFromJson(arr){this.ClearAllScheduledWaits();for(const data of arr){const sw=C3.ScheduledWait._CreateFromJson(this,data);if(sw)this._scheduledWaits.push(sw)}}_GetPerfRecords(){return[...this._runtime.GetLayoutManager().runningLayouts()].map(l=> +l.GetEventSheet()).filter(eventSheet=>eventSheet).map(e=>e._GetPerfRecord())}FindFirstFunctionBlockParent(parent){while(parent){const scopeParent=parent.GetScopeParent();if(scopeParent instanceof C3.FunctionBlock)return scopeParent;parent=scopeParent}return null}_InvokeFunctionFromJS(name,params){if(!Array.isArray(params))params=[];const functionBlock=this.GetFunctionBlockByName(name.toLowerCase());if(!functionBlock)return null;if(!functionBlock.IsEnabled())return functionBlock.GetDefaultReturnValue(); +const functionParameters=functionBlock.GetFunctionParameters();if(params.length1;if(isRecursive)eventSheetManager.GetLocalVarStack().Push();const frame=eventStack.Push(trigger);if(inst){const objectClass=trigger.GetConditions()[index].GetObjectClass();const sol=objectClass.GetCurrentSol();sol.SetSinglePicked(inst);if(inst.IsInContainer())inst.SetSiblingsSinglePicked()}let okToRun=true;if(trigger.GetParent()){const parents=trigger.GetTriggerParents();for(let i=0,len=parents.length;i< +len;++i)if(!parents[i].RunPreTrigger(frame)){okToRun=false;break}}if(okToRun){runtime.IncrementExecCount();if(trigger.IsOrBlock())trigger.RunOrBlockTrigger(frame,index);else trigger.Run(frame);ret=frame.GetLastEventTrue()}eventStack.Pop();if(isRecursive)eventSheetManager.GetLocalVarStack().Pop();eventSheetManager.PopSol(trigger.GetSolModifiersIncludingParents());if(currentEvent)eventSheetManager.PopSol(currentEvent.GetSolModifiersIncludingParents());if(!currentEvent&&triggerDepth===1){eventSheetManager.ClearAsyncActionPromises(); +if(!eventSheetManager.IsFlushingBlocked())runtime.FlushPendingInstances()}return ret}*_DebugExecuteTrigger(inst,trigger,index){const runtime=this._runtime;const eventSheetManager=this._eventSheetManager;const currentEvent=eventSheetManager.GetCurrentEvent();const eventStack=eventSheetManager.GetEventStack();const triggerDepth=eventSheetManager.GetTriggerDepth();let ret=false;if(currentEvent)eventSheetManager.PushCleanSol(currentEvent.GetSolModifiersIncludingParents());eventSheetManager.PushCleanSol(trigger.GetSolModifiersIncludingParents()); +const isRecursive=triggerDepth>1;if(isRecursive)eventSheetManager.GetLocalVarStack().Push();const frame=eventStack.Push(trigger);if(inst){const objectClass=trigger.GetConditions()[index].GetObjectClass();const sol=objectClass.GetCurrentSol();sol.SetSinglePicked(inst);if(inst.IsInContainer())inst.SetSiblingsSinglePicked()}let okToRun=true;if(trigger.GetParent()){const parents=trigger.GetTriggerParents();for(let i=0,len=parents.length;i0){let hasAnyActionWithReturnType=false;for(const a of this._actions){a._PostInit();if(a.HasReturnType())hasAnyActionWithReturnType= +true}if(hasAnyActionWithReturnType){this._RunActions=this._RunActions_ReturnValue;this._DebugRunActions=this._DebugRunActions_ReturnValue}else{this._RunActions=this._RunActions_Fast;this._DebugRunActions=this._DebugRunActions_Fast}}const subEvents=this._subEvents;for(let i=0,len=subEvents.length;ic.DebugCanRunFast());dd.canRunAllActionsFast=this._actions.every(a=>a.DebugCanRunFast());dd.canRunAllSubEventsFast=this._subEvents.every(s=>s.DebugCanRunFast());dd.canRunSelfFast=dd.canRunAllConditionsFast&&dd.canRunAllActionsFast&&dd.canRunAllSubEventsFast}_UpdateCanRunFastRecursive(){let e=this;do{e._UpdateCanRunFast(); +e=e.GetParent()}while(e)}_IdentifyTopLevelGroup(){if(!this.IsGroup())return;let p=this.GetParent();this._isTopLevelGroup=true;while(p){if(!p.IsGroup()){this._isTopLevelGroup=false;break}p=p.GetParent()}}_IdentifySolModifiersIncludingParents(){const allObjectClasses=this._runtime.GetAllObjectClasses();if(this._solModifiers===allObjectClasses)this._solModifiersIncludingParents=allObjectClasses;else{this._solModifiersIncludingParents=C3.cloneArray(this._solModifiers);let p=this.GetParent();while(p){for(const o of p._solModifiers)this._AddParentSolModifier(o); +p=p.GetParent()}const eventSheetManager=this.GetEventSheetManager();this._solModifiers=eventSheetManager._DeduplicateSolModifierList(this._solModifiers);this._solModifiersIncludingParents=eventSheetManager._DeduplicateSolModifierList(this._solModifiersIncludingParents)}}_IdentifyTriggerParents(){if(!this.HasAnyTriggeredCondition())return;this._triggerParents=[];let p=this.GetParent();while(p){this._triggerParents.push(p);p=p.GetParent()}this._triggerParents.reverse()}SetSolWriterAfterCnds(){this._isSolWriterAfterCnds= +true;if(this._parent)this._parent.SetSolWriterAfterCnds()}IsSolWriterAfterCnds(){return this._isSolWriterAfterCnds}GetSolModifiers(){return this._solModifiers}GetSolModifiersIncludingParents(){if(!this._hasGotSolModifiersIncludingParents){this._hasGotSolModifiersIncludingParents=true;this._IdentifySolModifiersIncludingParents()}return this._solModifiersIncludingParents}HasSolModifier(objectClass){return this._solModifiers.includes(objectClass)}GetTriggerParents(){return this._triggerParents}GetEventSheet(){return this._eventSheet}GetEventSheetManager(){return this._eventSheet.GetEventSheetManager()}GetRuntime(){return this._runtime}GetParent(){return this._parent}_SetScopeParent(p){this._scopeParent= +p}GetScopeParent(){return this._scopeParent||this._parent}GetDisplayNumber(){return this._displayNumber}IsDebugBreakable(){return this._debugData&&this._debugData.isBreakable}IsDebugBreakpoint(){return this.IsDebugBreakable()&&this._debugData.isBreakpoint}_SetDebugBreakpoint(b){this._debugData.isBreakpoint=!!b;this._UpdateCanRunFastRecursive()}IsGroup(){return this._isGroup}IsTopLevelGroup(){return this._isTopLevelGroup}IsElseBlock(){return this._isElseBlock}HasElseBlock(){return this._hasElseBlock}GetGroupName(){return this._groupName}IsGroupActive(){return this._isGroupActive}ResetInitialActivation(){this.SetGroupActive(this._isInitiallyActive)}SetGroupActive(a){a= +!!a;if(!this._isGroup)throw new Error("not a group");if(this._isGroupActive===a)return;this._isGroupActive=a;for(const include of this._containedIncludes)include.UpdateActive();if(this._containedIncludes.length){const currentLayout=this._runtime.GetCurrentLayout();const mainEventSheet=currentLayout.GetEventSheet();if(mainEventSheet)mainEventSheet._UpdateDeepIncludes()}}GetSID(){return this._sid}IsOrBlock(){return this._isOrBlock}IsTrigger(){return this._conditions.length&&this._conditions[0].IsTrigger()}IsForFunctionBlock(){return this._scopeParent&& +this._scopeParent instanceof C3.FunctionBlock}HasAnyTriggeredCondition(){return this.IsForFunctionBlock()||this._conditions.some(c=>c.IsTrigger())}GetConditions(){return this._conditions}GetConditionCount(){return this._conditions.length}GetConditionAt(i){i=Math.floor(i);if(i<0||i>=this._conditions.length)throw new RangeError("invalid condition index");return this._conditions[i]}GetConditionByDebugIndex(i){return this.GetConditionAt(i)}IsFirstConditionOfType(cnd){let i=cnd.GetIndex();if(i===0)return true; +--i;for(;i>=0;--i)if(this._conditions[i].GetObjectClass()===cnd.GetObjectClass())return false;return true}GetActions(){return this._actions}GetActionCount(){return this._actions.length}GetActionAt(i){i=Math.floor(i);if(i<0||i>=this._actions.length)throw new RangeError("invalid action index");return this._actions[i]}GetActionByDebugIndex(i){i=Math.floor(i);const ret=this._actions.find(a=>a.GetDebugIndex()===i);if(!ret)throw new RangeError("invalid action debug index");return ret}_HasActionIndex(i){i= +Math.floor(i);return i>=0&&ie instanceof C3.EventVariable)}RunPreTrigger(frame){frame.SetCurrentEvent(this);let isAnyTrue=false;const conditions=this._conditions;for(let i=0,len=conditions.length;i0)if(isRecursive){const paramResults=parameters.map(p=>p.Get(0));eventSheetManager.GetLocalVarStack().Push();this._scopeParent.SetFunctionParameters(paramResults)}else this._scopeParent.EvaluateFunctionParameters(parameters);else if(isRecursive)eventSheetManager.GetLocalVarStack().Push()}RunAsFunctionCall(combinedSolModifiers,parameters){let ret;let asyncId;const hasAnySolModifiers=combinedSolModifiers.length>0;const runtime=this._runtime;const eventStack= +this._eventStack;const eventSheetManager=runtime.GetEventSheetManager();const triggerDepth=eventSheetManager._IncTriggerDepth();const isRecursive=triggerDepth>1;this._EvaluateFunctionCallParameters(eventSheetManager,parameters,isRecursive);if(hasAnySolModifiers)eventSheetManager.PushCleanSol(combinedSolModifiers);const frame=eventStack.Push(this);if(this._CheckParentsOKToRun(frame)){runtime.IncrementExecCount();frame.SetCurrentEvent(this);const isAsync=this._scopeParent.IsAsync();if(isAsync)[asyncId, +ret]=this._scopeParent.StartAsyncFunctionCall();this._RunAndBlock(frame);if(isAsync)this._scopeParent.MaybeFinishAsyncFunctionCall(asyncId)}eventStack.Pop();if(isRecursive)eventSheetManager.GetLocalVarStack().Pop();if(hasAnySolModifiers)eventSheetManager.PopSol(combinedSolModifiers);eventSheetManager._DecTriggerDepth();return ret}*DebugRunAsFunctionCall(combinedSolModifiers,parameters){let ret;let asyncId;if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;const hasAnySolModifiers= +combinedSolModifiers.length>0;const runtime=this._runtime;const eventStack=this._eventStack;const eventSheetManager=runtime.GetEventSheetManager();const triggerDepth=eventSheetManager._IncTriggerDepth();const isRecursive=triggerDepth>1;this._EvaluateFunctionCallParameters(eventSheetManager,parameters,isRecursive);if(hasAnySolModifiers)eventSheetManager.PushCleanSol(combinedSolModifiers);const frame=eventStack.Push(this);if(yield*this._DebugCheckParentsOKToRun(frame)){runtime.IncrementExecCount(); +frame.SetCurrentEvent(this);const isAsync=this._scopeParent.IsAsync();if(isAsync)[asyncId,ret]=this._scopeParent.StartAsyncFunctionCall();yield*this._DebugRunAndBlock(frame);if(isAsync)this._scopeParent.MaybeFinishAsyncFunctionCall(asyncId)}eventStack.Pop();if(isRecursive)eventSheetManager.GetLocalVarStack().Pop();if(hasAnySolModifiers)eventSheetManager.PopSol(combinedSolModifiers);eventSheetManager._DecTriggerDepth();return ret}RunAsMappedFunctionCall(paramResults){const solModifiers=this.GetSolModifiersIncludingParents(); +const hasAnySolModifiers=solModifiers.length>0;const runtime=this._runtime;const eventStack=this._eventStack;const eventSheetManager=runtime.GetEventSheetManager();const triggerDepth=eventSheetManager._IncTriggerDepth();const isRecursive=triggerDepth>1;if(isRecursive)eventSheetManager.GetLocalVarStack().Push();this._scopeParent.SetFunctionParameters(paramResults);if(hasAnySolModifiers)eventSheetManager.PushCleanSol(solModifiers);const frame=eventStack.Push(this);if(this._CheckParentsOKToRun(frame)){runtime.IncrementExecCount(); +frame.SetCurrentEvent(this);this._RunAndBlock(frame)}eventStack.Pop();if(isRecursive)eventSheetManager.GetLocalVarStack().Pop();if(hasAnySolModifiers)eventSheetManager.PopSol(solModifiers);eventSheetManager._DecTriggerDepth()}*DebugRunAsMappedFunctionCall(paramResults){if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;const solModifiers=this.GetSolModifiersIncludingParents();const hasAnySolModifiers=solModifiers.length>0;const runtime=this._runtime;const eventStack=this._eventStack; +const eventSheetManager=runtime.GetEventSheetManager();const triggerDepth=eventSheetManager._IncTriggerDepth();const isRecursive=triggerDepth>1;if(isRecursive)eventSheetManager.GetLocalVarStack().Push();this._scopeParent.SetFunctionParameters(paramResults);if(hasAnySolModifiers)eventSheetManager.PushCleanSol(solModifiers);const frame=eventStack.Push(this);if(yield*this._DebugCheckParentsOKToRun(frame)){runtime.IncrementExecCount();frame.SetCurrentEvent(this);yield*this._DebugRunAndBlock(frame)}eventStack.Pop(); +if(isRecursive)eventSheetManager.GetLocalVarStack().Pop();if(hasAnySolModifiers)eventSheetManager.PopSol(solModifiers);eventSheetManager._DecTriggerDepth()}RunAsExpressionFunctionCall(combinedSolModifiers,returnType,defaultReturnValue,...paramResults){let ret;let asyncId;const hasAnySolModifiers=combinedSolModifiers.length>0;const runtime=this._runtime;const eventStack=this._eventStack;const eventSheetManager=runtime.GetEventSheetManager();const triggerDepth=eventSheetManager._IncTriggerDepth();const isRecursive= +triggerDepth>1;if(isRecursive)eventSheetManager.GetLocalVarStack().Push();if(paramResults.length>0)this._scopeParent.SetFunctionParameters(paramResults);if(hasAnySolModifiers)eventSheetManager.PushCleanSol(combinedSolModifiers);const frame=eventStack.Push(this);frame.InitCallFunctionExpression(returnType,defaultReturnValue);eventStack.PushExpFunc(frame);runtime.SetDebuggingEnabled(false);if(this._CheckParentsOKToRun(frame)){runtime.IncrementExecCount();frame.SetCurrentEvent(this);const isAsync=this._scopeParent.IsAsync(); +if(isAsync)[asyncId,ret]=this._scopeParent.StartAsyncFunctionCall();this._RunAndBlock(frame);if(isAsync)this._scopeParent.MaybeFinishAsyncFunctionCall(asyncId)}runtime.SetDebuggingEnabled(true);eventStack.Pop();eventStack.PopExpFunc();if(isRecursive)eventSheetManager.GetLocalVarStack().Pop();if(hasAnySolModifiers)eventSheetManager.PopSol(combinedSolModifiers);eventSheetManager._DecTriggerDepth();return ret||frame.GetFunctionReturnValue()}}}; + + +// c3/events/eventScript.js +'use strict';{const C3=self.C3;const EMPTY_SOL_MODIFIERS=[];let hadUserScriptException=false;C3.EventScript=class EventScript extends C3.DefendedBase{constructor(eventSheet,parent,data){super();const runtime=eventSheet.GetRuntime();const eventSheetManager=eventSheet.GetEventSheetManager();this._eventSheet=eventSheet;this._eventSheetManager=eventSheetManager;this._runtime=eventSheet.GetRuntime();this._parent=parent;const userMethod=runtime.GetObjectReference(data[1]);this._func=userMethod;this._displayNumber= +data[2];this._eventSheet._RegisterEventByDisplayNumber(this,this._displayNumber);this._debugData=runtime.IsDebug()?{isBreakpoint:data[3][0],isBreakable:data[3][1]}:null}static Create(eventSheet,parent,data){return C3.New(C3.EventScript,eventSheet,parent,data)}_PostInit(){const userMethod=this._func;const localVars=this._runtime.GetEventSheetManager()._GetLocalVariablesScriptInterface(this);this._func=userMethod.bind(null,this._runtime.GetIRuntime(),localVars)}GetParent(){return this._parent}GetScopeParent(){return this._parent}GetEventSheet(){return this._eventSheet}GetDisplayNumber(){return this._displayNumber}IsDebugBreakable(){return this._debugData&& +this._debugData.isBreakable}IsDebugBreakpoint(){return this.IsDebugBreakable()&&this._debugData.isBreakpoint}_SetDebugBreakpoint(b){this._debugData.isBreakpoint=!!b}IsElseBlock(){return false}GetSolModifiers(){return EMPTY_SOL_MODIFIERS}GetSolModifiersIncludingParents(){if(this._parent)return this._parent.GetSolModifiersIncludingParents();else return EMPTY_SOL_MODIFIERS}Run(frame){frame.SetCurrentEvent(this);this._eventSheetManager.AddAsyncActionPromise(this._RunUserScript())}async _RunUserScript(){try{await this._func()}catch(err){console.error(`Unhandled exception running script %c${this.GetEventSheet().GetName()}, event ${this.GetDisplayNumber()}:`, +"font-size: 1.2em; font-weight: bold;",err);if(self.C3Debugger)self.C3Debugger._SetLastErrorScript(this);if(!hadUserScriptException){console.info(`%cTip:%c run this to highlight in Construct the last script that had an error: %cgoToLastErrorScript()`,"font-weight: bold; text-decoration: underline","","font-weight: bold");hadUserScriptException=true}}}*DebugRun(frame){frame.SetCurrentEvent(this);if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;this.Run(frame)}DebugCanRunFast(){return!this.IsDebugBreakpoint()&& +!this._runtime.DebugBreakNext()}static HadUserScriptException(){return hadUserScriptException}static SetHadUserScriptException(){hadUserScriptException=true}}}; + + +// c3/events/functionBlock.js +'use strict';{const C3=self.C3;const assert=self.assert;C3.FunctionBlock=class FunctionBlock extends C3.DefendedBase{constructor(eventSheet,parent,data){super();this._eventSheet=eventSheet;this._runtime=eventSheet.GetRuntime();this._parent=parent;const funcData=data[1];this._functionName=funcData[0];this._returnType=funcData[1];this._functionParameters=funcData[2].map(paramData=>C3.EventVariable.Create(eventSheet,this,paramData));this._isEnabled=funcData[3];this._innerLocalVariables=[];this._isAsync= +funcData[4];this._nextAsyncId=0;this._currentAsyncId=-1;this._asyncMap=new Map;this._eventBlock=C3.EventBlock.Create(eventSheet,parent,data);this._eventBlock._SetScopeParent(this)}static Create(eventSheet,parent,data){return C3.New(C3.FunctionBlock,eventSheet,parent,data)}_PostInit(){for(const fp of this._functionParameters)fp._PostInit();this._eventBlock._PostInit(false)}_GetAllLocalVariablesInScope(){return this._functionParameters}GetFunctionParameters(){return this._functionParameters}GetFunctionParameterCount(){return this._functionParameters.length}_RegisterLocalVariable(localVariable){this._innerLocalVariables.push(localVariable)}_GetAllInnerLocalVariables(){return this._innerLocalVariables}EvaluateFunctionParameters(parameters){const functionParameters= +this._functionParameters;for(let i=0,len=functionParameters.length;ip.GetValue())}GetParent(){return this._parent}GetScopeParent(){return this._parent}GetFunctionName(){return this._functionName}GetReturnType(){return this._returnType}IsEnabled(){return this._isEnabled}GetDefaultReturnValue(){switch(this._returnType){case 0:return null; +case 2:return"";default:return 0}}GetEventBlock(){return this._eventBlock}IsAsync(){return this._isAsync}StartAsyncFunctionCall(){const asyncId=this._nextAsyncId++;this._currentAsyncId=asyncId;let resolve;const promise=new Promise(r=>resolve=r);this._asyncMap.set(asyncId,{resolve,pauseCount:0});return[asyncId,promise]}MaybeFinishAsyncFunctionCall(asyncId){const info=this._asyncMap.get(asyncId);if(info.pauseCount===0){info.resolve();this._asyncMap.delete(asyncId)}this._currentAsyncId=-1}PauseCurrentAsyncFunction(){const info= +this._asyncMap.get(this._currentAsyncId);info.pauseCount++;return this._currentAsyncId}ResumeAsyncFunction(asyncId){this._currentAsyncId=asyncId;const info=this._asyncMap.get(asyncId);info.pauseCount--}}}; + + +// c3/events/eventVariable.js +'use strict';{const C3=self.C3;const EMPTY_SOL_MODIFIERS=[];C3.EventVariable=class EventVariable extends C3.DefendedBase{constructor(eventSheet,parent,data){super();const eventSheetManager=eventSheet.GetEventSheetManager();this._eventSheet=eventSheet;this._eventSheetManager=eventSheetManager;this._runtime=eventSheet.GetRuntime();this._parent=parent;this._localVarStack=eventSheetManager.GetLocalVarStack();this._name=data[1];this._type=data[2];this._initialValue=data[3];this._isStatic=!!data[4];this._isConstant= +!!data[5];this._isFunctionParameter=parent instanceof C3.FunctionBlock;this._sid=data[6];this._jsPropName=this._runtime.GetJsPropName(data[8]);this._scriptSetter=v=>this.SetValue(v);this._scriptGetter=()=>this.GetValue();this._hasSingleValue=!this._parent||this._isStatic||this._isConstant;this._value=this._initialValue;this._localIndex=-1;if(this.IsBoolean())this._value=this._value?1:0;if(this.IsLocal()&&!this.IsStatic()&&!this.IsConstant())this._localIndex=eventSheetManager._GetNextLocalVarIndex(this); +eventSheetManager._RegisterEventVariable(this)}static Create(eventSheet,parent,data){return C3.New(C3.EventVariable,eventSheet,parent,data)}_PostInit(){if(this.IsLocal()&&!this.IsStatic()&&!this.IsConstant()&&!this.IsFunctionParameter()){const functionBlock=this._eventSheetManager.FindFirstFunctionBlockParent(this);if(functionBlock)functionBlock._RegisterLocalVariable(this)}}GetName(){return this._name}GetJsPropName(){return this._jsPropName}GetParent(){return this._parent}GetScopeParent(){return this.GetParent()}IsGlobal(){return!this.GetParent()}IsLocal(){return!this.IsGlobal()}IsFunctionParameter(){return this._isFunctionParameter}IsStatic(){return this._isStatic}IsConstant(){return this._isConstant}IsNumber(){return this._type=== +0}IsString(){return this._type===1}IsBoolean(){return this._type===2}IsElseBlock(){return false}GetSID(){return this._sid}GetInitialValue(){return this._initialValue}GetSolModifiers(){return EMPTY_SOL_MODIFIERS}Run(frame){if(this.IsLocal()&&!this.IsStatic()&&!this.IsConstant())this.SetValue(this.GetInitialValue())}DebugCanRunFast(){return true}*DebugRun(frame){this.Run(frame)}SetValue(v){if(this.IsNumber()){if(typeof v!=="number")v=parseFloat(v)}else if(this.IsString()){if(typeof v!=="string")v=v.toString()}else if(this.IsBoolean())v= +v?1:0;if(this._hasSingleValue)this._value=v;else this._localVarStack.GetCurrent()[this._localIndex]=v}GetValue(){return this._hasSingleValue?this._value:this._localVarStack.GetCurrent()[this._localIndex]}GetTypedValue(){let ret=this.GetValue();if(this.IsBoolean())ret=!!ret;return ret}ResetToInitialValue(){this._value=this._initialValue}_GetScriptInterfaceDescriptor(){return{configurable:false,enumerable:true,get:this._scriptGetter,set:this._scriptSetter}}}}; + + +// c3/events/eventInclude.js +'use strict';{const C3=self.C3;const assert=self.assert;const EMPTY_SOL_MODIFIERS=[];C3.EventInclude=class EventInclude extends C3.DefendedBase{constructor(eventSheet,parent,data){super();const eventSheetManager=eventSheet.GetEventSheetManager();this._eventSheet=eventSheet;this._eventSheetManager=eventSheetManager;this._runtime=eventSheet.GetRuntime();this._parent=parent;this._includeSheet=null;this._includeSheetName=data[1];this._isActive=true}static Create(eventSheet,parent,data){return C3.New(C3.EventInclude, +eventSheet,parent,data)}_PostInit(){this._includeSheet=this._eventSheetManager.GetEventSheetByName(this._includeSheetName);this._eventSheet._AddShallowInclude(this);let p=this.GetParent();while(p){if(p instanceof C3.EventBlock&&p.IsGroup())p._AddContainedInclude(this);p=p.GetParent()}this.UpdateActive();if(this._runtime.IsDebug())this._eventSheet._GetPerfRecord().children.push(this._includeSheet._GetPerfRecord())}GetParent(){return this._parent}GetSolModifiers(){return EMPTY_SOL_MODIFIERS}GetIncludeSheet(){return this._includeSheet}Run(frame){const pushSol= +!!this.GetParent();const allObjectClasses=this._runtime.GetAllObjectClasses();if(pushSol)this._eventSheetManager.PushCleanSol(allObjectClasses);this._includeSheet.Run();if(pushSol)this._eventSheetManager.PopSol(allObjectClasses)}*DebugRun(frame){const pushSol=!!this.GetParent();const allObjectClasses=this._runtime.GetAllObjectClasses();if(pushSol)this._eventSheetManager.PushCleanSol(allObjectClasses);yield*this._includeSheet.DebugRun();if(pushSol)this._eventSheetManager.PopSol(allObjectClasses)}DebugCanRunFast(){return false}IsActive(){return this._isActive}UpdateActive(){let p= +this.GetParent();while(p){if(p instanceof C3.EventBlock&&p.IsGroup()&&!p.IsGroupActive()){this._isActive=false;return}p=p.GetParent()}this._isActive=true}}}; + + +// c3/events/expNode.js +'use strict';{const C3=self.C3;const assert=self.assert;C3.ExpNode=class ExpNode extends C3.DefendedBase{constructor(owner){super();this._owner=owner;this._runtime=owner.GetRuntime()}_PostInit(){}static CreateNode(owner,data){const type=data[0];const Classes=[BehaviorExpressionNode,ObjectExpressionNode,InstVarExpressionNode,EventVarExpNode,SystemExpressionExpNode,CallFunctionExpressionExpNode];return C3.New(Classes[type],owner,data)}};class SystemExpressionExpNode extends C3.ExpNode{constructor(owner, +data){super(owner);this._systemPlugin=this._runtime.GetSystemPlugin();this._func=this._runtime.GetObjectReference(data[1]);if(this._func===C3.Plugins.System.Exps.random||this._func===C3.Plugins.System.Exps.choose)this._owner.SetVariesPerInstance()}GetBoundMethod(){return this._systemPlugin._GetBoundACEMethod(this._func,this._systemPlugin)}}class CallFunctionExpressionExpNode extends C3.ExpNode{constructor(owner,data){super(owner);this._functionBlock=null;this._functionName=data[1];this._owner.SetVariesPerInstance()}_PostInit(){const eventSheetManager= +this._runtime.GetEventSheetManager();this._functionBlock=eventSheetManager.GetFunctionBlockByName(this._functionName);this._functionName=null;const myEventBlock=this._owner.GetEventBlock();const callEventBlock=this._functionBlock.GetEventBlock();this._combinedSolModifiers=[...(new Set([...myEventBlock.GetSolModifiersIncludingParents(),...callEventBlock.GetSolModifiersIncludingParents()]))];this._combinedSolModifiers=eventSheetManager._DeduplicateSolModifierList(this._combinedSolModifiers)}GetBoundMethod(){const functionBlock= +this._functionBlock;if(functionBlock.IsEnabled()){const callEventBlock=functionBlock.GetEventBlock();return C3.EventBlock.prototype.RunAsExpressionFunctionCall.bind(callEventBlock,this._combinedSolModifiers,functionBlock.GetReturnType(),functionBlock.GetDefaultReturnValue())}else{const defaultReturnValue=functionBlock.GetDefaultReturnValue();return()=>defaultReturnValue}}}function WrapIndex(index,len){if(index>=len)return index%len;else if(index<0){if(index<=-len)index%=len;if(index<0)index+=len; +return index}else return index}class ObjectExpressionNode extends C3.ExpNode{constructor(owner,data){super(owner);this._objectClass=this._runtime.GetObjectClassByIndex(data[1]);this._func=this._runtime.GetObjectReference(data[2]);this._returnsString=!!data[3];this._eventStack=this._runtime.GetEventSheetManager().GetEventStack();this._owner._MaybeVaryFor(this._objectClass)}GetBoundMethod(){return this._objectClass.GetPlugin()._GetBoundACEMethod(this._func,this._objectClass.GetSingleGlobalInstance().GetSdkInstance())}ExpObject(...args){const objectClass= +this._objectClass;const instances=objectClass.GetCurrentSol().GetExpressionInstances();const len=instances.length;if(len===0)return this._returnsString?"":0;const index=WrapIndex(this._owner.GetSolIndex(),len);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(objectClass);return this._func.apply(instances[index].GetSdkInstance(),args)}ExpObject_InstExpr(instIndex,...args){const objectClass=this._objectClass;const instances=objectClass.GetInstances();const len=instances.length;if(len=== +0)return this._returnsString?"":0;const index=WrapIndex(instIndex,len);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(objectClass);return this._func.apply(instances[index].GetSdkInstance(),args)}}class InstVarExpressionNode extends C3.ExpNode{constructor(owner,data){super(owner);this._objectClass=this._runtime.GetObjectClassByIndex(data[1]);this._varIndex=data[3];this._returnsString=!!data[2];this._owner._MaybeVaryFor(this._objectClass)}ExpInstVar(){const instances=this._objectClass.GetCurrentSol().GetExpressionInstances(); +const len=instances.length;if(len===0)return this._returnsString?"":0;const index=WrapIndex(this._owner.GetSolIndex(),len);return instances[index]._GetInstanceVariableValueUnchecked(this._varIndex)}ExpInstVar_Family(){const objectClass=this._objectClass;const instances=objectClass.GetCurrentSol().GetExpressionInstances();const len=instances.length;if(len===0)return this._returnsString?"":0;const index=WrapIndex(this._owner.GetSolIndex(),len);const inst=instances[index];const offset=inst.GetObjectClass().GetFamilyInstanceVariableOffset(objectClass.GetFamilyIndex()); +return inst._GetInstanceVariableValueUnchecked(this._varIndex+offset)}ExpInstVar_InstExpr(instIndex){const objectClass=this._objectClass;const instances=objectClass.GetInstances();const len=instances.length;if(len===0)return this._returnsString?"":0;const index=WrapIndex(instIndex,len);const inst=instances[index];let offset=0;if(objectClass.IsFamily())offset=inst.GetObjectClass().GetFamilyInstanceVariableOffset(objectClass.GetFamilyIndex());return inst._GetInstanceVariableValueUnchecked(this._varIndex+ +offset)}}class BehaviorExpressionNode extends C3.ExpNode{constructor(owner,data){super(owner);this._objectClass=this._runtime.GetObjectClassByIndex(data[1]);this._behaviorType=this._objectClass.GetBehaviorTypeByName(data[2]);this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(data[2]);this._func=this._runtime.GetObjectReference(data[3]);this._returnsString=!!data[4];this._eventStack=this._runtime.GetEventSheetManager().GetEventStack();this._owner._MaybeVaryFor(this._objectClass)}ExpBehavior(...args){const objectClass= +this._objectClass;const instances=objectClass.GetCurrentSol().GetExpressionInstances();const len=instances.length;if(len===0)return this._returnsString?"":0;const index=WrapIndex(this._owner.GetSolIndex(),len);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(objectClass);const inst=instances[index];let offset=0;if(objectClass.IsFamily())offset=inst.GetObjectClass().GetFamilyBehaviorOffset(objectClass.GetFamilyIndex());return this._func.apply(inst.GetBehaviorInstances()[this._behaviorIndex+ +offset].GetSdkInstance(),args)}ExpBehavior_InstExpr(instIndex,...args){const objectClass=this._objectClass;const instances=objectClass.GetInstances();const len=instances.length;if(len===0)return this._returnsString?"":0;const index=WrapIndex(instIndex,len);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(objectClass);const inst=instances[index];let offset=0;if(objectClass.IsFamily())offset=inst.GetObjectClass().GetFamilyBehaviorOffset(objectClass.GetFamilyIndex());return this._func.apply(inst.GetBehaviorInstances()[this._behaviorIndex+ +offset].GetSdkInstance(),args)}}class EventVarExpNode extends C3.ExpNode{constructor(owner,data){super(owner);this._eventVar=null;this._eventVarSid=data[1]}_PostInit(){this._eventVar=this._runtime.GetEventSheetManager().GetEventVariableBySID(this._eventVarSid)}GetVar(){return this._eventVar}}}; + + +// c3/events/parameter.js +'use strict';{const C3=self.C3;const assert=self.assert;C3.Parameter=class Parameter extends C3.DefendedBase{constructor(owner,type,index){super();this._owner=owner;this._index=index;this._type=type;this.Get=null;this._variesPerInstance=false;this._isConstant=false}static Create(owner,data,index){const type=data[0];const Classes=[ExpressionParameter,StringExpressionParameter,FileParameter,ComboParameter,ObjectParameter,LayerExpressionParameter,LayoutParameter,ExpressionParameter,ComboParameter,ComboParameter, +InstVarParameter,EventVarParameter,FileParameter,VariadicParameter,StringExpressionParameter,TimelineParameter,BooleanParameter,FunctionParameter,EaseParameter];return C3.New(Classes[type],owner,type,index,data)}_PostInit(){}SetVariesPerInstance(){this._variesPerInstance=true}_MaybeVaryFor(objectClass){if(this._variesPerInstance)return;if(!objectClass)return;if(!objectClass.GetPlugin().IsSingleGlobal())this._variesPerInstance=true}VariesPerInstance(){return this._variesPerInstance}GetIndex(){return this._index}GetRuntime(){return this._owner.GetRuntime()}GetEventBlock(){return this._owner.GetEventBlock()}IsConstant(){return this._isConstant}}; +function GetExpressionFunc(number){const ret=self.C3_ExpressionFuncs[number];if(!ret)throw new Error("invalid expression number");return ret}class ExpressionParameter extends C3.Parameter{constructor(owner,type,index,data){super(owner,type,index);this._solIndex=0;const expData=data[1];this._expressionNumber=expData[0];this._numberedNodes=[];this._expressionFunc=null;for(let i=1,len=expData.length;i=this._numberedNodes.length)throw new RangeError("invalid numbered node");return this._numberedNodes[i]}_PostInit(){for(const node of this._numberedNodes)node._PostInit();const func=GetExpressionFunc(this._expressionNumber);if(this._numberedNodes.length)this._expressionFunc=func(this);else this._expressionFunc=func}GetSolIndex(){return this._solIndex}GetExpression(solIndex){this._solIndex= +solIndex;return this._expressionFunc()}}class StringExpressionParameter extends ExpressionParameter{constructor(owner,type,index,data){super(owner,type,index,data);this.Get=this.GetStringExpression;if(type===14){this.GetEventBlock().SetAllSolModifiers();if(this._owner instanceof C3.Action)this.GetEventBlock().SetSolWriterAfterCnds()}}GetStringExpression(solIndex){this._solIndex=solIndex;const ret=this._expressionFunc();if(typeof ret==="string")return ret;else return""}_GetFastTriggerValue(){return GetExpressionFunc(this._expressionNumber)()}} +class LayerExpressionParameter extends ExpressionParameter{constructor(owner,type,index,data){super(owner,type,index,data);this.Get=this.GetLayer;this._isConstant=false}GetLayer(solIndex){this._solIndex=solIndex;const ret=this._expressionFunc();const layout=this.GetRuntime().GetCurrentLayout();return layout.GetLayer(ret)}}class ComboParameter extends C3.Parameter{constructor(owner,type,index,data){super(owner,type,index);this._combo=data[1];this.Get=this.GetCombo;this._isConstant=true}GetCombo(){return this._combo}} +class BooleanParameter extends C3.Parameter{constructor(owner,type,index,data){super(owner,type,index);this._bool=data[1];this.Get=this.GetBoolean;this._isConstant=true}GetBoolean(){return this._bool}}class ObjectParameter extends C3.Parameter{constructor(owner,type,index,data){super(owner,type,index);this._objectClass=this.GetRuntime().GetObjectClassByIndex(data[1]);this.Get=this.GetObjectClass;const eventBlock=this.GetEventBlock();eventBlock._AddSolModifier(this._objectClass);if(this._owner instanceof +C3.Action)eventBlock.SetSolWriterAfterCnds();else if(eventBlock.GetParent())eventBlock.GetParent().SetSolWriterAfterCnds();this._isConstant=true}GetObjectClass(){return this._objectClass}}class LayoutParameter extends C3.Parameter{constructor(owner,type,index,data){super(owner,type,index);this._layout=this.GetRuntime().GetLayoutManager().GetLayoutByName(data[1]);this.Get=this.GetLayout;this._isConstant=true}GetLayout(){return this._layout}}class TimelineParameter extends C3.Parameter{constructor(owner, +type,index,data){super(owner,type,index);this._timeline=this.GetRuntime().GetTimelineManager().GetTimelineByName(data[1]);this.Get=this.GetTimeline;this._isConstant=true}GetTimeline(){return this._timeline}}class FileParameter extends C3.Parameter{constructor(owner,type,index,data){super(owner,type,index);this._fileInfo=data[1];this.Get=this.GetFile;this._isConstant=true}GetFile(){return this._fileInfo}}class InstVarParameter extends C3.Parameter{constructor(owner,type,index,data){super(owner,type, +index);this._instVarIndex=data[1];const ownerObjectClass=this._owner.GetObjectClass();if(ownerObjectClass&&ownerObjectClass.IsFamily()){this.Get=this.GetFamilyInstanceVariable;this.SetVariesPerInstance()}else{this.Get=this.GetInstanceVariable;this._isConstant=true}}GetInstanceVariable(){return this._instVarIndex}GetFamilyInstanceVariable(solIndex){solIndex=solIndex||0;const familyType=this._owner.GetObjectClass();const sol=familyType.GetCurrentSol();const instances=sol.GetInstances();let realType= +null;if(instances.length)realType=instances[solIndex%instances.length].GetObjectClass();else if(sol.HasAnyElseInstances()){const elseInstances=sol.GetElseInstances();realType=elseInstances[solIndex%elseInstances.length].GetObjectClass()}else if(familyType.GetInstanceCount()>0){const familyInstances=familyType.GetInstances();realType=familyInstances[solIndex%familyInstances.length].GetObjectClass()}else return 0;return this._instVarIndex+realType.GetFamilyInstanceVariableOffset(familyType.GetFamilyIndex())}} +class EventVarParameter extends C3.Parameter{constructor(owner,type,index,data){super(owner,type,index);this._eventVarSid=data[1];this._eventVar=null;this.Get=this.GetEventVariable;this._isConstant=true}_PostInit(){this._eventVar=this.GetRuntime().GetEventSheetManager().GetEventVariableBySID(this._eventVarSid)}GetEventVariable(){return this._eventVar}}class FunctionParameter extends C3.Parameter{constructor(owner,type,index,data){super(owner,type,index);this._functionBlockName=data[1];this._functionBlock= +null;this.Get=this.GetFunction;this._isConstant=true}_PostInit(){this._functionBlock=this.GetRuntime().GetEventSheetManager().GetFunctionBlockByName(this._functionBlockName);this._functionBlockName=null}GetFunction(){return this._functionBlock}}class VariadicParameter extends C3.Parameter{constructor(owner,type,index,data){super(owner,type,index);this._subParams=[];this._variadicRet=[];this._isConstant=true;for(let i=1,len=data.length;i0;this._isFastTrigger= +data[3]===2;this._isLooping=!!data[4];this._isInverted=!!data[5];this._isStatic=!!data[6];this._sid=data[7];this._isInOrBlock=this._eventBlock.IsOrBlock();this._objectClass=null;this._behaviorType=null;this._behaviorIndex=-1;this._systemPlugin=null;this.Run=noop;this.DebugRun=noop;this._parameters=[];this._results=[];this._anyParamVariesPerInstance=false;this._savedData=null;this._unsavedData=null;this._debugData=this._runtime.IsDebug()?{isBreakpoint:data[8][0],canDebug:data[8][1]}:null;if(data[0]=== +-1)this._systemPlugin=this._runtime.GetSystemPlugin();else{this._objectClass=this._runtime.GetObjectClassByIndex(data[0]);if(data[2]){this._behaviorType=this._objectClass.GetBehaviorTypeByName(data[2]);this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(data[2])}if(this._eventBlock.GetParent())this._eventBlock.GetParent().SetSolWriterAfterCnds()}if(data.length===10){let paramData=data[9];for(let data of paramData){this._parameters.push(C3.Parameter.Create(this,data,this._parameters.length)); +this._results.push(0)}}if(this._parameters.length===0){this._parameters=EMPTY_PARAMS_ARRAY;this._results=EMPTY_PARAMS_ARRAY}this._eventBlock.GetEventSheetManager()._RegisterCondition(this)}static Create(eventBlock,data,index){return C3.New(C3.Condition,eventBlock,data,index)}_PostInit(){for(const param of this._parameters){param._PostInit();if(param.VariesPerInstance())this._anyParamVariesPerInstance=true}if(this._isFastTrigger){this.Run=this._RunFastTrigger;this.DebugRun=this._DebugRunFastTrigger}else if(this._systemPlugin){this._SetSystemRunMethod(); +this.DebugRun=this._DebugRunSystem}else if(this._objectClass.GetPlugin().IsSingleGlobal()){this._SetSingleGlobalRunMethod();this.DebugRun=this._DebugRunSingleGlobal}else if(this._isStatic){this.Run=this._RunStatic;this.DebugRun=this._DebugRunStatic}else{this.Run=this._RunObject;this.DebugRun=this._DebugRunObject}}_SetSystemRunMethod(){const plugin=this._systemPlugin;const bindThis=this._systemPlugin;this._SetRunMethodForBoundFunc(plugin,bindThis,this._RunSystem)}_SetSingleGlobalRunMethod(){const plugin= +this._objectClass.GetPlugin();const bindThis=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();this._SetRunMethodForBoundFunc(plugin,bindThis,this._RunSingleGlobal)}_SetRunMethodForBoundFunc(plugin,bindThis,fallbackMethod){const func=this._func;const isInverted=this._isInverted;const parameters=this._parameters;if(parameters.length===0){const boundFunc=plugin._GetBoundACEMethod(func,bindThis);if(isInverted)this.Run=function RunSingleCnd_0param(){return C3.xor(boundFunc(),isInverted)};else this.Run= +boundFunc}else if(parameters.length===1){const param0=parameters[0];if(!isInverted&¶m0.IsConstant())this.Run=plugin._GetBoundACEMethod_1param(func,bindThis,param0.Get(0));else{const boundFunc=plugin._GetBoundACEMethod(func,bindThis);this.Run=function RunSingleCnd_1param(){return C3.xor(boundFunc(param0.Get(0)),isInverted)}}}else if(parameters.length===2){const param0=parameters[0];const param1=parameters[1];if(!isInverted&¶m0.IsConstant()&¶m1.IsConstant())this.Run=plugin._GetBoundACEMethod_2params(func, +bindThis,param0.Get(0),param1.Get(0));else{const boundFunc=plugin._GetBoundACEMethod(func,bindThis);this.Run=function RunSingleCnd_2params(){return C3.xor(boundFunc(param0.Get(0),param1.Get(0)),isInverted)}}}else if(parameters.length===3){const param0=parameters[0];const param1=parameters[1];const param2=parameters[2];if(!isInverted&¶m0.IsConstant()&¶m1.IsConstant()&¶m2.IsConstant())this.Run=plugin._GetBoundACEMethod_3params(func,bindThis,param0.Get(0),param1.Get(0),param2.Get(0));else{const boundFunc= +plugin._GetBoundACEMethod(func,bindThis);this.Run=function RunSingleCnd_3params(){return C3.xor(boundFunc(param0.Get(0),param1.Get(0),param2.Get(0)),isInverted)}}}else this.Run=fallbackMethod}GetSID(){return this._sid}_GetFunc(){return this._func}GetObjectClass(){return this._objectClass}GetBehaviorType(){return this._behaviorType}GetEventBlock(){return this._eventBlock}GetRuntime(){return this._runtime}GetIndex(){return this._index}GetDebugIndex(){return this.GetIndex()}IsTrigger(){return this._isTrigger}IsFastTrigger(){return this._isFastTrigger}IsInverted(){return this._isInverted}IsLooping(){return this._isLooping}IsBreakpoint(){return this._debugData.isBreakpoint}_SetBreakpoint(b){this._debugData.isBreakpoint= +!!b;this._eventBlock._UpdateCanRunFastRecursive()}_DebugReturnsGenerator(){return this._debugData.canDebug}DebugCanRunFast(){return!this.IsBreakpoint()&&!this._runtime.DebugBreakNext()&&!this._DebugReturnsGenerator()}GetSavedDataMap(){if(!this._savedData)this._savedData=new Map;return this._savedData}GetUnsavedDataMap(){if(!this._unsavedData)this._unsavedData=new Map;return this._unsavedData}_RunSystem(){const results=this._results;EvalParams(this._parameters,results);return C3.xor(this._func.apply(this._systemPlugin, +results),this._isInverted)}*_DebugRunSystem(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const results=this._results;EvalParams(this._parameters,results);let ret=this._func.apply(this._systemPlugin,results);if(C3.IsIterator(ret))ret=yield*ret;return C3.xor(ret,this._isInverted)}else return this.Run()}_RunSingleGlobal(){const results=this._results;EvalParams(this._parameters,results);const inst=this._objectClass.GetSingleGlobalInstance().GetSdkInstance(); +return C3.xor(this._func.apply(inst,results),this._isInverted)}*_DebugRunSingleGlobal(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const results=this._results;EvalParams(this._parameters,results);const inst=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();let ret=this._func.apply(inst,results);if(C3.IsIterator(ret))ret=yield*ret;return C3.xor(ret,this._isInverted)}else return this.Run()}_RunFastTrigger(){return true}*_DebugRunFastTrigger(){if(this.IsBreakpoint()|| +this._runtime.DebugBreakNext())yield this;return true}_RunStatic(){const results=this._results;EvalParams(this._parameters,results);const ret=this._func.apply(this._behaviorType||this._objectClass,results);this._objectClass.ApplySolToContainer();return ret}*_DebugRunStatic(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const results=this._results;EvalParams(this._parameters,results);let ret=this._func.apply(this._behaviorType||this._objectClass, +results);if(C3.IsIterator(ret))ret=yield*ret;this._objectClass.ApplySolToContainer();return ret}else return this.Run()}_RunObject(){const parameters=this._parameters;const results=this._results;const sol=this._objectClass.GetCurrentSol();for(let i=0,len=parameters.length;i=0;const allInstances=objectClass.GetInstances(); +const paramsVary=this._anyParamVariesPerInstance;const results=this._results;const func=this._func;const isInverted=this._isInverted;const isInOrBlock=this._isInOrBlock&&!this._isTrigger;sol.ClearArrays();for(let i=0,len=allInstances.length;i=0;const paramsVary=this._anyParamVariesPerInstance;const results=this._results;const func=this._func;const isInverted=this._isInverted;const isInOrBlock=this._isInOrBlock&&!this._isTrigger;const solInstances=sol._GetOwnInstances();const solElseInstances=sol._GetOwnElseInstances();const isUsingElseInstances=isInOrBlock&&!this._eventBlock.IsFirstConditionOfType(this);const arr=isUsingElseInstances?solElseInstances:solInstances;let k=0;let isAnyTrue=false;for(let i=0, +len=arr.length;i=0;const results=this._results;const func=this._func;const isInverted=this._isInverted;for(let i=0,len=solInstances.length;i[arr[0].GetUID(),arr[1].GetUID(),arr[2]]);ex[k]=saveVal}return{"ex":ex}}_LoadFromJson(o){if(this._savedData){this._savedData.clear();this._savedData=null}if(!o)return;const runtime=this._runtime;const ex=o["ex"];if(ex){const map=this.GetSavedDataMap();map.clear(); +for(const [k,v]of Object.entries(ex)){let loadVal=v;if(k==="collmemory")loadVal=C3.New(C3.PairMap,v.map(arr=>[runtime.GetInstanceByUID(arr[0]),runtime.GetInstanceByUID(arr[1]),arr[2]]).filter(arr=>arr[0]&&arr[1]));map.set(k,loadVal)}}}}}; + + +// c3/events/action.js +'use strict';{const C3=self.C3;const assert=self.assert;function EvalParams(parameters,results){for(let i=0,len=parameters.length;i=4?data[3]:-1;this._actionReturnType= +data.length>=5?data[4]:0;this._func=null;this._objectClass=null;this._behaviorType=null;this._behaviorIndex=-1;this._systemPlugin=null;this._callFunctionName="";this._callEventBlock=null;this._combinedSolModifiers=null;this.Run=noop;this.DebugRun=noop;this._parameters=[];this._results=[];this._anyParamVariesPerInstance=false;this._savedData=null;this._unsavedData=null;const isScript=data[0]===-3;const debugInfo=isScript?data[2]:data[5];this._debugData=runtime.IsDebug()||isScript?{isBreakpoint:debugInfo[0], +canDebug:debugInfo[1],index:debugInfo[2]}:null;if(data[0]===-1){this._systemPlugin=runtime.GetSystemPlugin();this._func=runtime.GetObjectReference(data[1])}else if(data[0]===-2)this._callFunctionName=data[1];else if(isScript){const userMethod=runtime.GetObjectReference(data[1]);this._func=userMethod;this.Run=this.RunUserScript;this.DebugRun=this.DebugRunUserScript;this._actionReturnType=1}else{this._func=runtime.GetObjectReference(data[1]);this._objectClass=runtime.GetObjectClassByIndex(data[0]); +if(data[2]){this._behaviorType=this._objectClass.GetBehaviorTypeByName(data[2]);this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(data[2])}}if(data.length===7){const paramData=data[6];for(const data of paramData){this._parameters.push(C3.Parameter.Create(this,data,this._parameters.length));this._results.push(0)}}if(this._parameters.length===0){this._parameters=EMPTY_PARAMS_ARRAY;this._results=EMPTY_PARAMS_ARRAY}this._eventBlock.GetEventSheetManager()._RegisterAction(this)}static Create(eventBlock, +data,index){return C3.New(C3.Action,eventBlock,data,index)}_PostInit(){for(const param of this._parameters){param._PostInit();if(param.VariesPerInstance())this._anyParamVariesPerInstance=true}if(this._systemPlugin){this._SetSystemRunMethod();this.DebugRun=this._DebugRunSystem}else if(this._callFunctionName){this._SetCallFunctionRunMethod();this._callFunctionName=""}else if(this.Run===this.RunUserScript){const userMethod=this._func;const localVars=this._runtime.GetEventSheetManager()._GetLocalVariablesScriptInterface(this._eventBlock); +this._func=userMethod.bind(null,this._runtime.GetIRuntime(),localVars)}else if(this._behaviorType)if(this.IsAsync()){this.Run=this._RunBehavior_Async;this.DebugRun=this._DebugRunBehavior_Async}else{this.Run=this._RunBehavior;this.DebugRun=this._DebugRunBehavior}else if(this._objectClass.GetPlugin().IsSingleGlobal()){this._SetSingleGlobalRunMethod();this.DebugRun=this._DebugRunSingleGlobal}else if(this.IsAsync()){this.Run=this._RunObject_Async;this.DebugRun=this._DebugRunObject_Async}else if(!this._parameters.length){this.Run= +this._RunObject_ParamsConst;this.DebugRun=this._DebugRunObject_ParamsConst}else if(this._parameters.every(p=>p.VariesPerInstance())){this.Run=this._RunObject_AllParamsVary;this.DebugRun=this._DebugRunObject_AllParamsVary}else if(this._anyParamVariesPerInstance){this.Run=this._RunObject_SomeParamsVary;this.DebugRun=this._DebugRunObject_SomeParamsVary}else if(this._parameters.every(p=>p.IsConstant())){EvalParams(this._parameters,this._results);this.Run=this._RunObject_ParamsConst;this.DebugRun=this._DebugRunObject_ParamsConst}else{this.Run= +this._RunObject_ParamsDontVary;this.DebugRun=this._DebugRunObject_ParamsDontVary}}_SetSystemRunMethod(){const plugin=this._systemPlugin;const bindThis=this._systemPlugin;this._SetRunMethodForBoundFunc(plugin,bindThis,this._RunSystem)}_SetSingleGlobalRunMethod(){const plugin=this._objectClass.GetPlugin();const bindThis=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();this._SetRunMethodForBoundFunc(plugin,bindThis,this._RunSingleGlobal)}_SetCallFunctionRunMethod(){const eventSheetManager= +this._eventBlock.GetEventSheetManager();const functionBlock=eventSheetManager.GetFunctionBlockByName(this._callFunctionName);if(functionBlock.IsEnabled()){this._callEventBlock=functionBlock.GetEventBlock();this._combinedSolModifiers=[...(new Set([...this._eventBlock.GetSolModifiersIncludingParents(),...this._callEventBlock.GetSolModifiersIncludingParents()]))];this._combinedSolModifiers=eventSheetManager._DeduplicateSolModifierList(this._combinedSolModifiers);this.Run=C3.EventBlock.prototype.RunAsFunctionCall.bind(this._callEventBlock, +this._combinedSolModifiers,this._parameters);this.DebugRun=this._DebugRunCallFunction}else{this.Run=noop;this.DebugRun=noopGenerator}}_SetRunMethodForBoundFunc(plugin,bindThis,fallbackMethod){const func=this._func;const parameters=this._parameters;if(parameters.length===0)this.Run=plugin._GetBoundACEMethod(func,bindThis);else if(parameters.length===1){const param0=parameters[0];if(param0.IsConstant())this.Run=plugin._GetBoundACEMethod_1param(func,bindThis,param0.Get(0));else{const boundFunc=plugin._GetBoundACEMethod(func, +bindThis);this.Run=function RunSingleAct_1param(){return boundFunc(param0.Get(0))}}}else if(parameters.length===2){const param0=parameters[0];const param1=parameters[1];if(param0.IsConstant()&¶m1.IsConstant())this.Run=plugin._GetBoundACEMethod_2params(func,bindThis,param0.Get(0),param1.Get(0));else{const boundFunc=plugin._GetBoundACEMethod(func,bindThis);this.Run=function RunSingleAct_2params(){return boundFunc(param0.Get(0),param1.Get(0))}}}else if(parameters.length===3){const param0=parameters[0]; +const param1=parameters[1];const param2=parameters[2];if(param0.IsConstant()&¶m1.IsConstant()&¶m2.IsConstant())this.Run=plugin._GetBoundACEMethod_3params(func,bindThis,param0.Get(0),param1.Get(0),param2.Get(0));else{const boundFunc=plugin._GetBoundACEMethod(func,bindThis);this.Run=function RunSingleAct_3params(){return boundFunc(param0.Get(0),param1.Get(0),param2.Get(0))}}}else this.Run=fallbackMethod}GetSID(){return this._sid}IsAsync(){return this._actionReturnType===1}CanBailOut(){return this._actionReturnType=== +2}HasReturnType(){return this._actionReturnType!==0}GetObjectClass(){return this._objectClass}GetEventBlock(){return this._eventBlock}GetRuntime(){return this._runtime}GetIndex(){return this._index}GetDebugIndex(){return this._debugData.index}GetCombinedSolModifiers(){return this._combinedSolModifiers}IsBreakpoint(){return this._debugData.isBreakpoint}_SetBreakpoint(b){this._debugData.isBreakpoint=!!b;this._eventBlock._UpdateCanRunFastRecursive()}_DebugReturnsGenerator(){return this._debugData.canDebug}DebugCanRunFast(){return!this.IsBreakpoint()&& +!this._runtime.DebugBreakNext()&&!this._DebugReturnsGenerator()}GetSavedDataMap(){if(!this._savedData)this._savedData=new Map;return this._savedData}GetUnsavedDataMap(){if(!this._unsavedData)this._unsavedData=new Map;return this._unsavedData}_RunSystem(){const results=this._results;EvalParams(this._parameters,results);return this._func.apply(this._systemPlugin,results)}*_DebugRunSystem(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const results= +this._results;EvalParams(this._parameters,results);const ret=yield*this._func.apply(this._systemPlugin,results);return ret}else return this.Run()}*_DebugRunCallFunction(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;const ret=yield*this._callEventBlock.DebugRunAsFunctionCall(this._combinedSolModifiers,this._parameters);return ret}_RunSingleGlobal(){const results=this._results;EvalParams(this._parameters,results);return this._func.apply(this._objectClass.GetSingleGlobalInstance().GetSdkInstance(), +results)}*_DebugRunSingleGlobal(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const results=this._results;EvalParams(this._parameters,results);const ret=yield*this._func.apply(this._objectClass.GetSingleGlobalInstance().GetSdkInstance(),results);return ret}else return this.Run()}_RunObject_ParamsConst(){const results=this._results;const instances=this._objectClass.GetCurrentSol().GetInstances();for(let i=0,len=instances.length;ilayout.GetWidth()|| +bbox.getTop()>layout.GetHeight()}function PickDistance(which,x,y){const sol=this.GetCurrentSol();const instances=sol.GetInstances();if(!instances.length)return false;let inst=instances[0];let wi=inst.GetWorldInfo();let pickme=inst;let dist2=C3.distanceSquared(wi.GetX(),wi.GetY(),x,y);for(let i=1,len=instances.length;idist2){dist2=d2;pickme=inst}}sol.PickOne(pickme); +return true}function SetX(x){const wi=this.GetWorldInfo();if(wi.GetX()===x)return;wi.SetX(x);wi.SetBboxChanged()}function SetY(y){const wi=this.GetWorldInfo();if(wi.GetY()===y)return;wi.SetY(y);wi.SetBboxChanged()}function SetPos(x,y){const wi=this.GetWorldInfo();if(wi.EqualsXY(x,y))return;wi.SetXY(x,y);wi.SetBboxChanged()}function SetPosToObject(objectClass,imgPt){if(!objectClass)return;const inst=objectClass.GetPairedInstance(this._inst);if(!inst)return;const [x,y]=inst.GetImagePoint(imgPt);const wi= +this.GetWorldInfo();if(wi.GetX()===x&&wi.GetY()===y)return;wi.SetXY(x,y);wi.SetBboxChanged()}function MoveForward(dist){if(dist===0)return;const wi=this.GetWorldInfo();wi.OffsetXY(wi.GetCosAngle()*dist,wi.GetSinAngle()*dist);wi.SetBboxChanged()}function MoveAtAngle(a,dist){if(dist===0)return;const wi=this.GetWorldInfo();a=C3.toRadians(a);wi.OffsetXY(Math.cos(a)*dist,Math.sin(a)*dist);wi.SetBboxChanged()}function GetX(){return this.GetWorldInfo().GetX()}function GetY(){return this.GetWorldInfo().GetY()} +function GetDt(){return this._runtime.GetDt(this._inst)}function CompareWidth(cmp,w){return C3.compare(this.GetWorldInfo().GetWidth(),cmp,w)}function CompareHeight(cmp,h){return C3.compare(this.GetWorldInfo().GetHeight(),cmp,h)}function SetWidth(w){const wi=this.GetWorldInfo();if(wi.GetWidth()===w)return;wi.SetWidth(w);wi.SetBboxChanged()}function SetHeight(h){const wi=this.GetWorldInfo();if(wi.GetHeight()===h)return;wi.SetHeight(h);wi.SetBboxChanged()}function SetSize(w,h){const wi=this.GetWorldInfo(); +if(wi.GetWidth()===w&&wi.GetHeight()===h)return;wi.SetSize(w,h);wi.SetBboxChanged()}function GetWidth(){return this.GetWorldInfo().GetWidth()}function GetHeight(){return this.GetWorldInfo().GetHeight()}function GetBboxLeft(){return this.GetWorldInfo().GetBoundingBox().getLeft()}function GetBboxTop(){return this.GetWorldInfo().GetBoundingBox().getTop()}function GetBboxRight(){return this.GetWorldInfo().GetBoundingBox().getRight()}function GetBboxBottom(){return this.GetWorldInfo().GetBoundingBox().getBottom()} +function IsAngleWithin(within,a){return C3.angleDiff(this.GetWorldInfo().GetAngle(),C3.toRadians(a))<=C3.toRadians(within)}function IsAngleClockwiseFrom(a){return C3.angleClockwise(this.GetWorldInfo().GetAngle(),C3.toRadians(a))}function IsBetweenAngles(a,b){const lower=C3.toRadians(a);const upper=C3.toRadians(b);const angle=this.GetWorldInfo().GetAngle();const obtuse=!C3.angleClockwise(upper,lower);if(obtuse)return!(!C3.angleClockwise(angle,lower)&&C3.angleClockwise(angle,upper));else return C3.angleClockwise(angle, +lower)&&!C3.angleClockwise(angle,upper)}function SetAngle(a){const wi=this.GetWorldInfo();const newAngle=C3.clampAngle(C3.toRadians(a));if(isNaN(newAngle)||wi.GetAngle()===newAngle)return;wi.SetAngle(newAngle);wi.SetBboxChanged()}function RotateClockwise(a){if(isNaN(a)||a===0)return;const wi=this.GetWorldInfo();wi.SetAngle(wi.GetAngle()+C3.toRadians(a));wi.SetBboxChanged()}function RotateCounterclockwise(a){if(isNaN(a)||a===0)return;const wi=this.GetWorldInfo();wi.SetAngle(wi.GetAngle()-C3.toRadians(a)); +wi.SetBboxChanged()}function RotateTowardAngle(amt,target){const wi=this.GetWorldInfo();const a=wi.GetAngle();const newAngle=C3.angleRotate(a,C3.toRadians(target),C3.toRadians(amt));if(isNaN(newAngle)||a===newAngle)return;wi.SetAngle(newAngle);wi.SetBboxChanged()}function RotateTowardPosition(amt,x,y){const wi=this.GetWorldInfo();const a=wi.GetAngle();const dx=x-wi.GetX();const dy=y-wi.GetY();const target=Math.atan2(dy,dx);const newAngle=C3.angleRotate(a,target,C3.toRadians(amt));if(isNaN(newAngle)|| +a===newAngle)return;wi.SetAngle(newAngle);wi.SetBboxChanged()}function SetTowardPosition(x,y){const wi=this.GetWorldInfo();const a=wi.GetAngle();const dx=x-wi.GetX();const dy=y-wi.GetY();const newAngle=Math.atan2(dy,dx);if(isNaN(newAngle)||a===newAngle)return;wi.SetAngle(newAngle);wi.SetBboxChanged()}function GetAngle(){return C3.toDegrees(this.GetWorldInfo().GetAngle())}function CompareOpacity(cmp,x){return C3.compare(C3.round6dp(this.GetWorldInfo().GetOpacity()*100),cmp,x)}function IsVisible(){return this.GetWorldInfo().IsVisible()} +function SetVisible(v){const wi=this.GetWorldInfo();if(v===2)v=!wi.IsVisible();else v=v!==0;if(wi.IsVisible()===v)return;wi.SetVisible(v);this._runtime.UpdateRender()}function SetOpacity(o){const newOpacity=C3.clamp(o/100,0,1);const wi=this.GetWorldInfo();if(wi.GetOpacity()===newOpacity)return;wi.SetOpacity(newOpacity);this._runtime.UpdateRender()}function SetDefaultColor(rgb){tempColor.setFromRgbValue(rgb);const wi=this.GetWorldInfo();if(wi.GetUnpremultipliedColor().equalsIgnoringAlpha(tempColor))return; +wi.SetUnpremultipliedColor(tempColor);this._runtime.UpdateRender()}function GetColor(){const c=this.GetWorldInfo().GetUnpremultipliedColor();return C3.PackRGBAEx(c.getR(),c.getG(),c.getB(),c.getA())}function GetOpacity(){return C3.round6dp(this.GetWorldInfo().GetOpacity()*100)}function IsOnLayer(layer){if(!layer)return false;return this.GetWorldInfo().GetLayer()===layer}function PickTopBottom(which){const sol=this.GetCurrentSol();const instances=sol.GetInstances();if(!instances.length)return false; +let inst=instances[0];let pickme=inst;for(let i=1,len=instances.length;ipickmeLayerIndex||instLayerIndex===pickmeLayerIndex&&instWi.GetZIndex()>pickmeWi.GetZIndex())pickme=inst}else if(instLayerIndex=paramsArr.length)return;const paramType= +effectType.GetShaderProgram().GetParameterType(paramIndex);if(paramType==="color"){tempColor.setFromRgbValue(value);const curColor=paramsArr[paramIndex];if(tempColor.equalsIgnoringAlpha(curColor))return;curColor.copyRgb(tempColor)}else{if(paramType==="percent")value/=100;if(paramsArr[paramIndex]===value)return;paramsArr[paramIndex]=value}if(instFxList.IsEffectIndexActive(effectTypeIndex))this._runtime.UpdateRender()}function HasParent(){return this.GetWorldInfo().HasParent()}function HasChildren(){return this.GetWorldInfo().HasChildren()} +function PickParent(parentObjectClass,which){const mySol=this.GetCurrentSol();const myInstances=mySol.GetInstances();if(myInstances.length===0)return false;const parentSol=parentObjectClass.GetCurrentSol();const parentInstances=parentSol.GetInstances();if(parentInstances.length===0)return false;const parentInstancesSet=new Set(parentInstances);const pickParents=new Set;for(let i=0,len=myInstances.length;ival){val=v;pickme=inst}}sol.PickOne(pickme);return true}function PickByUID(uid){if(this._runtime.GetCurrentCondition().IsInverted())return PickByUID_Inverted(this,uid);else return PickByUID_Normal(this, +uid)}function PickByUID_Normal(objectClass,uid){const inst=objectClass.GetRuntime().GetInstanceByUID(uid);if(!inst)return false;const sol=objectClass.GetCurrentSol();if(!sol.IsSelectAll()&&!sol._GetOwnInstances().includes(inst))return false;if(objectClass.IsFamily()){if(inst.GetObjectClass().BelongsToFamily(objectClass)){sol.PickOne(inst);objectClass.ApplySolToContainer();return true}}else if(inst.GetObjectClass()===objectClass){sol.PickOne(inst);objectClass.ApplySolToContainer();return true}return false} +function PickByUID_Inverted(objectClass,uid){const sol=objectClass.GetCurrentSol();if(sol.IsSelectAll()){sol._SetSelectAll(false);sol.ClearArrays();const instances=objectClass.GetInstances();for(let i=0,len=instances.length;iv.GetValue());if(functionBlock.IsAsync())this._asyncId=functionBlock.PauseCurrentAsyncFunction()}for(const objectClass of allObjectClasses){const sol=objectClass.GetCurrentSol();if(sol.IsSelectAll()&&!this._event.HasSolModifier(objectClass))continue; +this._solModifiers.push(objectClass);this._sols.set(objectClass,C3.New(C3.SolState,sol))}}InitTimer(seconds){this._type="timer";this._Init();this._time=this._eventSheetManager.GetRuntime().GetGameTime()+seconds}InitSignal(tag){this._type="signal";this._Init();this._signalTag=tag.toLowerCase()}InitPromise(p){this._type="promise";this._Init();p.then(()=>this.SetSignalled()).catch(err=>{console.warn("[C3 runtime] Promise rejected in 'Wait for previous actions to complete': ",err);this.SetSignalled()})}IsTimer(){return this._type=== +"timer"}IsSignal(){return this._type==="signal"}IsPromise(){return this._type==="promise"}GetSignalTag(){return this._signalTag}IsSignalled(){return this._isSignalled}SetSignalled(){this._isSignalled=true}_ShouldRun(){if(this.IsTimer())return this._time<=this._eventSheetManager.GetRuntime().GetGameTime();else return this.IsSignalled()}_RestoreState(frame){frame._Restore(this._event,this._actIndex);for(const [objectClass,solState]of this._sols.entries()){const sol=objectClass.GetCurrentSol();solState._Restore(sol)}const callingFunctionBlock= +this._callingFunctionBlock;if(callingFunctionBlock){callingFunctionBlock.SetFunctionParameters(this._functionParameters);callingFunctionBlock._GetAllInnerLocalVariables().map((v,index)=>v.SetValue(this._functionInnerLocalVars[index]));if(callingFunctionBlock.IsAsync())callingFunctionBlock.ResumeAsyncFunction(this._asyncId)}}_Run(frame){this._RestoreState(frame);this._event._ResumeActionsAndSubEvents(frame);if(this._callingFunctionBlock&&this._callingFunctionBlock.IsAsync())this._callingFunctionBlock.MaybeFinishAsyncFunctionCall(this._asyncId); +this._eventSheetManager.ClearSol(this._solModifiers);this._shouldRelease=true}async _DebugRun(frame){this._RestoreState(frame);for(const breakEventObject of this._event._DebugResumeActionsAndSubEvents(frame))await this._eventSheetManager.GetRuntime().DebugBreak(breakEventObject);if(this._callingFunctionBlock&&this._callingFunctionBlock.IsAsync())this._callingFunctionBlock.MaybeFinishAsyncFunctionCall(this._asyncId);this._eventSheetManager.ClearSol(this._solModifiers);this._shouldRelease=true}ShouldRelease(){return this._shouldRelease}RemoveInstances(s){for(const solState of this._sols.values())solState.RemoveInstances(s)}_SaveToJson(){const sols= +{};const o={"t":this._time,"st":this._signalTag,"s":this._isSignalled,"ev":this._event.GetSID(),"sm":this._solModifiers.map(oc=>oc.GetSID()),"sols":sols};if(this._event._HasActionIndex(this._actIndex))o["act"]=this._event.GetActionAt(this._actIndex).GetSID();for(const [objectClass,solState]of this._sols)sols[objectClass.GetSID().toString()]=solState._SaveToJson();return o}static _CreateFromJson(eventSheetManager,o){const runtime=eventSheetManager.GetRuntime();const event=eventSheetManager.GetEventBlockBySID(o["ev"]); +if(!event)return null;let actIndex=0;if(o.hasOwnProperty("act")){const act=eventSheetManager.GetActionBySID(o["act"]);if(!act)return null;actIndex=act.GetIndex()}const sw=C3.New(C3.ScheduledWait,eventSheetManager);sw._time=o["t"];sw._type=sw._time===-1?"signal":"timer";sw._signalTag=o["st"];sw._isSignalled=o["s"];sw._event=event;sw._actIndex=actIndex;for(const sid of o["sm"]){const objectClass=runtime.GetObjectClassBySID(sid);if(objectClass)sw._solModifiers.push(objectClass)}for(const [sidStr,solData]of Object.entries(o["sols"])){const sid= +parseInt(sidStr,10);const objectClass=runtime.GetObjectClassBySID(sid);if(!objectClass)continue;const solState=C3.New(C3.SolState,null);solState._LoadFromJson(eventSheetManager,solData);sw._sols.set(objectClass,solState)}return sw}}}; + + +// c3/events/solState.js +'use strict';{const C3=self.C3;C3.SolState=class SolState extends C3.DefendedBase{constructor(sol){super();this._objectClass=null;this._isSelectAll=true;this._instances=[];if(sol){this._objectClass=sol.GetObjectClass();this._isSelectAll=sol.IsSelectAll();C3.shallowAssignArray(this._instances,sol._GetOwnInstances())}}Release(){this._objectClass=null;C3.clearArray(this._instances)}_Restore(sol){sol._SetSelectAll(this._isSelectAll);C3.shallowAssignArray(sol._GetOwnInstances(),this._instances)}RemoveInstances(s){C3.arrayRemoveAllInSet(this._instances, +s)}_SaveToJson(){return{"sa":this._isSelectAll,"insts":this._instances.map(inst=>inst.GetUID())}}_LoadFromJson(eventSheetManager,o){const runtime=eventSheetManager.GetRuntime();this._isSelectAll=!!o["sa"];C3.clearArray(this._instances);for(const uid of o["insts"]){const inst=runtime.GetInstanceByUID(uid);if(inst)this._instances.push(inst)}}}}; + + +// c3/sdk/sdkPluginBase.js +'use strict';{const C3=self.C3;function GetNextParamMap(paramMap,param){let nextParamMap=paramMap.get(param);if(!nextParamMap){nextParamMap=new Map;paramMap.set(param,nextParamMap)}return nextParamMap}C3.SDKPluginBase=class SDKPluginBase extends C3.DefendedBase{constructor(opts){super();this._runtime=opts.runtime;this._isSingleGlobal=!!opts.isSingleGlobal;this._isWorldType=!!opts.isWorld;this._isRotatable=!!opts.isRotatable;this._mustPredraw=!!opts.mustPredraw;this._hasEffects=!!opts.hasEffects;this._supportsSceneGraph= +!!opts.supportsSceneGraph;this._supportsMesh=!!opts.supportsMesh;this._singleGlobalObjectClass=null;this._boundACEMethodCache=new Map;this._boundACEMethodCache_1param=new Map;this._boundACEMethodCache_2params=new Map;this._boundACEMethodCache_3params=new Map}Release(){this._runtime=null}GetRuntime(){return this._runtime}OnCreate(){}IsSingleGlobal(){return this._isSingleGlobal}IsWorldType(){return this._isWorldType}IsRotatable(){return this._isRotatable}MustPreDraw(){return this._mustPredraw}HasEffects(){return this._hasEffects}SupportsSceneGraph(){return this._supportsSceneGraph}SupportsMesh(){return this._supportsMesh}_GetBoundACEMethod(func, +bindThis){if(!bindThis)throw new Error("missing 'this' binding");let ret=this._boundACEMethodCache.get(func);if(ret)return ret;ret=func.bind(bindThis);this._boundACEMethodCache.set(func,ret);return ret}_GetBoundACEMethod_1param(func,bindThis,param0){if(!bindThis)throw new Error("missing 'this' binding");const param0map=GetNextParamMap(this._boundACEMethodCache_1param,func);let ret=param0map.get(param0);if(ret)return ret;ret=func.bind(bindThis,param0);param0map.set(param0,ret);return ret}_GetBoundACEMethod_2params(func, +bindThis,param0,param1){if(!bindThis)throw new Error("missing 'this' binding");const param0map=GetNextParamMap(this._boundACEMethodCache_2params,func);const param1map=GetNextParamMap(param0map,param0);let ret=param1map.get(param1);if(ret)return ret;ret=func.bind(bindThis,param0,param1);param1map.set(param1,ret);return ret}_GetBoundACEMethod_3params(func,bindThis,param0,param1,param2){if(!bindThis)throw new Error("missing 'this' binding");const param0map=GetNextParamMap(this._boundACEMethodCache_3params, +func);const param1map=GetNextParamMap(param0map,param0);const param2map=GetNextParamMap(param1map,param1);let ret=param2map.get(param2);if(ret)return ret;ret=func.bind(bindThis,param0,param1,param2);param2map.set(param2,ret);return ret}_SetSingleGlobalObjectClass(objectClass){if(!this.IsSingleGlobal())throw new Error("must be single-global plugin");this._singleGlobalObjectClass=objectClass}GetSingleGlobalObjectClass(){if(!this.IsSingleGlobal())throw new Error("must be single-global plugin");return this._singleGlobalObjectClass}GetSingleGlobalInstance(){if(!this.IsSingleGlobal())throw new Error("must be single-global plugin"); +return this._singleGlobalObjectClass.GetSingleGlobalInstance()}}}; + + +// c3/sdk/sdkDOMPluginBase.js +'use strict';{const C3=self.C3;C3.SDKDOMPluginBase=class SDKDOMPluginBase extends C3.SDKPluginBase{constructor(opts,DOM_COMPONENT_ID){super(opts);this._domComponentId=DOM_COMPONENT_ID;this._nextElementId=0;this._instMap=new Map;this.AddElementMessageHandler("elem-focused",sdkInst=>sdkInst._OnElemFocused());this.AddElementMessageHandler("elem-blurred",sdkInst=>{if(sdkInst)sdkInst._OnElemBlurred()})}Release(){super.Release()}_AddElement(sdkInst){const elementId=this._nextElementId++;this._instMap.set(elementId, +sdkInst);return elementId}_RemoveElement(elementId){this._instMap.delete(elementId)}AddElementMessageHandler(handler,func){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,handler,e=>{const sdkInst=this._instMap.get(e["elementId"]);func(sdkInst,e)})}}}; + + +// c3/sdk/sdkTypeBase.js +'use strict';{const C3=self.C3;C3.SDKTypeBase=class SDKTypeBase extends C3.DefendedBase{constructor(objectClass){super();this._objectClass=objectClass;this._runtime=objectClass.GetRuntime();this._plugin=objectClass.GetPlugin()}Release(){this._objectClass=null;this._runtime=null;this._plugin=null}GetObjectClass(){return this._objectClass}GetRuntime(){return this._runtime}GetPlugin(){return this._plugin}GetImageInfo(){return this._objectClass.GetImageInfo()}FinishCondition(f){}LoadTextures(renderer){}ReleaseTextures(){}OnDynamicTextureLoadComplete(){}PreloadTexturesWithInstances(renderer){}LoadTilemapData(){}GetScriptInterfaceClass(){return null}}}; + + +// c3/sdk/sdkInstanceBase.js +'use strict';{const C3=self.C3;C3.SDKInstanceBase=class SDKInstanceBase extends C3.DefendedBase{constructor(inst,domComponentId){super();this._inst=inst;this._domComponentId=domComponentId;this._runtime=inst.GetRuntime();this._objectClass=this._inst.GetObjectClass();this._sdkType=this._objectClass.GetSdkType();this._tickFunc=null;this._tick2Func=null;this._isTicking=false;this._isTicking2=false;this._disposables=null;this._wasReleased=false}Release(){this._wasReleased=true;this._StopTicking();this._StopTicking2(); +this._tickFunc=null;this._tick2Func=null;if(this._disposables){this._disposables.Release();this._disposables=null}this._inst=null;this._runtime=null;this._objectClass=null;this._sdkType=null}WasReleased(){return this._wasReleased}GetInstance(){return this._inst}GetRuntime(){return this._runtime}GetObjectClass(){return this._objectClass}GetPlugin(){return this._sdkType.GetPlugin()}GetSdkType(){return this._sdkType}GetScriptInterface(){return this._inst.GetInterfaceClass()}Trigger(method){return this._runtime.Trigger(method, +this._inst,null)}DebugTrigger(method){return this._runtime.DebugTrigger(method,this._inst,null)}TriggerAsync(method){return this._runtime.TriggerAsync(method,this._inst,null)}FastTrigger(method,value){return this._runtime.FastTrigger(method,this._inst,value)}DebugFastTrigger(method,value){return this._runtime.DebugFastTrigger(method,this._inst,value)}ScheduleTriggers(f){return this._runtime.ScheduleTriggers(f)}AddDOMMessageHandler(handler,func){this._runtime.AddDOMComponentMessageHandler(this._domComponentId, +handler,func)}AddDOMMessageHandlers(list){for(const [handler,func]of list)this.AddDOMMessageHandler(handler,func)}PostToDOM(handler,data){this._runtime.PostComponentMessageToDOM(this._domComponentId,handler,data)}PostToDOMAsync(handler,data){return this._runtime.PostComponentMessageToDOMAsync(this._domComponentId,handler,data)}_PostToDOMMaybeSync(handler,data){if(this._runtime.IsInWorker())this.PostToDOM(handler,data);else return window["c3_runtimeInterface"]["_OnMessageFromRuntime"]({"type":"event", +"component":this._domComponentId,"handler":handler,"data":data,"responseId":null})}GetCurrentImageInfo(){return null}GetCurrentSurfaceSize(){const imageInfo=this.GetCurrentImageInfo();if(imageInfo){const texture=imageInfo.GetTexture();if(texture)return[texture.GetWidth(),texture.GetHeight()]}return[100,100]}GetCurrentTexRect(){const imageInfo=this.GetCurrentImageInfo();return imageInfo?imageInfo.GetTexRect():null}GetImagePoint(nameOrIndex){const wi=this._inst.GetWorldInfo();return[wi.GetX(),wi.GetY()]}Tick(){}Tick2(){}_StartTicking(){if(this._isTicking)return; +if(!this._tickFunc)this._tickFunc=()=>this.Tick();this._runtime.Dispatcher().addEventListener("tick",this._tickFunc);this._isTicking=true}_StopTicking(){if(!this._isTicking)return;this._runtime.Dispatcher().removeEventListener("tick",this._tickFunc);this._isTicking=false}IsTicking(){return this._isTicking}_StartTicking2(){if(this._isTicking2)return;if(!this._tick2Func)this._tick2Func=()=>this.Tick2();this._runtime.Dispatcher().addEventListener("tick2",this._tick2Func);this._isTicking2=true}_StopTicking2(){if(!this._isTicking2)return; +this._runtime.Dispatcher().removeEventListener("tick2",this._tick2Func);this._isTicking2=false}IsTicking2(){return this._isTicking2}GetDebuggerProperties(){return[]}SaveToJson(){return null}LoadFromJson(o){}LoadTilemapData(data,mapWidth,mapHeight){}TestPointOverlapTile(x,y){}GetPropertyValueByIndex(index){}SetPropertyValueByIndex(index,value){}OffsetPropertyValueByIndex(index,offset){if(offset===0)return;const value=this.GetPropertyValueByIndex(index);if(typeof value!=="number")throw new Error("expected number"); +this.SetPropertyValueByIndex(index,value+offset)}SetPropertyColorOffsetValueByIndex(offset,r,g,b){}CallAction(actMethod,...args){actMethod.call(this,...args)}CallExpression(expMethod,...args){return expMethod.call(this,...args)}GetScriptInterfaceClass(){return null}}}; + + +// c3/sdk/sdkWorldInstanceBase.js +'use strict';{const C3=self.C3;C3.SDKWorldInstanceBase=class SDKWorldInstanceBase extends C3.SDKInstanceBase{constructor(inst,domComponentId){super(inst,domComponentId);this._worldInfo=inst.GetWorldInfo();this._webglcontextlost_handler=null;this._webglcontextrestored_handler=null}Release(){if(this._webglcontextlost_handler){const dispatcher=this._runtime.Dispatcher();dispatcher.removeEventListener("webglcontextlost",this._webglcontextlost_handler);dispatcher.removeEventListener("webglcontextrestored", +this._webglcontextrestored_handler);this._webglcontextlost_handler=null;this._webglcontextrestored_handler=null}this._worldInfo=null;super.Release()}HandleWebGLContextLoss(){if(this._webglcontextlost_handler)return;this._webglcontextlost_handler=()=>this.OnWebGLContextLost();this._webglcontextrestored_handler=()=>this.OnWebGLContextRestored();const dispatcher=this._runtime.Dispatcher();dispatcher.addEventListener("webglcontextlost",this._webglcontextlost_handler);dispatcher.addEventListener("webglcontextrestored", +this._webglcontextrestored_handler)}OnWebGLContextLost(){}OnWebGLContextRestored(){}GetWorldInfo(){return this._worldInfo}}}; + + +// c3/sdk/sdkDOMInstanceBase.js +'use strict';{const C3=self.C3;const tempRect=C3.New(C3.Rect);C3.SDKDOMInstanceBase=class SDKDOMInstanceBase extends C3.SDKWorldInstanceBase{constructor(inst,domComponentId){super(inst,domComponentId);this._elementId=this.GetPlugin()._AddElement(this);this._isElementShowing=true;this._elemHasFocus=false;this._autoFontSize=false;this._lastRect=C3.New(C3.Rect,0,0,-1,-1);const canvasManager=this._runtime.GetCanvasManager();this._lastWindowWidth=canvasManager.GetLastWidth();this._lastWindowHeight=canvasManager.GetLastHeight(); +this._isPendingUpdateState=false;this._StartTicking()}Release(){this.GetPlugin()._RemoveElement(this._elementId);this.PostToDOMElement("destroy");this._elementId=-1;super.Release()}_GetElementInDOMMode(){if(this._runtime.IsInWorker())throw new Error("not valid in worker mode");return this._PostToDOMElementMaybeSync("get-element")}PostToDOMElement(handler,data){if(!data)data={};data["elementId"]=this._elementId;this.PostToDOM(handler,data)}_PostToDOMElementMaybeSync(handler,data){if(!data)data={}; +data["elementId"]=this._elementId;return this._PostToDOMMaybeSync(handler,data)}PostToDOMElementAsync(handler,data){if(!data)data={};data["elementId"]=this._elementId;return this.PostToDOMAsync(handler,data)}CreateElement(data){if(!data)data={};const isVisible=this.GetWorldInfo().IsVisible();data["elementId"]=this._elementId;data["isVisible"]=isVisible;Object.assign(data,this.GetElementState());this._isElementShowing=!!data["isVisible"];this._PostToDOMMaybeSync("create",data);this._UpdatePosition(true)}SetElementVisible(v){v= +!!v;if(this._isElementShowing===v)return;this._isElementShowing=v;this.PostToDOMElement("set-visible",{"isVisible":v})}Tick(){this._UpdatePosition(false)}_ShouldPreserveElement(){const fullscreenMode=this._runtime.GetCanvasManager().GetFullscreenMode();return C3.Platform.OS==="Android"&&(fullscreenMode==="scale-inner"||fullscreenMode==="scale-outer"||fullscreenMode==="crop")}_UpdatePosition(first){const wi=this.GetWorldInfo();const layer=wi.GetLayer();const x=wi.GetX();const y=wi.GetY();let [cleft, +ctop]=layer.LayerToCanvasCss(x,y);let [cright,cbottom]=layer.LayerToCanvasCss(x+wi.GetWidth(),y+wi.GetHeight());const canvasManager=this._runtime.GetCanvasManager();const rightEdge=canvasManager.GetCssWidth();const bottomEdge=canvasManager.GetCssHeight();if(!wi.IsVisible()||!layer.IsVisible()){this.SetElementVisible(false);return}if(!this._ShouldPreserveElement()){if(cright<=0||cbottom<=0||cleft>=rightEdge||ctop>=bottomEdge){this.SetElementVisible(false);return}if(cleft<1)cleft=1;if(ctop<1)ctop=1; +if(cright>=rightEdge)cright=rightEdge-1;if(cbottom>=bottomEdge)cbottom=bottomEdge-1}tempRect.set(cleft,ctop,cright,cbottom);const curWinWidth=canvasManager.GetLastWidth();const curWinHeight=canvasManager.GetLastHeight();if(!first&&tempRect.equals(this._lastRect)&&this._lastWindowWidth===curWinWidth&&this._lastWindowHeight===curWinHeight){this.SetElementVisible(true);return}this._lastRect.copy(tempRect);this._lastWindowWidth=curWinWidth;this._lastWindowHeight=curWinHeight;this.SetElementVisible(true); +let fontSize=null;if(this._autoFontSize)fontSize=layer.GetDisplayScale()-.2;this.PostToDOMElement("update-position",{"left":Math.round(this._lastRect.getLeft())+canvasManager.GetCanvasClientX(),"top":Math.round(this._lastRect.getTop())+canvasManager.GetCanvasClientY(),"width":Math.round(this._lastRect.width()),"height":Math.round(this._lastRect.height()),"fontSize":fontSize})}FocusElement(){this._PostToDOMElementMaybeSync("focus",{"focus":true})}BlurElement(){this._PostToDOMElementMaybeSync("focus", +{"focus":false})}_OnElemFocused(){this._elemHasFocus=true}_OnElemBlurred(){this._elemHasFocus=false}IsElementFocused(){return this._elemHasFocus}SetElementCSSStyle(prop,val){this.PostToDOMElement("set-css-style",{"prop":C3.CSSToCamelCase(prop),"val":val})}SetElementAttribute(attribName,value){this.PostToDOMElement("set-attribute",{"name":attribName,"val":value})}RemoveElementAttribute(attribName){this.PostToDOMElement("remove-attribute",{"name":attribName})}UpdateElementState(){if(this._isPendingUpdateState)return; +this._isPendingUpdateState=true;Promise.resolve().then(()=>{this._isPendingUpdateState=false;this.PostToDOMElement("update-state",this.GetElementState())})}GetElementState(){}GetElementId(){return this._elementId}}}; + + +// c3/sdk/sdkBehaviorBase.js +'use strict';{const C3=self.C3;const IBehavior=self.IBehavior;C3.SDKBehaviorBase=class SDKBehaviorBase extends C3.DefendedBase{constructor(opts){super();this._runtime=opts.runtime;this._myObjectClasses=C3.New(C3.ArraySet);this._myInstances=C3.New(C3.ArraySet);this._iBehavior=null;const CustomScriptClass=opts.scriptInterfaceClass;if(CustomScriptClass){this._iBehavior=new CustomScriptClass(this);if(!(this._iBehavior instanceof IBehavior))throw new TypeError("script interface class must derive from IBehavior"); +}else this._iBehavior=new IBehavior(this)}Release(){this._myInstances.Release();this._myObjectClasses.Release();this._runtime=null}GetRuntime(){return this._runtime}OnCreate(){}_AddObjectClass(objectClass){this._myObjectClasses.Add(objectClass)}GetObjectClasses(){return this._myObjectClasses.GetArray()}_AddInstance(inst){this._myInstances.Add(inst)}_RemoveInstance(inst){this._myInstances.Delete(inst)}GetInstances(){return this._myInstances.GetArray()}GetIBehavior(){return this._iBehavior}}}; + + +// c3/sdk/sdkBehaviorTypeBase.js +'use strict';{const C3=self.C3;C3.SDKBehaviorTypeBase=class SDKBehaviorTypeBase extends C3.DefendedBase{constructor(behaviorType){super();this._runtime=behaviorType.GetRuntime();this._behaviorType=behaviorType;this._objectClass=behaviorType.GetObjectClass();this._behavior=behaviorType.GetBehavior();this._behavior._AddObjectClass(this._objectClass)}Release(){this._runtime=null;this._behaviorType=null;this._objectClass=null;this._behavior=null}GetBehaviorType(){return this._behaviorType}GetObjectClass(){return this._objectClass}GetRuntime(){return this._runtime}GetBehavior(){return this._behavior}}}; + + +// c3/sdk/sdkBehaviorInstanceBase.js +'use strict';{const C3=self.C3;C3.SDKBehaviorInstanceBase=class SDKBehaviorInstanceBase extends C3.DefendedBase{constructor(behInst,domComponentId){super();this._behInst=behInst;this._domComponentId=domComponentId;this._inst=behInst.GetObjectInstance();this._runtime=behInst.GetRuntime();this._behaviorType=behInst.GetBehaviorType();this._sdkType=this._behaviorType.GetSdkType();this._isTicking=false;this._isTicking2=false;this._isPostTicking=false;this._disposables=null}Release(){this._StopTicking(); +this._StopTicking2();this._StopPostTicking();if(this._disposables){this._disposables.Release();this._disposables=null}this._behInst=null;this._inst=null;this._runtime=null;this._behaviorType=null;this._sdkType=null}GetBehavior(){return this._behaviorType.GetBehavior()}GetBehaviorInstance(){return this._behInst}GetObjectInstance(){return this._inst}GetObjectClass(){return this._inst.GetObjectClass()}GetWorldInfo(){return this._inst.GetWorldInfo()}GetRuntime(){return this._runtime}GetBehaviorType(){return this._behaviorType}GetSdkType(){return this._sdkType}GetScriptInterface(){return this._behInst.GetScriptInterface()}Trigger(method){return this._runtime.Trigger(method, +this._inst,this._behaviorType)}DebugTrigger(method){return this._runtime.DebugTrigger(method,this._inst,this._behaviorType)}TriggerAsync(method){return this._runtime.TriggerAsync(method,this._inst,this._behaviorType)}PostCreate(){}Tick(){}Tick2(){}PostTick(){}_StartTicking(){if(this._isTicking)return;this._runtime._AddBehInstToTick(this);this._isTicking=true}_StopTicking(){if(!this._isTicking)return;this._runtime._RemoveBehInstToTick(this);this._isTicking=false}IsTicking(){return this._isTicking}_StartTicking2(){if(this._isTicking2)return; +this._runtime._AddBehInstToTick2(this);this._isTicking2=true}_StopTicking2(){if(!this._isTicking2)return;this._runtime._RemoveBehInstToTick2(this);this._isTicking2=false}IsTicking2(){return this._isTicking2}_StartPostTicking(){if(this._isPostTicking)return;this._runtime._AddBehInstToPostTick(this);this._isPostTicking=true}_StopPostTicking(){if(!this._isPostTicking)return;this._runtime._RemoveBehInstToPostTick(this);this._isPostTicking=false}IsPostTicking(){return this._isPostTicking}GetDebuggerProperties(){return[]}AddDOMMessageHandler(handler, +func){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,handler,func)}OnSpriteFrameChanged(prevFrame,nextFrame){}SaveToJson(){return null}LoadFromJson(o){}GetPropertyValueByIndex(index){}SetPropertyValueByIndex(index,value){}OffsetPropertyValueByIndex(index,offset){if(offset===0)return;const value=this.GetPropertyValueByIndex(index);if(typeof value!=="number")throw new Error("expected number");this.SetPropertyValueByIndex(index,value+offset)}SetPropertyColorOffsetValueByIndex(index, +offsetR,offsetG,offsetB){}CallAction(actMethod,...args){actMethod.call(this,...args)}CallExpression(expMethod,...args){return expMethod.call(this,...args)}GetScriptInterfaceClass(){return null}}}; + + +// c3/objects/pluginManager.js +'use strict';{const C3=self.C3;C3.Plugins={};C3.Behaviors={};C3.PluginManager=class PluginManager extends C3.DefendedBase{constructor(runtime){super();this._runtime=runtime;this._allPlugins=[];this._pluginsByCtor=new Map;this._systemPlugin=null;this._allBehaviors=[];this._behaviorsByCtor=new Map;this._solidBehavior=null;this._jumpthruBehavior=null}CreatePlugin(pluginData){const Ctor=this._runtime.GetObjectReference(pluginData[0]);if(!Ctor)throw new Error("missing plugin");C3.AddCommonACEs(pluginData, +Ctor);const plugin=C3.New(Ctor,{runtime:this._runtime,isSingleGlobal:pluginData[1],isWorld:pluginData[2],isRotatable:pluginData[5],hasEffects:pluginData[8],mustPredraw:pluginData[9],supportsSceneGraph:pluginData[13],supportsMesh:pluginData[14]});plugin.OnCreate();this._allPlugins.push(plugin);this._pluginsByCtor.set(Ctor,plugin)}CreateSystemPlugin(){this._systemPlugin=C3.New(C3.Plugins.System,{runtime:this._runtime,isSingleGlobal:true});this._systemPlugin.OnCreate()}CreateBehavior(behaviorData){const Ctor= +this._runtime.GetObjectReference(behaviorData[1]);if(!Ctor)throw new Error("missing behavior");const behavior=C3.New(Ctor,{runtime:this._runtime});behavior.OnCreate();this._allBehaviors.push(behavior);this._behaviorsByCtor.set(Ctor,behavior);if(!this._solidBehavior&&C3.Behaviors.solid&&behavior instanceof C3.Behaviors.solid)this._solidBehavior=behavior;else if(!this._jumpthruBehavior&&C3.Behaviors.jumpthru&&behavior instanceof C3.Behaviors.jumpthru)this._jumpthruBehavior=behavior}GetPluginByConstructorFunction(ctor){return this._pluginsByCtor.get(ctor)|| +null}HasBehaviorByConstructorFunction(ctor){return this._behaviorsByCtor.has(ctor)}GetBehaviorByConstructorFunction(ctor){return this._behaviorsByCtor.get(ctor)||null}GetSystemPlugin(){return this._systemPlugin}GetSolidBehavior(){return this._solidBehavior}GetJumpthruBehavior(){return this._jumpthruBehavior}}}; + + +// c3/objects/imageInfo.js +'use strict';{const C3=self.C3;const allImageInfos=new Set;C3.ImageInfo=class ImageInfo extends C3.DefendedBase{constructor(){super();this._url="";this._size=0;this._pixelFormat=0;this._offsetX=0;this._offsetY=0;this._width=0;this._height=0;this._hasMetaData=false;this._imageAsset=null;this._textureState="";this._rcTex=C3.New(C3.Rect);allImageInfos.add(this)}Release(){this.ReleaseTexture();this._imageAsset=null;allImageInfos.delete(this)}static OnWebGLContextLost(){for(const imageInfo of allImageInfos){imageInfo._textureState= +"";imageInfo._rcTex.set(0,0,0,0)}}LoadData(imageData){this._url=imageData[0];this._size=imageData[1];this._pixelFormat=imageData[2];this._offsetX=imageData[3];this._offsetY=imageData[4];this._width=imageData[5];this._height=imageData[6];this._hasMetaData=true}LoadAnimationFrameData(frameData){this._url=frameData[0];this._size=frameData[1];this._offsetX=frameData[2];this._offsetY=frameData[3];this._width=frameData[4];this._height=frameData[5];this._pixelFormat=frameData[11];this._hasMetaData=true}LoadDynamicAsset(runtime, +url){if(this._imageAsset)throw new Error("already loaded asset");this._url=url;const opts={};if(C3.IsAbsoluteURL(url))opts.loadPolicy="remote";this.LoadAsset(runtime,opts);return this._imageAsset.Load()}ReplaceWith(otherImageInfo){if(otherImageInfo===this)throw new Error("cannot replace with self");this.ReleaseTexture();this._url=otherImageInfo._url;this._size=otherImageInfo._size;this._pixelFormat=otherImageInfo._pixelFormat;this._offsetX=otherImageInfo._offsetX;this._offsetY=otherImageInfo._offsetY; +this._width=otherImageInfo._width;this._height=otherImageInfo._height;this._hasMetaData=otherImageInfo._hasMetaData;this._imageAsset=otherImageInfo._imageAsset;this._textureState=otherImageInfo._textureState;this._rcTex=otherImageInfo._rcTex}GetURL(){return this._url}GetSize(){return this._size}GetPixelFormat(){return this._pixelFormat}GetOffsetX(){return this._offsetX}GetOffsetY(){return this._offsetY}GetWidth(){return this._width}GetHeight(){return this._height}GetSheetWidth(){return this._imageAsset.GetWidth()}GetSheetHeight(){return this._imageAsset.GetHeight()}LoadAsset(runtime, +opts){if(this._imageAsset)throw new Error("already got asset");opts=Object.assign({},opts,{url:this.GetURL(),size:this.GetSize()});this._imageAsset=runtime.LoadImage(opts)}IsLoaded(){return this._imageAsset&&this._imageAsset.IsLoaded()}async LoadStaticTexture(renderer,opts){if(!this._imageAsset)throw new Error("no asset");if(this._textureState)throw new Error("already loaded texture");this._textureState="loading";const texture=await this._imageAsset.LoadStaticTexture(renderer,opts);if(!texture){this._textureState= +"";return null}this._textureState="loaded";if(!this._hasMetaData){this._width=texture.GetWidth();this._height=texture.GetHeight();this._hasMetaData=true}this._rcTex.set(this._offsetX,this._offsetY,this._offsetX+this._width,this._offsetY+this._height);this._rcTex.divide(texture.GetWidth(),texture.GetHeight());return texture}ReleaseTexture(){if(!this._textureState)return;if(this._imageAsset)this._imageAsset.ReleaseTexture();this._textureState="";this._rcTex.set(0,0,0,0)}GetTexture(){return this._imageAsset? +this._imageAsset.GetTexture():null}GetTexRect(){return this._rcTex}async ExtractImageToCanvas(){const srcDrawable=await this._imageAsset.LoadToDrawable();const canvas=C3.CreateCanvas(this._width,this._height);const ctx=canvas.getContext("2d");ctx.drawImage(srcDrawable,this._offsetX,this._offsetY,this._width,this._height,0,0,this._width,this._height);return canvas}}}; + + +// c3/objects/animationInfo.js +'use strict';{const C3=self.C3;C3.AnimationInfo=class AnimationInfo extends C3.DefendedBase{constructor(animData){super();this._name=animData[0];this._speed=animData[1];this._isLooping=!!animData[2];this._repeatCount=animData[3];this._repeatTo=animData[4];this._isPingPong=!!animData[5];this._sid=animData[6];this._frames=animData[7].map(frameData=>C3.New(C3.AnimationFrameInfo,frameData))}Release(){for(const f of this._frames)f.Release();C3.clearArray(this._frames)}LoadAllAssets(runtime){for(const f of this._frames)f.GetImageInfo().LoadAsset(runtime)}LoadAllTextures(renderer, +opts){return Promise.all(this._frames.map(f=>f.GetImageInfo().LoadStaticTexture(renderer,opts)))}ReleaseAllTextures(){for(const f of this._frames)f.GetImageInfo().ReleaseTexture()}GetName(){return this._name}GetSID(){return this._sid}GetFrameCount(){return this._frames.length}GetFrames(){return this._frames}GetFrameAt(i){i=Math.floor(i);if(i<0||i>=this._frames.length)throw new RangeError("invalid frame");return this._frames[i]}GetSpeed(){return this._speed}IsLooping(){return this._isLooping}GetRepeatCount(){return this._repeatCount}GetRepeatTo(){return this._repeatTo}IsPingPong(){return this._isPingPong}}}; + + +// c3/objects/animationFrameInfo.js +'use strict';{const C3=self.C3;C3.AnimationFrameInfo=class AnimationFrameInfo extends C3.DefendedBase{constructor(frameData){super();this._imageInfo=C3.New(C3.ImageInfo);this._imageInfo.LoadAnimationFrameData(frameData);this._duration=frameData[6];this._origin=C3.New(C3.Vector2,frameData[7],frameData[8]);this._imagePoints=frameData[9].map(data=>C3.New(C3.ImagePoint,this,data));this._imagePointsByName=new Map;for(const ip of this._imagePoints)this._imagePointsByName.set(ip.GetName().toLowerCase(), +ip);this._collisionPoly=null;const polyPoints=frameData[10];if(polyPoints.length>=6)this._collisionPoly=C3.New(C3.CollisionPoly,polyPoints)}Release(){if(this._collisionPoly){this._collisionPoly.Release();this._collisionPoly=null}this._imageInfo.Release();this._imageInfo=null}GetImageInfo(){return this._imageInfo}GetDuration(){return this._duration}GetOriginX(){return this._origin.getX()}GetOriginY(){return this._origin.getY()}GetCollisionPoly(){return this._collisionPoly}GetImagePointByName(name){return this._imagePointsByName.get(name.toLowerCase())|| +null}GetImagePointByIndex(index){index=Math.floor(index);if(index<0||index>=this._imagePoints.length)return null;return this._imagePoints[index]}GetImagePointCount(){return this._imagePoints.length}}}; + + +// c3/objects/imagePoint.js +'use strict';{const C3=self.C3;C3.ImagePoint=class ImagePoint extends C3.DefendedBase{constructor(afi,data){super();this._afi=afi;this._name=data[0];this._pos=C3.New(C3.Vector2,data[1],data[2])}Release(){}GetName(){return this._name}GetX(){return this._pos.getX()}GetY(){return this._pos.getY()}GetVec2(){return this._pos}}}; + + +// c3/objects/objectClass.js +'use strict';{const C3=self.C3;const C3Debugger=self.C3Debugger;const IObjectClass=self.IObjectClass;const assert=self.assert;C3.ObjectClass=class ObjectClass extends C3.DefendedBase{constructor(runtime,index,data){super();const PluginCtor=runtime.GetObjectReference(data[1]);this._runtime=runtime;this._plugin=runtime.GetPluginManager().GetPluginByConstructorFunction(PluginCtor);this._sdkType=null;this._instSdkCtor=PluginCtor.Instance;this._index=index;this._sid=data[11];this._name=data[0];this._jsPropName= +this._runtime.GetJsPropName(data[14]);this._isGlobal=!!data[9];this._isFamily=!!data[2];this._isOnLoaderLayout=!!data[10];this._instVars=data[3].map(arr=>({sid:arr[0],type:arr[1],name:arr[2],jsPropName:runtime.GetJsPropName(arr[3])}));this._behaviorsCount=data[4];this._effectsCount=data[5];this._isWorldType=this._plugin.IsWorldType();this._effectList=null;this._collisionGrid=C3.New(C3.SparseGrid,runtime.GetOriginalViewportWidth(),runtime.GetOriginalViewportHeight());this._anyCollisionCellChanged= +true;this._anyInstanceParallaxed=false;this._familyMembers=null;this._familyMembersSet=null;this._familyIndex=-1;this._families=null;this._familiesSet=null;this._familyInstVarMap=null;this._familyBehaviorMap=null;this._familyEffectMap=null;this._isInContainer=false;this._container=null;this._behaviorTypes=data[8].map(behaviorTypeData=>C3.BehaviorType.Create(this,behaviorTypeData));this._behaviorTypesIncludingInherited=[];this._behaviorsByName=new Map;this._behaviorNameToIndex=new Map;this._usedBehaviorCtors= +new Set;this._solStack=C3.New(C3.SolStack,this);this._defaultInstanceData=null;this._defaultLayerIndex=0;this._isContained=false;this._container=null;this._imageInfo=null;this._animations=null;this._animationsByName=null;this._animationsBySid=null;this._textureRefCount=0;this._savedData=new Map;this._unsavedData=new Map;this._instances=[];this._iidsStale=true;if(this._plugin.HasEffects())this._effectList=C3.New(C3.EffectList,this,data[12]);if(data[6]){this._imageInfo=C3.New(C3.ImageInfo);this._imageInfo.LoadData(data[6])}if(data[7]){this._animations= +data[7].map(animData=>C3.New(C3.AnimationInfo,animData));this._animationsByName=new Map;this._animationsBySid=new Map;for(const anim of this._animations){this._animationsByName.set(anim.GetName().toLowerCase(),anim);this._animationsBySid.set(anim.GetSID(),anim)}}if(this._isFamily){this._familyMembers=[];this._familyMembersSet=new Set;this._familyIndex=this._runtime._GetNextFamilyIndex()}else{this._families=[];this._familiesSet=new Set;this._familyInstVarMap=[];this._familyBehaviorMap=[];this._familyEffectMap= +[]}this._sdkType=C3.New(PluginCtor.Type,this,data[15]);this._iObjectClass=null;this._instanceUserScriptClass=null;this._userScriptDispatcher=C3.New(C3.Event.Dispatcher);const CustomScriptClass=this._sdkType.GetScriptInterfaceClass();if(CustomScriptClass){this._iObjectClass=new CustomScriptClass(this);if(!(this._iObjectClass instanceof IObjectClass))throw new TypeError("script interface class must derive from IObjectClass");}else this._iObjectClass=new IObjectClass(this);if(data[13]){const tilemapData= +data[13];if(tilemapData){const tilePolyData=tilemapData[0];const maxTileIndex=tilemapData[1];this._sdkType.LoadTilemapData(tilePolyData,maxTileIndex)}}if(!this._runtime.UsesLoaderLayout()||this._isFamily||this._isOnLoaderLayout||!this._isWorldType)this.OnCreate();if(this._plugin.IsSingleGlobal()){this._plugin._SetSingleGlobalObjectClass(this);this._CreateSingleGlobalInstance(data)}}static Create(runtime,index,objectClassData){return C3.New(C3.ObjectClass,runtime,index,objectClassData)}Release(){if(this._imageInfo){this._imageInfo.Release(); +this._imageInfo=null}if(this._animations){for(const a of this._animations)a.Release();C3.clearArray(this._animations);this._animationsByName.clear();this._animationsBySid.clear()}this._solStack.Release();this._solStack=null;this._savedData.clear();this._unsavedData.clear();this._container=null;this._runtime=null}_LoadFamily(familyData){for(let i=1,len=familyData.length;i0}LoadTextures(renderer){if(this._isFamily)return Promise.resolve();this._textureRefCount++;if(this._textureRefCount===1)return this._sdkType.LoadTextures(renderer)||Promise.resolve();else return Promise.resolve()}ReleaseTextures(){if(this._isFamily)return;this._textureRefCount--; +if(this._textureRefCount<0)throw new Error("released textures too many times");if(this._textureRefCount===0)this._sdkType.ReleaseTextures()}OnDynamicTextureLoadComplete(){if(this._isFamily)throw new Error("not applicable to family");this._sdkType.OnDynamicTextureLoadComplete()}PreloadTexturesWithInstances(renderer){if(this._isFamily)return Promise.resolve();return this._sdkType.PreloadTexturesWithInstances(renderer)}GetRuntime(){return this._runtime}GetPlugin(){return this._plugin}GetInstanceSdkCtor(){return this._instSdkCtor}GetName(){return this._name}GetJsPropName(){return this._jsPropName}GetIndex(){return this._index}GetSID(){return this._sid}IsFamily(){return this._isFamily}IsGlobal(){return this._isGlobal}IsWorldType(){return this._isWorldType}GetFamilyIndex(){return this._familyIndex}GetBehaviorTypes(){return this._behaviorTypes}GetBehaviorTypesCount(){return this._behaviorsCount}UsesBehaviorByCtor(Ctor){return Ctor&& +this._usedBehaviorCtors.has(Ctor)}GetInstanceVariablesCount(){return this._instVars.length}GetInstanceVariableSIDs(){return this._instVars.map(iv=>iv.sid)}GetInstanceVariableIndexBySID(sid){return this._instVars.findIndex(iv=>iv.sid===sid)}GetInstanceVariableIndexByName(name){return this._instVars.findIndex(iv=>iv.name===name)}_GetAllInstanceVariableNames(){return this._instVars.map(iv=>iv.name)}_GetAllInstanceVariableJsPropNames(){return this._instVars.map(iv=>iv.jsPropName)}GetInstanceVariableType(i){i= +Math.floor(i);if(i<0||i>=this._instVars.length)throw new RangeError("invalid instance variable index");return this._instVars[i].type}GetInstanceVariableName(i){i=Math.floor(i);if(i<0||i>=this._instVars.length)throw new RangeError("invalid instance variable index");return this._instVars[i].name}GetEffectTypesCount(){return this._effectsCount}GetBehaviorTypesIncludingInherited(){return this._behaviorTypesIncludingInherited}GetBehaviorTypeByName(name){return this._behaviorsByName.get(name.toLowerCase())|| +null}GetBehaviorIndexByName(name){const ret=this._behaviorNameToIndex.get(name.toLowerCase());if(typeof ret==="undefined")return-1;else return ret}GetEffectList(){return this._effectList}HasEffects(){return this._plugin.HasEffects()}UsesEffects(){return this._effectList&&this._effectList.HasAnyEffectType()}GetSolStack(){return this._solStack}GetCurrentSol(){return this._solStack.GetCurrentSol()}GetImageInfo(){return this._imageInfo}SetDefaultInstanceData(d){this._defaultInstanceData=d}GetDefaultInstanceData(){return this._defaultInstanceData}_SetDefaultLayerIndex(i){this._defaultLayerIndex= +i}GetDefaultLayerIndex(){return this._defaultLayerIndex}GetAnimations(){return this._animations}GetAnimationCount(){return this._animations.length}GetFamilies(){return this._families}BelongsToFamily(family){return this._familiesSet.has(family)}GetFamilyMembers(){return this._familyMembers}FamilyHasMember(objectType){return this._familyMembersSet.has(objectType)}GetFamilyBehaviorOffset(familyIndex){return this._familyBehaviorMap[familyIndex]}GetFamilyInstanceVariableOffset(familyIndex){return this._familyInstVarMap[familyIndex]}GetAnimationByName(name){if(!this._animations)throw new Error("no animations"); +return this._animationsByName.get(name.toLowerCase())||null}GetAnimationBySID(sid){if(!this._animations)throw new Error("no animations");return this._animationsBySid.get(sid)||null}GetFirstAnimationFrame(){if(!this._animations)throw new Error("no animations");return this._animations[0].GetFrameAt(0)}GetDefaultInstanceSize(){if(this._animations){const firstFrameInfo=this.GetFirstAnimationFrame().GetImageInfo();return[firstFrameInfo.GetWidth(),firstFrameInfo.GetHeight()]}else if(this._imageInfo)return[this._imageInfo.GetWidth(), +this._imageInfo.GetHeight()];else return[100,100]}GetSingleGlobalInstance(){if(!this._plugin.IsSingleGlobal())throw new Error("not a single-global plugin");return this._instances[0]}GetInstances(){return this._instances}*instances(){yield*this._instances}*instancesIncludingPendingCreate(){yield*this._instances;for(const inst of this._runtime._GetInstancesPendingCreate())if(inst.GetObjectClass()===this)yield inst}GetInstanceCount(){return this._instances.length}_AddInstance(inst){this._instances.push(inst)}_SetIIDsStale(){this._iidsStale= +true}_UpdateIIDs(){if(!this._iidsStale||this._isFamily)return;const instances=this._instances;let i=0;for(let len=instances.length;iinst.SaveToJson())}; +if(this._savedData&&this._savedData.size)o["ex"]=C3.ToSuperJSON(this._savedData);return o}_LoadFromJson(o){if(this._savedData){this._savedData.clear();this._savedData=null}const ex=o["ex"];if(ex)this._savedData=C3.FromSuperJSON(ex);const existingInstances=this._instances;const loadInstances=o["instances"];for(let i=0,len=Math.min(existingInstances.length,loadInstances.length);io.IsWorldType())}}}; + + +// c3/objects/instance.js +'use strict';{const C3=self.C3;const C3Debugger=self.C3Debugger;const IInstance=self.IInstance;const EMPTY_ARRAY=[];let nextPuid=0;const savedDataMaps=new WeakMap;const unsavedDataMaps=new WeakMap;const FLAG_DESTROYED=1<<0;const FLAG_TILEMAP=1<<1;const FLAG_MUST_PREDRAW=1<<2;const FLAG_SOLID_ENABLED=1<<3;const FLAG_JUMPTHRU_ENABLED=1<<4;C3.Instance=class Instance extends C3.DefendedBase{constructor(opts){super();this._runtime=opts.runtime;this._objectType=opts.objectType;this._worldInfo=null;this._sdkInst= +null;this._iScriptInterface=null;this._iid=0;this._uid=opts.uid;this._puid=nextPuid++;this._flags=0;this._instVarValues=EMPTY_ARRAY;this._behaviorInstances=EMPTY_ARRAY;const behaviorTypes=this._objectType.GetBehaviorTypesIncludingInherited();if(behaviorTypes.length>0)this._behaviorInstances=behaviorTypes.map((behaviorType,index)=>C3.New(C3.BehaviorInstance,{runtime:this._runtime,behaviorType:behaviorType,instance:this,index}));this._siblings=this._objectType.IsInContainer()?[]:null;this._timeScale= +-1;this._dispatcher=null;const plugin=this.GetPlugin();if(plugin.MustPreDraw())this._flags|=FLAG_MUST_PREDRAW;if(plugin.IsWorldType()){this._worldInfo=C3.New(C3.WorldInfo,this,opts.layer);if(opts.worldData)this._worldInfo.Init(opts.worldData);else{this._worldInfo.InitNoData();const [width,height]=this._objectType.GetDefaultInstanceSize();this._worldInfo.SetSize(width,height);if(this.GetObjectClass().UsesEffects())this._worldInfo.GetInstanceEffectList().LoadDefaultEffectParameters()}}if(opts.instVarData)this._LoadInstanceVariableData(opts.instVarData); +else this._LoadDefaultInstanceVariables()}Release(){if(this._iScriptInterface){this._iScriptInterface._Release();this._iScriptInterface=null}if(this._behaviorInstances.length>0){for(const behInst of this._behaviorInstances)behInst.Release();C3.clearArray(this._behaviorInstances)}this._sdkInst.Release();this._sdkInst=null;const savedData=savedDataMaps.get(this);if(savedData){savedData.clear();savedDataMaps.delete(this)}const unsavedData=unsavedDataMaps.get(this);if(unsavedData){unsavedData.clear(); +unsavedDataMaps.delete(this)}if(this._siblings)C3.clearArray(this._siblings);if(this._dispatcher){this._dispatcher.Release();this._dispatcher=null}this._runtime=null;this._objectType=null;if(this._instVarValues.length>0)C3.clearArray(this._instVarValues);if(this._worldInfo){this._worldInfo.Release();this._worldInfo=null}}_LoadInstanceVariableData(instVarData){if(instVarData.length>0){this._instVarValues=[];C3.shallowAssignArray(this._instVarValues,instVarData)}}_LoadDefaultInstanceVariables(){const len= +this._objectType.GetInstanceVariablesCount();if(len===0)return;this._instVarValues=[];const typeToInitValue=[0,0,""];for(let i=0;iwi.GetInstance())}*children(){const wi=this.GetWorldInfo();if(!wi)return;for(const childWi of wi.children())yield childWi.GetInstance()}*allChildren(){const wi=this.GetWorldInfo();if(!wi)return;for(const childWi of wi.allChildren())yield childWi.GetInstance()}GetChildCount(){const wi= +this.GetWorldInfo();return wi?wi.GetChildCount():0}GetChildAt(index){const wi=this.GetWorldInfo();if(!wi)return null;const childWi=wi.GetChildAt(index);return childWi?childWi.GetInstance():null}AddChild(childInst,opts){this.VerifySupportsSceneGraph();childInst.VerifySupportsSceneGraph();this.GetWorldInfo().AddChild(childInst.GetWorldInfo(),opts||{})}RemoveChild(childInst){const wi=this.GetWorldInfo();if(!wi)return;wi.RemoveChild(childInst.GetWorldInfo())}GetDestroyWithParent(){const wi=this.GetWorldInfo(); +return wi?wi.GetDestroyWithParent():false}SetupInitialSceneGraphConnections(){const wi=this.GetWorldInfo();if(!wi)return;const childrenData=wi.GetSceneGraphChildrenExportData();if(!childrenData)return;for(const childData of childrenData){const child=this._runtime.GetInstanceByUID(childData[2]);if(child){const flags=childData[3];this.AddChild(child,{transformX:!!(flags>>0&1),transformY:!!(flags>>1&1),transformWidth:!!(flags>>2&1),transformHeight:!!(flags>>3&1),transformAngle:!!(flags>>4&1),destroyWithParent:!!(flags>> +5&1),transformZElevation:!!(flags>>6&1)})}}}IsInContainer(){return this._siblings!==null}_AddSibling(inst){this._siblings.push(inst)}GetSiblings(){return this._siblings}HasSibling(objectClass){return!!this.GetSibling(objectClass)}GetSibling(objectClass){const siblings=this.siblings();if(siblings===null||siblings.length===0)return false;for(const s of siblings)if(s.GetObjectClass()===objectClass)return s;return null}siblings(){return this._siblings}SetSiblingsSinglePicked(){for(const s of this.siblings())s.GetObjectClass().GetCurrentSol().SetSinglePicked(s)}_PushSiblingsToSolInstances(){for(const s of this.siblings())s.GetObjectClass().GetCurrentSol()._PushInstance(s)}_SetSiblingsToSolInstancesIndex(i){for(const s of this.siblings())s.GetObjectClass().GetCurrentSol()._GetOwnInstances()[i]= +s}_PushSiblingsToSolElseInstances(){for(const s of this.siblings())s.GetObjectClass().GetCurrentSol()._PushElseInstance(s)}_SetSiblingsToSolElseInstancesIndex(i){for(const s of this.siblings())s.GetObjectClass().GetCurrentSol()._GetOwnElseInstances()[i]=s}GetPlugin(){return this._objectType.GetPlugin()}_SetIID(i){this._iid=i}GetIID(){this._objectType._UpdateIIDs();return this._iid}GetUID(){return this._uid}GetPUID(){return this._puid}GetBehaviorInstances(){return this._behaviorInstances}GetBehaviorInstanceFromCtor(ctor){if(!ctor)return null; +for(const behInst of this._behaviorInstances)if(behInst.GetBehavior()instanceof ctor)return behInst;return null}GetBehaviorSdkInstanceFromCtor(ctor){if(!ctor)return null;const behInst=this.GetBehaviorInstanceFromCtor(ctor);if(behInst)return behInst.GetSdkInstance();else return null}GetBehaviorIndexBySID(sid){const behaviorInstances=this._behaviorInstances;for(let i=0,len=behaviorInstances.length;i=instVarValues.length)throw new RangeError("invalid instance variable");return instVarValues[index]}_GetInstanceVariableValueUnchecked(index){return this._instVarValues[index]}_GetInstanceVariableTypedValue(index){const ret=this._instVarValues[index];if(this._objectType.GetInstanceVariableType(index)===0)return!!ret;else return ret}SetInstanceVariableValue(index,value){index=index|0;const instVarValues=this._instVarValues;if(index< +0||index>=instVarValues.length)throw new RangeError("invalid instance variable");const type=this._objectType.GetInstanceVariableType(index);switch(type){case 0:instVarValues[index]=value?1:0;break;case 1:instVarValues[index]=typeof value==="number"?value:parseFloat(value);break;case 2:instVarValues[index]=typeof value==="string"?value:value.toString();break;default:throw new Error("unknown instance variable type");}}SetInstanceVariableOffset(index,offset){if(offset===0)return;index=index|0;const instVarValues= +this._instVarValues;if(index<0||index>=instVarValues.length)throw new RangeError("invalid instance variable");const lastValue=instVarValues[index];if(typeof lastValue==="number")if(typeof offset==="number")instVarValues[index]+=offset;else instVarValues[index]+=parseFloat(offset);else if(typeof lastValue==="boolean")throw new Error("can not set offset of boolean variable");else if(typeof lastValue==="string")throw new Error("can not set offset of string variable");else throw new Error("unknown instance variable type"); +}GetSavedDataMap(){let ret=savedDataMaps.get(this);if(ret)return ret;ret=new Map;savedDataMaps.set(this,ret);return ret}GetUnsavedDataMap(){let ret=unsavedDataMaps.get(this);if(ret)return ret;ret=new Map;unsavedDataMaps.set(this,ret);return ret}_HasAnyCreateDestroyHandler(name){const objectType=this.GetObjectClass();if(objectType.UserScriptDispatcher().HasAnyHandlerFor(name))return true;for(const family of objectType.GetFamilies())if(family.UserScriptDispatcher().HasAnyHandlerFor(name))return true; +if(this._runtime.UserScriptDispatcher().HasAnyHandlerFor(name))return true;return false}_TriggerOnCreatedOnSelfAndRelated(){this._TriggerOnCreated();const wi=this.GetWorldInfo();const relatedInstances=new Set;if(wi&&wi.HasChildren())for(const c of this.allChildren()){relatedInstances.add(c);if(!c.IsInContainer())continue;for(const s of c.siblings())relatedInstances.add(s)}if(this.IsInContainer())for(const s of this.siblings())relatedInstances.add(s);for(const relatedInstance of relatedInstances.values())relatedInstance._TriggerOnCreated()}_TriggerOnCreated(){if(this._HasAnyCreateDestroyHandler("instancecreate")){const objectType= +this.GetObjectClass();const instCreateEvent=new C3.Event("instancecreate");instCreateEvent.instance=this.GetInterfaceClass();objectType.DispatchUserScriptEvent(instCreateEvent);for(const family of objectType.GetFamilies())family.DispatchUserScriptEvent(instCreateEvent);this._runtime.DispatchUserScriptEvent(instCreateEvent)}this._runtime.Trigger(this.GetPlugin().constructor.Cnds.OnCreated,this,null)}_TriggerOnDestroyed(){this._runtime.Trigger(this.GetPlugin().constructor.Cnds.OnDestroyed,this,null)}_FireDestroyedScriptEvents(isEndingLayout){if(this._iScriptInterface){const e= +new C3.Event("destroy");e.isEndingLayout=isEndingLayout;this.DispatchUserScriptEvent(e)}if(!this._HasAnyCreateDestroyHandler("instancedestroy"))return;const objectType=this.GetObjectClass();const instDestroyEvent=new C3.Event("instancedestroy");instDestroyEvent.instance=this.GetInterfaceClass();instDestroyEvent.isEndingLayout=isEndingLayout;objectType.DispatchUserScriptEvent(instDestroyEvent);for(const family of objectType.GetFamilies())family.DispatchUserScriptEvent(instDestroyEvent);this._runtime.DispatchUserScriptEvent(instDestroyEvent)}_GetDebuggerProperties(){return this._sdkInst.GetDebuggerProperties()}SaveToJson(mode= +"full"){const o={};if(mode==="full")o["uid"]=this.GetUID();else o["c3"]=true;if(mode!=="visual-state"){const savedData=savedDataMaps.get(this);if(savedData&&savedData.size)o["ex"]=C3.ToSuperJSON(savedData);if(this.GetTimeScale()!==-1)o["mts"]=this.GetTimeScale();if(this._objectType.GetInstanceVariablesCount()>0){const ivs={};const ivSids=this._objectType.GetInstanceVariableSIDs();for(let i=0,len=this._instVarValues.length;i=this._instVarValues.length)continue;let v=value;if(v===null)v=NaN;this._instVarValues[index]=v}}if(this.GetPlugin().IsWorldType()){const worldData=o["w"];const layerSid=worldData["l"]; +if(this._worldInfo.GetLayer().GetSID()!==layerSid){const oldLayer=this._worldInfo.GetLayer();const newLayer=oldLayer.GetLayout().GetLayerBySID(layerSid);if(newLayer){this._worldInfo._SetLayer(newLayer);oldLayer._RemoveInstance(this,true);newLayer._AddInstance(this,true);newLayer.SetZIndicesChanged();this._worldInfo.SetBboxChanged()}else if(mode==="full")this._runtime.DestroyInstance(this)}this._worldInfo._LoadFromJson(worldData,mode)}if(mode!=="visual-state"){const behs=o["behs"];if(behs)for(const [sidStr, +data]of Object.entries(behs)){const sid=parseInt(sidStr,10);const index=this.GetBehaviorIndexBySID(sid);if(index<0||index>=this._behaviorInstances.length)continue;this._behaviorInstances[index].LoadFromJson(data)}}const ownData=o["data"];if(ownData)this._sdkInst.LoadFromJson(ownData)}GetInterfaceClass(){return this._iScriptInterface||this._InitUserScriptInterface()}_InitUserScriptInterface(){const DefaultScriptClass=this._worldInfo?self.IWorldInstance:IInstance;const SdkScriptClass=this._sdkInst.GetScriptInterfaceClass(); +const UserScriptClass=this._objectType._GetUserScriptInstanceClass();const ScriptInterfaceClass=UserScriptClass||SdkScriptClass||DefaultScriptClass;IInstance._Init(this);this._iScriptInterface=new ScriptInterfaceClass;IInstance._Init(null);if(SdkScriptClass&&!(this._iScriptInterface instanceof DefaultScriptClass))throw new TypeError(`script interface class '${SdkScriptClass.name}' does not extend the right base class '${DefaultScriptClass.name}'`);if(UserScriptClass){const ExpectedBaseClass=SdkScriptClass|| +DefaultScriptClass;if(!(this._iScriptInterface instanceof ExpectedBaseClass))throw new TypeError(`setInstanceClass(): class '${UserScriptClass.name}' does not extend the right base class '${ExpectedBaseClass.name}'`);}return this._iScriptInterface}_GetInstVarsScriptDescriptor(instDescriptors){if(this._instVarValues.length===0)return;const varDescriptors={};const instVarJsPropNames=this._objectType._GetAllInstanceVariableJsPropNames();for(let i=0,len=instVarJsPropNames.length;i0}GetChildren(){return this._children}_GetStartWidth(){return this._myStartWidth}_GetStartHeight(){return this._myStartHeight}GetParentScaleX(){if(this._owner.GetTransformWithParentWidth())return this._parent.GetWidth()/ +this._parent._GetSceneGraphInfo()._GetStartWidth();else return 1}GetParentScaleY(){if(this._owner.GetTransformWithParentHeight())return this._parent.GetHeight()/this._parent._GetSceneGraphInfo()._GetStartHeight();else return 1}GetParentStartAngle(){return this._parentStartAngle}_SaveToJson(){return{"sw":this._myStartWidth,"sh":this._myStartHeight,"psa":this._parentStartAngle,"c":this._children.map(c=>{let flagsStr="";if(c.GetTransformWithParentX())flagsStr+="x";if(c.GetTransformWithParentY())flagsStr+= +"y";if(c.GetTransformWithParentWidth())flagsStr+="w";if(c.GetTransformWithParentHeight())flagsStr+="h";if(c.GetTransformWithParentAngle())flagsStr+="a";if(c.GetTransformWithParentZElevation())flagsStr+="z";if(c.GetDestroyWithParent())flagsStr+="d";return{"uid":c.GetInstance().GetUID(),"f":flagsStr}})}}_LoadFromJson(o){this._myStartWidth=o["sw"];this._myStartHeight=o["sh"];this._parentStartAngle=o["psa"]}_OnAfterLoad(o){const owner=this._owner;const runtime=owner.GetRuntime();for(const childData of o["c"]){const childUid= +childData["uid"];const childInst=runtime.GetInstanceByUID(childUid);const childWi=childInst.GetWorldInfo();const flagsStr=childData["f"];const opts={};opts.transformX=flagsStr.includes("x");opts.transformY=flagsStr.includes("y");opts.transformWidth=flagsStr.includes("w");opts.transformHeight=flagsStr.includes("h");opts.transformAngle=flagsStr.includes("a");opts.transformZElevation=flagsStr.includes("z");opts.destroyWithParent=flagsStr.includes("d");owner.AddChild(childWi,opts)}}}}; + + +// c3/objects/worldInfo.js +'use strict';{const C3=self.C3;const tempRect=C3.New(C3.Rect);const tempQuad=C3.New(C3.Quad);const bboxChangeEvent=C3.New(C3.Event,"bboxchange",false);const tempColor=C3.New(C3.Color,0,0,0,0);const tempCollisionPoly=C3.New(C3.CollisionPoly);const DEFAULT_COLOR=C3.New(C3.Color,1,1,1,1);const DEFAULT_RENDER_CELLS=C3.New(C3.Rect,0,0,-1,-1);const DEFAULT_COLLISION_CELLS=C3.New(C3.Rect,0,0,-1,-1);const VALID_SET_MESH_POINT_MODES=new Set(["absolute","relative"]);const EMPTY_ARRAY=[];let enableUpdateRendererStateGroup= +true;const FLAG_IS_VISIBLE=1<<0;const FLAG_BBOX_CHANGED=1<<1;const FLAG_ENABLE_BBOX_CHANGED_EVENT=1<<2;const FLAG_COLLISION_ENABLED=1<<3;const FLAG_COLLISION_CELL_CHANGED=1<<4;const FLAG_SOLID_FILTER_INCLUSIVE=1<<5;const FLAG_HAS_ANY_ACTIVE_EFFECT=1<<6;const FLAG_IS_ROTATABLE=1<<7;const FLAG_DESTROY_WITH_PARENT=1<<8;const FLAG_TRANSFORM_WITH_PARENT_X=1<<9;const FLAG_TRANSFORM_WITH_PARENT_Y=1<<10;const FLAG_TRANSFORM_WITH_PARENT_W=1<<11;const FLAG_TRANSFORM_WITH_PARENT_H=1<<12;const FLAG_TRANSFORM_WITH_PARENT_A= +1<<13;const FLAG_TRANSFORM_WITH_PARENT_Z_ELEVATION=1<<14;const MASK_ALL_SCENE_GRAPH_FLAGS=FLAG_DESTROY_WITH_PARENT|FLAG_TRANSFORM_WITH_PARENT_X|FLAG_TRANSFORM_WITH_PARENT_Y|FLAG_TRANSFORM_WITH_PARENT_W|FLAG_TRANSFORM_WITH_PARENT_H|FLAG_TRANSFORM_WITH_PARENT_A|FLAG_TRANSFORM_WITH_PARENT_Z_ELEVATION;const FLAG_MESH_CHANGED=1<<15;const FLAG_PHYSICS_BODY_CHANGED=1<<16;const FLAG_SIN_COS_ANGLE_CHANGED=1<<17;const FLAG_BLEND_MODE_BIT_OFFSET=26;const FLAG_BLEND_MODE_MASK=31<=children.length)return null;return children[index]}_CreateSceneGraphInfo(parent){if(!this._sceneGraphInfo)this._sceneGraphInfo=C3.New(C3.SceneGraphInfo,this);if(parent)this._sceneGraphInfo.SetParent(parent)}_GetSceneGraphInfo(){return this._sceneGraphInfo}_ReleaseSceneGraphInfo(){if(!this._sceneGraphInfo)return;this._sceneGraphInfo.Release();this._sceneGraphInfo=null}_SetParent(parent){if(parent){parent._CreateSceneGraphInfo(null);this._CreateSceneGraphInfo(parent)}else{if(this._sceneGraphInfo)this._sceneGraphInfo.SetParent(null); +if(!this.HasChildren())this._ReleaseSceneGraphInfo()}}_HasAnyParent(child){if(!this.HasParent())return false;const parent=this.GetParent();if(parent===child)return true;return parent._HasAnyParent(child)}_HasChildRecursive(child){if(this.HasChild(child))return true;for(const c of this.GetChildren())if(c._HasChildRecursive(child))return true;return false}_AddChildToSceneGraphInfo(child){this._sceneGraphInfo.GetChildren().push(child)}_RemoveChildFromSceneGraphInfo(child){const children=this._sceneGraphInfo.GetChildren(); +const index=children.indexOf(child);if(index!==-1)children.splice(index,1);if(children.length===0&&!this.HasParent())this._ReleaseSceneGraphInfo();if(!child.HasChildren())child._ReleaseSceneGraphInfo()}GetSceneGraphChildrenExportData(){return this._sceneGraphChildrenExportData}GetSceneGraphZIndexExportData(){return this._sceneGraphZIndexExportData}GetSceneGraphZIndex(){return this._sceneGraphZIndex}SetSceneGraphZIndex(z){this._sceneGraphZIndex=z}_UpdateRendererStateGroup(){if(!enableUpdateRendererStateGroup)return; +const renderer=this._runtime.GetRenderer();if(this._stateGroup)renderer.ReleaseStateGroup(this._stateGroup);this._stateGroup=renderer.AcquireStateGroup(renderer.GetTextureFillShaderProgram()||"",this.GetBlendMode(),this._colorPremultiplied,this.GetZElevation())}GetRendererStateGroup(){return this._stateGroup}HasDefaultColor(){return this._color===DEFAULT_COLOR}SetBlendMode(bm){bm=bm|0;if(bm<0||bm>31)throw new RangeError("invalid blend mode");if(this.GetBlendMode()===bm)return;this._flags= +this._flags&~FLAG_BLEND_MODE_MASK|bm<>FLAG_BLEND_MODE_BIT_OFFSET}_SetLayer(layer){this._layer=layer;if(this.GetZElevation()!==0)this._layer._SetAnyInstanceZElevated()}GetLayer(){return this._layer}GetLayout(){return this.GetLayer().GetLayout()}_SetZIndex(z){this._zIndex=z|0}GetZIndex(){this._layer._UpdateZIndices();return this._zIndex}_GetLastCachedZIndex(){return this._zIndex}_SetFlag(bit, +enable){if(enable)this._flags|=bit;else this._flags&=~bit}IsVisible(){return(this._flags&FLAG_IS_VISIBLE)!==0}SetVisible(v){this._SetFlag(FLAG_IS_VISIBLE,v)}IsCollisionEnabled(){return(this._flags&FLAG_COLLISION_ENABLED)!==0}SetCollisionEnabled(e){e=!!e;if(this.IsCollisionEnabled()===e)return;this._SetFlag(FLAG_COLLISION_ENABLED,e);if(e)this.SetBboxChanged();else this._RemoveFromCollisionCells()}SetSolidCollisionFilter(isInclusive,tags){this._SetFlag(FLAG_SOLID_FILTER_INCLUSIVE,isInclusive);if(this._solidFilterTags)this._solidFilterTags.clear(); +if(!tags.trim()){this._solidFilterTags=null;return}if(!this._solidFilterTags)this._solidFilterTags=new Set;for(const tag of tags.split(" "))if(tag)this._solidFilterTags.add(tag.toLowerCase())}IsSolidCollisionAllowed(solidTagSet){const isInclusive=(this._flags&FLAG_SOLID_FILTER_INCLUSIVE)!==0;const filterTags=this._solidFilterTags;if(!solidTagSet||!filterTags)return!isInclusive;for(const tag of filterTags)if(solidTagSet.has(tag))return isInclusive;return!isInclusive}SetBboxChanged(){this._flags|=FLAG_BBOX_CHANGED| +FLAG_COLLISION_CELL_CHANGED|FLAG_MESH_CHANGED;this._objectClass._SetAnyCollisionCellChanged(true);this._runtime.UpdateRender();if(this._layer.UsesRenderCells()){this.CalculateBbox(this._boundingBox,this._boundingQuad,true);this._flags&=~FLAG_BBOX_CHANGED;this._UpdateRenderCell()}if((this._flags&FLAG_ENABLE_BBOX_CHANGED_EVENT)!==0)this._inst.Dispatcher().dispatchEvent(bboxChangeEvent);if(this._sceneGraphInfo!==null){const children=this._sceneGraphInfo.GetChildren();for(let i=0,len=children.length;i< +len;++i)children[i].SetBboxChanged()}}CalculateBbox(bbox,bquad,includeMesh){const x=this.GetX();const y=this.GetY();const w=this.GetWidth();const h=this.GetHeight();const a=this.GetAngle();bbox.setWH(x-this._ox*w,y-this._oy*h,w,h);if(includeMesh&&this.HasMesh())this._ExpandBboxForMesh(bbox);if(a===0)bquad.setFromRect(bbox);else{bbox.offset(-x,-y);bquad.setFromRotatedRectPrecalc(bbox,this.GetSinAngle(),this.GetCosAngle());bquad.offset(x,y);bquad.getBoundingBox(bbox)}bbox.normalize()}_UpdateBbox(){const flags= +this._flags;if((flags&FLAG_BBOX_CHANGED)!==0){this.CalculateBbox(this._boundingBox,this._boundingQuad,true);this._flags=flags&~FLAG_BBOX_CHANGED}}GetBoundingBox(){this._UpdateBbox();return this._boundingBox}GetBoundingQuad(){this._UpdateBbox();return this._boundingQuad}PixelRoundQuad(quad){const x=this.GetX();const y=this.GetY();const ox=Math.round(x)-x;const oy=Math.round(y)-y;if(ox===0&&oy===0)return quad;else{tempQuad.copy(quad);tempQuad.offset(ox,oy);return tempQuad}}OverwriteBoundingBox(box){this._boundingBox.copy(box); +this._boundingQuad.setFromRect(this._boundingBox);this._flags&=~FLAG_BBOX_CHANGED;this._UpdateCollisionCell();this._UpdateRenderCell()}SetBboxChangeEventEnabled(e){this._SetFlag(FLAG_ENABLE_BBOX_CHANGED_EVENT,e)}IsBboxChangeEventEnabled(){return(this._flags&FLAG_ENABLE_BBOX_CHANGED_EVENT)!==0}IsInViewport(viewport){return this.GetZElevation()===0?viewport.intersectsRect(this.GetBoundingBox()):this._IsInViewport_ZElevated()}_IsInViewport_ZElevated(){const layer=this.GetLayer();const totalZElevation= +this.GetTotalZElevation();if(totalZElevation>=layer.GetCameraZ())return false;layer.GetViewportForZ(totalZElevation,tempRect);return tempRect.intersectsRect(this.GetBoundingBox())}SetSourceCollisionPoly(poly){this._sourceCollisionPoly=poly;this._DiscardTransformedCollisionPoly();if(this.HasMesh())this._meshInfo.meshPoly=null}GetSourceCollisionPoly(){return this._sourceCollisionPoly}HasOwnCollisionPoly(){return this._sourceCollisionPoly!==null||this.HasMesh()}GetTransformedCollisionPoly(){return this._GetCustomTransformedCollisionPolyPrecalc(this.GetWidth(), +this.GetHeight(),this.GetAngle(),this.GetSinAngle(),this.GetCosAngle())}GetCustomTransformedCollisionPoly(w,h,a){let sina=0;let cosa=1;if(a!==0){sina=Math.sin(a);cosa=Math.cos(a)}return this._GetCustomTransformedCollisionPolyPrecalc(w,h,a,sina,cosa)}_GetCustomTransformedCollisionPolyPrecalc(w,h,a,sinA,cosA){let tpi=this._transformedPolyInfo;if(tpi===null){tpi={poly:C3.New(C3.CollisionPoly),width:NaN,height:NaN,angle:NaN};this._transformedPolyInfo=tpi}const transformedPoly=tpi.poly;if(tpi.width=== +w&&tpi.height===h&&tpi.angle===a)return transformedPoly;const sourcePoly=this._sourceCollisionPoly;if(this.HasMesh()){const ox=this.GetOriginX();const oy=this.GetOriginY();const sourceMesh=this.GetSourceMesh();let meshPoly=this._meshInfo.meshPoly;if(!meshPoly){if(sourcePoly){tempCollisionPoly.copy(sourcePoly);tempCollisionPoly.offset(ox,oy)}else tempCollisionPoly.setDefaultPoints();meshPoly=sourceMesh.InsertPolyMeshVertices(tempCollisionPoly);this._meshInfo.meshPoly=meshPoly}sourceMesh.TransformCollisionPoly(meshPoly, +transformedPoly);transformedPoly.offset(-ox,-oy);transformedPoly.transformPrecalc(w,h,sinA,cosA)}else if(sourcePoly){transformedPoly.copy(sourcePoly);transformedPoly.transformPrecalc(w,h,sinA,cosA)}else transformedPoly.setFromQuad(this.GetBoundingQuad(),-this.GetX(),-this.GetY());tpi.width=w;tpi.height=h;tpi.angle=a;return transformedPoly}_DiscardTransformedCollisionPoly(){this.SetPhysicsBodyChanged(true);const tpi=this._transformedPolyInfo;if(tpi===null)return;tpi.width=NaN}CreateMesh(hsize,vsize){hsize= +Math.floor(hsize);vsize=Math.floor(vsize);if(!this.GetInstance().GetPlugin().SupportsMesh())throw new Error("object does not support mesh");this.ReleaseMesh();this._meshInfo={sourceMesh:C3.New(C3.Gfx.Mesh,hsize,vsize),transformedMesh:C3.New(C3.Gfx.Mesh,hsize,vsize),meshPoly:null}}HasMesh(){return this._meshInfo!==null}GetSourceMesh(){if(!this.HasMesh())throw new Error("no mesh");return this._meshInfo.sourceMesh}GetTransformedMesh(){if(!this.HasMesh())throw new Error("no mesh");return this._meshInfo.transformedMesh}SetMeshChanged(e){this._SetFlag(FLAG_MESH_CHANGED, +e)}IsMeshChanged(){return(this._flags&FLAG_MESH_CHANGED)!==0}SetPhysicsBodyChanged(e){this._SetFlag(FLAG_PHYSICS_BODY_CHANGED,e)}IsPhysicsBodyChanged(){return(this._flags&FLAG_PHYSICS_BODY_CHANGED)!==0}_ExpandBboxForMesh(bbox){const sourceMesh=this._meshInfo.sourceMesh;const minX=Math.min(sourceMesh.GetMinX(),0);const minY=Math.min(sourceMesh.GetMinY(),0);const maxX=Math.max(sourceMesh.GetMaxX(),1);const maxY=Math.max(sourceMesh.GetMaxY(),1);const w=bbox.width();const h=bbox.height();bbox.offsetLeft(minX* +w);bbox.offsetTop(minY*h);bbox.offsetRight((maxX-1)*w);bbox.offsetBottom((maxY-1)*h)}ReleaseMesh(){if(!this._meshInfo)return;this._meshInfo.sourceMesh.Release();this._meshInfo.transformedMesh.Release();this._meshInfo=null;this._DiscardTransformedCollisionPoly()}SetMeshPoint(col,row,opts){col=Math.floor(col);row=Math.floor(row);const mode=opts.mode||"absolute";if(!VALID_SET_MESH_POINT_MODES.has(mode))throw new Error("invalid mode");const isRelative=mode==="relative";let posx=opts.x;let posy=opts.y; +let texu=typeof opts.u==="number"?opts.u:isRelative?0:-1;let texv=typeof opts.v==="number"?opts.v:isRelative?0:-1;if(!this.HasMesh())return false;const sourceMesh=this.GetSourceMesh();const p=sourceMesh.GetMeshPointAt(col,row);if(p===null)return false;if(isRelative){posx+=col/(sourceMesh.GetHSize()-1);posy+=row/(sourceMesh.GetVSize()-1)}if(texu===-1&&!isRelative)texu=p.GetU();else{if(isRelative)texu+=col/(sourceMesh.GetHSize()-1);texu=C3.clamp(texu,0,1)}if(texv===-1&&!isRelative)texv=p.GetV();else{if(isRelative)texv+= +row/(sourceMesh.GetVSize()-1);texv=C3.clamp(texv,0,1)}if(p.GetX()===posx&&p.GetY()===posy&&p.GetU()===texu&&p.GetV()===texv)return false;p.SetX(posx);p.SetY(posy);p.SetU(texu);p.SetV(texv);this._DiscardTransformedCollisionPoly();return true}HasTilemap(){return this._inst.HasTilemap()}ContainsPoint(x,y){if(!this.GetBoundingBox().containsPoint(x,y))return false;if(!this.GetBoundingQuad().containsPoint(x,y))return false;if(this.HasTilemap())return this._inst.GetSdkInstance().TestPointOverlapTile(x,y); +if(!this.HasOwnCollisionPoly())return true;return this.GetTransformedCollisionPoly().containsPoint(x-this.GetX(),y-this.GetY())}_IsCollisionCellChanged(){return(this._flags&FLAG_COLLISION_CELL_CHANGED)!==0}_UpdateCollisionCell(){if(!this._IsCollisionCellChanged()||!this.IsCollisionEnabled())return;const bbox=this.GetBoundingBox();const grid=this._objectClass._GetCollisionCellGrid();const collisionCells=this._collisionCells;tempRect.set(grid.XToCell(bbox.getLeft()),grid.YToCell(bbox.getTop()),grid.XToCell(bbox.getRight()), +grid.YToCell(bbox.getBottom()));if(collisionCells.equals(tempRect))return;const inst=this._inst;if(collisionCells===DEFAULT_COLLISION_CELLS){grid.Update(inst,null,tempRect);this._collisionCells=C3.New(C3.Rect,tempRect)}else{grid.Update(inst,collisionCells,tempRect);collisionCells.copy(tempRect)}this._flags&=~FLAG_COLLISION_CELL_CHANGED}_RemoveFromCollisionCells(){const collisionCells=this._collisionCells;if(collisionCells===DEFAULT_COLLISION_CELLS)return;this._objectClass._GetCollisionCellGrid().Update(this._inst, +collisionCells,null);this._collisionCells=DEFAULT_COLLISION_CELLS}_UpdateRenderCell(){const layer=this.GetLayer();if(!layer.UsesRenderCells())return;const renderGrid=layer.GetRenderGrid();const bbox=this.GetBoundingBox();const renderCells=this._renderCells;tempRect.set(renderGrid.XToCell(bbox.getLeft()),renderGrid.YToCell(bbox.getTop()),renderGrid.XToCell(bbox.getRight()),renderGrid.YToCell(bbox.getBottom()));if(renderCells.equals(tempRect))return;const inst=this._inst;if(renderCells===DEFAULT_RENDER_CELLS){renderGrid.Update(inst, +null,tempRect);this._renderCells=C3.New(C3.Rect,tempRect)}else{renderGrid.Update(inst,renderCells,tempRect);renderCells.copy(tempRect)}layer.SetRenderListStale()}_RemoveFromRenderCells(){const renderCells=this._renderCells;if(renderCells===DEFAULT_RENDER_CELLS)return;this.GetLayer().GetRenderGrid().Update(this._inst,renderCells,null);this._renderCells=DEFAULT_RENDER_CELLS}GetRenderCellRange(){return this._renderCells}ZOrderMoveToTop(){const inst=this._inst;const layer=this._layer;const layerInstances= +layer._GetInstances();if(layerInstances.length&&layerInstances[layerInstances.length-1]===inst)return;layer._RemoveInstance(inst,false);layer._AddInstance(inst,false);this._runtime.UpdateRender()}ZOrderMoveToBottom(){const inst=this._inst;const layer=this._layer;const layerInstances=layer._GetInstances();if(layerInstances.length&&layerInstances[0]===inst)return;layer._RemoveInstance(inst,false);layer._PrependInstance(inst,false);this._runtime.UpdateRender()}ZOrderMoveToLayer(layerMove){const inst= +this._inst;const curLayer=this._layer;if(curLayer.GetLayout()!==layerMove.GetLayout())throw new Error("layer from different layout");if(layerMove===curLayer)return;curLayer._RemoveInstance(inst,true);this._SetLayer(layerMove);layerMove._AddInstance(inst,true);this._runtime.UpdateRender()}ZOrderMoveAdjacentToInstance(otherInst,isAfter){const inst=this._inst;const curLayer=this._layer;if(otherInst.GetUID()===inst.GetUID())return;const otherWi=otherInst.GetWorldInfo();if(!otherWi)throw new Error("expected world instance"); +const otherLayer=otherWi.GetLayer();let didChangeLayer=false;if(curLayer.GetIndex()!==otherLayer.GetIndex()){curLayer._RemoveInstance(inst,true);this._SetLayer(otherLayer);otherLayer._AddInstance(inst,true);didChangeLayer=true}const didChangeZOrder=otherLayer.MoveInstanceAdjacent(inst,otherInst,!!isAfter);if(didChangeLayer||didChangeZOrder)this._runtime.UpdateRender()}GetInstanceEffectList(){return this._instanceEffectList}_SetHasAnyActiveEffect(e){this._SetFlag(FLAG_HAS_ANY_ACTIVE_EFFECT,e)}HasAnyActiveEffect(){return(this._flags& +FLAG_HAS_ANY_ACTIVE_EFFECT)!==0}_SaveToJson(mode){const o={"x":this.GetX(),"y":this.GetY(),"w":this.GetWidth(),"h":this.GetHeight(),"l":this.GetLayer().GetSID(),"zi":this.GetZIndex()};if(this.GetZElevation()!==0)o["ze"]=this.GetZElevation();if(this.GetAngle()!==0)o["a"]=this.GetAngle();if(!this.HasDefaultColor())o["c"]=this._color.toJSON();if(this.GetOriginX()!==.5)o["oX"]=this.GetOriginX();if(this.GetOriginY()!==.5)o["oY"]=this.GetOriginY();if(this.GetBlendMode()!==0)o["bm"]=this.GetBlendMode(); +if(!this.IsVisible())o["v"]=this.IsVisible();if(!this.IsCollisionEnabled())o["ce"]=this.IsCollisionEnabled();if(this.IsBboxChangeEventEnabled())o["be"]=this.IsBboxChangeEventEnabled();if(this._instanceEffectList)o["fx"]=this._instanceEffectList._SaveToJson();const isSolidFilterInclusive=(this._flags&FLAG_SOLID_FILTER_INCLUSIVE)!==0;if(isSolidFilterInclusive)o["sfi"]=isSolidFilterInclusive;if(this._solidFilterTags)o["sft"]=[...this._solidFilterTags].join(" ");if(this._sceneGraphInfo&&mode!=="visual-state")o["sgi"]= +this._sceneGraphInfo._SaveToJson();if(this.HasMesh())o["mesh"]=this.GetSourceMesh().SaveToJson();return o}_LoadFromJson(o,mode){enableUpdateRendererStateGroup=false;if(mode!=="visual-state")this._ResetAllSceneGraphState();this.SetX(o["x"]);this.SetY(o["y"]);this.SetWidth(o["w"]);this.SetHeight(o["h"]);this._SetZIndex(o["zi"]);this.SetZElevation(o.hasOwnProperty("ze")?o["ze"]:0);this.SetAngle(o.hasOwnProperty("a")?o["a"]:0);if(o.hasOwnProperty("c"))tempColor.setFromJSON(o["c"]);else if(o.hasOwnProperty("o")){tempColor.copyRgb(this._color); +tempColor.a=o["o"]}else tempColor.setRgba(1,1,1,1);this._SetColor(tempColor);this.SetOriginX(o.hasOwnProperty("oX")?o["oX"]:.5);this.SetOriginY(o.hasOwnProperty("oY")?o["oY"]:.5);this.SetBlendMode(o.hasOwnProperty("bm")?o["bm"]:0);this.SetVisible(o.hasOwnProperty("v")?o["v"]:true);this.SetCollisionEnabled(o.hasOwnProperty("ce")?o["ce"]:true);this.SetBboxChangeEventEnabled(o.hasOwnProperty("be")?o["be"]:false);this.SetSolidCollisionFilter(o.hasOwnProperty("sfi")?o["sfi"]:false,o.hasOwnProperty("sft")? +o["sft"]:"");if(this._instanceEffectList&&o.hasOwnProperty("fx"))this._instanceEffectList._LoadFromJson(o["fx"]);if(o.hasOwnProperty("sgi")&&mode!=="visual-state"){this._CreateSceneGraphInfo(null);const sgi=this._sceneGraphInfo;const sgiData=o["sgi"];sgi._LoadFromJson(sgiData);const runtimeDispatcher=this.GetRuntime().Dispatcher();const onAfterLoad=()=>{runtimeDispatcher.removeEventListener("afterload",onAfterLoad);sgi._OnAfterLoad(sgiData)};runtimeDispatcher.addEventListener("afterload",onAfterLoad)}if(o.hasOwnProperty("mesh")){const meshData= +o["mesh"];this.CreateMesh(meshData["cols"],meshData["rows"]);this.GetSourceMesh().LoadFromJson(meshData)}else this.ReleaseMesh();this.SetBboxChanged();enableUpdateRendererStateGroup=true;this._UpdateRendererStateGroup()}}}; + + +// c3/objects/behaviorType.js +'use strict';{const C3=self.C3;C3.BehaviorType=class BehaviorType extends C3.DefendedBase{constructor(objectClass,data){super();const runtime=objectClass.GetRuntime();const pluginManager=runtime.GetPluginManager();const BehaviorCtor=runtime.GetObjectReference(data[1]);if(!pluginManager.HasBehaviorByConstructorFunction(BehaviorCtor))pluginManager.CreateBehavior(data);this._runtime=runtime;this._objectClass=objectClass;this._behavior=pluginManager.GetBehaviorByConstructorFunction(BehaviorCtor);this._sdkType= +null;this._instSdkCtor=BehaviorCtor.Instance;this._sid=data[2];this._name=data[0];this._jsPropName=this._runtime.GetJsPropName(data[3]);this._sdkType=C3.New(BehaviorCtor.Type,this);this.OnCreate()}static Create(objectClass,behaviorTypeData){return C3.New(C3.BehaviorType,objectClass,behaviorTypeData)}Release(){this._runtime=null;this._behavior=null;this._sdkType.Release();this._sdkType=null;this._instSdkCtor=null}GetSdkType(){return this._sdkType}OnCreate(){this._sdkType.OnCreate()}GetRuntime(){return this._runtime}GetObjectClass(){return this._objectClass}GetBehavior(){return this._behavior}GetInstanceSdkCtor(){return this._instSdkCtor}GetName(){return this._name}GetSID(){return this._sid}GetJsPropName(){return this._jsPropName}}}; + + +// c3/objects/behaviorInstance.js +'use strict';{const C3=self.C3;const IBehaviorInstance=self.IBehaviorInstance;C3.BehaviorInstance=class BehaviorInstance extends C3.DefendedBase{constructor(opts){super();this._runtime=opts.runtime;this._behaviorType=opts.behaviorType;this._behavior=this._behaviorType.GetBehavior();this._inst=opts.instance;this._index=opts.index;this._sdkInst=null;this._iScriptInterface=null;this._behavior._AddInstance(this._inst)}Release(){if(this._iScriptInterface){this._iScriptInterface._Release();this._iScriptInterface= +null}this._behavior._RemoveInstance(this._inst);this._sdkInst.Release();this._sdkInst=null;this._iScriptInterface=null;this._runtime=null;this._behaviorType=null;this._behavior=null;this._inst=null}_CreateSdkInstance(properties){if(this._sdkInst)throw new Error("already got sdk instance");this._sdkInst=C3.New(this._behaviorType.GetInstanceSdkCtor(),this,properties);this._InitScriptInterface()}GetSdkInstance(){return this._sdkInst}GetObjectInstance(){return this._inst}GetRuntime(){return this._runtime}GetBehaviorType(){return this._behaviorType}GetBehavior(){return this._behavior}_GetIndex(){return this._index}PostCreate(){this._sdkInst.PostCreate()}OnSpriteFrameChanged(prevFrame, +nextFrame){this._sdkInst.OnSpriteFrameChanged(prevFrame,nextFrame)}_GetDebuggerProperties(){return this._sdkInst.GetDebuggerProperties()}SaveToJson(){return this._sdkInst.SaveToJson()}LoadFromJson(o){return this._sdkInst.LoadFromJson(o)}static SortByTickSequence(a,b){const instA=a.GetObjectInstance();const instB=b.GetObjectInstance();const typeIndexA=instA.GetObjectClass().GetIndex();const typeIndexB=instB.GetObjectClass().GetIndex();if(typeIndexA!==typeIndexB)return typeIndexA-typeIndexB;const seqA= +instA.GetPUID();const seqB=instB.GetPUID();if(seqA!==seqB)return seqA-seqB;return a.GetBehaviorInstance()._GetIndex()-b.GetBehaviorInstance()._GetIndex()}_InitScriptInterface(){const DefaultScriptClass=IBehaviorInstance;const SdkScriptClass=this._sdkInst.GetScriptInterfaceClass();const ScriptInterfaceClass=SdkScriptClass||DefaultScriptClass;IBehaviorInstance._Init(this);this._iScriptInterface=new ScriptInterfaceClass;IBehaviorInstance._Init(null);if(SdkScriptClass&&!(this._iScriptInterface instanceof +DefaultScriptClass))throw new TypeError(`script interface class '${SdkScriptClass.name}' does not extend the right base class '${DefaultScriptClass.name}'`);}GetScriptInterface(){return this._iScriptInterface}}}; + + +// c3/objects/effectList.js +'use strict';{const C3=self.C3;C3.EffectList=class EffectList extends C3.DefendedBase{constructor(owner,data){super();this._owner=owner;this._allEffectTypes=[];this._activeEffectTypes=[];this._effectTypesByName=new Map;this._effectParams=[];this._preservesOpaqueness=true;for(const d of data){const et=C3.New(C3.EffectType,this,d,this._allEffectTypes.length);this._allEffectTypes.push(et);this._effectTypesByName.set(et.GetName().toLowerCase(),et);if(d.length>=3)this._effectParams.push(this._LoadSingleEffectParameters(d[2]))}this.GetRuntime()._AddEffectList(this)}Release(){C3.clearArray(this._allEffectTypes); +C3.clearArray(this._activeEffectTypes);this._effectTypesByName.clear();C3.clearArray(this._effectParams);this._owner=null}PrependEffectTypes(arr){if(!arr.length)return;this._allEffectTypes=arr.concat(this._allEffectTypes);for(const et of arr)this._effectTypesByName.set(et.GetName().toLowerCase(),et);for(let i=0,len=this._allEffectTypes.length;i +0}GetEffectTypeByName(name){return this._effectTypesByName.get(name.toLowerCase())||null}GetEffectTypeByIndex(index){index=Math.floor(+index);if(index<0||index>=this._allEffectTypes.length)throw new RangeError("invalid effect type index");return this._allEffectTypes[index]}IsEffectIndexActive(index){return this.GetEffectTypeByIndex(index).IsActive()}SetEffectIndexActive(index,a){this.GetEffectTypeByIndex(index).SetActive(a)}GetActiveEffectTypes(){return this._activeEffectTypes}HasAnyActiveEffect(){return this._activeEffectTypes.length> +0}PreservesOpaqueness(){return this._preservesOpaqueness}GetEffectParametersForIndex(index){return this._effectParams[index]}static SaveFxParamToJson(param){if(param&¶m instanceof C3.Color)return{"t":"color","v":param.toJSON()};else return param}static LoadFxParamFromJson(o){if(typeof o==="object"){const type=o["t"];if(type==="color"){const color=C3.New(C3.Color);color.setFromJSON(o["v"]);return color}else throw new Error("invalid effect parameter type");}else return o}static SaveFxParamsToJson(params){return params.map(C3.EffectList.SaveFxParamToJson)}static LoadFxParamsFromJson(arr){return arr.map(C3.EffectList.LoadFxParamFromJson)}SaveToJson(){return this._allEffectTypes.map(et=> +({"name":et.GetName(),"active":et.IsActive(),"params":C3.EffectList.SaveFxParamsToJson(this._effectParams[et.GetIndex()])}))}LoadFromJson(arr){for(const o of arr){const et=this.GetEffectTypeByName(o["name"]);if(!et)continue;et.SetActive(o["active"]);this._effectParams[et.GetIndex()]=C3.EffectList.LoadFxParamsFromJson(o["params"])}this.UpdateActiveEffects()}}}; + + +// c3/objects/effectType.js +'use strict';{const C3=self.C3;C3.EffectType=class EffectType extends C3.DefendedBase{constructor(effectList,data,index){super();this._effectList=effectList;this._id=data[0];this._name=data[1];this._index=index;this._shaderProgram=null;this._isActive=true}Release(){this._effectList=null;this._shaderProgram=null}Clone(effectListOwner){const ret=C3.New(C3.EffectType,effectListOwner,[this._id,this._name],-1);ret._shaderProgram=this._shaderProgram;ret._isActive=this._isActive;return ret}_InitRenderer(renderer){const shaderProgram= +renderer.GetShaderProgramByName(this._id);if(!shaderProgram)throw new Error("failed to find shader program '"+this._id+"'");this._shaderProgram=shaderProgram}GetEffectList(){return this._effectList}GetName(){return this._name}_SetIndex(i){this._index=i}GetIndex(){return this._index}GetOwner(){return this._effectList.GetOwner()}GetRuntime(){return this._effectList.GetRuntime()}SetActive(a){this._isActive=!!a}IsActive(){return this._isActive}GetShaderProgram(){return this._shaderProgram}GetDefaultParameterValues(){const ret= +[];for(let i=0,len=this._shaderProgram.GetParameterCount();i +et.GetShaderProgram().UsesDest())}IsEffectIndexActive(i){return this._activeEffectFlags[i]}SetEffectIndexActive(i,e){this._activeEffectFlags[i]=!!e}GetAllEffectTypes(){return this._effectList.GetAllEffectTypes()}_SaveToJson(){return this._effectList.GetAllEffectTypes().map(et=>({"name":et.GetName(),"active":this._activeEffectFlags[et.GetIndex()],"params":C3.EffectList.SaveFxParamsToJson(this._effectParams[et.GetIndex()])}))}_LoadFromJson(arr){for(const o of arr){const et=this._effectList.GetEffectTypeByName(o["name"]); +if(!et)continue;this._activeEffectFlags[et.GetIndex()]=o["active"];this._effectParams[et.GetIndex()]=C3.EffectList.LoadFxParamsFromJson(o["params"])}this.UpdateActiveEffects()}}}; + + +// c3/collisions/collisionEngine.js +'use strict';{const C3=self.C3;const tempCandidates=[];const tileCollRectCandidates=[];const tempJumpthruRet=[];const tempPolyA=C3.New(C3.CollisionPoly);const tempPolyB=C3.New(C3.CollisionPoly);const tempQuad=C3.New(C3.Quad);const tempRect=C3.New(C3.Rect);const tempRect2=C3.New(C3.Rect);C3.CollisionEngine=class CollisionEngine extends C3.DefendedBase{constructor(runtime){super();this._runtime=runtime;this._registeredCollisions=[];this._collisionCheckCount=0;this._collisionCheckSec=0;this._polyCheckCount= +0;this._polyCheckSec=0}Release(){this._runtime=null}_Update1sStats(){this._collisionCheckSec=this._collisionCheckCount;this._collisionCheckCount=0;this._polyCheckSec=this._polyCheckCount;this._polyCheckCount=0}Get1secCollisionChecks(){return this._collisionCheckSec}Get1secPolyChecks(){return this._polyCheckSec}RegisterCollision(a,b){const aw=a.GetWorldInfo();const bw=b.GetWorldInfo();if(!aw||!bw)return;if(!aw.IsCollisionEnabled()||!bw.IsCollisionEnabled())return;this._registeredCollisions.push([a, +b])}AddRegisteredCollisionCandidates(inst,otherType,arr){for(const [a,b]of this._registeredCollisions){let otherInst=null;if(inst===a)otherInst=b;else if(inst===b)otherInst=a;else continue;if(!otherInst.BelongsToObjectClass(otherType))continue;if(!arr.includes(otherInst))arr.push(otherInst)}}CheckRegisteredCollision(a,b){if(!this._registeredCollisions.length)return false;for(const [c,d]of this._registeredCollisions)if(a===c&&b===d||a===d&&b===c)return true;return false}ClearRegisteredCollisions(){C3.clearArray(this._registeredCollisions)}TestOverlap(a, +b){if(!a||!b||a===b)return false;const aw=a.GetWorldInfo();const bw=b.GetWorldInfo();if(!aw.IsCollisionEnabled()||!bw.IsCollisionEnabled())return false;this._collisionCheckCount++;const layerA=aw.GetLayer();const layerB=bw.GetLayer();const areLayerTransformsCompatible=layerA.IsTransformCompatibleWith(layerB);if(areLayerTransformsCompatible)return this._TestOverlap_SameLayers(aw,bw);else return this._TestOverlap_DifferentLayers(aw,bw)}_TestOverlap_SameLayers(aw,bw){if(!aw.GetBoundingBox().intersectsRect(bw.GetBoundingBox()))return false; +this._polyCheckCount++;if(!aw.GetBoundingQuad().intersectsQuad(bw.GetBoundingQuad()))return false;if(aw.HasTilemap()&&bw.HasTilemap())return false;if(aw.HasTilemap())return this.TestTilemapOverlap(aw,bw);else if(bw.HasTilemap())return this.TestTilemapOverlap(bw,aw);if(!aw.HasOwnCollisionPoly()&&!bw.HasOwnCollisionPoly())return true;const polyA=aw.GetTransformedCollisionPoly();const polyB=bw.GetTransformedCollisionPoly();return polyA.intersectsPoly(polyB,bw.GetX()-aw.GetX(),bw.GetY()-aw.GetY())}_TestOverlap_DifferentLayers(aw, +bw){const layerA=aw.GetLayer();const layerB=bw.GetLayer();tempPolyA.copy(aw.GetTransformedCollisionPoly());tempPolyB.copy(bw.GetTransformedCollisionPoly());const ptsArrA=tempPolyA.pointsArr();for(let i=0,len=ptsArrA.length;i0){const PI=Math.PI;this.hitNormal=C3.clampAngle(this.hitNormal+PI);this.normalX=-this.normalX;this.normalY=-this.normalY}}TestInstanceSegment(inst, +sx1,sy1,sx2,sy2){const t=C3.rayIntersect(this.x1,this.y1,this.x2,this.y2,sx1,sy1,sx2,sy2);if(t>=0&&tthis._loadingProgress=e.progress;this._percentText=null;this._loadingLogoAsset=null;this._splashTextures={logo:null,powered:null,website:null};this._splashFrameNumber=0;this._splashFadeInFinishTime=0;this._splashFadeOutStartTime=0;this._splashState="fade-in";this._splashDoneResolve= +null;this._splashDonePromise=new Promise(resolve=>this._splashDoneResolve=resolve)}_SetGPUPowerPreference(pref){this._gpuPreference=pref}async CreateCanvas(opts){this._canvas=opts["canvas"];this._canvas.addEventListener("webglcontextlost",e=>this._OnWebGLContextLost(e));this._canvas.addEventListener("webglcontextrestored",e=>this._OnWebGLContextRestored(e));const rendererOpts={powerPreference:this._gpuPreference,enableGpuProfiling:true};if(C3.Platform.OS==="Android"&&C3.Platform.BrowserEngine==="Chromium"&& +C3.Platform.BrowserVersionNumber<75){console.warn("[Construct 3] Disabling WebGL 2 because this device appears to be affected by crbug.com/934823. Install software updates to avoid this.");rendererOpts.maxWebGLVersion=1}if(this._runtime.GetCompositingMode()==="standard")rendererOpts.alpha=true;else{rendererOpts.alpha=false;rendererOpts.lowLatency=true}this._webglRenderer=C3.New(C3.Gfx.WebGLRenderer,this._canvas,rendererOpts);await this._webglRenderer.InitState();if(!this._webglRenderer.SupportsGPUProfiling())this._gpuLastUtilisation= +NaN;this._runtime.AddDOMComponentMessageHandler("runtime","window-resize",e=>this._OnWindowResize(e));this._runtime.AddDOMComponentMessageHandler("runtime","fullscreenchange",e=>this._OnFullscreenChange(e));this._runtime.AddDOMComponentMessageHandler("runtime","fullscreenerror",e=>this._OnFullscreenError(e));this._isDocumentFullscreen=!!opts["isFullscreen"];this.SetSize(opts["windowInnerWidth"],opts["windowInnerHeight"],true);this._shaderData=self["C3_Shaders"];await this._LoadShaderPrograms();let hasAnyBackgroundBlending= +false;for(const effectList of this._runtime._GetAllEffectLists()){for(const effectType of effectList.GetAllEffectTypes()){effectType._InitRenderer(this._webglRenderer);if(effectType.GetShaderProgram().UsesDest())hasAnyBackgroundBlending=true}effectList.UpdateActiveEffects()}this._runtime._SetUsesAnyBackgroundBlending(hasAnyBackgroundBlending);if(this._webglRenderer.SupportsGPUProfiling())this._gpuFrameTimingsBuffer=C3.New(C3.Gfx.WebGLQueryResultBuffer,this._webglRenderer);this._webglRenderer.SetMipmapsEnabled(this._enableMipmaps)}async _LoadShaderPrograms(){if(!this._shaderData)return; +const promises=[];for(const [id,data]of Object.entries(this._shaderData)){const vertexSrc=C3.Gfx.WebGLShaderProgram.GetDefaultVertexShaderSource(this._webglRenderer.Is3D());promises.push(this._webglRenderer.CreateShaderProgram(data,vertexSrc,id))}await Promise.all(promises);this._webglRenderer.ResetLastProgram();this._webglRenderer.SetTextureFillMode()}Release(){this._runtime=null;this._webglRenderer=null;this._canvas=null}_OnWindowResize(e){const dpr=e["devicePixelRatio"];if(this._runtime.IsInWorker())self.devicePixelRatio= +dpr;this._runtime._SetDevicePixelRatio(dpr);this.SetSize(e["innerWidth"],e["innerHeight"]);this._runtime.UpdateRender()}_OnFullscreenChange(e){this._isDocumentFullscreen=!!e["isFullscreen"];this.SetSize(e["innerWidth"],e["innerHeight"],true);this._runtime.UpdateRender()}_OnFullscreenError(e){this._isDocumentFullscreen=!!e["isFullscreen"];this.SetSize(e["innerWidth"],e["innerHeight"],true);this._runtime.UpdateRender()}SetSize(availableWidth,availableHeight,force=false){availableWidth=Math.floor(availableWidth); +availableHeight=Math.floor(availableHeight);if(availableWidth<=0||availableHeight<=0)throw new Error("invalid size");if(this._windowInnerWidth===availableWidth&&this._windowInnerHeight===availableHeight&&!force)return;this._windowInnerWidth=availableWidth;this._windowInnerHeight=availableHeight;const fullscreenMode=this.GetCurrentFullscreenMode();if(fullscreenMode==="letterbox-scale")this._CalculateLetterboxScale(availableWidth,availableHeight);else if(fullscreenMode==="letterbox-integer-scale")this._CalculateLetterboxIntegerScale(availableWidth, +availableHeight);else if(fullscreenMode==="off")this._CalculateFixedSizeCanvas(availableWidth,availableHeight);else this._CalculateFullsizeCanvas(availableWidth,availableHeight);this._UpdateFullscreenScalingQuality(fullscreenMode);this._canvas.width=this._canvasDeviceWidth;this._canvas.height=this._canvasDeviceHeight;this._runtime.PostComponentMessageToDOM("canvas","update-size",{"marginLeft":this._canvasCssOffsetX,"marginTop":this._canvasCssOffsetY,"styleWidth":this._canvasCssWidth,"styleHeight":this._canvasCssHeight}); +this._webglRenderer.SetSize(this._canvasDeviceWidth,this._canvasDeviceHeight,true)}_CalculateLetterboxScale(availableWidth,availableHeight){const dpr=this._runtime.GetDevicePixelRatio();const originalViewportWidth=this._runtime.GetOriginalViewportWidth();const originalViewportHeight=this._runtime.GetOriginalViewportHeight();const originalAspectRatio=originalViewportWidth/originalViewportHeight;const availableAspectRatio=availableWidth/availableHeight;if(availableAspectRatio>originalAspectRatio){const letterboxedWidth= +availableHeight*originalAspectRatio;this._canvasCssWidth=Math.round(letterboxedWidth);this._canvasCssHeight=availableHeight;this._canvasCssOffsetX=Math.floor((availableWidth-this._canvasCssWidth)/2);this._canvasCssOffsetY=0}else{const letterboxedHeight=availableWidth/originalAspectRatio;this._canvasCssWidth=availableWidth;this._canvasCssHeight=Math.round(letterboxedHeight);this._canvasCssOffsetX=0;this._canvasCssOffsetY=Math.floor((availableHeight-this._canvasCssHeight)/2)}this._canvasDeviceWidth= +Math.round(this._canvasCssWidth*dpr);this._canvasDeviceHeight=Math.round(this._canvasCssHeight*dpr);this._runtime.SetViewportSize(originalViewportWidth,originalViewportHeight)}_CalculateLetterboxIntegerScale(availableWidth,availableHeight){const dpr=this._runtime.GetDevicePixelRatio();if(dpr!==1){availableWidth+=1;availableHeight+=1}const originalViewportWidth=this._runtime.GetOriginalViewportWidth();const originalViewportHeight=this._runtime.GetOriginalViewportHeight();const originalAspectRatio= +originalViewportWidth/originalViewportHeight;const availableAspectRatio=availableWidth/availableHeight;let intScale;if(availableAspectRatio>originalAspectRatio){const letterboxedWidth=availableHeight*originalAspectRatio;intScale=letterboxedWidth*dpr/originalViewportWidth}else{const letterboxedHeight=availableWidth/originalAspectRatio;intScale=letterboxedHeight*dpr/originalViewportHeight}if(intScale>1)intScale=Math.floor(intScale);else if(intScale<1)intScale=1/Math.ceil(1/intScale);this._canvasDeviceWidth= +Math.round(originalViewportWidth*intScale);this._canvasDeviceHeight=Math.round(originalViewportHeight*intScale);this._canvasCssWidth=this._canvasDeviceWidth/dpr;this._canvasCssHeight=this._canvasDeviceHeight/dpr;this._canvasCssOffsetX=Math.max(Math.floor((availableWidth-this._canvasCssWidth)/2),0);this._canvasCssOffsetY=Math.max(Math.floor((availableHeight-this._canvasCssHeight)/2),0);this._runtime.SetViewportSize(originalViewportWidth,originalViewportHeight)}_CalculateFullsizeCanvas(availableWidth, +availableHeight){const dpr=this._runtime.GetDevicePixelRatio();this._canvasCssWidth=availableWidth;this._canvasCssHeight=availableHeight;this._canvasDeviceWidth=Math.round(this._canvasCssWidth*dpr);this._canvasDeviceHeight=Math.round(this._canvasCssHeight*dpr);this._canvasCssOffsetX=0;this._canvasCssOffsetY=0;const displayScale=this.GetDisplayScale();this._runtime.SetViewportSize(this._canvasCssWidth/displayScale,this._canvasCssHeight/displayScale)}_CalculateFixedSizeCanvas(availableWidth,availableHeight){const dpr= +this._runtime.GetDevicePixelRatio();this._canvasCssWidth=this._runtime.GetViewportWidth();this._canvasCssHeight=this._runtime.GetViewportHeight();this._canvasDeviceWidth=Math.round(this._canvasCssWidth*dpr);this._canvasDeviceHeight=Math.round(this._canvasCssHeight*dpr);if(this.IsDocumentFullscreen()){this._canvasCssOffsetX=Math.floor((availableWidth-this._canvasCssWidth)/2);this._canvasCssOffsetY=Math.floor((availableHeight-this._canvasCssHeight)/2)}else{this._canvasCssOffsetX=0;this._canvasCssOffsetY= +0}this._runtime.SetViewportSize(this._runtime.GetViewportWidth(),this._runtime.GetViewportHeight())}_UpdateFullscreenScalingQuality(fullscreenMode){if(this._wantFullscreenScalingQuality==="high"){this._drawWidth=this._canvasDeviceWidth;this._drawHeight=this._canvasDeviceHeight;this._fullscreenScalingQuality="high"}else{let viewportWidth,viewportHeight;if(this.GetCurrentFullscreenMode()==="off"){viewportWidth=this._runtime.GetViewportWidth();viewportHeight=this._runtime.GetViewportHeight()}else{viewportWidth= +this._runtime.GetOriginalViewportWidth();viewportHeight=this._runtime.GetOriginalViewportHeight()}if(this._canvasDeviceWidthoriginalAspectRatio)this._drawHeight=this._drawWidth/currentAspectRatio}else if(fullscreenMode==="scale-outer"){const originalAspectRatio=viewportWidth/viewportHeight;const currentAspectRatio=this._windowInnerWidth/this._windowInnerHeight;if(currentAspectRatio>originalAspectRatio)this._drawWidth=this._drawHeight*currentAspectRatio; +else if(currentAspectRatiooriginalAspectRatio||fullscreenMode==="scale-inner"&¤tAspectRatiort.IsCompatibleWithOptions(opts));let ret;if(useIndex!==-1){ret=arr[useIndex];arr.splice(useIndex,1)}else ret=this._webglRenderer.CreateRenderTarget(opts);this._usedAdditionalRenderTargets.add(ret);return ret}ReleaseAdditionalRenderTarget(renderTarget){if(!this._usedAdditionalRenderTargets.has(renderTarget))throw new Error("render target not in use");this._usedAdditionalRenderTargets.delete(renderTarget);this._availableAdditionalRenderTargets.push(renderTarget)}*activeLayersGpuProfiles(){for(const layout of this._runtime.GetLayoutManager().runningLayouts())for(const layer of layout.GetLayers()){const p= +this._layersGpuProfile.get(layer);if(p)yield p}}GetLayerTimingsBuffer(layer){if(!this._webglRenderer.SupportsGPUProfiling())return null;let p=this._layersGpuProfile.get(layer);if(!p){p={name:layer.GetName(),timingsBuffer:C3.New(C3.Gfx.WebGLQueryResultBuffer,this._webglRenderer),curUtilisation:0,lastUtilisation:0};this._layersGpuProfile.set(layer,p)}return p.timingsBuffer}_Update1sFrameRange(){if(!this._webglRenderer.SupportsGPUProfiling())return;if(this._gpuTimeEndFrame===0){this._gpuTimeEndFrame= +this._webglRenderer.GetFrameNumber();this._gpuCurUtilisation=NaN;for(const p of this.activeLayersGpuProfiles())p.curUtilisation=NaN}}_UpdateTick(){if(!this._webglRenderer.SupportsGPUProfiling()||!isNaN(this._gpuCurUtilisation))return;this._gpuCurUtilisation=this._gpuFrameTimingsBuffer.GetFrameRangeResultSum(this._gpuTimeStartFrame,this._gpuTimeEndFrame);if(isNaN(this._gpuCurUtilisation))return;if(this._runtime.IsDebug())for(const p of this.activeLayersGpuProfiles()){p.curUtilisation=p.timingsBuffer.GetFrameRangeResultSum(this._gpuTimeStartFrame, +this._gpuTimeEndFrame);if(isNaN(p.curUtilisation))return}this._gpuFrameTimingsBuffer.DeleteAllBeforeFrameNumber(this._gpuTimeEndFrame);this._gpuLastUtilisation=Math.min(this._gpuCurUtilisation,1);if(this._runtime.IsDebug()){for(const p of this.activeLayersGpuProfiles()){p.timingsBuffer.DeleteAllBeforeFrameNumber(this._gpuTimeEndFrame);p.lastUtilisation=Math.min(p.curUtilisation,1)}self.C3Debugger.UpdateGPUProfile(this._gpuLastUtilisation,[...this.activeLayersGpuProfiles()])}this._gpuTimeStartFrame= +this._gpuTimeEndFrame;this._gpuTimeEndFrame=0}GetGPUFrameTimingsBuffer(){return this._gpuFrameTimingsBuffer}GetGPUUtilisation(){return this._gpuLastUtilisation}SnapshotCanvas(format,quality,x,y,width,height){this._snapshotFormat=format;this._snapshotQuality=quality;this._snapshotArea.setWH(x,y,width,height);if(this._snapshotPromise)return this._snapshotPromise;this._snapshotPromise=new Promise(resolve=>{this._snapshotResolve=resolve});return this._snapshotPromise}_MaybeTakeSnapshot(){if(!this._snapshotFormat)return; +let canvas=this._canvas;const snapArea=this._snapshotArea;const x=C3.clamp(Math.floor(snapArea.getLeft()),0,canvas.width);const y=C3.clamp(Math.floor(snapArea.getTop()),0,canvas.height);let w=snapArea.width();if(w===0)w=canvas.width-x;else w=C3.clamp(Math.floor(w),0,canvas.width-x);let h=snapArea.height();if(h===0)h=canvas.height-y;else h=C3.clamp(Math.floor(h),0,canvas.height-y);if((x!==0||y!==0||w!==canvas.width||h!==canvas.height)&&(w>0&&h>0)){canvas=C3.CreateCanvas(w,h);const ctx=canvas.getContext("2d"); +ctx.drawImage(this._canvas,x,y,w,h,0,0,w,h)}C3.CanvasToBlob(canvas,this._snapshotFormat,this._snapshotQuality).then(blob=>{this._snapshotUrl=URL.createObjectURL(blob);this._snapshotPromise=null;this._snapshotResolve(this._snapshotUrl)});this._snapshotFormat="";this._snapshotQuality=1}GetCanvasSnapshotUrl(){return this._snapshotUrl}InitLoadingScreen(loaderStyle){if(loaderStyle===2){this._percentText=C3.New(C3.Gfx.RendererText,this._webglRenderer);this._percentText.SetIsAsync(false);this._percentText.SetFontName("Arial"); +this._percentText.SetFontSize(16);this._percentText.SetHorizontalAlignment("center");this._percentText.SetVerticalAlignment("center");this._percentText.SetSize(PERCENTTEXT_WIDTH,PERCENTTEXT_HEIGHT)}else if(loaderStyle===0){const loadingLogoFilename=this._runtime.GetLoadingLogoFilename();const assetManager=this._runtime.GetAssetManager();let url;if(this._runtime.IsPreview()){if(!assetManager._HasLocalUrlBlob(loadingLogoFilename))return;url=assetManager.GetLocalUrlAsBlobUrl(loadingLogoFilename)}else url= +assetManager.GetIconsSubfolder()+loadingLogoFilename;this._loadingLogoAsset=assetManager.LoadImage({url});this._loadingLogoAsset.LoadStaticTexture(this._webglRenderer).catch(err=>console.warn(`[C3 runtime] Failed to load '${loadingLogoFilename}' for loading screen. Check the project has an icon with that name.`,err))}else if(loaderStyle===4){this._LoadSvgSplashImage("splash-images/splash-logo.svg").then(tex=>{if(this._splashState==="done")this._webglRenderer.DeleteTexture(tex);else this._splashTextures.logo= +tex}).catch(err=>console.warn("Failed to load splash image: ",err));this._LoadBitmapSplashImage("splash-images/splash-poweredby-512.png").then(tex=>{if(this._splashState==="done")this._webglRenderer.DeleteTexture(tex);else this._splashTextures.powered=tex}).catch(err=>console.warn("Failed to load splash image: ",err));this._LoadBitmapSplashImage("splash-images/splash-website-512.png").then(tex=>{if(this._splashState==="done")this._webglRenderer.DeleteTexture(tex);else this._splashTextures.website= +tex}).catch(err=>console.warn("Failed to load splash image: ",err))}}async _LoadSvgSplashImage(url){url=(new URL(url,this._runtime.GetBaseURL())).toString();const blob=await C3.FetchBlob(url);const drawable=await this._runtime.RasterSvgImage(blob,2048,2048);return await this._webglRenderer.CreateStaticTextureAsync(drawable,{mipMapQuality:"high"})}async _LoadBitmapSplashImage(url){url=(new URL(url,this._runtime.GetBaseURL())).toString();const blob=await C3.FetchBlob(url);return await this._webglRenderer.CreateStaticTextureAsync(blob, +{mipMapQuality:"high"})}HideCordovaSplashScreen(){this._runtime.PostComponentMessageToDOM("runtime","hide-cordova-splash")}StartLoadingScreen(){this._loaderStartTime=Date.now();this._runtime.Dispatcher().addEventListener("loadingprogress",this._loadingprogress_handler);this._rafId=requestAnimationFrame(()=>this._DrawLoadingScreen());const loaderStyle=this._runtime.GetLoaderStyle();if(loaderStyle!==3)this.HideCordovaSplashScreen()}async EndLoadingScreen(){this._loadingProgress=1;const loaderStyle= +this._runtime.GetLoaderStyle();if(loaderStyle===4)await this._splashDonePromise;this._splashDoneResolve=null;this._splashDonePromise=null;if(this._rafId!==-1){cancelAnimationFrame(this._rafId);this._rafId=-1}this._runtime.Dispatcher().removeEventListener("loadingprogress",this._loadingprogress_handler);this._loadingprogress_handler=null;if(this._percentText){this._percentText.Release();this._percentText=null}if(this._loadingLogoAsset){this._loadingLogoAsset.Release();this._loadingLogoAsset=null}this._webglRenderer.Start(); +if(this._splashTextures.logo){this._webglRenderer.DeleteTexture(this._splashTextures.logo);this._splashTextures.logo=null}if(this._splashTextures.powered){this._webglRenderer.DeleteTexture(this._splashTextures.powered);this._splashTextures.powered=null}if(this._splashTextures.website){this._webglRenderer.DeleteTexture(this._splashTextures.website);this._splashTextures.website=null}this._webglRenderer.ClearRgba(0,0,0,0);this._webglRenderer.Finish();this._splashState="done";this._gpuTimeStartFrame= +this._webglRenderer.GetFrameNumber();if(loaderStyle===3)this.HideCordovaSplashScreen()}_DrawLoadingScreen(){if(this._rafId===-1)return;const renderer=this._webglRenderer;renderer.Start();this._rafId=-1;const hasHadError=this._runtime.GetAssetManager().HasHadErrorLoading();const loaderStyle=this._runtime.GetLoaderStyle();if(loaderStyle!==3){this.SetCssTransform(renderer);renderer.ClearRgba(0,0,0,0);renderer.ResetColor();renderer.SetTextureFillMode();renderer.SetTexture(null)}if(loaderStyle===0)this._DrawProgressBarAndLogoLoadingScreen(hasHadError); +else if(loaderStyle===1)this._DrawProgressBarLoadingScreen(hasHadError,PROGRESSBAR_WIDTH,0);else if(loaderStyle===2)this._DrawPercentTextLoadingScreen(hasHadError);else if(loaderStyle===3)C3.noop();else if(loaderStyle===4)this._DrawSplashLoadingScreen(hasHadError);else throw new Error("invalid loader style");renderer.Finish();this._rafId=requestAnimationFrame(()=>this._DrawLoadingScreen())}_DrawPercentTextLoadingScreen(hasHadError){if(hasHadError)this._percentText.SetColorRgb(1,0,0);else this._percentText.SetColorRgb(.6, +.6,.6);this._percentText.SetText(Math.round(this._loadingProgress*100)+"%");const midX=this._canvasCssWidth/2;const midY=this._canvasCssHeight/2;const hw=PERCENTTEXT_WIDTH/2;const hh=PERCENTTEXT_HEIGHT/2;tempQuad.setRect(midX-hw,midY-hh,midX+hw,midY+hh);this._webglRenderer.SetTexture(this._percentText.GetTexture());this._webglRenderer.Quad3(tempQuad,this._percentText.GetTexRect())}_DrawProgressBarLoadingScreen(hasHadError,width,yOff){const renderer=this._webglRenderer;const height=PROGRESSBAR_HEIGHT; +renderer.SetColorFillMode();if(hasHadError)renderer.SetColorRgba(1,0,0,1);else renderer.SetColorRgba(.118,.565,1,1);const midX=this._canvasCssWidth/2;const midY=this._canvasCssHeight/2;const hw=width/2;const hh=height/2;tempRect.setWH(midX-hw,midY-hh+yOff,Math.floor(width*this._loadingProgress),height);renderer.Rect(tempRect);tempRect.setWH(midX-hw,midY-hh+yOff,width,height);tempRect.offset(-.5,-.5);tempRect.inflate(.5,.5);renderer.SetColorRgba(0,0,0,1);renderer.LineRect2(tempRect);tempRect.inflate(1, +1);renderer.SetColorRgba(1,1,1,1);renderer.LineRect2(tempRect)}_DrawProgressBarAndLogoLoadingScreen(hasHadError){if(!this._loadingLogoAsset){this._DrawProgressBarLoadingScreen(hasHadError,PROGRESSBAR_WIDTH,0);return}const logoTexture=this._loadingLogoAsset.GetTexture();if(!logoTexture){this._DrawProgressBarLoadingScreen(hasHadError,PROGRESSBAR_WIDTH,0);return}const logoW=logoTexture.GetWidth();const logoH=logoTexture.GetHeight();const midX=this._canvasCssWidth/2;const midY=this._canvasCssHeight/2; +const hw=logoW/2;const hh=logoH/2;tempQuad.setRect(midX-hw,midY-hh,midX+hw,midY+hh);this._webglRenderer.SetTexture(logoTexture);this._webglRenderer.Quad(tempQuad);this._DrawProgressBarLoadingScreen(hasHadError,logoW,hh+16)}_DrawSplashLoadingScreen(hasHadError){const renderer=this._webglRenderer;const logoTex=this._splashTextures.logo;const poweredTex=this._splashTextures.powered;const websiteTex=this._splashTextures.website;const nowTime=Date.now();if(this._splashFrameNumber===0)this._loaderStartTime= +nowTime;const allowQuickSplash=this._runtime.IsPreview()||this._runtime.IsFBInstantAvailable()&&!this._runtime.IsCordova();const splashAfterFadeOutWait=allowQuickSplash?0:SPLASH_AFTER_FADEOUT_WAIT_TIME;const splashMinDisplayTime=allowQuickSplash?0:SPLASH_MIN_DISPLAY_TIME;let a=1;if(this._splashState==="fade-in")a=Math.min((nowTime-this._loaderStartTime)/SPLASH_FADE_DURATION,1);else if(this._splashState==="fade-out")a=Math.max(1-(nowTime-this._splashFadeOutStartTime)/SPLASH_FADE_DURATION,0);renderer.SetColorFillMode(); +renderer.SetColorRgba(.231*a,.251*a,.271*a,a);tempRect.set(0,0,this._canvasCssWidth,this._canvasCssHeight);renderer.Rect(tempRect);const w=Math.ceil(this._canvasCssWidth);const h=Math.ceil(this._canvasCssHeight);let drawW,drawH;if(this._canvasCssHeight>256){renderer.SetColorRgba(.302*a,.334*a,.365*a,a);drawW=w;drawH=Math.max(h*.005,2);tempRect.setWH(0,h*.8-drawH/2,drawW,drawH);renderer.Rect(tempRect);if(hasHadError)renderer.SetColorRgba(a,0,0,a);else renderer.SetColorRgba(.161*a,.953*a,.816*a,a); +drawW=w*this._loadingProgress;tempRect.setWH(w*.5-drawW/2,h*.8-drawH/2,drawW,drawH);renderer.Rect(tempRect);renderer.SetColorRgba(a,a,a,a);renderer.SetTextureFillMode();if(poweredTex){drawW=C3.clamp(h*.22,105,w*.6)*1.5;drawH=drawW/8;tempRect.setWH(w*.5-drawW/2,h*.2-drawH/2,drawW,drawH);renderer.SetTexture(poweredTex);renderer.Rect(tempRect)}if(logoTex){drawW=Math.min(h*.395,w*.95);drawH=drawW;tempRect.setWH(w*.5-drawW/2,h*.485-drawH/2,drawW,drawH);renderer.SetTexture(logoTex);renderer.Rect(tempRect)}if(websiteTex){drawW= +C3.clamp(h*.22,105,w*.6)*1.5;drawH=drawW/8;tempRect.setWH(w*.5-drawW/2,h*.868-drawH/2,drawW,drawH);renderer.SetTexture(websiteTex);renderer.Rect(tempRect)}}else{renderer.SetColorRgba(.302*a,.334*a,.365*a,a);drawW=w;drawH=Math.max(h*.005,2);tempRect.setWH(0,h*.85-drawH/2,drawW,drawH);renderer.Rect(tempRect);if(hasHadError)renderer.SetColorRgba(a,0,0,a);else renderer.SetColorRgba(.161*a,.953*a,.816*a,a);drawW=w*this._loadingProgress;tempRect.setWH(w*.5-drawW/2,h*.85-drawH/2,drawW,drawH);renderer.Rect(tempRect); +renderer.SetColorRgba(a,a,a,a);renderer.SetTextureFillMode();if(logoTex){drawW=h*.55;drawH=drawW;tempRect.setWH(w*.5-drawW/2,h*.45-drawH/2,drawW,drawH);renderer.SetTexture(logoTex);renderer.Rect(tempRect)}}this._splashFrameNumber++;if(this._splashState==="fade-in"&&nowTime-this._loaderStartTime>=SPLASH_FADE_DURATION&&this._splashFrameNumber>=2){this._splashState="wait";this._splashFadeInFinishTime=nowTime}if(this._splashState==="wait"&&nowTime-this._splashFadeInFinishTime>=splashMinDisplayTime&&this._loadingProgress>= +1){this._splashState="fade-out";this._splashFadeOutStartTime=nowTime}if(this._splashState==="fade-out"&&nowTime-this._splashFadeOutStartTime>=SPLASH_FADE_DURATION+splashAfterFadeOutWait||allowQuickSplash&&this._loadingProgress>=1&&nowTime-this._loaderStartTime<500)this._splashDoneResolve()}}}; + + +// c3/runtime.js +'use strict';{const C3=self.C3;const C3Debugger=self.C3Debugger;const assert=self.assert;const DEFAULT_RUNTIME_OPTS={"messagePort":null,"baseUrl":"","headless":false,"hasDom":true,"isInWorker":false,"useAudio":true,"projectData":"","exportType":""};let ife=true;C3.Runtime=class C3Runtime extends C3.DefendedBase{constructor(opts){opts=Object.assign({},DEFAULT_RUNTIME_OPTS,opts);super();this._messagePort=opts["messagePort"];this._baseUrl=opts["baseUrl"];this._isHeadless=!!opts["headless"];this._hasDom= +!!opts["hasDom"];this._isInWorker=!!opts["isInWorker"];ife=opts["ife"];this._useAudio=!!opts["useAudio"];this._exportType=opts["exportType"];this._isiOSCordova=!!opts["isiOSCordova"];this._isiOSWebView=!!opts["isiOSWebView"];this._isFBInstantAvailable=!!opts["isFBInstantAvailable"];this._opusWasmScriptUrl=opts["opusWasmScriptUrl"];this._opusWasmBinaryUrl=opts["opusWasmBinaryUrl"];this._isDebug=!!(this._exportType==="preview"&&opts["isDebug"]);this._breakpointsEnabled=this._isDebug;this._isDebugging= +this._isDebug;this._debuggingDisabled=0;this._additionalLoadPromises=[];this._additionalCreatePromises=[];this._isUsingCreatePromises=false;this._projectName="";this._projectVersion="";this._projectUniqueId="";this._appId="";this._originalViewportWidth=0;this._originalViewportHeight=0;this._devicePixelRatio=self.devicePixelRatio;this._parallaxXorigin=0;this._parallaxYorigin=0;this._viewportWidth=0;this._viewportHeight=0;this._loaderStyle=0;this._usesLoaderLayout=false;this._isLoading=true;this._usesAnyBackgroundBlending= +false;this._loadingLogoFilename="loading-logo.png";this._assetManager=C3.New(C3.AssetManager,this,opts);this._layoutManager=C3.New(C3.LayoutManager,this);this._eventSheetManager=C3.New(C3.EventSheetManager,this);this._pluginManager=C3.New(C3.PluginManager,this);this._collisionEngine=C3.New(C3.CollisionEngine,this);this._timelineManager=C3.New(C3.TimelineManager,this);this._transitionManager=C3.New(C3.TransitionManager,this);this._allObjectClasses=[];this._objectClassesByName=new Map;this._objectClassesBySid= +new Map;this._familyCount=0;this._allContainers=[];this._allEffectLists=[];this._currentLayoutStack=[];this._instancesPendingCreate=[];this._instancesPendingDestroy=new Map;this._hasPendingInstances=false;this._isFlushingPendingInstances=false;this._objectCount=0;this._nextUid=0;this._instancesByUid=new Map;this._instancesToReleaseAtEndOfTick=new Set;this._instancesToReleaseAffectedObjectClasses=new Set;this._objectReferenceTable=[];this._jsPropNameTable=[];this._canvasManager=null;this._framerateMode= +"vsync";this._compositingMode="standard";this._sampling="trilinear";this._isPixelRoundingEnabled=false;this._needRender=true;this._pauseOnBlur=false;this._isPausedOnBlur=false;this._tickCallbacks={normal:timestamp=>{this._rafId=-1;this._ruafId=-1;this.Tick(timestamp)},tickOnly:timestamp=>{this._ruafId=-1;this.Tick(timestamp,false,"skip-render")},renderOnly:()=>{this._rafId=-1;this.Render()}};this._rafId=-1;this._ruafId=-1;this._tickCount=0;this._tickCountNoSave=0;this._execCount=0;this._hasStarted= +false;this._isInTick=false;this._hasStartedTicking=false;this._isLayoutFirstTick=true;this._suspendCount=0;this._scheduleTriggersThrottle=new C3.PromiseThrottle(1);this._randomNumberCallback=()=>Math.random();this._startTime=0;this._lastTickTime=0;this._dt1=0;this._dt=0;this._timeScale=1;this._minimumFramerate=30;this._gameTime=C3.New(C3.KahanSum);this._wallTime=C3.New(C3.KahanSum);this._fpsFrameCount=-1;this._fpsLastTime=0;this._fps=0;this._mainThreadTimeCounter=0;this._mainThreadTime=0;this._isLoadingState= +false;this._saveToSlotName="";this._loadFromSlotName="";this._loadFromJson=null;this._lastSaveJson="";this._projectStorage=null;this._savegamesStorage=null;this._dispatcher=C3.New(C3.Event.Dispatcher);this._domEventHandlers=new Map;this._pendingResponsePromises=new Map;this._nextDomResponseId=0;this._didRequestDeviceOrientationEvent=false;this._didRequestDeviceMotionEvent=false;this._isReadyToHandleEvents=false;this._waitingToHandleEvents=[];this._eventObjects={"pretick":C3.New(C3.Event,"pretick", +false),"tick":C3.New(C3.Event,"tick",false),"tick2":C3.New(C3.Event,"tick2",false),"instancedestroy":C3.New(C3.Event,"instancedestroy",false),"beforelayoutchange":C3.New(C3.Event,"beforelayoutchange",false),"layoutchange":C3.New(C3.Event,"layoutchange",false)};this._eventObjects["instancedestroy"].instance=null;this._userScriptDispatcher=C3.New(C3.Event.Dispatcher);this._userScriptEventObjects=null;this._behInstsToTick=C3.New(C3.RedBlackSet,C3.BehaviorInstance.SortByTickSequence);this._behInstsToPostTick= +C3.New(C3.RedBlackSet,C3.BehaviorInstance.SortByTickSequence);this._behInstsToTick2=C3.New(C3.RedBlackSet,C3.BehaviorInstance.SortByTickSequence);this._jobScheduler=C3.New(C3.JobSchedulerRuntime,this,opts["jobScheduler"]);if(opts["canvas"])this._canvasManager=C3.New(C3.CanvasManager,this);this._messagePort.onmessage=e=>this["_OnMessageFromDOM"](e.data);this.AddDOMComponentMessageHandler("runtime","visibilitychange",e=>this._OnVisibilityChange(e));this.AddDOMComponentMessageHandler("runtime","opus-decode", +e=>this._WasmDecodeWebMOpus(e["arrayBuffer"]));this.AddDOMComponentMessageHandler("runtime","get-remote-preview-status-info",()=>this._GetRemotePreviewStatusInfo());this.AddDOMComponentMessageHandler("runtime","js-invoke-function",e=>this._InvokeFunctionFromJS(e));this.AddDOMComponentMessageHandler("runtime","go-to-last-error-script",self["goToLastErrorScript"]);this._dispatcher.addEventListener("window-blur",e=>this._OnWindowBlur(e));this._dispatcher.addEventListener("window-focus",()=>this._OnWindowFocus()); +this._timelineManager.AddRuntimeListeners();this._iRuntime=null;this._interfaceMap=new WeakMap;this._commonScriptInterfaces={keyboard:null,mouse:null,touch:null}}static Create(opts){return C3.New(C3.Runtime,opts)}Release(){C3.clearArray(this._allObjectClasses);this._objectClassesByName.clear();this._objectClassesBySid.clear();this._layoutManager.Release();this._layoutManager=null;this._eventSheetManager.Release();this._eventSheetManager=null;this._pluginManager.Release();this._pluginManager=null; +this._assetManager.Release();this._assetManager=null;this._collisionEngine.Release();this._collisionEngine=null;this._timelineManager.Release();this._timelineManager=null;this._transitionManager.Release();this._transitionManager=null;if(this._canvasManager){this._canvasManager.Release();this._canvasManager=null}this._dispatcher.Release();this._dispatcher=null;this._tickEvent=null}["_OnMessageFromDOM"](data){const type=data["type"];if(type==="event")this._OnEventFromDOM(data);else if(type==="result")this._OnResultFromDOM(data); +else throw new Error(`unknown message '${type}'`);}_OnEventFromDOM(e){if(!this._isReadyToHandleEvents){this._waitingToHandleEvents.push(e);return}const component=e["component"];const handler=e["handler"];const data=e["data"];const dispatchOpts=e["dispatchOpts"];const dispatchRuntimeEvent=!!(dispatchOpts&&dispatchOpts["dispatchRuntimeEvent"]);const dispatchUserScriptEvent=!!(dispatchOpts&&dispatchOpts["dispatchUserScriptEvent"]);const responseId=e["responseId"];if(component==="runtime"){if(dispatchRuntimeEvent){const event= +new C3.Event(handler);event.data=data;this._dispatcher.dispatchEventAndWaitAsyncSequential(event)}if(dispatchUserScriptEvent){const event=new C3.Event(handler,true);for(const [key,value]of Object.entries(data))event[key]=value;this.DispatchUserScriptEvent(event)}}const handlerMap=this._domEventHandlers.get(component);if(!handlerMap){if(!dispatchRuntimeEvent&&!dispatchUserScriptEvent)console.warn(`[Runtime] No DOM event handlers for component '${component}'`);return}const func=handlerMap.get(handler); +if(!func){if(!dispatchRuntimeEvent&&!dispatchUserScriptEvent)console.warn(`[Runtime] No DOM handler '${handler}' for component '${component}'`);return}let ret=null;try{ret=func(data)}catch(err){console.error(`Exception in '${component}' handler '${handler}':`,err);if(responseId!==null)this._PostResultToDOM(responseId,false,""+err);return}if(responseId!==null)if(ret&&ret.then)ret.then(result=>this._PostResultToDOM(responseId,true,result)).catch(err=>{console.error(`Rejection from '${component}' handler '${handler}':`, +err);this._PostResultToDOM(responseId,false,""+err)});else this._PostResultToDOM(responseId,true,ret)}_PostResultToDOM(responseId,isOk,result){this._messagePort.postMessage({"type":"result","responseId":responseId,"isOk":isOk,"result":result})}_OnResultFromDOM(data){const responseId=data["responseId"];const isOk=data["isOk"];const result=data["result"];const pendingPromise=this._pendingResponsePromises.get(responseId);if(isOk)pendingPromise.resolve(result);else pendingPromise.reject(result);this._pendingResponsePromises.delete(responseId)}AddDOMComponentMessageHandler(component, +handler,func){let handlerMap=this._domEventHandlers.get(component);if(!handlerMap){handlerMap=new Map;this._domEventHandlers.set(component,handlerMap)}if(handlerMap.has(handler))throw new Error(`[Runtime] Component '${component}' already has handler '${handler}'`);handlerMap.set(handler,func)}PostComponentMessageToDOM(component,handler,data){this._messagePort.postMessage({"type":"event","component":component,"handler":handler,"data":data,"responseId":null})}PostComponentMessageToDOMAsync(component, +handler,data){const responseId=this._nextDomResponseId++;const ret=new Promise((resolve,reject)=>{this._pendingResponsePromises.set(responseId,{resolve,reject})});this._messagePort.postMessage({"type":"event","component":component,"handler":handler,"data":data,"responseId":responseId});return ret}PostToDebugger(data){if(!this.IsDebug())throw new Error("not in debug mode");this.PostComponentMessageToDOM("runtime","post-to-debugger",data)}async Init(opts){if(this.IsDebug())await C3Debugger.Init(this); +else if(self.C3Debugger)self.C3Debugger.InitPreview(this);const [o]=await Promise.all([this._assetManager.FetchJson("data.json"),this._MaybeLoadOpusDecoder(),this._jobScheduler.Init()]);this._LoadDataJson(o);await this._InitialiseCanvas(opts);if(!this.IsPreview())console.info("Made with Construct 3, the game and app creator :: https://www.construct.net");const webglRenderer=this.GetWebGLRenderer();console.info(`[C3 runtime] Hosted in ${this.IsInWorker()?"worker":"DOM"}, using ${this._assetManager.GetScriptsType()} scripts, rendering with WebGL ${webglRenderer.GetWebGLVersionNumber()} [${webglRenderer.GetUnmaskedRenderer()}] (${webglRenderer.IsDesynchronized()? +"desynchronized":"standard"} compositing)`);if(webglRenderer.HasMajorPerformanceCaveat())console.warn("[C3 runtime] WebGL indicates a major performance caveat. Software rendering may be in use. This can result in significantly degraded performance.");this._isReadyToHandleEvents=true;for(const e of this._waitingToHandleEvents)this._OnEventFromDOM(e);C3.clearArray(this._waitingToHandleEvents);if(this._canvasManager)this._canvasManager.StartLoadingScreen();for(const f of opts["runOnStartupFunctions"])this._additionalLoadPromises.push(this._RunOnStartupFunction(f)); +await Promise.all([this._assetManager.WaitForAllToLoad(),...this._additionalLoadPromises]);C3.clearArray(this._additionalLoadPromises);if(this._assetManager.HasHadErrorLoading()){if(this._canvasManager)this._canvasManager.HideCordovaSplashScreen();return}if(this._canvasManager)await this._canvasManager.EndLoadingScreen();await this._dispatcher.dispatchEventAndWaitAsync(new C3.Event("beforeruntimestart"));await this.Start();this._messagePort.postMessage({"type":"runtime-ready"});return this}async _RunOnStartupFunction(f){try{await f(this._iRuntime)}catch(err){console.error("[C3 runtime] Error in runOnStartup function: ", +err)}}_LoadDataJson(o){const projectData=o["project"];this._projectName=projectData[0];this._projectVersion=projectData[16];this._projectUniqueId=projectData[31];this._appId=projectData[38];this._loadingLogoFilename=projectData[39];this._isPixelRoundingEnabled=!!projectData[9];this._originalViewportWidth=this._viewportWidth=projectData[10];this._originalViewportHeight=this._viewportHeight=projectData[11];this._parallaxXorigin=this._originalViewportWidth/2;this._parallaxYorigin=this._originalViewportHeight/ +2;this._compositingMode=projectData[36];this._framerateMode=projectData[37];if(this._compositingMode==="low-latency"&&this.IsAndroidWebView()&&C3.Platform.BrowserVersionNumber<=77){console.warn("[C3 runtime] Desynchronized (low-latency) compositing is enabled, but is disabled in the Android WebView <=77 due to crbug.com/1008842. Reverting to synchronized (standard) compositing.");this._compositingMode="standard"}this._sampling=projectData[14];this._usesLoaderLayout=!!projectData[18];this._loaderStyle= +projectData[19];this._nextUid=projectData[21];this._pauseOnBlur=projectData[22];this._assetManager._SetAudioFiles(projectData[7],projectData[25]);this._assetManager._SetMediaSubfolder(projectData[8]);this._assetManager._SetFontsSubfolder(projectData[32]);this._assetManager._SetIconsSubfolder(projectData[28]);this._assetManager._SetWebFonts(projectData[29]);if(this._canvasManager){this._canvasManager.SetFullscreenMode(C3.CanvasManager._FullscreenModeNumberToString(projectData[12]));this._canvasManager.SetFullscreenScalingQuality(projectData[23]? +"high":"low");this._canvasManager.SetMipmapsEnabled(projectData[24]!==0);this._canvasManager._SetGPUPowerPreference(projectData[34])}this._pluginManager.CreateSystemPlugin();this._objectReferenceTable=self.C3_GetObjectRefTable();for(const pluginData of projectData[2])this._pluginManager.CreatePlugin(pluginData);this._objectReferenceTable=self.C3_GetObjectRefTable();this._LoadJsPropNameTable();for(const objectClassData of projectData[3]){const objectClass=C3.ObjectClass.Create(this,this._allObjectClasses.length, +objectClassData);this._allObjectClasses.push(objectClass);this._objectClassesByName.set(objectClass.GetName().toLowerCase(),objectClass);this._objectClassesBySid.set(objectClass.GetSID(),objectClass)}for(const familyData of projectData[4]){const familyType=this._allObjectClasses[familyData[0]];familyType._LoadFamily(familyData)}for(const containerData of projectData[27]){const containerTypes=containerData.map(index=>this._allObjectClasses[index]);this._allContainers.push(C3.New(C3.Container,this, +containerTypes))}for(const objectClass of this._allObjectClasses)objectClass._OnAfterCreate();for(const layoutData of projectData[5])this._layoutManager.Create(layoutData);const firstLayoutName=projectData[1];if(firstLayoutName){const firstLayout=this._layoutManager.GetLayoutByName(firstLayoutName);if(firstLayout)this._layoutManager.SetFirstLayout(firstLayout)}for(const timelineData of projectData[33])this._timelineManager.Create(timelineData);for(const transitionData of projectData[35])this._transitionManager.Create(transitionData); +this._InitScriptInterfaces();for(const eventSheetData of projectData[6])this._eventSheetManager.Create(eventSheetData);this._eventSheetManager._PostInit();this._InitGlobalVariableScriptInterface();C3.clearArray(this._objectReferenceTable);this.FlushPendingInstances();let targetOrientation="any";const orientations=projectData[20];if(orientations===1)targetOrientation="portrait";else if(orientations===2)targetOrientation="landscape";this.PostComponentMessageToDOM("runtime","set-target-orientation", +{"targetOrientation":targetOrientation})}GetLoaderStyle(){return this._loaderStyle}IsFBInstantAvailable(){return this._isFBInstantAvailable}IsLoading(){return this._isLoading}AddLoadPromise(promise){this._additionalLoadPromises.push(promise)}SetUsingCreatePromises(e){this._isUsingCreatePromises=!!e}AddCreatePromise(promise){if(!this._isUsingCreatePromises)return;this._additionalCreatePromises.push(promise)}GetCreatePromises(){return this._additionalCreatePromises}_GetNextFamilyIndex(){return this._familyCount++}GetFamilyCount(){return this._familyCount}_AddEffectList(el){this._allEffectLists.push(el)}_GetAllEffectLists(){return this._allEffectLists}async _InitialiseCanvas(opts){if(!this._canvasManager)return; +await this._canvasManager.CreateCanvas(opts);this._canvasManager.InitLoadingScreen(this._loaderStyle)}async _MaybeLoadOpusDecoder(){if(this._assetManager.IsAudioFormatSupported("audio/webm; codecs=opus"))return;let wasmBlob=null;let wasmBuffer=null;try{if(this.IsiOSCordova()&&location.protocol==="file:")wasmBuffer=await this._assetManager.CordovaFetchLocalFileAsArrayBuffer(this._opusWasmBinaryUrl);else wasmBlob=await this._assetManager.FetchBlob(this._opusWasmBinaryUrl)}catch(err){console.info("Failed to fetch Opus decoder WASM; assuming project has no Opus audio.", +err);return}if(wasmBuffer)this.AddJobWorkerBuffer(wasmBuffer,"opus-decoder-wasm");else this.AddJobWorkerBlob(wasmBlob,"opus-decoder-wasm");await this.AddJobWorkerScripts([this._opusWasmScriptUrl])}async _WasmDecodeWebMOpus(arrayBuffer){const result=await this.AddJob("OpusDecode",{"arrayBuffer":arrayBuffer},[arrayBuffer]);return result}async Start(){this._hasStarted=true;this._startTime=Date.now();if(this._usesLoaderLayout){for(const objectClass of this._allObjectClasses)if(!objectClass.IsFamily()&& +!objectClass.IsOnLoaderLayout()&&objectClass.IsWorldType())objectClass.OnCreate();this._assetManager.WaitForAllToLoad().then(()=>{this._isLoading=false;this._OnLoadFinished()})}else this._isLoading=false;this._assetManager.SetInitialLoadFinished();if(this.IsDebug())C3Debugger.RuntimeInit(ife);for(const layout of this._layoutManager.GetAllLayouts())layout._CreateGlobalNonWorlds();const firstLayout=this._layoutManager.GetFirstLayout();await firstLayout._Load(null,this.GetWebGLRenderer());await firstLayout._StartRunning(true); +this._fpsLastTime=performance.now();if(!this._usesLoaderLayout)this._OnLoadFinished();const state=await this.PostComponentMessageToDOMAsync("runtime","before-start-ticking");if(state["isSuspended"])this._suspendCount++;else this.Tick()}_OnLoadFinished(){this.Trigger(C3.Plugins.System.Cnds.OnLoadFinished,null,null);this.PostComponentMessageToDOM("runtime","register-sw")}GetObjectReference(index){index=Math.floor(index);const objRefTable=this._objectReferenceTable;if(index<0||index>=objRefTable.length)throw new Error("invalid object reference"); +return objRefTable[index]}_LoadJsPropNameTable(){for(const entry of self.C3_JsPropNameTable){const propName=C3.first(Object.keys(entry));this._jsPropNameTable.push(propName)}}GetJsPropName(index){index=Math.floor(index);const jsPropNameTable=this._jsPropNameTable;if(index<0||index>=jsPropNameTable.length)throw new Error("invalid prop reference");return jsPropNameTable[index]}HasDOM(){return this._hasDom}IsHeadless(){return this._isHeadless}IsInWorker(){return this._isInWorker}GetBaseURL(){return this._baseUrl}GetEventSheetManager(){return this._eventSheetManager}GetEventStack(){return this._eventSheetManager.GetEventStack()}GetCurrentEventStackFrame(){return this._eventSheetManager.GetCurrentEventStackFrame()}GetCurrentEvent(){return this._eventSheetManager.GetCurrentEvent()}GetCurrentCondition(){return this._eventSheetManager.GetCurrentCondition()}IsCurrentConditionFirst(){return this.GetCurrentEventStackFrame().GetConditionIndex()=== +0}GetCurrentAction(){return this._eventSheetManager.GetCurrentAction()}GetPluginManager(){return this._pluginManager}GetSystemPlugin(){return this._pluginManager.GetSystemPlugin()}GetObjectClassByIndex(i){i=Math.floor(i);if(i<0||i>=this._allObjectClasses.length)throw new RangeError("invalid index");return this._allObjectClasses[i]}GetObjectClassByName(name){return this._objectClassesByName.get(name.toLowerCase())||null}GetObjectClassBySID(sid){return this._objectClassesBySid.get(sid)||null}GetSingleGlobalObjectClassByCtor(ctor){const plugin= +this._pluginManager.GetPluginByConstructorFunction(ctor);if(!plugin)return null;return plugin.GetSingleGlobalObjectClass()}GetAllObjectClasses(){return this._allObjectClasses}Dispatcher(){return this._dispatcher}UserScriptDispatcher(){return this._userScriptDispatcher}DispatchUserScriptEvent(e){e.runtime=this.GetIRuntime();const shouldTime=this.IsDebug()&&!this._eventSheetManager.IsInEventEngine();if(shouldTime)C3Debugger.StartMeasuringScriptTime();this._userScriptDispatcher.dispatchEvent(e);if(shouldTime)C3Debugger.AddScriptTime()}DispatchUserScriptEventAsyncWait(e){e.runtime= +this.GetIRuntime();return this._userScriptDispatcher.dispatchEventAndWaitAsync(e)}GetOriginalViewportWidth(){return this._originalViewportWidth}GetOriginalViewportHeight(){return this._originalViewportHeight}SetOriginalViewportSize(w,h){this._originalViewportWidth=w;this._originalViewportHeight=h}GetViewportWidth(){return this._viewportWidth}GetViewportHeight(){return this._viewportHeight}SetViewportSize(w,h){this._viewportWidth=w;this._viewportHeight=h}_SetDevicePixelRatio(r){this._devicePixelRatio= +r}GetDevicePixelRatio(){return this._devicePixelRatio}GetParallaxXOrigin(){return this._parallaxXorigin}GetParallaxYOrigin(){return this._parallaxYorigin}GetCanvasManager(){return this._canvasManager}GetDrawWidth(){if(!this._canvasManager)return this._viewportWidth;return this._canvasManager.GetDrawWidth()}GetDrawHeight(){if(!this._canvasManager)return this._viewportHeight;return this._canvasManager.GetDrawHeight()}GetRenderScale(){if(!this._canvasManager)return 1;return this._canvasManager.GetRenderScale()}GetDisplayScale(){if(!this._canvasManager)return 1; +return this._canvasManager.GetDisplayScale()}GetCanvasClientX(){if(!this._canvasManager)return 0;return this._canvasManager.GetCanvasClientX()}GetCanvasClientY(){if(!this._canvasManager)return 0;return this._canvasManager.GetCanvasClientY()}GetCanvasCssWidth(){if(!this._canvasManager)return 0;return this._canvasManager.GetCssWidth()}GetCanvasCssHeight(){if(!this._canvasManager)return 0;return this._canvasManager.GetCssHeight()}GetFullscreenMode(){if(!this._canvasManager)return"off";return this._canvasManager.GetFullscreenMode()}GetAdditionalRenderTarget(opts){if(!this._canvasManager)return null; +return this._canvasManager.GetAdditionalRenderTarget(opts)}ReleaseAdditionalRenderTarget(renderTarget){if(!this._canvasManager)return;this._canvasManager.ReleaseAdditionalRenderTarget(renderTarget)}_SetUsesAnyBackgroundBlending(u){this._usesAnyBackgroundBlending=!!u}UsesAnyBackgroundBlending(){return this._usesAnyBackgroundBlending}GetGPUUtilisation(){if(!this._canvasManager)return NaN;return this._canvasManager.GetGPUUtilisation()}IsLinearSampling(){return this.GetSampling()!=="nearest"}GetFramerateMode(){return this._framerateMode}GetCompositingMode(){return this._compositingMode}GetSampling(){return this._sampling}UsesLoaderLayout(){return this._usesLoaderLayout}GetLoadingLogoFilename(){return this._loadingLogoFilename}GetLayoutManager(){return this._layoutManager}GetMainRunningLayout(){return this._layoutManager.GetMainRunningLayout()}GetTimelineManager(){return this._timelineManager}GetTransitionManager(){return this._transitionManager}GetAssetManager(){return this._assetManager}LoadImage(opts){return this._assetManager.LoadImage(opts)}CreateInstance(objectClass, +layer,x,y,createHierarchy){return this.CreateInstanceFromData(objectClass,layer,false,x,y,false,createHierarchy)}CreateInstanceFromData(instData_or_objectClass,layer,isStartupInstance,x,y,skipSiblings,createHierarchy){let instData=null;let objectClass=null;if(instData_or_objectClass instanceof C3.ObjectClass){objectClass=instData_or_objectClass;if(objectClass.IsFamily()){const members=objectClass.GetFamilyMembers();const i=Math.floor(this.Random()*members.length);objectClass=members[i]}instData=objectClass.GetDefaultInstanceData()}else{instData= +instData_or_objectClass;objectClass=this.GetObjectClassByIndex(instData[1])}const isWorld=objectClass.GetPlugin().IsWorldType();if(this._isLoading&&isWorld&&!objectClass.IsOnLoaderLayout())return null;const originalLayer=layer;if(!isWorld)layer=null;let uid;if(isStartupInstance&&!skipSiblings&&instData&&!this._instancesByUid.has(instData[2]))uid=instData[2];else uid=this._nextUid++;const worldData=instData?instData[0]:null;const inst=C3.New(C3.Instance,{runtime:this,objectType:objectClass,layer:layer, +worldData,instVarData:instData?instData[3]:null,uid:uid});this._instancesByUid.set(uid,inst);let wi=null;if(isWorld){wi=inst.GetWorldInfo();if(typeof x!=="undefined"&&typeof y!=="undefined"){wi.SetX(x);wi.SetY(y)}objectClass._SetAnyCollisionCellChanged(true)}if(layer){if(!createHierarchy)layer._AddInstance(inst,true);if(layer.GetParallaxX()!==1||layer.GetParallaxY()!==1)objectClass._SetAnyInstanceParallaxed(true);layer.GetLayout().MaybeLoadTexturesFor(objectClass)}this._objectCount++;if(objectClass.IsInContainer()&& +!isStartupInstance&&!skipSiblings){for(const containerType of objectClass.GetContainer().objectTypes()){if(containerType===objectClass)continue;const siblingInst=this.CreateInstanceFromData(containerType,originalLayer,false,wi?wi.GetX():x,wi?wi.GetY():y,true,false);inst._AddSibling(siblingInst)}for(const s of inst.siblings()){s._AddSibling(inst);for(const s2 of inst.siblings())if(s!==s2)s._AddSibling(s2)}}if(isWorld&&!isStartupInstance&&!!createHierarchy)this._CreateChildInstancesFromData(inst,worldData, +wi,layer,x,y);if(objectClass.IsInContainer()&&!isStartupInstance&&!skipSiblings&&!!createHierarchy)for(const sibling of inst.siblings()){const swi=sibling.GetWorldInfo();const sWorldData=sibling.GetObjectClass().GetDefaultInstanceData()[0];this._CreateChildInstancesFromData(sibling,sWorldData,swi,layer,swi.GetX(),swi.GetY())}if(!skipSiblings&&!!createHierarchy){if(typeof x==="undefined")x=worldData[0];if(typeof y==="undefined")y=worldData[1];const pwi=wi.GetTopParent();const newX=x-wi.GetX()+pwi.GetX(); +const newY=y-wi.GetY()+pwi.GetY();pwi.SetXY(newX,newY)}objectClass._SetIIDsStale();const instPropertyData=instData?C3.cloneArray(instData[5]):null;const behPropertyData=instData?instData[4].map(bp=>C3.cloneArray(bp)):null;const hasTilemap=isWorld&&worldData&&worldData[13];if(hasTilemap)inst._SetHasTilemap();inst._CreateSdkInstance(instPropertyData,behPropertyData);if(hasTilemap){const tilemapData=worldData[13];inst.GetSdkInstance().LoadTilemapData(tilemapData[2],tilemapData[0],tilemapData[1])}this._instancesPendingCreate.push(inst); +this._hasPendingInstances=true;if(this.IsDebug())C3Debugger.InstanceCreated(inst);return inst}_CreateChildInstancesFromData(parentInstance,parentWorldData,parentWorldInfo,layer,x,y){const parentZIndex=parentWorldInfo.GetSceneGraphZIndexExportData();const childrenData=parentWorldInfo.GetSceneGraphChildrenExportData();parentInstance.GetWorldInfo().SetSceneGraphZIndex(parentZIndex);if(!childrenData)return;if(typeof x==="undefined")x=parentWorldData[0];if(typeof y==="undefined")y=parentWorldData[1];const sceneGraphSiblings= +new Set;const parentX=parentWorldData[0];const parentY=parentWorldData[1];for(const childData of childrenData){const childLayoutSID=childData[0];const childLayerIndex=childData[1];const childUID=childData[2];const childFlags=childData[3];const childIsInContainer=!!childData[4];const childZIndex=childData[5];const layout=this._layoutManager.GetLayoutBySID(childLayoutSID);const l=layout.GetLayer(childLayerIndex);const childInstData=l.GetInitialInstanceData(childUID);const childObjectClass=this.GetObjectClassByIndex(childInstData[1]); +const hasSibling=parentInstance.HasSibling(childObjectClass);const siblingProcessed=sceneGraphSiblings.has(childObjectClass);if(hasSibling&&!siblingProcessed&&childIsInContainer){const childInst=parentInstance.GetSibling(childObjectClass);const childX=x+childInstData[0][0]-parentX;const childY=y+childInstData[0][1]-parentY;childInst.GetWorldInfo().SetXY(childX,childY);childInst.GetWorldInfo().SetSceneGraphZIndex(childZIndex);parentInstance.AddChild(childInst,{transformX:!!(childFlags>>0&1),transformY:!!(childFlags>> +1&1),transformWidth:!!(childFlags>>2&1),transformHeight:!!(childFlags>>3&1),transformAngle:!!(childFlags>>4&1),destroyWithParent:!!(childFlags>>5&1),transformZElevation:!!(childFlags>>6&1)});sceneGraphSiblings.add(childObjectClass)}else{const childX=x+childInstData[0][0]-parentX;const childY=y+childInstData[0][1]-parentY;const childInst=this.CreateInstanceFromData(childInstData,layer,false,childX,childY,false,true);childInst.GetWorldInfo().SetSceneGraphZIndex(childZIndex);parentInstance.AddChild(childInst, +{transformX:!!(childFlags>>0&1),transformY:!!(childFlags>>1&1),transformWidth:!!(childFlags>>2&1),transformHeight:!!(childFlags>>3&1),transformAngle:!!(childFlags>>4&1),destroyWithParent:!!(childFlags>>5&1),transformZElevation:!!(childFlags>>6&1)})}}}DestroyInstance(inst){if(this._instancesToReleaseAtEndOfTick.has(inst))return;const objectClass=inst.GetObjectClass();let s=this._instancesPendingDestroy.get(objectClass);if(s){if(s.has(inst))return;s.add(inst)}else{s=new Set;s.add(inst);this._instancesPendingDestroy.set(objectClass, +s)}if(this.IsDebug())C3Debugger.InstanceDestroyed(inst);inst._MarkDestroyed();this._hasPendingInstances=true;if(inst.IsInContainer())for(const s of inst.siblings())this.DestroyInstance(s);for(const c of inst.children())if(c.GetDestroyWithParent())this.DestroyInstance(c);if(!this._layoutManager.IsEndingLayout()&&!this._isLoadingState){const eventSheetManager=this.GetEventSheetManager();eventSheetManager.BlockFlushingInstances(true);inst._TriggerOnDestroyed();eventSheetManager.BlockFlushingInstances(false)}inst._FireDestroyedScriptEvents(this._layoutManager.IsEndingLayout())}FlushPendingInstances(){if(!this._hasPendingInstances)return; +this._isFlushingPendingInstances=true;this._FlushInstancesPendingCreate();this._FlushInstancesPendingDestroy();this._isFlushingPendingInstances=false;this._hasPendingInstances=false;this.UpdateRender()}_FlushInstancesPendingCreate(){for(const inst of this._instancesPendingCreate){const objectType=inst.GetObjectClass();objectType._AddInstance(inst);for(const family of objectType.GetFamilies()){family._AddInstance(inst);family._SetIIDsStale()}}C3.clearArray(this._instancesPendingCreate)}_FlushInstancesPendingDestroy(){this._dispatcher.SetDelayRemoveEventsEnabled(true); +for(const [objectClass,s]of this._instancesPendingDestroy.entries()){this._FlushInstancesPendingDestroyForObjectClass(objectClass,s);s.clear()}this._instancesPendingDestroy.clear();this._dispatcher.SetDelayRemoveEventsEnabled(false)}_FlushInstancesPendingDestroyForObjectClass(objectClass,s){for(const inst of s){const instanceDestroyEvent=this._eventObjects["instancedestroy"];instanceDestroyEvent.instance=inst;this._dispatcher.dispatchEvent(instanceDestroyEvent);this._instancesByUid.delete(inst.GetUID()); +const wi=inst.GetWorldInfo();if(wi){wi._RemoveFromCollisionCells();wi._RemoveFromRenderCells()}this._instancesToReleaseAtEndOfTick.add(inst);this._objectCount--}C3.arrayRemoveAllInSet(objectClass.GetInstances(),s);objectClass._SetIIDsStale();this._instancesToReleaseAffectedObjectClasses.add(objectClass);if(objectClass.GetInstances().length===0)objectClass._SetAnyInstanceParallaxed(false);for(const family of objectClass.GetFamilies()){C3.arrayRemoveAllInSet(family.GetInstances(),s);family._SetIIDsStale(); +this._instancesToReleaseAffectedObjectClasses.add(family)}if(objectClass.GetPlugin().IsWorldType()){const layers=new Set([...s].map(i=>i.GetWorldInfo().GetLayer()));for(const layer of layers)layer._RemoveAllInstancesInSet(s)}}_GetInstancesPendingCreate(){return this._instancesPendingCreate}_GetNewUID(){return this._nextUid++}_MapInstanceByUID(uid,inst){this._instancesByUid.set(uid,inst)}_OnWebGLContextLost(){this._dispatcher.dispatchEvent(C3.New(C3.Event,"webglcontextlost"));this.SetSuspended(true); +for(const objectClass of this._allObjectClasses)if(!objectClass.IsFamily()&&objectClass.HasLoadedTextures())objectClass.ReleaseTextures();const runningLayout=this.GetMainRunningLayout();if(runningLayout)runningLayout._OnWebGLContextLost();C3.ImageInfo.OnWebGLContextLost();C3.ImageAsset.OnWebGLContextLost()}async _OnWebGLContextRestored(){await this.GetMainRunningLayout()._Load(null,this.GetWebGLRenderer());this._dispatcher.dispatchEvent(C3.New(C3.Event,"webglcontextrestored"));this.SetSuspended(false); +this.UpdateRender()}_OnVisibilityChange(e){this.SetSuspended(e["hidden"])}_OnWindowBlur(e){if(!this.IsPreview()||!this._pauseOnBlur||C3.Platform.IsMobile)return;if(!e.data["parentHasFocus"]){this.SetSuspended(true);this._isPausedOnBlur=true}}_OnWindowFocus(){if(!this._isPausedOnBlur)return;this.SetSuspended(false);this._isPausedOnBlur=false}_RequestAnimationFrame(){const tickCallbacks=this._tickCallbacks;if(this._framerateMode==="vsync"){if(this._rafId===-1)this._rafId=C3.RequestPostAnimationFrame(tickCallbacks.normal)}else if(this._framerateMode=== +"unlimited-tick"){if(this._ruafId===-1)this._ruafId=C3.RequestUnlimitedAnimationFrame(tickCallbacks.tickOnly);if(this._rafId===-1)this._rafId=C3.RequestPostAnimationFrame(tickCallbacks.renderOnly)}else if(this._ruafId===-1)this._ruafId=C3.RequestUnlimitedAnimationFrame(tickCallbacks.normal)}_CancelAnimationFrame(){if(this._rafId!==-1){C3.CancelPostAnimationFrame(this._rafId);this._rafId=-1}if(this._ruafId!==-1){C3.CancelUnlimitedAnimationFrame(this._ruafId);this._ruafId=-1}}IsSuspended(){return this._suspendCount> +0}SetSuspended(s){const wasSuspended=this.IsSuspended();this._suspendCount+=s?1:-1;if(this._suspendCount<0)this._suspendCount=0;const isSuspended=this.IsSuspended();if(!wasSuspended&&isSuspended){console.log("[Construct 3] Suspending");this._CancelAnimationFrame();this._dispatcher.dispatchEvent(C3.New(C3.Event,"suspend"));this.Trigger(C3.Plugins.System.Cnds.OnSuspend,null,null)}else if(wasSuspended&&!isSuspended){console.log("[Construct 3] Resuming");const now=performance.now();this._lastTickTime= +now;this._fpsLastTime=now;this._fpsFrameCount=0;this._fps=0;this._mainThreadTime=0;this._mainThreadTimeCounter=0;this._dispatcher.dispatchEvent(C3.New(C3.Event,"resume"));this.Trigger(C3.Plugins.System.Cnds.OnResume,null,null);if(!this.HitBreakpoint())this.Tick(now)}}_AddBehInstToTick(behSdkInst){this._behInstsToTick.Add(behSdkInst)}_AddBehInstToPostTick(behSdkInst){this._behInstsToPostTick.Add(behSdkInst)}_AddBehInstToTick2(behSdkInst){this._behInstsToTick2.Add(behSdkInst)}_RemoveBehInstToTick(behSdkInst){this._behInstsToTick.Remove(behSdkInst)}_RemoveBehInstToPostTick(behSdkInst){this._behInstsToPostTick.Remove(behSdkInst)}_RemoveBehInstToTick2(behSdkInst){this._behInstsToTick2.Remove(behSdkInst)}_BehaviorTick(){this._behInstsToTick.SetQueueingEnabled(true); +for(const bi of this._behInstsToTick)bi.Tick();this._behInstsToTick.SetQueueingEnabled(false)}_BehaviorPostTick(){this._behInstsToPostTick.SetQueueingEnabled(true);for(const bi of this._behInstsToPostTick)bi.PostTick();this._behInstsToPostTick.SetQueueingEnabled(false)}_BehaviorTick2(){this._behInstsToTick2.SetQueueingEnabled(true);for(const bi of this._behInstsToTick2)bi.Tick2();this._behInstsToTick2.SetQueueingEnabled(false)}*_DebugBehaviorTick(){this._behInstsToTick.SetQueueingEnabled(true);for(const bi of this._behInstsToTick){const ret= +bi.Tick();if(C3.IsIterator(ret))yield*ret}this._behInstsToTick.SetQueueingEnabled(false)}*_DebugBehaviorPostTick(){this._behInstsToPostTick.SetQueueingEnabled(true);for(const bi of this._behInstsToPostTick){const ret=bi.PostTick();if(C3.IsIterator(ret))yield*ret}this._behInstsToPostTick.SetQueueingEnabled(false)}*_DebugBehaviorTick2(){this._behInstsToTick2.SetQueueingEnabled(true);for(const bi of this._behInstsToTick2){const ret=bi.Tick2();if(C3.IsIterator(ret))yield*ret}this._behInstsToTick2.SetQueueingEnabled(false)}async Tick(timestamp, +isDebugStep,mode){this._hasStartedTicking=true;const isBackgroundWake=mode==="background-wake";const shouldRender=mode!=="background-wake"&&mode!=="skip-render";if(!this._hasStarted||this.IsSuspended()&&!isDebugStep&&!isBackgroundWake)return;const startTime=performance.now();this._isInTick=true;if(!timestamp)timestamp=startTime;this._MeasureDt(timestamp);const beforePreTickRet=this.Step_BeforePreTick();if(this.IsDebugging())await beforePreTickRet;const pretickRet=this._dispatcher.dispatchEventAndWait_AsyncOptional(this._eventObjects["pretick"]); +if(pretickRet instanceof Promise)await pretickRet;const afterPreTickRet=this.Step_AfterPreTick();if(this.IsDebugging())await afterPreTickRet;if(this._NeedsHandleSaveOrLoad())await this._HandleSaveOrLoad();if(this.GetLayoutManager().IsPendingChangeMainLayout())await this._MaybeChangeLayout();const runEventsRet=this.Step_RunEventsEtc();if(this.IsDebugging())await runEventsRet;if(shouldRender)this.Render();if(!this.IsSuspended()&&!isBackgroundWake)this._RequestAnimationFrame();this._tickCount++;this._tickCountNoSave++; +this._execCount++;this._isInTick=false;this._mainThreadTimeCounter+=performance.now()-startTime}async Step_BeforePreTick(){const eventSheetManager=this._eventSheetManager;const isDebug=this.IsDebug();this.FlushPendingInstances();eventSheetManager.BlockFlushingInstances(true);this.PushCurrentLayout(this.GetMainRunningLayout());if(isDebug)C3Debugger.StartMeasuringTime();if(this.IsDebugging())await eventSheetManager.DebugRunScheduledWaits();else eventSheetManager.RunScheduledWaits();if(isDebug)C3Debugger.AddEventsTime(); +this.PopCurrentLayout();eventSheetManager.BlockFlushingInstances(false);this.FlushPendingInstances();eventSheetManager.BlockFlushingInstances(true)}async Step_AfterPreTick(){const isDebug=this.IsDebug();const isDebugging=this.IsDebugging();const dispatcher=this._dispatcher;const eventObjects=this._eventObjects;const userScriptEventObjects=this._userScriptEventObjects;if(isDebug)C3Debugger.StartMeasuringTime();if(isDebugging)await this.DebugIterateAndBreak(this._DebugBehaviorTick());else this._BehaviorTick(); +if(isDebugging)await this.DebugIterateAndBreak(this._DebugBehaviorPostTick());else this._BehaviorPostTick();if(isDebug)C3Debugger.AddBehaviorTickTime();if(isDebug)C3Debugger.StartMeasuringTime();if(isDebugging)await this.DebugFireGeneratorEventAndBreak(eventObjects["tick"]);else dispatcher.dispatchEvent(eventObjects["tick"]);if(isDebug)C3Debugger.AddPluginTickTime();this._eventSheetManager.BlockFlushingInstances(false);this.DispatchUserScriptEvent(userScriptEventObjects["tick"])}async Step_RunEventsEtc(){const eventSheetManager= +this._eventSheetManager;const dispatcher=this._dispatcher;const eventObjects=this._eventObjects;const isDebug=this.IsDebug();const isDebugging=this.IsDebugging();if(isDebug)C3Debugger.StartMeasuringTime();if(isDebugging)await eventSheetManager.DebugRunEvents(this._layoutManager);else eventSheetManager.RunEvents(this._layoutManager);if(isDebug)C3Debugger.AddEventsTime();this._collisionEngine.ClearRegisteredCollisions();if(this._instancesToReleaseAtEndOfTick.size>0){dispatcher.SetDelayRemoveEventsEnabled(true); +for(const objectClass of this._instancesToReleaseAffectedObjectClasses)objectClass.GetSolStack().RemoveInstances(this._instancesToReleaseAtEndOfTick);this._instancesToReleaseAffectedObjectClasses.clear();this._eventSheetManager.RemoveInstancesFromScheduledWaits(this._instancesToReleaseAtEndOfTick);for(const inst of this._instancesToReleaseAtEndOfTick)inst.Release();this._instancesToReleaseAtEndOfTick.clear();dispatcher.SetDelayRemoveEventsEnabled(false)}this._isLayoutFirstTick=false;eventSheetManager.BlockFlushingInstances(true); +if(isDebug)C3Debugger.StartMeasuringTime();if(isDebugging)await this.DebugIterateAndBreak(this._DebugBehaviorTick2());else this._BehaviorTick2();if(isDebug)C3Debugger.AddBehaviorTickTime();if(isDebug)C3Debugger.StartMeasuringTime();if(isDebugging)await this.DebugFireGeneratorEventAndBreak(eventObjects["tick2"]);else dispatcher.dispatchEvent(eventObjects["tick2"]);if(isDebug)C3Debugger.AddPluginTickTime();eventSheetManager.BlockFlushingInstances(false);if(isDebugging)await eventSheetManager.RunQueuedDebugTriggersAsync()}async _MaybeChangeLayout(){const layoutManager= +this.GetLayoutManager();let i=0;while(layoutManager.IsPendingChangeMainLayout()&&i++<10)await this._DoChangeLayout(layoutManager.GetPendingChangeMainLayout())}_MeasureDt(timestamp){if(this._lastTickTime!==0){const msDiff=Math.max(timestamp-this._lastTickTime,0);this._dt1=msDiff/1E3;const maxDt1=1/this._minimumFramerate;if(this._dt1>.5)this._dt1=0;else if(this._dt1>maxDt1)this._dt1=maxDt1}this._lastTickTime=timestamp;this._dt=this._dt1*this._timeScale;this._gameTime.Add(this._dt);this._wallTime.Add(this._dt1); +if(this._canvasManager)this._canvasManager._UpdateTick();if(timestamp-this._fpsLastTime>=1E3){this._fpsLastTime+=1E3;if(timestamp-this._fpsLastTime>=1E3)this._fpsLastTime=timestamp;this._fps=this._fpsFrameCount;this._fpsFrameCount=0;this._mainThreadTime=Math.min(this._mainThreadTimeCounter/1E3,1);this._mainThreadTimeCounter=0;if(this._canvasManager)this._canvasManager._Update1sFrameRange();this._collisionEngine._Update1sStats();if(this.IsDebug())C3Debugger.Update1sPerfStats()}this._fpsFrameCount++}async _DoChangeLayout(changeToLayout){const dispatcher= +this._dispatcher;const layoutManager=this.GetLayoutManager();const prevLayout=layoutManager.GetMainRunningLayout();await prevLayout._StopRunning();prevLayout._Unload(changeToLayout,this.GetWebGLRenderer());if(prevLayout===changeToLayout)this._eventSheetManager.ClearAllScheduledWaits();this._collisionEngine.ClearRegisteredCollisions();dispatcher.dispatchEvent(this._eventObjects["beforelayoutchange"]);C3.Asyncify.SetHighThroughputMode(true);await changeToLayout._Load(prevLayout,this.GetWebGLRenderer()); +C3.Asyncify.SetHighThroughputMode(false);await changeToLayout._StartRunning(false);dispatcher.dispatchEvent(this._eventObjects["layoutchange"]);this.UpdateRender();this._isLayoutFirstTick=true;this.FlushPendingInstances()}UpdateRender(){this._needRender=true}GetWebGLRenderer(){if(!this._canvasManager)return null;return this._canvasManager.GetWebGLRenderer()}GetRenderer(){return this.GetWebGLRenderer()}Render(){if(!this._canvasManager||this._canvasManager.IsWebGLContextLost())return;const renderer= +this.GetWebGLRenderer();renderer.Start();renderer.CheckForQueryResults();if(!this._needRender){renderer.IncrementFrameNumber();return}const isDebug=this.IsDebug();if(isDebug)C3Debugger.StartMeasuringTime();this._needRender=false;let frameQuery=null;if(renderer.SupportsGPUProfiling()){frameQuery=this._canvasManager.GetGPUFrameTimingsBuffer().AddTimeElapsedQuery();renderer.StartQuery(frameQuery)}renderer.SetTextureFillMode();renderer.SetAlphaBlend();renderer.SetColorRgba(1,1,1,1);renderer.SetRenderTarget(null); +renderer.SetTexture(null);const layout=this._layoutManager.GetMainRunningLayout();layout.Draw(renderer);if(frameQuery)renderer.EndQuery(frameQuery);renderer.Finish();if(isDebug){C3Debugger.AddDrawCallsTime();C3Debugger.UpdateInspectHighlight()}if(this._canvasManager)this._canvasManager._MaybeTakeSnapshot()}Trigger(method,inst,behaviorType){if(!this._hasStarted)return false;const isTopLevel=!this._isInTick&&!this._eventSheetManager.IsInTrigger();let startTime=0;if(isTopLevel)startTime=performance.now(); +const isDebug=this.IsDebug();if(isDebug)this.SetDebuggingEnabled(false);const ret=this._eventSheetManager._Trigger(this._layoutManager,method,inst,behaviorType);if(isTopLevel){const triggerTime=performance.now()-startTime;this._mainThreadTimeCounter+=triggerTime;if(isDebug)C3Debugger.AddTriggersTime(triggerTime)}if(isDebug)this.SetDebuggingEnabled(true);return ret}DebugTrigger(method,inst,behaviorType){if(!this.IsDebug())return this.Trigger(method,inst,behaviorType);if(this.HitBreakpoint())throw new Error("called DebugTrigger() while stopped on breakpoint"); +if(!this._isInTick&&!this._eventSheetManager.IsInTrigger())throw new Error("called DebugTrigger() outside of event code - use TriggerAsync() instead");return this._eventSheetManager._DebugTrigger(this._layoutManager,method,inst,behaviorType)}async TriggerAsync(method,inst,behaviorType){if(!this.IsDebugging())return this.Trigger(method,inst,behaviorType);if(!this._hasStarted)return false;if(this.HitBreakpoint())return this._eventSheetManager.QueueDebugTrigger(method,inst,behaviorType);if(!this.GetMainRunningLayout())return this._eventSheetManager.QueueTrigger(method, +inst,behaviorType);const startTime=performance.now();const iter=this._eventSheetManager._DebugTrigger(this._layoutManager,method,inst,behaviorType);let result=iter.next();while(!result.done){await this.DebugBreak(result.value);result=iter.next()}if(!this.IsSuspended()&&!this._eventSheetManager.IsInTrigger()){await this._eventSheetManager.RunQueuedDebugTriggersAsync();if(this._hasStartedTicking&&!this._isInTick)this._RequestAnimationFrame()}this._mainThreadTimeCounter+=performance.now()-startTime; +return result.value}FastTrigger(method,inst,value){const isDebug=this.IsDebug();if(isDebug)this.SetDebuggingEnabled(false);const ret=this._eventSheetManager._FastTrigger(this._layoutManager,method,inst,value);if(isDebug)this.SetDebuggingEnabled(true);return ret}DebugFastTrigger(method,inst,value){return this._eventSheetManager._DebugFastTrigger(this._layoutManager,method,inst,value)}ScheduleTriggers(f){return this._scheduleTriggersThrottle.Add(f)}PushCurrentLayout(layout){this._currentLayoutStack.push(layout)}PopCurrentLayout(){if(!this._currentLayoutStack.length)throw new Error("layout stack empty"); +this._currentLayoutStack.pop()}GetCurrentLayout(){if(!this._currentLayoutStack.length)return this.GetMainRunningLayout();return this._currentLayoutStack[this._currentLayoutStack.length-1]}GetDt(inst){if(!inst||inst.GetTimeScale()===-1)return this._dt;return this._dt1*inst.GetTimeScale()}_GetDtFast(){return this._dt}GetDt1(){return this._dt1}GetTimeScale(){return this._timeScale}SetTimeScale(ts){if(isNaN(ts)||ts<0)ts=0;this._timeScale=ts}SetMinimumFramerate(fps){this._minimumFramerate=C3.clamp(fps, +1,120)}GetMinimumFramerate(){return this._minimumFramerate}GetFPS(){return this._fps}GetMainThreadTime(){return this._mainThreadTime}GetStartTime(){return this._startTime}GetGameTime(){return this._gameTime.Get()}GetWallTime(){return this._wallTime.Get()}GetTickCount(){return this._tickCount}GetTickCountNoSave(){return this._tickCountNoSave}IncrementExecCount(){++this._execCount}GetExecCount(){return this._execCount}GetObjectCount(){return this._objectCount}GetProjectName(){return this._projectName}GetProjectVersion(){return this._projectVersion}GetProjectUniqueId(){return this._projectUniqueId}GetAppId(){return this._appId}GetInstanceByUID(uid){if(this._isLoadingState)throw new Error("cannot call while loading state - wait until afterload event"); +return this._instancesByUid.get(uid)||null}_RefreshUidMap(){this._instancesByUid.clear();for(const objectClass of this._allObjectClasses){if(objectClass.IsFamily())continue;for(const inst of objectClass.GetInstances())this._instancesByUid.set(inst.GetUID(),inst)}}IsPreview(){return this._exportType==="preview"}IsDebug(){return this._isDebug}GetExportType(){return this._exportType}IsCordova(){return this._exportType==="cordova"}IsAndroidWebView(){return C3.Platform.OS==="Android"&&(this._exportType=== +"cordova"||this._exportType==="playable-ad"||this._exportType==="instant-games")}IsiOSCordova(){return this._isiOSCordova}IsiOSWebView(){return this._isiOSWebView}GetCollisionEngine(){return this._collisionEngine}GetSolidBehavior(){return this._pluginManager.GetSolidBehavior()}GetJumpthruBehavior(){return this._pluginManager.GetJumpthruBehavior()}IsLayoutFirstTick(){return this._isLayoutFirstTick}SetPixelRoundingEnabled(e){e=!!e;if(this._isPixelRoundingEnabled===e)return;this._isPixelRoundingEnabled= +e;this.UpdateRender()}IsPixelRoundingEnabled(){return this._isPixelRoundingEnabled}SaveToSlot(slotName){this._saveToSlotName=slotName}LoadFromSlot(slotName){this._loadFromSlotName=slotName}LoadFromJsonString(str){this._loadFromJson=str}GetLastSaveJsonString(){return this._lastSaveJson}_NeedsHandleSaveOrLoad(){return!!(this._saveToSlotName||this._loadFromSlotName||this._loadFromJson!==null)}async _HandleSaveOrLoad(){if(this._saveToSlotName){this.FlushPendingInstances();await this._DoSaveToSlot(this._saveToSlotName); +this._ClearSaveOrLoad()}if(this._loadFromSlotName){await this._DoLoadFromSlot(this._loadFromSlotName);this._ClearSaveOrLoad();if(this.IsDebug())C3Debugger.StepIfPausedInDebugger()}if(this._loadFromJson!==null){this.FlushPendingInstances();try{await this._DoLoadFromJsonString(this._loadFromJson);this._lastSaveJson=this._loadFromJson;await this.TriggerAsync(C3.Plugins.System.Cnds.OnLoadComplete,null);this._lastSaveJson=""}catch(err){console.error("[Construct 3] Failed to load state from JSON string: ", +err);await this.TriggerAsync(C3.Plugins.System.Cnds.OnLoadFailed,null)}this._ClearSaveOrLoad()}}_ClearSaveOrLoad(){this._saveToSlotName="";this._loadFromSlotName="";this._loadFromJson=null}_GetProjectStorage(){if(!this._projectStorage)this._projectStorage=localforage.createInstance({name:"c3-localstorage-"+this.GetProjectUniqueId(),description:this.GetProjectName()});return this._projectStorage}_GetSavegamesStorage(){if(!this._savegamesStorage)this._savegamesStorage=localforage.createInstance({name:"c3-savegames-"+ +this.GetProjectUniqueId(),description:this.GetProjectName()});return this._savegamesStorage}async _DoSaveToSlot(slotName){const saveJson=await this._SaveToJsonString();try{await this._GetSavegamesStorage().setItem(slotName,saveJson);console.log("[Construct 3] Saved state to storage ("+saveJson.length+" chars)");this._lastSaveJson=saveJson;await this.TriggerAsync(C3.Plugins.System.Cnds.OnSaveComplete,null);this._lastSaveJson=""}catch(err){console.error("[Construct 3] Failed to save state to storage: ", +err);await this.TriggerAsync(C3.Plugins.System.Cnds.OnSaveFailed,null)}}async _DoLoadFromSlot(slotName){try{const loadJson=await this._GetSavegamesStorage().getItem(slotName);if(!loadJson)throw new Error("empty slot");console.log("[Construct 3] Loaded state from storage ("+loadJson.length+" chars)");await this._DoLoadFromJsonString(loadJson);this._lastSaveJson=loadJson;await this.TriggerAsync(C3.Plugins.System.Cnds.OnLoadComplete,null);this._lastSaveJson=""}catch(err){console.error("[Construct 3] Failed to load state from storage: ", +err);await this.TriggerAsync(C3.Plugins.System.Cnds.OnLoadFailed,null)}}async _SaveToJsonString(){const o={"c3save":true,"version":1,"rt":{"time":this.GetGameTime(),"walltime":this.GetWallTime(),"timescale":this.GetTimeScale(),"tickcount":this.GetTickCount(),"execcount":this.GetExecCount(),"next_uid":this._nextUid,"running_layout":this.GetMainRunningLayout().GetSID(),"start_time_offset":Date.now()-this._startTime},"types":{},"layouts":{},"events":this._eventSheetManager._SaveToJson(),"timelines":this._timelineManager._SaveToJson(), +"user_script_data":null};for(const objectClass of this._allObjectClasses){if(objectClass.IsFamily()||objectClass.HasNoSaveBehavior())continue;o["types"][objectClass.GetSID().toString()]=objectClass._SaveToJson()}for(const layout of this._layoutManager.GetAllLayouts())o["layouts"][layout.GetSID().toString()]=layout._SaveToJson();const saveEvent=this._CreateUserScriptEvent("save");saveEvent.saveData=null;await this.DispatchUserScriptEventAsyncWait(saveEvent);o["user_script_data"]=saveEvent.saveData; +return JSON.stringify(o)}IsLoadingState(){return this._isLoadingState}async _DoLoadFromJsonString(jsonStr){const o=JSON.parse(jsonStr);if(o["c2save"])throw new Error("C2 saves are incompatible with C3 runtime");if(!o["c3save"])throw new Error("not valid C3 save data");if(o["version"]>1)throw new Error("C3 save data from future version");this._dispatcher.dispatchEvent(C3.New(C3.Event,"beforeload"));this._isLoadingState=true;const rt=o["rt"];this._gameTime.Set(rt["time"]);this._wallTime.Set(rt["walltime"]); +this._timeScale=rt["timescale"];this._tickCount=rt["tickcount"];this._execCount=rt["execcount"];this._startTime=Date.now()-rt["start_time_offset"];const layoutSid=rt["running_layout"];if(layoutSid!==this.GetMainRunningLayout().GetSID()){const changeToLayout=this._layoutManager.GetLayoutBySID(layoutSid);if(changeToLayout)await this._DoChangeLayout(changeToLayout);else return}for(const [sidStr,data]of Object.entries(o["types"])){const sid=parseInt(sidStr,10);const objectClass=this.GetObjectClassBySID(sid); +if(!objectClass||objectClass.IsFamily()||objectClass.HasNoSaveBehavior())continue;objectClass._LoadFromJson(data)}this.FlushPendingInstances();this._RefreshUidMap();this._isLoadingState=false;this._nextUid=rt["next_uid"];for(const [sidStr,data]of Object.entries(o["layouts"])){const sid=parseInt(sidStr,10);const layout=this._layoutManager.GetLayoutBySID(sid);if(!layout)continue;layout._LoadFromJson(data)}this._eventSheetManager._LoadFromJson(o["events"]);for(const objectClass of this._allObjectClasses){if(objectClass.IsFamily()|| +!objectClass.IsInContainer())continue;for(const inst of objectClass.GetInstances()){const iid=inst.GetIID();for(const otherType of objectClass.GetContainer().objectTypes()){if(otherType===objectClass)continue;const otherInstances=otherType.GetInstances();if(iid<0||iid>=otherInstances.length)throw new Error("missing sibling instance");inst._AddSibling(otherInstances[iid])}}}this._timelineManager._LoadFromJson(o["timelines"]);this._dispatcher.dispatchEvent(C3.New(C3.Event,"afterload"));const loadEvent= +this._CreateUserScriptEvent("load");loadEvent.saveData=o["user_script_data"];await this.DispatchUserScriptEventAsyncWait(loadEvent);this.UpdateRender()}async AddJobWorkerScripts(scripts){const blobs=await Promise.all(scripts.map(url=>this._assetManager.FetchBlob(url)));const blobUrls=blobs.map(b=>URL.createObjectURL(b));this._jobScheduler.ImportScriptsToJobWorkers(blobUrls)}AddJobWorkerBlob(blob,id){this._jobScheduler.SendBlobToJobWorkers(blob,id)}AddJobWorkerBuffer(buffer,id){this._jobScheduler.SendBufferToJobWorkers(buffer, +id)}AddJob(type,params,transferables){return this._jobScheduler.AddJob(type,params,transferables)}BroadcastJob(type,params,transferables){return this._jobScheduler.BroadcastJob(type,params,transferables)}InvokeDownload(url,filename){this.PostComponentMessageToDOM("runtime","invoke-download",{"url":url,"filename":filename})}async RasterSvgImage(blob,imageWidth,imageHeight,surfaceWidth,surfaceHeight,imageBitmapOpts){surfaceWidth=surfaceWidth||imageWidth;surfaceHeight=surfaceHeight||imageHeight;if(this.IsInWorker()){const result= +await this.PostComponentMessageToDOMAsync("runtime","raster-svg-image",{"blob":blob,"imageWidth":imageWidth,"imageHeight":imageHeight,"surfaceWidth":surfaceWidth,"surfaceHeight":surfaceHeight,"imageBitmapOpts":imageBitmapOpts});return result["imageBitmap"]}else{const canvas=await self["C3_RasterSvgImageBlob"](blob,imageWidth,imageHeight,surfaceWidth,surfaceHeight);if(imageBitmapOpts)return await self.createImageBitmap(canvas,imageBitmapOpts);else return canvas}}async GetSvgImageSize(blob){if(this.IsInWorker())return await this.PostComponentMessageToDOMAsync("runtime", +"get-svg-image-size",{"blob":blob});else return await self["C3_GetSvgImageSize"](blob)}RequestDeviceOrientationEvent(){if(this._didRequestDeviceOrientationEvent)return;this._didRequestDeviceOrientationEvent=true;this.PostComponentMessageToDOM("runtime","enable-device-orientation")}RequestDeviceMotionEvent(){if(this._didRequestDeviceMotionEvent)return;this._didRequestDeviceMotionEvent=true;this.PostComponentMessageToDOM("runtime","enable-device-motion")}Random(){return this._randomNumberCallback()}SetRandomNumberGeneratorCallback(f){this._randomNumberCallback= +f}_GetRemotePreviewStatusInfo(){return{"fps":this.GetFPS(),"cpu":this.GetMainThreadTime(),"gpu":this.GetGPUUtilisation(),"layout":this.GetMainRunningLayout()?this.GetMainRunningLayout().GetName():"","renderer":this.GetWebGLRenderer().GetUnmaskedRenderer()}}HitBreakpoint(){if(!this.IsDebug())return false;return C3Debugger.HitBreakpoint()}DebugBreak(eventObject){if(!this.IsDebugging())return Promise.resolve();return C3Debugger.DebugBreak(eventObject)}DebugBreakNext(){if(!this.IsDebugging())return false; +return C3Debugger.BreakNext()}SetDebugBreakpointsEnabled(e){this._breakpointsEnabled=!!e;this._UpdateDebuggingFlag()}AreDebugBreakpointsEnabled(){return this._breakpointsEnabled}IsDebugging(){return this._isDebugging}SetDebuggingEnabled(d){if(d)this._debuggingDisabled--;else this._debuggingDisabled++;this._UpdateDebuggingFlag()}_UpdateDebuggingFlag(){this._isDebugging=this.IsDebug()&&this._breakpointsEnabled&&this._debuggingDisabled===0}IsCPUProfiling(){return this.IsDebug()&&C3Debugger.IsCPUProfiling()}IsGPUProfiling(){return this.IsDebug()&& +this.GetWebGLRenderer().SupportsGPUProfiling()&&C3Debugger.IsGPUProfiling()}async DebugIterateAndBreak(iter){if(!iter)return;for(const breakEventObject of iter)await this.DebugBreak(breakEventObject)}DebugFireGeneratorEventAndBreak(event){return this.DebugIterateAndBreak(this._dispatcher.dispatchGeneratorEvent(event))}_InvokeFunctionFromJS(e){return this._eventSheetManager._InvokeFunctionFromJS(e["name"],e["params"])}GetIRuntime(){return this._iRuntime}_CreateUserScriptEvent(name){const e=C3.New(C3.Event, +name,false);e.runtime=this._iRuntime;return e}_InitScriptInterfaces(){const objectDescriptors={};for(const objectClass of this._allObjectClasses)objectDescriptors[objectClass.GetJsPropName()]={value:objectClass.GetIObjectClass(),enumerable:true,writable:false};const objects=Object.create(Object.prototype,objectDescriptors);this._iRuntime=new self.IRuntime(this,objects);this._userScriptEventObjects={"tick":this._CreateUserScriptEvent("tick")}}_InitGlobalVariableScriptInterface(){const globalVarDescriptors= +{};for(const globalVar of this.GetEventSheetManager().GetAllGlobalVariables())globalVarDescriptors[globalVar.GetJsPropName()]=globalVar._GetScriptInterfaceDescriptor();this._iRuntime._InitGlobalVars(globalVarDescriptors)}_GetCommonScriptInterfaces(){return this._commonScriptInterfaces}_MapScriptInterface(interface_,class_){this._interfaceMap.set(interface_,class_)}_UnwrapScriptInterface(interface_){return this._interfaceMap.get(interface_)}};self["C3_CreateRuntime"]=C3.Runtime.Create;self["C3_InitRuntime"]= +(runtime,opts)=>runtime.Init(opts)}; + + +// c3/workers/jobSchedulerRuntime.js +'use strict';{const C3=self.C3;C3.JobSchedulerRuntime=class JobSchedulerRuntime extends C3.DefendedBase{constructor(runtime,data){super();this._runtime=runtime;this._jobPromises=new Map;this._nextJobId=0;this._inputPort=data["inputPort"];data["outputPort"].onmessage=e=>this._OnJobWorkerMessage(e);this._maxNumWorkers=data["maxNumWorkers"];this._jobWorkerCount=1;this._isCreatingWorker=false;this._hadErrorCreatingWorker=false}async Init(){}ImportScriptsToJobWorkers(scripts){this._inputPort.postMessage({"type":"_import_scripts", +"scripts":scripts})}SendBlobToJobWorkers(blob,id){this._inputPort.postMessage({"type":"_send_blob","blob":blob,"id":id})}SendBufferToJobWorkers(buffer,id){this._inputPort.postMessage({"type":"_send_buffer","buffer":buffer,"id":id},[buffer])}AddJob(type,params,transferables,progressHandler,abortDisposable){if(!transferables)transferables=[];const jobId=this._nextJobId++;const job={"type":type,"isBroadcast":false,"jobId":jobId,"params":params,"transferables":transferables};const promise=new Promise((resolve, +reject)=>{this._jobPromises.set(jobId,{resolve:resolve,progress:progressHandler,reject:reject,cancelled:false})});if(abortDisposable)abortDisposable.SetAction(()=>this._CancelJob(jobId));this._inputPort.postMessage(job,transferables);this._MaybeCreateExtraWorker();return promise}BroadcastJob(type,params,transferables){if(!transferables)transferables=[];const jobId=this._nextJobId++;const job={"type":type,"isBroadcast":true,"jobId":jobId,"params":params,"transferables":transferables};this._inputPort.postMessage(job, +transferables)}_CancelJob(jobId){const job=this._jobPromises.get(jobId);if(job){job.cancelled=true;job.resolve=null;job.progress=null;job.reject=null;this._inputPort.postMessage({"type":"_cancel","jobId":jobId})}}_OnJobWorkerMessage(e){const msg=e.data;const type=msg["type"];const id=msg["jobId"];switch(type){case "result":this._OnJobResult(id,msg["result"]);break;case "progress":this._OnJobProgress(id,msg["progress"]);break;case "error":this._OnJobError(id,msg["error"]);break;case "ready":this._OnJobWorkerReady(); +break;default:throw new Error(`unknown message from worker '${type}'`);}}_OnJobResult(jobId,result){const p=this._jobPromises.get(jobId);if(!p)throw new Error("invalid job ID");if(!p.cancelled)p.resolve(result);this._jobPromises.delete(jobId)}_OnJobProgress(jobId,progress){const p=this._jobPromises.get(jobId);if(!p)throw new Error("invalid job ID");if(!p.cancelled&&p.progress)p.progress(progress)}_OnJobError(jobId,error){const p=this._jobPromises.get(jobId);if(!p)throw new Error("invalid job ID"); +if(!p.cancelled)p.reject(error);this._jobPromises.delete(jobId)}_OnJobWorkerReady(){if(!this._isCreatingWorker)return;this._isCreatingWorker=false;this._jobWorkerCount++;if(this._jobWorkerCount=this._maxNumWorkers||this._isCreatingWorker||this._hadErrorCreatingWorker||this._jobPromises.size<=this._jobWorkerCount)return;try{this._isCreatingWorker= +true;const result=await this._runtime.PostComponentMessageToDOMAsync("runtime","create-job-worker");result["outputPort"].onmessage=e=>this._OnJobWorkerMessage(e)}catch(err){this._hadErrorCreatingWorker=true;this._isCreatingWorker=false;console.error(`[Construct 3] Failed to create job worker; stopping creating any more (created ${this._jobWorkerCount} so far)`,err)}}}}; + + +self["C3_Shaders"] = {}; +self["C3_Shaders"]["brightness"] = { + src: "varying mediump vec2 vTex;\nuniform lowp sampler2D samplerFront;\nuniform lowp float brightness;\nvoid main(void)\n{\nlowp vec4 front = texture2D(samplerFront, vTex);\nlowp float a = front.a;\nif (a != 0.0)\nfront.rgb /= front.a;\nfront.rgb += (brightness - 1.0);\nfront.rgb *= a;\ngl_FragColor = front;\n}", + extendBoxHorizontal: 0, + extendBoxVertical: 0, + crossSampling: false, + mustPreDraw: false, + preservesOpaqueness: true, + animated: false, + parameters: [["brightness",0,"percent"]] +}; +self["C3_Shaders"]["hsladjust"] = { + src: "varying mediump vec2 vTex;\nuniform lowp sampler2D samplerFront;\nprecision mediump float;\nuniform float huerotate;\nuniform float satadjust;\nuniform float lumadjust;\nvec3 rgb_to_hsl(vec3 color)\n{\nvec3 hsl = vec3(0.0, 0.0, 0.0);\nfloat fmin = min(min(color.r, color.g), color.b);\nfloat fmax = max(max(color.r, color.g), color.b);\nfloat delta = fmax - fmin;\nhsl.z = (fmax + fmin) / 2.0;\nif (delta == 0.0)\n{\nhsl.x = 0.0;\nhsl.y = 0.0;\n}\nelse\n{\nif (hsl.z < 0.5)\nhsl.y = delta / (fmax + fmin);\nelse\nhsl.y = delta / (2.0 - fmax - fmin);\nfloat dR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;\nfloat dG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;\nfloat dB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;\nif (color.r == fmax)\nhsl.x = dB - dG;\nelse if (color.g == fmax)\nhsl.x = (1.0 / 3.0) + dR - dB;\nelse if (color.b == fmax)\nhsl.x = (2.0 / 3.0) + dG - dR;\nif (hsl.x < 0.0)\nhsl.x += 1.0;\nelse if (hsl.x > 1.0)\nhsl.x -= 1.0;\n}\nreturn hsl;\n}\nfloat hue_to_rgb(float f1, float f2, float hue)\n{\nif (hue < 0.0)\nhue += 1.0;\nelse if (hue > 1.0)\nhue -= 1.0;\nfloat ret;\nif ((6.0 * hue) < 1.0)\nret = f1 + (f2 - f1) * 6.0 * hue;\nelse if ((2.0 * hue) < 1.0)\nret = f2;\nelse if ((3.0 * hue) < 2.0)\nret = f1 + (f2 - f1) * ((2.0 / 3.0) - hue) * 6.0;\nelse\nret = f1;\nreturn ret;\n}\nvec3 hsl_to_rgb(vec3 hsl)\n{\nvec3 rgb = vec3(hsl.z);\nif (hsl.y != 0.0)\n{\nfloat f2;\nif (hsl.z < 0.5)\nf2 = hsl.z * (1.0 + hsl.y);\nelse\nf2 = (hsl.z + hsl.y) - (hsl.y * hsl.z);\nfloat f1 = 2.0 * hsl.z - f2;\nrgb.r = hue_to_rgb(f1, f2, hsl.x + (1.0 / 3.0));\nrgb.g = hue_to_rgb(f1, f2, hsl.x);\nrgb.b = hue_to_rgb(f1, f2, hsl.x - (1.0 / 3.0));\n}\nreturn rgb;\n}\nvoid main(void)\n{\nvec4 front = texture2D(samplerFront, vTex);\nvec3 rgb = rgb_to_hsl(front.rgb) + vec3((huerotate > 0.5 ? huerotate - 1.0 : huerotate), 0, (lumadjust - 1.0) * front.a);\nrgb.y *= satadjust;\nrgb = hsl_to_rgb(rgb);\ngl_FragColor = vec4(rgb, front.a);\n}", + extendBoxHorizontal: 0, + extendBoxVertical: 0, + crossSampling: false, + mustPreDraw: false, + preservesOpaqueness: true, + animated: false, + parameters: [["huerotate",0,"percent"],["satadjust",0,"percent"],["lumadjust",0,"percent"]] +}; +self["C3_Shaders"]["inverse"] = { + src: "varying mediump vec2 vTex;\nuniform lowp sampler2D samplerFront;\nuniform lowp float intensity;\nvoid main(void)\n{\nlowp vec4 front = texture2D(samplerFront, vTex);\nlowp vec3 inverse = vec3(front.a - front.rgb);\ngl_FragColor = vec4(mix(front.rgb, inverse, intensity), front.a);\n}", + extendBoxHorizontal: 0, + extendBoxVertical: 0, + crossSampling: false, + mustPreDraw: false, + preservesOpaqueness: true, + animated: false, + parameters: [["intensity",0,"percent"]] +}; +self["C3_Shaders"]["warpobjectmask"] = { + src: "#ifdef GL_FRAGMENT_PRECISION_HIGH\n#define highmedp highp\n#else\n#define highmedp mediump\n#endif\nvarying mediump vec2 vTex;\nuniform lowp sampler2D samplerFront;\nuniform mediump vec2 srcStart;\nuniform mediump vec2 srcEnd;\nuniform mediump vec2 srcOriginStart;\nuniform mediump vec2 srcOriginEnd;\nuniform lowp sampler2D samplerBack;\nuniform mediump vec2 destStart;\nuniform mediump vec2 destEnd;\nuniform highmedp float seconds;\nuniform mediump vec2 pixelSize;\nuniform mediump float layerScale;\nuniform mediump float freqX;\nuniform mediump float freqY;\nuniform mediump float ampX;\nuniform mediump float ampY;\nuniform mediump float speedX;\nuniform mediump float speedY;\nvoid main(void)\n{\nmediump float _2pi = 2.0 * 3.14159265359;\nlowp float fronta = texture2D(samplerFront, vTex).a;\nmediump vec2 srcSize = srcEnd - srcStart;\nmediump vec2 tex = ((vTex - srcStart) / srcSize);\nmediump vec2 srcOriginSize = srcOriginEnd - srcOriginStart;\nmediump vec2 n = ((vTex - srcOriginStart) / srcOriginSize);\nmediump vec2 p = mix(destStart, destEnd, tex);\np.x += cos(n.y * _2pi * freqY + seconds * speedY * _2pi) * ampY * pixelSize.x * layerScale * fronta;\np.y += sin(n.x * _2pi * freqX + seconds * speedX * _2pi) * ampX * pixelSize.y * layerScale * fronta;\np = clamp(p, min(destStart, destEnd), max(destStart, destEnd));\ngl_FragColor = texture2D(samplerBack, p);\n}", + extendBoxHorizontal: 30, + extendBoxVertical: 30, + crossSampling: true, + mustPreDraw: false, + preservesOpaqueness: false, + animated: true, + parameters: [["freqX",0,"float"],["freqY",0,"float"],["ampX",0,"float"],["ampY",0,"float"],["speedX",0,"float"],["speedY",0,"float"]] +}; +self["C3_Shaders"]["waterbg"] = { + src: "#ifdef GL_FRAGMENT_PRECISION_HIGH\n#define highmedp highp\n#else\n#define highmedp mediump\n#endif\nvarying mediump vec2 vTex;\nuniform lowp sampler2D samplerFront;\nuniform mediump vec2 srcStart;\nuniform mediump vec2 srcEnd;\nuniform lowp sampler2D samplerBack;\nuniform mediump vec2 destStart;\nuniform mediump vec2 destEnd;\nprecision mediump float;\nuniform highmedp float seconds;\nuniform mediump vec2 pixelSize;\nconst float PI = 3.1415926535897932;\nuniform float speed;\nuniform float speed_x;\nuniform float speed_y;\nuniform float intensity;\nconst float steps = 8.0;\nuniform float frequency;\nuniform float angle; // better when a prime\nuniform float delta;\nuniform float intence;\nuniform float emboss;\nfloat col(vec2 coord)\n{\nfloat delta_theta = 2.0 * PI / angle;\nfloat col = 0.0;\nfloat theta = 0.0;\nfor (float i = 0.0; i < steps; i++)\n{\nvec2 adjc = coord;\ntheta = delta_theta*i;\nadjc.x += cos(theta)*seconds*speed + seconds * speed_x;\nadjc.y -= sin(theta)*seconds*speed - seconds * speed_y;\ncol = col + cos( (adjc.x*cos(theta) - adjc.y*sin(theta))*frequency)*intensity;\n}\nreturn cos(col);\n}\nvoid main(void)\n{\nmediump vec2 tex = (vTex - srcStart) / (srcEnd - srcStart);\nvec2 p = tex, c1 = p, c2 = p;\nfloat cc1 = col(c1);\nc2.x += (1.0 / pixelSize.x) / delta;\nfloat dx = emboss*(cc1-col(c2))/delta;\nc2.x = p.x;\nc2.y += (1.0 / pixelSize.y) / delta;\nfloat dy = emboss*(cc1-col(c2))/delta;\nc1.x += dx;\nc1.y = -(c1.y+dy);\nfloat alpha = 1.+dot(dx,dy)*intence;\nc1.y = -c1.y;\nc1 = clamp(c1, 0.0, 1.0);\nlowp vec4 front = texture2D(samplerFront, mix(srcStart, srcEnd, c1)) * alpha;\nlowp vec4 result;\nif (front.a == 0.0)\nresult = front + texture2D(samplerBack, mix(destStart, destEnd, tex)) * (1.0 - front.a);\nelse\nresult = front + texture2D(samplerBack, mix(destStart, destEnd, c1)) * (1.0 - front.a);\ngl_FragColor = result;\n}", + extendBoxHorizontal: 40, + extendBoxVertical: 40, + crossSampling: true, + mustPreDraw: false, + preservesOpaqueness: false, + animated: true, + parameters: [["speed",0,"percent"],["speed_x",0,"percent"],["speed_y",0,"percent"],["intensity",0,"float"],["frequency",0,"float"],["angle",0,"float"],["delta",0,"float"],["intence",0,"float"],["emboss",0,"percent"]] +}; +self["C3_Shaders"]["pixellate"] = { + src: "varying mediump vec2 vTex;\nuniform lowp sampler2D samplerFront;\nuniform mediump vec2 srcOriginStart;\nuniform mediump vec2 srcOriginEnd;\nuniform mediump vec2 pixelSize;\nuniform mediump float tilesize;\nvoid main(void)\n{\nmediump vec2 tile = pixelSize * tilesize;\nmediump vec2 halftile = tile / 2.0;\nmediump vec2 tex = floor(vTex / tile) * tile + halftile;\ntex = clamp(tex, min(srcOriginStart, srcOriginEnd), max(srcOriginStart, srcOriginEnd));\ngl_FragColor = texture2D(samplerFront, tex);\n}", + extendBoxHorizontal: 0, + extendBoxVertical: 0, + crossSampling: false, + mustPreDraw: false, + preservesOpaqueness: false, + animated: false, + parameters: [["tilesize",0,"float"]] +}; + + +'use strict';{const C3=self.C3;let cacheRegex=null;let lastRegex="";let lastFlags="";let regexMatches=[];let lastMatchesStr="";let lastMatchesRegex="";let lastMatchesFlags="";const forEachStack=C3.New(C3.ArrayStack);function ForEachOrdered_SortInstances(a,b){const va=a[1];const vb=b[1];if(typeof va==="number"&&typeof vb==="number")return va-vb;else{const sa=""+va;const sb=""+vb;if(sasb)return 1;else return 0}}C3.Plugins.System=class SystemPlugin extends C3.SDKPluginBase{constructor(opts){super(opts); +this._loopStack=this._runtime.GetEventSheetManager().GetLoopStack();this._eventStack=this._runtime.GetEventSheetManager().GetEventStack();this._imagesLoadingTotal=0;this._imagesLoadingComplete=0;this._functionMaps=new Map}Release(){super.Release()}UpdateRender(){this._runtime.UpdateRender()}Trigger(method){this._runtime.Trigger(method,null,null)}GetRegex(regex,flags){if(!cacheRegex||regex!==lastRegex||flags!==lastFlags){cacheRegex=new RegExp(regex,flags);lastRegex=regex;lastFlags=flags}cacheRegex.lastIndex= +0;return cacheRegex}GetRegexMatches(str,regex,flags){if(str===lastMatchesStr&®ex===lastMatchesRegex&&flags===lastMatchesFlags)return regexMatches;const cacheRegex=this.GetRegex(regex,flags);regexMatches=str.match(cacheRegex);lastMatchesStr=str;lastMatchesRegex=regex;lastMatchesFlags=flags;return regexMatches}async _LoadTexturesForObjectClasses(layout,objectClasses){if(!objectClasses.length)return;this._imagesLoadingTotal+=objectClasses.length;const promises=[];for(const oc of objectClasses)promises.push(layout.MaybeLoadTexturesFor(oc)); +await C3.PromiseAllWithProgress(promises,()=>{this._imagesLoadingComplete++});this._imagesLoadingComplete++;if(this._imagesLoadingComplete===this._imagesLoadingTotal){this._runtime.Trigger(C3.Plugins.System.Cnds.OnImageLoadingComplete,null,null);this._imagesLoadingComplete=0;this._imagesLoadingTotal=0}}_UnloadTexturesForObjectClasses(layout,objectClasses){for(const oc of objectClasses)if(oc.GetInstanceCount()===0)layout.MaybeUnloadTexturesFor(oc)}_GetForEachStack(){return forEachStack}_Repeat(count){const eventSheetManager= +this._runtime.GetEventSheetManager();const eventStack=eventSheetManager.GetEventStack();const oldFrame=eventStack.GetCurrentStackFrame();const currentEvent=oldFrame.GetCurrentEvent();const solModifiers=currentEvent.GetSolModifiers();const isSolModifierAfterCnds=oldFrame.IsSolModifierAfterCnds();const newFrame=eventStack.Push(currentEvent);const loopStack=eventSheetManager.GetLoopStack();const loop=loopStack.Push();loop.SetEnd(count);if(isSolModifierAfterCnds)for(let i=0;i=end&&!loop.IsStopped();--i){eventSheetManager.PushCopySol(solModifiers);loop.SetIndex(i);currentEvent.Retrigger(oldFrame,newFrame);eventSheetManager.PopSol(solModifiers)}else for(let i=start;i>= +end&&!loop.IsStopped();--i){loop.SetIndex(i);currentEvent.Retrigger(oldFrame,newFrame)}else if(isSolModifierAfterCnds)for(let i=start;i<=end&&!loop.IsStopped();++i){eventSheetManager.PushCopySol(solModifiers);loop.SetIndex(i);currentEvent.Retrigger(oldFrame,newFrame);eventSheetManager.PopSol(solModifiers)}else for(let i=start;i<=end&&!loop.IsStopped();++i){loop.SetIndex(i);currentEvent.Retrigger(oldFrame,newFrame)}eventStack.Pop();loopStack.Pop();return false}*_DebugFor(name,start,end){const eventSheetManager= +this._runtime.GetEventSheetManager();const eventStack=eventSheetManager.GetEventStack();const oldFrame=eventStack.GetCurrentStackFrame();const currentEvent=oldFrame.GetCurrentEvent();const solModifiers=currentEvent.GetSolModifiers();const isSolModifierAfterCnds=oldFrame.IsSolModifierAfterCnds();const newFrame=eventStack.Push(currentEvent);const loopStack=eventSheetManager.GetLoopStack();const loop=loopStack.Push();loop.SetName(name);loop.SetEnd(end);if(end=end&&!loop.IsStopped();--i){eventSheetManager.PushCopySol(solModifiers);loop.SetIndex(i);yield*currentEvent.DebugRetrigger(oldFrame,newFrame);eventSheetManager.PopSol(solModifiers)}else for(let i=start;i>=end&&!loop.IsStopped();--i){loop.SetIndex(i);yield*currentEvent.DebugRetrigger(oldFrame,newFrame)}else if(isSolModifierAfterCnds)for(let i=start;i<=end&&!loop.IsStopped();++i){eventSheetManager.PushCopySol(solModifiers);loop.SetIndex(i);yield*currentEvent.DebugRetrigger(oldFrame,newFrame); +eventSheetManager.PopSol(solModifiers)}else for(let i=start;i<=end&&!loop.IsStopped();++i){loop.SetIndex(i);yield*currentEvent.DebugRetrigger(oldFrame,newFrame)}eventStack.Pop();loopStack.Pop();return false}_ForEach(objectClass){const eventSheetManager=this._runtime.GetEventSheetManager();const eventStack=eventSheetManager.GetEventStack();const oldFrame=eventStack.GetCurrentStackFrame();const currentEvent=oldFrame.GetCurrentEvent();const solModifiers=currentEvent.GetSolModifiers();const isSolModifierAfterCnds= +oldFrame.IsSolModifierAfterCnds();const newFrame=eventStack.Push(currentEvent);const loopStack=eventSheetManager.GetLoopStack();const loop=loopStack.Push();const isInContainer=objectClass.IsInContainer();const sol=objectClass.GetCurrentSol();const instances=forEachStack.Push();C3.shallowAssignArray(instances,sol.GetInstances());loop.SetEnd(instances.length);if(isSolModifierAfterCnds)for(let i=0,len=instances.length;i=lastTime+thisSeconds){cndSavedData.set("Every_lastTime",lastTime+thisSeconds);if(curTime>=cndSavedData.get("Every_lastTime")+.04)cndSavedData.set("Every_lastTime",curTime);cndSavedData.set("Every_seconds",seconds);return true}else if(curTime=a&&x<=b},CompareVar(ev,cmp,val){return C3.compare(ev.GetValue(),cmp,val)},CompareBoolVar(ev){return!!ev.GetValue()}, +CompareTime(cmp,t){const gameTime=this._runtime.GetGameTime();if(cmp===0){const cnd=this._runtime.GetCurrentCondition();const cndSavedData=cnd.GetSavedDataMap();if(!cndSavedData.get("CompareTime_executed"))if(gameTime>=t){cndSavedData.set("CompareTime_executed",true);return true}return false}else return C3.compare(gameTime,cmp,t)},IsNaN(n){return isNaN(n)},AngleWithin(a1,within,a2){return C3.angleDiff(C3.toRadians(a1),C3.toRadians(a2))<=C3.toRadians(within)},IsClockwiseFrom(a1,a2){return C3.angleClockwise(C3.toRadians(a1), +C3.toRadians(a2))},IsBetweenAngles(a,la,ua){let angle=C3.toRadians(a);let lower=C3.toRadians(la);let upper=C3.toRadians(ua);let obtuse=!C3.angleClockwise(upper,lower);if(obtuse)return!(!C3.angleClockwise(angle,lower)&&C3.angleClockwise(angle,upper));else return C3.angleClockwise(angle,lower)&&!C3.angleClockwise(angle,upper)},IsValueType(v,t){if(typeof v==="number")return t===0;else return t===1},EvaluateExpression(v){return!!v},PickByComparison(objectClass,exp,cmp,val){if(!objectClass)return false; +const forEachStack=this._GetForEachStack();const tempInstances=forEachStack.Push();const sol=objectClass.GetCurrentSol();C3.shallowAssignArray(tempInstances,sol.GetInstances());if(sol.IsSelectAll())C3.clearArray(sol._GetOwnElseInstances());const cnd=this._runtime.GetCurrentCondition();let k=0;for(let i=0,len=tempInstances.length;i=instances.length)return false;const inst=instances[index];sol.PickOne(inst);objectClass.ApplySolToContainer();return true},PickRandom(objectClass){if(!objectClass)return false;const sol=objectClass.GetCurrentSol();const instances=sol.GetInstances();const index=Math.floor(this._runtime.Random()*instances.length);if(index>=instances.length)return false;const inst=instances[index];sol.PickOne(inst);objectClass.ApplySolToContainer();return true},PickAll(objectClass){if(!objectClass)return false; +if(!objectClass.GetInstanceCount())return false;const sol=objectClass.GetCurrentSol();sol._SetSelectAll(true);objectClass.ApplySolToContainer();return true},PickOverlappingPoint(objectClass,x,y){if(!objectClass)return false;const sol=objectClass.GetCurrentSol();const instances=sol.GetInstances();const currentEvent=this._runtime.GetCurrentEvent();const isOrBlock=currentEvent.IsOrBlock();const isInverted=this._runtime.GetCurrentCondition().IsInverted();if(sol.IsSelectAll()){C3.shallowAssignArray(tmpPickArray, +instances);sol.ClearArrays();sol._SetSelectAll(false)}else if(isOrBlock){C3.shallowAssignArray(tmpPickArray,sol._GetOwnElseInstances());C3.clearArray(sol._GetOwnElseInstances())}else{C3.shallowAssignArray(tmpPickArray,sol._GetOwnInstances());C3.clearArray(sol._GetOwnInstances())}for(let i=0,len=tmpPickArray.length;i=0;--i){const inst=instancesPendingCreate[i];if(isFamily){if(inst.GetObjectClass().BelongsToFamily(objectClass)){pick=inst;break}}else if(inst.GetObjectClass()===objectClass){pick=inst;break}}if(!pick){const instances= +objectClass.GetInstances();if(instances.length)pick=instances[instances.length-1]}if(!pick)return false;const sol=objectClass.GetCurrentSol();sol.PickOne(pick);objectClass.ApplySolToContainer();return true},Repeat(count){if(this._runtime.IsDebugging())return this._DebugRepeat(count);else return this._Repeat(count)},While(){if(this._runtime.IsDebugging())return this._DebugWhile();else return this._While()},For(name,start,end){if(this._runtime.IsDebugging())return this._DebugFor(name,start,end);else return this._For(name, +start,end)},ForEach(objectClass){if(this._runtime.IsDebugging())return this._DebugForEach(objectClass);else return this._ForEach(objectClass)},ForEachOrdered(objectClass,expression,order){if(this._runtime.IsDebugging())return this._DebugForEachOrdered(objectClass,order);else return this._ForEachOrdered(objectClass,order)},LayerVisible(layer){return layer?layer.IsVisible():false},LayerEmpty(layer){return layer?!layer.GetInstanceCount():false},LayerCmpOpacity(layer,cmp,o){if(!layer)return false;return C3.compare(layer.GetOpacity()* +100,cmp,o)},OnImageLoadingComplete(){return true},IsLoadingImages(){return this._imagesLoadingTotal>0}}}; + + +'use strict';{const C3=self.C3;function SortZOrderList(a,b){const layerA=a[0];const layerB=b[0];const diff=layerA-layerB;if(diff!==0)return diff;const indexA=a[1];const indexB=b[1];return indexA-indexB}function SortInstancesByValue(a,b){return a[1]-b[1]}const tempZOrderList=[];const tempInstValues=[];const tempRect=C3.New(C3.Rect);const tempColor=C3.New(C3.Color);C3.Plugins.System.Acts={SetVar(ev,x){ev.SetValue(x)},AddVar(ev,x){if(ev.IsNumber()&&typeof x!=="number")x=parseFloat(x);ev.SetValue(ev.GetValue()+ +x)},SubVar(ev,x){if(!ev.IsNumber())return;ev.SetValue(ev.GetValue()-x)},SetBoolVar(ev,x){ev.SetValue(!!x)},ToggleBoolVar(ev){ev.SetValue(!ev.GetValue())},ResetGlobals(){this._runtime.GetEventSheetManager().ResetAllGlobalsToInitialValue()},CreateObject(objectClass,layer,x,y,createHierarchy){if(!objectClass||!layer)return;const inst=this._runtime.CreateInstance(objectClass,layer,x,y,createHierarchy);if(!inst)return;if(createHierarchy)layer.SortAndAddSceneGraphInstancesByZIndex(inst);const eventSheetManager= +this._runtime.GetEventSheetManager();eventSheetManager.BlockFlushingInstances(true);inst._TriggerOnCreatedOnSelfAndRelated();eventSheetManager.BlockFlushingInstances(false);objectClass.GetCurrentSol().SetSinglePicked(inst);if(inst.IsInContainer())inst.SetSiblingsSinglePicked()},CreateObjectByName(objectClassName,layer,x,y,createHierarchy){if(!objectClassName||!layer)return;const objectClass=this._runtime.GetObjectClassByName(objectClassName);if(!objectClass)return;C3.Plugins.System.Acts.CreateObject.call(this, +objectClass,layer,x,y,createHierarchy)},RecreateInitialObjects(objectClass,x1,y1,x2,y2,sourceLayoutName,sourceLayerParam,offsetX,offsetY,createHierarchy){if(!objectClass)return;let sourceLayout=this._runtime.GetCurrentLayout();if(sourceLayoutName){const lookupLayout=this._runtime.GetLayoutManager().GetLayoutByName(sourceLayoutName);if(lookupLayout)sourceLayout=lookupLayout;else return}let sourceLayer=null;if(typeof sourceLayerParam!=="number"||sourceLayerParam>=0){sourceLayer=sourceLayout.GetLayer(sourceLayerParam); +if(!sourceLayer)return}tempRect.set(x1,y1,x2,y2);const allCreatedInstances=sourceLayout.RecreateInitialObjects(objectClass,tempRect,sourceLayer,offsetX,offsetY,createHierarchy);objectClass.GetCurrentSol().SetArrayPicked(allCreatedInstances);objectClass.ApplySolToContainer()},StopLoop(){const loopStack=this._loopStack;if(!loopStack.IsInLoop())return;loopStack.GetCurrent().Stop()},SetGroupActive(groupName,a){const group=this._runtime.GetEventSheetManager().GetEventGroupByName(groupName);if(!group)return; +if(a===0)group.SetGroupActive(false);else if(a===1)group.SetGroupActive(true);else group.SetGroupActive(!group.IsGroupActive())},SetTimescale(ts){this._runtime.SetTimeScale(ts)},SetObjectTimescale(objectClass,ts){if(ts<0)ts=0;if(!objectClass)return;const sol=objectClass.GetCurrentSol();const instances=sol.GetInstances();for(const inst of instances)inst.SetTimeScale(ts)},RestoreObjectTimescale(objectClass){if(!objectClass)return;const sol=objectClass.GetCurrentSol();const instances=sol.GetInstances(); +for(const inst of instances)inst.RestoreTimeScale()},Wait(seconds){if(seconds<0)return;this._runtime.GetEventSheetManager().AddScheduledWait().InitTimer(seconds);return true},WaitForSignal(tag){this._runtime.GetEventSheetManager().AddScheduledWait().InitSignal(tag);return true},WaitForPreviousActions(){const eventSheetManager=this._runtime.GetEventSheetManager();eventSheetManager.AddScheduledWait().InitPromise(eventSheetManager.GetPromiseForAllAsyncActions());return true},Signal(tag){const lowerTag= +tag.toLowerCase();for(const w of this._runtime.GetEventSheetManager().scheduledWaits())if(w.IsSignal()&&w.GetSignalTag()===lowerTag)w.SetSignalled()},async SnapshotCanvas(format,quality,x,y,width,height){const canvasManager=this._runtime.GetCanvasManager();if(!canvasManager)return;this.UpdateRender();await canvasManager.SnapshotCanvas(format===0?"image/png":"image/jpeg",quality/100,x,y,width,height);await this._runtime.TriggerAsync(C3.Plugins.System.Cnds.OnCanvasSnapshot,null)},SetCanvasSize(w,h){if(w<= +0||h<=0)return;this._runtime.SetViewportSize(w,h);const currentLayout=this._runtime.GetCurrentLayout();currentLayout.BoundScrolling();for(const layer of currentLayout.GetLayers())layer.UpdateViewport();const canvasManager=this._runtime.GetCanvasManager();if(!canvasManager)return;if(canvasManager.GetCurrentFullscreenMode()==="off")canvasManager.SetSize(canvasManager.GetLastWidth(),canvasManager.GetLastHeight(),true);else{this._runtime.SetOriginalViewportSize(w,h);canvasManager.SetSize(canvasManager.GetLastWidth(), +canvasManager.GetLastHeight(),true)}this._runtime.UpdateRender()},SetFullscreenQuality(q){const canvasManager=this._runtime.GetCanvasManager();if(!canvasManager)return;if(canvasManager.GetCurrentFullscreenMode()==="off")return;canvasManager.SetFullscreenScalingQuality(q!==0?"high":"low");canvasManager.SetSize(canvasManager.GetLastWidth(),canvasManager.GetLastHeight(),true)},SaveState(slot){this._runtime.SaveToSlot(slot)},LoadState(slot){this._runtime.LoadFromSlot(slot)},LoadStateJSON(jsonStr){this._runtime.LoadFromJsonString(jsonStr)}, +SetHalfFramerateMode(m){},ResetPersisted(){for(const layout of this._runtime.GetLayoutManager().GetAllLayouts())layout.ResetPersistData()},SetPixelRounding(m){this._runtime.SetPixelRoundingEnabled(m!==0)},SetMinimumFramerate(fps){this._runtime.SetMinimumFramerate(fps)},SortZOrderByInstVar(objectClass,instVar){if(!objectClass)return;const sol=objectClass.GetCurrentSol();const pickedInstances=sol.GetInstances();const zOrderList=tempZOrderList;const instValues=tempInstValues;const layout=this._runtime.GetCurrentLayout(); +const isFamily=objectClass.IsFamily();const familyIndex=objectClass.GetFamilyIndex();for(let i=0,len=pickedInstances.length;i=paramsArr.length)return;const paramType=effectType.GetShaderProgram().GetParameterType(paramIndex);if(paramType==="color"){tempColor.setFromRgbValue(value); +const curColor=paramsArr[paramIndex];if(tempColor.equalsIgnoringAlpha(curColor))return;curColor.copyRgb(tempColor)}else{if(paramType==="percent")value/=100;if(paramsArr[paramIndex]===value)return;paramsArr[paramIndex]=value}if(effectType.IsActive())this._runtime.UpdateRender()},SetLayerForceOwnTexture(layer,f){if(!layer)return;f=!!f;if(layer.IsForceOwnTexture()===f)return;layer.SetForceOwnTexture(f);this.UpdateRender()},SetLayoutScale(s){const layout=this._runtime.GetCurrentLayout();if(layout.GetScale()=== +s)return;layout.SetScale(s);this.UpdateRender()},SetLayoutAngle(a){a=C3.clampAngle(C3.toRadians(+a));const layout=this._runtime.GetCurrentLayout();if(layout.GetAngle()===a)return;layout.SetAngle(a);this.UpdateRender()},SetLayoutEffectEnabled(enabled,effectName){const layout=this._runtime.GetCurrentLayout();const effectList=layout.GetEffectList();const effectType=effectList.GetEffectTypeByName(effectName);if(!effectType)return;const e=enabled===1;if(effectType.IsActive()===e)return;effectType.SetActive(e); +effectList.UpdateActiveEffects();this._runtime.UpdateRender()},SetLayoutEffectParam(effectName,paramIndex,value){const layout=this._runtime.GetCurrentLayout();const effectList=layout.GetEffectList();const effectType=effectList.GetEffectTypeByName(effectName);if(!effectType)return;const effectTypeIndex=effectType.GetIndex();const paramsArr=effectList.GetEffectParametersForIndex(effectTypeIndex);paramIndex=Math.floor(paramIndex);if(paramIndex<0||paramIndex>=paramsArr.length)return;const paramType=effectType.GetShaderProgram().GetParameterType(paramIndex); +if(paramType==="color"){tempColor.setFromRgbValue(value);const curColor=paramsArr[paramIndex];if(tempColor.equalsIgnoringAlpha(curColor))return;curColor.copyRgb(tempColor)}else{if(paramType==="percent")value/=100;if(paramsArr[paramIndex]===value)return;paramsArr[paramIndex]=value}if(effectType.IsActive())this._runtime.UpdateRender()},ScrollX(x){const layout=this._runtime.GetCurrentLayout();layout.SetScrollX(x)},ScrollY(y){const layout=this._runtime.GetCurrentLayout();layout.SetScrollY(y)},Scroll(x, +y){const layout=this._runtime.GetCurrentLayout();layout.SetScrollX(x);layout.SetScrollY(y)},ScrollToObject(objectClass){if(!objectClass)return;const inst=objectClass.GetFirstPicked();if(!inst)return;const wi=inst.GetWorldInfo();if(!wi)return;const layout=this._runtime.GetCurrentLayout();layout.SetScrollX(wi.GetX());layout.SetScrollY(wi.GetY())},async LoadObjectTextures(objectClass){const layout=this._runtime.GetMainRunningLayout();if(!layout||!objectClass||this._runtime.IsLoading())return;const objectClasses= +objectClass.IsFamily()?objectClass.GetFamilyMembers():[objectClass];await this._LoadTexturesForObjectClasses(layout,objectClasses)},async LoadObjectTexturesByName(objectClassName){await C3.Plugins.System.Acts.LoadObjectTextures.call(this,this._runtime.GetObjectClassByName(objectClassName))},UnloadObjectTextures(objectClass){const layout=this._runtime.GetMainRunningLayout();if(!layout||!objectClass)return;const objectClasses=objectClass.IsFamily()?objectClass.GetFamilyMembers():[objectClass];this._UnloadTexturesForObjectClasses(layout, +objectClasses)},UnloadObjectTexturesByName(objectClassName){C3.Plugins.System.Acts.UnloadObjectTexturesByName.call(this,this._runtime.GetObjectClassByName(objectClassName))},UnloadUnusedTextures(){const layout=this._runtime.GetMainRunningLayout();if(!layout)return;const objectClasses=layout._GetTextureLoadedObjectTypes();this._UnloadTexturesForObjectClasses(layout,objectClasses)},async LoadLayoutTextures(loadLayout){const curLayout=this._runtime.GetMainRunningLayout();if(!loadLayout||!curLayout|| +this._runtime.IsLoading())return;await this._LoadTexturesForObjectClasses(curLayout,loadLayout._GetInitialObjectClasses())},async LoadLayoutTexturesByName(layoutName){const curLayout=this._runtime.GetMainRunningLayout();const loadLayout=this._runtime.GetLayoutManager().GetLayoutByName(layoutName);if(!loadLayout||!curLayout||this._runtime.IsLoading())return;await this._LoadTexturesForObjectClasses(curLayout,loadLayout._GetInitialObjectClasses())},SetFunctionReturnValue(v){const frame=this._eventStack.GetCurrentExpFuncStackFrame(); +if(!frame)return;switch(frame.GetFunctionReturnType()){case 1:if(typeof v==="number")frame.SetFunctionReturnValue(v);break;case 2:if(typeof v==="string")frame.SetFunctionReturnValue(v);break;case 3:frame.SetFunctionReturnValue(v);break}},MapFunction(name,str,functionBlock){const mapEntry=this._GetFunctionMap(name.toLowerCase(),true);const strMap=mapEntry.strMap;const lowerStr=str.toLowerCase();if(strMap.has(lowerStr))console.warn(`[Construct 3] Function map '${name}' string '${str}' already in map; overwriting entry`); +const firstFunctionBlock=C3.first(strMap.values())||mapEntry.defaultFunc;if(firstFunctionBlock){const firstReturnsValue=firstFunctionBlock.GetReturnType()!==0;const curReturnsValue=functionBlock.GetReturnType()!==0;if(firstReturnsValue!==curReturnsValue){console.error(`[Construct 3] Function map '${name}' string '${str}' function return type not compatible with other functions in the map; entry ignored`);return}}strMap.set(lowerStr,functionBlock)},MapFunctionDefault(name,functionBlock){const mapEntry= +this._GetFunctionMap(name.toLowerCase(),true);if(mapEntry.defaultFunc)console.warn(`[Construct 3] Function map '${name}' already has a default; overwriting entry`);const firstFunctionBlock=C3.first(mapEntry.strMap.values())||mapEntry.defaultFunc;if(firstFunctionBlock){const firstReturnsValue=firstFunctionBlock.GetReturnType()!==0;const curReturnsValue=functionBlock.GetReturnType()!==0;if(firstReturnsValue!==curReturnsValue){console.error(`[Construct 3] Function map '${name}' default: function return type not compatible with other functions in the map; entry ignored`); +return}}mapEntry.defaultFunc=functionBlock},CallMappedFunction(name,str,forwardParams){forwardParams=Math.floor(forwardParams);const mapEntry=this._GetFunctionMap(name.toLowerCase(),false);if(!mapEntry){console.warn(`[Construct 3] Call mapped function: map name '${name}' not found; call ignored`);return}let functionBlock=mapEntry.strMap.get(str.toLowerCase());if(!functionBlock)if(mapEntry.defaultFunc){functionBlock=mapEntry.defaultFunc;forwardParams=0}else{console.warn(`[Construct 3] Call mapped function: no function associated with map '${name}' string '${str}'; call ignored (consider setting a default)`); +return}if(!functionBlock.IsEnabled())return;if(functionBlock.GetReturnType()!==0){console.warn(`[Construct 3] Call mapped function: map '${name}' string '${str}' has a return type so cannot be called`);return}const runtime=this._runtime;const eventSheetManager=runtime.GetEventSheetManager();const currentEvent=eventSheetManager.GetCurrentEvent();const solModifiers=currentEvent.GetSolModifiersIncludingParents();const hasAnySolModifiers=solModifiers.length>0;if(hasAnySolModifiers)eventSheetManager.PushCleanSol(solModifiers); +const paramResults=[];const callerFunctionBlock=eventSheetManager.FindFirstFunctionBlockParent(currentEvent);if(callerFunctionBlock){const callerParameters=callerFunctionBlock.GetFunctionParameters();for(let i=forwardParams,len=callerParameters.length;in)ret=n}return ret},clamp(x,l,u){return C3.clamp(x,l,u)},distance(x1,y1,x2,y2){return C3.distanceTo(x1,y1,x2,y2)}, +angle(x1,y1,x2,y2){return C3.toDegrees(C3.angleTo(x1,y1,x2,y2))},lerp(a,b,x){return C3.lerp(a,b,x)},unlerp(a,b,y){return C3.unlerp(a,b,y)},qarp(a,b,c,x){return C3.qarp(a,b,c,x)},cubic(a,b,c,d,x){return C3.cubic(a,b,c,d,x)},cosp(a,b,x){return C3.cosp(a,b,x)},anglediff(a,b){return C3.toDegrees(C3.angleDiff(C3.toRadians(a),C3.toRadians(b)))},anglelerp(a,b,x){return C3.toDegrees(C3.angleLerp(C3.toRadians(a),C3.toRadians(b),x))},anglerotate(a,b,c){return C3.toDegrees(C3.angleRotate(C3.toRadians(a),C3.toRadians(b), +C3.toRadians(c)))},setbit(n,b,v){n=n|0;b=b|0;v=v!==0?1:0;return n&~(1<=arr.length)return"";return arr[index]},tokencount(text,sep){if(typeof text!=="string"||typeof sep!=="string"||!text.length)return 0;return text.split(sep).length},find(text,searchStr){if(typeof text==="string"&&typeof searchStr=== +"string")return text.search(new RegExp(C3.EscapeRegex(searchStr),"i"));else return-1},findcase(text,searchStr){if(typeof text==="string"&&typeof searchStr==="string")return text.search(new RegExp(C3.EscapeRegex(searchStr),""));else return-1},replace(text,find,replace){if(typeof text==="string"&&typeof find==="string"&&typeof replace==="string")return text.replace(new RegExp(C3.EscapeRegex(find),"gi"),replace);else return typeof text==="string"?text:""},regexsearch(text,regex,flags){const cacheRegex= +this.GetRegex(regex,flags);return text?text.search(cacheRegex):-1},regexreplace(text,regex,flags,replace){const cacheRegex=this.GetRegex(regex,flags);return text?text.replace(cacheRegex,replace):""},regexmatchcount(text,regex,flags){const matches=this.GetRegexMatches(text.toString(),regex,flags);return matches?matches.length:0},regexmatchat(text,regex,flags,index){index=Math.floor(index);const matches=this.GetRegexMatches(text.toString(),regex,flags);if(!matches||index<0||index>=matches.length)return""; +else return matches[index]},zeropad(n,d){let s=n<0?"-":"";if(n<0)n=-n;const zeroes=d-n.toString().length;s+="0".repeat(Math.max(zeroes,0));return s+n.toString()},urlencode(s){return encodeURIComponent(s)},urldecode(s){return decodeURIComponent(s)},dt(){return this._runtime._GetDtFast()},timescale(){return this._runtime.GetTimeScale()},wallclocktime(){return(Date.now()-this._runtime.GetStartTime())/1E3},unixtime(){return Date.now()},time(){return this._runtime.GetGameTime()},tickcount(){return this._runtime.GetTickCount()}, +objectcount(){return this._runtime.GetObjectCount()},fps(){return this._runtime.GetFPS()},cpuutilisation(){return this._runtime.GetMainThreadTime()},gpuutilisation(){return this._runtime.GetGPUUtilisation()},windowwidth(){return this._runtime.GetCanvasManager().GetDeviceWidth()},windowheight(){return this._runtime.GetCanvasManager().GetDeviceHeight()},originalwindowwidth(){return this._runtime.GetOriginalViewportWidth()},originalwindowheight(){return this._runtime.GetOriginalViewportHeight()},originalviewportwidth(){return this._runtime.GetOriginalViewportWidth()}, +originalviewportheight(){return this._runtime.GetOriginalViewportHeight()},scrollx(){return this._runtime.GetCurrentLayout().GetScrollX()},scrolly(){return this._runtime.GetCurrentLayout().GetScrollY()},layoutname(){return this._runtime.GetCurrentLayout().GetName()},layoutscale(){return this._runtime.GetCurrentLayout().GetScale()},layoutangle(){return C3.toDegrees(this._runtime.GetCurrentLayout().GetAngle())},layoutwidth(){return this._runtime.GetCurrentLayout().GetWidth()},layoutheight(){return this._runtime.GetCurrentLayout().GetHeight()}, +viewportleft(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.GetViewport().getLeft():0},viewporttop(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.GetViewport().getTop():0},viewportright(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.GetViewport().getRight():0},viewportbottom(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam); +return layer?layer.GetViewport().getBottom():0},viewportwidth(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.GetViewport().width():0},viewportheight(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.GetViewport().height():0},canvastolayerx(layerParam,x,y){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.CanvasCssToLayer(x,y)[0]:0},canvastolayery(layerParam,x,y){const layer= +this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.CanvasCssToLayer(x,y)[1]:0},layertocanvasx(layerParam,x,y){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.LayerToCanvasCss(x,y)[0]:0},layertocanvasy(layerParam,x,y){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.LayerToCanvasCss(x,y)[1]:0},layerscale(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.GetOwnScale(): +0},layerangle(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?C3.toDegrees(layer.GetOwnAngle()):0},layeropacity(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.GetOpacity()*100:0},layerscalerate(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.GetScaleRate():0},layerparallaxx(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer? +layer.GetParallaxX()*100:0},layerparallaxy(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.GetParallaxY()*100:0},layerzelevation(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.GetZElevation():0},layerindex(layerParam){const layer=this._runtime.GetCurrentLayout().GetLayer(layerParam);return layer?layer.GetIndex():-1},canvassnapshot(){const canvasManager=this._runtime.GetCanvasManager();if(!canvasManager)return""; +return canvasManager.GetCanvasSnapshotUrl()},loopindex(name){const loopStack=this._loopStack;if(!loopStack.IsInLoop())return 0;if(name){const loop=loopStack.FindByName(name);return loop?loop.GetIndex():0}else return loopStack.GetCurrent().GetIndex()},savestatejson(){return this._runtime.GetLastSaveJsonString()},callmapped(name,str,...paramResults){const mapEntry=this._GetFunctionMap(name.toLowerCase(),false);if(!mapEntry){console.warn(`[Construct 3] Call mapped function: map name '${name}' not found; returning 0`); +return 0}let functionBlock=mapEntry.strMap.get(str.toLowerCase());if(!functionBlock)if(mapEntry.defaultFunc)functionBlock=mapEntry.defaultFunc;else{console.warn(`[Construct 3] Call mapped function: no function associated with map '${name}' string '${str}'; returning 0 (consider setting a default)`);return 0}const returnType=functionBlock.GetReturnType();const defaultReturnValue=functionBlock.GetDefaultReturnValue();if(returnType===0){console.warn(`[Construct 3] Call mapped function: map '${name}' string '${str}' has no return type so cannot be called from an expression; returning 0`); +return 0}if(!functionBlock.IsEnabled())return defaultReturnValue;const runtime=this._runtime;const eventSheetManager=runtime.GetEventSheetManager();const currentEvent=eventSheetManager.GetCurrentEvent();const solModifiers=currentEvent.GetSolModifiersIncludingParents();const hasAnySolModifiers=solModifiers.length>0;if(hasAnySolModifiers)eventSheetManager.PushCleanSol(solModifiers);const calleeParameters=functionBlock.GetFunctionParameters();for(let i=paramResults.length,len=calleeParameters.length;i< +len;++i)paramResults.push(calleeParameters[i].GetInitialValue());const callEventBlock=functionBlock.GetEventBlock();const returnValue=callEventBlock.RunAsExpressionFunctionCall(callEventBlock.GetSolModifiersIncludingParents(),returnType,defaultReturnValue,...paramResults);if(hasAnySolModifiers)eventSheetManager.PopSol(solModifiers);return returnValue},loadingprogress(){return this._runtime.GetAssetManager().GetLoadProgress()},imageloadingprogress(){if(this._imagesLoadingTotal===0)return 1;return this._imagesLoadingComplete/ +this._imagesLoadingTotal},renderer(){return"webgl"},rendererdetail(){return this._runtime.GetWebGLRenderer().GetUnmaskedRenderer()},imagememoryusage(){let ret=this._runtime.GetWebGLRenderer().GetEstimatedTextureMemoryUsage();return Math.round(100*ret/(1024*1024))/100},rgb(r,g,b){return C3.PackRGB(r,g,b)},rgbex(r,g,b){return C3.PackRGBEx(r/100,g/100,b/100)},rgba(r,g,b,a){return C3.PackRGBAEx(r/100,g/100,b/100,a/100)},rgbex255(r,g,b){return C3.PackRGBEx(r/255,g/255,b/255)},rgba255(r,g,b,a){return C3.PackRGBAEx(r/ +255,g/255,b/255,a/255)},projectname(){return this._runtime.GetProjectName()},projectversion(){return this._runtime.GetProjectVersion()},currenteventsheetname(){return this._runtime.GetCurrentEvent().GetEventSheet().GetName()},currenteventnumber(){return this._runtime.GetCurrentEvent().GetDisplayNumber()}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Keyboard=class KeyboardPlugin extends C3.SDKPluginBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Keyboard.Type=class KeyboardType extends C3.SDKTypeBase{constructor(objectClass){super(objectClass)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return self.IKeyboardObjectType}};let keyboardObjectType=null;function GetKeyboardSdkInstance(){return keyboardObjectType.GetSingleGlobalInstance().GetSdkInstance()}self.IKeyboardObjectType=class IKeyboardObjectType extends self.IObjectClass{constructor(objectType){super(objectType);keyboardObjectType= +objectType;objectType.GetRuntime()._GetCommonScriptInterfaces().keyboard=this}isKeyDown(keyOrCode){const keyboardInst=GetKeyboardSdkInstance();if(typeof keyOrCode==="string")return keyboardInst.IsKeyDown(keyOrCode);else if(typeof keyOrCode==="number")return keyboardInst.IsKeyCodeDown(keyOrCode);else throw new TypeError("expected string or number");}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Keyboard.Instance=class KeyboardInstance extends C3.SDKInstanceBase{constructor(inst,properties){super(inst);this._keysDownByString=new Set;this._keysDownByWhich=new Set;this._triggerWhich=0;this._triggerString="";this._triggerTypedKey="";const rt=this.GetRuntime().Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(rt,"keydown",e=>this._OnKeyDown(e.data)),C3.Disposable.From(rt,"keyup",e=>this._OnKeyUp(e.data)),C3.Disposable.From(rt, +"window-blur",()=>this._OnWindowBlur()))}Release(){super.Release()}_OnKeyDown(e){const which=e["which"];const keyString=e["code"]||which.toString();const typedKey=e["key"];if(this._keysDownByString.has(keyString))return;this._keysDownByString.add(keyString);this._keysDownByWhich.add(which);this._triggerString=keyString;this._triggerWhich=which;this._triggerTypedKey=typedKey;this.Trigger(C3.Plugins.Keyboard.Cnds.OnAnyKey);this.Trigger(C3.Plugins.Keyboard.Cnds.OnKey);this.Trigger(C3.Plugins.Keyboard.Cnds.OnLeftRightKeyPressed); +this.Trigger(C3.Plugins.Keyboard.Cnds.OnKeyCode)}_OnKeyUp(e){const which=e["which"];const keyString=e["code"]||which.toString();const typedKey=e["key"];this._keysDownByString.delete(keyString);this._keysDownByWhich.delete(which);this._triggerString=keyString;this._triggerWhich=which;this._triggerTypedKey=typedKey;this.Trigger(C3.Plugins.Keyboard.Cnds.OnAnyKeyReleased);this.Trigger(C3.Plugins.Keyboard.Cnds.OnKeyReleased);this.Trigger(C3.Plugins.Keyboard.Cnds.OnLeftRightKeyReleased);this.Trigger(C3.Plugins.Keyboard.Cnds.OnKeyCodeReleased)}_OnWindowBlur(){for(const which of this._keysDownByWhich){this._keysDownByWhich.delete(which); +this._triggerWhich=which;this.Trigger(C3.Plugins.Keyboard.Cnds.OnAnyKeyReleased);this.Trigger(C3.Plugins.Keyboard.Cnds.OnKeyReleased);this.Trigger(C3.Plugins.Keyboard.Cnds.OnKeyCodeReleased)}this._keysDownByString.clear()}IsKeyDown(str){return this._keysDownByString.has(str)}IsKeyCodeDown(which){return this._keysDownByWhich.has(which)}SaveToJson(){return{"tk":this._triggerWhich,"tkk":this._triggerTypedKey}}LoadFromJson(o){this._triggerWhich=o["tk"];if(o.hasOwnProperty("tkk"))this._triggerTypedKey= +o["tkk"]}GetDebuggerProperties(){const prefix="plugins.keyboard";return[{title:prefix+".name",properties:[{name:prefix+".debugger.last-key-code",value:this._triggerWhich},{name:prefix+".debugger.last-key-string",value:C3.Plugins.Keyboard.Exps.StringFromKeyCode(this._triggerWhich)},{name:prefix+".debugger.last-typed-key",value:this._triggerTypedKey}]}]}}}; + + +'use strict';{const C3=self.C3;const LEFTRIGHT_KEY_STRINGS=["ShiftLeft","ShiftRight","ControlLeft","ControlRight","AltLeft","AltRight","MetaLeft","MetaRight"];C3.Plugins.Keyboard.Cnds={IsKeyDown(which){return this._keysDownByWhich.has(which)},OnKey(which){return this._triggerWhich===which},OnAnyKey(){return true},OnAnyKeyReleased(){return true},OnKeyReleased(which){return this._triggerWhich===which},IsKeyCodeDown(which){which=Math.floor(which);return this._keysDownByWhich.has(which)},OnKeyCode(which){return this._triggerWhich=== +which},OnKeyCodeReleased(which){return this._triggerWhich===which},OnLeftRightKeyPressed(index){const keyString=LEFTRIGHT_KEY_STRINGS[index];return this._triggerString===keyString},OnLeftRightKeyReleased(index){const keyString=LEFTRIGHT_KEY_STRINGS[index];return this._triggerString===keyString},IsLeftRightKeyDown(index){const keyString=LEFTRIGHT_KEY_STRINGS[index];return this._keysDownByString.has(keyString)}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Keyboard.Acts={}}; + + +'use strict';{const C3=self.C3;function StringFromCharCode(kc){kc=Math.floor(kc);switch(kc){case 8:return"backspace";case 9:return"tab";case 13:return"enter";case 16:return"shift";case 17:return"control";case 18:return"alt";case 19:return"pause";case 20:return"capslock";case 27:return"esc";case 33:return"pageup";case 34:return"pagedown";case 35:return"end";case 36:return"home";case 37:return"\u2190";case 38:return"\u2191";case 39:return"\u2192";case 40:return"\u2193";case 45:return"insert";case 46:return"del"; +case 91:return"left window key";case 92:return"right window key";case 93:return"select";case 96:return"numpad 0";case 97:return"numpad 1";case 98:return"numpad 2";case 99:return"numpad 3";case 100:return"numpad 4";case 101:return"numpad 5";case 102:return"numpad 6";case 103:return"numpad 7";case 104:return"numpad 8";case 105:return"numpad 9";case 106:return"numpad *";case 107:return"numpad +";case 109:return"numpad -";case 110:return"numpad .";case 111:return"numpad /";case 112:return"F1";case 113:return"F2"; +case 114:return"F3";case 115:return"F4";case 116:return"F5";case 117:return"F6";case 118:return"F7";case 119:return"F8";case 120:return"F9";case 121:return"F10";case 122:return"F11";case 123:return"F12";case 144:return"numlock";case 145:return"scroll lock";case 186:return";";case 187:return"=";case 188:return",";case 189:return"-";case 190:return".";case 191:return"/";case 192:return"'";case 219:return"[";case 220:return"\\";case 221:return"]";case 222:return"#";case 223:return"`";default:return String.fromCharCode(kc)}} +C3.Plugins.Keyboard.Exps={LastKeyCode(){return this._triggerWhich},StringFromKeyCode(kc){return StringFromCharCode(kc)},TypedKey(){return this._triggerTypedKey}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Audio=class AudioPlugin extends C3.SDKPluginBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Audio.Type=class AudioType extends C3.SDKTypeBase{constructor(objectClass){super(objectClass)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return self.IAudioObjectType}};function GetAudioDOMInterface(){if(self["C3Audio_DOMInterface"])return self["C3Audio_DOMInterface"];else throw new Error("audio scripting API cannot be used here - make sure the project is using DOM mode, not worker mode");}self.IAudioObjectType=class IAudioObjectType extends self.IObjectClass{constructor(objectType){super(objectType)}get audioContext(){return GetAudioDOMInterface().GetAudioContext()}get destinationNode(){return GetAudioDOMInterface().GetDestinationNode()}}}; + + +'use strict';{const C3=self.C3;const DOM_COMPONENT_ID="audio";const LATENCY_HINTS=["interactive","balanced","playback"];C3.Plugins.Audio.Instance=class AudioInstance extends C3.SDKInstanceBase{constructor(inst,properties){super(inst,DOM_COMPONENT_ID);this._nextPlayTime=0;this._triggerTag="";this._timeScaleMode=0;this._saveLoadMode=0;this._playInBackground=false;this._panningModel=1;this._distanceModel=1;this._listenerX=this._runtime.GetViewportWidth()/2;this._listenerY=this._runtime.GetViewportHeight()/ +2;this._listenerZ=-600;this._referenceDistance=600;this._maxDistance=1E4;this._rolloffFactor=1;this._listenerInst=null;this._loadListenerUid=-1;this._masterVolume=1;this._isSilent=false;this._sampleRate=0;this._effectCount=new Map;this._preloadTotal=0;this._preloadCount=0;this._remoteUrls=new Map;let latencyHint="interactive";if(properties){this._timeScaleMode=properties[0];this._saveLoadMode=properties[1];this._playInBackground=properties[2];latencyHint=LATENCY_HINTS[properties[3]];this._panningModel= +properties[4];this._distanceModel=properties[5];this._listenerZ=-properties[6];this._referenceDistance=properties[7];this._maxDistance=properties[8];this._rolloffFactor=properties[9]}this._lastAIState=[];this._lastFxState=[];this._lastAnalysersData=[];this.AddDOMMessageHandlers([["state",e=>this._OnUpdateState(e)],["fxstate",e=>this._OnUpdateFxState(e)],["trigger",e=>this._OnTrigger(e)]]);const rt=this.GetRuntime().Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(rt,"instancedestroy", +e=>this._OnInstanceDestroyed(e.instance)),C3.Disposable.From(rt,"afterload",()=>this._OnAfterLoad()),C3.Disposable.From(rt,"suspend",()=>this._OnSuspend()),C3.Disposable.From(rt,"resume",()=>this._OnResume()));this._runtime.AddLoadPromise(this.PostToDOMAsync("create-audio-context",{"preloadList":this._runtime.GetAssetManager().GetAudioToPreload().map(o=>({"originalUrl":o.originalUrl,"url":o.url,"type":o.type,"fileSize":o.fileSize})),"isiOSCordova":this._runtime.IsiOSCordova(),"timeScaleMode":this._timeScaleMode, +"latencyHint":latencyHint,"panningModel":this._panningModel,"distanceModel":this._distanceModel,"refDistance":this._referenceDistance,"maxDistance":this._maxDistance,"rolloffFactor":this._rolloffFactor,"listenerPos":[this._listenerX,this._listenerY,this._listenerZ]}).then(info=>{this._sampleRate=info["sampleRate"]}));this._StartTicking()}Release(){this._listenerInst=null;super.Release()}_OnInstanceDestroyed(inst){if(this._listenerInst===inst)this._listenerInst=null}DbToLinearNoCap(x){return Math.pow(10, +x/20)}DbToLinear(x){const v=this.DbToLinearNoCap(x);if(!isFinite(v))return 0;return Math.max(Math.min(v,1),0)}LinearToDbNoCap(x){return Math.log(x)/Math.log(10)*20}LinearToDb(x){return this.LinearToDbNoCap(Math.max(Math.min(x,1),0))}_OnSuspend(){if(this._playInBackground)return;this.PostToDOM("set-suspended",{"isSuspended":true})}_OnResume(){if(this._playInBackground)return;this.PostToDOM("set-suspended",{"isSuspended":false})}_OnUpdateState(e){const tickCount=e["tickCount"];const preservePlaceholders= +this._lastAIState.filter(ai=>ai.hasOwnProperty("placeholder")&&(ai["placeholder"]>tickCount||ai["placeholder"]===-1));this._lastAIState=e["audioInstances"];this._lastAnalysersData=e["analysers"];if(preservePlaceholders.length>0)C3.appendArray(this._lastAIState,preservePlaceholders)}_OnUpdateFxState(e){this._lastFxState=e["fxstate"]}_GetFirstAudioStateByTag(tag){for(const a of this._lastAIState)if(C3.equalsNoCase(a["tag"],tag))return a;return null}_IsTagPlaying(tag){return this._lastAIState.some(ai=> +C3.equalsNoCase(tag,ai["tag"])&&ai["isPlaying"])}_MaybeMarkAsPlaying(tag,isMusic,isLooping,vol){if(this._IsTagPlaying(tag))return null;const state={"tag":tag,"duration":0,"volume":vol,"isPlaying":true,"playbackTime":0,"playbackRate":1,"uid":-1,"bufferOriginalUrl":"","bufferUrl":"","bufferType":"","isMusic":isMusic,"isLooping":isLooping,"isMuted":false,"resumePosition":0,"pan":null,"placeholder":-1};this._lastAIState.push(state);return state}async _OnTrigger(e){const type=e["type"];this._triggerTag= +e["tag"];const aiId=e["aiid"];if(type==="ended"){for(const aiState of this._lastAIState)if(aiState["aiid"]===aiId){aiState["isPlaying"]=false;break}await this.TriggerAsync(C3.Plugins.Audio.Cnds.OnEnded)}else if(type==="fade-ended")await this.TriggerAsync(C3.Plugins.Audio.Cnds.OnFadeEnded)}Tick(){const o={"timeScale":this._runtime.GetTimeScale(),"gameTime":this._runtime.GetGameTime(),"instPans":this.GetInstancePans(),"tickCount":this._runtime.GetTickCountNoSave()};if(this._listenerInst){const wi=this._listenerInst.GetWorldInfo(); +this._listenerX=wi.GetX();this._listenerY=wi.GetY();o["listenerPos"]=[this._listenerX,this._listenerY,this._listenerZ]}this.PostToDOM("tick",o)}rotatePtAround(px,py,a,ox,oy){if(a===0)return[px,py];const sin_a=Math.sin(a);const cos_a=Math.cos(a);px-=ox;py-=oy;const left_sin_a=px*sin_a;const top_sin_a=py*sin_a;const left_cos_a=px*cos_a;const top_cos_a=py*cos_a;px=left_cos_a-top_sin_a;py=top_cos_a+left_sin_a;px+=ox;py+=oy;return[px,py]}GetInstancePans(){return this._lastAIState.filter(ai=>ai["uid"]!== +-1).map(ai=>this._runtime.GetInstanceByUID(ai["uid"])).filter(inst=>inst).map(inst=>{const wi=inst.GetWorldInfo();const layerAngle=wi.GetLayer().GetAngle();const [x,y]=this.rotatePtAround(wi.GetX(),wi.GetY(),-layerAngle,this._listenerX,this._listenerY);return{"uid":inst.GetUID(),"x":x,"y":y,"angle":wi.GetAngle()-layerAngle}})}GetAnalyserData(tag,index){for(const o of this._lastAnalysersData)if(o.index===index&&C3.equalsNoCase(o.tag,tag))return o;return null}_IncrementEffectCount(tag){this._effectCount.set(tag, +(this._effectCount.get(tag)||0)+1)}_ShouldSave(ai){if(ai.hasOwnProperty("placeholder"))return false;if(this._saveLoadMode===3)return false;else if(ai["isMusic"]&&this._saveLoadMode===1)return false;else if(!ai["isMusic"]&&this._saveLoadMode===2)return false;else return true}SaveToJson(){return{"isSilent":this._isSilent,"masterVolume":this._masterVolume,"listenerZ":this._listenerZ,"listenerUid":this._listenerInst?this._listenerInst.GetUID():-1,"remoteUrls":[...this._remoteUrls.entries()],"playing":this._lastAIState.filter(ai=> +this._ShouldSave(ai)),"effects":this._lastFxState,"analysers":this._lastAnalysersData}}LoadFromJson(o){this._isSilent=o["isSilent"];this._masterVolume=o["masterVolume"];this._listenerZ=o["listenerZ"];this._listenerInst=null;this._loadListenerUid=o["listenerUid"];this._remoteUrls.clear();if(o["remoteUrls"])for(const [k,v]of o["remoteUrls"])this._remoteUrls.set(k,v);this._lastAIState=o["playing"];this._lastFxState=o["effects"];this._lastAnalysersData=o["analysers"]}_OnAfterLoad(){if(this._loadListenerUid!== +-1){this._listenerInst=this._runtime.GetInstanceByUID(this._loadListenerUid);this._loadListenerUid=-1;if(this._listenerInst){const wi=this._listenerInst.GetWorldInfo();this._listenerX=wi.GetX();this._listenerY=wi.GetY()}}for(const ai of this._lastAIState){const info=this._runtime.GetAssetManager().GetProjectAudioFileUrl(ai["bufferOriginalUrl"]);if(info){ai["bufferUrl"]=info.url;ai["bufferType"]=info.type}else ai["bufferUrl"]=null}for(const fxChainData of Object.values(this._lastFxState))for(const fxData of fxChainData)if(fxData.hasOwnProperty("bufferOriginalUrl")){const info= +this._runtime.GetAssetManager().GetProjectAudioFileUrl(fxData["bufferOriginalUrl"]);if(info){fxData["bufferUrl"]=info.url;fxData["bufferType"]=info.type}}this.PostToDOM("load-state",{"saveLoadMode":this._saveLoadMode,"timeScale":this._runtime.GetTimeScale(),"gameTime":this._runtime.GetGameTime(),"listenerPos":[this._listenerX,this._listenerY,this._listenerZ],"isSilent":this._isSilent,"masterVolume":this._masterVolume,"playing":this._lastAIState.filter(ai=>ai["bufferUrl"]!==null),"effects":this._lastFxState})}GetDebuggerProperties(){const fxProps= +[];for(const [tag,fxChainData]of Object.entries(this._lastFxState))fxProps.push({name:"$"+tag,value:fxChainData.map(d=>d["type"]).join(", ")});const prefix="plugins.audio.debugger";return[{title:prefix+".tag-effects",properties:fxProps},{title:prefix+".currently-playing",properties:[{name:prefix+".currently-playing-count",value:this._lastAIState.length},...this._lastAIState.map((s,index)=>({name:"$#"+index,value:`${s["bufferOriginalUrl"]} ("${s["tag"]}") ${Math.round(s["playbackTime"]*10)/10} / ${Math.round(s["duration"]* +10)/10}`}))]}]}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Audio.Cnds={OnEnded(tag){return C3.equalsNoCase(this._triggerTag,tag)},OnFadeEnded(tag){return C3.equalsNoCase(this._triggerTag,tag)},PreloadsComplete(){return this._preloadCount===this._preloadTotal},AdvancedAudioSupported(){return true},IsSilent(){return this._isSilent},IsAnyPlaying(){for(const ai of this._lastAIState)if(ai["isPlaying"])return true;return false},IsTagPlaying(tag){return this._IsTagPlaying(tag)}}}; + + +'use strict';{const C3=self.C3;const FILTER_TYPES=["lowpass","highpass","bandpass","lowshelf","highshelf","peaking","notch","allpass"];C3.Plugins.Audio.Acts={async Play(file,looping,vol,tag){if(this._isSilent)return;const isMusic=file[1];const info=this._runtime.GetAssetManager().GetProjectAudioFileUrl(file[0]);if(!info)return;const nextPlayTime=this._nextPlayTime;this._nextPlayTime=0;const state=this._MaybeMarkAsPlaying(tag.toLowerCase(),isMusic,looping!==0,this.DbToLinear(vol));try{await this.PostToDOMAsync("play", +{"originalUrl":file[0],"url":info.url,"type":info.type,"isMusic":isMusic,"tag":tag.toLowerCase(),"isLooping":looping!==0,"vol":this.DbToLinear(vol),"pos":0,"off":nextPlayTime,"trueClock":!!self["C3_GetAudioContextCurrentTime"]})}finally{if(state)state["placeholder"]=this._runtime.GetTickCountNoSave()}},async PlayAtPosition(file,looping,vol,x,y,angle,innerAngle,outerAngle,outerGain,tag){if(this._isSilent)return;const isMusic=file[1];const info=this._runtime.GetAssetManager().GetProjectAudioFileUrl(file[0]); +if(!info)return;const nextPlayTime=this._nextPlayTime;this._nextPlayTime=0;const state=this._MaybeMarkAsPlaying(tag.toLowerCase(),isMusic,looping!==0,this.DbToLinear(vol));try{await this.PostToDOMAsync("play",{"originalUrl":file[0],"url":info.url,"type":info.type,"isMusic":isMusic,"tag":tag.toLowerCase(),"isLooping":looping!==0,"vol":this.DbToLinear(vol),"pos":0,"off":nextPlayTime,"trueClock":!!self["C3_GetAudioContextCurrentTime"],"panning":{"x":x,"y":y,"angle":C3.toRadians(angle),"innerAngle":C3.toRadians(innerAngle), +"outerAngle":C3.toRadians(outerAngle),"outerGain":this.DbToLinear(outerGain)}})}finally{if(state)state["placeholder"]=this._runtime.GetTickCountNoSave()}},async PlayAtObject(file,looping,vol,objectClass,innerAngle,outerAngle,outerGain,tag){if(this._isSilent)return;if(!objectClass)return;const inst=objectClass.GetFirstPicked();if(!inst||!inst.GetWorldInfo())return;const wi=inst.GetWorldInfo();const layerAngle=wi.GetLayer().GetAngle();const [x,y]=this.rotatePtAround(wi.GetX(),wi.GetY(),-layerAngle, +this._listenerX,this._listenerY);const isMusic=file[1];const info=this._runtime.GetAssetManager().GetProjectAudioFileUrl(file[0]);if(!info)return;const nextPlayTime=this._nextPlayTime;this._nextPlayTime=0;const state=this._MaybeMarkAsPlaying(tag.toLowerCase(),isMusic,looping!==0,this.DbToLinear(vol));try{await this.PostToDOMAsync("play",{"originalUrl":file[0],"url":info.url,"type":info.type,"isMusic":isMusic,"tag":tag.toLowerCase(),"isLooping":looping!==0,"vol":this.DbToLinear(vol),"pos":0,"off":nextPlayTime, +"trueClock":!!self["C3_GetAudioContextCurrentTime"],"panning":{"x":x,"y":y,"angle":wi.GetAngle()-layerAngle,"innerAngle":C3.toRadians(innerAngle),"outerAngle":C3.toRadians(outerAngle),"outerGain":this.DbToLinear(outerGain),"uid":inst.GetUID()}})}finally{if(state)state["placeholder"]=this._runtime.GetTickCountNoSave()}},async PlayByName(folder,filename,looping,vol,tag){if(this._isSilent)return;const isMusic=folder===1;const info=this._runtime.GetAssetManager().GetProjectAudioFileUrl(filename)||this._remoteUrls.get(filename.toLowerCase()); +if(!info)return;const nextPlayTime=this._nextPlayTime;this._nextPlayTime=0;const state=this._MaybeMarkAsPlaying(tag.toLowerCase(),isMusic,looping!==0,this.DbToLinear(vol));try{await this.PostToDOMAsync("play",{"originalUrl":filename,"url":info.url,"type":info.type,"isMusic":isMusic,"tag":tag.toLowerCase(),"isLooping":looping!==0,"vol":this.DbToLinear(vol),"pos":0,"off":nextPlayTime,"trueClock":!!self["C3_GetAudioContextCurrentTime"]})}finally{if(state)state["placeholder"]=this._runtime.GetTickCountNoSave()}}, +async PlayAtPositionByName(folder,filename,looping,vol,x,y,angle,innerAngle,outerAngle,outerGain,tag){if(this._isSilent)return;const isMusic=folder===1;const info=this._runtime.GetAssetManager().GetProjectAudioFileUrl(filename)||this._remoteUrls.get(filename.toLowerCase());if(!info)return;const nextPlayTime=this._nextPlayTime;this._nextPlayTime=0;const state=this._MaybeMarkAsPlaying(tag.toLowerCase(),isMusic,looping!==0,this.DbToLinear(vol));try{await this.PostToDOMAsync("play",{"originalUrl":filename, +"url":info.url,"type":info.type,"isMusic":isMusic,"tag":tag.toLowerCase(),"isLooping":looping!==0,"vol":this.DbToLinear(vol),"pos":0,"off":nextPlayTime,"trueClock":!!self["C3_GetAudioContextCurrentTime"],"panning":{"x":x,"y":y,"angle":C3.toRadians(angle),"innerAngle":C3.toRadians(innerAngle),"outerAngle":C3.toRadians(outerAngle),"outerGain":this.DbToLinear(outerGain)}})}finally{if(state)state["placeholder"]=this._runtime.GetTickCountNoSave()}},async PlayAtObjectByName(folder,filename,looping,vol, +objectClass,innerAngle,outerAngle,outerGain,tag){if(this._isSilent)return;if(this._isSilent)return;if(!objectClass)return;const inst=objectClass.GetFirstPicked();if(!inst||!inst.GetWorldInfo())return;const wi=inst.GetWorldInfo();const layerAngle=wi.GetLayer().GetAngle();const [x,y]=this.rotatePtAround(wi.GetX(),wi.GetY(),-layerAngle,this._listenerX,this._listenerY);const isMusic=folder===1;const info=this._runtime.GetAssetManager().GetProjectAudioFileUrl(filename)||this._remoteUrls.get(filename.toLowerCase()); +if(!info)return;const nextPlayTime=this._nextPlayTime;this._nextPlayTime=0;const state=this._MaybeMarkAsPlaying(tag.toLowerCase(),isMusic,looping!==0,this.DbToLinear(vol));try{await this.PostToDOMAsync("play",{"originalUrl":filename,"url":info.url,"type":info.type,"isMusic":isMusic,"tag":tag.toLowerCase(),"isLooping":looping!==0,"vol":this.DbToLinear(vol),"pos":0,"off":nextPlayTime,"trueClock":!!self["C3_GetAudioContextCurrentTime"],"panning":{"x":x,"y":y,"angle":wi.GetAngle()-layerAngle,"innerAngle":C3.toRadians(innerAngle), +"outerAngle":C3.toRadians(outerAngle),"outerGain":this.DbToLinear(outerGain),"uid":inst.GetUID()}})}finally{if(state)state["placeholder"]=this._runtime.GetTickCountNoSave()}},SetLooping(tag,looping){this.PostToDOM("set-looping",{"tag":tag.toLowerCase(),"isLooping":looping===0})},SetMuted(tag,muted){this.PostToDOM("set-muted",{"tag":tag.toLowerCase(),"isMuted":muted===0})},SetVolume(tag,vol){this.PostToDOM("set-volume",{"tag":tag.toLowerCase(),"vol":this.DbToLinear(vol)})},FadeVolume(tag,vol,duration, +ending){this.PostToDOM("fade-volume",{"tag":tag.toLowerCase(),"vol":this.DbToLinear(vol),"duration":duration,"stopOnEnd":ending===0})},async Preload(file){const isMusic=file[1];const info=this._runtime.GetAssetManager().GetProjectAudioFileUrl(file[0]);if(!info)return;this._preloadTotal++;await this.PostToDOMAsync("preload",{"originalUrl":file[0],"url":info.url,"type":info.type,"isMusic":isMusic});this._preloadCount++},async PreloadByName(folder,filename){const isMusic=folder===1;const info=this._runtime.GetAssetManager().GetProjectAudioFileUrl(filename)|| +this._remoteUrls.get(filename.toLowerCase());if(!info)return;this._preloadTotal++;await this.PostToDOMAsync("preload",{"originalUrl":filename,"url":info.url,"type":info.type,"isMusic":isMusic});this._preloadCount++},SetPlaybackRate(tag,rate){this.PostToDOM("set-playback-rate",{"tag":tag.toLowerCase(),"rate":Math.max(rate,0)})},Stop(tag){this.PostToDOM("stop",{"tag":tag.toLowerCase()})},StopAll(){this.PostToDOM("stop-all")},SetPaused(tag,state){this.PostToDOM("set-paused",{"tag":tag.toLowerCase(), +"paused":state===0})},Seek(tag,pos){this.PostToDOM("seek",{"tag":tag.toLowerCase(),"pos":pos})},SetSilent(s){if(s===2)s=this._isSilent?1:0;s=s===0;if(this._isSilent===s)return;this._isSilent=s;this.PostToDOM("set-silent",{"isSilent":s})},SetMasterVolume(vol){const mv=this.DbToLinear(vol);if(this._masterVolume===mv)return;this._masterVolume=mv;this.PostToDOM("set-master-volume",{"vol":mv})},AddFilterEffect(tag,type,freq,detune,q,gain,mix){tag=tag.toLowerCase();const typeStr=FILTER_TYPES[type];this._IncrementEffectCount(tag); +this.PostToDOM("add-effect",{"type":"filter","tag":tag,"params":[typeStr,freq,detune,q,gain,C3.clamp(mix/100,0,1)]})},AddDelayEffect(tag,delay,gain,mix){tag=tag.toLowerCase();this._IncrementEffectCount(tag);this.PostToDOM("add-effect",{"type":"delay","tag":tag,"params":[delay,this.DbToLinear(gain),C3.clamp(mix/100,0,1)]})},AddFlangerEffect(tag,delay,modulation,freq,feedback,mix){tag=tag.toLowerCase();this._IncrementEffectCount(tag);this.PostToDOM("add-effect",{"type":"flanger","tag":tag,"params":[delay/ +1E3,modulation/1E3,freq,feedback/100,C3.clamp(mix/100,0,1)]})},AddPhaserEffect(tag,freq,detune,q,mod,modfreq,mix){tag=tag.toLowerCase();this._IncrementEffectCount(tag);this.PostToDOM("add-effect",{"type":"phaser","tag":tag,"params":[freq,detune,q,mod,modfreq,C3.clamp(mix/100,0,1)]})},AddConvolutionEffect(tag,file,norm,mix){tag=tag.toLowerCase();const info=this._runtime.GetAssetManager().GetProjectAudioFileUrl(file[0]);if(!info)return;this._IncrementEffectCount(tag);this.PostToDOM("add-effect",{"type":"convolution", +"tag":tag,"bufferOriginalUrl":file[0],"bufferUrl":info.url,"bufferType":info.type,"params":[norm===0,C3.clamp(mix/100,0,1)]})},AddGainEffect(tag,g){tag=tag.toLowerCase();this._IncrementEffectCount(tag);this.PostToDOM("add-effect",{"type":"gain","tag":tag,"params":[this.DbToLinear(g)]})},AddMuteEffect(tag){tag=tag.toLowerCase();this._IncrementEffectCount(tag);this.PostToDOM("add-effect",{"type":"gain","tag":tag,"params":[0]})},AddTremoloEffect(tag,freq,mix){tag=tag.toLowerCase();this._IncrementEffectCount(tag); +this.PostToDOM("add-effect",{"type":"tremolo","tag":tag,"params":[freq,C3.clamp(mix/100,0,1)]})},AddRingModEffect(tag,freq,mix){tag=tag.toLowerCase();this._IncrementEffectCount(tag);this.PostToDOM("add-effect",{"type":"ringmod","tag":tag,"params":[freq,C3.clamp(mix/100,0,1)]})},AddDistortionEffect(tag,threshold,headroom,drive,makeupgain,mix){tag=tag.toLowerCase();this._IncrementEffectCount(tag);this.PostToDOM("add-effect",{"type":"distortion","tag":tag,"params":[this.DbToLinearNoCap(threshold),this.DbToLinearNoCap(headroom), +drive,this.DbToLinearNoCap(makeupgain),C3.clamp(mix/100,0,1)]})},AddCompressorEffect(tag,threshold,knee,ratio,attack,release){tag=tag.toLowerCase();this._IncrementEffectCount(tag);this.PostToDOM("add-effect",{"type":"compressor","tag":tag,"params":[threshold,knee,ratio,attack/1E3,release/1E3]})},AddAnalyserEffect(tag,fftSize,smoothing){tag=tag.toLowerCase();this._IncrementEffectCount(tag);this.PostToDOM("add-effect",{"type":"analyser","tag":tag,"params":[fftSize,smoothing]})},RemoveEffects(tag){tag= +tag.toLowerCase();this._effectCount.set(tag,0);this.PostToDOM("remove-effects",{"tag":tag});this._lastFxState={}},SetEffectParameter(tag,index,param,value,ramp,time){this.PostToDOM("set-effect-param",{"tag":tag.toLowerCase(),"index":Math.floor(index),"param":param,"value":value,"ramp":ramp,"time":time})},SetListenerObject(objectClass){if(!objectClass)return;const inst=objectClass.GetFirstPicked();if(!inst||!inst.GetWorldInfo())return;this._listenerInst=inst},SetListenerZ(z){this._listenerZ=z},ScheduleNextPlay(t){this._nextPlayTime= +Math.max(t,0)},UnloadAudio(file){const isMusic=file[1];const info=this._runtime.GetAssetManager().GetProjectAudioFileUrl(file[0]);if(!info)return;this.PostToDOM("unload",{"url":info.url,"type":info.type,"isMusic":isMusic})},UnloadAudioByName(folder,filename){const isMusic=folder===1;const info=this._runtime.GetAssetManager().GetProjectAudioFileUrl(filename)||this._remoteUrls.get(filename.toLowerCase());if(!info)return;this.PostToDOM("unload",{"url":info.url,"type":info.type,"isMusic":isMusic})},UnloadAll(){this.PostToDOM("unload-all")}, +AddRemoteURL(url,type,name){this._remoteUrls.set(name.toLowerCase(),{url,type})}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Audio.Exps={Duration(tag){const a=this._GetFirstAudioStateByTag(tag);return a?a["duration"]:0},PlaybackTime(tag){const a=this._GetFirstAudioStateByTag(tag);return a?a["playbackTime"]:0},PlaybackRate(tag){const a=this._GetFirstAudioStateByTag(tag);return a?a["playbackRate"]:0},Volume(tag){const a=this._GetFirstAudioStateByTag(tag);return a?this.LinearToDb(a["volume"]):0},MasterVolume(){return this.LinearToDb(this._masterVolume)},EffectCount(tag){return this._effectCount.get(tag.toLowerCase())|| +0},AnalyserFreqBinCount(tag,index){const o=this.GetAnalyserData(tag,Math.floor(index));return o?o["binCount"]:0},AnalyserFreqBinAt(tag,index,bin){const o=this.GetAnalyserData(tag,Math.floor(index));if(!o)return 0;bin=Math.floor(bin);if(bin<0||bin>=o["binCount"])return 0;return o["freqBins"][bin]},AnalyserPeakLevel(tag,index){const o=this.GetAnalyserData(tag,Math.floor(index));return o?o["peak"]:0},AnalyserRMSLevel(tag,index){const o=this.GetAnalyserData(tag,Math.floor(index));return o?o["rms"]:0}, +SampleRate(){return this._sampleRate},CurrentTime(){if(self["C3_GetAudioContextCurrentTime"])return self["C3_GetAudioContextCurrentTime"]();else return performance.now()/1E3}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Function=class FunctionPlugin extends C3.SDKPluginBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Function.Type=class FunctionType extends C3.SDKTypeBase{constructor(objectClass){super(objectClass)}Release(){super.Release()}OnCreate(){}}}; + + +'use strict';{const C3=self.C3;class FuncStackEntry{constructor(){this.name="";this.retVal=0;this.params=[]}}C3.Plugins.Function.Instance=class FunctionInstance extends C3.SDKInstanceBase{constructor(inst,properties){super(inst);this._isPreview=this._runtime.IsPreview();this._funcStackPtr=-1;this._funcStack=[];const invokeFromJs=(name,params)=>this._InvokeFromJS(name,params);self["c2_callFunction"]=invokeFromJs;self["c3_callFunction"]=invokeFromJs}Release(){super.Release()}Push(){const funcStack= +this._funcStack;const i=++this._funcStackPtr;if(i===funcStack.length)funcStack.push(new FuncStackEntry);return funcStack[i]}Pop(){--this._funcStackPtr}GetCurrent(){const i=this._funcStackPtr;if(i<0)return null;return this._funcStack[i]}GetOneAbove(){const funcStack=this._funcStack;if(!funcStack.length)return null;const i=Math.min(this._funcStackPtr+1,funcStack.length-1);return funcStack[i]}_CallFunction(name,params){const fs=this.Push();fs.name=name.toLowerCase();fs.retVal=0;C3.shallowAssignArray(fs.params, +params);const ran=this.FastTrigger(C3.Plugins.Function.Cnds.OnFunction,fs.name);if(this._isPreview&&!ran)console.warn(`[Construct 3] Function object: called function '${name}' but no event was triggered. Is the function call spelt incorrectly or no longer used?`);this.Pop()}*_DebugCallFunction(name,params){const fs=this.Push();fs.name=name.toLowerCase();fs.retVal=0;C3.shallowAssignArray(fs.params,params);const ran=yield*this.DebugFastTrigger(C3.Plugins.Function.Cnds.OnFunction,fs.name);if(this._isPreview&& +!ran)console.warn(`[Construct 3] Function object: called function '${name}' but no event was triggered. Is the function call spelt incorrectly or no longer used?`);this.Pop()}_InvokeFromJS(name,params){const fs=this.Push();fs.name=name.toLowerCase();fs.retVal=0;fs.params=(params||[]).map(v=>{if(typeof v==="number"||typeof v==="string")return v;else if(typeof v==="boolean")return v?1:0;else return 0});this.FastTrigger(C3.Plugins.Function.Cnds.OnFunction,fs.name);this.Pop();return fs.retVal}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Function.Cnds={OnFunction(name){return true},CompareParam(index,cmp,value){const fs=this.GetCurrent();if(!fs){if(this._isPreview)console.warn(`[Construct 3] Function object: used 'Compare parameter' condition when not in a function call`);return false}const params=fs.params;index=Math.floor(index);let paramValue=0;if(index<0||index>=params.length){if(this._isPreview)console.warn(`[Construct 3] Function object: in function '${fs.name}', compared parameter out of bounds (accessed index ${index} of ${params.length})`)}else paramValue= +params[index];return C3.compare(paramValue,cmp,value)}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Function.Acts={CallFunction(name,params){if(this._runtime.IsDebugging())return this._DebugCallFunction(name,params);else this._CallFunction(name,params)},SetReturnValue(value){const fs=this.GetCurrent();if(fs)fs.retVal=value;else if(this._isPreview)console.warn(`[Construct 3] Function object: used 'Set return value' when not in a function call`)},CallExpression(unused){}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Function.Exps={ReturnValue(){const fs=this.GetOneAbove();return fs?fs.retVal:0},ParamCount(){const fs=this.GetCurrent();if(fs)return fs.params.length;else{if(this._isPreview)console.warn(`[Construct 3] Function object: used 'ParamCount' expression when not in a function call`);return 0}},Param(index){index=Math.floor(index);const fs=this.GetCurrent();if(fs){const params=fs.params;if(index>=0&&indexthis._OnOnlineStateChanged(e)], +["backbutton",()=>this._OnBackButton()],["sw-message",e=>this._OnSWMessage(e)],["hashchange",e=>this._OnHashChange(e)]]);const rt=this.GetRuntime().Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(rt,"afterfirstlayoutstart",()=>this._OnAfterFirstLayoutStart()),C3.Disposable.From(rt,"window-resize",()=>this._OnWindowResize()),C3.Disposable.From(rt,"suspend",()=>this._OnSuspend()),C3.Disposable.From(rt,"resume",()=>this._OnResume()));this._runtime.AddLoadPromise(this.PostToDOMAsync("get-initial-state", +{"exportType":this._runtime.GetExportType()}).then(data=>{this._initLocationStr=data["location"];this._isOnline=data["isOnline"];this._referrer=data["referrer"];this._docTitle=data["title"];this._isCookieEnabled=data["isCookieEnabled"];this._screenWidth=data["screenWidth"];this._screenHeight=data["screenHeight"];this._windowOuterWidth=data["windowOuterWidth"];this._windowOuterHeight=data["windowOuterHeight"];this._isScirraArcade=data["isScirraArcade"]}))}Release(){super.Release()}_OnAfterFirstLayoutStart(){this.PostToDOM("ready-for-sw-messages")}async _OnOnlineStateChanged(e){const isOnline= +!!e["isOnline"];if(this._isOnline===isOnline)return;this._isOnline=isOnline;if(this._isOnline)await this.TriggerAsync(C3.Plugins.Browser.Cnds.OnOnline);else await this.TriggerAsync(C3.Plugins.Browser.Cnds.OnOffline)}async _OnWindowResize(){await this.TriggerAsync(C3.Plugins.Browser.Cnds.OnResize)}_OnSuspend(){this.Trigger(C3.Plugins.Browser.Cnds.OnPageHidden)}_OnResume(){this.Trigger(C3.Plugins.Browser.Cnds.OnPageVisible)}async _OnBackButton(){await this.TriggerAsync(C3.Plugins.Browser.Cnds.OnBackButton)}_OnSWMessage(e){const messageType= +e["type"];if(messageType==="downloading-update")this.Trigger(C3.Plugins.Browser.Cnds.OnUpdateFound);else if(messageType==="update-ready"||messageType==="update-pending")this.Trigger(C3.Plugins.Browser.Cnds.OnUpdateReady);else if(messageType==="offline-ready")this.Trigger(C3.Plugins.Browser.Cnds.OnOfflineReady)}_OnHashChange(e){this._initLocationStr=e["location"];this.Trigger(C3.Plugins.Browser.Cnds.OnHashChange)}GetDebuggerProperties(){const prefix="plugins.browser.debugger";return[{title:"plugins.browser.name", +properties:[{name:prefix+".user-agent",value:navigator.userAgent},{name:prefix+".is-online",value:this._isOnline},{name:prefix+".is-fullscreen",value:this._runtime.GetCanvasManager().IsDocumentFullscreen()}]}]}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Browser.Cnds={IsOnline(){return this._isOnline},OnOnline(){return true},OnOffline(){return true},OnResize(){return true},CookiesEnabled(){return this._isCookieEnabled},IsFullscreen(){return this._runtime.GetCanvasManager().IsDocumentFullscreen()},OnBackButton(){return true},IsPortraitLandscape(p){const lastInnerWidth=this._runtime.GetCanvasManager().GetLastWidth();const lastInnerHeight=this._runtime.GetCanvasManager().GetLastHeight();const current=lastInnerWidth<= +lastInnerHeight?0:1;return current===p},OnUpdateFound(){return true},OnUpdateReady(){return true},OnOfflineReady(){return true},OnHashChange(){return true},PageVisible(){return!this._runtime.IsSuspended()},OnPageHidden(){return true},OnPageVisible(){return true},HasJava(){return false},IsDownloadingUpdate(){return false},OnMenuButton(){return false},OnSearchButton(){return false},IsMetered(){return false},IsCharging(){return true},SupportsFullscreen(){return true}}}; + + +'use strict';{const C3=self.C3;const ORIENTATIONS=["portrait","landscape","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];C3.Plugins.Browser.Acts={Alert(message){this.PostToDOM("alert",{"message":message.toString()})},Close(){if(this._isScirraArcade)return;if(this._runtime.IsDebug())self.C3Debugger.CloseWindow();else this.PostToDOM("close")},Focus(){this.PostToDOM("set-focus",{"isFocus":true})},Blur(){this.PostToDOM("set-focus",{"isFocus":false})},GoBack(){if(this._isScirraArcade)return; +this.PostToDOM("navigate",{"type":"back"})},GoForward(){if(this._isScirraArcade)return;this.PostToDOM("navigate",{"type":"forward"})},GoHome(){if(this._isScirraArcade)return;this.PostToDOM("navigate",{"type":"home"})},Reload(){if(this._isScirraArcade)return;if(this._runtime.IsDebug())this._runtime.PostToDebugger({"type":"reload"});else this.PostToDOM("navigate",{"type":"reload"})},GoToURL(url,target){this._PostToDOMMaybeSync("navigate",{"type":"url","url":url,"target":target,"exportType":this._runtime.GetExportType()})}, +GoToURLWindow(url,tag){this._PostToDOMMaybeSync("navigate",{"type":"new-window","url":url,"tag":tag,"exportType":this._runtime.GetExportType()})},RequestFullScreen(mode,navUi){if(mode>=2)mode+=1;if(mode===6)mode=2;if(mode===1)mode=0;const modeStr=C3.CanvasManager._FullscreenModeNumberToString(mode);this._runtime.GetCanvasManager().SetDocumentFullscreenMode(modeStr);this._PostToDOMMaybeSync("request-fullscreen",{"navUI":navUi})},CancelFullScreen(){this._PostToDOMMaybeSync("exit-fullscreen")},Vibrate(pattern){const arr= +pattern.split(",");for(let i=0,len=arr.length;i=ORIENTATIONS.length)return;const orientation=ORIENTATIONS[o];this._PostToDOMMaybeSync("lock-orientation",{"orientation":orientation})},UnlockOrientation(){this._PostToDOMMaybeSync("unlock-orientation")}, +LoadStyleSheet(url){this._runtime.GetAssetManager().LoadStyleSheet(url)},SetHash(h){this.PostToDOM("set-hash",{"hash":h})}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Browser.Exps={URL(){if(this._runtime.IsInWorker())return this._initLocationStr;else return location.toString()},Protocol(){if(this._runtime.IsInWorker())return(new URL(this._initLocationStr)).protocol;else return location.protocol},Domain(){if(this._runtime.IsInWorker())return(new URL(this._initLocationStr)).hostname;else return location.hostname},Port(){if(this._runtime.IsInWorker())return(new URL(this._initLocationStr)).port;else return location.port},PathName(){if(this._runtime.IsInWorker())return(new URL(this._initLocationStr)).pathname; +else return location.pathname},Hash(){if(this._runtime.IsInWorker())return(new URL(this._initLocationStr)).hash;else return location.hash},QueryString(){if(this._runtime.IsInWorker())return(new URL(this._initLocationStr)).search;else return location.search},QueryParam(param){const search=this._runtime.IsInWorker()?(new URL(this._initLocationStr)).search:location.search;const match=RegExp("[?&]"+param+"=([^&]*)").exec(search);if(match)return decodeURIComponent(match[1].replace(/\+/g," "));else return""}, +Referrer(){return this._referrer},Title(){return this._docTitle},Language(){return navigator.language},Platform(){return navigator.platform},UserAgent(){return navigator.userAgent},ExecJS(jsStr){let result=0;try{result=eval(jsStr)}catch(err){console.error("Error executing JavaScript: ",err)}if(typeof result==="number"||typeof result==="string")return result;if(typeof result==="boolean")return result?1:0;else return 0},Name(){return navigator.appName},Version(){return navigator.appVersion},Product(){return navigator.product}, +Vendor(){return navigator.vendor},BatteryLevel(){return 1},BatteryTimeLeft(){return Infinity},Bandwidth(){const connection=navigator["connection"];if(connection)return connection["downlink"]||connection["downlinkMax"]||connection["bandwidth"]||Infinity;else return Infinity},ConnectionType(){const connection=navigator["connection"];if(connection)return connection["type"]||"unknown";else return"unknown"},DevicePixelRatio(){return self.devicePixelRatio},ScreenWidth(){return this._screenWidth},ScreenHeight(){return this._screenHeight}, +WindowInnerWidth(){return this._runtime.GetCanvasManager().GetLastWidth()},WindowInnerHeight(){return this._runtime.GetCanvasManager().GetLastHeight()},WindowOuterWidth(){return this._windowOuterWidth},WindowOuterHeight(){return this._windowOuterWidth}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Sprite=class SpritePlugin extends C3.SDKPluginBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Sprite.Type=class SpriteType extends C3.SDKTypeBase{constructor(objectClass){super(objectClass);this._animations=objectClass.GetAnimations()}Release(){C3.clearArray(this._animations);super.Release()}OnCreate(){for(const a of this._animations)a.LoadAllAssets(this._runtime)}LoadTextures(renderer){const opts={sampling:this._runtime.GetSampling()};return Promise.all(this._animations.map(a=>a.LoadAllTextures(renderer,opts)))}ReleaseTextures(){for(const a of this._animations)a.ReleaseAllTextures()}OnDynamicTextureLoadComplete(){this._UpdateAllCurrentTexture()}_UpdateAllCurrentTexture(){for(const inst of this._objectClass.instancesIncludingPendingCreate())inst.GetSdkInstance()._UpdateCurrentTexture()}FinishCondition(doPick){C3.Plugins.Sprite._FinishCondition(this, +doPick)}}}; + + +'use strict';{const C3=self.C3;const INITIALLY_VISIBLE=0;const INITIAL_ANIMATION=1;const INITIAL_FRAME=2;const ENABLE_COLLISIONS=3;const tempRect=C3.New(C3.Rect);const tempQuad=C3.New(C3.Quad);const tempVec2=C3.New(C3.Vector2);const FLAG_PLAYING_FORWARDS=1<<0;const FLAG_ANIMATION_PLAYING=1<<1;const FLAG_ANIMATION_TRIGGER=1<<2;C3.Plugins.Sprite.Instance=class SpriteInstance extends C3.SDKWorldInstanceBase{constructor(inst,properties){super(inst);let initiallyVisible=true;let initialAnimation="";let initialFrame= +0;let collisionEnabled=true;if(properties){initiallyVisible=!!properties[INITIALLY_VISIBLE];initialAnimation=properties[INITIAL_ANIMATION];initialFrame=properties[INITIAL_FRAME];collisionEnabled=properties[ENABLE_COLLISIONS]}this._currentAnimation=this._objectClass.GetAnimationByName(initialAnimation)||this._objectClass.GetAnimations()[0];this._currentFrameIndex=C3.clamp(initialFrame,0,this._currentAnimation.GetFrameCount()-1);this._currentAnimationFrame=this._currentAnimation.GetFrameAt(this._currentFrameIndex); +const initialImageInfo=this._currentAnimationFrame.GetImageInfo();this._currentTexture=initialImageInfo.GetTexture();this._currentRcTex=initialImageInfo.GetTexRect();this.HandleWebGLContextLoss();inst.SetFlag(FLAG_ANIMATION_PLAYING,true);inst.SetFlag(FLAG_PLAYING_FORWARDS,this._currentAnimation.GetSpeed()>=0);this._currentAnimationSpeed=Math.abs(this._currentAnimation.GetSpeed());this._currentAnimationRepeatTo=this._currentAnimation.GetRepeatTo();this._animationTimer=C3.New(C3.KahanSum);this._frameStartTime= +0;this._animationRepeats=0;this._animTriggerName="";this._changeAnimFrameIndex=-1;this._changeAnimationName="";this._changeAnimationFrom=0;const wi=this.GetWorldInfo();this._bquadRef=wi.GetBoundingQuad();wi.SetVisible(initiallyVisible);wi.SetCollisionEnabled(collisionEnabled);wi.SetOriginX(this._currentAnimationFrame.GetOriginX());wi.SetOriginY(this._currentAnimationFrame.GetOriginY());wi.SetSourceCollisionPoly(this._currentAnimationFrame.GetCollisionPoly());wi.SetBboxChanged();if((this._objectClass.GetAnimationCount()!== +1||this._objectClass.GetAnimations()[0].GetFrameCount()!==1)&&this._currentAnimationSpeed!==0)this._StartTicking()}Release(){this._currentAnimation=null;this._currentAnimationFrame=null;this._currentTexture=null;this._animationTimer=null;super.Release()}GetCurrentImageInfo(){return this._currentAnimationFrame.GetImageInfo()}OnWebGLContextLost(){this._currentTexture=null}OnWebGLContextRestored(){this._UpdateCurrentTexture()}Draw(renderer){const texture=this._currentTexture;if(texture===null)return; +renderer.SetTexture(texture);const wi=this.GetWorldInfo();if(wi.HasMesh())this._DrawMesh(wi,renderer);else this._DrawStandard(wi,renderer)}_DrawStandard(wi,renderer){let quad=this._bquadRef;if(this._runtime.IsPixelRoundingEnabled())quad=wi.PixelRoundQuad(quad);renderer.Quad3(quad,this._currentRcTex)}_DrawMesh(wi,renderer){const transformedMesh=wi.GetTransformedMesh();if(wi.IsMeshChanged()){wi.CalculateBbox(tempRect,tempQuad,false);let quad=tempQuad;if(this._runtime.IsPixelRoundingEnabled())quad=wi.PixelRoundQuad(quad); +transformedMesh.CalculateTransformedMesh(wi.GetSourceMesh(),quad,this._currentRcTex);wi.SetMeshChanged(false)}transformedMesh.Draw(renderer)}GetAnimationTime(){return this._animationTimer.Get()}IsAnimationPlaying(){return this._inst.GetFlag(FLAG_ANIMATION_PLAYING)}SetAnimationPlaying(e){this._inst.SetFlag(FLAG_ANIMATION_PLAYING,e)}IsPlayingForwards(){return this._inst.GetFlag(FLAG_PLAYING_FORWARDS)}SetPlayingForwards(e){this._inst.SetFlag(FLAG_PLAYING_FORWARDS,e)}IsInAnimationTrigger(){return this._inst.GetFlag(FLAG_ANIMATION_TRIGGER)}SetInAnimationTrigger(e){this._inst.SetFlag(FLAG_ANIMATION_TRIGGER, +e)}Tick(){if(this._changeAnimationName)this._DoChangeAnimation();if(this._changeAnimFrameIndex>=0)this._DoChangeAnimFrame();const currentAnimationSpeed=this._currentAnimationSpeed;if(!this.IsAnimationPlaying()||currentAnimationSpeed===0){this._StopTicking();return}const dt=this._runtime.GetDt(this._inst);this._animationTimer.Add(dt);const now=this.GetAnimationTime();const prevFrame=this._currentAnimationFrame;const currentFrameTime=prevFrame.GetDuration()/currentAnimationSpeed;if(now=frameCount)if(isPingPong){this.SetPlayingForwards(false); +this._currentFrameIndex=frameCount-2}else if(isLooping)this._currentFrameIndex=repeatTo;else{this._animationRepeats++;if(this._animationRepeats>=repeatCount)this._FinishAnimation(false);else this._currentFrameIndex=repeatTo}if(this._currentFrameIndex<0)if(isPingPong){this._currentFrameIndex=1;this.SetPlayingForwards(true);if(!isLooping){this._animationRepeats++;if(this._animationRepeats>=repeatCount)this._FinishAnimation(true)}}else if(isLooping)this._currentFrameIndex=repeatTo;else{this._animationRepeats++; +if(this._animationRepeats>=repeatCount)this._FinishAnimation(true);else this._currentFrameIndex=repeatTo}this._currentFrameIndex=C3.clamp(this._currentFrameIndex,0,frameCount-1);const nextFrame=currentAnimation.GetFrameAt(this._currentFrameIndex);if(now>this._frameStartTime+nextFrame.GetDuration()/currentAnimationSpeed)this._frameStartTime=now;this._OnFrameChanged(prevFrame,nextFrame)}_FinishAnimation(reverse){this._currentFrameIndex=reverse?0:this._currentAnimation.GetFrameCount()-1;this.SetAnimationPlaying(false); +this._animTriggerName=this._currentAnimation.GetName();this.SetInAnimationTrigger(true);this.Trigger(C3.Plugins.Sprite.Cnds.OnAnyAnimFinished);this.Trigger(C3.Plugins.Sprite.Cnds.OnAnimFinished);this.SetInAnimationTrigger(false);this._animationRepeats=0}_OnFrameChanged(prevFrame,nextFrame){if(prevFrame===nextFrame)return;const wi=this.GetWorldInfo();const prevImage=prevFrame.GetImageInfo();const nextImage=nextFrame.GetImageInfo();const oldW=prevImage.GetWidth();const oldH=prevImage.GetHeight();const newW= +nextImage.GetWidth();const newH=nextImage.GetHeight();if(oldW!==newW)wi.SetWidth(wi.GetWidth()*(newW/oldW));if(oldH!==newH)wi.SetHeight(wi.GetHeight()*(newH/oldH));wi.SetOriginX(nextFrame.GetOriginX());wi.SetOriginY(nextFrame.GetOriginY());wi.SetSourceCollisionPoly(nextFrame.GetCollisionPoly());wi.SetBboxChanged();this._currentAnimationFrame=nextFrame;this._currentTexture=nextImage.GetTexture();this._currentRcTex=nextImage.GetTexRect();const behaviorInstances=this.GetInstance().GetBehaviorInstances(); +for(let i=0,len=behaviorInstances.length;i=0);if(this._currentAnimationSpeed> +0)this._StartTicking()}_GetAnimSpeed(){return this.IsPlayingForwards()?this._currentAnimationSpeed:-this._currentAnimationSpeed}_SetAnimRepeatToFrame(f){f=C3.clamp(Math.floor(f),0,this._currentAnimation.GetFrameCount()-1);this._currentAnimationRepeatTo=f}_GetAnimRepeatToFrame(){return this._currentAnimationRepeatTo}_DoChangeAnimation(){const prevFrame=this._currentAnimationFrame;const animation=this._objectClass.GetAnimationByName(this._changeAnimationName);this._changeAnimationName="";if(!animation)return; +if(animation===this._currentAnimation&&this.IsAnimationPlaying())return;this._currentAnimation=animation;this.SetPlayingForwards(animation.GetSpeed()>=0);this._currentAnimationSpeed=Math.abs(animation.GetSpeed());this._currentAnimationRepeatTo=animation.GetRepeatTo();this._currentFrameIndex=C3.clamp(this._currentFrameIndex,0,this._currentAnimation.GetFrameCount()-1);if(this._changeAnimationFrom===1)this._currentFrameIndex=0;this.SetAnimationPlaying(true);this._frameStartTime=this.GetAnimationTime(); +const nextFrame=this._currentAnimation.GetFrameAt(this._currentFrameIndex);this._OnFrameChanged(prevFrame,nextFrame)}_DoChangeAnimFrame(){const prevFrame=this._currentAnimationFrame;const prevFrameIndex=this._currentFrameIndex;this._currentFrameIndex=C3.clamp(Math.floor(this._changeAnimFrameIndex),0,this._currentAnimation.GetFrameCount()-1);this._changeAnimFrameIndex=-1;if(prevFrameIndex===this._currentFrameIndex)return;const nextFrame=this._currentAnimation.GetFrameAt(this._currentFrameIndex);this._OnFrameChanged(prevFrame, +nextFrame);this._frameStartTime=this.GetAnimationTime()}_UpdateCurrentTexture(){const curImageInfo=this._currentAnimationFrame.GetImageInfo();this._currentTexture=curImageInfo.GetTexture();this._currentRcTex=curImageInfo.GetTexRect();this.GetWorldInfo().SetMeshChanged(true)}GetImagePointCount(){return this._currentAnimationFrame.GetImagePointCount()}GetImagePoint(nameOrIndex){const frame=this._currentAnimationFrame;const wi=this.GetWorldInfo();let ip=null;if(typeof nameOrIndex==="string")ip=frame.GetImagePointByName(nameOrIndex); +else if(typeof nameOrIndex==="number")ip=frame.GetImagePointByIndex(nameOrIndex-1);else throw new TypeError("expected string or number");if(!ip)return[wi.GetX(),wi.GetY()];tempVec2.copy(ip.GetVec2());if(wi.HasMesh()){const [tx,ty]=wi.GetSourceMesh().TransformPoint(tempVec2.getX(),tempVec2.getY());tempVec2.set(tx,ty)}tempVec2.offset(-frame.GetOriginX(),-frame.GetOriginY());tempVec2.scale(wi.GetWidth(),wi.GetHeight());tempVec2.rotate(wi.GetAngle());tempVec2.offset(wi.GetX(),wi.GetY());return[tempVec2.getX(), +tempVec2.getY()]}GetCollisionPolyPointCount(){return this.GetWorldInfo().GetTransformedCollisionPoly().pointCount()}GetCollisionPolyPoint(index){index=Math.floor(index);const wi=this.GetWorldInfo();const poly=wi.GetTransformedCollisionPoly();const pointCount=poly.pointCount();if(index===pointCount)index=0;if(index<0||index>=pointCount)return[0,0];const pointsArr=poly.pointsArr();return[pointsArr[index*2+0]+wi.GetX(),pointsArr[index*2+1]+wi.GetY()]}GetDebuggerProperties(){const Acts=C3.Plugins.Sprite.Acts; +const prefix="plugins.sprite.debugger.animation-properties";return[{title:prefix+".title",properties:[{name:prefix+".current-animation",value:this._currentAnimation.GetName(),onedit:v=>this.CallAction(Acts.SetAnim,v,0)},{name:prefix+".current-frame",value:this._currentFrameIndex,onedit:v=>this.CallAction(Acts.SetAnimFrame,v)},{name:prefix+".is-playing",value:this.IsAnimationPlaying(),onedit:v=>v?this.CallAction(Acts.StartAnim,0):this.CallAction(Acts.StopAnim)},{name:prefix+".speed",value:this._currentAnimationSpeed, +onedit:v=>this.CallAction(Acts.SetAnimSpeed,v)},{name:prefix+".repeats",value:this._animationRepeats,onedit:v=>this._animationRepeats=v}]}]}SaveToJson(){const o={"a":this._currentAnimation.GetSID()};if(this._frameStartTime!==0)o["fs"]=this._frameStartTime;const animTime=this.GetAnimationTime();if(animTime!==0)o["at"]=animTime;if(this._currentFrameIndex!==0)o["f"]=this._currentFrameIndex;if(this._currentAnimationSpeed!==0)o["cas"]=this._currentAnimationSpeed;if(this._animationRepeats!==1)o["ar"]=this._animationRepeats; +if(this._currentAnimationRepeatTo!==0)o["rt"]=this._currentAnimationRepeatTo;if(!this.IsAnimationPlaying())o["ap"]=this.IsAnimationPlaying();if(!this.IsPlayingForwards())o["af"]=this.IsPlayingForwards();const wi=this.GetWorldInfo();if(wi.IsCollisionEnabled())o["ce"]=wi.IsCollisionEnabled();return o}LoadFromJson(o){const anim=this.GetObjectClass().GetAnimationBySID(o["a"]);if(anim)this._currentAnimation=anim;this._frameStartTime=o.hasOwnProperty("fs")?o["fs"]:0;this._animationTimer.Set(o.hasOwnProperty("at")? +o["at"]:0);const frameIndex=o.hasOwnProperty("f")?o["f"]:0;this._currentFrameIndex=C3.clamp(frameIndex,0,this._currentAnimation.GetFrameCount()-1);this._currentAnimationSpeed=o.hasOwnProperty("cas")?o["cas"]:0;this._animationRepeats=o.hasOwnProperty("ar")?o["ar"]:1;const repeatToIndex=o.hasOwnProperty("rt")?o["rt"]:0;this._currentAnimationRepeatTo=C3.clamp(repeatToIndex,0,this._currentAnimation.GetFrameCount()-1);this.SetAnimationPlaying(o.hasOwnProperty("ap")?!!o["ap"]:true);this.SetPlayingForwards(o.hasOwnProperty("af")? +!!o["af"]:true);const nextFrame=this._currentAnimation.GetFrameAt(this._currentFrameIndex);this._currentAnimationFrame=nextFrame;this._UpdateCurrentTexture();const wi=this.GetWorldInfo();wi.SetOriginX(nextFrame.GetOriginX());wi.SetOriginY(nextFrame.GetOriginY());wi.SetSourceCollisionPoly(nextFrame.GetCollisionPoly());wi.SetCollisionEnabled(!!o["ce"])}GetPropertyValueByIndex(index){const wi=this.GetWorldInfo();switch(index){case ENABLE_COLLISIONS:return wi.IsCollisionEnabled();case INITIAL_FRAME:return C3.clamp(this._currentFrameIndex, +0,this._currentAnimation.GetFrameCount()-1)}}SetPropertyValueByIndex(index,value){const wi=this.GetWorldInfo();switch(index){case ENABLE_COLLISIONS:wi.SetCollisionEnabled(!!value);break;case INITIAL_FRAME:this.SetAnimationPlaying(false);const totalFrames=this._currentAnimation.GetFrameCount()-1;const nextIndex=value=C3.clamp(value,0,totalFrames);const prevFrame=this._currentAnimation.GetFrameAt(this._currentFrameIndex);const nextFrame=this._currentAnimation.GetFrameAt(nextIndex);this._OnFrameChanged(prevFrame, +nextFrame);this._currentFrameIndex=C3.clamp(nextIndex,0,totalFrames);break}}GetScriptInterfaceClass(){return self.ISpriteInstance}};const map=new WeakMap;const ANIM_FROM_MODES=new Map([["current-frame",0],["beginning",1]]);self.ISpriteInstance=class ISpriteInstance extends self.IWorldInstance{constructor(){super();map.set(this,self.IInstance._GetInitInst().GetSdkInstance())}getImagePointCount(){return map.get(this).GetImagePointCount()}getImagePointX(nameOrIndex){if(typeof nameOrIndex!=="string"&& +typeof nameOrIndex!=="number")throw new TypeError("expected string or number");return map.get(this).GetImagePoint(nameOrIndex)[0]}getImagePointY(nameOrIndex){if(typeof nameOrIndex!=="string"&&typeof nameOrIndex!=="number")throw new TypeError("expected string or number");return map.get(this).GetImagePoint(nameOrIndex)[1]}getImagePoint(nameOrIndex){if(typeof nameOrIndex!=="string"&&typeof nameOrIndex!=="number")throw new TypeError("expected string or number");return map.get(this).GetImagePoint(nameOrIndex)}getPolyPointCount(){return map.get(this).GetCollisionPolyPointCount()}getPolyPointX(index){return map.get(this).GetCollisionPolyPoint(index)[0]}getPolyPointY(index){return map.get(this).GetCollisionPolyPoint(index)[1]}getPolyPoint(index){return map.get(this).GetCollisionPolyPoint(index)}stopAnimation(){map.get(this).SetAnimationPlaying(false)}startAnimation(from= +"current-frame"){const f=ANIM_FROM_MODES.get(from);if(typeof f==="undefined")throw new Error("invalid mode");map.get(this)._StartAnim(f)}setAnimation(name,from="beginning"){const f=ANIM_FROM_MODES.get(from);if(typeof f==="undefined")throw new Error("invalid mode");map.get(this)._SetAnim(name,f)}get animationName(){return map.get(this)._GetCurrentAnimationName()}set animationFrame(frameIndex){map.get(this)._SetAnimFrame(frameIndex)}get animationFrame(){return map.get(this)._GetAnimFrame()}set animationSpeed(s){map.get(this)._SetAnimSpeed(s)}get animationSpeed(){return map.get(this)._GetAnimSpeed()}set animationRepeatToFrame(f){map.get(this)._SetAnimRepeatToFrame(f)}get animationRepeatToFrame(){return map.get(this)._GetAnimRepeatToFrame()}get imageWidth(){return map.get(this).GetCurrentImageInfo().GetWidth()}get imageHeight(){return map.get(this).GetCurrentImageInfo().GetHeight()}}}; + + +'use strict';{const C3=self.C3;const tempRect=C3.New(C3.Rect);const tempCandidates1=[];const tempCandidates2=[];let needsCollisionFinish=false;let rPickType=null;let rPickFromElseInstances=false;const rToPick=new Set;function CollMemory_Add(collMemory,a,b,tickCount){const a_uid=a.GetUID();const b_uid=b.GetUID();if(a_uidCollMemory_RemoveInstance(collMemory,e.instance))}const lsol=ltype.GetCurrentSol();const rsol=rtype.GetCurrentSol();const linstances=lsol.GetInstances();let rinstances=null;for(let l= +0;lCollMemory_RemoveInstance(collMemory,e.instance))}const lsol= +ltype.GetCurrentSol();const rsol=rtype.GetCurrentSol();const linstances=lsol.GetInstances();let rinstances=null;for(let l=0;lthis._runtime.UpdateRender();this._rendererText.SetIsAsync(false);if(properties){this._text=properties[TEXT];this._enableBBcode=!!properties[ENABLE_BBCODE];this._faceName=properties[FONT];this._ptSize=properties[SIZE];this._lineHeightOffset=properties[LINE_HEIGHT];this._isBold=!!properties[BOLD];this._isItalic=!!properties[ITALIC];this._horizontalAlign=properties[HORIZONTAL_ALIGNMENT];this._verticalAlign=properties[VERTICAL_ALIGNMENT];this._wrapByWord= +properties[WRAPPING]===WORD_WRAP;const v=properties[COLOR];this._color.setRgb(v[0],v[1],v[2]);this.GetWorldInfo().SetVisible(properties[INITIALLY_VISIBLE])}this._UpdateTextSettings()}Release(){this._CancelTypewriter();this._rendererText.Release();this._rendererText=null;super.Release()}_UpdateTextSettings(){const rendererText=this._rendererText;rendererText.SetText(this._text);rendererText.SetBBCodeEnabled(this._enableBBcode);rendererText.SetFontName(this._faceName);rendererText.SetLineHeight(this._lineHeightOffset); +rendererText.SetBold(this._isBold);rendererText.SetItalic(this._isItalic);rendererText.SetColor(this._color);rendererText.SetHorizontalAlignment(HORIZONTAL_ALIGNMENTS[this._horizontalAlign]);rendererText.SetVerticalAlignment(VERTICAL_ALIGNMENTS[this._verticalAlign]);rendererText.SetWordWrapMode(this._wrapByWord?"word":"character")}_UpdateTextSize(){const wi=this.GetWorldInfo();this._rendererText.SetFontSize(this._ptSize*wi.GetSceneGraphScale());const layer=wi.GetLayer();const textZoom=layer.GetRenderScale()* +layer.Get2DScaleFactorToZ(wi.GetTotalZElevation());this._rendererText.SetSize(wi.GetWidth(),wi.GetHeight(),textZoom)}Draw(renderer){const wi=this.GetWorldInfo();this._UpdateTextSize();const texture=this._rendererText.GetTexture();if(!texture)return;const layer=wi.GetLayer();if(wi.GetAngle()===0&&wi.GetLayer().GetAngle()===0&&wi.GetTotalZElevation()===0&&!wi.HasMesh()){const quad=wi.GetBoundingQuad();const [dl,dt]=layer.LayerToDrawSurface(quad.getTlx(),quad.getTly());const [dr,db]=layer.LayerToDrawSurface(quad.getBrx(), +quad.getBry());const offX=dl-Math.round(dl);const offY=dt-Math.round(dt);tempRect.set(dl,dt,dr,db);tempRect.offset(-offX,-offY);tempQuad.setFromRect(tempRect);const [rtWidth,rtHeight]=renderer.GetRenderTargetSize(renderer.GetRenderTarget());this._runtime.GetCanvasManager().SetDeviceTransform(renderer,rtWidth,rtHeight);renderer.SetTexture(texture);renderer.Quad3(tempQuad,this._rendererText.GetTexRect());layer._SetTransform(renderer)}else{renderer.SetTexture(texture);if(wi.HasMesh())this._DrawMesh(wi, +renderer);else this._DrawStandard(wi,renderer)}}_DrawStandard(wi,renderer){let quad=wi.GetBoundingQuad();if(this._runtime.IsPixelRoundingEnabled())quad=this._PixelRoundQuad(quad);renderer.Quad3(quad,this._rendererText.GetTexRect())}_DrawMesh(wi,renderer){const transformedMesh=wi.GetTransformedMesh();if(wi.IsMeshChanged()){wi.CalculateBbox(tempRect,tempQuad,false);let quad=tempQuad;if(this._runtime.IsPixelRoundingEnabled())quad=this._PixelRoundQuad(quad);transformedMesh.CalculateTransformedMesh(wi.GetSourceMesh(), +quad,this._rendererText.GetTexRect());wi.SetMeshChanged(false)}transformedMesh.Draw(renderer)}_PixelRoundQuad(quad){const offX=quad.getTlx()-Math.round(quad.getTlx());const offY=quad.getTly()-Math.round(quad.getTly());if(offX===0&&offY===0)return quad;else{tempQuad.copy(quad);tempQuad.offset(-offX,-offY);return tempQuad}}SaveToJson(){const o={"t":this._text,"c":this._color.toJSON(),"fn":this._faceName,"ps":this._ptSize};if(this._enableBBcode)o["bbc"]=this._enableBBcode;if(this._horizontalAlign!== +0)o["ha"]=this._horizontalAlign;if(this._verticalAlign!==0)o["va"]=this._verticalAlign;if(!this._wrapByWord)o["wr"]=this._wrapByWord;if(this._lineHeightOffset!==0)o["lho"]=this._lineHeightOffset;if(this._isBold)o["b"]=this._isBold;if(this._isItalic)o["i"]=this._isItalic;if(this._typewriterEndTime!==-1)o["tw"]={"st":this._typewriterStartTime,"en":this._typewriterEndTime,"l":this._typewriterLength};return o}LoadFromJson(o){this._CancelTypewriter();this._text=o["t"],this._color.setFromJSON(o["c"]);this._faceName= +o["fn"],this._ptSize=o["ps"];this._enableBBcode=o.hasOwnProperty("bbc")?o["bbc"]:false;this._horizontalAlign=o.hasOwnProperty("ha")?o["ha"]:0;this._verticalAlign=o.hasOwnProperty("va")?o["va"]:0;this._wrapByWord=o.hasOwnProperty("wr")?o["wr"]:true;this._lineHeightOffset=o.hasOwnProperty("lho")?o["lho"]:0;this._isBold=o.hasOwnProperty("b")?o["b"]:false;this._isItalic=o.hasOwnProperty("i")?o["i"]:false;if(o.hasOwnProperty("tw")){const tw=o["tw"];this._typewriterStartTime=tw["st"];this._typewriterEndTime= +tw["en"];this._typewriterLength=tw["l"]}this._UpdateTextSettings();if(this._typewriterEndTime!==-1)this._StartTicking()}GetPropertyValueByIndex(index){switch(index){case TEXT:return this._text;case ENABLE_BBCODE:return this._enableBBcode;case FONT:return this._faceName;case SIZE:return this._ptSize;case LINE_HEIGHT:return this._lineHeightOffset;case BOLD:return this._isBold;case ITALIC:return this._isItalic;case COLOR:TEMP_COLOR_ARRAY[0]=this._color.getR();TEMP_COLOR_ARRAY[1]=this._color.getG();TEMP_COLOR_ARRAY[2]= +this._color.getB();return TEMP_COLOR_ARRAY;case HORIZONTAL_ALIGNMENT:return this._horizontalAlign;case VERTICAL_ALIGNMENT:return this._verticalAlign;case WRAPPING:return this._wrapByWord?CHARACTER_WRAP:WORD_WRAP}}SetPropertyValueByIndex(index,value){switch(index){case TEXT:if(this._text===value)return;this._text=value;this._UpdateTextSettings();break;case ENABLE_BBCODE:if(this._enableBBcode===!!value)return;this._enableBBcode=!!value;this._UpdateTextSettings();break;case FONT:if(this._faceName=== +value)return;this._faceName=value;this._UpdateTextSettings();break;case SIZE:if(this._ptSize===value)return;this._ptSize=value;this._UpdateTextSettings();break;case LINE_HEIGHT:if(this._lineHeightOffset===value)return;this._lineHeightOffset=value;this._UpdateTextSettings();break;case BOLD:if(this._isBold===!!value)return;this._isBold=!!value;this._UpdateTextSettings();break;case ITALIC:if(this._isItalic===!!value)return;this._isItalic=!!value;this._UpdateTextSettings();break;case COLOR:const c=this._color; +const v=value;if(c.getR()===v[0]&&c.getG()===v[1]&&c.getB()===v[2])return;this._color.setRgb(v[0],v[1],v[2]);this._UpdateTextSettings();break;case HORIZONTAL_ALIGNMENT:if(this._horizontalAlign===value)return;this._horizontalAlign=value;this._UpdateTextSettings();break;case VERTICAL_ALIGNMENT:if(this._verticalAlign===value)return;this._verticalAlign=value;this._UpdateTextSettings();break;case WRAPPING:if(this._wrapByWord===(value===WORD_WRAP))return;this._wrapByWord=value===WORD_WRAP;this._UpdateTextSettings(); +break}}SetPropertyColorOffsetValueByIndex(index,r,g,b){if(r===0&&g===0&&b===0)return;switch(index){case COLOR:this._color.addRgb(r,g,b);this._UpdateTextSettings();break}}_SetText(text){if(this._text===text)return;this._text=text;this._rendererText.SetText(text);this._runtime.UpdateRender()}GetText(){return this._text}_StartTypewriter(text,duration){this._SetText(text);this._typewriterStartTime=this._runtime.GetWallTime();this._typewriterEndTime=this._typewriterStartTime+duration/this.GetInstance().GetActiveTimeScale(); +this._typewriterLength=C3.BBString.StripAnyTags(text).length;this._rendererText.SetDrawMaxCharacterCount(0);this._StartTicking()}_CancelTypewriter(){this._typewriterStartTime=-1;this._typewriterEndTime=-1;this._typewriterLength=0;this._rendererText.SetDrawMaxCharacterCount(-1);this._StopTicking()}_FinishTypewriter(){if(this._typewriterEndTime===-1)return;this._CancelTypewriter();this.Trigger(C3.Plugins.Text.Cnds.OnTypewriterTextFinished);this._runtime.UpdateRender()}_SetFontFace(face){if(this._faceName=== +face)return;this._faceName=face;this._rendererText.SetFontName(face);this._runtime.UpdateRender()}_GetFontFace(){return this._faceName}_SetBold(b){b=!!b;if(this._isBold===b)return;this._isBold=b;this._rendererText.SetBold(b);this._runtime.UpdateRender()}_IsBold(){return this._isBold}_SetItalic(i){i=!!i;if(this._isItalic===i)return;this._isItalic=i;this._rendererText.SetItalic(i);this._runtime.UpdateRender()}_IsItalic(){return this._isItalic}_SetFontSize(size){if(this._ptSize===size)return;this._ptSize= +size;this._runtime.UpdateRender()}_GetFontSize(){return this._ptSize}_SetLineHeight(lho){if(this._lineHeightOffset===lho)return;this._lineHeightOffset=lho;this._UpdateTextSettings();this._runtime.UpdateRender()}_GetLineHeight(){return this._lineHeightOffset}_SetHAlign(h){if(this._horizontalAlign===h)return;this._horizontalAlign=h;this._UpdateTextSettings();this._runtime.UpdateRender()}_GetHAlign(){return this._horizontalAlign}_SetVAlign(v){if(this._verticalAlign===v)return;this._verticalAlign=v;this._UpdateTextSettings(); +this._runtime.UpdateRender()}_GetVAlign(){return this._verticalAlign}_SetWrapByWord(w){w=!!w;if(this._wrapByWord===w)return;this._wrapByWord=w;this._UpdateTextSettings();this._runtime.UpdateRender()}_IsWrapByWord(){return this._wrapByWord}Tick(){const wallTime=this._runtime.GetWallTime();if(wallTime>=this._typewriterEndTime){this._CancelTypewriter();this.Trigger(C3.Plugins.Text.Cnds.OnTypewriterTextFinished);this._runtime.UpdateRender()}else{let displayLength=C3.relerp(this._typewriterStartTime,this._typewriterEndTime, +wallTime,0,this._typewriterLength);displayLength=Math.floor(displayLength);if(displayLength!==this._rendererText.GetDrawMaxCharacterCount()){this._rendererText.SetDrawMaxCharacterCount(displayLength);this._runtime.UpdateRender()}}}GetDebuggerProperties(){const prefix="plugins.text";return[{title:prefix+".name",properties:[{name:prefix+".properties.text.name",value:this._text,onedit:v=>this._SetText(v)}]}]}GetScriptInterfaceClass(){return self.ITextInstance}};const map=new WeakMap;const SCRIPT_HORIZONTAL_ALIGNMENTS= +new Map([["left",0],["center",1],["right",2]]);const SCRIPT_VERTICAL_ALIGNMENTS=new Map([["top",0],["center",1],["bottom",2]]);const SCRIPT_WRAP_MODES=new Map([["word",true],["character",false]]);self.ITextInstance=class ITextInstance extends self.IWorldInstance{constructor(){super();map.set(this,self.IInstance._GetInitInst().GetSdkInstance())}get text(){return map.get(this).GetText()}set text(str){const inst=map.get(this);inst._CancelTypewriter();inst._SetText(str)}typewriterText(str,duration){const inst= +map.get(this);inst._CancelTypewriter();inst._StartTypewriter(str,duration)}typewriterFinish(){map.get(this)._FinishTypewriter()}set fontFace(str){map.get(this)._SetFontFace(str)}get fontFace(){return map.get(this)._GetFontFace()}set isBold(b){map.get(this)._SetBold(b)}get isBold(){return map.get(this)._IsBold()}set isItalic(i){map.get(this)._SetItalic(i)}get isItalic(){return map.get(this)._IsItalic()}set sizePt(pt){map.get(this)._SetFontSize(pt)}get sizePt(){return map.get(this)._GetFontSize()}set lineHeight(lho){map.get(this)._SetLineHeight(lho)}get lineHeight(){return map.get(this)._GetLineHeight()}set horizontalAlign(str){const h= +SCRIPT_HORIZONTAL_ALIGNMENTS.get(str);if(typeof h==="undefined")throw new Error("invalid mode");map.get(this)._SetHAlign(h)}get horizontalAlign(){return HORIZONTAL_ALIGNMENTS[map.get(this)._GetHAlign()]}set verticalAlign(str){const v=SCRIPT_VERTICAL_ALIGNMENTS.get(str);if(typeof v==="undefined")throw new Error("invalid mode");map.get(this)._SetVAlign(v)}get verticalAlign(){return VERTICAL_ALIGNMENTS[map.get(this)._GetVAlign()]}set wordWrapMode(str){const isWrapByWord=SCRIPT_WRAP_MODES.get(str);if(typeof isWrapByWord=== +"undefined")throw new Error("invalid mode");map.get(this)._SetWrapByWord(isWrapByWord)}get wordWrapMode(){return map.get(this)._IsWrapByWord()?"word":"character"}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Text.Cnds={CompareText(str,caseSensitive){if(caseSensitive)return this._text===str;else return C3.equalsNoCase(this._text,str)},IsRunningTypewriterText(){return this._typewriterEndTime!==-1},OnTypewriterTextFinished(){return true}}}; + + +'use strict';{const C3=self.C3;const tempColor=C3.New(C3.Color);C3.Plugins.Text.Acts={SetText(param){this._CancelTypewriter();if(typeof param==="number"&¶m<1E9)param=Math.round(param*1E10)/1E10;this._SetText(param.toString())},AppendText(param){this._CancelTypewriter();if(typeof param==="number"&¶m<1E9)param=Math.round(param*1E10)/1E10;param=param.toString();if(!param)return;this._SetText(this._text+param)},TypewriterText(param,duration){this._CancelTypewriter();if(typeof param==="number"&& +param<1E9)param=Math.round(param*1E10)/1E10;this._StartTypewriter(param.toString(),duration)},SetFontFace(face,style){let bold=false;let italic=false;switch(style){case 1:bold=true;break;case 2:italic=true;break;case 3:bold=true;italic=true;break}if(face===this._faceName&&bold===this._isBold&&italic===this._isItalic)return;this._SetFontFace(face);this._SetBold(bold);this._SetItalic(italic)},SetFontSize(size){this._SetFontSize(size)},SetFontColor(rgb){tempColor.setFromRgbValue(rgb);tempColor.clamp(); +if(this._color.equalsIgnoringAlpha(tempColor))return;this._color.copyRgb(tempColor);this._rendererText.SetColor(this._color);this._runtime.UpdateRender()},SetWebFont(familyName,cssUrl){console.warn("[Text] 'Set web font' action is deprecated and no longer has any effect")},SetEffect(effect){this.GetWorldInfo().SetBlendMode(effect);this._runtime.UpdateRender()},TypewriterFinish(){this._FinishTypewriter()},SetLineHeight(lho){this._SetLineHeight(lho)},SetHAlign(h){this._SetHAlign(h)},SetVAlign(v){this._SetVAlign(v)}, +SetWrapping(w){this._SetWrapByWord(w===0)}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Text.Exps={Text(){return this._text},PlainText(){if(this._enableBBcode)return C3.BBString.StripAnyTags(this._text);else return this._text},FaceName(){return this._faceName},FaceSize(){return this._ptSize},TextWidth(){this._UpdateTextSize();return this._rendererText.GetTextWidth()},TextHeight(){this._UpdateTextSize();return this._rendererText.GetTextHeight()},LineHeight(){return this._lineHeightOffset}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Spritefont2=class SpriteFontPlugin extends C3.SDKPluginBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Spritefont2.Type=class SpriteFontType extends C3.SDKTypeBase{constructor(objectClass){super(objectClass);this._spriteFont=C3.New(self.SpriteFont)}Release(){super.Release()}OnCreate(){this.GetImageInfo().LoadAsset(this._runtime)}LoadTextures(renderer){return this.GetImageInfo().LoadStaticTexture(renderer,{sampling:this._runtime.GetSampling()})}ReleaseTextures(){this.GetImageInfo().ReleaseTexture()}GetSpriteFont(){return this._spriteFont}UpdateSettings(characterWidth, +characterHeight,characterSet,spacingData){const imageInfo=this.GetImageInfo();const sf=this._spriteFont;sf.SetWidth(imageInfo.GetWidth());sf.SetHeight(imageInfo.GetHeight());sf.SetCharacterWidth(characterWidth);sf.SetCharacterHeight(characterHeight);sf.SetCharacterSet(characterSet);sf.SetSpacingData(spacingData);sf.UpdateCharacterMap()}}}; + + +'use strict';{const C3=self.C3;const TEXT=0;const ENABLE_BBCODE=1;const CHARACTER_WIDTH=2;const CHARACTER_HEIGHT=3;const CHARACTER_SET=4;const SPACING_DATA=5;const SCALE=6;const CHARACTER_SPACING=7;const LINE_HEIGHT=8;const HORIZONTAL_ALIGNMENT=9;const VERTICAL_ALIGNMENT=10;const WRAPPING=11;const INITIALLY_VISIBLE=12;const ORIGIN=13;const HORIZONTAL_ALIGNMENTS=["left","center","right"];const VERTICAL_ALIGNMENTS=["top","center","bottom"];const WORD_WRAP=0;const CHARACTER_WRAP=1;C3.Plugins.Spritefont2.Instance= +class SpriteFontInstance extends C3.SDKWorldInstanceBase{constructor(inst,properties){super(inst);this._text="";this._enableBBcode=true;this._characterWidth=16;this._characterHeight=16;this._characterSet="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@\u00b0+=*$\u00a3\u20ac<>";let spacingData="";this._characterScale=1;this._characterSpacing=0;this._lineHeight=0;this._horizontalAlign=0;this._verticalAlign=0;this._wrapByWord=true;this._spriteFontText=null;this._typewriterStartTime= +-1;this._typewriterEndTime=-1;this._typewriterLength=0;if(properties){this._text=properties[0];this._enableBBcode=properties[1];this._characterWidth=properties[2];this._characterHeight=properties[3];this._characterSet=properties[4];spacingData=properties[5];this._characterScale=properties[6];this._characterSpacing=properties[7];this._lineHeight=properties[8];this._horizontalAlign=properties[9];this._verticalAlign=properties[10];this._wrapByWord=properties[11]===0;const wi=this.GetWorldInfo();wi.SetVisible(properties[12])}this._sdkType.UpdateSettings(this._characterWidth, +this._characterHeight,this._characterSet,spacingData);this._spriteFontText=C3.New(self.SpriteFontText,this._sdkType.GetSpriteFont());const wi=this.GetWorldInfo();this._spriteFontText.SetSize(wi.GetWidth(),wi.GetHeight());this._UpdateSettings()}Release(){this._CancelTypewriter();this._spriteFontText.Release();this._spriteFontText=null;super.Release()}_UpdateSettings(){const sft=this._spriteFontText;if(!sft)return;sft.SetBBCodeEnabled(this._enableBBcode);sft.SetText(this._text);sft.SetWordWrapMode(this._wrapByWord? +"word":"character");sft.SetHorizontalAlign(HORIZONTAL_ALIGNMENTS[this._horizontalAlign]);sft.SetVerticalAlign(VERTICAL_ALIGNMENTS[this._verticalAlign]);sft.SetSpacing(this._characterSpacing);sft.SetLineHeight(this._lineHeight)}Draw(renderer){const imageInfo=this._objectClass.GetImageInfo();const texture=imageInfo.GetTexture();if(!texture)return;renderer.SetTexture(texture);const wi=this.GetWorldInfo();let q=wi.GetBoundingQuad();const sft=this._spriteFontText;sft.SetScale(this._characterScale*wi.GetSceneGraphScale()); +if(this._runtime.IsPixelRoundingEnabled())q=wi.PixelRoundQuad(q);sft.SetSize(wi.GetWidth(),wi.GetHeight());sft.GetSpriteFont().SetTexRect(imageInfo.GetTexRect());sft.SetColor(wi.GetUnpremultipliedColor());sft.Draw(renderer,q.getTlx(),q.getTly(),wi.GetAngle())}SaveToJson(){const ret={"t":this._text,"ebbc":this._enableBBcode,"csc":this._characterScale,"csp":this._characterSpacing,"lh":this._lineHeight,"ha":this._horizontalAlign,"va":this._verticalAlign,"w":this._wrapByWord,"cw":this._sdkType.GetSpriteFont().GetCharacterWidth(), +"ch":this._sdkType.GetSpriteFont().GetCharacterHeight(),"cs":this._sdkType.GetSpriteFont().GetCharacterSet(),"sd":this._sdkType.GetSpriteFont().GetSpacingData()};if(this._typewriterEndTime!==-1)ret["tw"]={"st":this._typewriterStartTime,"en":this._typewriterEndTime,"l":this._typewriterLength};return ret}LoadFromJson(o){this._CancelTypewriter();this._text=o["t"];this._enableBBcode=o["ebbc"];this._characterScale=o["csc"];this._characterSpacing=o["csp"];this._lineHeight=o["lh"];this._horizontalAlign= +o["ha"];this._verticalAlign=o["va"];this._wrapByWord=o["w"];if(o.hasOwnProperty("tw")){const tw=o["tw"];this._typewriterStartTime=tw["st"];this._typewriterEndTime=tw["en"];this._typewriterLength=o["l"]}const spriteFont=this._sdkType.GetSpriteFont();spriteFont.SetCharacterWidth(o["cw"]);spriteFont.SetCharacterHeight(o["ch"]);spriteFont.SetCharacterSet(o["cs"]);spriteFont.SetSpacingData(o["sd"]);this._UpdateSettings();if(this._typewriterEndTime!==-1)this._StartTicking()}GetPropertyValueByIndex(index){switch(index){case TEXT:return this._text; +case ENABLE_BBCODE:return this._enableBBcode;case CHARACTER_WIDTH:return this._sdkType.GetSpriteFont().GetCharacterWidth();case CHARACTER_HEIGHT:return this._sdkType.GetSpriteFont().GetCharacterHeight();case CHARACTER_SET:return this._sdkType.GetSpriteFont().GetCharacterSet();case SPACING_DATA:return this._sdkType.GetSpriteFont().GetSpacingData();case SCALE:return this._characterScale;case CHARACTER_SPACING:return this._characterSpacing;case LINE_HEIGHT:return this._lineHeight;case HORIZONTAL_ALIGNMENT:return this._horizontalAlign; +case VERTICAL_ALIGNMENT:return this._verticalAlign;case WRAPPING:return this._wrapByWord?CHARACTER_WRAP:WORD_WRAP}}SetPropertyValueByIndex(index,value){switch(index){case TEXT:if(this._text===value)return;this._text=value;this._UpdateSettings();break;case ENABLE_BBCODE:if(this._enableBBcode===!!value)return;this._enableBBcode=!!value;this._UpdateSettings();break;case CHARACTER_WIDTH:this._sdkType.GetSpriteFont().SetCharacterWidth(value);break;case CHARACTER_HEIGHT:this._sdkType.GetSpriteFont().SetCharacterHeight(value); +break;case CHARACTER_SET:this._sdkType.GetSpriteFont().SetCharacterSet(value);break;case SPACING_DATA:this._sdkType.GetSpriteFont().SetSpacingData(value);break;case SCALE:if(this._characterScale===value)return;this._characterScale=value;this._UpdateSettings();break;case CHARACTER_SPACING:if(this._characterSpacing===value)return;this._characterSpacing=value;this._UpdateSettings();break;case LINE_HEIGHT:if(this._lineHeight===value)return;this._lineHeight=value;this._UpdateSettings();break;case HORIZONTAL_ALIGNMENT:if(this._horizontalAlign=== +value)return;this._horizontalAlign=value;this._UpdateSettings();break;case VERTICAL_ALIGNMENT:if(this._verticalAlign===value)return;this._verticalAlign=value;this._UpdateSettings();break;case WRAPPING:if(this._wrapByWord===(value===WORD_WRAP))return;this._wrapByWord=value===WORD_WRAP;this._UpdateSettings();break}}_SetText(text){if(this._text===text)return;this._text=text;this._spriteFontText.SetText(text);this._runtime.UpdateRender()}GetText(){return this._text}_StartTypewriter(text,duration){this._SetText(text); +this._typewriterStartTime=this._runtime.GetWallTime();this._typewriterEndTime=this._typewriterStartTime+duration/this.GetInstance().GetActiveTimeScale();this._typewriterLength=C3.BBString.StripAnyTags(text).length;this._spriteFontText.SetDrawMaxCharacterCount(0);this._StartTicking()}_CancelTypewriter(){this._typewriterStartTime=-1;this._typewriterEndTime=-1;this._typewriterLength=0;this._spriteFontText.SetDrawMaxCharacterCount(-1);this._StopTicking()}_FinishTypewriter(){if(this._typewriterEndTime=== +-1)return;this._CancelTypewriter();this.Trigger(C3.Plugins.Spritefont2.Cnds.OnTypewriterTextFinished);this._runtime.UpdateRender()}_SetScale(s){if(this._characterScale===s)return;this._characterScale=s;this._spriteFontText.SetScale(this._characterScale);this._runtime.UpdateRender()}_GetScale(){return this._characterScale}_SetCharacterSpacing(s){if(this._characterSpacing===s)return;this._characterSpacing=s;this._spriteFontText.SetSpacing(this._characterSpacing);this._runtime.UpdateRender()}_GetCharacterSpacing(){return this._characterSpacing}_SetLineHeight(h){if(this._lineHeight=== +h)return;this._lineHeight=h;this._spriteFontText.SetLineHeight(this._lineHeight);this._runtime.UpdateRender()}_GetLineHeight(){return this._lineHeight}_SetHAlign(h){if(this._horizontalAlign===h)return;this._horizontalAlign=h;this._UpdateSettings();this._runtime.UpdateRender()}_GetHAlign(){return this._horizontalAlign}_SetVAlign(v){if(this._verticalAlign===v)return;this._verticalAlign=v;this._UpdateSettings();this._runtime.UpdateRender()}_GetVAlign(){return this._verticalAlign}_SetWrapByWord(w){w= +!!w;if(this._wrapByWord===w)return;this._wrapByWord=w;this._UpdateSettings();this._runtime.UpdateRender()}_IsWrapByWord(){return this._wrapByWord}Tick(){const wallTime=this._runtime.GetWallTime();if(wallTime>=this._typewriterEndTime){this._CancelTypewriter();this.Trigger(C3.Plugins.Spritefont2.Cnds.OnTypewriterTextFinished);this._runtime.UpdateRender()}else{let displayLength=C3.relerp(this._typewriterStartTime,this._typewriterEndTime,wallTime,0,this._typewriterLength);displayLength=Math.floor(displayLength); +if(displayLength!==this._spriteFontText.GetDrawMaxCharacterCount()){this._spriteFontText.SetDrawMaxCharacterCount(displayLength);this._runtime.UpdateRender()}}}GetDebuggerProperties(){const prefix="plugins.spritefont2";return[{title:prefix+".name",properties:[{name:prefix+".properties.text.name",value:this._text,onedit:v=>this._SetText(v)}]}]}GetScriptInterfaceClass(){return self.ISpriteFontInstance}};const map=new WeakMap;const SCRIPT_HORIZONTAL_ALIGNMENTS=new Map([["left",0],["center",1],["right", +2]]);const SCRIPT_VERTICAL_ALIGNMENTS=new Map([["top",0],["center",1],["bottom",2]]);const SCRIPT_WRAP_MODES=new Map([["word",true],["character",false]]);self.ISpriteFontInstance=class ISpriteFontInstance extends self.IWorldInstance{constructor(){super();map.set(this,self.IInstance._GetInitInst().GetSdkInstance())}get text(){return map.get(this).GetText()}set text(str){const inst=map.get(this);inst._CancelTypewriter();inst._SetText(str)}typewriterText(str,duration){const inst=map.get(this);inst._CancelTypewriter(); +inst._StartTypewriter(str,duration)}typewriterFinish(){map.get(this)._FinishTypewriter()}set characterScale(s){map.get(this)._SetScale(s)}get characterScale(){return map.get(this)._GetScale()}set characterSpacing(s){map.get(this)._SetCharacterSpacing(s)}get characterSpacing(){return map.get(this)._GetCharacterSpacing()}set lineHeight(lho){map.get(this)._SetLineHeight(lho)}get lineHeight(){return map.get(this)._GetLineHeight()}set horizontalAlign(str){const h=SCRIPT_HORIZONTAL_ALIGNMENTS.get(str); +if(typeof h==="undefined")throw new Error("invalid mode");map.get(this)._SetHAlign(h)}get horizontalAlign(){return HORIZONTAL_ALIGNMENTS[map.get(this)._GetHAlign()]}set verticalAlign(str){const v=SCRIPT_VERTICAL_ALIGNMENTS.get(str);if(typeof v==="undefined")throw new Error("invalid mode");map.get(this)._SetVAlign(v)}get verticalAlign(){return VERTICAL_ALIGNMENTS[map.get(this)._GetVAlign()]}set wordWrapMode(str){const isWrapByWord=SCRIPT_WRAP_MODES.get(str);if(typeof isWrapByWord==="undefined")throw new Error("invalid mode"); +map.get(this)._SetWrapByWord(isWrapByWord)}get wordWrapMode(){return map.get(this)._IsWrapByWord()?"word":"character"}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Spritefont2.Cnds={CompareText(text,caseSensitive){if(caseSensitive)return this._text===text;else return C3.equalsNoCase(this._text,text)},IsRunningTypewriterText(){return this._typewriterEndTime!==-1},OnTypewriterTextFinished(){return true}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Spritefont2.Acts={SetText(param){this._CancelTypewriter();if(typeof param==="number"&¶m<1E9)param=Math.round(param*1E10)/1E10;this._SetText(param.toString())},AppendText(param){this._CancelTypewriter();if(typeof param==="number"&¶m<1E9)param=Math.round(param*1E10)/1E10;param=param.toString();if(!param)return;this._SetText(this._text+param)},TypewriterText(param,duration){this._CancelTypewriter();if(typeof param==="number"&¶m<1E9)param=Math.round(param* +1E10)/1E10;this._StartTypewriter(param.toString(),duration)},TypewriterFinish(){this._FinishTypewriter()},SetScale(s){this._SetScale(s)},SetCharacterSpacing(s){this._SetCharacterSpacing(s)},SetLineHeight(h){this._SetLineHeight(h)},SetCharacterWidth(chars,width){let didAnyChange=false;const spriteFont=this._sdkType.GetSpriteFont();for(const ch of chars)if(ch===" "){spriteFont.SetSpaceWidth(width);didAnyChange=true}else{const sfc=spriteFont.GetCharacter(ch);if(sfc){sfc.SetDisplayWidth(width);didAnyChange= +true}}if(didAnyChange)spriteFont.SetCharacterWidthsChanged();this._runtime.UpdateRender()},SetEffect(effect){this.GetWorldInfo().SetBlendMode(effect);this._runtime.UpdateRender()},SetHAlign(h){this._SetHAlign(h)},SetVAlign(v){this._SetVAlign(v)},SetWrapping(w){this._SetWrapByWord(w===0)}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Spritefont2.Exps={CharacterWidth(ch){const sfc=this._sdkType.GetSpriteFont().GetCharacter(ch);if(sfc)return sfc.GetDisplayWidth();else return this._sdkType.GetSpriteFont().GetCharacterWidth()},CharacterHeight(){return this._characterHeight},CharacterScale(){return this._characterScale},CharacterSpacing(){return this._characterSpacing},LineHeight(){return this._lineHeight},Text(){return this._text},PlainText(){if(this._enableBBcode)return C3.BBString.StripAnyTags(this._text); +else return this._text},TextWidth(){const wi=this.GetWorldInfo();this._spriteFontText.SetSize(wi.GetWidth(),wi.GetHeight());return this._spriteFontText.GetTextWidth()},TextHeight(){const wi=this.GetWorldInfo();this._spriteFontText.SetSize(wi.GetWidth(),wi.GetHeight());return this._spriteFontText.GetTextHeight()}}}; + + +'use strict';{const C3=self.C3;self.SpriteFontCharacter=class SpriteFontCharacter{constructor(spriteFont,char,x,y){let charWidth=spriteFont.GetCharacterWidth();let charHeight=spriteFont.GetCharacterHeight();this._spriteFont=spriteFont;this._char=char;this._pxRect=new C3.Rect(x,y,x+charWidth,y+charHeight);this._texRect=new C3.Rect;this._displayWidth=-1;this._UpdateTexRect()}Release(){this._spriteFont=null;this._pxRect=null;this._texRect=null}_UpdateTexRect(){let w=this._spriteFont.GetWidth();let h= +this._spriteFont.GetHeight();this._texRect.copy(this._pxRect);this._texRect.divide(w,h);this._texRect.lerpInto(this._spriteFont.GetTexRect())}GetSpriteFont(){return this._spriteFont}GetChar(){return this._char}GetTexRect(){return this._texRect}SetDisplayWidth(w){this._displayWidth=w}GetDisplayWidth(){if(this._displayWidth<0)return this._spriteFont.GetCharacterWidth();else return this._displayWidth}}}; + + +'use strict';{const C3=self.C3;const tmpRect=new C3.Rect;const tmpQuad=new C3.Quad;const tmpColor=new C3.Color;const VALID_HORIZ_ALIGNMENTS=new Set(["left","center","right"]);const VALID_VERT_ALIGNMENTS=new Set(["top","center","bottom"]);const VALID_WORD_WRAP_MODES=new Set(["word","character"]);self.SpriteFontText=class SpriteFontText{constructor(spriteFont){this._spriteFont=spriteFont;this._cssWidth=0;this._cssHeight=0;this._text="";this._isBBcodeEnabled=false;this._bbString=null;this._wrappedText= +C3.New(C3.WordWrap);this._wrapMode="word";this._wrapChanged=false;this._horizontalAlign="left";this._verticalAlign="top";this._scale=1;this._spacing=0;this._lineHeight=0;this._color=C3.New(C3.Color);this._drawMaxCharCount=-1;this._drawCharCount=0;this._measureTextCallback=(str,styles)=>this._MeasureText(str,styles);this._spriteFont._AddSpriteFontText(this)}Release(){this._spriteFont._RemoveSpriteFontText(this);this._color=null;this._measureTextCallback=null;this._wrappedText.Clear();this._wrappedText= +null;this._spriteFont=null;this._bbString=null}_MeasureText(str,styles){const scaleStyle=this._GetStyleTag(styles,"scale");const scale=scaleStyle?parseFloat(scaleStyle.param):this._scale;const scaleXStyle=this._GetStyleTag(styles,"scalex");const scaleX=(scaleXStyle?parseFloat(scaleXStyle.param):1)*scale;const scaleYStyle=this._GetStyleTag(styles,"scaley");const scaleY=(scaleYStyle?parseFloat(scaleYStyle.param):1)*scale;const lineTotalHeight=this._spriteFont.GetCharacterHeight()*scaleY+this._lineHeight; +const spriteFont=this.GetSpriteFont();const defaultCharWidth=spriteFont.GetCharacterWidth()*scaleX;const spacing=this.GetSpacing();if(spriteFont.HasAnyCustomWidths()){let strLen=0;let totalWidth=0;for(const ch of str){let charWidth=defaultCharWidth;const sfc=spriteFont.GetCharacter(ch);if(sfc)charWidth=sfc.GetDisplayWidth()*scaleX;else if(ch===" ")charWidth=spriteFont.GetSpaceWidth()*scaleX;totalWidth+=charWidth;++strLen}return{width:totalWidth+strLen*spacing,height:lineTotalHeight}}else{const strLen= +[...str].length;const spaceCount=Math.max(strLen,0);return{width:defaultCharWidth*strLen+spaceCount*spacing,height:lineTotalHeight}}}_SetWrapChanged(){this._wrapChanged=true;this._wrappedText.Clear()}SetSize(cssWidth,cssHeight){if(cssWidth<=0||cssHeight<=0)return;if(this._cssWidth===cssWidth&&this._cssHeight===cssHeight)return;if(this._cssWidth!==cssWidth)this._SetWrapChanged();this._cssWidth=cssWidth;this._cssHeight=cssHeight}SetDrawMaxCharacterCount(n){this._drawMaxCharCount=Math.floor(n)}GetDrawMaxCharacterCount(){return this._drawMaxCharCount}_GetStyleTag(styles, +tag){for(let i=styles.length-1;i>=0;--i){const s=styles[i];if(s.tag===tag)return s}return null}_HasStyleTag(styles,tag){return!!this._GetStyleTag(styles,tag)}_MaybeWrapText(){if(!this._wrapChanged)return;if(this._isBBcodeEnabled&&(!this._bbString||this._bbString.toString()!==this._text))this._bbString=new C3.BBString(this._text,{noEscape:true});const endOfLineMargin=-this.GetSpacing();this._wrappedText.WordWrap(this._isBBcodeEnabled?this._bbString.toFragmentList():this._text,this._measureTextCallback, +this._cssWidth,this._wrapMode,endOfLineMargin);this._wrapChanged=false}Draw(renderer,offX,offY,angle){this._MaybeWrapText();this._drawCharCount=0;let penY=0;const lineSpaceHeight=this._lineHeight;const lines=C3.cloneArray(this._wrappedText.GetLines());const sin_a=Math.sin(angle);const cos_a=Math.cos(angle);const linesTotalHeight=lines.reduce((a,v)=>a+v.height,0)-lineSpaceHeight;if(this._verticalAlign==="center")penY=Math.max(Math.floor(this._cssHeight/2-linesTotalHeight/2),0);else if(this._verticalAlign=== +"bottom")penY=Math.floor(this._cssHeight-linesTotalHeight);for(let i=0,len=lines.length;i0&&penY>this._cssHeight-(curLineTextHeight-lineSpaceHeight))break;if(penY>=0)this._DrawLine(renderer,line,offX,offY,penY,sin_a,cos_a);penY+=curLineTextHeight}}_DrawLine(renderer,line,offX,offY,penY,sin_a,cos_a){const lineHeight=line.height;let penX=0;if(this._horizontalAlign==="center")penX=Math.max(Math.floor((this._cssWidth-line.width)/2), +0);else if(this._horizontalAlign==="right")penX=Math.max(Math.floor(this._cssWidth-line.width),0);for(const frag of line.fragments){this._DrawFragment(renderer,frag,offX,offY,penX,penY,sin_a,cos_a,lineHeight);penX+=frag.width}}_DrawFragment(renderer,frag,offX,offY,penX,penY,sin_a,cos_a,lineHeight){let text=frag.text;let fragWidth=frag.width;const styles=frag.styles;if(this._drawMaxCharCount!==-1){if(this._drawCharCount>=this._drawMaxCharCount)return;if(this._drawCharCount+text.length>this._drawMaxCharCount){text= +text.substr(0,this._drawMaxCharCount-this._drawCharCount);fragWidth=this._MeasureText(text,styles).width}this._drawCharCount+=text.length}const backgroundStyle=this._GetStyleTag(styles,"background");if(C3.IsStringAllWhitespace(text)&&!backgroundStyle||this._HasStyleTag(styles,"hide"))return;const scaleStyle=this._GetStyleTag(styles,"scale");const scale=scaleStyle?parseFloat(scaleStyle.param):this._scale;const scaleXStyle=this._GetStyleTag(styles,"scalex");const scaleX=(scaleXStyle?parseFloat(scaleXStyle.param): +1)*scale;const scaleYStyle=this._GetStyleTag(styles,"scaley");const scaleY=(scaleYStyle?parseFloat(scaleYStyle.param):1)*scale;const charHeight=this._spriteFont.GetCharacterHeight()*scaleY;const lineSpaceHeight=this._lineHeight;penY+=lineHeight-lineSpaceHeight-charHeight;const offsetXStyle=this._GetStyleTag(styles,"offsetx");penX+=offsetXStyle?parseFloat(offsetXStyle.param):0;const offsetYStyle=this._GetStyleTag(styles,"offsety");penY+=offsetYStyle?parseFloat(offsetYStyle.param):0;if(backgroundStyle){renderer.SetColorFillMode(); +tmpColor.parseString(backgroundStyle.param);tmpColor.setA(1);renderer.SetColor(tmpColor);tmpRect.set(penX,penY,penX+fragWidth,penY+charHeight);if(tmpRect.getRight()>this._cssWidth)tmpRect.setRight(this._cssWidth);tmpQuad.setFromRotatedRectPrecalc(tmpRect,sin_a,cos_a);tmpQuad.offset(offX,offY);renderer.Quad(tmpQuad);renderer.SetTextureFillMode()}const colorStyle=this._GetStyleTag(styles,"color");if(colorStyle){tmpColor.parseString(colorStyle.param);tmpColor.setA(this._color.getA())}else tmpColor.copy(this._color); +const opacityStyle=this._GetStyleTag(styles,"opacity");if(opacityStyle)tmpColor.setA(tmpColor.getA()*parseFloat(opacityStyle.param)/100);tmpColor.premultiply();renderer.SetColor(tmpColor);const drawCharWidth=this._spriteFont.GetCharacterWidth()*scaleX;const endOfLineMargin=Math.abs(this.GetSpacing());for(const ch of text){const sfc=this._spriteFont.GetCharacter(ch);if(sfc){const layoutCharWidth=sfc.GetDisplayWidth()*scaleX;if(penX+layoutCharWidth>this._cssWidth+endOfLineMargin+1E-5)return;tmpRect.set(penX, +penY,penX+drawCharWidth,penY+charHeight);tmpQuad.setFromRotatedRectPrecalc(tmpRect,sin_a,cos_a);tmpQuad.offset(offX,offY);renderer.Quad3(tmpQuad,sfc.GetTexRect());penX+=layoutCharWidth+this._spacing}else penX+=this._spriteFont.GetSpaceWidth()*scaleX+this._spacing}}GetSpriteFont(){return this._spriteFont}SetBBCodeEnabled(e){e=!!e;if(this._isBBcodeEnabled===e)return;this._isBBcodeEnabled=e;this._SetWrapChanged()}IsBBCodeEnabled(){return this._isBBcodeEnabled}SetText(text){if(this._text===text)return; +this._text=text;this._SetWrapChanged()}SetWordWrapMode(w){if(!VALID_WORD_WRAP_MODES.has(w))throw new Error("invalid word wrap mode");if(this._wrapMode===w)return;this._wrapMode=w;this._SetWrapChanged()}SetHorizontalAlign(a){if(!VALID_HORIZ_ALIGNMENTS.has(a))throw new Error("invalid alignment");this._horizontalAlign=a}SetVerticalAlign(a){if(!VALID_VERT_ALIGNMENTS.has(a))throw new Error("invalid alignment");this._verticalAlign=a}SetScale(s){if(this._scale===s)return;this._scale=s;this._SetWrapChanged()}GetScale(){return this._scale}SetSpacing(s){if(this._spacing=== +s)return;this._spacing=s;this._SetWrapChanged()}GetSpacing(){return this._spacing}SetLineHeight(h){this._lineHeight=h;this._SetWrapChanged()}GetLineHeight(){return this._lineHeight}SetOpacity(o){o=C3.clamp(o,0,1);this._color.a=o}SetColor(c){if(this._color.equals(c))return;this._color.copy(c)}GetColor(){return this._color}GetTextWidth(){this._MaybeWrapText();return this._wrappedText.GetMaxLineWidth()}GetTextHeight(){this._MaybeWrapText();const lineTextHeight=this._spriteFont.GetCharacterHeight()*this._scale; +const lineSpaceHeight=this._lineHeight;const lineTotalHeight=lineTextHeight+lineSpaceHeight;return this._wrappedText.GetLineCount()*lineTotalHeight-lineSpaceHeight}}}; + + +'use strict';{const C3=self.C3;const SpriteFontText=self.SpriteFontText;const DEFAULT_SPRITEFONT_OPTS={width:256,height:256,characterWidth:16,characterHeight:16,characterSet:""};self.SpriteFont=class SpriteFont{constructor(opts){opts=Object.assign({},DEFAULT_SPRITEFONT_OPTS,opts);if(opts.width<=0||opts.height<=0||opts.characterWidth<=0||opts.characterHeight<=0)throw new Error("invalid size");this._width=opts.width;this._height=opts.height;this._characterWidth=opts.characterWidth;this._characterHeight= +opts.characterHeight;this._characterSet=opts.characterSet;this._spacingData="";this._spacingParsed=null;this._hasAnyCustomWidths=false;this._spaceWidth=-1;this._texRect=new C3.Rect(0,0,1,1);this._characterMap=new Map;this._mapChanged=true;this._allTexts=new Set}Release(){this._texRect=null;this._ReleaseCharacters();this._characterMap=null;if(this._allTexts)this._allTexts.clear();this._allTexts=null}_ReleaseCharacters(){for(let c of this._characterMap.values())c.Release();this._characterMap.clear()}_AddSpriteFontText(sft){this._allTexts.add(sft)}_RemoveSpriteFontText(sft){this._allTexts.delete(sft)}UpdateCharacterMap(){if(!this._mapChanged)return; +this._ReleaseCharacters();let charSetArr=[...this._characterSet];let cols=Math.floor(this._width/this._characterWidth);let rows=Math.floor(this._height/this._characterHeight);let last=cols*rows;for(let i=0,len=charSetArr.length;i=last)break;let x=i%cols;let y=Math.floor(i/cols);let char=charSetArr[i];this._characterMap.set(char,C3.New(self.SpriteFontCharacter,this,char,x*this._characterWidth,y*this._characterHeight))}this._hasAnyCustomWidths=false;this._spaceWidth=-1;if(Array.isArray(this._spacingParsed))for(let entry of this._spacingParsed){if(!Array.isArray(entry))continue; +if(entry.length!==2)continue;let charWidth=entry[0];let str=entry[1];if(typeof charWidth!=="number"||!isFinite(charWidth)||typeof str!=="string")continue;if(charWidth===this._characterWidth)continue;for(let ch of str){let sfc=this._characterMap.get(ch);if(sfc){sfc.SetDisplayWidth(charWidth);this._hasAnyCustomWidths=true}else if(ch===" "){this._spaceWidth=charWidth;this._hasAnyCustomWidths=true}}}this._mapChanged=false;for(let sft of this._allTexts)sft._SetWrapChanged()}SetCharacterWidthsChanged(){this._hasAnyCustomWidths= +true;for(const sft of this._allTexts)sft._SetWrapChanged()}GetCharacter(ch){this.UpdateCharacterMap();return this._characterMap.get(ch)||null}HasAnyCustomWidths(){return this._hasAnyCustomWidths}SetWidth(w){w=Math.floor(w);if(w<=0)throw new Error("invalid size");if(this._width===w)return;this._width=w;this._mapChanged=true}GetWidth(){return this._width}SetHeight(h){h=Math.floor(h);if(h<=0)throw new Error("invalid size");if(this._height===h)return;this._height=h;this._mapChanged=true}GetHeight(){return this._height}SetTexRect(rc){if(this._texRect.equals(rc))return; +this._texRect.copy(rc);for(const sfc of this._characterMap.values())sfc._UpdateTexRect()}GetTexRect(){return this._texRect}SetCharacterWidth(w){w=Math.floor(w);if(w<=0)throw new Error("invalid size");if(this._characterWidth===w)return;this._characterWidth=w;this._mapChanged=true}GetCharacterWidth(){return this._characterWidth}SetCharacterHeight(h){h=Math.floor(h);if(h<=0)throw new Error("invalid size");if(this._characterHeight===h)return;this._characterHeight=h;this._mapChanged=true}GetCharacterHeight(){return this._characterHeight}SetCharacterSet(s){if(this._characterSet=== +s)return;this._characterSet=s;this._mapChanged=true}GetCharacterSet(){return this._characterSet}SetSpacingData(s){if(this._spacingData===s)return;this._spacingData=s;this._mapChanged=true;this._spacingParsed=null;if(this._spacingData.length)try{this._spacingParsed=JSON.parse(this._spacingData)}catch(e){this._spacingParsed=null}}GetSpacingData(){return this._spacingData}SetSpaceWidth(w){if(w<0)w=-1;if(this._spaceWidth===w)return;this._spaceWidth=w;if(this._spaceWidth>=0)this._hasAnyCustomWidths=true}GetSpaceWidth(){if(this._spaceWidth< +0)return this._characterWidth;else return this._spaceWidth}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Touch=class TouchPlugin extends C3.SDKPluginBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Touch.Type=class TouchType extends C3.SDKTypeBase{constructor(objectClass){super(objectClass)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return self.ITouchObjectType}};let touchObjectType=null;function GetTouchSdkInstance(){return touchObjectType.GetSingleGlobalInstance().GetSdkInstance()}self.ITouchObjectType=class ITouchObjectType extends self.IObjectClass{constructor(objectType){super(objectType);touchObjectType=objectType;objectType.GetRuntime()._GetCommonScriptInterfaces().touch= +this}requestPermission(type){const touchInst=GetTouchSdkInstance();if(type==="orientation")return touchInst._RequestPermission(0);else if(type==="motion")return touchInst._RequestPermission(1);else throw new Error("invalid type");}}}; + + +'use strict';{const C3=self.C3;const DOM_COMPONENT_ID="touch";C3.Plugins.Touch.Instance=class TouchInstance extends C3.SDKInstanceBase{constructor(inst,properties){super(inst,DOM_COMPONENT_ID);this._touches=new Map;this._useMouseInput=false;this._isMouseDown=false;this._orientCompassHeading=0;this._orientAlpha=0;this._orientBeta=0;this._orientGamma=0;this._accX=0;this._accY=0;this._accZ=0;this._accWithGX=0;this._accWithGY=0;this._accWithGZ=0;this._triggerIndex=0;this._triggerId=0;this._triggerPermission= +0;this._curTouchX=0;this._curTouchY=0;this._getTouchIndex=0;this._permissionPromises=[];if(properties)this._useMouseInput=properties[0];this.AddDOMMessageHandler("permission-result",e=>this._OnPermissionResult(e));const rt=this.GetRuntime().Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(rt,"pointerdown",e=>this._OnPointerDown(e.data)),C3.Disposable.From(rt,"pointermove",e=>this._OnPointerMove(e.data)),C3.Disposable.From(rt,"pointerup",e=>this._OnPointerUp(e.data,false)), +C3.Disposable.From(rt,"pointercancel",e=>this._OnPointerUp(e.data,true)),C3.Disposable.From(rt,"deviceorientation",e=>this._OnDeviceOrientation(e.data)),C3.Disposable.From(rt,"deviceorientationabsolute",e=>this._OnDeviceOrientationAbsolute(e.data)),C3.Disposable.From(rt,"devicemotion",e=>this._OnDeviceMotion(e.data)),C3.Disposable.From(rt,"tick2",e=>this._OnTick2()))}Release(){this._touches.clear();super.Release()}_OnPointerDown(e){if(e["pointerType"]==="mouse")if(this._useMouseInput)this._isMouseDown= +true;else return;const pointerId=e["pointerId"];if(this._touches.has(pointerId))return;const x=e["pageX"]-this._runtime.GetCanvasClientX();const y=e["pageY"]-this._runtime.GetCanvasClientY();const nowTime=performance.now();const index=this._touches.size;this._triggerIndex=index;this._triggerId=pointerId;const touchInfo=C3.New(C3.Plugins.Touch.TouchInfo);touchInfo.Init(nowTime,x,y,pointerId,index);this._touches.set(pointerId,touchInfo);this.Trigger(C3.Plugins.Touch.Cnds.OnNthTouchStart);this.Trigger(C3.Plugins.Touch.Cnds.OnTouchStart); +this._curTouchX=x;this._curTouchY=y;this.Trigger(C3.Plugins.Touch.Cnds.OnTouchObject)}_OnPointerMove(e){if(e["pointerType"]==="mouse"&&!this._isMouseDown)return;const touchInfo=this._touches.get(e["pointerId"]);if(!touchInfo)return;const nowTime=performance.now();if(nowTime-touchInfo.GetTime()<2)return;const x=e["pageX"]-this._runtime.GetCanvasClientX();const y=e["pageY"]-this._runtime.GetCanvasClientY();touchInfo.Update(nowTime,x,y,e["width"],e["height"],e["pressure"])}_OnPointerUp(e,isCancel){if(e["pointerType"]=== +"mouse")if(this._isMouseDown)this._isMouseDown=false;else return;const nowTime=performance.now();const pointerId=e["pointerId"];const touchInfo=this._touches.get(pointerId);if(!touchInfo)return;this._triggerIndex=touchInfo.GetStartIndex();this._triggerId=touchInfo.GetId();this.Trigger(C3.Plugins.Touch.Cnds.OnNthTouchEnd);this.Trigger(C3.Plugins.Touch.Cnds.OnTouchEnd);if(!isCancel){const tap=touchInfo.ShouldTriggerTap(nowTime);if(tap==="single-tap"){this.Trigger(C3.Plugins.Touch.Cnds.OnTapGesture); +this._curTouchX=touchInfo.GetX();this._curTouchY=touchInfo.GetY();this.Trigger(C3.Plugins.Touch.Cnds.OnTapGestureObject)}else if(tap==="double-tap"){this.Trigger(C3.Plugins.Touch.Cnds.OnDoubleTapGesture);this._curTouchX=touchInfo.GetX();this._curTouchY=touchInfo.GetY();this.Trigger(C3.Plugins.Touch.Cnds.OnDoubleTapGestureObject)}}touchInfo.Release();this._touches.delete(pointerId)}_RequestPermission(type){this._PostToDOMMaybeSync("request-permission",{"type":type});return new Promise((resolve,reject)=> +{this._permissionPromises.push({type,resolve,reject})})}_OnPermissionResult(e){const isGranted=e["result"];const type=e["type"];this._triggerPermission=type;const toResolve=this._permissionPromises.filter(o=>o.type===type);for(const o of toResolve)o.resolve(isGranted?"granted":"denied");this._permissionPromises=this._permissionPromises.filter(o=>o.type!==type);if(isGranted){this.Trigger(C3.Plugins.Touch.Cnds.OnPermissionGranted);if(type===0)this._runtime.RequestDeviceOrientationEvent();else this._runtime.RequestDeviceMotionEvent()}else this.Trigger(C3.Plugins.Touch.Cnds.OnPermissionDenied)}_OnDeviceOrientation(e){if(typeof e["webkitCompassHeading"]=== +"number")this._orientCompassHeading=e["webkitCompassHeading"];else if(e["absolute"])this._orientCompassHeading=e["alpha"];this._orientAlpha=e["alpha"];this._orientBeta=e["beta"];this._orientGamma=e["gamma"]}_OnDeviceOrientationAbsolute(e){this._orientCompassHeading=e["alpha"]}_OnDeviceMotion(e){const acc=e["acceleration"];if(acc){this._accX=acc["x"];this._accY=acc["y"];this._accZ=acc["z"]}const withG=e["accelerationIncludingGravity"];if(withG){this._accWithGX=withG["x"];this._accWithGY=withG["y"]; +this._accWithGZ=withG["z"]}}_OnTick2(){const nowTime=performance.now();let index=0;for(const touchInfo of this._touches.values()){if(touchInfo.GetTime()<=nowTime-50)touchInfo._SetLastTime(nowTime);if(touchInfo.ShouldTriggerHold(nowTime)){this._triggerIndex=touchInfo.GetStartIndex();this._triggerId=touchInfo.GetId();this._getTouchIndex=index;this.Trigger(C3.Plugins.Touch.Cnds.OnHoldGesture);this._curTouchX=touchInfo.GetX();this._curTouchY=touchInfo.GetY();this.Trigger(C3.Plugins.Touch.Cnds.OnHoldGestureObject); +this._getTouchIndex=0}++index}}_GetTouchByIndex(index){index=Math.floor(index);for(const touchInfo of this._touches.values()){if(index===0)return touchInfo;--index}return null}_IsClientPosOnCanvas(touchX,touchY){return touchX>=0&&touchY>=0&&touchX({name:"$"+ti.GetId(),value:ti.GetX()+ +", "+ti.GetY()}))}]}}}; + + +'use strict';{const C3=self.C3;const tempArr=[];C3.Plugins.Touch.Cnds={OnTouchStart(){return true},OnTouchEnd(){return true},IsInTouch(){return this._touches.size>0},OnTouchObject(objectClass){if(!objectClass)return false;if(!this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY))return false;return this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(objectClass,this._curTouchX,this._curTouchY,false)},IsTouchingObject(objectClass){if(!objectClass)return false;const sol=objectClass.GetCurrentSol(); +const instances=sol.GetInstances();for(const inst of instances){const wi=inst.GetWorldInfo();const layer=wi.GetLayer();for(const touchInfo of this._touches.values()){if(!this._IsClientPosOnCanvas(touchInfo.GetX(),touchInfo.GetY()))continue;const [px,py]=layer.CanvasCssToLayer(touchInfo.GetX(),touchInfo.GetY(),wi.GetTotalZElevation());if(wi.ContainsPoint(px,py)){tempArr.push(inst);break}}}if(tempArr.length){sol.SetArrayPicked(tempArr);objectClass.ApplySolToContainer();C3.clearArray(tempArr);return true}else return false}, +CompareTouchSpeed(index,cmp,s){const touchInfo=this._GetTouchByIndex(index);if(!touchInfo)return false;return C3.compare(touchInfo.GetSpeed(),cmp,s)},OrientationSupported(){return true},MotionSupported(){return true},CompareOrientation(orientation,cmp,a){this._runtime.RequestDeviceOrientationEvent();let v=0;if(orientation===0)v=this._orientAlpha;else if(orientation===1)v=this._orientBeta;else v=this._orientGamma;return C3.compare(v,cmp,a)},CompareAcceleration(a,cmp,x){this._runtime.RequestDeviceMotionEvent(); +let v=0;if(a===0)v=this._accWithGX;else if(a===1)v=this._accWithGY;else if(a===2)v=this._accWithGZ;else if(a===3)v=this._accX;else if(a===4)v=this._accY;else v=this._accZ;return C3.compare(v,cmp,x)},OnNthTouchStart(index){index=Math.floor(index);return index===this._triggerIndex},OnNthTouchEnd(index){index=Math.floor(index);return index===this._triggerIndex},HasNthTouch(index){index=Math.floor(index);return this._touches.size>=index+1},OnHoldGesture(){return true},OnTapGesture(){return true},OnDoubleTapGesture(){return true}, +OnHoldGestureObject(objectClass){if(!objectClass)return false;if(!this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY))return false;return this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(objectClass,this._curTouchX,this._curTouchY,false)},OnTapGestureObject(objectClass){if(!objectClass)return false;if(!this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY))return false;return this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(objectClass,this._curTouchX, +this._curTouchY,false)},OnDoubleTapGestureObject(objectClass){if(!objectClass)return false;if(!this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY))return false;return this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(objectClass,this._curTouchX,this._curTouchY,false)},OnPermissionGranted(type){return this._triggerPermission===type},OnPermissionDenied(type){return this._triggerPermission===type}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Touch.Acts={RequestPermission(type){this._RequestPermission(type)}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Touch.Exps={TouchCount(){return this._touches.size},X(layerParam){const touchInfo=this._GetTouchByIndex(this._getTouchIndex);if(!touchInfo)return 0;return touchInfo.GetPositionForLayer(this._runtime.GetCurrentLayout(),layerParam,true)},Y(layerParam){const touchInfo=this._GetTouchByIndex(this._getTouchIndex);if(!touchInfo)return 0;return touchInfo.GetPositionForLayer(this._runtime.GetCurrentLayout(),layerParam,false)},XAt(index,layerParam){const touchInfo= +this._GetTouchByIndex(index);if(!touchInfo)return 0;return touchInfo.GetPositionForLayer(this._runtime.GetCurrentLayout(),layerParam,true)},YAt(index,layerParam){const touchInfo=this._GetTouchByIndex(index);if(!touchInfo)return 0;return touchInfo.GetPositionForLayer(this._runtime.GetCurrentLayout(),layerParam,false)},XForID(id,layerParam){const touchInfo=this._touches.get(id);if(!touchInfo)return 0;return touchInfo.GetPositionForLayer(this._runtime.GetCurrentLayout(),layerParam,true)},YForID(id,layerParam){const touchInfo= +this._touches.get(id);if(!touchInfo)return 0;return touchInfo.GetPositionForLayer(this._runtime.GetCurrentLayout(),layerParam,false)},AbsoluteX(){const touchInfo=this._GetTouchByIndex(0);if(touchInfo)return touchInfo.GetX();else return 0},AbsoluteY(){const touchInfo=this._GetTouchByIndex(0);if(touchInfo)return touchInfo.GetY();else return 0},AbsoluteXAt(index){const touchInfo=this._GetTouchByIndex(index);if(touchInfo)return touchInfo.GetX();else return 0},AbsoluteYAt(index){const touchInfo=this._GetTouchByIndex(index); +if(touchInfo)return touchInfo.GetY();else return 0},AbsoluteXForID(id){const touchInfo=this._touches.get(id);if(touchInfo)return touchInfo.GetX();else return 0},AbsoluteYForID(id){const touchInfo=this._touches.get(id);if(touchInfo)return touchInfo.GetY();else return 0},SpeedAt(index){const touchInfo=this._GetTouchByIndex(index);if(touchInfo)return touchInfo.GetSpeed();else return 0},SpeedForID(id){const touchInfo=this._touches.get(id);if(touchInfo)return touchInfo.GetSpeed();else return 0},AngleAt(index){const touchInfo= +this._GetTouchByIndex(index);if(touchInfo)return C3.toDegrees(touchInfo.GetAngle());else return 0},AngleForID(id){const touchInfo=this._touches.get(id);if(touchInfo)return C3.toDegrees(touchInfo.GetAngle());else return 0},CompassHeading(){this._runtime.RequestDeviceOrientationEvent();return this._orientCompassHeading},Alpha(){this._runtime.RequestDeviceOrientationEvent();return this._orientAlpha},Beta(){this._runtime.RequestDeviceOrientationEvent();return this._orientBeta},Gamma(){this._runtime.RequestDeviceOrientationEvent(); +return this._orientGamma},AccelerationXWithG(){this._runtime.RequestDeviceMotionEvent();return this._accWithGX},AccelerationYWithG(){this._runtime.RequestDeviceMotionEvent();return this._accWithGY},AccelerationZWithG(){this._runtime.RequestDeviceMotionEvent();return this._accWithGZ},AccelerationX(){this._runtime.RequestDeviceMotionEvent();return this._accX},AccelerationY(){this._runtime.RequestDeviceMotionEvent();return this._accY},AccelerationZ(){this._runtime.RequestDeviceMotionEvent();return this._accZ}, +TouchIndex(){return this._triggerIndex},TouchID(){return this._triggerId},WidthForID(id){const touchInfo=this._touches.get(id);if(touchInfo)return touchInfo.GetWidth();else return 0},HeightForID(id){const touchInfo=this._touches.get(id);if(touchInfo)return touchInfo.GetHeight();else return 0},PressureForID(id){const touchInfo=this._touches.get(id);if(touchInfo)return touchInfo.GetPressure();else return 0}}}; + + +'use strict';{const C3=self.C3;const GESTURE_HOLD_THRESHOLD=15;const GESTURE_HOLD_TIMEOUT=500;const GESTURE_TAP_TIMEOUT=333;const GESTURE_DOUBLETAP_THRESHOLD=25;let lastTapX=-1E3;let lastTapY=-1E3;let lastTapTime=-1E4;C3.Plugins.Touch.TouchInfo=class TouchInfo extends C3.DefendedBase{constructor(){super();this._pointerId=0;this._startIndex=0;this._startTime=0;this._time=0;this._lastTime=0;this._startX=0;this._startY=0;this._x=0;this._y=0;this._lastX=0;this._lastY=0;this._width=0;this._height=0;this._pressure= +0;this._hasTriggeredHold=false;this._isTooFarForHold=false}Release(){}Init(nowTime,x,y,id,index){this._pointerId=id;this._startIndex=index;this._time=nowTime;this._lastTime=nowTime;this._startTime=nowTime;this._startX=x;this._startY=y;this._x=x;this._y=y;this._lastX=x;this._lastY=y}Update(nowTime,x,y,width,height,pressure){this._lastTime=this._time;this._time=nowTime;this._lastX=this._x;this._lastY=this._y;this._x=x;this._y=y;this._width=width;this._height=height;this._pressure=pressure;if(!this._isTooFarForHold&& +C3.distanceTo(this._startX,this._startY,this._x,this._y)>=GESTURE_HOLD_THRESHOLD)this._isTooFarForHold=true}GetId(){return this._pointerId}GetStartIndex(){return this._startIndex}GetTime(){return this._time}_SetLastTime(t){this._lastTime=t}GetX(){return this._x}GetY(){return this._y}GetSpeed(){const dist=C3.distanceTo(this._x,this._y,this._lastX,this._lastY);const dt=(this._time-this._lastTime)/1E3;if(dt>0)return dist/dt;else return 0}GetAngle(){return C3.angleTo(this._lastX,this._lastY,this._x,this._y)}GetWidth(){return this._width}GetHeight(){return this._height}GetPressure(){return this._pressure}ShouldTriggerHold(nowTime){if(this._hasTriggeredHold)return false; +if(nowTime-this._startTime>=GESTURE_HOLD_TIMEOUT&&!this._isTooFarForHold&&C3.distanceTo(this._startX,this._startY,this._x,this._y)this._OnPointerMove(e.data)),C3.Disposable.From(rt, +"pointerdown",e=>this._OnPointerDown(e.data)),C3.Disposable.From(rt,"pointerup",e=>this._OnPointerUp(e.data)),C3.Disposable.From(rt,"dblclick",e=>this._OnDoubleClick(e.data)),C3.Disposable.From(rt,"wheel",e=>this._OnMouseWheel(e.data)),C3.Disposable.From(rt,"window-blur",()=>this._OnWindowBlur()))}Release(){super.Release()}_OnPointerDown(e){if(e["pointerType"]!=="mouse")return;this._mouseXcanvas=e["pageX"]-this._runtime.GetCanvasClientX();this._mouseYcanvas=e["pageY"]-this._runtime.GetCanvasClientY(); +this._CheckButtonChanges(e["lastButtons"],e["buttons"])}_OnPointerMove(e){if(e["pointerType"]!=="mouse")return;this._mouseXcanvas=e["pageX"]-this._runtime.GetCanvasClientX();this._mouseYcanvas=e["pageY"]-this._runtime.GetCanvasClientY();this._CheckButtonChanges(e["lastButtons"],e["buttons"])}_OnPointerUp(e){if(e["pointerType"]!=="mouse")return;this._CheckButtonChanges(e["lastButtons"],e["buttons"])}_CheckButtonChanges(lastButtons,buttons){this._CheckButtonChange(lastButtons,buttons,1,0);this._CheckButtonChange(lastButtons, +buttons,4,1);this._CheckButtonChange(lastButtons,buttons,2,2)}_CheckButtonChange(lastButtons,buttons,checkButtonFlag,resultButton){if(!(lastButtons&checkButtonFlag)&&buttons&checkButtonFlag)this._OnMouseDown(resultButton);else if(lastButtons&checkButtonFlag&&!(buttons&checkButtonFlag))this._OnMouseUp(resultButton)}_OnMouseDown(button){this._buttonMap[button]=true;this.Trigger(C3.Plugins.Mouse.Cnds.OnAnyClick);this._triggerButton=button;this._triggerType=0;this.Trigger(C3.Plugins.Mouse.Cnds.OnClick); +this.Trigger(C3.Plugins.Mouse.Cnds.OnObjectClicked)}_OnMouseUp(button){if(!this._buttonMap[button])return;this._buttonMap[button]=false;this._triggerButton=button;this.Trigger(C3.Plugins.Mouse.Cnds.OnRelease)}_OnDoubleClick(e){this._triggerButton=e["button"];this._triggerType=1;this.Trigger(C3.Plugins.Mouse.Cnds.OnClick);this.Trigger(C3.Plugins.Mouse.Cnds.OnObjectClicked)}_OnMouseWheel(e){this._triggerDir=e["deltaY"]<0?1:0;this.Trigger(C3.Plugins.Mouse.Cnds.OnWheel)}_OnWindowBlur(){for(let i=0,len= +this._buttonMap.length;i=0&&this._mouseYcanvas>=0&&this._mouseXcanvas({name:"$"+layer.GetName(),value:layer.CanvasCssToLayer(this._mouseXcanvas,this._mouseYcanvas).join(", ")}))}]}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Mouse.Cnds={OnClick(button,type){return this._triggerButton===button&&this._triggerType===type},OnAnyClick(){return true},IsButtonDown(button){return this._buttonMap[button]},OnRelease(button){return this._triggerButton===button},IsOverObject(objectClass){if(!this._IsMouseOverCanvas())return false;const cnd=this._runtime.GetCurrentCondition();const isInverted=cnd.IsInverted();const mx=this._mouseXcanvas;const my=this._mouseYcanvas;return C3.xor(this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(objectClass, +mx,my,isInverted),isInverted)},OnObjectClicked(button,type,objectClass){if(button!==this._triggerButton||type!==this._triggerType)return false;if(!this._IsMouseOverCanvas())return false;const mx=this._mouseXcanvas;const my=this._mouseYcanvas;return this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(objectClass,mx,my,false)},OnWheel(dir){return this._triggerDir===dir}}}; + + +'use strict';{const C3=self.C3;let lastSetCursor=null;const CURSOR_STYLES=["auto","pointer","text","crosshair","move","help","wait","none"];C3.Plugins.Mouse.Acts={SetCursor(c){const cursorStyle=CURSOR_STYLES[c];if(lastSetCursor===cursorStyle)return;lastSetCursor=cursorStyle;this.PostToDOM("cursor",cursorStyle)},SetCursorSprite(objectClass){if(C3.Platform.IsMobile||!objectClass)return;const inst=objectClass.GetFirstPicked();if(!inst)return;const wi=inst.GetWorldInfo();const imageInfo=inst.GetCurrentImageInfo(); +if(!wi||!imageInfo)return;if(lastSetCursor===imageInfo)return;lastSetCursor=imageInfo;imageInfo.ExtractImageToCanvas().then(canvas=>C3.CanvasToBlob(canvas)).then(blob=>{const url=URL.createObjectURL(blob);const cursorStyle=`url(${url}) ${Math.round(wi.GetOriginX()*imageInfo.GetWidth())} ${Math.round(wi.GetOriginY()*imageInfo.GetHeight())}, auto`;this.PostToDOM("cursor","");this.PostToDOM("cursor",cursorStyle)})}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.Mouse.Exps={X(layerParam){return this.GetMousePositionForLayer(layerParam)[0]},Y(layerParam){return this.GetMousePositionForLayer(layerParam)[1]},AbsoluteX(){return this._mouseXcanvas},AbsoluteY(){return this._mouseYcanvas}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.PlatformInfo=class PlatformInfoPlugin extends C3.SDKPluginBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.PlatformInfo.Type=class PlatformInfoType extends C3.SDKTypeBase{constructor(objectClass){super(objectClass)}Release(){super.Release()}OnCreate(){}}}; + + +'use strict';{const C3=self.C3;const DOM_COMPONENT_ID="platform-info";C3.Plugins.PlatformInfo.Instance=class PlatformInfoInstance extends C3.SDKInstanceBase{constructor(inst,properties){super(inst,DOM_COMPONENT_ID);this._screenWidth=0;this._screenHeight=0;this._windowOuterWidth=0;this._windowOuterHeight=0;this._safeAreaInset=[0,0,0,0];this._supportsWakeLock=false;this._isWakeLockActive=false;this.AddDOMMessageHandlers([["window-resize",e=>this._OnWindowResize(e)],["wake-lock-acquired",e=>this._OnWakeLockAcquired(e)], +["wake-lock-error",e=>this._OnWakeLockError(e)],["wake-lock-released",e=>this._OnWakeLockReleased(e)]]);if(navigator.connection)navigator.connection.addEventListener("change",()=>this._OnNetworkChange());this._runtime.AddLoadPromise(this.PostToDOMAsync("get-initial-state").then(data=>{this._screenWidth=data["screenWidth"];this._screenHeight=data["screenHeight"];this._windowOuterWidth=data["windowOuterWidth"];this._windowOuterHeight=data["windowOuterHeight"];this._safeAreaInset=data["safeAreaInset"]; +this._supportsWakeLock=data["supportsWakeLock"]}))}Release(){super.Release()}_OnWindowResize(e){this._windowOuterWidth=e["windowOuterWidth"];this._windowOuterHeight=e["windowOuterHeight"];this._safeAreaInset=e["safeAreaInset"]}async _OnNetworkChange(){await this.TriggerAsync(C3.Plugins.PlatformInfo.Cnds.OnNetworkChange)}async _OnWakeLockAcquired(){this._isWakeLockActive=true;await this.TriggerAsync(C3.Plugins.PlatformInfo.Cnds.OnWakeLockAcquired)}async _OnWakeLockError(){this._isWakeLockActive=false; +await this.TriggerAsync(C3.Plugins.PlatformInfo.Cnds.OnWakeLockError)}async _OnWakeLockReleased(){this._isWakeLockActive=false;await this.TriggerAsync(C3.Plugins.PlatformInfo.Cnds.OnWakeLockReleased)}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.PlatformInfo.Cnds={IsOnMobile(){return C3.Platform.IsMobile},IsOnWindows(){return C3.Platform.OS==="Windows"},IsOnMacOS(){return C3.Platform.OS==="Mac OS X"},IsOnLinux(){return C3.Platform.OS==="Linux"},IsOnChromeOS(){return C3.Platform.OS==="Chrome OS"},IsOnAndroid(){return C3.Platform.OS==="Android"},IsOniOS(){return C3.Platform.OS==="iOS"},IsWebExport(){const exportType=this._runtime.GetExportType();return exportType==="html5"||exportType==="scirra-arcade"|| +exportType==="preview"||exportType==="instant-games"},IsCordovaExport(){return this._runtime.IsCordova()},IsNWjsExport(){return this._runtime.GetExportType()==="nwjs"},IsWindowsUWPExport(){return this._runtime.GetExportType()==="windows-uwp"},OnNetworkChange(){return true},OnWakeLockAcquired(){return true},OnWakeLockError(){return true},OnWakeLockReleased(){return true},IsWakeLockActive(){return this._isWakeLockActive},IsWakeLockSupported(){return this._supportsWakeLock}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.PlatformInfo.Acts={RequestWakeLock(){if(!this._supportsWakeLock)return;this._PostToDOMMaybeSync("request-wake-lock")},ReleaseWakeLock(){if(!this._supportsWakeLock)return;this._isWakeLockActive=false;this.PostToDOM("release-wake-lock")}}}; + + +'use strict';{const C3=self.C3;C3.Plugins.PlatformInfo.Exps={Renderer(){const renderer=this._runtime.GetWebGLRenderer();let ret="webgl"+renderer.GetWebGLVersionNumber();if(renderer.HasMajorPerformanceCaveat())ret+="-software";return ret},RendererDetail(){return this._runtime.GetWebGLRenderer().GetUnmaskedRenderer()},DevicePixelRatio(){return self.devicePixelRatio},ScreenWidth(){return this._screenWidth},ScreenHeight(){return this._screenHeight},WindowInnerWidth(){return this._runtime.GetCanvasManager().GetLastWidth()}, +WindowInnerHeight(){return this._runtime.GetCanvasManager().GetLastHeight()},WindowOuterWidth(){return this._windowOuterWidth},WindowOuterHeight(){return this._windowOuterHeight},CanvasCssWidth(){return this._runtime.GetCanvasManager().GetCssWidth()},CanvasCssHeight(){return this._runtime.GetCanvasManager().GetCssHeight()},CanvasDeviceWidth(){return this._runtime.GetCanvasManager().GetDeviceWidth()},CanvasDeviceHeight(){return this._runtime.GetCanvasManager().GetDeviceHeight()},Downlink(){if(navigator.connection)return navigator.connection["downlink"]|| +0;else return 0},DownlinkMax(){if(navigator.connection)return navigator.connection["downlinkMax"]||0;else return 0},ConnectionType(){if(navigator.connection)return navigator.connection["type"]||"unknown";else return"unknown"},ConnectionEffectiveType(){if(navigator.connection)return navigator.connection["effectiveType"]||"unknown";else return"unknown"},ConnectionRTT(){if(navigator.connection)return navigator.connection["rtt"]||0;else return 0},HardwareConcurrency(){return navigator.hardwareConcurrency|| +0},DeviceMemory(){return navigator.deviceMemory||0},SafeAreaInsetTop(){return this._safeAreaInset[0]},SafeAreaInsetRight(){return this._safeAreaInset[1]},SafeAreaInsetBottom(){return this._safeAreaInset[2]},SafeAreaInsetLeft(){return this._safeAreaInset[3]}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Sin=class SinBehavior extends C3.SDKBehaviorBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Sin.Type=class SinType extends C3.SDKBehaviorTypeBase{constructor(behaviorType){super(behaviorType)}Release(){super.Release()}OnCreate(){}}}; + + +'use strict';{const C3=self.C3;const MOVEMENT=0;const WAVE=1;const PERIOD=2;const PERIOD_RANDOM=3;const PERIOD_OFFSET=4;const PERIOD_OFFSET_RANDOM=5;const MAGNITUDE=6;const MAGNITUDE_RANDOM=7;const ENABLE=8;const HORIZONTAL=0;const VERTICAL=1;const SIZE=2;const WIDTH=3;const HEIGHT=4;const ANGLE=5;const OPACITY=6;const VALUE=7;const FORWARDS_BACKWARDS=8;const ZELEVATION=9;const SINE=0;const TRIANGLE=1;const SAWTOOTH=2;const REVERSE_SAWTOOTH=3;const SQUARE=4;const _2pi=2*Math.PI;const _pi_2=Math.PI/ +2;const _3pi_2=3*Math.PI/2;const MOVEMENT_LOOKUP=[0,1,8,3,4,2,5,6,9,7];C3.Behaviors.Sin.Instance=class SinInstance extends C3.SDKBehaviorInstanceBase{constructor(behInst,properties){super(behInst);this._i=0;this._movement=0;this._wave=0;this._period=0;this._mag=0;this._isEnabled=true;this._basePeriod=0;this._basePeriodOffset=0;this._baseMag=0;this._periodRandom=0;this._periodOffsetRandom=0;this._magnitudeRandom=0;this._initialValue=0;this._initialValue2=0;this._lastKnownValue=0;this._lastKnownValue2= +0;this._ratio=0;if(properties){this._movement=MOVEMENT_LOOKUP[properties[MOVEMENT]];this._wave=properties[WAVE];this._periodRandom=this._runtime.Random()*properties[PERIOD_RANDOM];this._basePeriod=properties[PERIOD];this._period=properties[PERIOD];this._period+=this._periodRandom;this._basePeriodOffset=properties[PERIOD_OFFSET];if(this._period!==0){this._periodOffsetRandom=this._runtime.Random()*properties[PERIOD_OFFSET_RANDOM];this._i=properties[PERIOD_OFFSET]/this._period*_2pi;this._i+=this._periodOffsetRandom/ +this._period*_2pi}this._magnitudeRandom=this._runtime.Random()*properties[MAGNITUDE_RANDOM];this._baseMag=properties[MAGNITUDE];this._mag=properties[MAGNITUDE];this._mag+=this._magnitudeRandom;this._isEnabled=!!properties[ENABLE]}if(this._movement===ANGLE)this._mag=C3.toRadians(this._mag);this.Init();if(this._isEnabled)this._StartTicking()}Release(){super.Release()}SaveToJson(){return{"i":this._i,"e":this._isEnabled,"mv":this._movement,"w":this._wave,"p":this._period,"mag":this._mag,"iv":this._initialValue, +"iv2":this._initialValue2,"r":this._ratio,"lkv":this._lastKnownValue,"lkv2":this._lastKnownValue2}}LoadFromJson(o){this._i=o["i"];this._SetEnabled(o["e"]);this._movement=o["mv"];this._wave=o["w"];this._period=o["p"];this._mag=o["mag"];this._initialValue=o["iv"];this._initialValue2=o["iv2"];this._ratio=o["r"];this._lastKnownValue=o["lkv"];this._lastKnownValue2=o["lkv2"]}Init(){const wi=this._inst.GetWorldInfo();switch(this._movement){case HORIZONTAL:this._initialValue=wi.GetX();break;case VERTICAL:this._initialValue= +wi.GetY();break;case SIZE:this._initialValue=wi.GetWidth();this._ratio=wi.GetHeight()/wi.GetWidth();break;case WIDTH:this._initialValue=wi.GetWidth();break;case HEIGHT:this._initialValue=wi.GetHeight();break;case ANGLE:this._initialValue=wi.GetAngle();break;case OPACITY:this._initialValue=wi.GetOpacity();break;case VALUE:this._initialValue=0;break;case FORWARDS_BACKWARDS:this._initialValue=wi.GetX();this._initialValue2=wi.GetY();break;case ZELEVATION:this._initialValue=wi.GetZElevation();break;default:}this._lastKnownValue= +this._initialValue;this._lastKnownValue2=this._initialValue2}WaveFunc(x){x=x%_2pi;switch(this._wave){case SINE:return Math.sin(x);case TRIANGLE:if(x<=_pi_2)return x/_pi_2;else if(x<=_3pi_2)return 1-2*(x-_pi_2)/Math.PI;else return(x-_3pi_2)/_pi_2-1;case SAWTOOTH:return 2*x/_2pi-1;case REVERSE_SAWTOOTH:return-2*x/_2pi+1;case SQUARE:return xthis._SetEnabled(v)},{name:prefix+".properties.period.name",value:this._period,onedit:v=>this._period=v},{name:prefix+".properties.magnitude.name",value:this._mag,onedit:v=>this._mag=v},{name:prefix+".debugger.value", +value:this.WaveFunc(this._i)*this._mag}]}]}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Sin.Cnds={IsEnabled(){return this._isEnabled},CompareMovement(m){return this._movement===m},ComparePeriod(cmp,v){return C3.compare(this._period,cmp,v)},CompareMagnitude(cmp,v){if(this._movement===5)return C3.compare(this._mag,cmp,C3.toRadians(v));else return C3.compare(this._mag,cmp,v)},CompareWave(w){return this._wave===w}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Sin.Acts={SetEnabled(e){this._SetEnabled(e!==0)},SetPeriod(x){this._period=x},SetMagnitude(x){this._mag=x;if(this._movement===5)this._mag=C3.toRadians(this._mag)},SetMovement(m){if(this._movement===5&&m!==5)this._mag=C3.toDegrees(this._mag);this._movement=m;this.Init()},SetWave(w){this._wave=w},SetPhase(x){const _2pi=Math.PI*2;this._i=x*_2pi%_2pi;this._UpdateFromPhase()},UpdateInitialState(){this.Init()}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Sin.Exps={CyclePosition(){return this._i/(2*Math.PI)},Period(){return this._period},Magnitude(){if(this._movement===5)return C3.toDegrees(this._mag);else return this._mag},Value(){return this.WaveFunc(this._i)*this._mag}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.solid=class SolidBehavior extends C3.SDKBehaviorBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.solid.Type=class SolidType extends C3.SDKBehaviorTypeBase{constructor(behaviorType){super(behaviorType)}Release(){super.Release()}OnCreate(){}}}; + + +'use strict';{const C3=self.C3;const ENABLE=0;const TAGS=1;const EMPTY_SET=new Set;C3.Behaviors.solid.Instance=class SolidInstance extends C3.SDKBehaviorInstanceBase{constructor(behInst,properties){super(behInst);this.SetEnabled(true);if(properties){this.SetEnabled(properties[ENABLE]);this.SetTags(properties[TAGS])}}Release(){super.Release()}SetEnabled(e){this._inst._SetSolidEnabled(!!e)}IsEnabled(){return this._inst._IsSolidEnabled()}SetTags(tagList){const savedDataMap=this._inst.GetSavedDataMap(); +if(!tagList.trim()){savedDataMap.delete("solidTags");return}let solidTags=savedDataMap.get("solidTags");if(!solidTags){solidTags=new Set;savedDataMap.set("solidTags",solidTags)}solidTags.clear();for(const tag of tagList.split(" "))if(tag)solidTags.add(tag.toLowerCase())}GetTags(){return this._inst.GetSavedDataMap().get("solidTags")||EMPTY_SET}SaveToJson(){return{"e":this.IsEnabled()}}LoadFromJson(o){this.SetEnabled(o["e"])}GetPropertyValueByIndex(index){switch(index){case ENABLE:return this.IsEnabled()}}SetPropertyValueByIndex(index, +value){switch(index){case ENABLE:this.SetEnabled(value);break}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.solid.properties.enabled.name",value:this.IsEnabled(),onedit:v=>this.SetEnabled(v)}]}]}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.solid.Cnds={IsEnabled(){return this.IsEnabled()}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.solid.Acts={SetEnabled(e){this.SetEnabled(e)},SetTags(tagList){this.SetTags(tagList)}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.solid.Exps={}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Pin=class PinBehavior extends C3.SDKBehaviorBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Pin.Type=class PinType extends C3.SDKBehaviorTypeBase{constructor(behaviorType){super(behaviorType)}Release(){super.Release()}OnCreate(){}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Pin.Instance=class PinInstance extends C3.SDKBehaviorInstanceBase{constructor(behInst,properties){super(behInst);this._pinInst=null;this._pinUid=-1;this._mode="";this._propSet=new Set;this._pinDist=0;this._pinAngle=0;this._pinImagePoint=0;this._dx=0;this._dy=0;this._dWidth=0;this._dHeight=0;this._dAngle=0;this._dz=0;this._lastKnownAngle=0;this._destroy=false;if(properties)this._destroy=properties[0];const rt=this._runtime.Dispatcher();this._disposables= +new C3.CompositeDisposable(C3.Disposable.From(rt,"instancedestroy",e=>this._OnInstanceDestroyed(e.instance)),C3.Disposable.From(rt,"afterload",e=>this._OnAfterLoad()))}Release(){this._pinInst=null;super.Release()}_SetPinInst(inst){if(inst){this._pinInst=inst;this._StartTicking2()}else{this._pinInst=null;this._StopTicking2()}}_Pin(objectClass,mode,propList){if(!objectClass)return;const otherInst=objectClass.GetFirstPicked(this._inst);if(!otherInst)return;this._mode=mode;this._SetPinInst(otherInst); +const myWi=this._inst.GetWorldInfo();const otherWi=otherInst.GetWorldInfo();if(this._mode==="properties"){const propSet=this._propSet;propSet.clear();for(const p of propList)propSet.add(p);this._dx=myWi.GetX()-otherWi.GetX();this._dy=myWi.GetY()-otherWi.GetY();this._dAngle=myWi.GetAngle()-otherWi.GetAngle();this._lastKnownAngle=myWi.GetAngle();this._dz=myWi.GetZElevation()-otherWi.GetZElevation();if(propSet.has("x")&&propSet.has("y")){this._pinAngle=C3.angleTo(otherWi.GetX(),otherWi.GetY(),myWi.GetX(), +myWi.GetY())-otherWi.GetAngle();this._pinDist=C3.distanceTo(otherWi.GetX(),otherWi.GetY(),myWi.GetX(),myWi.GetY())}if(propSet.has("width-abs"))this._dWidth=myWi.GetWidth()-otherWi.GetWidth();else if(propSet.has("width-scale"))this._dWidth=myWi.GetWidth()/otherWi.GetWidth();if(propSet.has("height-abs"))this._dHeight=myWi.GetHeight()-otherWi.GetHeight();else if(propSet.has("height-scale"))this._dHeight=myWi.GetHeight()/otherWi.GetHeight()}else this._pinDist=C3.distanceTo(otherWi.GetX(),otherWi.GetY(), +myWi.GetX(),myWi.GetY())}SaveToJson(){const propSet=this._propSet;const mode=this._mode;const ret={"uid":this._pinInst?this._pinInst.GetUID():-1,"m":mode};if(mode==="rope"||mode==="bar")ret["pd"]=this._pinDist;else if(mode==="properties"){ret["ps"]=[...this._propSet];if(propSet.has("imagepoint"))ret["ip"]=this._pinImagePoint;else if(propSet.has("x")&&propSet.has("y")){ret["pa"]=this._pinAngle;ret["pd"]=this._pinDist}else{if(propSet.has("x"))ret["dx"]=this._dx;if(propSet.has("y"))ret["dy"]=this._dy}if(propSet.has("angle")){ret["da"]= +this._dAngle;ret["lka"]=this._lastKnownAngle}if(propSet.has("width-abs")||propSet.has("width-scale"))ret["dw"]=this._dWidth;if(propSet.has("height-abs")||propSet.has("height-scale"))ret["dh"]=this._dHeight;if(propSet.has("z"))ret["dz"]=this._dz}return ret}LoadFromJson(o){const mode=o["m"];const propSet=this._propSet;propSet.clear();this._pinUid=o["uid"];if(typeof mode==="number"){this._LoadFromJson_Legacy(o);return}this._mode=mode;if(mode==="rope"||mode==="bar")this._pinDist=o["pd"];else if(mode=== +"properties"){for(const p of o["ps"])propSet.add(p);if(propSet.has("imagepoint"))this._pinImagePoint=o["ip"];else if(propSet.has("x")&&propSet.has("y")){this._pinAngle=o["pa"];this._pinDist=o["pd"]}else{if(propSet.has("x"))this._dx=o["dx"];if(propSet.has("y"))this._dy=o["dy"]}if(propSet.has("angle")){this._dAngle=o["da"];this._lastKnownAngle=o["lka"]||0}if(propSet.has("width-abs")||propSet.has("width-scale"))this._dWidth=o["dw"];if(propSet.has("height-abs")||propSet.has("height-scale"))this._dHeight= +o["dh"];if(propSet.has("z"))this._dz=o["dz"]}}_LoadFromJson_Legacy(o){const propSet=this._propSet;const myStartAngle=o["msa"];const theirStartAngle=o["tsa"];const pinAngle=o["pa"];const pinDist=o["pd"];const mode=o["m"];switch(mode){case 0:this._mode="properties";propSet.add("x").add("y").add("angle");this._pinAngle=pinAngle;this._pinDist=pinDist;this._dAngle=myStartAngle-theirStartAngle;this._lastKnownAngle=o["lka"];break;case 1:this._mode="properties";propSet.add("x").add("y");this._pinAngle=pinAngle; +this._pinDist=pinDist;break;case 2:this._mode="properties";propSet.add("angle");this._dAngle=myStartAngle-theirStartAngle;this._lastKnownAngle=o["lka"];break;case 3:this._mode="rope";this._pinDist=o["pd"];break;case 4:this._mode="bar";this._pinDist=o["pd"];break}}_OnAfterLoad(){if(this._pinUid===-1)this._SetPinInst(null);else{this._SetPinInst(this._runtime.GetInstanceByUID(this._pinUid));this._pinUid=-1}}_OnInstanceDestroyed(inst){if(this._pinInst===inst){this._SetPinInst(null);if(this._destroy)this._runtime.DestroyInstance(this._inst)}}Tick2(){const pinInst= +this._pinInst;if(!pinInst)return;const pinWi=pinInst.GetWorldInfo();const myInst=this._inst;const myWi=myInst.GetWorldInfo();const mode=this._mode;let bboxChanged=false;if(mode==="rope"||mode==="bar"){const dist=C3.distanceTo(myWi.GetX(),myWi.GetY(),pinWi.GetX(),pinWi.GetY());if(dist>this._pinDist||mode==="bar"&&distthis._OnInstanceDestroyed(e.instance)), +C3.Disposable.From(rt,"afterload",e=>this._OnAfterLoad()));if(this._defaultControls)this._BindEvents();if(this._isEnabled)this._StartPostTicking();this._UpdateGravity();this._inst.GetUnsavedDataMap().set("isPlatformBehavior",true)}Release(){if(this._keyboardDisposables){this._keyboardDisposables.Release();this._keyboardDisposables=null}this._lastFloorObject=null;this._wasOverJumpthru=null;super.Release()}_BindEvents(){if(this._keyboardDisposables)return;const rt=this._runtime.Dispatcher();this._keyboardDisposables= +new C3.CompositeDisposable(C3.Disposable.From(rt,"keydown",e=>this._OnKeyDown(e.data)),C3.Disposable.From(rt,"keyup",e=>this._OnKeyUp(e.data)),C3.Disposable.From(rt,"window-blur",()=>this._OnWindowBlur()))}_UnBindEvents(){if(!this._keyboardDisposables)return;this._keyboardDisposables.Release();this._keyboardDisposables=null}_OnInstanceDestroyed(inst){if(this._lastFloorObject===inst)this._lastFloorObject=null;if(this._wasOverJumpthru===inst)this._wasOverJumpthru=null}_OnKeyDown(data){switch(data["key"]){case "ArrowLeft":this._leftKey= +true;break;case "ArrowRight":this._rightKey=true;break;case "ArrowUp":this._jumpKey=true;break}}_OnKeyUp(data){switch(data["key"]){case "ArrowLeft":this._leftKey=false;break;case "ArrowRight":this._rightKey=false;break;case "ArrowUp":this._jumpKey=false;this._jumped=false;break}}_OnWindowBlur(){this._leftKey=false;this._rightKey=false;this._jumpKey=false;this._jumped=false}SaveToJson(){return{"ii":this._ignoreInput,"lfx":this._lastFloorX,"lfy":this._lastFloorY,"lfo":this._lastFloorObject?this._lastFloorObject.GetUID(): +-1,"am":this._animMode,"en":this._isEnabled,"fall":this._fallThrough,"ft":this._isFirstTick,"dx":this._dx,"dy":this._dy,"ms":this._maxSpeed,"acc":this._acc,"dec":this._dec,"js":this._jumpStrength,"g":this._g,"g1":this._g1,"mf":this._maxFall,"wof":this._wasOnFloor,"woj":this._wasOverJumpthru?this._wasOverJumpthru.GetUID():-1,"ga":this._ga,"edj":this._enableDoubleJump,"cdj":this._canDoubleJump,"dj":this._doubleJumped,"sus":this._jumpSustain,"dc":this._defaultControls,"cc":this._ceilingCollisionMode}}LoadFromJson(o){this._ignoreInput= +o["ii"];this._lastFloorX=o["lfx"];this._lastFloorY=o["lfy"];this._loadFloorUid=o["lfo"];this._animMode=o["am"];const isEnabled=o["en"];this._fallThrough=o["fall"];this._isFirstTick=o["ft"];this._dx=o["dx"];this._dy=o["dy"];this._maxSpeed=o["ms"];this._acc=o["acc"];this._dec=o["dec"];this._jumpStrength=o["js"];this._g=o["g"];this._g1=o["g1"];this._maxFall=o["mf"];this._wasOnFloor=o["wof"];this._loadJumpthruUid=o["woj"];this._ga=o["ga"];this._enableDoubleJump=o["edj"];this._canDoubleJump=o["cdj"];this._doubleJumped= +o["dj"];this._jumpSustain=o["sus"];this._defaultControls=o["dc"];this._ceilingCollisionMode=o["cc"]||0;this._leftKey=false;this._rightKey=false;this._jumpKey=false;this._jumped=false;this._simLeft=false;this._simRight=false;this._simJump=false;this._sustainTime=0;if(this._defaultControls)this._BindEvents();else this._UnBindEvents();this._SetEnabled(isEnabled);this._UpdateGravity()}_OnAfterLoad(){if(this._loadFloorUid===-1)this._lastFloorObject=null;else this._lastFloorObject=this._runtime.GetInstanceByUID(this._loadFloorUid); +if(this._loadJumpthruUid===-1)this._wasOverJumpthru=null;else this._wasOverJumpthru=this._runtime.GetInstanceByUID(this._loadJumpthruUid)}_UpdateGravity(){this._downX=Math.cos(this._ga);this._downY=Math.sin(this._ga);this._rightX=Math.cos(this._ga-Math.PI/2);this._rightY=Math.sin(this._ga-Math.PI/2);this._downX=C3.round6dp(this._downX);this._downY=C3.round6dp(this._downY);this._rightX=C3.round6dp(this._rightX);this._rightY=C3.round6dp(this._rightY);this._g1=this._g;if(this._g<0){this._downX*=-1;this._downY*= +-1;this._g=Math.abs(this._g)}}_GetGDir(){if(this._g<0)return-1;else return 1}_IsOnFloor(){const wi=this._inst.GetWorldInfo();const collisionEngine=this._runtime.GetCollisionEngine();const inst=this._inst;const lfo=this._lastFloorObject;const oldX=wi.GetX();const oldY=wi.GetY();wi.OffsetXY(this._downX,this._downY);wi.SetBboxChanged();if(lfo&&collisionEngine.TestOverlap(inst,lfo)&&(!lfo.GetObjectClass().HasSolidBehavior()||collisionEngine.IsSolidCollisionAllowed(lfo,inst))){wi.SetXY(oldX,oldY);wi.SetBboxChanged(); +return lfo}else{let ret=collisionEngine.TestOverlapSolid(inst);let ret2=null;if(!ret&&this._fallThrough===0)ret2=collisionEngine.TestOverlapJumpthru(inst,true);wi.SetXY(oldX,oldY);wi.SetBboxChanged();if(ret)if(collisionEngine.TestOverlap(inst,ret))return null;else{this._floorIsJumpthru=false;return ret}if(ret2&&ret2.length){let j=0;for(let i=0,len=ret2.length;i=1){this._floorIsJumpthru=true;return ret2[0]}}return null}}PostTick(){if(!this._isEnabled)return; +const dt=this._runtime.GetDt(this._inst);if(!this._jumpKey&&!this._simJump)this._jumped=false;let left=this._leftKey||this._simLeft;let right=this._rightKey||this._simRight;let jumpkey=this._jumpKey||this._simJump;let jump=jumpkey&&!this._jumped;this._simLeft=false;this._simRight=false;this._simJump=false;if(this._ignoreInput){left=false;right=false;jumpkey=false;jump=false}if(!jumpkey)this._sustainTime=0;this._HandleFirstTick();const [mx,my,floorMoved]=this._TrackMovingPlatform();let floor=this._IsOnFloor(); +const didJustLandOnFloor=floor&&!this._wasOnFloor;let isStuck=false;[isStuck,floor]=this._MaybePushOutSolid(floor);if(isStuck)return;this._TrackFloor(floor,floorMoved,mx,jumpkey);jump=this._HandleJump(floor,jump,jumpkey);if(!floor)this._ApplyJumpGravity(jump,jumpkey,dt);this._wasOnFloor=!!floor;const hacc=this._ApplyHorizontalAcceleration(left,right,dt);let landed=false;let downMagnitude=0;if(this._dx!==0)landed=this._HandleHorizontalMovement(dt,hacc,floor,jump);if(this._dy!==0){const [l,dm]=this._HandleVerticalMovement(dt, +floor);landed=landed||l;downMagnitude=dm}if(!landed&&didJustLandOnFloor&&this._dy<0&&downMagnitude>0){this._dy=0;landed=true}this._HandleAnimationTriggers(floor,landed,jump);if(this._fallThrough>0)this._fallThrough--;this._wasOverJumpthru=this._runtime.GetCollisionEngine().TestOverlapJumpthru(this._inst)}_HandleFirstTick(){if(!this._isFirstTick)return;const inst=this._inst;const collisionEngine=this._runtime.GetCollisionEngine();if(collisionEngine.TestOverlapSolid(inst)||collisionEngine.TestOverlapJumpthru(inst))collisionEngine.PushOutSolid(inst, +-this._downX,-this._downY,4,true);this._isFirstTick=false}_TrackMovingPlatform(){const lastFloor=this._lastFloorObject;const lastFloorWi=lastFloor?lastFloor.GetWorldInfo():null;let mx=0;let my=0;let floorMoved=false;if(lastFloor&&this._dy===0&&(lastFloorWi.GetY()!==this._lastFloorY||lastFloorWi.GetX()!==this._lastFloorX)){const inst=this._inst;const wi=inst.GetWorldInfo();const collisionEngine=this._runtime.GetCollisionEngine();const lfx=lastFloorWi.GetX();const lfy=lastFloorWi.GetY();mx=lfx-this._lastFloorX; +my=lfy-this._lastFloorY;wi.OffsetXY(mx,my);wi.SetBboxChanged();this._lastFloorX=lfx;this._lastFloorY=lfy;floorMoved=true;if(collisionEngine.TestOverlapSolid(inst))collisionEngine.PushOutSolid(inst,-mx,-my,Math.hypot(mx,my)*2.5)}return[mx,my,floorMoved]}_MaybePushOutSolid(floor){let isStuck=false;const inst=this._inst;const wi=inst.GetWorldInfo();const collisionEngine=this._runtime.GetCollisionEngine();const collInst=collisionEngine.TestOverlapSolid(inst);if(!collInst)return[false,floor];const instWidth= +Math.abs(wi.GetWidth());const instHeight=Math.abs(wi.GetHeight());if(inst.GetSavedDataMap().get("inputPredicted"))collisionEngine.PushOutSolid(inst,-this._downX,-this._downY,10,false);else if(collisionEngine.PushOutSolidAxis(inst,-this._downX,-this._downY,instHeight/8)){collisionEngine.RegisterCollision(inst,collInst);floor=collInst;this._lastFloorObject=collInst;const collWi=collInst.GetWorldInfo();this._lastFloorX=collWi.GetX();this._lastFloorY=collWi.GetY();this._floorIsJumpthru=false}else if(collisionEngine.PushOutSolidAxis(inst, +this._rightX,this._rightY,instWidth/2)||collisionEngine.PushOutSolidAxis(inst,this._downX,this._downY,instHeight/2)||collisionEngine.PushOutSolidNearest(inst,Math.max(instWidth,instHeight)/2))collisionEngine.RegisterCollision(inst,collInst);else isStuck=true;return[isStuck,floor]}_TrackFloor(floor,floorMoved,mx,jumpkey){const inst=this._inst;const collisionEngine=this._runtime.GetCollisionEngine();if(floor){const downX=this._downX;const downY=this._downY;const rightX=this._rightX;const rightY=this._rightY; +this._doubleJumped=false;this._canDoubleJump=false;if(this._dy>0){if(!this._wasOnFloor){collisionEngine.PushInFractional(inst,-downX,-downY,floor,16);this._wasOnFloor=true}this._dy=0}if(this._lastFloorObject!==floor){this._lastFloorObject=floor;const floorWi=floor.GetWorldInfo();this._lastFloorX=floorWi.GetX();this._lastFloorY=floorWi.GetY();collisionEngine.RegisterCollision(inst,floor)}else if(floorMoved){const collInst=collisionEngine.TestOverlapSolid(inst);if(collInst){collisionEngine.RegisterCollision(inst, +collInst);if(mx!==0)if(mx>0)collisionEngine.PushOutSolid(inst,-rightX,-rightY);else collisionEngine.PushOutSolid(inst,rightX,rightY);collisionEngine.PushOutSolid(inst,-downX,-downY)}}}else if(!jumpkey)this._canDoubleJump=true}_HandleJump(floor,jump,jumpkey){if(floor&&jump||!floor&&this._enableDoubleJump&&jumpkey&&this._canDoubleJump&&!this._doubleJumped){const inst=this._inst;const wi=inst.GetWorldInfo();const collisionEngine=this._runtime.GetCollisionEngine();const oldX=wi.GetX();const oldY=wi.GetY(); +wi.OffsetXY(-this._downX,-this._downY);wi.SetBboxChanged();if(!collisionEngine.TestOverlapSolid(inst)){this._sustainTime=this._jumpSustain;this.Trigger(C3.Behaviors.Platform.Cnds.OnJump);this._animMode="jumping";this._dy=-this._jumpStrength;jump=true;if(floor)this._jumped=true;else this._doubleJumped=true}else jump=false;wi.SetXY(oldX,oldY);wi.SetBboxChanged()}return jump}_ApplyJumpGravity(jump,jumpkey,dt){if(jumpkey&&this._sustainTime>0){this._dy=-this._jumpStrength;this._sustainTime-=dt}else{this._lastFloorObject= +null;this._dy+=this._g*dt;if(this._dy>this._maxFall)this._dy=this._maxFall}if(jump)this._jumped=true}_ApplyHorizontalAcceleration(left,right,dt){const acc=this._acc;const dec=this._dec;if(left===right)if(this._dx<0){this._dx+=dec*dt;if(this._dx>0)this._dx=0}else if(this._dx>0){this._dx-=dec*dt;if(this._dx<0)this._dx=0}let hacc=0;if(left&&!right)if(this._dx>0)hacc=-(acc+dec);else hacc=-acc;if(right&&!left)if(this._dx<0)hacc=acc+dec;else hacc=acc;this._dx+=hacc*dt;this._dx=C3.clamp(this._dx,-this._maxSpeed, +this._maxSpeed);return hacc}_HandleHorizontalMovement(dt,hacc,floor,jump){const inst=this._inst;const wi=inst.GetWorldInfo();const collisionEngine=this._runtime.GetCollisionEngine();const downX=this._downX;const downY=this._downY;const rightX=this._rightX;const rightY=this._rightY;const maxSpeed=this._maxSpeed;let landed=false;let oldX=wi.GetX();let oldY=wi.GetY();const mx=accelerate(this._dx,-maxSpeed,maxSpeed,hacc,dt)*rightX;const my=accelerate(this._dx,-maxSpeed,maxSpeed,hacc,dt)*rightY;wi.OffsetXY(rightX* +(this._dx>1?1:-1)-downX,rightY*(this._dx>1?1:-1)-downY);wi.SetBboxChanged();let isJumpthru=false;const slopeTooSteep=collisionEngine.TestOverlapSolid(inst);wi.SetXY(oldX+mx,oldY+my);wi.SetBboxChanged();let obstacle=collisionEngine.TestOverlapSolid(inst);if(!obstacle&&floor){obstacle=collisionEngine.TestOverlapJumpthru(inst);if(obstacle){wi.SetXY(oldX,oldY);wi.SetBboxChanged();if(collisionEngine.TestOverlap(inst,obstacle)){obstacle=null;isJumpthru=false}else isJumpthru=true;wi.SetXY(oldX+mx,oldY+my); +wi.SetBboxChanged()}}if(obstacle){let pushDist=Math.abs(this._dx*dt)+2;if(slopeTooSteep||!collisionEngine.PushOutSolid(inst,-downX,-downY,pushDist,isJumpthru,obstacle)){collisionEngine.RegisterCollision(inst,obstacle);pushDist=Math.max(Math.abs(this._dx*dt*2.5),30);if(!collisionEngine.PushOutSolid(inst,rightX*(this._dx<0?1:-1),rightY*(this._dx<0?1:-1),pushDist,false)){wi.SetXY(oldX,oldY);wi.SetBboxChanged()}else if(floor&&!isJumpthru&&!this._floorIsJumpthru){oldX=wi.GetX();oldY=wi.GetY();wi.OffsetXY(downX, +downY);if(collisionEngine.TestOverlapSolid(inst)){if(!collisionEngine.PushOutSolid(inst,-downX,-downY,3,false)){wi.SetXY(oldX,oldY);wi.SetBboxChanged()}}else{wi.SetXY(oldX,oldY);wi.SetBboxChanged()}}if(!isJumpthru)this._dx=0}else if(!slopeTooSteep&&!jump&&Math.abs(this._dy)0&&!floor){const allOver=this._fallThrough>0?null:collisionEngine.TestOverlapJumpthru(inst,true);if(allOver&&allOver.length){if(this._wasOverJumpthru){wi.SetXY(oldX,oldY);wi.SetBboxChanged();let j=0;for(let i=0,len=allOver.length;i=1)collInst=allOver[0]}fellOnJumpthru=!!collInst}if(collInst){collisionEngine.RegisterCollision(inst, +collInst);this._sustainTime=0;let multiplier=1.1;if(fellOnJumpthru&&!this._wasOverJumpthru)multiplier=2;const pushDist=Math.max(Math.abs(this._dy*dt*multiplier),2);if(!collisionEngine.PushOutSolid(inst,downX*(this._dy<0?1:-1),downY*(this._dy<0?1:-1),pushDist,fellOnJumpthru,collInst)){wi.SetXY(oldX,oldY);wi.SetBboxChanged();this._wasOnFloor=true;if(!fellOnJumpthru)this._dy=0}else{this._lastFloorObject=collInst;const collWi=collInst.GetWorldInfo();this._lastFloorX=collWi.GetX();this._lastFloorY=collWi.GetY(); +this._floorIsJumpthru=fellOnJumpthru;if(fellOnJumpthru)landed=true;if(this._dy>0||this._ceilingCollisionMode===0)this._dy=0;if(this._dy<0&&this._ceilingCollisionMode===1)collisionEngine.PushInFractional(inst,downX,downY,collInst,32)}}return[landed,downMagnitude]}_HandleAnimationTriggers(floor,landed,jump){if(this._animMode!=="falling"&&this._dy>0&&!floor){this.Trigger(C3.Behaviors.Platform.Cnds.OnFall);this._animMode="falling"}if((floor||landed)&&this._dy>=0)if(this._animMode==="falling"||landed|| +jump&&this._dy===0){this.Trigger(C3.Behaviors.Platform.Cnds.OnLand);if(this._dx===0&&this._dy===0)this._animMode="stopped";else this._animMode="moving"}else{if(this._animMode!=="stopped"&&this._dx===0&&this._dy===0){this.Trigger(C3.Behaviors.Platform.Cnds.OnStop);this._animMode="stopped"}if(this._animMode!=="moving"&&(this._dx!==0||this._dy!==0)&&!jump){this.Trigger(C3.Behaviors.Platform.Cnds.OnMove);this._animMode="moving"}}}_CheckIfStandingOnFloor(){if(this._dy!==0)return false;const inst=this._inst; +const wi=this.GetWorldInfo();const collisionEngine=this._runtime.GetCollisionEngine();const oldX=wi.GetX();const oldY=wi.GetY();wi.OffsetXY(this._downX,this._downY);wi.SetBboxChanged();const ret=collisionEngine.TestOverlapSolid(inst);let ret2=null;if(!ret&&this._fallThrough===0)ret2=collisionEngine.TestOverlapJumpthru(inst,true);wi.SetXY(oldX,oldY);wi.SetBboxChanged();if(ret)return!collisionEngine.TestOverlap(inst,ret);if(ret2&&ret2.length){let j=0;for(let i=0,len=ret2.length;i=1)return true}return false}_IsByWall(side){const inst=this._inst;const wi=this.GetWorldInfo();const collisionEngine=this._runtime.GetCollisionEngine();const oldX=wi.GetX();const oldY=wi.GetY();if(side===0)wi.OffsetXY(-this._rightX*2,-this._rightY*2);else wi.OffsetXY(this._rightX*2,this._rightY*2);wi.SetBboxChanged();if(!collisionEngine.TestOverlapSolid(inst)){wi.SetXY(oldX,oldY);wi.SetBboxChanged();return false}wi.OffsetXY(-this._downX*3,-this._downY* +3);wi.SetBboxChanged();const ret=!!collisionEngine.TestOverlapSolid(inst);wi.SetXY(oldX,oldY);wi.SetBboxChanged();return ret}_FallThroughJumpThru(){const wi=this.GetWorldInfo();const oldX=wi.GetX();const oldY=wi.GetY();wi.OffsetXY(this._downX,this._downY);wi.SetBboxChanged();const overlaps=this._runtime.GetCollisionEngine().TestOverlapJumpthru(this._inst,false);wi.SetXY(oldX,oldY);wi.SetBboxChanged();if(!overlaps)return;this._fallThrough=3;this._lastFloorObject=null}_ResetDoubleJump(d){this._doubleJumped= +!d}_GetSpeed(){return Math.hypot(this._dx,this._dy)}_GetMovingAngle(){return Math.atan2(this._dy,this._dx)}_IsJumping(){return this._dy<0}_IsFalling(){return this._dy>0}_SetMaxSpeed(ms){this._maxSpeed=Math.max(ms,0)}_GetMaxSpeed(){return this._maxSpeed}_SetAcceleration(acc){this._acc=Math.max(acc,0)}_GetAcceleration(){return this._acc}_SetDeceleration(dec){this._dec=Math.max(dec,0)}_GetDeceleration(){return this._dec}_SetJumpStrength(js){this._jumpStrength=Math.max(js,0)}_GetJumpStrength(){return this._jumpStrength}_SetMaxFallSpeed(mfs){this._maxFall= +Math.max(mfs,0)}_GetMaxFallSpeed(){return this._maxFall}_SetGravity(grav){if(this._g1===grav)return;this._g=grav;this._UpdateGravity();const collisionEngine=this._runtime.GetCollisionEngine();const wi=this.GetWorldInfo();if(collisionEngine.TestOverlapSolid(this._inst)){collisionEngine.PushOutSolid(this._inst,this._downX,this._downY,10);wi.OffsetXY(this._downX*2,this._downY*2);wi.SetBboxChanged()}this._lastFloorObject=null}_GetGravity(){return this._g}_SetGravityAngle(a){a=C3.clampAngle(a);if(this._ga=== +a)return;this._ga=a;this._UpdateGravity();this._lastFloorObject=null}_GetGravityAngle(){return this._ga}_SetDoubleJumpEnabled(e){this._enableDoubleJump=!!e}_IsDoubleJumpEnabled(){return this._enableDoubleJump}_SetJumpSustain(s){this._jumpSustain=s}_GetJumpSustain(){return this._jumpSustain}_SetCeilingCollisionMode(m){this._ceilingCollisionMode=m}_GetCeilingCollisionMode(){return this._ceilingCollisionMode}_SetVectorX(x){this._dx=x}_GetVectorX(){return this._dx}_SetVectorY(y){this._dy=y}_GetVectorY(){return this._dy}_SimulateControl(ctrl){if(!this._isEnabled)return; +switch(ctrl){case 0:this._simLeft=true;break;case 1:this._simRight=true;break;case 2:this._simJump=true;break}}_SetDefaultControls(d){d=!!d;if(this._defaultControls===d)return;this._defaultControls=d;if(this._defaultControls)this._BindEvents();else{this._UnBindEvents();this._OnWindowBlur()}}_IsDefaultControls(){return this._defaultControls}_SetIgnoreInput(i){this._ignoreInput=!!i}_IsIgnoreInput(){return this._ignoreInput}_SetEnabled(e){e=!!e;if(this._isEnabled===e)return;this._isEnabled=e;if(this._isEnabled)this._StartPostTicking(); +else{this._StopPostTicking();this._lastFloorObject=null;this._simLeft=false;this._simRight=false;this._simJump=false}}_IsEnabled(){return this._isEnabled}GetPropertyValueByIndex(index){switch(index){case MAX_SPEED:return this._GetMaxSpeed();case ACCELERATION:return this._GetAcceleration();case DECELERATION:return this._GetDeceleration();case JUMP_STRENGTH:return this._GetJumpStrength();case GRAVITY:return this._GetGravity();case MAX_FALL_SPEED:return this._GetMaxFallSpeed();case DOUBLE_JUMP:return this._IsDoubleJumpEnabled(); +case JUMP_SUSTAIN:return this._GetJumpSustain()*1E3;case DEFAULT_CONTROLS:return this._IsDefaultControls();case ENABLE:return this._IsEnabled()}}SetPropertyValueByIndex(index,value){switch(index){case MAX_SPEED:this._SetMaxSpeed(value);break;case ACCELERATION:this._SetAcceleration(value);break;case DECELERATION:this._SetDeceleration(value);break;case JUMP_STRENGTH:this._SetJumpStrength(value);break;case GRAVITY:this._SetGravity(value);break;case MAX_FALL_SPEED:this._SetMaxFallSpeed(value);break;case DOUBLE_JUMP:this._SetDoubleJumpEnabled(!!value); +break;case JUMP_SUSTAIN:this._SetJumpSustain(value/1E3);break;case DEFAULT_CONTROLS:this._SetDefaultControls(!!value);break;case ENABLE:this._SetEnabled(!!value);break}}GetDebuggerProperties(){const prefix="behaviors.platform";return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:prefix+".debugger.vector-x",value:this._GetVectorX(),onedit:v=>this._SetVectorX(v)},{name:prefix+".debugger.vector-y",value:this._GetVectorY(),onedit:v=>this._SetVectorY(v)},{name:prefix+".properties.max-speed.name", +value:this._GetMaxSpeed(),onedit:v=>this._SetMaxSpeed(v)},{name:prefix+".properties.acceleration.name",value:this._GetAcceleration(),onedit:v=>this._SetAcceleration(v)},{name:prefix+".properties.deceleration.name",value:this._GetDeceleration(),onedit:v=>this._SetDeceleration(v)},{name:prefix+".properties.jump-strength.name",value:this._GetJumpStrength(),onedit:v=>this._SetJumpStrength(v)},{name:prefix+".properties.gravity.name",value:this._GetGravity(),onedit:v=>this._SetGravity(v)},{name:prefix+ +".debugger.gravity-angle",value:C3.toDegrees(this._GetGravityAngle()),onedit:v=>this._SetGravityAngle(C3.toRadians(v))},{name:prefix+".properties.max-fall-speed.name",value:this._GetMaxFallSpeed(),onedit:v=>this._SetMaxFallSpeed(v)},{name:prefix+".debugger.animation-mode",value:[prefix+".debugger.anim-"+this._animMode]},{name:prefix+".properties.enabled.name",value:this._IsEnabled(),onedit:v=>this._SetEnabled(v)}]}]}GetScriptInterfaceClass(){return self.IPlatformBehaviorInstance}};const map=new WeakMap; +const SIMULATE_CONTROL_MAP=new Map([["left",0],["right",1],["jump",2]]);self.IPlatformBehaviorInstance=class IPlatformBehaviorInstance extends IBehaviorInstance{constructor(){super();map.set(this,IBehaviorInstance._GetInitInst().GetSdkInstance())}fallThrough(){map.get(this)._FallThroughJumpThru()}resetDoubleJump(d){map.get(this)._ResetDoubleJump(!!d)}simulateControl(ctrl){const index=SIMULATE_CONTROL_MAP.get(ctrl);if(typeof index!=="number")throw new Error("invalid control");map.get(this)._SimulateControl(index)}get speed(){return map.get(this)._GetSpeed()}get maxSpeed(){return map.get(this)._GetMaxSpeed()}set maxSpeed(s){map.get(this)._SetMaxSpeed(s)}get acceleration(){return map.get(this)._GetAcceleration()}set acceleration(a){map.get(this)._SetAcceleration(a)}get deceleration(){return map.get(this)._GetDeceleration()}set deceleration(d){map.get(this)._SetDeceleration(d)}get jumpStrength(){return map.get(this)._GetJumpStrength()}set jumpStrength(js){map.get(this)._SetJumpStrength(js)}get maxFallSpeed(){return map.get(this)._GetMaxFallSpeed()}set maxFallSpeed(mfs){map.get(this)._SetMaxFallSpeed(mfs)}get gravity(){return map.get(this)._GetGravity()}set gravity(g){map.get(this)._SetGravity(g)}get gravityAngle(){return map.get(this)._GetGravityAngle()}set gravityAngle(ga){map.get(this)._SetGravityAngle(ga)}get isDoubleJumpEnabled(){return map.get(this)._IsDoubleJumpEnabled()}set isDoubleJumpEnabled(e){map.get(this)._SetDoubleJumpEnabled(!!e)}get jumpSustain(){return map.get(this)._GetJumpSustain()}set jumpSustain(js){map.get(this)._SetJumpSustain(js)}get ceilingCollisionMode(){const ccm= +map.get(this)._GetCeilingCollisionMode();return ccm===0?"stop":"preserve-momentum"}set ceilingCollisionMode(ccm){const bi=map.get(this);if(ccm==="stop")bi._SetCeilingCollisionMode(0);else if(ccm==="preserve-momentum")bi._SetCeilingCollisionMode(1);else throw new Error("invalid mode");}get isOnFloor(){return map.get(this)._CheckIfStandingOnFloor()}isByWall(side){const bi=map.get(this);if(side==="left")return bi._IsByWall(0);else if(side==="right")return bi._IsByWall(1);else throw new Error("invalid side"); +}get isJumping(){return map.get(this)._IsJumping()}get isFalling(){return map.get(this)._IsFalling()}get vectorX(){return map.get(this)._GetVectorX()}set vectorX(x){map.get(this)._SetVectorX(x)}get vectorY(){return map.get(this)._GetVectorY()}set vectorY(y){map.get(this)._SetVectorY(y)}get isDefaultControls(){return map.get(this)._IsDefaultControls()}set isDefaultControls(d){map.get(this)._SetDefaultControls(!!d)}get isIgnoringInput(){return map.get(this)._IsIgnoreInput()}set isIgnoringInput(e){map.get(this)._SetIgnoreInput(!!e)}get isEnabled(){return map.get(this)._IsEnabled()}set isEnabled(e){map.get(this)._SetEnabled(!!e)}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Platform.Cnds={IsMoving(){return this._GetVectorX()!==0||this._GetVectorY()!==0},CompareSpeed(cmp,s){return C3.compare(this._GetSpeed(),cmp,s)},IsOnFloor(){return this._CheckIfStandingOnFloor()},IsByWall(side){return this._IsByWall(side)},IsJumping(){return this._IsJumping()},IsFalling(){return this._IsFalling()},IsDoubleJumpEnabled(){return this._IsDoubleJumpEnabled()},OnJump(){return true},OnFall(){return true},OnStop(){return true},OnMove(){return true}, +OnLand(){return true},IsEnabled(){return this._IsEnabled()}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Platform.Acts={SetMaxSpeed(ms){this._SetMaxSpeed(ms)},SetAcceleration(acc){this._SetAcceleration(acc)},SetDeceleration(dec){this._SetDeceleration(dec)},SetJumpStrength(js){this._SetJumpStrength(js)},SetMaxFallSpeed(mfs){this._SetMaxFallSpeed(mfs)},SetGravity(grav){this._SetGravity(grav)},SimulateControl(ctrl){this._SimulateControl(ctrl)},SetIgnoreInput(i){this._SetIgnoreInput(!!i)},SetVectorX(x){this._SetVectorX(x)},SetVectorY(y){this._SetVectorY(y)},SetGravityAngle(a){this._SetGravityAngle(C3.toRadians(a))}, +SetEnabled(en){this._SetEnabled(en!==0)},FallThrough(){this._FallThroughJumpThru()},SetDoubleJumpEnabled(e){this._SetDoubleJumpEnabled(e!==0)},SetJumpSustain(s){this._SetJumpSustain(s/1E3)},SetCeilingCollision(m){this._SetCeilingCollisionMode(m)},SetDefaultControls(d){this._SetDefaultControls(d)},ResetDoubleJump(d){this._ResetDoubleJump(d)}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Platform.Exps={Speed(){return this._GetSpeed()},MaxSpeed(){return this._GetMaxSpeed()},Acceleration(){return this._GetAcceleration()},Deceleration(){return this._GetDeceleration()},JumpStrength(){return this._GetJumpStrength()},Gravity(){return this._GetGravity()},GravityAngle(){return C3.toDegrees(this._GetGravityAngle())},MaxFallSpeed(){return this._GetMaxFallSpeed()},MovingAngle(){return C3.toDegrees(this._GetMovingAngle())},VectorX(){return this._GetVectorX()}, +VectorY(){return this._GetVectorY()},JumpSustain(){return this._GetJumpSustain()*1E3}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.scrollto=class ScrollToBehavior extends C3.SDKBehaviorBase{constructor(opts){super(opts);this._shakeMag=0;this._shakeStart=0;this._shakeEnd=0;this._shakeMode=0}Release(){super.Release()}SetShakeMagnitude(m){this._shakeMag=m}GetShakeMagnitude(){return this._shakeMag}SetShakeStart(s){this._shakeStart=s}GetShakeStart(){return this._shakeStart}SetShakeEnd(s){this._shakeEnd=s}GetShakeEnd(){return this._shakeEnd}SetShakeMode(m){this._shakeMode=m}GetShakeMode(){return this._shakeMode}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.scrollto.Type=class ScrollToType extends C3.SDKBehaviorTypeBase{constructor(objectClass){super(objectClass)}Release(){super.Release()}OnCreate(){}}}; + + +'use strict';{const C3=self.C3;const ENABLE=0;C3.Behaviors.scrollto.Instance=class ScrollToInstance extends C3.SDKBehaviorInstanceBase{constructor(inst,properties){super(inst);this._isEnabled=true;if(properties)this._isEnabled=properties[ENABLE];if(this._isEnabled)this._StartTicking2()}Release(){super.Release()}SaveToJson(){const behavior=this.GetBehavior();return{"e":this._isEnabled,"smg":behavior.GetShakeMagnitude(),"ss":behavior.GetShakeStart(),"se":behavior.GetShakeEnd(),"smd":behavior.GetShakeMode()}}LoadFromJson(o){const behavior= +this.GetBehavior();behavior.SetShakeMagnitude(o["smg"]);behavior.SetShakeStart(o["ss"]);behavior.SetShakeEnd(o["se"]);behavior.SetShakeMode(o["smd"]);this._isEnabled=o["e"];if(this._isEnabled)this._StartTicking2();else this._StopTicking2()}IsEnabled(){return this._isEnabled}Tick2(){if(!this.IsEnabled())return;const dt=this._runtime.GetDt(this._inst);const behavior=this.GetBehavior();const allInstances=behavior.GetInstances();let sumX=0;let sumY=0;let count=0;for(const inst of allInstances){const behInst= +inst.GetBehaviorInstanceFromCtor(C3.Behaviors.scrollto);if(!behInst||!behInst.GetSdkInstance().IsEnabled())continue;const wi=inst.GetWorldInfo();sumX+=wi.GetX();sumY+=wi.GetY();++count}const layout=this._inst.GetWorldInfo().GetLayout();const now=this._runtime.GetGameTime();let offX=0;let offY=0;if(now>=behavior.GetShakeStart()&&nowlayout.GetWidth()){wi.SetX(layout.GetWidth());isChanged=true}if(wi.GetY()>layout.GetHeight()){wi.SetY(layout.GetHeight());isChanged=true}}else{if(bbox.getLeft()<0){wi.OffsetX(-bbox.getLeft());isChanged=true}if(bbox.getTop()<0){wi.OffsetY(-bbox.getTop());isChanged=true}if(bbox.getRight()>layout.GetWidth()){wi.OffsetX(-(bbox.getRight()-layout.GetWidth()));isChanged=true}if(bbox.getBottom()>layout.GetHeight()){wi.OffsetY(-(bbox.getBottom()- +layout.GetHeight()));isChanged=true}}if(isChanged)wi.SetBboxChanged()}GetPropertyValueByIndex(index){switch(index){case MODE:return this._mode}}SetPropertyValueByIndex(index,value){switch(index){case MODE:this._mode=value;break}}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.bound.Cnds={}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.bound.Acts={}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.bound.Exps={}}; + + +'use strict';{const C3=self.C3;let tempVec2a=null;let tempVec2b=null;let vec2RecycleCache=[];let Box2D=null;let physicsBehavior=null;const PHYSICS_COLLISIONS_KEY="Physics_DisabledCollisions";function SetObjectTypeCollisionsEnabled(typeA,typeB,state){const savedA=typeA.GetSavedDataMap();const savedB=typeB.GetSavedDataMap();if(state){const setA=savedA.get(PHYSICS_COLLISIONS_KEY);if(setA)setA.delete(typeB.GetSID());const setB=savedB.get(PHYSICS_COLLISIONS_KEY);if(setB)setB.delete(typeA.GetSID())}else{let setA= +savedA.get(PHYSICS_COLLISIONS_KEY);if(!setA){setA=new Set;savedA.set(PHYSICS_COLLISIONS_KEY,setA)}let setB=savedB.get(PHYSICS_COLLISIONS_KEY);if(!setB){setB=new Set;savedB.set(PHYSICS_COLLISIONS_KEY,setB)}setA.add(typeB.GetSID());setB.add(typeA.GetSID())}}C3.Behaviors.Physics=class PhysicsBehavior extends C3.SDKBehaviorBase{constructor(opts){opts.scriptInterfaceClass=self.IPhysicsBehavior;super(opts);this._world=null;this._worldG=10;this._worldScale=.02;this._worldManifold=null;this._lastUpdateTick= +-1;this._steppingMode=1;this._velocityIterations=8;this._positionIterations=3;this._allCollisionsEnabled=true;this._runtime.AddLoadPromise(this._LoadBox2DWasm())}async _LoadBox2DWasm(){const box2dWasmUrl=await this._runtime.GetAssetManager().GetProjectFileUrl("box2d.wasm");await new Promise(resolve=>{self["Box2DWasmModule"]({"wasmBinaryFile":box2dWasmUrl}).then(box2d=>{Box2D=box2d;this._InitBox2DWorld();resolve()})})}_InitBox2DWorld(){const collisionEngine=this._runtime.GetCollisionEngine();tempVec2a= +C3.Behaviors.Physics.GetVec2(0,0);tempVec2b=C3.Behaviors.Physics.GetVec2(0,0);this._world=new Box2D["b2World"](C3.Behaviors.Physics.GetTempVec2A(0,this._worldG),true);const listener=new Box2D["JSContactListener"];listener["BeginContact"]=contactPtr=>{const contact=Box2D["wrapPointer"](contactPtr,Box2D["b2Contact"]);const behA=C3.Behaviors.Physics.Instance.LookupBehInstFromBody(contact["GetFixtureA"]()["GetBody"]());const behB=C3.Behaviors.Physics.Instance.LookupBehInstFromBody(contact["GetFixtureB"]()["GetBody"]()); +collisionEngine.RegisterCollision(behA.GetObjectInstance(),behB.GetObjectInstance())};listener["EndContact"]=()=>{};listener["PreSolve"]=()=>{};listener["PostSolve"]=()=>{};this._world["SetContactListener"](listener);const filter=new Box2D["JSContactFilter"];filter["ShouldCollide"]=(fixAPtr,fixBPtr)=>{if(this._allCollisionsEnabled)return true;const fixtureA=Box2D["wrapPointer"](fixAPtr,Box2D["b2Fixture"]);const fixtureB=Box2D["wrapPointer"](fixBPtr,Box2D["b2Fixture"]);const behA=C3.Behaviors.Physics.Instance.LookupBehInstFromBody(fixtureA["GetBody"]()); +const behB=C3.Behaviors.Physics.Instance.LookupBehInstFromBody(fixtureB["GetBody"]());const typeA=behA.GetObjectInstance().GetObjectClass();const typeB=behB.GetObjectInstance().GetObjectClass();const sidA=typeA.GetSID();const sidB=typeB.GetSID();const setA=typeA.GetSavedDataMap().get(PHYSICS_COLLISIONS_KEY);if(setA&&setA.has(sidB))return false;const setB=typeB.GetSavedDataMap().get(PHYSICS_COLLISIONS_KEY);if(setB&&setB.has(sidA))return false;return true};this._world["SetContactFilter"](filter);this._worldManifold= +new Box2D["b2WorldManifold"]}Release(){super.Release()}GetBox2D(){return Box2D}GetWorld(){return this._world}GetWorldScale(){return this._worldScale}GetSteppingMode(){return this._steppingMode}SetSteppingMode(m){this._steppingMode=m}SetLastUpdateTick(t){this._lastUpdateTick=t}GetLastUpdateTick(){return this._lastUpdateTick}SetVelocityIterations(v){this._velocityIterations=Math.max(v,1)}GetVelocityIterations(){return this._velocityIterations}SetPositionIterations(p){this._positionIterations=Math.max(p, +1)}GetPositionIterations(){return this._positionIterations}SetIterations(v,p){this.SetVelocityIterations(v);this.SetPositionIterations(p)}GetGravity(){return this._worldG}SetGravity(g){if(g===this._worldG)return;this._world["SetGravity"](C3.Behaviors.Physics.GetTempVec2A(0,g));this._worldG=g;this._WakeUpAllPhysicsBodies()}_WakeUpAllPhysicsBodies(){for(const inst of this.GetInstances()){const behInst=C3.Behaviors.Physics.Instance.LookupBehInstFromInst(inst);if(!behInst)continue;const body=behInst.GetBody(); +if(!body)continue;body["SetAwake"](true)}}DisableShouldCollideFastPath(){this._allCollisionsEnabled=false}SetCollisionsEnabled(typeA,typeB,state){state=!!state;if(!typeA||!typeB)return;if(typeB.IsFamily())for(const member of typeB.GetFamilyMembers())SetObjectTypeCollisionsEnabled(typeA,member,state);else SetObjectTypeCollisionsEnabled(typeA,typeB,state);this.DisableShouldCollideFastPath()}GetWorldManifold(){return this._worldManifold}static GetPhysicsCollisionKey(){return PHYSICS_COLLISIONS_KEY}static GetVec2(x, +y){if(vec2RecycleCache.length){const ret=vec2RecycleCache.pop();ret["set_x"](x);ret["set_y"](y);return ret}else{const b2Vec2=Box2D["b2Vec2"];return new b2Vec2(x,y)}}static FreeVec2(v){vec2RecycleCache.push(v)}static GetTempVec2A(x,y){tempVec2a["set_x"](x);tempVec2a["set_y"](y);return tempVec2a}static GetTempVec2B(x,y){tempVec2b["set_x"](x);tempVec2b["set_y"](y);return tempVec2b}static CreatePolygonShape(vertices){const b2PolygonShape=Box2D["b2PolygonShape"];const shape=new b2PolygonShape;const buffer= +Box2D["_malloc"](vertices.length*8);let offset=0;for(let i=0;i>2]=vertices[i]["get_x"]();Box2D["HEAPF32"][buffer+(offset+4)>>2]=vertices[i]["get_y"]();offset+=8}const ptr_wrapped=Box2D["wrapPointer"](buffer,Box2D["b2Vec2"]);shape["Set"](ptr_wrapped,vertices.length);Box2D["_free"](buffer);return shape}};const STEPPING_MODES=["fixed","variable"];function UnwrapIObjectClass(iObjectClass){if(!(iObjectClass instanceof self.IObjectClass))throw new TypeError("expected IObjectClass"); +const objectClass=physicsBehavior.GetRuntime()._UnwrapScriptInterface(iObjectClass);if(!objectClass||!(objectClass instanceof C3.ObjectClass))throw new Error("invalid IObjectClass");return objectClass}self.IPhysicsBehavior=class IPhysicsBehavior extends self.IBehavior{constructor(behavior){super(behavior);physicsBehavior=behavior}set worldGravity(g){physicsBehavior.SetGravity(g)}get worldGravity(){return physicsBehavior.GetGravity()}set steppingMode(s){const i=STEPPING_MODES.indexOf(s);if(i<0)throw new Error("invalid stepping mode"); +physicsBehavior.SetSteppingMode(STEPPING_MODES[i])}get steppingMode(){return STEPPING_MODES[physicsBehavior.GetSteppingMode()]}set velocityIterations(v){physicsBehavior.SetVelocityIterations(v)}get velocityIterations(){return physicsBehavior.GetVelocityIterations()}set positionIterations(p){physicsBehavior.SetPositionIterations(p)}get positionIterations(){return physicsBehavior.GetPositionIterations()}setCollisionsEnabled(iObjectClassA,iObjectClassB,state){const objectClassA=UnwrapIObjectClass(iObjectClassA); +const objectClassB=UnwrapIObjectClass(iObjectClassB);state=!!state;physicsBehavior.SetCollisionsEnabled(objectClassA,objectClassB,state)}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Physics.Type=class PhysicsType extends C3.SDKBehaviorTypeBase{constructor(behaviorType){super(behaviorType)}Release(){super.Release()}OnCreate(){}}}; + + +'use strict';{const C3=self.C3;const IBehaviorInstance=self.IBehaviorInstance;const assert=self.assert;const IMMOVABLE=0;const COLLISION_MASK=1;const PREVENT_ROTATION=2;const DENSITY=3;const FRICTION=4;const ELASTICITY=5;const LINEAR_DAMPING=6;const ANGULAR_DAMPING=7;const BULLET=8;const ENABLE=9;const body2beh=new WeakMap;const inst2beh=new WeakMap;const tileConvexPolyCache=new WeakMap;const TILE_FLIPPED_HORIZONTAL=-2147483648;const TILE_FLIPPED_VERTICAL=1073741824;const TILE_FLIPPED_DIAGONAL=536870912; +const TILE_FLAGS_MASK=3758096384;const TILE_ID_MASK=536870911;const GetTempVec2A=C3.Behaviors.Physics.GetTempVec2A;const GetTempVec2B=C3.Behaviors.Physics.GetTempVec2B;const tempRect=C3.New(C3.Rect);const tempQuad=C3.New(C3.Quad);C3.Behaviors.Physics.Instance=class PhysicsInstance extends C3.SDKBehaviorInstanceBase{constructor(behInst,properties){super(behInst);const behavior=this.GetBehavior();const wi=this.GetWorldInfo();this._box2d=behavior.GetBox2D();this._world=behavior.GetWorld();this._worldScale= +behavior.GetWorldScale();this._isImmovable=false;this._collisionMask=0;this._preventRotation=false;this._density=1;this._friction=.5;this._restitution=.2;this._linearDamping=0;this._angularDamping=.01;this._isBullet=false;this._isEnabled=true;this._body=null;this._fixtures=[];this._myJoints=[];this._myCreatedJoints=[];this._joiningMe=new Set;this._lastKnownX=wi.GetX();this._lastKnownY=wi.GetY();this._lastKnownAngle=wi.GetAngle();this._lastWidth=0;this._lastHeight=0;this._lastTickOverride=false;if(properties){this._isImmovable= +!!properties[IMMOVABLE];this._collisionMask=properties[COLLISION_MASK];this._preventRotation=!!properties[PREVENT_ROTATION];this._density=properties[DENSITY];this._friction=properties[FRICTION];this._restitution=properties[ELASTICITY];this._linearDamping=properties[LINEAR_DAMPING];this._angularDamping=properties[ANGULAR_DAMPING];this._isBullet=!!properties[BULLET];this._isEnabled=!!properties[ENABLE]}const rt=this._runtime.Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(rt, +"instancedestroy",e=>this._OnInstanceDestroyed(e.instance)),C3.Disposable.From(rt,"beforeload",()=>this._OnBeforeLoad()),C3.Disposable.From(rt,"afterload",()=>this._OnAfterLoad()));inst2beh.set(this._inst,this);if(this._isEnabled)this._StartTicking()}PostCreate(){this._CreateBody()}Release(){this._DestroyMyJoints();C3.clearArray(this._myCreatedJoints);this._joiningMe.clear();if(this._body){this._DestroyFixtures();this._world["DestroyBody"](this._body);this._body=null}super.Release()}_CreateFixture(fixDef){if(!this._body)return; +const fixture=this._body["CreateFixture"](fixDef);this._fixtures.push(fixture);return fixture}_DestroyFixtures(){if(!this._body)return;for(const fixture of this._fixtures)this._body["DestroyFixture"](fixture);C3.clearArray(this._fixtures)}_GetBoundingQuadExcludingMesh(){const wi=this.GetWorldInfo();if(wi.HasMesh()){wi.CalculateBbox(tempRect,tempQuad,false);return tempQuad}else return wi.GetBoundingQuad()}_Destroy(o){this._box2d["destroy"](o)}_CreateBody(){if(!this._isEnabled)return;const b2FixtureDef= +this._box2d["b2FixtureDef"];const b2BodyDef=this._box2d["b2BodyDef"];const wi=this.GetWorldInfo();if(!this._body){const bodyDef=new b2BodyDef;bodyDef["set_type"](this._isImmovable?0:2);const bquad=this._GetBoundingQuadExcludingMesh();bodyDef["set_position"](GetTempVec2B(bquad.midX()*this._worldScale,bquad.midY()*this._worldScale));bodyDef["set_angle"](wi.GetAngle());bodyDef["set_fixedRotation"](this._preventRotation);bodyDef["set_linearDamping"](this._linearDamping);bodyDef["set_angularDamping"](this._angularDamping); +bodyDef["set_bullet"](this._isBullet);this._body=this._world["CreateBody"](bodyDef);this._Destroy(bodyDef);body2beh.set(this._body,this)}this._DestroyFixtures();const fixDef=new b2FixtureDef;fixDef["set_density"](this._density);fixDef["set_friction"](this._friction);fixDef["set_restitution"](this._restitution);const hasPoly=wi.HasOwnCollisionPoly();let useCollisionMask=this._collisionMask;if(!hasPoly&&!this._inst.HasTilemap()&&useCollisionMask===0)useCollisionMask=1;const instW=Math.max(Math.abs(wi.GetWidth()), +1);const instH=Math.max(Math.abs(wi.GetHeight()),1);if(useCollisionMask===0)if(this._inst.HasTilemap())this._CreateTilemapFixtures(fixDef);else this._CreatePolygonFixture(fixDef,instW,instH);else if(useCollisionMask===1)this._CreateBoundingBoxFixture(fixDef,instW,instH);else this._CreateCircleFixture(fixDef,instW,instH);this._lastWidth=wi.GetWidth();this._lastHeight=wi.GetHeight();wi.SetPhysicsBodyChanged(false);this._Destroy(fixDef)}_CreateBoundingBoxFixture(fixDef,instW,instH){const b2PolygonShape= +this._box2d["b2PolygonShape"];const shape=new b2PolygonShape;shape["SetAsBox"](instW*this._worldScale*.5,instH*this._worldScale*.5);fixDef["set_shape"](shape);this._CreateFixture(fixDef);this._Destroy(shape)}_CreateCircleFixture(fixDef,instW,instH){const b2CircleShape=this._box2d["b2CircleShape"];const shape=new b2CircleShape;shape["set_m_radius"](Math.min(instW,instH)*this._worldScale*.5);fixDef["set_shape"](shape);this._CreateFixture(fixDef);this._Destroy(shape)}_CreatePolygonFixture(fixDef,instW, +instH){const wi=this.GetWorldInfo();const isMirrored=wi.GetWidth()<0;const isFlipped=wi.GetHeight()<0;const worldScale=this._worldScale;const angle=wi.GetAngle();if(angle!==0){wi.SetAngle(0);wi.SetBboxChanged()}const bquad=this._GetBoundingQuadExcludingMesh();const offX=bquad.midX()-wi.GetX();const offY=bquad.midY()-wi.GetY();if(angle!==0){wi.SetAngle(angle);wi.SetBboxChanged()}const transformedPoly=wi.GetCustomTransformedCollisionPoly(isMirrored?-instW:instW,isFlipped?-instH:instH,0);const ptsArr= +transformedPoly.pointsArr();const ptsCount=ptsArr.length/2;const arr=[];for(let i=0;i1/30)dt=1/30}const tickCount=runtime.GetTickCountNoSave();if(tickCount>behavior.GetLastUpdateTick()&&runtime.GetTimeScale()>0){const isDebug=this._runtime.IsDebug();let startTime=0;if(isDebug)startTime=performance.now();if(dt!==0)this._world["Step"](dt,behavior.GetVelocityIterations(),behavior.GetPositionIterations());this._world["ClearForces"](); +if(isDebug)self.C3Debugger.AddPhysicsTime(performance.now()-startTime);behavior.SetLastUpdateTick(tickCount)}this._UpdateBodyToMatchInstance(true)}_UpdateBodyToMatchInstance(isTickUpdate){const inst=this._inst;const wi=inst.GetWorldInfo();const worldScale=this._worldScale;if(wi.GetWidth()!==this._lastWidth||wi.GetHeight()!==this._lastHeight||wi.IsPhysicsBodyChanged())this._CreateBody();const body=this._body;const posChanged=wi.GetX()!==this._lastKnownX||wi.GetY()!==this._lastKnownY;const angleChanged= +wi.GetAngle()!==this._lastKnownAngle;if(posChanged){const bquad=this._GetBoundingQuadExcludingMesh();const newMidX=bquad.midX();const newMidY=bquad.midY();const diffX=newMidX-this._lastKnownX;const diffY=newMidY-this._lastKnownY;if(angleChanged)body["SetTransform"](GetTempVec2A(newMidX*worldScale,newMidY*worldScale),wi.GetAngle());else body["SetTransform"](GetTempVec2A(newMidX*worldScale,newMidY*worldScale),body["GetAngle"]());if(isTickUpdate){body["SetLinearVelocity"](GetTempVec2A(diffX,diffY)); +this._lastTickOverride=true}body["SetAwake"](true)}else if(isTickUpdate&&this._lastTickOverride){const bquad=this._GetBoundingQuadExcludingMesh();this._lastTickOverride=false;body["SetLinearVelocity"](GetTempVec2A(0,0));body["SetTransform"](GetTempVec2A(bquad.midX()*worldScale,bquad.midY()*worldScale),body["GetAngle"]())}if(!posChanged&&angleChanged){body["SetTransform"](body["GetPosition"](),wi.GetAngle());body["SetAwake"](true)}const pos=body["GetPosition"]();const newX=pos["get_x"]()/worldScale; +const newY=pos["get_y"]()/worldScale;const newAngle=body["GetAngle"]();if(newX!==wi.GetX()||newY!==wi.GetY()||newAngle!==wi.GetAngle()){wi.SetXY(newX,newY);wi.SetAngle(newAngle);wi.SetBboxChanged();const bquad=this._GetBoundingQuadExcludingMesh();const dx=bquad.midX()-wi.GetX();const dy=bquad.midY()-wi.GetY();if(dx!==0||dy!==0){wi.OffsetXY(-dx,-dy);wi.SetBboxChanged()}}this._lastKnownX=wi.GetX();this._lastKnownY=wi.GetY();this._lastKnownAngle=wi.GetAngle()}GetPropertyValueByIndex(index){switch(index){case PREVENT_ROTATION:return this._IsPreventRotate(); +case DENSITY:return this._GetDensity();case FRICTION:return this._GetFriction();case ELASTICITY:return this._GetElasticity();case LINEAR_DAMPING:return this._GetLinearDamping();case ANGULAR_DAMPING:return this._GetAngularDamping();case BULLET:return this._IsBullet();case ENABLE:return this._IsEnabled()}}SetPropertyValueByIndex(index,value){switch(index){case PREVENT_ROTATION:this._SetPreventRotate(value);break;case DENSITY:this._SetDensity(value);break;case FRICTION:this._SetFriction(value);break; +case ELASTICITY:this._SetElasticity(value);break;case LINEAR_DAMPING:this._SetLinearDamping(value);break;case ANGULAR_DAMPING:this._SetAngularDamping(value);break;case BULLET:this._SetBullet(value);break;case ENABLE:this._SetEnabled(value);break}}_SetEnabled(e){e=!!e;if(this._isEnabled&&!e){this._DestroyBody();this._isEnabled=false;this._StopTicking()}else if(!this._isEnabled&&e){this._isEnabled=true;this._CreateBody();this._StartTicking()}}_IsEnabled(){return this._isEnabled}GetDebuggerProperties(){const prefix= +"behaviors.physics";const props=[{name:prefix+".properties.enabled.name",value:this._IsEnabled(),onedit:v=>this._SetEnabled(v)},{name:prefix+".properties.immovable.name",value:this._IsImmovable(),onedit:v=>this._SetImmovable(v)},{name:prefix+".properties.density.name",value:this._GetDensity(),onedit:v=>this._SetDensity(v)},{name:prefix+".properties.friction.name",value:this._GetFriction(),onedit:v=>this._SetFriction(v)},{name:prefix+".properties.elasticity.name",value:this._GetElasticity(),onedit:v=> +this._SetElasticity(v)},{name:prefix+".properties.linear-damping.name",value:this._GetLinearDamping(),onedit:v=>this._SetLinearDamping(v)},{name:prefix+".properties.angular-damping.name",value:this._GetAngularDamping(),onedit:v=>this._SetAngularDamping(v)}];if(this._isEnabled){props.push({name:prefix+".debugger.is-sleeping",value:this._IsSleeping()});props.push({name:prefix+".debugger.velocity-x",value:this._GetVelocityX(),onedit:v=>this._SetVelocity(v,this._GetVelocityY())});props.push({name:prefix+ +".debugger.velocity-y",value:this._GetVelocityY(),onedit:v=>this._SetVelocity(this._GetVelocityX(),v)});props.push({name:prefix+".debugger.angular-velocity",value:C3.toDegrees(this._GetAngularVelocity()),onedit:v=>this._SetAngularVelocity(C3.toRadians(v))});props.push({name:prefix+".debugger.mass",value:this._GetMass()})}return[{title:"$"+this.GetBehaviorType().GetName(),properties:props}]}_ApplyForce(fx,fy,imgPt){const [x,y]=this._GetInstImagePoint(imgPt);this._DoApplyForce(fx,fy,x,y)}_ApplyForceToward(f, +px,py,imgPt){const [x,y]=this._GetInstImagePoint(imgPt);const a=C3.angleTo(x,y,px,py);this._DoApplyForce(Math.cos(a)*f,Math.sin(a)*f,x,y)}_ApplyForceAtAngle(f,a,imgPt){const [x,y]=this._GetInstImagePoint(imgPt);this._DoApplyForce(Math.cos(a)*f,Math.sin(a)*f,x,y)}_DoApplyForce(fx,fy,ox,oy){if(!this._isEnabled)return;const worldScale=this._worldScale;this._body["ApplyForce"](GetTempVec2A(fx,fy),GetTempVec2B(ox*worldScale,oy*worldScale),true)}_ApplyImpulse(fx,fy,imgPt){const [x,y]=this._GetInstImagePoint(imgPt); +this._DoApplyImpulse(fx,fy,x,y)}_ApplyImpulseToward(f,px,py,imgPt){const [x,y]=this._GetInstImagePoint(imgPt);const a=C3.angleTo(x,y,px,py);this._DoApplyImpulse(Math.cos(a)*f,Math.sin(a)*f,x,y)}_ApplyImpulseAtAngle(f,a,imgPt){const [x,y]=this._GetInstImagePoint(imgPt);this._DoApplyImpulse(Math.cos(a)*f,Math.sin(a)*f,x,y)}_DoApplyImpulse(fx,fy,ox,oy){if(!this._isEnabled)return;const worldScale=this._worldScale;this._body["ApplyLinearImpulse"](GetTempVec2A(fx,fy),GetTempVec2B(ox*worldScale,oy*worldScale), +true);const wi=this.GetWorldInfo();this._lastKnownX=wi.GetX();this._lastKnownY=wi.GetY();this._lastTickOverride=false}_ApplyTorque(m){if(!this._isEnabled)return;this._body["ApplyTorque"](m,true)}_ApplyTorqueToAngle(m,a){const f=C3.angleClockwise(this.GetWorldInfo().GetAngle(),a)?-1:1;this._ApplyTorque(m*f)}_ApplyTorqueToPosition(m,x,y){const wi=this.GetWorldInfo();const a=C3.angleTo(wi.GetX(),wi.GetY(),x,y);const f=C3.angleClockwise(wi.GetAngle(),a)?-1:1;this._ApplyTorque(m*f)}_SetAngularVelocity(v){if(!this._isEnabled)return; +this._body["SetAngularVelocity"](v);this._body["SetAwake"](true)}_GetAngularVelocity(){return this._isEnabled?this._body["GetAngularVelocity"]():0}_SetVelocity(vx,vy){if(!this._isEnabled)return;const worldScale=this._worldScale;this._body["SetLinearVelocity"](GetTempVec2A(vx*worldScale,vy*worldScale));this._body["SetAwake"](true);const wi=this.GetWorldInfo();this._lastKnownX=wi.GetX();this._lastKnownY=wi.GetY();this._lastTickOverride=false}_GetVelocity(){if(!this._isEnabled)return[0,0];const worldScale= +this._worldScale;const vec=this._body["GetLinearVelocity"]();return[vec["get_x"]()/worldScale,vec["get_y"]()/worldScale]}_GetVelocityX(){return this._isEnabled?this._body["GetLinearVelocity"]()["get_x"]()/this._worldScale:0}_GetVelocityY(){return this._isEnabled?this._body["GetLinearVelocity"]()["get_y"]()/this._worldScale:0}_SetDensity(d){if(!this._isEnabled)return;if(this._density===d)return;this._density=d;for(const fixture of this._fixtures)fixture["SetDensity"](d);this._body["ResetMassData"]()}_GetDensity(){return this._isEnabled? +this._density:0}_SetFriction(f){if(!this._isEnabled)return;if(this._friction===f)return;this._friction=f;for(const fixture of this._fixtures)fixture["SetFriction"](f);for(let contactEdge=this._body["GetContactList"]();this._box2d["getPointer"](contactEdge);contactEdge=contactEdge["get_next"]()){const contact=contactEdge["get_contact"]();if(contact)contact["ResetFriction"]()}}_GetFriction(){return this._isEnabled?this._friction:0}_SetElasticity(e){if(!this._isEnabled)return;if(this._restitution=== +e)return;this._restitution=e;for(const fixture of this._fixtures)fixture["SetRestitution"](e)}_GetElasticity(){return this._isEnabled?this._restitution:0}_SetLinearDamping(ld){if(!this._isEnabled)return;if(this._linearDamping===ld)return;this._linearDamping=ld;this._body["SetLinearDamping"](ld)}_GetLinearDamping(){return this._isEnabled?this._linearDamping:0}_SetAngularDamping(ad){if(!this._isEnabled)return;if(this._angularDamping===ad)return;this._angularDamping=ad;this._body["SetAngularDamping"](ad)}_GetAngularDamping(){return this._isEnabled? +this._angularDamping:0}_SetImmovable(i){if(!this._isEnabled)return;i=!!i;if(this._isImmovable===i)return;this._isImmovable=i;this._body["SetType"](this._isImmovable?0:2);this._body["SetAwake"](true)}_IsImmovable(){return this._isImmovable}_SetPreventRotate(i){if(!this._isEnabled)return;i=!!i;if(this._preventRotation===i)return;this._preventRotation=i;this._body["SetFixedRotation"](this._preventRotation);this._body["SetAngularVelocity"](0);this._body["SetAwake"](true)}_IsPreventRotate(){return this._preventRotation}_SetBullet(i){if(!this._isEnabled)return; +i=!!i;if(this._isBullet===i)return;this._isBullet=i;this._body["SetBullet"](this._isBullet);this._body["SetAwake"](true)}_IsBullet(){return this._isBullet}_GetMass(){return this._isEnabled?this._body["GetMass"]()/this._worldScale:0}_GetCenterOfMassX(){return this._isEnabled?(this._body["GetPosition"]()["get_x"]()+this._body["GetLocalCenter"]()["get_x"]())/this._worldScale:0}_GetCenterOfMassY(){return this._isEnabled?(this._body["GetPosition"]()["get_y"]()+this._body["GetLocalCenter"]()["get_y"]())/ +this._worldScale:0}_GetCenterOfMass(){if(!this._isEnabled)return[0,0];const posVec=this._body["GetPosition"]();const centerVec=this._body["GetLocalCenter"]();const worldScale=this._worldScale;return[(posVec["get_x"]()+centerVec["get_x"]())/worldScale,(posVec["get_y"]()+centerVec["get_y"]())/worldScale]}_IsSleeping(){return this._isEnabled?!this._body["IsAwake"]():false}_GetContactCount(){if(!this._isEnabled)return 0;let count=0;for(let contactEdge=this._body["GetContactList"]();this._box2d["getPointer"](contactEdge);contactEdge= +contactEdge["get_next"]()){const contact=contactEdge["get_contact"]();if(!contact)continue;const manifold=contact["GetManifold"]();const pointCount=manifold["get_pointCount"]();count+=pointCount}return count}_GetContactPositionAt(index){index=Math.floor(index);if(!this._isEnabled)return[0,0];let count=0;for(let contactEdge=this._body["GetContactList"]();this._box2d["getPointer"](contactEdge);contactEdge=contactEdge["get_next"]()){const contact=contactEdge["get_contact"]();if(!contact)continue;const manifold= +contact["GetManifold"]();const pointCount=manifold["get_pointCount"]();if(index>=count&&index=px&&px>=x2-.1||x1-.1<=px&&px<=x2+.1;const b2=y1+.1>=py&&py>=y2-.1||y1-.1<=py&&py<=y2+.1;return b1&&b2&&b2Separator.isOnLine(px,py,x1,y1,x2,y2)};b2Separator.isOnLine=function(px,py,x1,y1,x2,y2){if(Math.abs(x2-x1)>.1){const a=(y2-y1)/(x2-x1);const possibleY=a*(px-x1)+ +y1;const diff=Math.abs(possibleY-py);return diff<.1}return Math.abs(px-x1)<.1};b2Separator.pointsMatch=function(x1,y1,x2,y2){return Math.abs(x2-x1)<.1&&Math.abs(y2-y1)<.1};b2Separator.Separate=function(verticesVec,objarea){const calced=b2Separator.calcShapes(verticesVec);let ret=[];for(let i=0,len=calced.length;i=objarea*.001)ret.push(poly);else for(let j=0,lenj=poly.length;j=n)return[];if(!b2Separator.isOnSegment(v2["get_x"](),v2["get_y"](),vec[h]["get_x"](),vec[h]["get_y"](),p1["get_x"](),p1["get_y"]()))vec1.push(vec[k]);break}h=k;if(k-1<0)k=n-1;else k--}vec1.reverse();h=-1;k=i2;while(true){if(k!==j1)vec2.push(vec[k]);else{if(h<0||h>=n)return[];if(k===j1&&!b2Separator.isOnSegment(v1["get_x"](),v1["get_y"](),vec[h]["get_x"](),vec[h]["get_y"](),p2["get_x"](),p2["get_y"]()))vec2.push(vec[k]);break}h=k;if(k+1>n-1)k=0;else k++}queue.push(vec1,vec2);queue.shift();break}}if(isConvex)figsVec.push(queue.shift())}return figsVec}; +function SplitConvexPolysOver8Points(convexPolys){const ret=[];for(const arr of convexPolys)if(arr.length<=8)ret.push(arr);else ret.push.apply(ret,SplitConvexPoly(arr));return ret}function SplitConvexPoly(arr){const ret=[];ret.push(arr.splice(0,8));const first=ret[0][0];let last=ret[0][7];while(arr.length){const poly=arr.splice(0,Math.min(arr.length,6));let nextLast=poly[poly.length-1];poly.push(CloneVec2(first));poly.push(CloneVec2(last));ret.push(poly);last=nextLast}return ret}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.MoveTo=class MoveToBehavior extends C3.SDKBehaviorBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.MoveTo.Type=class MoveToType extends C3.SDKBehaviorTypeBase{constructor(behaviorType){super(behaviorType)}Release(){super.Release()}OnCreate(){}}}; + + +'use strict';{const C3=self.C3;const IBehaviorInstance=self.IBehaviorInstance;const PROP_MAX_SPEED=0;const PROP_ACCELERATION=1;const PROP_DECELERATION=2;const PROP_ROTATE_SPEED=3;const PROP_SET_ANGLE=4;const PROP_STOP_ON_SOLIDS=5;const PROP_ENABLED=6;C3.Behaviors.MoveTo.Instance=class MoveToInstance extends C3.SDKBehaviorInstanceBase{constructor(behInst,properties){super(behInst);this._maxSpeed=200;this._acc=600;this._dec=600;this._rotateSpeed=0;this._setAngle=true;this._stopOnSolids=false;this._isEnabled= +true;this._speed=0;this._movingAngle=this.GetWorldInfo().GetAngle();this._waypoints=[];if(properties){this._maxSpeed=properties[PROP_MAX_SPEED];this._acc=properties[PROP_ACCELERATION];this._dec=properties[PROP_DECELERATION];this._rotateSpeed=C3.toRadians(properties[PROP_ROTATE_SPEED]);this._setAngle=properties[PROP_SET_ANGLE];this._stopOnSolids=properties[PROP_STOP_ON_SOLIDS];this._isEnabled=properties[PROP_ENABLED]}}Release(){super.Release()}SaveToJson(){return{"ms":this._maxSpeed,"acc":this._acc, +"dec":this._dec,"rs":this._rotateSpeed,"sa":this._setAngle,"sos":this._stopOnSolids,"s":this._speed,"ma":this._movingAngle,"wp":this._waypoints.map(p=>({"x":p.x,"y":p.y})),"e":this._isEnabled}}LoadFromJson(o){this._maxSpeed=o["ms"];this._acc=o["acc"];this._dec=o["dec"];this._rotateSpeed=o["rs"];this._setAngle=o["sa"];this._stopOnSolids=o["sos"];this._speed=o["s"];this._movingAngle=o["ma"];this._waypoints=o["wp"].map(p=>({x:p["x"],y:p["y"]}));this._SetEnabled(o["e"]);if(this._isEnabled&&this._waypoints.length> +0)this._StartTicking()}_AddWaypoint(x,y,isDirect){if(isDirect)C3.clearArray(this._waypoints);this._waypoints.push({x,y});if(this._isEnabled)this._StartTicking()}_GetWaypointCount(){return this._waypoints.length}_GetWaypointXAt(i){i=Math.floor(i);if(i<0||i>=this._waypoints.length)return 0;return this._waypoints[i].x}_GetWaypointYAt(i){i=Math.floor(i);if(i<0||i>=this._waypoints.length)return 0;return this._waypoints[i].y}_IsMoving(){return this._waypoints.length>0}_Stop(){C3.clearArray(this._waypoints); +this._speed=0;this._StopTicking()}_GetTargetX(){if(this._waypoints.length>0)return this._waypoints[0].x;else return 0}_GetTargetY(){if(this._waypoints.length>0)return this._waypoints[0].y;else return 0}_SetSpeed(s){if(!this._IsMoving())return;this._speed=Math.min(s,this._maxSpeed)}_GetSpeed(){return this._speed}_SetMaxSpeed(ms){this._maxSpeed=Math.max(ms,0);this._SetSpeed(this._speed)}_GetMaxSpeed(){return this._maxSpeed}_IsRotationEnabled(){return this._rotateSpeed!==0}Tick(){if(!this._isEnabled|| +!this._IsMoving())return;const dt=this._runtime.GetDt(this._inst);const wi=this._inst.GetWorldInfo();const startX=wi.GetX();const startY=wi.GetY();const startAngle=wi.GetAngle();let curSpeed=this._speed;let maxSpeed=this._maxSpeed;const acc=this._acc;const dec=this._dec;const targetX=this._GetTargetX();const targetY=this._GetTargetY();const angleToTarget=C3.angleTo(startX,startY,targetX,targetY);let isWithinStoppingDistance=false;if(dec>0&&this._waypoints.length===1){const stoppingDist=.5*curSpeed* +curSpeed/dec*1.0001;isWithinStoppingDistance=C3.distanceSquared(startX,startY,targetX,targetY)<=stoppingDist*stoppingDist;if(isWithinStoppingDistance){const remainingDist=C3.distanceTo(startX,startY,targetX,targetY);curSpeed=Math.sqrt(2*dec*remainingDist);maxSpeed=curSpeed;this._speed=curSpeed}}if(this._IsRotationEnabled()){const da=C3.angleDiff(this._movingAngle,angleToTarget);if(da>Number.EPSILON){const t=da/this._rotateSpeed;const dist=C3.distanceTo(wi.GetX(),wi.GetY(),targetX,targetY);const r= +dist/(2*Math.sin(da));const curveDist=r*da;maxSpeed=Math.min(maxSpeed,C3.clamp(curveDist/t,0,this._maxSpeed))}}let curAcc=isWithinStoppingDistance?-dec:acc;const stepDist=Math.min(curSpeed*dt+.5*curAcc*dt*dt,maxSpeed*dt);if(isWithinStoppingDistance){if(dec>0){this._speed=Math.max(this._speed-dec*dt,0);if(this._speed===0){this._OnArrived(wi,targetX,targetY);return}}}else if(acc===0)this._speed=maxSpeed;else this._speed=Math.min(this._speed+acc*dt,maxSpeed);if(C3.distanceSquared(wi.GetX(),wi.GetY(), +targetX,targetY)<=stepDist*stepDist){this._OnArrived(wi,targetX,targetY);return}if(this._IsRotationEnabled())this._movingAngle=C3.angleRotate(this._movingAngle,angleToTarget,this._rotateSpeed*dt);else this._movingAngle=angleToTarget;wi.OffsetXY(Math.cos(this._movingAngle)*stepDist,Math.sin(this._movingAngle)*stepDist);if(this._setAngle)wi.SetAngle(this._movingAngle);wi.SetBboxChanged();this._CheckSolidCollision(startX,startY,startAngle)}_OnArrived(wi,targetX,targetY){wi.SetXY(targetX,targetY);wi.SetBboxChanged(); +this._waypoints.shift();if(this._waypoints.length===0){this._speed=0;this._StopTicking()}this.GetScriptInterface().dispatchEvent(C3.New(C3.Event,"arrived"));this.Trigger(C3.Behaviors.MoveTo.Cnds.OnArrived)}_CheckSolidCollision(startX,startY,startAngle){const collisionEngine=this._runtime.GetCollisionEngine();if(this._stopOnSolids&&collisionEngine.TestOverlapSolid(this._inst)){this._Stop();const wi=this._inst.GetWorldInfo();const x=wi.GetX();const y=wi.GetY();const a=C3.angleTo(x,y,startX,startY); +const dist=C3.distanceTo(x,y,startX,startY);if(!collisionEngine.PushOutSolid(this._inst,Math.cos(a),Math.sin(a),Math.max(dist,1))){wi.SetXY(startX,startY);wi.SetAngle(startAngle);wi.SetBboxChanged()}this.GetScriptInterface().dispatchEvent(C3.New(C3.Event,"hitsolid"));this.Trigger(C3.Behaviors.MoveTo.Cnds.OnHitSolid)}}_IsSetAngle(){return this._setAngle}_SetSetAngle(a){this._setAngle=!!a}_SetAngleOfMotion(a){this._movingAngle=a;if(this._isEnabled&&this._setAngle&&!this._IsMoving()){const wi=this.GetWorldInfo(); +wi.SetAngle(this._movingAngle);wi.SetBboxChanged()}}_GetAngleOfMotion(){return this._movingAngle}_SetAcceleration(a){this._acc=Math.max(a,0)}_GetAcceleration(){return this._acc}_SetDeceleration(d){this._dec=Math.max(d,0)}_GetDeceleration(){return this._dec}_SetRotateSpeed(r){this._rotateSpeed=Math.max(r,0)}_GetRotateSpeed(){return this._rotateSpeed}_SetStopOnSolids(e){this._stopOnSolids=!!e}_IsStopOnSolids(){return this._stopOnSolids}_SetEnabled(e){e=!!e;if(this._isEnabled===e)return;this._isEnabled= +e;if(this._isEnabled&&this._IsMoving())this._StartTicking();else this._StopTicking()}_IsEnabled(){return this._isEnabled}GetPropertyValueByIndex(index){switch(index){case PROP_MAX_SPEED:return this._GetMaxSpeed();case PROP_ACCELERATION:return this._GetAcceleration();case PROP_DECELERATION:return this._GetDeceleration();case PROP_ROTATE_SPEED:return C3.toDegrees(this._GetRotateSpeed());case PROP_SET_ANGLE:return this._IsSetAngle();case PROP_STOP_ON_SOLIDS:return this._IsStopOnSolids();case PROP_ENABLED:return this._IsEnabled()}}SetPropertyValueByIndex(index, +value){switch(index){case PROP_MAX_SPEED:this._SetMaxSpeed(value);break;case PROP_ACCELERATION:this._SetAcceleration(value);break;case PROP_DECELERATION:this._SetDeceleration(value);break;case PROP_ROTATE_SPEED:this._SetRotateSpeed(C3.toRadians(value));break;case PROP_SET_ANGLE:this._SetSetAngle(value);break;case PROP_STOP_ON_SOLIDS:this._SetStopOnSolids(value);break;case PROP_ENABLED:this._SetEnabled(value);break}}GetDebuggerProperties(){const prefix="behaviors.moveto";return[{title:"$"+this.GetBehaviorType().GetName(), +properties:[{name:prefix+".debugger.speed",value:this._GetSpeed(),onedit:v=>this._SetSpeed(v)},{name:prefix+".debugger.angle-of-motion",value:C3.toDegrees(this._GetAngleOfMotion()),onedit:v=>this._movingAngle=C3.toRadians(v)},{name:prefix+".debugger.target-x",value:this._GetTargetX()},{name:prefix+".debugger.target-y",value:this._GetTargetY()},{name:prefix+".debugger.waypoint-count",value:this._GetWaypointCount()},{name:prefix+".properties.max-speed.name",value:this._GetMaxSpeed(),onedit:v=>this._SetMaxSpeed(v)}, +{name:prefix+".properties.acceleration.name",value:this._GetAcceleration(),onedit:v=>this._SetAcceleration(v)},{name:prefix+".properties.deceleration.name",value:this._GetDeceleration(),onedit:v=>this._SetDeceleration(v)},{name:prefix+".properties.rotate-speed.name",value:C3.toDegrees(this._GetRotateSpeed()),onedit:v=>this._SetRotateSpeed(C3.toRadians(v))},{name:prefix+".properties.enabled.name",value:this._IsEnabled(),onedit:v=>this._SetEnabled(v)}]}]}GetScriptInterfaceClass(){return self.IMoveToBehaviorInstance}}; +const map=new WeakMap;self.IMoveToBehaviorInstance=class IMoveToBehaviorInstance extends IBehaviorInstance{constructor(){super();map.set(this,IBehaviorInstance._GetInitInst().GetSdkInstance())}moveToPosition(x,y,isDirect=true){map.get(this)._AddWaypoint(x,y,!!isDirect)}getTargetX(){return map.get(this)._GetTargetX()}getTargetY(){return map.get(this)._GetTargetY()}getTargetPosition(){const b=map.get(this);return[b._GetTargetX(),b._GetTargetY()]}getWaypointCount(){return map.get(this)._GetWaypointCount()}getWaypointX(i){return map.get(this)._GetWaypointXAt(+i)}getWaypointY(i){return map.get(this)._GetWaypointYAt(+i)}getWaypoint(i){i= ++i;const b=map.get(this);return[b._GetWaypointXAt(i),b._GetWaypointYAt(i)]}stop(){map.get(this)._Stop()}get isMoving(){return map.get(this)._IsMoving()}get speed(){return map.get(this)._GetSpeed()}set speed(s){map.get(this)._SetSpeed(s)}get maxSpeed(){return map.get(this)._GetMaxSpeed()}set maxSpeed(ms){map.get(this)._SetMaxSpeed(ms)}get acceleration(){return map.get(this)._GetAcceleration()}set acceleration(a){map.get(this)._SetAcceleration(a)}get deceleration(){return map.get(this)._GetDeceleration()}set deceleration(d){map.get(this)._SetDeceleration(d)}get angleOfMotion(){return map.get(this)._GetAngleOfMotion()}set angleOfMotion(a){map.get(this)._SetAngleOfMotion(a)}get rotateSpeed(){return map.get(this)._GetRotateSpeed()}set rotateSpeed(r){map.get(this)._SetRotateSpeed(r)}get isStopOnSolids(){return map.get(this)._IsStopOnSolids()}set isStopOnSolids(e){map.get(this)._SetStopOnSolids(e)}get isEnabled(){return map.get(this)._IsEnabled()}set isEnabled(e){map.get(this)._SetEnabled(e)}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.MoveTo.Cnds={IsMoving(){return this._IsMoving()},CompareSpeed(cmp,s){return C3.compare(this._GetSpeed(),cmp,s)},IsEnabled(){return this._IsEnabled()},OnArrived(){return true},OnHitSolid(){return true}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.MoveTo.Acts={MoveToPosition(x,y,mode){this._AddWaypoint(x,y,mode===0)},MoveToObject(objectClass,imgPt,mode){if(!objectClass)return;const inst=objectClass.GetPairedInstance(this._inst);if(!inst||!inst.GetWorldInfo())return;const [x,y]=inst.GetImagePoint(imgPt);this._AddWaypoint(x,y,mode===0)},MoveAlongPathfindingPath(mode){const behInst=this._inst.GetBehaviorSdkInstanceFromCtor(C3.Behaviors.Pathfinding);if(!behInst)return;const path=behInst._GetPath();if(path.length=== +0)return;for(let i=0,len=path.length;i= this.remainDistance); + } + var acc = (isSlowDown) ? (-this.moveParams["dec"]) : this.moveParams["acc"]; + if (acc != 0) { + this.setCurrentSpeed(this.currentSpeed + (acc * dt)); + } + + // Apply movement to the object + var distance = this.currentSpeed * dt; + this.remainDistance -= distance; + + var isHitTarget = false; + var angle = this.target["a"]; + var ux = Math.cos(angle); + var uy = Math.sin(angle); + // is hit to target at next tick? + if ((this.remainDistance <= 0) || (this.currentSpeed <= 0)) { + isHitTarget = true; + this.wi.SetX(this.target["x"]); + this.wi.SetY(this.target["y"]); + + if (this.currentSpeed > 0) + this.remainDt = (-this.remainDistance) / this.currentSpeed; + + this.getMovingAngle(); + this.setCurrentSpeed(0); + this.remainDistance = 0; + } + else { + var angle = this.target["a"]; + this.wi.SetX(this.wi.GetX() + (distance * ux)); + this.wi.SetY(this.wi.GetY() + (distance * uy)); + } + + this.wi.SetBboxChanged(); + + this.prePosition["x"] = this.wi.GetX(); + this.prePosition["y"] = this.wi.GetY(); + + if (isHitTarget) { + this.isMoving = false; // stop + this.isMyCall = true; + this.Trigger(C3.Behaviors.Rex_MoveTo.Cnds.OnHitTarget); + this.isMyCall = false; + } + } + + setCurrentSpeed (speed) { + if (speed != null) { + this.currentSpeed = (speed > this.moveParams["max"]) ? + this.moveParams["max"] : speed; + } + else if (this.moveParams["acc"] == 0) { + this.currentSpeed = this.moveParams["max"]; + } + } + + resetCurrentPosition () { + var dx = this.target["x"] - this.wi.GetX(); + var dy = this.target["y"] - this.wi.GetY(); + + this.target["a"] = Math.atan2(dy, dx); + this.remainDistance = Math.sqrt((dx * dx) + (dy * dy)); + this.prePosition["x"] = this.wi.GetX(); + this.prePosition["y"] = this.wi.GetY(); + } + + setTargetPos (_x, _y) { + this.target["x"] = _x; + this.target["y"] = _y; + this.setCurrentSpeed(null); + this.resetCurrentPosition(); + this.movingAngleData["x"] = this.wi.GetX(); + this.movingAngleData["y"] = this.wi.GetY(); + this.isMoving = true;; + + // start position + this.movingAngleStartData["x"] = this.wi.GetX(); + this.movingAngleStartData["y"] = this.wi.GetY(); + this.movingAngleStartData["a"] = to_clamped_degrees(angleTo(this.wi.GetX(), this.wi.GetY(), _x, _y)); + + if (this.isContinueMode) + this.move(this.remainDt); + } + + isTickChanged () { + var curTick = this._runtime.GetTickCount(); + var tickChanged = (this.lastTick != curTick); + this.lastTick = curTick; + return tickChanged; + } + + getMovingAngle (ret) { + if (this.isTickChanged()) { + var dx = this.wi.GetX() - this.movingAngleData["x"]; + var dy = this.wi.GetY() - this.movingAngleData["y"]; + if ((dx != 0) || (dy != 0)) + this.movingAngleData["a"] = to_clamped_degrees(Math.atan2(dy, dx)); + } + return this.movingAngleData["a"]; + } + // Custom Class Functions :: End + }; +} + +// Custom Variables :: Start + +var newPointData = function (point) { + if (point == null) + point = {}; + point["x"] = 0; + point["y"] = 0; + point["a"] = -1; + return point; +}; + +// Custom Variables :: End + +// Custom Functions :: Start + +function clone(obj) { + if (null == obj || "object" != typeof obj) + return obj; + var result = obj.constructor(); + for (var attr in obj) { + if (obj.hasOwnProperty(attr)) + result[attr] = obj[attr]; + } + return result; +}; + +// Custom Functions :: End + +// Custom System Variable Functions :: Start + +var to_radians = function(x) +{ + return x / (180.0 / Math.PI); +}; + +var clamp_angle = function (a) +{ + // Clamp in radians + a %= 2 * Math.PI; // now in (-2pi, 2pi) range + + if (a < 0) + a += 2 * Math.PI; // now in [0, 2pi) range + + return a; +}; +var do_cmp = function (x, cmp, y) + { + if (typeof x === "undefined" || typeof y === "undefined") + return false; + switch (cmp) + { + case 0: // equal + return x === y; + case 1: // not equal + return x !== y; + case 2: // less + return x < y; + case 3: // less/equal + return x <= y; + case 4: // greater + return x > y; + case 5: // greater/equal + return x >= y; + default: + return false; + } +}; +var to_clamped_radians = function (x) +{ + // Convert x from radians to [0, 2pi) range + return clamp_angle(to_radians(x)); +}; + +var clamp_angle_degrees = function (a) +{ + // Clamp in degrees + a %= 360; // now in (-360, 360) range + + if (a < 0) + a += 360; // now in [0, 360) range + + return a; +}; + +var to_degrees = function(x) +{ + return x * (180.0 / Math.PI); +}; + +var to_clamped_degrees = function (x) +{ + // Convert x from radians to [0, 360) range + return clamp_angle_degrees(to_degrees(x)); +}; + +var angleTo = function(x1, y1, x2, y2) +{ + var dx = x2 - x1; + var dy = y2 - y1; + return Math.atan2(dy, dx); +}; + +// Custom System Variable Functions :: End + +"use strict"; + +{ + C3.Behaviors.Rex_MoveTo.Cnds = + { + OnHitTarget () { + return (this.isMyCall); + }, + + CompareSpeed (cmp, s) { + return do_cmp(this.currentSpeed, cmp, s); + }, + + OnMoving () // deprecated + { + return false; + }, + + IsMoving () { + return (this.enabled && this.isMoving); + }, + + CompareMovingAngle (cmp, s) { + var angle = this.getMovingAngle(); + if (angle != (-1)) + return do_cmp(this.getMovingAngle(), cmp, s); + else + return false; + }, + + OnSolidStop() { + return this.isMyCall; + } + + }; +} + +"use strict"; + +{ + C3.Behaviors.Rex_MoveTo.Acts = + { + SetEnabled (en) { + this.enabled = (en === 1); + }, + + SetMaxSpeed (s) { + this.moveParams["max"] = s; + this.setCurrentSpeed(null); + }, + + SetAcceleration (a) { + this.moveParams["acc"] = a; + this.setCurrentSpeed(null); + }, + + SetDeceleration (a) { + this.moveParams["dec"] = a; + }, + + SetTargetPos (x, y) { + this.setTargetPos(x, y) + }, + + SetCurrentSpeed (s) { + this.setCurrentSpeed(s); + }, + + SetTargetPosOnObject (objtype) { + if (!objtype) + return; + var inst = objtype.GetFirstPicked(); + if (inst != null) + { + var instWI = inst.GetWorldInfo(); + this.setTargetPos(instWI.GetX(), instWI.GetY()); + } + + }, + + SetTargetPosByDeltaXY (dx, dy) { + this.setTargetPos(this.wi.GetX() + dx, this.wi.GetY() + dy); + }, + + SetTargetPosByDistanceAngle (distance, angle) { + var a = to_clamped_radians(angle); + var dx = distance * Math.cos(a); + var dy = distance * Math.sin(a); + this.setTargetPos(this.wi.GetX() + dx, this.wi.GetY() + dy); + }, + + Stop () { + this.isMoving = false; + }, + + SetTargetPosOnUID (uid) { + var inst = this._runtime.GetInstanceByUID(uid); + + if (inst != null) + { + var instWI = inst.GetWorldInfo(); + this.setTargetPos(instWI.GetX(), instWI.GetY()); + } + }, + + SetStopBySolid (en) { + this.soildStopEnable = (en === 1); + } + }; +} + +"use strict"; + +{ + C3.Behaviors.Rex_MoveTo.Exps = + { + Activated () { + return ((this.enabled) ? 1 : 0); + }, + + Speed () { + return (this.currentSpeed); + }, + + MaxSpeed () { + return (this.moveParams["max"]); + }, + + Acc () { + return (this.moveParams["acc"]); + }, + + Dec () { + return (this.moveParams["dec"]); + }, + + TargetX () { + return (this.target["x"]); + }, + + TargetY () { + return (this.target["y"]); + }, + + MovingAngle () { + return (this.getMovingAngle()); + }, + + MovingAngleStart () { + return (this.movingAngleStartData["a"]); + } + }; +} + +'use strict';{const C3=self.C3;C3.Behaviors.Bullet=class BulletBehavior extends C3.SDKBehaviorBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Bullet.Type=class BulletType extends C3.SDKBehaviorTypeBase{constructor(behaviorType){super(behaviorType)}Release(){super.Release()}OnCreate(){}}}; + + +'use strict';{const C3=self.C3;const IBehaviorInstance=self.IBehaviorInstance;const SPEED=0;const ACCELERATION=1;const GRAVITY=2;const BOUNCE_OFF_SOLIDS=3;const SET_ANGLE=4;const STEPPING=5;const ENABLE=6;C3.Behaviors.Bullet.Instance=class BulletInstance extends C3.SDKBehaviorInstanceBase{constructor(behInst,properties){super(behInst);const wi=this.GetWorldInfo();this._speed=0;this._acc=0;this._g=0;this._bounceOffSolid=false;this._setAngle=false;this._isStepping=false;this._isEnabled=true;this._dx= +0;this._dy=0;this._lastX=wi.GetX();this._lastY=wi.GetY();this._lastKnownAngle=wi.GetAngle();this._travelled=0;this._stepSize=Math.min(Math.abs(wi.GetWidth()),Math.abs(wi.GetHeight())/2);this._stopStepping=false;if(properties){this._speed=properties[SPEED];this._acc=properties[ACCELERATION];this._g=properties[GRAVITY];this._bounceOffSolid=!!properties[BOUNCE_OFF_SOLIDS];this._setAngle=!!properties[SET_ANGLE];this._isStepping=!!properties[STEPPING];this._isEnabled=!!properties[ENABLE]}const a=wi.GetAngle(); +this._dx=Math.cos(a)*this._speed;this._dy=Math.sin(a)*this._speed;if(this._isEnabled){this._StartTicking();if(this._bounceOffSolid)this._StartPostTicking()}}Release(){super.Release()}SaveToJson(){const o={"dx":this._dx,"dy":this._dy,"lx":this._lastX,"ly":this._lastY,"lka":this._lastKnownAngle,"t":this._travelled};if(this._acc!==0)o["acc"]=this._acc;if(this._g!==0)o["g"]=this._g;if(this._isStepping)o["st"]=this._isStepping;if(!this._isEnabled)o["e"]=this._isEnabled;if(this._bounceOffSolid)o["bos"]= +this._bounceOffSolid;if(this._setAngle)o["sa"]=this._setAngle;return o}LoadFromJson(o){this._dx=o["dx"];this._dy=o["dy"];this._lastX=o["lx"];this._lastY=o["ly"];this._lastKnownAngle=o["lka"];this._travelled=o["t"];this._acc=o.hasOwnProperty("acc")?o["acc"]:0;this._g=o.hasOwnProperty("g")?o["g"]:0;this._isStepping=o.hasOwnProperty("st")?o["st"]:false;this._bounceOffSolid=o.hasOwnProperty("bos")?o["bos"]:false;this._setAngle=o.hasOwnProperty("sa")?o["sa"]:false;this._SetEnabled(o.hasOwnProperty("e")? +o["e"]:true)}Tick(){if(!this._isEnabled)return;const dt=this._runtime.GetDt(this._inst);const wi=this._inst.GetWorldInfo();if(wi.GetAngle()!==this._lastKnownAngle){const angle=wi.GetAngle();if(this._setAngle){const s=C3.distanceTo(0,0,this._dx,this._dy);this._dx=Math.cos(angle)*s;this._dy=Math.sin(angle)*s}this._lastKnownAngle=angle}let xacc=0;let yacc=0;if(this._acc!==0){let s=C3.distanceTo(0,0,this._dx,this._dy);let a=0;if(this._dx===0&&this._dy===0)a=wi.GetAngle();else a=C3.angleTo(0,0,this._dx, +this._dy);s+=this._acc*dt;xacc=Math.cos(a)*this._acc;yacc=Math.sin(a)*this._acc;if(s<0){s=0;xacc=0;yacc=0}this._dx=Math.cos(a)*s;this._dy=Math.sin(a)*s}if(this._g!==0){this._dy+=this._g*dt;yacc+=this._g}this._lastX=wi.GetX();this._lastY=wi.GetY();if(this._dx!==0||this._dy!==0){const mx=this._dx*dt+.5*xacc*dt*dt;const my=this._dy*dt+.5*yacc*dt*dt;const stepDist=C3.distanceTo(0,0,mx,my);this._MoveBy(mx,my,stepDist);this._travelled+=stepDist;if(this._setAngle&&(mx!==0||my!==0)){const a=C3.angleTo(0, +0,mx,my);wi.SetAngle(a);this._lastKnownAngle=wi.GetAngle()}wi.SetBboxChanged()}}_MoveBy(mx,my,stepDist){const wi=this.GetWorldInfo();if(!this._isStepping||stepDist<=this._stepSize){wi.OffsetXY(mx,my);wi.SetBboxChanged();if(this._isStepping)this.Trigger(C3.Behaviors.Bullet.Cnds.OnStep);return}this._stopStepping=false;const startX=wi.GetX();const startY=wi.GetY();const endX=startX+mx;const endY=startY+my;const a=C3.angleTo(0,0,mx,my);const stepX=Math.cos(a)*this._stepSize;const stepY=Math.sin(a)*this._stepSize; +const stepCount=Math.floor(stepDist/this._stepSize);for(let i=1;i<=stepCount;++i){wi.SetXY(startX+stepX*i,startY+stepY*i);wi.SetBboxChanged();this.Trigger(C3.Behaviors.Bullet.Cnds.OnStep);if(this._inst.IsDestroyed()||this._stopStepping)return}wi.SetXY(endX,endY);wi.SetBboxChanged();this.Trigger(C3.Behaviors.Bullet.Cnds.OnStep)}PostTick(){if(!this._isEnabled||!this._bounceOffSolid||this._dx===0&&this._dy===0)return;const dt=this._runtime.GetDt(this._inst);const wi=this._inst.GetWorldInfo();const collisionEngine= +this._runtime.GetCollisionEngine();const bounceSolid=collisionEngine.TestOverlapSolid(this._inst);if(bounceSolid){collisionEngine.RegisterCollision(this._inst,bounceSolid);const s=C3.distanceTo(0,0,this._dx,this._dy);const bounceAngle=collisionEngine.CalculateBounceAngle(this._inst,this._lastX,this._lastY);this._dx=Math.cos(bounceAngle)*s;this._dy=Math.sin(bounceAngle)*s;wi.OffsetXY(this._dx*dt,this._dy*dt);wi.SetBboxChanged();if(this._setAngle){wi.SetAngle(bounceAngle);this._lastKnownAngle=wi.GetAngle(); +wi.SetBboxChanged()}if(!collisionEngine.PushOutSolid(this._inst,this._dx/s,this._dy/s,Math.max(s*2.5*dt,30)))collisionEngine.PushOutSolidNearest(this._inst,100)}}GetPropertyValueByIndex(index){switch(index){case SPEED:return this._GetSpeed();case ACCELERATION:return this._GetAcceleration();case GRAVITY:return this._GetGravity();case SET_ANGLE:return this._setAngle;case STEPPING:return this._isStepping;case ENABLE:return this._IsEnabled()}}SetPropertyValueByIndex(index,value){switch(index){case SPEED:this._SetSpeed(value); +break;case ACCELERATION:this._acc=value;break;case GRAVITY:this._g=value;break;case SET_ANGLE:this._setAngle=!!value;break;case STEPPING:this._isStepping=!!value;break;case ENABLE:this._SetEnabled(!!value);break}}_SetSpeed(s){const a=C3.angleTo(0,0,this._dx,this._dy);this._dx=Math.cos(a)*s;this._dy=Math.sin(a)*s}_GetSpeed(){return C3.round6dp(C3.distanceTo(0,0,this._dx,this._dy))}_SetAcceleration(a){this._acc=a}_GetAcceleration(){return this._acc}_SetGravity(g){this._g=g}_GetGravity(){return this._g}_SetAngleOfMotion(a){const s= +C3.distanceTo(0,0,this._dx,this._dy);this._dx=Math.cos(a)*s;this._dy=Math.sin(a)*s}_GetAngleOfMotion(){return C3.angleTo(0,0,this._dx,this._dy)}_SetBounceOffSolids(b){b=!!b;if(this._bounceOffSolid===b)return;this._bounceOffSolid=b;if(this._isEnabled)if(this._bounceOffSolid)this._StartPostTicking();else this._StopPostTicking()}_IsBounceOffSolids(){return this._bounceOffSolid}_SetDistanceTravelled(d){this._travelled=d}_GetDistanceTravelled(){return this._travelled}_SetEnabled(e){this._isEnabled=!!e; +if(this._isEnabled){this._StartTicking();if(this._bounceOffSolid)this._StartPostTicking()}else{this._StopTicking();this._StopPostTicking()}}_IsEnabled(){return this._isEnabled}GetDebuggerProperties(){const prefix="behaviors.bullet";return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:prefix+".debugger.vector-x",value:this._dx,onedit:v=>this._dx=v},{name:prefix+".debugger.vector-y",value:this._dy,onedit:v=>this._dy=v},{name:prefix+".properties.speed.name",value:this._GetSpeed(),onedit:v=> +this._SetSpeed(v)},{name:prefix+".debugger.angle-of-motion",value:C3.toDegrees(this._GetAngleOfMotion())},{name:prefix+".properties.gravity.name",value:this._GetGravity(),onedit:v=>this._SetGravity(v)},{name:prefix+".properties.acceleration.name",value:this._GetAcceleration(),onedit:v=>this._SetAcceleration(v)},{name:prefix+".debugger.distance-travelled",value:this._GetDistanceTravelled()},{name:prefix+".properties.enabled.name",value:this._IsEnabled(),onedit:v=>this._SetEnabled(v)}]}]}GetScriptInterfaceClass(){return self.IBulletBehaviorInstance}}; +const map=new WeakMap;self.IBulletBehaviorInstance=class IBulletBehaviorInstance extends IBehaviorInstance{constructor(){super();map.set(this,IBehaviorInstance._GetInitInst().GetSdkInstance())}get speed(){return map.get(this)._GetSpeed()}set speed(s){map.get(this)._SetSpeed(s)}get acceleration(){return map.get(this)._GetAcceleration()}set acceleration(a){map.get(this)._SetAcceleration(a)}get gravity(){return map.get(this)._GetGravity()}set gravity(g){map.get(this)._SetGravity(g)}get angleOfMotion(){return map.get(this)._GetAngleOfMotion()}set angleOfMotion(a){map.get(this)._SetAngleOfMotion(a)}get bounceOffSolids(){return map.get(this)._IsBounceOffSolids()}set bounceOffSolids(b){map.get(this)._SetBounceOffSolids(!!b)}get distanceTravelled(){return map.get(this)._GetDistanceTravelled()}set distanceTravelled(d){map.get(this)._SetDistanceTravelled(d)}get isEnabled(){return map.get(this)._IsEnabled()}set isEnabled(e){map.get(this)._SetEnabled(e)}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Bullet.Cnds={CompareSpeed(cmp,s){const speed=Math.sqrt(this._dx*this._dx+this._dy*this._dy);return C3.compare(speed,cmp,s)},CompareTravelled(cmp,d){return C3.compare(this._GetDistanceTravelled(),cmp,d)},OnStep(){return true},IsEnabled(){return this._IsEnabled()}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Bullet.Acts={SetSpeed(s){this._SetSpeed(s)},SetAcceleration(a){this._SetAcceleration(a)},SetGravity(g){this._SetGravity(g)},SetAngleOfMotion(a){this._SetAngleOfMotion(C3.toRadians(a))},Bounce(objectClass){if(!objectClass)return;const otherInst=objectClass.GetFirstPicked(this._inst);if(!otherInst)return;const wi=this._inst.GetWorldInfo();const collisionEngine=this._runtime.GetCollisionEngine();const dt=this._runtime.GetDt(this._inst);const s=C3.distanceTo(0, +0,this._dx,this._dy);const bounceAngle=collisionEngine.CalculateBounceAngle(this._inst,this._lastX,this._lastY,otherInst);this._dx=Math.cos(bounceAngle)*s;this._dy=Math.sin(bounceAngle)*s;wi.OffsetXY(this._dx*dt,this._dy*dt);wi.SetBboxChanged();if(this._setAngle){wi.SetAngle(bounceAngle);this._lastKnownAngle=wi.GetAngle();wi.SetBboxChanged()}if(s!==0)if(this._bounceOffSolid){if(!collisionEngine.PushOutSolid(this._inst,this._dx/s,this._dy/s,Math.max(s*2.5*dt,30)))collisionEngine.PushOutSolidNearest(this._inst, +100)}else collisionEngine.PushOut(this._inst,this._dx/s,this._dy/s,Math.max(s*2.5*dt,30),otherInst)},SetBounceOffSolids(b){this._SetBounceOffSolids(b)},SetDistanceTravelled(d){this._SetDistanceTravelled(d)},SetEnabled(e){this._SetEnabled(e)},StopStepping(){this._stopStepping=true}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Bullet.Exps={Speed(){return this._GetSpeed()},Acceleration(){return this._GetAcceleration()},AngleOfMotion(){return C3.toDegrees(this._GetAngleOfMotion())},DistanceTravelled(){return this._GetDistanceTravelled()},Gravity(){return this._GetGravity()}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Fade=class FadeBehavior extends C3.SDKBehaviorBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Fade.Type=class FadeType extends C3.SDKBehaviorTypeBase{constructor(behaviorType){super(behaviorType)}Release(){super.Release()}OnCreate(){}}}; + + +'use strict';{const C3=self.C3;const FADE_IN_TIME=0;const WAIT_TIME=1;const FADE_OUT_TIME=2;const DESTROY=3;const ACTIVE_AT_START=4;C3.Behaviors.Fade.Instance=class FadeInstance extends C3.SDKBehaviorInstanceBase{constructor(behInst,properties){super(behInst);this._fadeInTime=0;this._waitTime=0;this._fadeOutTime=0;this._destroy=true;this._activeAtStart=true;this._setMaxOpacity=false;this._stage=0;this._stageTime=C3.New(C3.KahanSum);this._maxOpacity=this._inst.GetWorldInfo().GetOpacity()||1;if(properties){this._fadeInTime= +properties[FADE_IN_TIME];this._waitTime=properties[WAIT_TIME];this._fadeOutTime=properties[FADE_OUT_TIME];this._destroy=!!properties[DESTROY];this._activeAtStart=!!properties[ACTIVE_AT_START];this._stage=this._activeAtStart?0:3}if(this._activeAtStart)if(this._fadeInTime===0){this._stage=1;if(this._waitTime===0)this._stage=2}else{this._inst.GetWorldInfo().SetOpacity(0);this._runtime.UpdateRender()}this._StartTicking()}Release(){super.Release()}SaveToJson(){return{"fit":this._fadeInTime,"wt":this._waitTime, +"fot":this._fadeOutTime,"d":this._destroy,"s":this._stage,"st":this._stageTime.Get(),"mo":this._maxOpacity}}LoadFromJson(o){this._fadeInTime=o["fit"];this._waitTime=o["wt"];this._fadeOutTime=o["fot"];this._destroy=o["d"];this._stage=o["s"];this._stageTime.Set(o["st"]);this._maxOpacity=o["mo"]}Tick(){const dt=this._runtime.GetDt(this._inst);this._stageTime.Add(dt);const wi=this._inst.GetWorldInfo();if(this._stage===0){wi.SetOpacity(this._stageTime.Get()/this._fadeInTime*this._maxOpacity);this._runtime.UpdateRender(); +if(wi.GetOpacity()>=this._maxOpacity){wi.SetOpacity(this._maxOpacity);this._stage=1;this._stageTime.Reset();this.Trigger(C3.Behaviors.Fade.Cnds.OnFadeInEnd)}}if(this._stage===1)if(this._stageTime.Get()>=this._waitTime){this._stage=2;this._stageTime.Reset();this.Trigger(C3.Behaviors.Fade.Cnds.OnWaitEnd)}if(this._stage===2)if(this._fadeOutTime!==0){wi.SetOpacity(this._maxOpacity-this._stageTime.Get()/this._fadeOutTime*this._maxOpacity);this._runtime.UpdateRender();if(wi.GetOpacity()<=0){this._stage= +3;this._stageTime.Reset();this.Trigger(C3.Behaviors.Fade.Cnds.OnFadeOutEnd);if(this._destroy)this._runtime.DestroyInstance(this._inst)}}}Start(){this._stage=0;this._stageTime.Reset();if(this._fadeInTime===0){this._stage=1;if(this._waitTime===0)this._stage=2}else{this._inst.GetWorldInfo().SetOpacity(0);this._runtime.UpdateRender()}}GetPropertyValueByIndex(index){switch(index){case FADE_IN_TIME:return this._fadeInTime;case WAIT_TIME:return this._waitTime;case FADE_OUT_TIME:return this._fadeOutTime; +case DESTROY:return this._destroy}}SetPropertyValueByIndex(index,value){switch(index){case FADE_IN_TIME:this._fadeInTime=value;break;case WAIT_TIME:this._waitTime=value;break;case FADE_OUT_TIME:this._fadeOutTime=value;break;case DESTROY:this._destroy=!!value;break}}GetDebuggerProperties(){const prefix="behaviors.fade";return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:prefix+".properties.fade-in-time.name",value:this._fadeInTime,onedit:v=>this._fadeInTime=v},{name:prefix+".properties.wait-time.name", +value:this._waitTime,onedit:v=>this._waitTime=v},{name:prefix+".properties.fade-out-time.name",value:this._fadeOutTime,onedit:v=>this._fadeOutTime=v},{name:prefix+".debugger.stage",value:[prefix+".debugger."+["fade-in","wait","fade-out","done"][this._stage]]}]}]}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Fade.Cnds={OnFadeOutEnd(){return true},OnFadeInEnd(){return true},OnWaitEnd(){return true}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Fade.Acts={StartFade(){if(!this._activeAtStart&&!this._setMaxOpacity){this._maxOpacity=this._inst.GetWorldInfo().GetOpacity()||1;this._setMaxOpacity=true}if(this._stage===3)this.Start()},RestartFade(){this.Start()},SetFadeInTime(t){if(t<0)t=0;this._fadeInTime=t},SetWaitTime(t){if(t<0)t=0;this._waitTime=t},SetFadeOutTime(t){if(t<0)t=0;this._fadeOutTime=t}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Fade.Exps={FadeInTime(){return this._fadeInTime},WaitTime(){return this._waitTime},FadeOutTime(){return this._fadeOutTime}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Tween=class TweenBehavior extends C3.SDKBehaviorBase{constructor(opts){super(opts)}Release(){super.Release()}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Tween.Type=class TweenType extends C3.SDKBehaviorTypeBase{constructor(behaviorType){super(behaviorType)}Release(){super.Release()}OnCreate(){}}}; + + +'use strict';{const C3=self.C3;const NAMESPACE=C3.Behaviors.Tween;const ENABLED=0;NAMESPACE.Instance=class TweenInstance extends C3.SDKBehaviorInstanceBase{constructor(behInst,properties){super(behInst);this._allowMultiple=false;this._enabled=true;if(properties){this._allowMultiple=false;this._enabled=!!properties[ENABLED]}this._activeTweens=new Map;this._disabledTweens=[];this._waitingForReleaseTweens=new Map;this._finishingTween=null;this._activeTweensJson=null;this._disabledTweensJson=null;this._waitingForReleaseTweensJson= +null;this._finishingTweenName="";if(this._enabled)this._StartTicking2();this._afterLoad=e=>this._OnAfterLoad(e);this.GetRuntime().Dispatcher().addEventListener("afterload",this._afterLoad)}Release(){this.GetRuntime().Dispatcher().removeEventListener("afterload",this._afterLoad);this._afterLoad=null;if(this._finishingTween){this.ReleaseAndCompleteTween(this._finishingTween);this._finishingTween=null}this.ReleaseAndCompleteTweens();this._tweens=null;this.ClearDisabledList();this._disabledTweens=null; +this._ReleaseWaitingTweens();this._waitingForReleaseTweens=null;super.Release()}SetEnabled(e){this._enabled=e;if(this._enabled)this._StartTicking2();else this._StopTicking2()}GetEnabled(){return this._enabled}AddToDisabledList(tween){this._disabledTweens.push(tween)}IsInDisabledList(tween){return this._disabledTweens.includes(tween)}ClearDisabledList(){C3.clearArray(this._disabledTweens)}GetFinishingTween(){return this._finishingTween}IsInstanceValid(){const inst=this.GetObjectInstance();if(!inst)return false; +return!inst.IsDestroyed()}GetTween(tags,property,includeWaitingForRelease=false){const tweens=property?this.PropertyTweens(property,includeWaitingForRelease):this.AllTweens(includeWaitingForRelease);if(!tweens||!tweens.length)return;for(const tween of tweens)if(tween.HasTags(tags))return tween}GetTweenIncludingWaitingForRelease(tags,property){return this.GetTween(tags,property,true)}*GetTweens(tags,property,includeWaitingForRelease=false){const tweens=property?this.PropertyTweens(property,includeWaitingForRelease): +this.AllTweens(includeWaitingForRelease);if(tweens&&tweens.length)for(const tween of tweens)if(tween.HasTags(tags))yield tween}*GetTweensIncludingWaitingForRelease(tags,property){yield*this.GetTweens(tags,property,true)}PropertyTweens(property,includeWaitingForRelease){if(includeWaitingForRelease){let active=this._activeTweens.get(property);let waitingForRelease=this._waitingForReleaseTweens.get(property);if(!active)active=[];if(!waitingForRelease)waitingForRelease=[];return active.concat(waitingForRelease).filter(t=> +t)}else{let active=this._activeTweens.get(property);if(!active)active=[];return active.filter(t=>t)}}AllTweens(includeWaitingForRelease){if(includeWaitingForRelease){const active=[...this._activeTweens.values()].flat();const waitingForRelease=[...this._waitingForReleaseTweens.values()].flat();return active.concat(waitingForRelease).filter(t=>t)}else{const active=[...this._activeTweens.values()].flat();return active.filter(t=>t)}}AllTweensIncludingWaitingForRelease(){return this.AllTweens(true)}SaveToJson(){return{"s":false, +"e":!!this._enabled,"at":this._SaveActiveTweensToJson(),"dt":this._SaveDisabledTweensToJson(),"wt":this._SaveWaitingForReleaseTweensToJson(),"ft":this._SaveFinishingTweenToJson()}}LoadFromJson(o){if(!o)return;this._activeTweensJson=o["at"];this._disabledTweensJson=o["dt"];this._waitingForReleaseTweensJson=o["wt"];this._finishingTweenName=o["ft"];this._allowMultiple=false;this._enabled=!!o["e"]}_OnAfterLoad(e){const timelineManager=this.GetRuntime().GetTimelineManager();this._PopulateTweenMap(this._activeTweensJson, +this._activeTweens,timelineManager);if(this._disabledTweensJson){C3.clearArray(this._disabledTweens);for(const tweenName of this._disabledTweensJson)this._PopulateTweenArray(this._disabledTweens,tweenName,timelineManager)}this._PopulateTweenMap(this._waitingForReleaseTweensJson,this._waitingForReleaseTweens,timelineManager);this._finishingTween=this._GetTween(this._finishingTweenName,timelineManager);this._enabled?this._StartTicking2():this._StopTicking2()}_PopulateTweenMap(restoreJson,map,timelineManager){if(!restoreJson)return; +for(const property in restoreJson){let tweens=map.get(property);tweens?C3.clearArray(tweens):tweens=[];const tweensJson=restoreJson[property];for(const tweenJson of tweensJson){const success=this._PopulateTweenArray(tweens,tweenJson["name"],timelineManager);if(!success){const tween=C3.Tween.Build({runtime:this.GetRuntime(),json:tweenJson});tween.AddCompletedCallback(tween=>this._FinishTriggers(tween));timelineManager.AddScheduledTimeline(tween);this._PopulateTweenArray(tweens,tween,timelineManager)}else this._LoadTweenFromJson(tweenJson["name"], +tweenJson,timelineManager)}map.set(property,tweens)}}_GetTween(name,timelineManager){return timelineManager.GetScheduledOrPlayingTimelineByName(name)}_PopulateTweenArray(collection,tweenOrName,timelineManager){if(typeof tweenOrName==="string"){const tween=this._GetTween(tweenOrName,timelineManager);if(tween)return!!collection.push(tween)}else return!!collection.push(tweenOrName);return false}_LoadTweenFromJson(tweenOrName,tweenJson,timelineManager){if(typeof tweenOrName==="string"){const tween=this._GetTween(tweenOrName, +timelineManager);if(tween)tween._LoadFromJson(tweenJson)}else tweenOrName._LoadFromJson(tweenJson)}_SaveActiveTweensToJson(){const ret={};for(const [property,tweens]of this._activeTweens)ret[property]=tweens.map(tween=>tween._SaveToJson());return ret}_SaveDisabledTweensToJson(){return this._disabledTweens.map(tween=>tween.GetName())}_SaveWaitingForReleaseTweensToJson(){const ret={};for(const [property,tweens]of this._waitingForReleaseTweens)ret[property]=tweens.map(tween=>tween._SaveToJson());return ret}_SaveFinishingTweenToJson(){return this._finishingTween? +this._finishingTween.GetName():""}Tick2(){this._ReleaseWaitingTweens()}CreateTween(args){const propertyTracksConfig=NAMESPACE.Config.GetPropertyTracksConfig(args.property,args.startValue,args.endValue,args.ease,args.resultMode,this.GetObjectInstance());const tweenId=NAMESPACE.Maps.GetPropertyFromIndex(args.property);if(!NAMESPACE.Maps.IsValueId(tweenId))this.ReleaseTweens(args.property);const tween=C3.Tween.Build({runtime:this.GetRuntime(),id:tweenId,tags:args.tags,time:args.time,instance:this.GetObjectInstance(), +releaseOnComplete:!!args.releaseOnComplete,loop:!!args.loop,pingPong:!!args.pingPong,initialValueMode:args.initialValueMode,propertyTracksConfig:propertyTracksConfig});tween.AddCompletedCallback(tween=>this._FinishTriggers(tween));this._AddTween(tween,args.property);return tween}ReleaseTween(tween,complete=false){const id=tween.GetId();if(this._activeTweens.has(id)){const tweenArray=this._activeTweens.get(id);if(tweenArray){const index=tweenArray.indexOf(tween);if(index!==-1)tweenArray.splice(index, +1)}}if(tween.IsReleased())return;if(this._IsInWaitingList(tween))return;tween.Stop(complete);this._AddToWaitingList(tween)}ReleaseTweens(indexProperty,complete=false){if(C3.IsFiniteNumber(indexProperty)){const stringProperty=NAMESPACE.Maps.GetPropertyFromIndex(indexProperty);if(!this._activeTweens.has(stringProperty))return;const tweenArray=this._activeTweens.get(stringProperty);const finishingTween=this.GetFinishingTween();for(const tween of tweenArray){if(tween===finishingTween)continue;if(tween.IsReleased())continue; +if(this._IsInWaitingList(tween))continue;tween.Stop(complete);tween.Release()}C3.clearArray(tweenArray)}else{const finishingTween=this.GetFinishingTween();for(const tween of this.AllTweens()){if(tween===finishingTween)continue;if(tween.IsReleased())continue;if(this._IsInWaitingList(tween))continue;tween.Stop(complete);tween.Release()}for(const property of this._activeTweens.keys()){C3.clearArray(this._activeTweens.get(property));this._activeTweens.delete(property)}this._activeTweens.clear()}}ReleaseAndCompleteTween(tween){this.ReleaseTween(tween, +true)}ReleaseAndCompleteTweens(){this.ReleaseTweens(NaN,true)}GetPropertyValueByIndex(index){switch(index){case ENABLED:return this._enabled}}SetPropertyValueByIndex(index,value){switch(index){case ENABLED:this._enabled=!!value;break}}_GetBehaviorType(tween){const instance=tween.GetInstance();const behaviorInstances=instance.GetBehaviorInstances();for(const behaviorInstance of behaviorInstances){const behaviorType=behaviorInstance.GetBehaviorType();if(behaviorType.GetInstanceSdkCtor()===this.constructor)return behaviorType}}Trigger(method, +runtime,inst,behaviorType){if(this._runtime)return super.Trigger(method);else return runtime.Trigger(method,inst,behaviorType)}_FinishTriggers(tween){this._finishingTween=tween;NAMESPACE.Cnds.SetFinishingTween(tween);let instance;let runtime;if(!this.GetRuntime()){instance=tween.GetInstance();if(!instance)return;if(instance&&instance.IsDestroyed())return;runtime=instance.GetRuntime();const behaviorType=this._GetBehaviorType(tween);this.Trigger(NAMESPACE.Cnds.OnTweensFinished,runtime,instance,behaviorType); +this.Trigger(NAMESPACE.Cnds.OnAnyTweensFinished,runtime,instance,behaviorType);tween.Stop()}else{instance=this._inst;runtime=this._runtime;this.Trigger(NAMESPACE.Cnds.OnTweensFinished);this.Trigger(NAMESPACE.Cnds.OnAnyTweensFinished);this.ReleaseTween(tween)}this._finishingTween=null;NAMESPACE.Cnds.SetFinishingTween(null);if(tween.GetDestroyInstanceOnComplete())runtime.DestroyInstance(instance)}_AddTween(tween,indexProperty){const stringProperty=NAMESPACE.Maps.GetPropertyFromIndex(indexProperty); +if(!this._activeTweens.has(stringProperty))this._activeTweens.set(stringProperty,[]);const tweenArray=this._activeTweens.get(stringProperty);tweenArray.push(tween)}_AddToWaitingList(tween){const id=tween.GetId();if(!this._waitingForReleaseTweens.has(id))this._waitingForReleaseTweens.set(id,[]);this._waitingForReleaseTweens.get(id).push(tween)}_IsInWaitingList(tween){const id=tween.GetId();if(!this._waitingForReleaseTweens.has(id))return false;return this._waitingForReleaseTweens.get(id).includes(tween)}_ReleaseWaitingTweens(){if(!this._waitingForReleaseTweens.size)return; +for(const tweenArray of this._waitingForReleaseTweens.values()){for(const tween of tweenArray){if(tween.IsReleased())continue;tween.Release()}C3.clearArray(tweenArray)}this._waitingForReleaseTweens.clear()}}}; + + +'use strict';{const C3=self.C3;let finishingTween=null;C3.Behaviors.Tween.Cnds={SetFinishingTween(tween){finishingTween=tween},OnTweensFinished(tags){return finishingTween.HasTags(tags)},OnAnyTweensFinished(){return true},IsPlaying(tags){const tweens=[...this.GetTweensIncludingWaitingForRelease(tags)];if(!tweens)return false;if(!tweens.length)return false;return tweens.some(C3.Tween.IsPlaying)},IsAnyPlaying(){const tweens=[...this.AllTweensIncludingWaitingForRelease()];if(!tweens)return false;if(!tweens.length)return false; +return tweens.some(C3.Tween.IsPlaying)},IsPaused(tags){const tweens=[...this.GetTweensIncludingWaitingForRelease(tags)];if(!tweens)return false;if(!tweens.length)return false;return tweens.some(C3.Tween.IsPaused)},IsAnyPaused(){const tweens=[...this.AllTweensIncludingWaitingForRelease()];if(!tweens)return false;if(!tweens.length)return false;return tweens.some(C3.Tween.IsPaused)}}}; + + +'use strict';{const C3=self.C3;const Ease=self.Ease;const NAMESPACE=C3.Behaviors.Tween;NAMESPACE.Acts={SetEnabled(enable){this.SetEnabled(!!enable);for(const tween of this.AllTweens())if(!!enable){if(this.IsInDisabledList(tween))tween.Resume()}else{if(tween.IsPlaying()||tween.IsScheduled())this.AddToDisabledList(tween);tween.Stop()}if(enable)this.ClearDisabledList()},async TweenOneProperty(...args){if(!this.GetEnabled()||!this.IsInstanceValid())return;const tween=this.CreateTween(NAMESPACE.TweenArguments.OneProperty(this, +...args));if(tween.Play())await tween.GetPlayPromise()},async TweenTwoProperties(...args){if(!this.GetEnabled()||!this.IsInstanceValid())return;const tween=this.CreateTween(NAMESPACE.TweenArguments.TwoProperties(this,...args));if(tween.Play())await tween.GetPlayPromise()},async TweenValue(...args){if(!this.GetEnabled()||!this.IsInstanceValid())return;const tween=this.CreateTween(NAMESPACE.TweenArguments.ValueProperty(this,...args));if(tween.Play())await tween.GetPlayPromise()},PauseTweens(tags){if(!this.GetEnabled()|| +!this.IsInstanceValid())return;for(const tween of this.GetTweens(tags))tween.Stop()},PauseAllTweens(){if(!this.GetEnabled()||!this.IsInstanceValid())return;for(const tween of this.AllTweens())tween.Stop()},ResumeTweens(tags){if(!this.GetEnabled()||!this.IsInstanceValid())return;for(const tween of this.GetTweens(tags))tween.Resume()},ResumeAllTweens(){if(!this.GetEnabled()||!this.IsInstanceValid())return;for(const tween of this.AllTweens())tween.Resume()},StopTweens(tags){if(!this.GetEnabled()||!this.IsInstanceValid())return; +for(const tween of this.GetTweens(tags))this.ReleaseTween(tween)},StopAllTweens(){if(!this.GetEnabled()||!this.IsInstanceValid())return;for(const tween of this.AllTweens())this.ReleaseTween(tween)},SetOnePropertyTweensEndValue(tags,endValue,property){if(!this.GetEnabled()||!this.IsInstanceValid())return;for(const tween of this.GetTweens(tags)){tween.BeforeSetEndValues([property]);tween.SetEndValue(endValue,property)}},SetTwoPropertiesTweensEndValue(tags,property,endValueX,endValueY){if(!this.GetEnabled()|| +!this.IsInstanceValid())return;const properties=C3.Behaviors.Tween.Maps.GetRealProperties(property);for(const tween of this.GetTweens(tags)){tween.BeforeSetEndValues(properties);tween.SetEndValue(endValueX,properties[0]);tween.SetEndValue(endValueY,properties[1])}},SetValuePropertyTweensStartValue(tags,startValue){if(!this.GetEnabled()||!this.IsInstanceValid())return;for(const tween of this.GetTweens(tags,"value"))tween.SetStartValue(startValue,"value")},SetValuePropertyTweensEndValue(tags,endValue){if(!this.GetEnabled()|| +!this.IsInstanceValid())return;for(const tween of this.GetTweens(tags,"value")){tween.BeforeSetEndValues(["value"]);tween.SetEndValue(endValue,"value")}},SetTweensEase(tags,easeIndex){if(!this.GetEnabled()||!this.IsInstanceValid())return;const ease=Ease.GetEaseFromIndex(easeIndex);for(const tween of this.GetTweens(tags))tween.SetEase(ease)},SetAllTweensEase(easeIndex){if(!this.GetEnabled()||!this.IsInstanceValid())return;const ease=Ease.GetEaseFromIndex(easeIndex);for(const tween of this.AllTweens())tween.SetEase(ease)}, +SetTweensTime(tags,time){if(!this.GetEnabled()||!this.IsInstanceValid())return;for(const tween of this.GetTweens(tags))tween.SetTime(time)},SetAllTweensTime(time){if(!this.GetEnabled()||!this.IsInstanceValid())return;for(const tween of this.AllTweens())tween.SetTime(time)},SetTweensPlaybackRate(tags,rate){if(!this.GetEnabled()||!this.IsInstanceValid())return;for(const tween of this.GetTweens(tags))tween.SetPlaybackRate(rate)},SetAllTweensPlaybackRate(rate){if(!this.GetEnabled()||!this.IsInstanceValid())return; +for(const tween of this.AllTweens())tween.SetPlaybackRate(rate)},SetTweensDestroyOnComplete(tags,destroyOnComplete){if(!this.GetEnabled()||!this.IsInstanceValid())return;for(const tween of this.GetTweens(tags))tween.SetDestroyInstanceOnComplete(!!destroyOnComplete)},SetAllTweensDestroyOnComplete(destroyOnComplete){if(!this.GetEnabled()||!this.IsInstanceValid())return;for(const tween of this.AllTweens())tween.SetDestroyInstanceOnComplete(!!destroyOnComplete)}}}; + + +'use strict';{const C3=self.C3;C3.Behaviors.Tween.Exps={Time(tags){const tween=this.GetTweenIncludingWaitingForRelease(tags);if(!tween)return 0;return tween.GetTime()},Progress(tags){const tween=this.GetTweenIncludingWaitingForRelease(tags);if(!tween)return 0;return tween.GetTime()/tween.GetTotalTime()},Value(tags){const tween=this.GetTweenIncludingWaitingForRelease(tags,"value");if(!tween)return 0;return tween.GetPropertyTrack("value").GetSourceAdapterValue()},Tags(){if(!this.GetFinishingTween())return""; +return this.GetFinishingTween().GetStringTags()}}}; + + +'use strict';{const C3=self.C3;const Ease=self.Ease;const PAIR_PROPERTIES=["position","size","scale"];const SINGLE_PROPERTIES=["offsetX","offsetY","offsetWidth","offsetHeight","offsetAngle","offsetOpacity","offsetColor","offsetZElevation","offsetScaleX","offsetScaleY"];const VALUE_PROPERTIES=["value"];const PROPERTY_INDEX_TO_NAME=[].concat(PAIR_PROPERTIES).concat(SINGLE_PROPERTIES).concat(VALUE_PROPERTIES);const PROPERTY_PAIR_TO_REAL_PROPERTIES={"position":["offsetX","offsetY"],"size":["offsetWidth", +"offsetHeight"],"scale":["offsetScaleX","offsetScaleY"]};const ALL_REAL_PROPERTIES=Object.assign({},PROPERTY_INDEX_TO_NAME.reduce((o,key)=>Object.assign({},o,{[key]:[key]}),{}),PROPERTY_PAIR_TO_REAL_PROPERTIES);C3.Behaviors.Tween.Maps=class Maps{constructor(){}static GetEases(){return[...Ease.GetRuntimeEaseNames()]}static GetEaseFromIndex(index){return[...Ease.GetRuntimeEaseNames()][index]}static GetPropertyFromIndex(index){return PROPERTY_INDEX_TO_NAME[index]}static GetPropertyIndexFromName(name){return PROPERTY_INDEX_TO_NAME.indexOf(name)}static GetPairPropertyFromIndex(index){return PAIR_PROPERTIES[index]}static GetSinglePropertyFromIndex(index){return SINGLE_PROPERTIES[index]}static GetValuePropertyFromIndex(index){return VALUE_PROPERTIES[index]}static GetPairProperties(pairId){return PROPERTY_PAIR_TO_REAL_PROPERTIES[pairId]}static GetRealProperties(id){if(C3.IsString(id))return ALL_REAL_PROPERTIES[id]; +else return ALL_REAL_PROPERTIES[PROPERTY_INDEX_TO_NAME[id]]}static IsPairId(id){return!!PROPERTY_PAIR_TO_REAL_PROPERTIES[id]}static IsColorId(id){return id==="offsetColor"}static IsAngleId(id){return id==="offsetAngle"}static IsOpacityId(id){return id==="offsetOpacity"}static IsValueId(id){return id==="value"}}}; + + +'use strict';{const C3=self.C3;const NAMESPACE=C3.Behaviors.Tween;const TWEEN_CONFIGURATIONS=new Map;NAMESPACE.Config=class Config{constructor(){}static GetPropertyTracksConfig(property,startValue,endValue,ease,resultMode,instance){if(TWEEN_CONFIGURATIONS.size===0)this._CreateConfigObjects();const propertyType=NAMESPACE.PropertyTypes.Pick(property);let config=TWEEN_CONFIGURATIONS.get(propertyType);if(C3.IsFiniteNumber(property))property=NAMESPACE.Maps.GetPropertyFromIndex(property);return this._GetConfig(config, +property,startValue,endValue,ease,resultMode,instance)}static TransformValue(property,value){const configFunctionObject=C3.Behaviors.Tween.GetPropertyTracksConfig(property);return configFunctionObject.valueGetter(value)}static _CreateConfigObjects(){const types=NAMESPACE.PropertyTypes;const getters=NAMESPACE.ValueGetters;this._AddConfigObject(types.PAIR,this._GetPairConfig,getters._GetPropertyValue);this._AddConfigObject(types.COLOR,this._GetColorConfig,getters._GetColorPropertyValue);this._AddConfigObject(types.ANGLE, +this._GetAngleConfig,getters._GetPropertyAngleValue);this._AddConfigObject(types.VALUE,this._GetValueConfig,getters._GetPropertyValue);this._AddConfigObject(types.OTHER,this._GetCommonConfig,getters._GetPropertyValue)}static _AddConfigObject(name,configGetter,valueGetter){TWEEN_CONFIGURATIONS.set(name,this._CreateConfigObject(name,configGetter,valueGetter))}static _CreateConfigObject(name,configFunc,valueGetter){return{name:name,configFunc:configFunc,valueGetter:valueGetter}}static _GetConfig(config, +property,startValue,endValue,ease,resultMode,instance){return config.configFunc(property,config.valueGetter(startValue),config.valueGetter(endValue),ease,resultMode,instance)}static _GetPairConfig(property,startValues,endValues,ease,resultMode,instance){const properties=NAMESPACE.Maps.GetPairProperties(property);return properties.map((property,index)=>{return{sourceId:"world-instance",property:property,type:"float",valueType:"numeric",startValue:startValues[index],endValue:endValues[index],ease:NAMESPACE.Maps.GetEaseFromIndex(ease), +resultMode:resultMode}})}static _GetColorConfig(property,startValue,endValue,ease,resultMode,instance){if(C3.Plugins.Text&&instance.GetPlugin()instanceof C3.Plugins.Text)return{sourceId:"plugin",sourceArgs:[7],property:"color",type:"color",valueType:"color",startValue:startValue,endValue:endValue,ease:NAMESPACE.Maps.GetEaseFromIndex(ease),resultMode:resultMode};else return{sourceId:"world-instance",property:property,type:"color",valueType:"color",startValue:startValue,endValue:endValue,ease:NAMESPACE.Maps.GetEaseFromIndex(ease), +resultMode:resultMode}}static _GetAngleConfig(property,startValue,endValue,ease,resultMode,instance){return{sourceId:"world-instance",property:property,type:"angle",valueType:"angle",startValue:startValue,endValue:endValue,ease:NAMESPACE.Maps.GetEaseFromIndex(ease),resultMode:resultMode}}static _GetCommonConfig(property,startValue,endValue,ease,resultMode,instance){return{sourceId:"world-instance",property:property,type:"float",valueType:"numeric",startValue:startValue,endValue:endValue,ease:NAMESPACE.Maps.GetEaseFromIndex(ease), +resultMode:resultMode}}static _GetValueConfig(property,startValue,endValue,ease,resultMode,instance){return{sourceId:"value",property:property,type:"float",valueType:"numeric",startValue:startValue,endValue:endValue,ease:NAMESPACE.Maps.GetEaseFromIndex(ease),resultMode:resultMode}}}}; + + +'use strict';{const C3=self.C3;const NAMESPACE=C3.Behaviors.Tween;const COMMON_FIXED_ARGS={resultMode:"absolute"};const COMMON_VARIABLE_ARGS=Object.assign({},COMMON_FIXED_ARGS,{tags:"",property:"",time:0,ease:0,releaseOnComplete:0,loop:false,pingPong:false});const ONE_PROPERTY_ARGS=Object.assign({},COMMON_VARIABLE_ARGS,{initialValueMode:"current-state",startValue:0,endValue:0});const TWO_PROPERTIES_ARGS=Object.assign({},COMMON_VARIABLE_ARGS,{initialValueMode:"current-state",startValue:[0,0],endValue:[0, +0]});const COLOR_PROPERTY_ARGS=Object.assign({},COMMON_VARIABLE_ARGS,{initialValueMode:"current-state",startValue:[0,0,0],endValue:[0,0,0]});const VALUE_PROPERTY_ARGS=Object.assign({},ONE_PROPERTY_ARGS,{initialValueMode:"start-value"});const X=0;const Y=1;const R=0;const G=1;const B=2;NAMESPACE.TweenArguments=class TweenArguments{constructor(){}static _SetCommonProperties(argsObject,tags,time,ease,destroyOnComplete,loop,pingPong){argsObject.tags=tags;argsObject.time=time;argsObject.ease=ease;argsObject.releaseOnComplete= +destroyOnComplete;argsObject.loop=loop;argsObject.pingPong=pingPong}static OneProperty(inst,tags,property,endValue,time,ease,destroyOnComplete,loop,pingPong){const propertyName=NAMESPACE.Maps.GetSinglePropertyFromIndex(property);const args=NAMESPACE.Maps.IsColorId(propertyName)?COLOR_PROPERTY_ARGS:ONE_PROPERTY_ARGS;this._SetCommonProperties(args,tags,time,ease,destroyOnComplete,loop,pingPong);if(NAMESPACE.Maps.IsColorId(propertyName)){COLOR_PROPERTY_ARGS.endValue[R]=C3.GetRValue(endValue);COLOR_PROPERTY_ARGS.endValue[G]= +C3.GetGValue(endValue);COLOR_PROPERTY_ARGS.endValue[B]=C3.GetBValue(endValue);COLOR_PROPERTY_ARGS.property=NAMESPACE.Maps.GetPropertyIndexFromName(propertyName)}else if(NAMESPACE.Maps.IsOpacityId(propertyName))ONE_PROPERTY_ARGS.endValue=endValue/100;else ONE_PROPERTY_ARGS.endValue=endValue;args.property=NAMESPACE.Maps.GetPropertyIndexFromName(propertyName);return args}static TwoProperties(inst,tags,property,endValueX,endValueY,time,ease,destroyOnComplete,loop,pingPong){this._SetCommonProperties(TWO_PROPERTIES_ARGS, +tags,time,ease,destroyOnComplete,loop,pingPong);const pairName=NAMESPACE.Maps.GetPairPropertyFromIndex(property);TWO_PROPERTIES_ARGS.endValue[X]=endValueX;TWO_PROPERTIES_ARGS.endValue[Y]=endValueY;TWO_PROPERTIES_ARGS.property=NAMESPACE.Maps.GetPropertyIndexFromName(pairName);return TWO_PROPERTIES_ARGS}static ValueProperty(inst,tags,startValue,endValue,time,ease,destroyOnComplete,loop,pingPong){this._SetCommonProperties(VALUE_PROPERTY_ARGS,tags,time,ease,destroyOnComplete,loop,pingPong);VALUE_PROPERTY_ARGS.startValue= +startValue;VALUE_PROPERTY_ARGS.endValue=endValue;VALUE_PROPERTY_ARGS.property=NAMESPACE.Maps.GetPropertyIndexFromName("value");return VALUE_PROPERTY_ARGS}}}; + + +'use strict';{const C3=self.C3;const NAMESPACE=C3.Behaviors.Tween;const TYPE_CHECK_OBJECTS=[];NAMESPACE.PropertyTypes=class PropertyTypes{constructor(){}static Pick(property){if(TYPE_CHECK_OBJECTS.length===0){const arr=TYPE_CHECK_OBJECTS;arr.push({checkFunc:NAMESPACE.Maps.IsPairId,result:this.PAIR});arr.push({checkFunc:NAMESPACE.Maps.IsColorId,result:this.COLOR});arr.push({checkFunc:NAMESPACE.Maps.IsAngleId,result:this.ANGLE});arr.push({checkFunc:NAMESPACE.Maps.IsValueId,result:this.VALUE});arr.push({checkFunc:()=> +true,result:this.OTHER})}if(C3.IsFiniteNumber(property))property=C3.Behaviors.Tween.Maps.GetPropertyFromIndex(property);for(const propertyTypeFunctionObject of TYPE_CHECK_OBJECTS)if(propertyTypeFunctionObject.checkFunc(property))return propertyTypeFunctionObject.result}static get PAIR(){return"pair"}static get COLOR(){return"color"}static get ANGLE(){return"angle"}static get VALUE(){return"value"}static get OTHER(){return"other"}}}; + + +'use strict';{const C3=self.C3;const NAMESPACE=C3.Behaviors.Tween;NAMESPACE.ValueGetters=class ValueGetters{constructor(){}static _GetPropertyAngleValue(value){const r=C3.toRadians(parseFloat(value));return C3.clampAngle(r)}static _GetColorPropertyValue(value){return value.slice(0)}static _GetPropertyValue(value){return value}}}; + + + +{ + const C3 = self.C3; + self.C3_GetObjectRefTable = function () { + return [ + C3.Plugins.Keyboard, + C3.Plugins.Audio, + C3.Plugins.Function, + C3.Plugins.Browser, + C3.Plugins.Sprite, + C3.Behaviors.Sin, + C3.Plugins.TiledBg, + C3.Behaviors.solid, + C3.Behaviors.Pin, + C3.Behaviors.Platform, + C3.Behaviors.scrollto, + C3.Behaviors.bound, + C3.Plugins.Text, + C3.Plugins.Spritefont2, + C3.Behaviors.Physics, + C3.Behaviors.MoveTo, + C3.Behaviors.Rex_MoveTo, + C3.Behaviors.Bullet, + C3.Behaviors.Fade, + C3.Behaviors.Tween, + C3.Plugins.Touch, + C3.Plugins.Mouse, + C3.Plugins.PlatformInfo, + C3.Plugins.System.Cnds.OnLayoutStart, + C3.Plugins.System.Acts.SetVar, + C3.Plugins.Function.Acts.CallFunction, + C3.Plugins.Sprite.Acts.MoveToBottom, + C3.Plugins.System.Acts.SetTimescale, + C3.Plugins.Audio.Cnds.IsTagPlaying, + C3.Plugins.System.Cnds.IsOnPlatform, + C3.Plugins.Text.Cnds.PickByUID, + C3.Plugins.Text.Acts.SetText, + C3.Plugins.System.Cnds.CompareVar, + C3.Plugins.Text.Acts.SetVisible, + C3.Plugins.System.Acts.Wait, + C3.Plugins.System.Cnds.Every, + C3.Plugins.System.Acts.SubVar, + C3.Plugins.System.Cnds.TriggerOnce, + C3.Plugins.Spritefont2.Acts.SetText, + C3.Plugins.Spritefont2.Acts.SetVisible, + C3.Plugins.System.Cnds.IsGroupActive, + C3.Plugins.Sprite.Cnds.IsOnScreen, + C3.Plugins.Sprite.Acts.SetPosToObject, + C3.Plugins.Sprite.Acts.SetPos, + C3.Plugins.Sprite.Exps.X, + C3.Plugins.Sprite.Exps.Y, + C3.Plugins.Sprite.Cnds.CompareInstanceVar, + C3.Plugins.Sprite.Acts.SetInstanceVar, + C3.Plugins.Sprite.Cnds.CompareWidth, + C3.Plugins.Sprite.Acts.SetWidth, + C3.Plugins.Sprite.Acts.SetAnim, + C3.Behaviors.Platform.Cnds.IsOnFloor, + C3.Behaviors.Platform.Acts.SetMaxSpeed, + C3.Plugins.Sprite.Cnds.IsBoolInstanceVarSet, + C3.Plugins.System.Cnds.Else, + C3.Plugins.Keyboard.Cnds.IsKeyDown, + C3.Plugins.Sprite.Cnds.IsMirrored, + C3.Plugins.Sprite.Cnds.IsAnimPlaying, + C3.Plugins.System.Cnds.Compare, + C3.Behaviors.Platform.Acts.SetVectorX, + C3.Plugins.Sprite.Cnds.OnAnimFinished, + C3.Plugins.Sprite.Cnds.IsOverlapping, + C3.Behaviors.Platform.Acts.SimulateControl, + C3.Plugins.Touch.Cnds.IsTouchingObject, + C3.Plugins.Touch.Cnds.OnTouchObject, + C3.Plugins.Keyboard.Cnds.OnKey, + C3.Plugins.Sprite.Acts.SetAnimFrame, + C3.Plugins.Sprite.Cnds.CompareX, + C3.Plugins.Sprite.Acts.Destroy, + C3.Plugins.Sprite.Acts.SubInstanceVar, + C3.Plugins.System.Acts.AddVar, + C3.Plugins.Audio.Acts.Play, + C3.Behaviors.Tween.Acts.TweenTwoProperties, + C3.Behaviors.Platform.Acts.SetVectorY, + C3.Plugins.Sprite.Acts.SetBoolInstanceVar, + C3.Plugins.Sprite.Acts.MoveToTop, + C3.Behaviors.Platform.Cnds.OnLand, + C3.Plugins.System.Exps.choose, + C3.Plugins.Audio.Acts.PlayByName, + C3.Plugins.Function.Cnds.OnFunction, + C3.Plugins.Sprite.Acts.Spawn, + C3.Plugins.Sprite.Acts.SetMirrored, + C3.Plugins.Sprite.Exps.Width, + C3.Plugins.Sprite.Acts.SetHeight, + C3.Plugins.Sprite.Exps.Height, + C3.Behaviors.Pin.Acts.Pin, + C3.Plugins.Sprite.Cnds.CompareFrame, + C3.Plugins.Sprite.Cnds.OnCollision, + C3.Plugins.Sprite.Acts.SetX, + C3.Plugins.System.Exps.dt, + C3.Plugins.System.Exps.viewportright, + C3.Plugins.System.Exps.viewportleft, + C3.Plugins.System.Acts.GoToLayout, + C3.Plugins.System.Acts.RestartLayout, + C3.Plugins.Function.Cnds.CompareParam, + C3.Plugins.System.Acts.CreateObject, + C3.Plugins.Function.Exps.Param, + C3.Plugins.Sprite.Cnds.OnCreated, + C3.Plugins.Sprite.Acts.SetEffectParam, + C3.Plugins.System.Exps.random, + C3.Plugins.Sprite.Acts.StopAnim, + C3.Plugins.Sprite.Acts.SetSize, + C3.Plugins.System.Cnds.EveryTick, + C3.Behaviors.MoveTo.Acts.MoveToPosition, + C3.Behaviors.Bullet.Acts.SetAngleOfMotion, + C3.Behaviors.Bullet.Acts.SetSpeed, + C3.Plugins.Sprite.Acts.SetOpacity, + C3.Behaviors.Fade.Acts.SetFadeOutTime, + C3.Plugins.Sprite.Acts.SetScale, + C3.Plugins.System.Cnds.Repeat, + C3.Plugins.Sprite.Acts.SetAngle, + C3.Behaviors.Bullet.Acts.SetGravity, + C3.Plugins.Sprite.Acts.SetVisible, + C3.Plugins.PlatformInfo.Cnds.IsOnMobile, + C3.Plugins.Keyboard.Cnds.IsKeyCodeDown, + C3.Plugins.Browser.Cnds.IsFullscreen, + C3.Plugins.Browser.Acts.RequestFullScreen, + C3.Plugins.Browser.Acts.CancelFullScreen, + C3.Behaviors.Platform.Cnds.IsFalling, + C3.Plugins.System.Acts.ResetGlobals, + C3.Plugins.Spritefont2.Acts.SetOpacity, + C3.Plugins.TiledBg.Cnds.CompareInstanceVar, + C3.Plugins.TiledBg.Acts.SubInstanceVar, + C3.Plugins.TiledBg.Acts.AddInstanceVar, + C3.Plugins.Browser.Acts.Close, + C3.Plugins.Browser.Acts.GoToURLWindow, + C3.Plugins.Mouse.Cnds.IsOverObject, + C3.Plugins.Mouse.Acts.SetCursor, + C3.Plugins.Mouse.Exps.X, + C3.Plugins.Mouse.Exps.Y, + C3.Plugins.TiledBg.Acts.SetBoolInstanceVar, + C3.Plugins.System.Exps.int, + C3.Plugins.System.Exps.tokenat, + C3.Plugins.Spritefont2.Cnds.PickByUID, + C3.Plugins.TiledBg.Cnds.IsBoolInstanceVarSet, + C3.Plugins.Sprite.Cnds.PickByUID + ]; + }; + self.C3_JsPropNameTable = [ + {Keyboard: 0}, + {Audio: 0}, + {Function: 0}, + {Browser: 0}, + {Sine: 0}, + {cenario: 0}, + {Solid: 0}, + {colisorChao: 0}, + {TiledBackground: 0}, + {TiledBackground2: 0}, + {Pin: 0}, + {caixaColisaoP1: 0}, + {caixaColisaoP2: 0}, + {caixaDanoP1: 0}, + {caixaDanoP2: 0}, + {defesaEfeito: 0}, + {damageEfeito: 0}, + {sombra1: 0}, + {sombra2: 0}, + {P1Char1: 0}, + {movimento: 0}, + {dano: 0}, + {energia: 0}, + {energiaMaxima: 0}, + {defesa: 0}, + {win: 0}, + {Platform: 0}, + {ScrollTo: 0}, + {BoundToLayout: 0}, + {almaP1: 0}, + {AI_Direita: 0}, + {AI_Esquerda: 0}, + {AI_Pulo: 0}, + {AI_Soco: 0}, + {AI_Chute: 0}, + {almaP2: 0}, + {P2Char3: 0}, + {P1Char2: 0}, + {P2Char4: 0}, + {P1Char3: 0}, + {P1Char4: 0}, + {P2Char1: 0}, + {P2Char2: 0}, + {Foto: 0}, + {ko: 0}, + {nome: 0}, + {barraP1: 0}, + {barraP2: 0}, + {barraLifeFundo: 0}, + {txtP1: 0}, + {txtRound: 0}, + {winP1: 0}, + {winP2: 0}, + {tKick: 0}, + {tLeft: 0}, + {tRight: 0}, + {tPunch: 0}, + {tUP: 0}, + {id: 0}, + {txtMenu: 0}, + {p2id: 0}, + {p1Escolhido: 0}, + {p2Escolhido: 0}, + {menuFundo: 0}, + {spriteSelect: 0}, + {txtMenuInfo: 0}, + {playbg: 0}, + {Sprite: 0}, + {bggg: 0}, + {Sprite2: 0}, + {Physics: 0}, + {zem: 0}, + {MoveTo: 0}, + {MoveTo2: 0}, + {sun: 0}, + {Sprite3: 0}, + {Sprite4: 0}, + {light: 0}, + {sun2: 0}, + {light2: 0}, + {Bullet: 0}, + {Fade: 0}, + {som1: 0}, + {som2: 0}, + {Sprite5: 0}, + {Sprite6: 0}, + {Sprite7: 0}, + {Sprite8: 0}, + {Tween: 0}, + {Sprite9: 0}, + {Untitled2_0027_Layer1copy: 0}, + {Untitled2_0028_Layer1copy: 0}, + {Untitled2_0029_Layer3copy: 0}, + {Untitled2_0030_Layer: 0}, + {Untitled2_0006_Layer: 0}, + {Untitled2_0005_2p: 0}, + {Untitled2_0004_1p: 0}, + {Untitled2_0003_Layer: 0}, + {Touch: 0}, + {Sprite10: 0}, + {Untitled2_0005_Layer: 0}, + {Untitled2_0004_Group6copy: 0}, + {roundtext: 0}, + {fighttext: 0}, + {Untitled2_0008_bluewins: 0}, + {Untitled2_0003_Layer2: 0}, + {Untitled2_0007_oangewins: 0}, + {Sprite11: 0}, + {Untitled2_0003_Layer3: 0}, + {Mouse: 0}, + {Sprite12: 0}, + {Sprite13: 0}, + {game_bg: 0}, + {introtwporg: 0}, + {play_intro_btn: 0}, + {PlatformInfo: 0}, + {Sprite14: 0}, + {Sprite15: 0}, + {P1: 0}, + {P2: 0}, + {HUDTouch: 0}, + {bgeffect: 0}, + {tweeen: 0}, + {button: 0}, + {FX: 0}, + {music: 0}, + {P1Select: 0}, + {P2Select: 0}, + {distPersonagens: 0}, + {numeroRound: 0}, + {roundP1: 0}, + {roundP2: 0}, + {roundTime: 0}, + {golpesExtras: 0}, + {limiteEsquerda: 0}, + {limiteDireita: 0}, + {InteligenciaArtificial: 0} + ]; +} + +"use strict"; + +{ + const C3 = self.C3; + + function unaryminus(n) + { + return (typeof n === "number" ? -n : n); + } + + function bothNumbers(a, b) + { + return typeof a === "number" && typeof b === "number"; + } + + function add(l, r) + { + if (bothNumbers(l, r)) + return l + r; + else + return l; + } + + function subtract(l, r) + { + if (bothNumbers(l, r)) + return l - r; + else + return l; + } + + function multiply(l, r) + { + if (bothNumbers(l, r)) + return l * r; + else + return l; + } + + function divide(l, r) + { + if (bothNumbers(l, r)) + return l / r; + else + return l; + } + + function mod(l, r) + { + if (bothNumbers(l, r)) + return l % r; + else + return l; + } + + function pow(l, r) + { + if (bothNumbers(l, r)) + return Math.pow(l, r); + else + return l; + } + + function and(l, r) + { + if (typeof l === "string" || typeof r === "string") + { + // & with either side string does string concatenation + let lstr, rstr; + + if (typeof l === "number") + lstr = (Math.round(l * 1e10) / 1e10).toString(); + else + lstr = l; + + if (typeof r === "number") + rstr = (Math.round(r * 1e10) / 1e10).toString(); + else + rstr = r; + + return lstr + rstr; + } + else + { + // & with neither side a string does logical AND + return (l && r ? 1 : 0); + } + } + + function or(l, r) + { + if (bothNumbers(l, r)) + return (l || r ? 1 : 0); + else + return l; + } + + self.C3_ExpressionFuncs = [ + () => 4, + () => 1, + () => "CriarPersonagemP1", + p => { + const v0 = p._GetNode(0).GetVar(); + return () => v0.GetValue(); + }, + () => "CriarPersonagemP2", + () => "desenhaHUD", + () => "music", + () => 30, + () => "Moviment WAS\nPunch = Y\nKick U", + () => 31, + () => "Moviment Arrows\nPunch = nun1\nKick nun2", + () => 5, + () => 0, + () => 2, + () => "Fight", + () => "EventosEmLooping", + p => { + const n0 = p._GetNode(0); + return () => n0.ExpObject(); + }, + () => 150, + () => "morrendo", + () => "Jogador1", + p => { + const n0 = p._GetNode(0); + return () => ((((n0.ExpInstVar()) > (0) ? 1 : 0)) ? (120) : (220)); + }, + () => "parado", + () => "esquerda", + () => "andarFrente", + p => { + const n0 = p._GetNode(0); + const n1 = p._GetNode(1); + return () => ((((n0.ExpObject()) < (n1.ExpObject()) ? 1 : 0)) ? ("andarTraz") : ("andarFrente")); + }, + () => "direita", + p => { + const n0 = p._GetNode(0); + const n1 = p._GetNode(1); + return () => ((((n0.ExpObject()) < (n1.ExpObject()) ? 1 : 0)) ? ("andarFrente") : ("andarTraz")); + }, + () => "socoForte", + () => "chute", + () => "abaixar", + () => "AereoSoco", + () => "AereoSocoDiagonal", + () => "AereoChute", + () => "AereoChuteReto", + () => "socoAbaixado", + () => "Rasteira", + p => { + const n0 = p._GetNode(0); + return () => (n0.ExpObject() + 135); + }, + () => "defesa", + () => 0.2, + p => { + const n0 = p._GetNode(0); + return () => (n0.ExpObject() - 135); + }, + () => "danoAbaixado", + () => "puloEsquerda", + () => "puloDireita", + () => "dano", + () => 100, + () => "danoEmPe", + () => "morte", + () => "", + () => 0.5, + () => "win", + () => 80, + () => 35, + () => 0.3, + () => "Win", + () => "verificaRound", + p => { + const n0 = p._GetNode(0); + return () => ((((n0.ExpInstVar()) > (0) ? 1 : 0)) ? (150) : (220)); + }, + () => "puloReto", + () => "golpeAereoEsquerda", + () => "golpeAereoDireita", + () => "socoAereoReto", + () => "chuteAereoReto", + () => -200, + () => 0.05, + () => "danoAereo", + () => 0.1, + () => "RodarFX", + () => "socoVento", + () => "chuteVento", + () => "Jogador2", + p => { + const n0 = p._GetNode(0); + const n1 = p._GetNode(1); + return () => ((((n0.ExpObject()) > (n1.ExpObject()) ? 1 : 0)) ? ("andarTraz") : ("andarFrente")); + }, + p => { + const n0 = p._GetNode(0); + const n1 = p._GetNode(1); + return () => ((((n0.ExpObject()) > (n1.ExpObject()) ? 1 : 0)) ? ("andarFrente") : ("andarTraz")); + }, + () => "rasteira", + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0.6, 0.9); + }, + () => "AtivarMovimento", + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(2, 2, 2, 3, 3, 3); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0("punch1", "punch2", "punch3", "punch4", "punch5", "punch6", "punch7", "punch8", "punch9", "punch10", "punch11", "punch12"); + }, + () => "ColisoresP1", + () => "colisoresP1", + () => "efeitos", + p => { + const n0 = p._GetNode(0); + return () => (n0.ExpObject() * 3); + }, + p => { + const n0 = p._GetNode(0); + return () => (n0.ExpObject() * 1.5); + }, + p => { + const n0 = p._GetNode(0); + return () => (n0.ExpObject() * 2); + }, + () => "andarTraz", + p => { + const n0 = p._GetNode(0); + const f1 = p._GetNode(1).GetBoundMethod(); + return () => (n0.ExpObject() - (f1() * 120)); + }, + p => { + const n0 = p._GetNode(0); + const f1 = p._GetNode(1).GetBoundMethod(); + return () => (n0.ExpObject() + (f1() * 120)); + }, + () => "ColisoresP2", + () => "colisoresP2", + () => "PosicaoCamera", + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + const v1 = p._GetNode(1).GetVar(); + return () => (f0("gameplay") - v1.GetValue()); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + const v1 = p._GetNode(1).GetVar(); + return () => (f0("gameplay") + v1.GetValue()); + }, + () => "EspelhandoPersonagens", + () => "Funcoes", + p => { + const n0 = p._GetNode(0); + const n1 = p._GetNode(1); + return () => ((115 / n0.ExpInstVar()) * n1.ExpInstVar()); + }, + () => "gameplay", + () => 3, + () => "RodarMusica", + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0); + }, + () => "fx", + () => "AdjustHSL2", + () => 120, + () => "Default", + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0, 99); + }, + () => "AdjustHSL", + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0, 4); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0.01, 0.1); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0, 2); + }, + p => { + const n0 = p._GetNode(0); + const f1 = p._GetNode(1).GetBoundMethod(); + return () => (n0.ExpObject() - f1((-30), 30)); + }, + () => 270, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(50, 100); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(5, 20); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0.5, 1); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0.1, 0.3); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(15, 22); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0, 360); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(50, 200); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(100, 1000); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0.3, 1.3); + }, + () => -15, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0("jump1", "jump2", "jump3", "jump4", "jump5"); + }, + () => -21, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0("attack1", "attack2", "attack3", "attack4"); + }, + () => 18, + () => "debug", + () => "AI_Debug", + () => "CPU_AI", + p => { + const n0 = p._GetNode(0); + return () => (n0.ExpObject() + 70); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(2, 3, 3, 3); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0, 0, 0, 0, 1, 1, 1, 1, 2, 3); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(2, 2, 2, 2, 2, 3, 3, 3, 4, 4); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4); + }, + p => { + const n0 = p._GetNode(0); + return () => (n0.ExpObject() - 70); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(2, 2, 2, 3); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(2, 2, 2, 2, 2, 3, 3, 3, 3, 3); + }, + p => { + const n0 = p._GetNode(0); + return () => (n0.ExpObject() + 220); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0.3, 0.6); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0, 0, 1, 1, 1, 2, 3); + }, + () => "menu", + () => "W or S vertical movimment\n\nEnter to Confirm option", + () => 154, + () => 180, + () => 266, + () => 210, + () => 200, + p => { + const n0 = p._GetNode(0); + const n1 = p._GetNode(1); + return () => ((((n0.ExpInstVar()) === (n1.ExpInstVar()) ? 1 : 0)) ? (100) : (60)); + }, + p => { + const n0 = p._GetNode(0); + return () => ((((n0.ExpInstVar()) === (0) ? 1 : 0)) ? (1) : (0)); + }, + () => "https://www.twoplayergames.org/?utm_source=Html5Game&utm_medium=Shadow_Fight", + () => "More_Games", + () => 0.0001, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(); + }, + () => "select", + () => 62, + () => "Player 1\nA or S\n\nConfirm character: Y", + () => 63, + () => "Player 2\nLeft Arrow or Right Arrow\n\nConfirm character: Nun1", + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + const f1 = p._GetNode(1).GetBoundMethod(); + const n2 = p._GetNode(2); + return () => f0(f1("150,184,218,252", n2.ExpInstVar(), ",")); + }, + () => 64, + p => { + const v0 = p._GetNode(0).GetVar(); + return () => and((("Player 1" + "\n") + "Character "), (v0.GetValue() + 1)); + }, + () => 65, + p => { + const v0 = p._GetNode(0).GetVar(); + return () => and((("Player 2" + "\n") + "Character "), (v0.GetValue() + 1)); + }, + p => { + const n0 = p._GetNode(0); + return () => n0.ExpInstVar(); + }, + () => 52, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(1, 2, 3); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0, 2, 3); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0, 1, 3); + }, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0, 1, 2); + }, + () => 53, + p => { + const f0 = p._GetNode(0).GetBoundMethod(); + return () => f0(0, 10); + }, + () => "sound", + () => 0.4 + ]; +} + + diff --git a/games/shadow-fight/scripts/dispatchworker.js b/games/shadow-fight/scripts/dispatchworker.js new file mode 100644 index 00000000..ff5fbed9 --- /dev/null +++ b/games/shadow-fight/scripts/dispatchworker.js @@ -0,0 +1,10 @@ +'use strict';self.inputPort=null;self.jobQueue=[];self.jobWorkers=[];self.sentBlobs=[];self.sentBuffers=[];self.importedScripts=[];self.lastBroadcasts=new Map; +class JobWorker{constructor(port,number){this._port=port;this._number=number;this._isReady=false;this._isBusy=false;this._port.onmessage=e=>this._OnMessage(e.data)}ImportScripts(scripts){this._port.postMessage({"type":"_import_scripts","scripts":scripts})}SendBlob(blob,id){this._port.postMessage({"type":"_send_blob","blob":blob,"id":id})}SendBuffer(buffer,id){this._port.postMessage({"type":"_send_buffer","buffer":buffer,"id":id})}SendJob(job){if(this._isBusy||!this._isReady)throw new Error("cannot take job"); +this._isBusy=true;this._port.postMessage(job,job["transferables"])}_InitBroadcast(job){this._port.postMessage(job,job["transferables"])}SendReady(){this._port.postMessage({"type":"_ready"})}IsReady(){return this._isReady}_OnReady(){this._isReady=true;this.MaybeStartNextJob()}IsBusy(){return this._isBusy}GetNumber(){return this._number}_OnMessage(msg){const type=msg["type"];switch(type){case "ready":this._OnReady();return;case "done":this._OnJobDone();return;default:console.error("unknown message from worker '"+ +type+"'");return}}_OnJobDone(){this._isBusy=false;this.MaybeStartNextJob()}MaybeStartNextJob(){if(this._isBusy||!this._isReady)return;const i=this._FindAvailableJob();if(i===-1)return;const job=self.jobQueue[i];const isBroadcast=job["isBroadcast"];if(isBroadcast){job["doneFlags"][this._number]=true;if(job["doneFlags"].every(x=>x))self.jobQueue.splice(i,1)}else self.jobQueue.splice(i,1);this.SendJob(job)}_FindAvailableJob(){for(let i=0,len=self.jobQueue.length;i{const msg=e.data;const type=msg["type"];if(type==="_init"){self.inputPort=msg["in-port"];self.inputPort.onmessage=OnInputPortMessage}else if(type==="_addJobWorker")AddJobWorker(msg["port"])}); +function OnInputPortMessage(e){const msg=e.data;const type=msg["type"];if(type==="_cancel"){CancelJob(msg.jobId);return}else if(type==="_import_scripts"){const scripts=msg["scripts"];for(const w of self.jobWorkers)w.ImportScripts(scripts);self.importedScripts.push(scripts);return}else if(type==="_send_blob"){const blob=msg["blob"];const id=msg["id"];for(const w of self.jobWorkers)w.SendBlob(blob,id);self.sentBlobs.push([blob,id]);return}else if(type==="_send_buffer"){const buffer=msg["buffer"];const id= +msg["id"];for(const w of self.jobWorkers)w.SendBuffer(buffer,id);self.sentBuffers.push([buffer,id]);return}else if(type==="_no_more_workers"){self.sentBlobs.length=0;self.sentBuffers.length=0;self.importedScripts.length=0;self.lastBroadcasts.clear();return}else if(type==="_testMessageChannel"){self.jobWorkers[0].TestMessageChannel();return}self.jobQueue.push(msg);if(msg["isBroadcast"]){msg["doneFlags"]=(new Array(self.jobWorkers.length)).fill(false);msg["transferables"]=[];self.lastBroadcasts.set(msg["type"], +msg)}for(const w of self.jobWorkers)w.MaybeStartNextJob()}; diff --git a/games/shadow-fight/scripts/jobworker.js b/games/shadow-fight/scripts/jobworker.js new file mode 100644 index 00000000..cca88063 --- /dev/null +++ b/games/shadow-fight/scripts/jobworker.js @@ -0,0 +1,9 @@ +'use strict';self.dispatchPort=null;self.outputPort=null;self.workerNumber=-1;self.activeJobId=null;self.sentBlobs=new Map;self.sentBuffers=new Map;self.JobHandlers={}; +function FlipImageData(data,width,height){const stride=width*4;const tempRow=new Uint8Array(stride);const imageBuffer=data.buffer;for(let topY=0,len=Math.floor(height/2);topY{const msg=e.data;const type=msg["type"];switch(type){case "init":self.workerNumber=msg["number"];self.dispatchPort=msg["dispatch-port"];self.dispatchPort.onmessage=OnDispatchWorkerMessage;self.outputPort=msg["output-port"];return;case "terminate":self.close();return;default:console.error("unknown message '"+type+"'");return}});function SendReady(){self.dispatchPort.postMessage({"type":"ready"});self.outputPort.postMessage({"type":"ready"})} +function SendError(isBroadcast,e){if(!isBroadcast)self.outputPort.postMessage({"type":"error","jobId":self.activeJobId,"error":e.toString()});SendDone()}function SendResult(isBroadcast,ret){if(!isBroadcast){const transferables=ret.transferables||[];self.outputPort.postMessage({"type":"result","jobId":self.activeJobId,"result":ret.result},transferables)}SendDone()}function SendDone(){self.activeJobId=null;self.dispatchPort.postMessage({"type":"done"})} +function SendProgress(val){self.outputPort.postMessage({"type":"progress","jobId":self.activeJobId,"progress":val})} +function OnDispatchWorkerMessage(e){const msg=e.data;const type=msg["type"];if(type==="_import_scripts"){importScripts(...msg["scripts"]);return}else if(type==="_send_blob"){self.sentBlobs.set(msg["id"],msg["blob"]);return}else if(type==="_send_buffer"){self.sentBuffers.set(msg["id"],msg["buffer"]);return}else if(type==="_testMessageChannel"){self.outputPort.postMessage({"type":"_testMessageChannelOk"});return}else if(type==="_ready"){SendReady();return}const jobId=msg["jobId"];const isBroadcast= +msg["isBroadcast"];const params=msg["params"];let ret;self.activeJobId=jobId;if(!self.JobHandlers.hasOwnProperty(type)){console.error(`no handler for message type '${type}'`);return}try{ret=self.JobHandlers[type](params)}catch(e){SendError(isBroadcast,"Exception in job handler: "+e);return}if(ret&&ret.then)ret.then(asyncRet=>SendResult(isBroadcast,asyncRet)).catch(err=>SendError(isBroadcast,"Rejection in job handler: "+err));else SendResult(isBroadcast,ret)}; diff --git a/games/shadow-fight/scripts/main.js b/games/shadow-fight/scripts/main.js new file mode 100644 index 00000000..dd1adc35 --- /dev/null +++ b/games/shadow-fight/scripts/main.js @@ -0,0 +1,242 @@ +'use strict';{window.DOMHandler=class DOMHandler{constructor(iRuntime,componentId){this._iRuntime=iRuntime;this._componentId=componentId;this._hasTickCallback=false;this._tickCallback=()=>this.Tick()}Attach(){}PostToRuntime(handler,data,dispatchOpts,transferables){this._iRuntime.PostToRuntimeComponent(this._componentId,handler,data,dispatchOpts,transferables)}PostToRuntimeAsync(handler,data,dispatchOpts,transferables){return this._iRuntime.PostToRuntimeComponentAsync(this._componentId,handler,data, +dispatchOpts,transferables)}_PostToRuntimeMaybeSync(name,data,dispatchOpts){if(this._iRuntime.UsesWorker())this.PostToRuntime(name,data,dispatchOpts);else this._iRuntime._GetLocalRuntime()["_OnMessageFromDOM"]({"type":"event","component":this._componentId,"handler":name,"dispatchOpts":dispatchOpts||null,"data":data,"responseId":null})}AddRuntimeMessageHandler(handler,func){this._iRuntime.AddRuntimeComponentMessageHandler(this._componentId,handler,func)}AddRuntimeMessageHandlers(list){for(const [handler, +func]of list)this.AddRuntimeMessageHandler(handler,func)}GetRuntimeInterface(){return this._iRuntime}GetComponentID(){return this._componentId}_StartTicking(){if(this._hasTickCallback)return;this._iRuntime._AddRAFCallback(this._tickCallback);this._hasTickCallback=true}_StopTicking(){if(!this._hasTickCallback)return;this._iRuntime._RemoveRAFCallback(this._tickCallback);this._hasTickCallback=false}Tick(){}};window.RateLimiter=class RateLimiter{constructor(callback,interval){this._callback=callback; +this._interval=interval;this._timerId=-1;this._lastCallTime=-Infinity;this._timerCallFunc=()=>this._OnTimer();this._ignoreReset=false;this._canRunImmediate=false}SetCanRunImmediate(c){this._canRunImmediate=!!c}Call(){if(this._timerId!==-1)return;const nowTime=Date.now();const timeSinceLastCall=nowTime-this._lastCallTime;const interval=this._interval;if(timeSinceLastCall>=interval&&this._canRunImmediate){this._lastCallTime=nowTime;this._RunCallback()}else this._timerId=self.setTimeout(this._timerCallFunc, +Math.max(interval-timeSinceLastCall,4))}_RunCallback(){this._ignoreReset=true;this._callback();this._ignoreReset=false}Reset(){if(this._ignoreReset)return;this._CancelTimer();this._lastCallTime=Date.now()}_OnTimer(){this._timerId=-1;this._lastCallTime=Date.now();this._RunCallback()}_CancelTimer(){if(this._timerId!==-1){self.clearTimeout(this._timerId);this._timerId=-1}}Release(){this._CancelTimer();this._callback=null;this._timerCallFunc=null}}}; + + +'use strict';{window.DOMElementHandler=class DOMElementHandler extends self.DOMHandler{constructor(iRuntime,componentId){super(iRuntime,componentId);this._elementMap=new Map;this._autoAttach=true;this.AddRuntimeMessageHandlers([["create",e=>this._OnCreate(e)],["destroy",e=>this._OnDestroy(e)],["set-visible",e=>this._OnSetVisible(e)],["update-position",e=>this._OnUpdatePosition(e)],["update-state",e=>this._OnUpdateState(e)],["focus",e=>this._OnSetFocus(e)],["set-css-style",e=>this._OnSetCssStyle(e)], +["set-attribute",e=>this._OnSetAttribute(e)],["remove-attribute",e=>this._OnRemoveAttribute(e)]]);this.AddDOMElementMessageHandler("get-element",elem=>elem)}SetAutoAttach(e){this._autoAttach=!!e}AddDOMElementMessageHandler(handler,func){this.AddRuntimeMessageHandler(handler,e=>{const elementId=e["elementId"];const elem=this._elementMap.get(elementId);return func(elem,e)})}_OnCreate(e){const elementId=e["elementId"];const elem=this.CreateElement(elementId,e);this._elementMap.set(elementId,elem);if(!e["isVisible"])elem.style.display= +"none";const focusElem=this._GetFocusElement(elem);focusElem.addEventListener("focus",e=>this._OnFocus(elementId));focusElem.addEventListener("blur",e=>this._OnBlur(elementId));if(this._autoAttach)document.body.appendChild(elem)}CreateElement(elementId,e){throw new Error("required override");}DestroyElement(elem){}_OnDestroy(e){const elementId=e["elementId"];const elem=this._elementMap.get(elementId);this.DestroyElement(elem);if(this._autoAttach)elem.parentElement.removeChild(elem);this._elementMap.delete(elementId)}PostToRuntimeElement(handler, +elementId,data){if(!data)data={};data["elementId"]=elementId;this.PostToRuntime(handler,data)}_PostToRuntimeElementMaybeSync(handler,elementId,data){if(!data)data={};data["elementId"]=elementId;this._PostToRuntimeMaybeSync(handler,data)}_OnSetVisible(e){if(!this._autoAttach)return;const elem=this._elementMap.get(e["elementId"]);elem.style.display=e["isVisible"]?"":"none"}_OnUpdatePosition(e){if(!this._autoAttach)return;const elem=this._elementMap.get(e["elementId"]);elem.style.left=e["left"]+"px"; +elem.style.top=e["top"]+"px";elem.style.width=e["width"]+"px";elem.style.height=e["height"]+"px";const fontSize=e["fontSize"];if(fontSize!==null)elem.style.fontSize=fontSize+"em"}_OnUpdateState(e){const elem=this._elementMap.get(e["elementId"]);this.UpdateState(elem,e)}UpdateState(elem,e){throw new Error("required override");}_GetFocusElement(elem){return elem}_OnFocus(elementId){this.PostToRuntimeElement("elem-focused",elementId)}_OnBlur(elementId){this.PostToRuntimeElement("elem-blurred",elementId)}_OnSetFocus(e){const elem= +this._GetFocusElement(this._elementMap.get(e["elementId"]));if(e["focus"])elem.focus();else elem.blur()}_OnSetCssStyle(e){const elem=this._elementMap.get(e["elementId"]);elem.style[e["prop"]]=e["val"]}_OnSetAttribute(e){const elem=this._elementMap.get(e["elementId"]);elem.setAttribute(e["name"],e["val"])}_OnRemoveAttribute(e){const elem=this._elementMap.get(e["elementId"]);elem.removeAttribute(e["name"])}GetElementById(elementId){return this._elementMap.get(elementId)}}}; + + +'use strict';{const isiOSLike=/(iphone|ipod|ipad|macos|macintosh|mac os x)/i.test(navigator.userAgent);function AddScript(url,type){const elem=document.createElement("script");elem.async=false;if(type==="module")elem.type="module";if(url.isStringSrc){elem.textContent=url.str;document.head.appendChild(elem)}else return new Promise((resolve,reject)=>{elem.onload=resolve;elem.onerror=reject;elem.src=url;document.head.appendChild(elem)})}let didCheckWorkerModuleSupport=false;let isWorkerModuleSupported= +false;function SupportsWorkerTypeModule(){if(!didCheckWorkerModuleSupport){try{new Worker("blob://",{get type(){isWorkerModuleSupported=true}})}catch(e){}didCheckWorkerModuleSupport=true}return isWorkerModuleSupported}let tmpAudio=new Audio;const supportedAudioFormats={"audio/webm; codecs=opus":!!tmpAudio.canPlayType("audio/webm; codecs=opus"),"audio/ogg; codecs=opus":!!tmpAudio.canPlayType("audio/ogg; codecs=opus"),"audio/webm; codecs=vorbis":!!tmpAudio.canPlayType("audio/webm; codecs=vorbis"),"audio/ogg; codecs=vorbis":!!tmpAudio.canPlayType("audio/ogg; codecs=vorbis"), +"audio/mp4":!!tmpAudio.canPlayType("audio/mp4"),"audio/mpeg":!!tmpAudio.canPlayType("audio/mpeg")};tmpAudio=null;async function BlobToString(blob){const arrayBuffer=await BlobToArrayBuffer(blob);const textDecoder=new TextDecoder("utf-8");return textDecoder.decode(arrayBuffer)}function BlobToArrayBuffer(blob){return new Promise((resolve,reject)=>{const fileReader=new FileReader;fileReader.onload=e=>resolve(e.target.result);fileReader.onerror=err=>reject(err);fileReader.readAsArrayBuffer(blob)})}const queuedArrayBufferReads= +[];let activeArrayBufferReads=0;const MAX_ARRAYBUFFER_READS=8;window["RealFile"]=window["File"];const domHandlerClasses=[];const runtimeEventHandlers=new Map;const pendingResponsePromises=new Map;let nextResponseId=0;const runOnStartupFunctions=[];self.runOnStartup=function runOnStartup(f){if(typeof f!=="function")throw new Error("runOnStartup called without a function");runOnStartupFunctions.push(f)};const WEBVIEW_EXPORT_TYPES=new Set(["cordova","playable-ad","instant-games"]);function IsWebViewExportType(exportType){return WEBVIEW_EXPORT_TYPES.has(exportType)} +window.RuntimeInterface=class RuntimeInterface{constructor(opts){this._useWorker=opts.useWorker;this._messageChannelPort=null;this._baseUrl="";this._scriptFolder=opts.scriptFolder;this._scriptsType=opts.scriptsType;this._workerScriptURLs={};this._worker=null;this._localRuntime=null;this._domHandlers=[];this._runtimeDomHandler=null;this._canvas=null;this._jobScheduler=null;this._rafId=-1;this._rafFunc=()=>this._OnRAFCallback();this._rafCallbacks=[];this._exportType=opts.exportType;if(this._useWorker&& +(typeof OffscreenCanvas==="undefined"||!navigator["userActivation"]||this._scriptsType==="module"&&!SupportsWorkerTypeModule()))this._useWorker=false;if(IsWebViewExportType(this._exportType)&&this._useWorker){console.warn("[C3 runtime] Worker mode is enabled and supported, but is disabled in WebViews due to crbug.com/923007. Reverting to DOM mode.");this._useWorker=false}this._localFileBlobs=null;this._localFileStrings=null;if((this._exportType==="html5"||this._exportType==="playable-ad")&&location.protocol.substr(0, +4)==="file")alert("Exported games won't work until you upload them. (When running on the file: protocol, browsers block many features from working for security reasons.)");this.AddRuntimeComponentMessageHandler("runtime","cordova-fetch-local-file",e=>this._OnCordovaFetchLocalFile(e));this.AddRuntimeComponentMessageHandler("runtime","create-job-worker",e=>this._OnCreateJobWorker(e));if(this._exportType==="cordova")document.addEventListener("deviceready",()=>this._Init(opts));else this._Init(opts)}Release(){this._CancelAnimationFrame(); +if(this._messageChannelPort){this._messageChannelPort.onmessage=null;this._messageChannelPort=null}if(this._worker){this._worker.terminate();this._worker=null}if(this._localRuntime){this._localRuntime.Release();this._localRuntime=null}if(this._canvas){this._canvas.parentElement.removeChild(this._canvas);this._canvas=null}}GetCanvas(){return this._canvas}GetBaseURL(){return this._baseUrl}UsesWorker(){return this._useWorker}GetExportType(){return this._exportType}GetScriptFolder(){return this._scriptFolder}IsiOSCordova(){return isiOSLike&& +this._exportType==="cordova"}IsiOSWebView(){return isiOSLike&&IsWebViewExportType(this._exportType)||navigator["standalone"]}async _Init(opts){if(this._exportType==="playable-ad"){this._localFileBlobs=self["c3_base64files"];this._localFileStrings={};await this._ConvertDataUrisToBlobs();for(let i=0,len=opts.engineScripts.length;ithis["_OnMessageFromRuntime"](e.data);if(window["c3_addPortMessageHandler"])window["c3_addPortMessageHandler"](e=>this._OnMessageFromDebugger(e));this._jobScheduler=new self.JobSchedulerDOM(this);await this._jobScheduler.Init();this.MaybeForceBodySize();if(typeof window["StatusBar"]==="object")window["StatusBar"]["hide"]();if(typeof window["AndroidFullScreen"]==="object")window["AndroidFullScreen"]["immersiveMode"]();if(this._useWorker)await this._InitWorker(opts, +messageChannel.port2);else await this._InitDOM(opts,messageChannel.port2)}_GetWorkerURL(url){let ret;if(this._workerScriptURLs.hasOwnProperty(url))ret=this._workerScriptURLs[url];else if(url.endsWith("/workermain.js")&&this._workerScriptURLs.hasOwnProperty("workermain.js"))ret=this._workerScriptURLs["workermain.js"];else if(this._exportType==="playable-ad"&&this._localFileBlobs.hasOwnProperty(url.toLowerCase()))ret=this._localFileBlobs[url.toLowerCase()];else ret=url;if(ret instanceof Blob)ret=URL.createObjectURL(ret); +return ret}async CreateWorker(url,baseUrl,workerOpts){if(url.startsWith("blob:"))return new Worker(url,workerOpts);if(this.IsiOSCordova()&&location.protocol==="file:"){const arrayBuffer=await this.CordovaFetchLocalFileAsArrayBuffer(this._scriptFolder+url);const blob=new Blob([arrayBuffer],{type:"application/javascript"});return new Worker(URL.createObjectURL(blob),workerOpts)}const absUrl=new URL(url,baseUrl);const isCrossOrigin=location.origin!==absUrl.origin;if(isCrossOrigin){const response=await fetch(absUrl); +if(!response.ok)throw new Error("failed to fetch worker script");const blob=await response.blob();return new Worker(URL.createObjectURL(blob),workerOpts)}else return new Worker(absUrl,workerOpts)}_GetWindowInnerWidth(){return Math.max(window.innerWidth,1)}_GetWindowInnerHeight(){return Math.max(window.innerHeight,1)}MaybeForceBodySize(){if(this.IsiOSWebView()){const docStyle=document["documentElement"].style;const bodyStyle=document["body"].style;const isPortrait=window.innerWidth-1,"ife":!!self.ife,"jobScheduler":this._jobScheduler.GetPortData(),"supportedAudioFormats":supportedAudioFormats,"opusWasmScriptUrl":window["cr_opusWasmScriptUrl"]|| +this._scriptFolder+"opus.wasm.js","opusWasmBinaryUrl":window["cr_opusWasmBinaryUrl"]||this._scriptFolder+"opus.wasm.wasm","isiOSCordova":this.IsiOSCordova(),"isiOSWebView":this.IsiOSWebView(),"isFBInstantAvailable":typeof self["FBInstant"]!=="undefined"}}async _InitWorker(opts,port2){const workerMainUrl=this._GetWorkerURL(opts.workerMainUrl);this._worker=await this.CreateWorker(workerMainUrl,this._baseUrl,{type:this._scriptsType,name:"Runtime"});this._canvas=document.createElement("canvas");this._canvas.style.display= +"none";const offscreenCanvas=this._canvas["transferControlToOffscreen"]();document.body.appendChild(this._canvas);window["c3canvas"]=this._canvas;this._worker.postMessage(Object.assign(this._GetCommonRuntimeOptions(opts),{"type":"init-runtime","isInWorker":true,"messagePort":port2,"canvas":offscreenCanvas,"workerDependencyScripts":opts.workerDependencyScripts||[],"engineScripts":opts.engineScripts,"projectScripts":opts.projectScripts,"mainProjectScript":opts.mainProjectScript,"projectScriptsStatus":self["C3_ProjectScriptsStatus"]}), +[port2,offscreenCanvas,...this._jobScheduler.GetPortTransferables()]);this._domHandlers=domHandlerClasses.map(C=>new C(this));this._FindRuntimeDOMHandler();self["c3_callFunction"]=(name,params)=>this._runtimeDomHandler._InvokeFunctionFromJS(name,params);if(this._exportType==="preview")self["goToLastErrorScript"]=()=>this.PostToRuntimeComponent("runtime","go-to-last-error-script")}async _InitDOM(opts,port2){this._canvas=document.createElement("canvas");this._canvas.style.display="none";document.body.appendChild(this._canvas); +window["c3canvas"]=this._canvas;this._domHandlers=domHandlerClasses.map(C=>new C(this));this._FindRuntimeDOMHandler();let engineScripts=opts.engineScripts.map(url=>typeof url==="string"?(new URL(url,this._baseUrl)).toString():url);if(Array.isArray(opts.workerDependencyScripts))engineScripts.unshift(...opts.workerDependencyScripts);engineScripts=await Promise.all(engineScripts.map(url=>this._MaybeGetCordovaScriptURL(url,this._scriptsType)));await Promise.all(engineScripts.map(url=>AddScript(url,this._scriptsType))); +const scriptsStatus=self["C3_ProjectScriptsStatus"];if(this._scriptsType==="module"){const mainProjectScript=opts.mainProjectScript;const allProjectScripts=opts.projectScripts;for(let [originalUrl,loadUrl]of allProjectScripts){if(!loadUrl)loadUrl=originalUrl;if(originalUrl===mainProjectScript)try{loadUrl=await this._MaybeGetCordovaScriptURL(loadUrl,this._scriptsType);await AddScript(loadUrl,this._scriptsType);if(this._exportType==="preview"&&!scriptsStatus[originalUrl])this._ReportProjectMainScriptError(originalUrl, +"main script did not run to completion")}catch(err){this._ReportProjectMainScriptError(originalUrl,err)}else if(originalUrl==="scriptsInEvents.js"||originalUrl.endsWith("/scriptsInEvents.js")){loadUrl=await this._MaybeGetCordovaScriptURL(loadUrl,this._scriptsType);await AddScript(loadUrl,this._scriptsType)}}}else if(opts.projectScripts&&opts.projectScripts.length>0)try{await Promise.all(opts.projectScripts.map(e=>AddScript(e[1],this._scriptsType)));if(Object.values(scriptsStatus).some(f=>!f)){self.setTimeout(()=> +this._ReportProjectScriptError(scriptsStatus),100);return}}catch(err){console.error("[Preview] Error loading project scripts: ",err);self.setTimeout(()=>this._ReportProjectScriptError(scriptsStatus),100);return}if(this._exportType==="preview"&&typeof self.C3.ScriptsInEvents!=="object"){this._RemoveLoadingMessage();const msg="Failed to load JavaScript code used in events. Check all your JavaScript code has valid syntax.";console.error("[C3 runtime] "+msg);alert(msg);return}const runtimeOpts=Object.assign(this._GetCommonRuntimeOptions(opts), +{"isInWorker":false,"messagePort":port2,"canvas":this._canvas,"runOnStartupFunctions":runOnStartupFunctions});this._OnBeforeCreateRuntime();this._localRuntime=self["C3_CreateRuntime"](runtimeOpts);await self["C3_InitRuntime"](this._localRuntime,runtimeOpts)}_ReportProjectScriptError(scriptsStatus){this._RemoveLoadingMessage();const failedScripts=Object.entries(scriptsStatus).filter(e=>!e[1]).map(e=>e[0]);const msg=`Failed to load project script '${failedScripts[0]}'. Check all your JavaScript code has valid syntax.`; +console.error("[Preview] "+msg);alert(msg)}_ReportProjectMainScriptError(url,err){this._RemoveLoadingMessage();console.error(`[Preview] Failed to load project main script (${url}): `,err);alert(`Failed to load project main script (${url}). Check all your JavaScript code has valid syntax. Press F12 and check the console for error details.`)}_OnBeforeCreateRuntime(){this._RemoveLoadingMessage()}_RemoveLoadingMessage(){const loadingElem=window.cr_previewLoadingElem;if(loadingElem){loadingElem.parentElement.removeChild(loadingElem); +window.cr_previewLoadingElem=null}}async _OnCreateJobWorker(e){const outputPort=await this._jobScheduler._CreateJobWorker();return{"outputPort":outputPort,"transferables":[outputPort]}}_GetLocalRuntime(){if(this._useWorker)throw new Error("not available in worker mode");return this._localRuntime}PostToRuntimeComponent(component,handler,data,dispatchOpts,transferables){this._messageChannelPort.postMessage({"type":"event","component":component,"handler":handler,"dispatchOpts":dispatchOpts||null,"data":data, +"responseId":null},transferables)}PostToRuntimeComponentAsync(component,handler,data,dispatchOpts,transferables){const responseId=nextResponseId++;const ret=new Promise((resolve,reject)=>{pendingResponsePromises.set(responseId,{resolve,reject})});this._messageChannelPort.postMessage({"type":"event","component":component,"handler":handler,"dispatchOpts":dispatchOpts||null,"data":data,"responseId":responseId},transferables);return ret}["_OnMessageFromRuntime"](data){const type=data["type"];if(type=== +"event")return this._OnEventFromRuntime(data);else if(type==="result")this._OnResultFromRuntime(data);else if(type==="runtime-ready")this._OnRuntimeReady();else if(type==="alert-error"){this._RemoveLoadingMessage();alert(data["message"])}else if(type==="creating-runtime")this._OnBeforeCreateRuntime();else throw new Error(`unknown message '${type}'`);}_OnEventFromRuntime(e){const component=e["component"];const handler=e["handler"];const data=e["data"];const responseId=e["responseId"];const handlerMap= +runtimeEventHandlers.get(component);if(!handlerMap){console.warn(`[DOM] No event handlers for component '${component}'`);return}const func=handlerMap.get(handler);if(!func){console.warn(`[DOM] No handler '${handler}' for component '${component}'`);return}let ret=null;try{ret=func(data)}catch(err){console.error(`Exception in '${component}' handler '${handler}':`,err);if(responseId!==null)this._PostResultToRuntime(responseId,false,""+err);return}if(responseId===null)return ret;else if(ret&&ret.then)ret.then(result=> +this._PostResultToRuntime(responseId,true,result)).catch(err=>{console.error(`Rejection from '${component}' handler '${handler}':`,err);this._PostResultToRuntime(responseId,false,""+err)});else this._PostResultToRuntime(responseId,true,ret)}_PostResultToRuntime(responseId,isOk,result){let transferables;if(result&&result["transferables"])transferables=result["transferables"];this._messageChannelPort.postMessage({"type":"result","responseId":responseId,"isOk":isOk,"result":result},transferables)}_OnResultFromRuntime(data){const responseId= +data["responseId"];const isOk=data["isOk"];const result=data["result"];const pendingPromise=pendingResponsePromises.get(responseId);if(isOk)pendingPromise.resolve(result);else pendingPromise.reject(result);pendingResponsePromises.delete(responseId)}AddRuntimeComponentMessageHandler(component,handler,func){let handlerMap=runtimeEventHandlers.get(component);if(!handlerMap){handlerMap=new Map;runtimeEventHandlers.set(component,handlerMap)}if(handlerMap.has(handler))throw new Error(`[DOM] Component '${component}' already has handler '${handler}'`); +handlerMap.set(handler,func)}static AddDOMHandlerClass(Class){if(domHandlerClasses.includes(Class))throw new Error("DOM handler already added");domHandlerClasses.push(Class)}_FindRuntimeDOMHandler(){for(const dh of this._domHandlers)if(dh.GetComponentID()==="runtime"){this._runtimeDomHandler=dh;return}throw new Error("cannot find runtime DOM handler");}_OnMessageFromDebugger(e){this.PostToRuntimeComponent("debugger","message",e)}_OnRuntimeReady(){for(const h of this._domHandlers)h.Attach()}static IsDocumentFullscreen(){return!!(document["fullscreenElement"]|| +document["webkitFullscreenElement"]||document["mozFullScreenElement"])}async GetRemotePreviewStatusInfo(){return await this.PostToRuntimeComponentAsync("runtime","get-remote-preview-status-info")}_AddRAFCallback(f){this._rafCallbacks.push(f);this._RequestAnimationFrame()}_RemoveRAFCallback(f){const i=this._rafCallbacks.indexOf(f);if(i===-1)throw new Error("invalid callback");this._rafCallbacks.splice(i,1);if(!this._rafCallbacks.length)this._CancelAnimationFrame()}_RequestAnimationFrame(){if(this._rafId=== +-1&&this._rafCallbacks.length)this._rafId=requestAnimationFrame(this._rafFunc)}_CancelAnimationFrame(){if(this._rafId!==-1){cancelAnimationFrame(this._rafId);this._rafId=-1}}_OnRAFCallback(){this._rafId=-1;for(const f of this._rafCallbacks)f();this._RequestAnimationFrame()}TryPlayMedia(mediaElem){this._runtimeDomHandler.TryPlayMedia(mediaElem)}RemovePendingPlay(mediaElem){this._runtimeDomHandler.RemovePendingPlay(mediaElem)}_PlayPendingMedia(){this._runtimeDomHandler._PlayPendingMedia()}SetSilent(s){this._runtimeDomHandler.SetSilent(s)}IsAudioFormatSupported(typeStr){return!!supportedAudioFormats[typeStr]}async _WasmDecodeWebMOpus(arrayBuffer){const result= +await this.PostToRuntimeComponentAsync("runtime","opus-decode",{"arrayBuffer":arrayBuffer},null,[arrayBuffer]);return new Float32Array(result)}IsAbsoluteURL(url){return/^(?:[a-z\-]+:)?\/\//.test(url)||url.substr(0,5)==="data:"||url.substr(0,5)==="blob:"}IsRelativeURL(url){return!this.IsAbsoluteURL(url)}async _MaybeGetCordovaScriptURL(url,type){if(this._exportType==="cordova"&&type==="module"&&(url.startsWith("file:")||location.protocol==="file:"&&this.IsRelativeURL(url))){let filename=url;if(filename.startsWith(this._baseUrl))filename= +filename.substr(this._baseUrl.length);const arrayBuffer=await this.CordovaFetchLocalFileAsArrayBuffer(filename);const blob=new Blob([arrayBuffer],{type:"application/javascript"});return URL.createObjectURL(blob)}else return url}async _OnCordovaFetchLocalFile(e){const filename=e["filename"];switch(e["as"]){case "text":return await this.CordovaFetchLocalFileAsText(filename);case "buffer":return await this.CordovaFetchLocalFileAsArrayBuffer(filename);default:throw new Error("unsupported type");}}_GetPermissionAPI(){const api= +window["cordova"]&&window["cordova"]["plugins"]&&window["cordova"]["plugins"]["permissions"];if(typeof api!=="object")throw new Error("Permission API is not loaded");return api}_MapPermissionID(api,permission){const permissionID=api[permission];if(typeof permissionID!=="string")throw new Error("Invalid permission name");return permissionID}_HasPermission(id){const api=this._GetPermissionAPI();return new Promise((resolve,reject)=>api["checkPermission"](this._MapPermissionID(api,id),status=>resolve(!!status["hasPermission"]), +reject))}_RequestPermission(id){const api=this._GetPermissionAPI();return new Promise((resolve,reject)=>api["requestPermission"](this._MapPermissionID(api,id),status=>resolve(!!status["hasPermission"]),reject))}async RequestPermissions(permissions){if(this.GetExportType()!=="cordova")return true;if(this.IsiOSCordova())return true;for(const id of permissions){const alreadyGranted=await this._HasPermission(id);if(alreadyGranted)continue;const granted=await this._RequestPermission(id);if(granted===false)return false}return true}async RequirePermissions(...permissions){if(await this.RequestPermissions(permissions)=== +false)throw new Error("Permission not granted");}CordovaFetchLocalFile(filename){const path=window["cordova"]["file"]["applicationDirectory"]+"www/"+filename.toLowerCase();return new Promise((resolve,reject)=>{window["resolveLocalFileSystemURL"](path,entry=>{entry["file"](resolve,reject)},reject)})}async CordovaFetchLocalFileAsText(filename){const file=await this.CordovaFetchLocalFile(filename);return await BlobToString(file)}_CordovaMaybeStartNextArrayBufferRead(){if(!queuedArrayBufferReads.length)return; +if(activeArrayBufferReads>=MAX_ARRAYBUFFER_READS)return;activeArrayBufferReads++;const job=queuedArrayBufferReads.shift();this._CordovaDoFetchLocalFileAsAsArrayBuffer(job.filename,job.successCallback,job.errorCallback)}CordovaFetchLocalFileAsArrayBuffer(filename){return new Promise((resolve,reject)=>{queuedArrayBufferReads.push({filename:filename,successCallback:result=>{activeArrayBufferReads--;this._CordovaMaybeStartNextArrayBufferRead();resolve(result)},errorCallback:err=>{activeArrayBufferReads--; +this._CordovaMaybeStartNextArrayBufferRead();reject(err)}});this._CordovaMaybeStartNextArrayBufferRead()})}async _CordovaDoFetchLocalFileAsAsArrayBuffer(filename,successCallback,errorCallback){try{const file=await this.CordovaFetchLocalFile(filename);const arrayBuffer=await BlobToArrayBuffer(file);successCallback(arrayBuffer)}catch(err){errorCallback(err)}}async _ConvertDataUrisToBlobs(){const promises=[];for(const [filename,data]of Object.entries(this._localFileBlobs))promises.push(this._ConvertDataUriToBlobs(filename, +data));await Promise.all(promises)}async _ConvertDataUriToBlobs(filename,data){if(typeof data==="object"){this._localFileBlobs[filename]=new Blob([data["str"]],{"type":data["type"]});this._localFileStrings[filename]=data["str"]}else{let blob=await this._FetchDataUri(data);if(!blob)blob=this._DataURIToBinaryBlobSync(data);this._localFileBlobs[filename]=blob}}async _FetchDataUri(dataUri){try{const response=await fetch(dataUri);return await response.blob()}catch(err){console.warn("Failed to fetch a data: URI. Falling back to a slower workaround. This is probably because the Content Security Policy unnecessarily blocked it. Allow data: URIs in your CSP to avoid this.", +err);return null}}_DataURIToBinaryBlobSync(datauri){const o=this._ParseDataURI(datauri);return this._BinaryStringToBlob(o.data,o.mime_type)}_ParseDataURI(datauri){const comma=datauri.indexOf(",");if(comma<0)throw new URIError("expected comma in data: uri");const typepart=datauri.substring(5,comma);const datapart=datauri.substring(comma+1);const typearr=typepart.split(";");const mimetype=typearr[0]||"";const encoding1=typearr[1];const encoding2=typearr[2];let decodeddata;if(encoding1==="base64"||encoding2=== +"base64")decodeddata=atob(datapart);else decodeddata=decodeURIComponent(datapart);return{mime_type:mimetype,data:decodeddata}}_BinaryStringToBlob(binstr,mime_type){let len=binstr.length;let len32=len>>2;let a8=new Uint8Array(len);let a32=new Uint32Array(a8.buffer,0,len32);let i,j;for(i=0,j=0;i{const styleLink=document.createElement("link");styleLink.onload=()=>resolve(styleLink);styleLink.onerror=err=>reject(err);styleLink.rel="stylesheet";styleLink.href=cssUrl;document.head.appendChild(styleLink)})}function FetchImage(url){return new Promise((resolve,reject)=>{const img=new Image;img.onload=()=>resolve(img);img.onerror=err=>reject(err);img.src=url})}async function BlobToImage(blob){const blobUrl= +URL.createObjectURL(blob);try{return await FetchImage(blobUrl)}finally{URL.revokeObjectURL(blobUrl)}}function BlobToString(blob){return new Promise((resolve,reject)=>{let fileReader=new FileReader;fileReader.onload=e=>resolve(e.target.result);fileReader.onerror=err=>reject(err);fileReader.readAsText(blob)})}async function BlobToSvgImage(blob,width,height){if(!/firefox/i.test(navigator.userAgent))return await BlobToImage(blob);let str=await BlobToString(blob);const parser=new DOMParser;const doc=parser.parseFromString(str, +"image/svg+xml");const rootElem=doc.documentElement;if(rootElem.hasAttribute("width")&&rootElem.hasAttribute("height")){const widthStr=rootElem.getAttribute("width");const heightStr=rootElem.getAttribute("height");if(!widthStr.includes("%")&&!heightStr.includes("%"))return await BlobToImage(blob)}rootElem.setAttribute("width",width+"px");rootElem.setAttribute("height",height+"px");const serializer=new XMLSerializer;str=serializer.serializeToString(doc);blob=new Blob([str],{type:"image/svg+xml"}); +return await BlobToImage(blob)}function IsInContentEditable(el){do{if(el.parentNode&&el.hasAttribute("contenteditable"))return true;el=el.parentNode}while(el);return false}const canvasOrDocTags=new Set(["canvas","body","html"]);function PreventDefaultOnCanvasOrDoc(e){const tagName=e.target.tagName.toLowerCase();if(canvasOrDocTags.has(tagName))e.preventDefault()}function BlockWheelZoom(e){if(e.metaKey||e.ctrlKey)e.preventDefault()}self["C3_GetSvgImageSize"]=async function(blob){const img=await BlobToImage(blob); +if(img.width>0&&img.height>0)return[img.width,img.height];else{img.style.position="absolute";img.style.left="0px";img.style.top="0px";img.style.visibility="hidden";document.body.appendChild(img);const rc=img.getBoundingClientRect();document.body.removeChild(img);return[rc.width,rc.height]}};self["C3_RasterSvgImageBlob"]=async function(blob,imageWidth,imageHeight,surfaceWidth,surfaceHeight){const img=await BlobToSvgImage(blob,imageWidth,imageHeight);const canvas=document.createElement("canvas");canvas.width= +surfaceWidth;canvas.height=surfaceHeight;const ctx=canvas.getContext("2d");ctx.drawImage(img,0,0,imageWidth,imageHeight);return canvas};let isCordovaPaused=false;document.addEventListener("pause",()=>isCordovaPaused=true);document.addEventListener("resume",()=>isCordovaPaused=false);function ParentHasFocus(){try{return window.parent&&window.parent.document.hasFocus()}catch(err){return false}}function KeyboardIsVisible(){const elem=document.activeElement;if(!elem)return false;const tagName=elem.tagName.toLowerCase(); +const inputTypes=new Set(["email","number","password","search","tel","text","url"]);if(tagName==="textarea")return true;if(tagName==="input")return inputTypes.has(elem.type.toLowerCase()||"text");return IsInContentEditable(elem)}const DOM_COMPONENT_ID="runtime";const HANDLER_CLASS=class RuntimeDOMHandler extends self.DOMHandler{constructor(iRuntime){super(iRuntime,DOM_COMPONENT_ID);this._isFirstSizeUpdate=true;this._simulatedResizeTimerId=-1;this._targetOrientation="any";this._attachedDeviceOrientationEvent= +false;this._attachedDeviceMotionEvent=false;this._debugHighlightElem=null;this._pointerRawUpdateRateLimiter=null;this._lastPointerRawUpdateEvent=null;iRuntime.AddRuntimeComponentMessageHandler("canvas","update-size",e=>this._OnUpdateCanvasSize(e));iRuntime.AddRuntimeComponentMessageHandler("runtime","invoke-download",e=>this._OnInvokeDownload(e));iRuntime.AddRuntimeComponentMessageHandler("runtime","raster-svg-image",e=>this._OnRasterSvgImage(e));iRuntime.AddRuntimeComponentMessageHandler("runtime", +"get-svg-image-size",e=>this._OnGetSvgImageSize(e));iRuntime.AddRuntimeComponentMessageHandler("runtime","set-target-orientation",e=>this._OnSetTargetOrientation(e));iRuntime.AddRuntimeComponentMessageHandler("runtime","register-sw",()=>this._OnRegisterSW());iRuntime.AddRuntimeComponentMessageHandler("runtime","post-to-debugger",e=>this._OnPostToDebugger(e));iRuntime.AddRuntimeComponentMessageHandler("runtime","go-to-script",e=>this._OnPostToDebugger(e));iRuntime.AddRuntimeComponentMessageHandler("runtime", +"before-start-ticking",()=>this._OnBeforeStartTicking());iRuntime.AddRuntimeComponentMessageHandler("runtime","debug-highlight",e=>this._OnDebugHighlight(e));iRuntime.AddRuntimeComponentMessageHandler("runtime","enable-device-orientation",()=>this._AttachDeviceOrientationEvent());iRuntime.AddRuntimeComponentMessageHandler("runtime","enable-device-motion",()=>this._AttachDeviceMotionEvent());iRuntime.AddRuntimeComponentMessageHandler("runtime","add-stylesheet",e=>this._OnAddStylesheet(e));iRuntime.AddRuntimeComponentMessageHandler("runtime", +"alert",e=>this._OnAlert(e));iRuntime.AddRuntimeComponentMessageHandler("runtime","hide-cordova-splash",()=>this._OnHideCordovaSplash());const allowDefaultContextMenuTagNames=new Set(["input","textarea","datalist"]);window.addEventListener("contextmenu",e=>{const t=e.target;const name=t.tagName.toLowerCase();if(!allowDefaultContextMenuTagNames.has(name)&&!IsInContentEditable(t))e.preventDefault()});const canvas=iRuntime.GetCanvas();window.addEventListener("selectstart",PreventDefaultOnCanvasOrDoc); +window.addEventListener("gesturehold",PreventDefaultOnCanvasOrDoc);canvas.addEventListener("selectstart",PreventDefaultOnCanvasOrDoc);canvas.addEventListener("gesturehold",PreventDefaultOnCanvasOrDoc);window.addEventListener("touchstart",PreventDefaultOnCanvasOrDoc,{"passive":false});if(typeof PointerEvent!=="undefined"){window.addEventListener("pointerdown",PreventDefaultOnCanvasOrDoc,{"passive":false});canvas.addEventListener("pointerdown",PreventDefaultOnCanvasOrDoc)}else canvas.addEventListener("touchstart", +PreventDefaultOnCanvasOrDoc);this._mousePointerLastButtons=0;window.addEventListener("mousedown",e=>{if(e.button===1)e.preventDefault()});window.addEventListener("mousewheel",BlockWheelZoom,{"passive":false});window.addEventListener("wheel",BlockWheelZoom,{"passive":false});window.addEventListener("resize",()=>this._OnWindowResize());if(iRuntime.IsiOSWebView())window.addEventListener("focusout",()=>{if(!KeyboardIsVisible())document.scrollingElement.scrollTop=0});this._mediaPendingPlay=new Set;this._mediaRemovedPendingPlay= +new WeakSet;this._isSilent=false}_OnBeforeStartTicking(){if(this._iRuntime.GetExportType()==="cordova"){document.addEventListener("pause",()=>this._OnVisibilityChange(true));document.addEventListener("resume",()=>this._OnVisibilityChange(false))}else document.addEventListener("visibilitychange",()=>this._OnVisibilityChange(document.hidden));return{"isSuspended":!!(document.hidden||isCordovaPaused)}}Attach(){window.addEventListener("focus",()=>this._PostRuntimeEvent("window-focus"));window.addEventListener("blur", +()=>{this._PostRuntimeEvent("window-blur",{"parentHasFocus":ParentHasFocus()});this._mousePointerLastButtons=0});window.addEventListener("fullscreenchange",()=>this._OnFullscreenChange());window.addEventListener("webkitfullscreenchange",()=>this._OnFullscreenChange());window.addEventListener("mozfullscreenchange",()=>this._OnFullscreenChange());window.addEventListener("fullscreenerror",e=>this._OnFullscreenError(e));window.addEventListener("webkitfullscreenerror",e=>this._OnFullscreenError(e));window.addEventListener("mozfullscreenerror", +e=>this._OnFullscreenError(e));window.addEventListener("keydown",e=>this._OnKeyEvent("keydown",e));window.addEventListener("keyup",e=>this._OnKeyEvent("keyup",e));window.addEventListener("dblclick",e=>this._OnMouseEvent("dblclick",e,DISPATCH_RUNTIME_AND_SCRIPT));window.addEventListener("wheel",e=>this._OnMouseWheelEvent("wheel",e));if(typeof PointerEvent!=="undefined"){window.addEventListener("pointerdown",e=>{this._HandlePointerDownFocus(e);this._OnPointerEvent("pointerdown",e)});if(this._iRuntime.UsesWorker()&& +typeof window["onpointerrawupdate"]!=="undefined"&&self===self.top){this._pointerRawUpdateRateLimiter=new self.RateLimiter(()=>this._DoSendPointerRawUpdate(),5);this._pointerRawUpdateRateLimiter.SetCanRunImmediate(true);window.addEventListener("pointerrawupdate",e=>this._OnPointerRawUpdate(e))}else window.addEventListener("pointermove",e=>this._OnPointerEvent("pointermove",e));window.addEventListener("pointerup",e=>this._OnPointerEvent("pointerup",e));window.addEventListener("pointercancel",e=>this._OnPointerEvent("pointercancel", +e))}else{window.addEventListener("mousedown",e=>{this._HandlePointerDownFocus(e);this._OnMouseEventAsPointer("pointerdown",e)});window.addEventListener("mousemove",e=>this._OnMouseEventAsPointer("pointermove",e));window.addEventListener("mouseup",e=>this._OnMouseEventAsPointer("pointerup",e));window.addEventListener("touchstart",e=>{this._HandlePointerDownFocus(e);this._OnTouchEvent("pointerdown",e)});window.addEventListener("touchmove",e=>this._OnTouchEvent("pointermove",e));window.addEventListener("touchend", +e=>this._OnTouchEvent("pointerup",e));window.addEventListener("touchcancel",e=>this._OnTouchEvent("pointercancel",e))}const playFunc=()=>this._PlayPendingMedia();window.addEventListener("pointerup",playFunc,true);window.addEventListener("touchend",playFunc,true);window.addEventListener("click",playFunc,true);window.addEventListener("keydown",playFunc,true);window.addEventListener("gamepadconnected",playFunc,true)}_PostRuntimeEvent(name,data){this.PostToRuntime(name,data||null,DISPATCH_RUNTIME_ONLY)}_GetWindowInnerWidth(){return this._iRuntime._GetWindowInnerWidth()}_GetWindowInnerHeight(){return this._iRuntime._GetWindowInnerHeight()}_OnWindowResize(){const width= +this._GetWindowInnerWidth();const height=this._GetWindowInnerHeight();this._PostRuntimeEvent("window-resize",{"innerWidth":width,"innerHeight":height,"devicePixelRatio":window.devicePixelRatio});if(this._iRuntime.IsiOSWebView()){if(this._simulatedResizeTimerId!==-1)clearTimeout(this._simulatedResizeTimerId);this._OnSimulatedResize(width,height,0)}}_ScheduleSimulatedResize(width,height,count){if(this._simulatedResizeTimerId!==-1)clearTimeout(this._simulatedResizeTimerId);this._simulatedResizeTimerId= +setTimeout(()=>this._OnSimulatedResize(width,height,count),48)}_OnSimulatedResize(originalWidth,originalHeight,count){const width=this._GetWindowInnerWidth();const height=this._GetWindowInnerHeight();this._simulatedResizeTimerId=-1;if(width!=originalWidth||height!=originalHeight)this._PostRuntimeEvent("window-resize",{"innerWidth":width,"innerHeight":height,"devicePixelRatio":window.devicePixelRatio});else if(count<10)this._ScheduleSimulatedResize(width,height,count+1)}_OnSetTargetOrientation(e){this._targetOrientation= +e["targetOrientation"]}_TrySetTargetOrientation(){const orientation=this._targetOrientation;if(screen["orientation"]&&screen["orientation"]["lock"])screen["orientation"]["lock"](orientation).catch(err=>console.warn("[Construct 3] Failed to lock orientation: ",err));else try{let result=false;if(screen["lockOrientation"])result=screen["lockOrientation"](orientation);else if(screen["webkitLockOrientation"])result=screen["webkitLockOrientation"](orientation);else if(screen["mozLockOrientation"])result= +screen["mozLockOrientation"](orientation);else if(screen["msLockOrientation"])result=screen["msLockOrientation"](orientation);if(!result)console.warn("[Construct 3] Failed to lock orientation")}catch(err){console.warn("[Construct 3] Failed to lock orientation: ",err)}}_OnFullscreenChange(){const isDocFullscreen=RuntimeInterface.IsDocumentFullscreen();if(isDocFullscreen&&this._targetOrientation!=="any")this._TrySetTargetOrientation();this.PostToRuntime("fullscreenchange",{"isFullscreen":isDocFullscreen, +"innerWidth":this._GetWindowInnerWidth(),"innerHeight":this._GetWindowInnerHeight()})}_OnFullscreenError(e){console.warn("[Construct 3] Fullscreen request failed: ",e);this.PostToRuntime("fullscreenerror",{"isFullscreen":RuntimeInterface.IsDocumentFullscreen(),"innerWidth":this._GetWindowInnerWidth(),"innerHeight":this._GetWindowInnerHeight()})}_OnVisibilityChange(isHidden){if(isHidden)this._iRuntime._CancelAnimationFrame();else this._iRuntime._RequestAnimationFrame();this.PostToRuntime("visibilitychange", +{"hidden":isHidden})}_OnKeyEvent(name,e){if(e.key==="Backspace")PreventDefaultOnCanvasOrDoc(e);const code=KEY_CODE_ALIASES.get(e.code)||e.code;this._PostToRuntimeMaybeSync(name,{"code":code,"key":e.key,"which":e.which,"repeat":e.repeat,"altKey":e.altKey,"ctrlKey":e.ctrlKey,"metaKey":e.metaKey,"shiftKey":e.shiftKey,"timeStamp":e.timeStamp},DISPATCH_RUNTIME_AND_SCRIPT)}_OnMouseWheelEvent(name,e){this.PostToRuntime(name,{"clientX":e.clientX,"clientY":e.clientY,"pageX":e.pageX,"pageY":e.pageY,"deltaX":e.deltaX, +"deltaY":e.deltaY,"deltaZ":e.deltaZ,"deltaMode":e.deltaMode,"timeStamp":e.timeStamp},DISPATCH_RUNTIME_AND_SCRIPT)}_OnMouseEvent(name,e,opts){if(IsCompatibilityMouseEvent(e))return;this._PostToRuntimeMaybeSync(name,{"button":e.button,"buttons":e.buttons,"clientX":e.clientX,"clientY":e.clientY,"pageX":e.pageX,"pageY":e.pageY,"timeStamp":e.timeStamp},opts)}_OnMouseEventAsPointer(name,e){if(IsCompatibilityMouseEvent(e))return;const pointerId=1;const lastButtons=this._mousePointerLastButtons;if(name=== +"pointerdown"&&lastButtons!==0)name="pointermove";else if(name==="pointerup"&&e.buttons!==0)name="pointermove";this._PostToRuntimeMaybeSync(name,{"pointerId":pointerId,"pointerType":"mouse","button":e.button,"buttons":e.buttons,"lastButtons":lastButtons,"clientX":e.clientX,"clientY":e.clientY,"pageX":e.pageX,"pageY":e.pageY,"width":0,"height":0,"pressure":0,"tangentialPressure":0,"tiltX":0,"tiltY":0,"twist":0,"timeStamp":e.timeStamp},DISPATCH_RUNTIME_AND_SCRIPT);this._mousePointerLastButtons=e.buttons; +this._OnMouseEvent(e.type,e,DISPATCH_SCRIPT_ONLY)}_OnPointerEvent(name,e){if(this._pointerRawUpdateRateLimiter&&name!=="pointermove")this._pointerRawUpdateRateLimiter.Reset();let lastButtons=0;if(e.pointerType==="mouse")lastButtons=this._mousePointerLastButtons;this._PostToRuntimeMaybeSync(name,{"pointerId":e.pointerId,"pointerType":e.pointerType,"button":e.button,"buttons":e.buttons,"lastButtons":lastButtons,"clientX":e.clientX,"clientY":e.clientY,"pageX":e.pageX,"pageY":e.pageY,"width":e.width|| +0,"height":e.height||0,"pressure":e.pressure||0,"tangentialPressure":e["tangentialPressure"]||0,"tiltX":e.tiltX||0,"tiltY":e.tiltY||0,"twist":e["twist"]||0,"timeStamp":e.timeStamp},DISPATCH_RUNTIME_AND_SCRIPT);if(e.pointerType==="mouse"){let mouseEventName="mousemove";if(name==="pointerdown")mouseEventName="mousedown";else if(name==="pointerup")mouseEventName="mouseup";this._OnMouseEvent(mouseEventName,e,DISPATCH_SCRIPT_ONLY);this._mousePointerLastButtons=e.buttons}}_OnPointerRawUpdate(e){this._lastPointerRawUpdateEvent= +e;this._pointerRawUpdateRateLimiter.Call()}_DoSendPointerRawUpdate(){this._OnPointerEvent("pointermove",this._lastPointerRawUpdateEvent);this._lastPointerRawUpdateEvent=null}_OnTouchEvent(fireName,e){for(let i=0,len=e.changedTouches.length;ithis._OnDeviceOrientation(e));window.addEventListener("deviceorientationabsolute",e=>this._OnDeviceOrientationAbsolute(e))}_AttachDeviceMotionEvent(){if(this._attachedDeviceMotionEvent)return;this._attachedDeviceMotionEvent=true;window.addEventListener("devicemotion", +e=>this._OnDeviceMotion(e))}_OnDeviceOrientation(e){this.PostToRuntime("deviceorientation",{"absolute":!!e["absolute"],"alpha":e["alpha"]||0,"beta":e["beta"]||0,"gamma":e["gamma"]||0,"timeStamp":e.timeStamp,"webkitCompassHeading":e["webkitCompassHeading"],"webkitCompassAccuracy":e["webkitCompassAccuracy"]},DISPATCH_RUNTIME_AND_SCRIPT)}_OnDeviceOrientationAbsolute(e){this.PostToRuntime("deviceorientationabsolute",{"absolute":!!e["absolute"],"alpha":e["alpha"]||0,"beta":e["beta"]||0,"gamma":e["gamma"]|| +0,"timeStamp":e.timeStamp},DISPATCH_RUNTIME_AND_SCRIPT)}_OnDeviceMotion(e){let accProp=null;const acc=e["acceleration"];if(acc)accProp={"x":acc["x"]||0,"y":acc["y"]||0,"z":acc["z"]||0};let withGProp=null;const withG=e["accelerationIncludingGravity"];if(withG)withGProp={"x":withG["x"]||0,"y":withG["y"]||0,"z":withG["z"]||0};let rotationRateProp=null;const rotationRate=e["rotationRate"];if(rotationRate)rotationRateProp={"alpha":rotationRate["alpha"]||0,"beta":rotationRate["beta"]||0,"gamma":rotationRate["gamma"]|| +0};this.PostToRuntime("devicemotion",{"acceleration":accProp,"accelerationIncludingGravity":withGProp,"rotationRate":rotationRateProp,"interval":e["interval"],"timeStamp":e.timeStamp},DISPATCH_RUNTIME_AND_SCRIPT)}_OnUpdateCanvasSize(e){const runtimeInterface=this.GetRuntimeInterface();const canvas=runtimeInterface.GetCanvas();canvas.style.width=e["styleWidth"]+"px";canvas.style.height=e["styleHeight"]+"px";canvas.style.marginLeft=e["marginLeft"]+"px";canvas.style.marginTop=e["marginTop"]+"px";runtimeInterface.MaybeForceBodySize(); +if(this._isFirstSizeUpdate){canvas.style.display="";this._isFirstSizeUpdate=false}}_OnInvokeDownload(e){const url=e["url"];const filename=e["filename"];const a=document.createElement("a");const body=document.body;a.textContent=filename;a.href=url;a.download=filename;body.appendChild(a);a.click();body.removeChild(a)}async _OnRasterSvgImage(e){const blob=e["blob"];const imageWidth=e["imageWidth"];const imageHeight=e["imageHeight"];const surfaceWidth=e["surfaceWidth"];const surfaceHeight=e["surfaceHeight"]; +const imageBitmapOpts=e["imageBitmapOpts"];const canvas=await self["C3_RasterSvgImageBlob"](blob,imageWidth,imageHeight,surfaceWidth,surfaceHeight);let ret;if(imageBitmapOpts)ret=await createImageBitmap(canvas,imageBitmapOpts);else ret=await createImageBitmap(canvas);return{"imageBitmap":ret,"transferables":[ret]}}async _OnGetSvgImageSize(e){return await self["C3_GetSvgImageSize"](e["blob"])}async _OnAddStylesheet(e){await AddStyleSheet(e["url"])}_PlayPendingMedia(){const mediaToTryPlay=[...this._mediaPendingPlay]; +this._mediaPendingPlay.clear();if(!this._isSilent)for(const mediaElem of mediaToTryPlay){const playRet=mediaElem.play();if(playRet)playRet.catch(err=>{if(!this._mediaRemovedPendingPlay.has(mediaElem))this._mediaPendingPlay.add(mediaElem)})}}TryPlayMedia(mediaElem){if(typeof mediaElem.play!=="function")throw new Error("missing play function");this._mediaRemovedPendingPlay.delete(mediaElem);let playRet;try{playRet=mediaElem.play()}catch(err){this._mediaPendingPlay.add(mediaElem);return}if(playRet)playRet.catch(err=> +{if(!this._mediaRemovedPendingPlay.has(mediaElem))this._mediaPendingPlay.add(mediaElem)})}RemovePendingPlay(mediaElem){this._mediaPendingPlay.delete(mediaElem);this._mediaRemovedPendingPlay.add(mediaElem)}SetSilent(s){this._isSilent=!!s}_OnHideCordovaSplash(){if(navigator["splashscreen"]&&navigator["splashscreen"]["hide"])navigator["splashscreen"]["hide"]()}_OnDebugHighlight(e){const show=e["show"];if(!show){if(this._debugHighlightElem)this._debugHighlightElem.style.display="none";return}if(!this._debugHighlightElem){this._debugHighlightElem= +document.createElement("div");this._debugHighlightElem.id="inspectOutline";document.body.appendChild(this._debugHighlightElem)}const elem=this._debugHighlightElem;elem.style.display="";elem.style.left=e["left"]-1+"px";elem.style.top=e["top"]-1+"px";elem.style.width=e["width"]+2+"px";elem.style.height=e["height"]+2+"px";elem.textContent=e["name"]}_OnRegisterSW(){if(window["C3_RegisterSW"])window["C3_RegisterSW"]()}_OnPostToDebugger(data){if(!window["c3_postToMessagePort"])return;data["from"]="runtime"; +window["c3_postToMessagePort"](data)}_InvokeFunctionFromJS(name,params){return this.PostToRuntimeAsync("js-invoke-function",{"name":name,"params":params})}_OnAlert(e){alert(e["message"])}};RuntimeInterface.AddDOMHandlerClass(HANDLER_CLASS)}; + + +'use strict';{const DISPATCH_WORKER_SCRIPT_NAME="dispatchworker.js";const JOB_WORKER_SCRIPT_NAME="jobworker.js";self.JobSchedulerDOM=class JobSchedulerDOM{constructor(runtimeInterface){this._runtimeInterface=runtimeInterface;this._baseUrl=runtimeInterface.GetBaseURL();if(runtimeInterface.GetExportType()==="preview")this._baseUrl+="c3/workers/";else this._baseUrl+=runtimeInterface.GetScriptFolder();this._maxNumWorkers=Math.min(navigator.hardwareConcurrency||2,16);this._dispatchWorker=null;this._jobWorkers= +[];this._inputPort=null;this._outputPort=null}async Init(){if(this._hasInitialised)throw new Error("already initialised");this._hasInitialised=true;const dispatchWorkerScriptUrl=this._runtimeInterface._GetWorkerURL(DISPATCH_WORKER_SCRIPT_NAME);this._dispatchWorker=await this._runtimeInterface.CreateWorker(dispatchWorkerScriptUrl,this._baseUrl,{name:"DispatchWorker"});const messageChannel=new MessageChannel;this._inputPort=messageChannel.port1;this._dispatchWorker.postMessage({"type":"_init","in-port":messageChannel.port2}, +[messageChannel.port2]);this._outputPort=await this._CreateJobWorker()}async _CreateJobWorker(){const number=this._jobWorkers.length;const jobWorkerScriptUrl=this._runtimeInterface._GetWorkerURL(JOB_WORKER_SCRIPT_NAME);const jobWorker=await this._runtimeInterface.CreateWorker(jobWorkerScriptUrl,this._baseUrl,{name:"JobWorker"+number});const dispatchChannel=new MessageChannel;const outputChannel=new MessageChannel;this._dispatchWorker.postMessage({"type":"_addJobWorker","port":dispatchChannel.port1}, +[dispatchChannel.port1]);jobWorker.postMessage({"type":"init","number":number,"dispatch-port":dispatchChannel.port2,"output-port":outputChannel.port2},[dispatchChannel.port2,outputChannel.port2]);this._jobWorkers.push(jobWorker);return outputChannel.port1}GetPortData(){return{"inputPort":this._inputPort,"outputPort":this._outputPort,"maxNumWorkers":this._maxNumWorkers}}GetPortTransferables(){return[this._inputPort,this._outputPort]}}}; + + +'use strict';{if(window["C3_IsSupported"]){const enableWorker=true;window["c3_runtimeInterface"]=new self.RuntimeInterface({useWorker:enableWorker,workerMainUrl:"workermain.js",engineScripts:["scripts/c3runtime.js"],projectScripts:[],mainProjectScript:"",scriptsType:"module",scriptFolder:"scripts/",workerDependencyScripts:["box2d.wasm.js"],exportType:"html5"})}}; +'use strict';{const R_TO_D=180/Math.PI;const DOM_COMPONENT_ID="audio";self.AudioDOMHandler=class AudioDOMHandler extends self.DOMHandler{constructor(iRuntime){super(iRuntime,DOM_COMPONENT_ID);this._audioContext=null;this._destinationNode=null;this._hasUnblocked=false;this._hasAttachedUnblockEvents=false;this._unblockFunc=()=>this._UnblockAudioContext();this._audioBuffers=[];this._audioInstances=[];this._lastAudioInstance=null;this._lastPlayedTag="";this._lastTickCount=-1;this._pendingTags=new Map; +this._masterVolume=1;this._isSilent=false;this._timeScaleMode=0;this._timeScale=1;this._gameTime=0;this._panningModel="HRTF";this._distanceModel="inverse";this._refDistance=600;this._maxDistance=1E4;this._rolloffFactor=1;this._playMusicAsSound=false;this._hasAnySoftwareDecodedMusic=false;this._supportsWebMOpus=this._iRuntime.IsAudioFormatSupported("audio/webm; codecs=opus");this._effects=new Map;this._analysers=new Set;this._isPendingPostFxState=false;this._microphoneTag="";this._microphoneSource= +null;self["C3Audio_OnMicrophoneStream"]=(localMediaStream,tag)=>this._OnMicrophoneStream(localMediaStream,tag);this._destMediaStreamNode=null;self["C3Audio_GetOutputStream"]=()=>this._OnGetOutputStream();self["C3Audio_DOMInterface"]=this;this.AddRuntimeMessageHandlers([["create-audio-context",e=>this._CreateAudioContext(e)],["play",e=>this._Play(e)],["stop",e=>this._Stop(e)],["stop-all",()=>this._StopAll()],["set-paused",e=>this._SetPaused(e)],["set-volume",e=>this._SetVolume(e)],["fade-volume",e=> +this._FadeVolume(e)],["set-master-volume",e=>this._SetMasterVolume(e)],["set-muted",e=>this._SetMuted(e)],["set-silent",e=>this._SetSilent(e)],["set-looping",e=>this._SetLooping(e)],["set-playback-rate",e=>this._SetPlaybackRate(e)],["seek",e=>this._Seek(e)],["preload",e=>this._Preload(e)],["unload",e=>this._Unload(e)],["unload-all",()=>this._UnloadAll()],["set-suspended",e=>this._SetSuspended(e)],["add-effect",e=>this._AddEffect(e)],["set-effect-param",e=>this._SetEffectParam(e)],["remove-effects", +e=>this._RemoveEffects(e)],["tick",e=>this._OnTick(e)],["load-state",e=>this._OnLoadState(e)]])}async _CreateAudioContext(e){if(e["isiOSCordova"])this._playMusicAsSound=true;this._timeScaleMode=e["timeScaleMode"];this._panningModel=["equalpower","HRTF","soundfield"][e["panningModel"]];this._distanceModel=["linear","inverse","exponential"][e["distanceModel"]];this._refDistance=e["refDistance"];this._maxDistance=e["maxDistance"];this._rolloffFactor=e["rolloffFactor"];const opts={"latencyHint":e["latencyHint"]}; +if(!this.SupportsWebMOpus())opts["sampleRate"]=48E3;if(typeof AudioContext!=="undefined")this._audioContext=new AudioContext(opts);else if(typeof webkitAudioContext!=="undefined")this._audioContext=new webkitAudioContext(opts);else throw new Error("Web Audio API not supported");this._AttachUnblockEvents();this._audioContext.onstatechange=()=>{if(this._audioContext.state!=="running")this._AttachUnblockEvents()};this._destinationNode=this._audioContext["createGain"]();this._destinationNode["connect"](this._audioContext["destination"]); +const listenerPos=e["listenerPos"];this._audioContext["listener"]["setPosition"](listenerPos[0],listenerPos[1],listenerPos[2]);this._audioContext["listener"]["setOrientation"](0,0,1,0,-1,0);self["C3_GetAudioContextCurrentTime"]=()=>this.GetAudioCurrentTime();try{await Promise.all(e["preloadList"].map(o=>this._GetAudioBuffer(o["originalUrl"],o["url"],o["type"],false)))}catch(err){console.error("[Construct 3] Preloading sounds failed: ",err)}return{"sampleRate":this._audioContext["sampleRate"]}}_AttachUnblockEvents(){if(this._hasAttachedUnblockEvents)return; +this._hasUnblocked=false;window.addEventListener("pointerup",this._unblockFunc,true);window.addEventListener("touchend",this._unblockFunc,true);window.addEventListener("click",this._unblockFunc,true);window.addEventListener("keydown",this._unblockFunc,true);this._hasAttachedUnblockEvents=true}_DetachUnblockEvents(){if(!this._hasAttachedUnblockEvents)return;this._hasUnblocked=true;window.removeEventListener("pointerup",this._unblockFunc,true);window.removeEventListener("touchend",this._unblockFunc, +true);window.removeEventListener("click",this._unblockFunc,true);window.removeEventListener("keydown",this._unblockFunc,true);this._hasAttachedUnblockEvents=false}_UnblockAudioContext(){if(this._hasUnblocked)return;const audioContext=this._audioContext;if(audioContext["state"]==="suspended"&&audioContext["resume"])audioContext["resume"]();const buffer=audioContext["createBuffer"](1,220,22050);const source=audioContext["createBufferSource"]();source["buffer"]=buffer;source["connect"](audioContext["destination"]); +source["start"](0);if(audioContext["state"]==="running")this._DetachUnblockEvents()}GetAudioContext(){return this._audioContext}GetAudioCurrentTime(){return this._audioContext["currentTime"]}GetDestinationNode(){return this._destinationNode}GetDestinationForTag(tag){const fxChain=this._effects.get(tag.toLowerCase());if(fxChain)return fxChain[0].GetInputNode();else return this.GetDestinationNode()}AddEffectForTag(tag,effect){tag=tag.toLowerCase();let fxChain=this._effects.get(tag);if(!fxChain){fxChain= +[];this._effects.set(tag,fxChain)}effect._SetIndex(fxChain.length);effect._SetTag(tag);fxChain.push(effect);this._ReconnectEffects(tag)}_ReconnectEffects(tag){let destNode=this.GetDestinationNode();const fxChain=this._effects.get(tag);if(fxChain&&fxChain.length){destNode=fxChain[0].GetInputNode();for(let i=0,len=fxChain.length;i{const audioBuffer=this._audioContext["createBuffer"](1,rawAudio.length,48E3);const channelBuffer=audioBuffer["getChannelData"](0);channelBuffer.set(rawAudio); +return audioBuffer});else return new Promise((resolve,reject)=>{this._audioContext["decodeAudioData"](audioData,resolve,reject)})}TryPlayMedia(mediaElem){this._iRuntime.TryPlayMedia(mediaElem)}RemovePendingPlay(mediaElem){this._iRuntime.RemovePendingPlay(mediaElem)}ReleaseInstancesForBuffer(buffer){let j=0;for(let i=0,len=this._audioInstances.length;iresolve=r);info={pendingCount:0,promise,resolve};this._pendingTags.set(tag,info)}info.pendingCount++}_RemovePendingTag(tag){const info=this._pendingTags.get(tag);if(!info)throw new Error("expected pending tag");info.pendingCount--;if(info.pendingCount===0){info.resolve();this._pendingTags.delete(tag)}}TagReady(tag){if(!tag)tag= +this._lastPlayedTag;const info=this._pendingTags.get(tag);if(info)return info.promise;else return Promise.resolve()}_MaybeStartTicking(){if(this._analysers.size>0){this._StartTicking();return}for(const ai of this._audioInstances)if(ai.IsActive()){this._StartTicking();return}}Tick(){for(const a of this._analysers)a.Tick();const currentTime=this.GetAudioCurrentTime();for(const ai of this._audioInstances)ai.Tick(currentTime);const instStates=this._audioInstances.filter(a=>a.IsActive()).map(a=>a.GetState()); +this.PostToRuntime("state",{"tickCount":this._lastTickCount,"audioInstances":instStates,"analysers":[...this._analysers].map(a=>a.GetData())});if(instStates.length===0&&this._analysers.size===0)this._StopTicking()}PostTrigger(type,tag,aiid){this.PostToRuntime("trigger",{"type":type,"tag":tag,"aiid":aiid})}async _Play(e){const originalUrl=e["originalUrl"];const url=e["url"];const type=e["type"];const isMusic=e["isMusic"];const tag=e["tag"];const isLooping=e["isLooping"];const volume=e["vol"];const position= +e["pos"];const panning=e["panning"];let startTime=e["off"];if(startTime>0&&!e["trueClock"])if(this._audioContext["getOutputTimestamp"]){const outputTimestamp=this._audioContext["getOutputTimestamp"]();startTime=startTime-outputTimestamp["performanceTime"]/1E3+outputTimestamp["contextTime"]}else startTime=startTime-performance.now()/1E3+this._audioContext["currentTime"];this._lastPlayedTag=tag;this._AddPendingTag(tag);try{this._lastAudioInstance=await this._GetAudioInstance(originalUrl,url,type,tag, +isMusic);if(panning){this._lastAudioInstance.SetPannerEnabled(true);this._lastAudioInstance.SetPan(panning["x"],panning["y"],panning["angle"],panning["innerAngle"],panning["outerAngle"],panning["outerGain"]);if(panning.hasOwnProperty("uid"))this._lastAudioInstance.SetUID(panning["uid"])}else this._lastAudioInstance.SetPannerEnabled(false);this._lastAudioInstance.Play(isLooping,volume,position,startTime)}catch(err){console.error("[Construct 3] Audio: error starting playback: ",err);return}finally{this._RemovePendingTag(tag)}this._StartTicking()}_Stop(e){const tag= +e["tag"];for(const ai of this.audioInstancesByTag(tag))ai.Stop()}_StopAll(){for(const ai of this._audioInstances)ai.Stop()}_SetPaused(e){const tag=e["tag"];const paused=e["paused"];for(const ai of this.audioInstancesByTag(tag))if(paused)ai.Pause();else ai.Resume();this._MaybeStartTicking()}_SetVolume(e){const tag=e["tag"];const vol=e["vol"];for(const ai of this.audioInstancesByTag(tag))ai.SetVolume(vol)}async _FadeVolume(e){const tag=e["tag"];const vol=e["vol"];const duration=e["duration"];const stopOnEnd= +e["stopOnEnd"];await this.TagReady(tag);for(const ai of this.audioInstancesByTag(tag))ai.FadeVolume(vol,duration,stopOnEnd);this._MaybeStartTicking()}_SetMasterVolume(e){this._masterVolume=e["vol"];for(const ai of this._audioInstances)ai._UpdateVolume()}_SetMuted(e){const tag=e["tag"];const isMuted=e["isMuted"];for(const ai of this.audioInstancesByTag(tag))ai.SetMuted(isMuted)}_SetSilent(e){this._isSilent=e["isSilent"];this._iRuntime.SetSilent(this._isSilent);for(const ai of this._audioInstances)ai._UpdateMuted()}_SetLooping(e){const tag= +e["tag"];const isLooping=e["isLooping"];for(const ai of this.audioInstancesByTag(tag))ai.SetLooping(isLooping)}async _SetPlaybackRate(e){const tag=e["tag"];const rate=e["rate"];await this.TagReady(tag);for(const ai of this.audioInstancesByTag(tag))ai.SetPlaybackRate(rate)}async _Seek(e){const tag=e["tag"];const pos=e["pos"];await this.TagReady(tag);for(const ai of this.audioInstancesByTag(tag))ai.Seek(pos)}async _Preload(e){const originalUrl=e["originalUrl"];const url=e["url"];const type=e["type"]; +const isMusic=e["isMusic"];try{await this._GetAudioInstance(originalUrl,url,type,"",isMusic)}catch(err){console.error("[Construct 3] Audio: error preloading: ",err)}}async _Unload(e){const url=e["url"];const type=e["type"];const isMusic=e["isMusic"];const buffer=await this._GetAudioBuffer("",url,type,isMusic,true);if(!buffer)return;buffer.Release();const i=this._audioBuffers.indexOf(buffer);if(i!==-1)this._audioBuffers.splice(i,1)}_UnloadAll(){for(const buffer of this._audioBuffers)buffer.Release(); +this._audioBuffers.length=0}_SetSuspended(e){const isSuspended=e["isSuspended"];if(!isSuspended&&this._audioContext["resume"])this._audioContext["resume"]();for(const ai of this._audioInstances)ai.SetSuspended(isSuspended);if(isSuspended&&this._audioContext["suspend"])this._audioContext["suspend"]()}_OnTick(e){this._timeScale=e["timeScale"];this._gameTime=e["gameTime"];this._lastTickCount=e["tickCount"];if(this._timeScaleMode!==0)for(const ai of this._audioInstances)ai._UpdatePlaybackRate();const listenerPos= +e["listenerPos"];if(listenerPos)this._audioContext["listener"]["setPosition"](listenerPos[0],listenerPos[1],listenerPos[2]);for(const instPan of e["instPans"]){const uid=instPan["uid"];for(const ai of this._audioInstances)if(ai.GetUID()===uid)ai.SetPanXYA(instPan["x"],instPan["y"],instPan["angle"])}}async _AddEffect(e){const type=e["type"];const tag=e["tag"];const params=e["params"];let effect;if(type==="filter")effect=new self.C3AudioFilterFX(this,...params);else if(type==="delay")effect=new self.C3AudioDelayFX(this, +...params);else if(type==="convolution"){let buffer=null;try{buffer=await this._GetAudioBuffer(e["bufferOriginalUrl"],e["bufferUrl"],e["bufferType"],false)}catch(err){console.log("[Construct 3] Audio: error loading convolution: ",err);return}effect=new self.C3AudioConvolveFX(this,buffer.GetAudioBuffer(),...params);effect._SetBufferInfo(e["bufferOriginalUrl"],e["bufferUrl"],e["bufferType"])}else if(type==="flanger")effect=new self.C3AudioFlangerFX(this,...params);else if(type==="phaser")effect=new self.C3AudioPhaserFX(this, +...params);else if(type==="gain")effect=new self.C3AudioGainFX(this,...params);else if(type==="tremolo")effect=new self.C3AudioTremoloFX(this,...params);else if(type==="ringmod")effect=new self.C3AudioRingModFX(this,...params);else if(type==="distortion")effect=new self.C3AudioDistortionFX(this,...params);else if(type==="compressor")effect=new self.C3AudioCompressorFX(this,...params);else if(type==="analyser")effect=new self.C3AudioAnalyserFX(this,...params);else throw new Error("invalid effect type"); +this.AddEffectForTag(tag,effect);this._PostUpdatedFxState()}_SetEffectParam(e){const tag=e["tag"];const index=e["index"];const param=e["param"];const value=e["value"];const ramp=e["ramp"];const time=e["time"];const fxChain=this._effects.get(tag);if(!fxChain||index<0||index>=fxChain.length)return;fxChain[index].SetParam(param,value,ramp,time);this._PostUpdatedFxState()}_RemoveEffects(e){const tag=e["tag"].toLowerCase();const fxChain=this._effects.get(tag);if(!fxChain||!fxChain.length)return;for(const effect of fxChain)effect.Release(); +this._effects.delete(tag);this._ReconnectEffects(tag)}_AddAnalyser(analyser){this._analysers.add(analyser);this._MaybeStartTicking()}_RemoveAnalyser(analyser){this._analysers.delete(analyser)}_PostUpdatedFxState(){if(this._isPendingPostFxState)return;this._isPendingPostFxState=true;Promise.resolve().then(()=>this._DoPostUpdatedFxState())}_DoPostUpdatedFxState(){const fxstate={};for(const [tag,fxChain]of this._effects)fxstate[tag]=fxChain.map(e=>e.GetState());this.PostToRuntime("fxstate",{"fxstate":fxstate}); +this._isPendingPostFxState=false}async _OnLoadState(e){const saveLoadMode=e["saveLoadMode"];if(saveLoadMode!==3)for(const ai of this._audioInstances){if(ai.IsMusic()&&saveLoadMode===1)continue;if(!ai.IsMusic()&&saveLoadMode===2)continue;ai.Stop()}for(const fxChain of this._effects.values())for(const effect of fxChain)effect.Release();this._effects.clear();this._timeScale=e["timeScale"];this._gameTime=e["gameTime"];const listenerPos=e["listenerPos"];this._audioContext["listener"]["setPosition"](listenerPos[0], +listenerPos[1],listenerPos[2]);this._isSilent=e["isSilent"];this._iRuntime.SetSilent(this._isSilent);this._masterVolume=e["masterVolume"];const promises=[];for(const fxChainData of Object.values(e["effects"]))promises.push(Promise.all(fxChainData.map(d=>this._AddEffect(d))));await Promise.all(promises);await Promise.all(e["playing"].map(d=>this._LoadAudioInstance(d,saveLoadMode)));this._MaybeStartTicking()}async _LoadAudioInstance(d,saveLoadMode){if(saveLoadMode===3)return;const originalUrl=d["bufferOriginalUrl"]; +const url=d["bufferUrl"];const type=d["bufferType"];const isMusic=d["isMusic"];const tag=d["tag"];const isLooping=d["isLooping"];const volume=d["volume"];const position=d["playbackTime"];if(isMusic&&saveLoadMode===1)return;if(!isMusic&&saveLoadMode===2)return;let ai=null;try{ai=await this._GetAudioInstance(originalUrl,url,type,tag,isMusic)}catch(err){console.error("[Construct 3] Audio: error loading audio state: ",err);return}ai.LoadPanState(d["pan"]);ai.Play(isLooping,volume,position,0);if(!d["isPlaying"])ai.Pause(); +ai._LoadAdditionalState(d)}_OnMicrophoneStream(localMediaStream,tag){if(this._microphoneSource)this._microphoneSource["disconnect"]();this._microphoneTag=tag.toLowerCase();this._microphoneSource=this._audioContext["createMediaStreamSource"](localMediaStream);this._microphoneSource["connect"](this.GetDestinationForTag(this._microphoneTag))}_OnGetOutputStream(){if(!this._destMediaStreamNode){this._destMediaStreamNode=this._audioContext["createMediaStreamDestination"]();this._destinationNode["connect"](this._destMediaStreamNode)}return this._destMediaStreamNode["stream"]}static EqualsNoCase(a, +b){if(a.length!==b.length)return false;if(a===b)return true;return a.toLowerCase()===b.toLowerCase()}static ToDegrees(x){return x*R_TO_D}static DbToLinearNoCap(x){return Math.pow(10,x/20)}static DbToLinear(x){return Math.max(Math.min(self.AudioDOMHandler.DbToLinearNoCap(x),1),0)}static LinearToDbNoCap(x){return Math.log(x)/Math.log(10)*20}static LinearToDb(x){return self.AudioDOMHandler.LinearToDbNoCap(Math.max(Math.min(x,1),0))}static e4(x,k){return 1-Math.exp(-k*x)}};self.RuntimeInterface.AddDOMHandlerClass(self.AudioDOMHandler)}; +'use strict';{self.C3AudioBuffer=class C3AudioBuffer{constructor(audioDomHandler,originalUrl,url,type,isMusic){this._audioDomHandler=audioDomHandler;this._originalUrl=originalUrl;this._url=url;this._type=type;this._isMusic=isMusic;this._api="";this._loadState="not-loaded";this._loadPromise=null}Release(){this._loadState="not-loaded";this._audioDomHandler=null;this._loadPromise=null}static Create(audioDomHandler,originalUrl,url,type,isMusic){const needsSoftwareDecode=type==="audio/webm; codecs=opus"&& +!audioDomHandler.SupportsWebMOpus();if(isMusic&&needsSoftwareDecode)audioDomHandler._SetHasAnySoftwareDecodedMusic();if(!isMusic||audioDomHandler.IsPlayMusicAsSound()||needsSoftwareDecode)return new self.C3WebAudioBuffer(audioDomHandler,originalUrl,url,type,isMusic,needsSoftwareDecode);else return new self.C3Html5AudioBuffer(audioDomHandler,originalUrl,url,type,isMusic)}CreateInstance(tag){if(this._api==="html5")return new self.C3Html5AudioInstance(this._audioDomHandler,this,tag);else return new self.C3WebAudioInstance(this._audioDomHandler, +this,tag)}_Load(){}Load(){if(!this._loadPromise)this._loadPromise=this._Load();return this._loadPromise}IsLoaded(){}IsLoadedAndDecoded(){}HasFailedToLoad(){return this._loadState==="failed"}GetAudioContext(){return this._audioDomHandler.GetAudioContext()}GetApi(){return this._api}GetOriginalUrl(){return this._originalUrl}GetUrl(){return this._url}GetContentType(){return this._type}IsMusic(){return this._isMusic}GetDuration(){}}}; +'use strict';{self.C3Html5AudioBuffer=class C3Html5AudioBuffer extends self.C3AudioBuffer{constructor(audioDomHandler,originalUrl,url,type,isMusic){super(audioDomHandler,originalUrl,url,type,isMusic);this._api="html5";this._audioElem=new Audio;this._audioElem.crossOrigin="anonymous";this._audioElem.autoplay=false;this._audioElem.preload="auto";this._loadResolve=null;this._loadReject=null;this._reachedCanPlayThrough=false;this._audioElem.addEventListener("canplaythrough",()=>this._reachedCanPlayThrough= +true);this._outNode=this.GetAudioContext()["createGain"]();this._mediaSourceNode=null;this._audioElem.addEventListener("canplay",()=>{if(this._loadResolve){this._loadState="loaded";this._loadResolve();this._loadResolve=null;this._loadReject=null}if(this._mediaSourceNode||!this._audioElem)return;this._mediaSourceNode=this.GetAudioContext()["createMediaElementSource"](this._audioElem);this._mediaSourceNode["connect"](this._outNode)});this.onended=null;this._audioElem.addEventListener("ended",()=>{if(this.onended)this.onended()}); +this._audioElem.addEventListener("error",e=>this._OnError(e))}Release(){this._audioDomHandler.ReleaseInstancesForBuffer(this);this._outNode["disconnect"]();this._outNode=null;this._mediaSourceNode["disconnect"]();this._mediaSourceNode=null;if(this._audioElem&&!this._audioElem.paused)this._audioElem.pause();this.onended=null;this._audioElem=null;super.Release()}_Load(){this._loadState="loading";return new Promise((resolve,reject)=>{this._loadResolve=resolve;this._loadReject=reject;this._audioElem.src= +this._url})}_OnError(e){console.error(`[Construct 3] Audio '${this._url}' error: `,e);if(this._loadReject){this._loadState="failed";this._loadReject(e);this._loadResolve=null;this._loadReject=null}}IsLoaded(){const ret=this._audioElem["readyState"]>=4;if(ret)this._reachedCanPlayThrough=true;return ret||this._reachedCanPlayThrough}IsLoadedAndDecoded(){return this.IsLoaded()}GetAudioElement(){return this._audioElem}GetOutputNode(){return this._outNode}GetDuration(){return this._audioElem["duration"]}}}; +'use strict';{self.C3WebAudioBuffer=class C3WebAudioBuffer extends self.C3AudioBuffer{constructor(audioDomHandler,originalUrl,url,type,isMusic,needsSoftwareDecode){super(audioDomHandler,originalUrl,url,type,isMusic);this._api="webaudio";this._audioData=null;this._audioBuffer=null;this._needsSoftwareDecode=!!needsSoftwareDecode}Release(){this._audioDomHandler.ReleaseInstancesForBuffer(this);this._audioData=null;this._audioBuffer=null;super.Release()}async _Fetch(){if(this._audioData)return this._audioData; +const iRuntime=this._audioDomHandler.GetRuntimeInterface();if(iRuntime.GetExportType()==="cordova"&&iRuntime.IsRelativeURL(this._url)&&location.protocol==="file:")this._audioData=await iRuntime.CordovaFetchLocalFileAsArrayBuffer(this._url);else{const response=await fetch(this._url);if(!response.ok)throw new Error(`error fetching audio data: ${response.status} ${response.statusText}`);this._audioData=await response.arrayBuffer()}}async _Decode(){if(this._audioBuffer)return this._audioBuffer;this._audioBuffer= +await this._audioDomHandler.DecodeAudioData(this._audioData,this._needsSoftwareDecode);this._audioData=null}async _Load(){try{this._loadState="loading";await this._Fetch();await this._Decode();this._loadState="loaded"}catch(err){this._loadState="failed";console.error(`[Construct 3] Failed to load audio '${this._url}': `,err)}}IsLoaded(){return!!(this._audioData||this._audioBuffer)}IsLoadedAndDecoded(){return!!this._audioBuffer}GetAudioBuffer(){return this._audioBuffer}GetDuration(){return this._audioBuffer? +this._audioBuffer["duration"]:0}}}; +'use strict';{let nextAiId=0;self.C3AudioInstance=class C3AudioInstance{constructor(audioDomHandler,buffer,tag){this._audioDomHandler=audioDomHandler;this._buffer=buffer;this._tag=tag;this._aiId=nextAiId++;this._gainNode=this.GetAudioContext()["createGain"]();this._gainNode["connect"](this.GetDestinationNode());this._pannerNode=null;this._isPannerEnabled=false;this._isStopped=true;this._isPaused=false;this._resumeMe=false;this._isLooping=false;this._volume=1;this._isMuted=false;this._playbackRate= +1;const timeScaleMode=this._audioDomHandler.GetTimeScaleMode();this._isTimescaled=timeScaleMode===1&&!this.IsMusic()||timeScaleMode===2;this._instUid=-1;this._fadeEndTime=-1;this._stopOnFadeEnd=false}Release(){this._audioDomHandler=null;this._buffer=null;if(this._pannerNode){this._pannerNode["disconnect"]();this._pannerNode=null}this._gainNode["disconnect"]();this._gainNode=null}GetAudioContext(){return this._audioDomHandler.GetAudioContext()}GetDestinationNode(){return this._audioDomHandler.GetDestinationForTag(this._tag)}GetMasterVolume(){return this._audioDomHandler.GetMasterVolume()}GetCurrentTime(){if(this._isTimescaled)return this._audioDomHandler.GetGameTime(); +else return performance.now()/1E3}GetOriginalUrl(){return this._buffer.GetOriginalUrl()}GetUrl(){return this._buffer.GetUrl()}GetContentType(){return this._buffer.GetContentType()}GetBuffer(){return this._buffer}IsMusic(){return this._buffer.IsMusic()}SetTag(tag){this._tag=tag}GetTag(){return this._tag}GetAiId(){return this._aiId}HasEnded(){}CanBeRecycled(){}IsPlaying(){return!this._isStopped&&!this._isPaused&&!this.HasEnded()}IsActive(){return!this._isStopped&&!this.HasEnded()}GetPlaybackTime(applyPlaybackRate){}GetDuration(applyPlaybackRate){let ret= +this._buffer.GetDuration();if(applyPlaybackRate)ret/=this._playbackRate||.001;return ret}Play(isLooping,vol,seekPos,scheduledTime){}Stop(){}Pause(){}IsPaused(){return this._isPaused}Resume(){}SetVolume(v){this._volume=v;this._gainNode["gain"]["cancelScheduledValues"](0);this._fadeEndTime=-1;this._gainNode["gain"]["value"]=this.GetOverallVolume()}FadeVolume(vol,duration,stopOnEnd){if(this.IsMuted())return;vol*=this.GetMasterVolume();const gainParam=this._gainNode["gain"];gainParam["cancelScheduledValues"](0); +const currentTime=this._audioDomHandler.GetAudioCurrentTime();const endTime=currentTime+duration;gainParam["setValueAtTime"](gainParam["value"],currentTime);gainParam["linearRampToValueAtTime"](vol,endTime);this._volume=vol;this._fadeEndTime=endTime;this._stopOnFadeEnd=stopOnEnd}_UpdateVolume(){this.SetVolume(this._volume)}Tick(currentTime){if(this._fadeEndTime!==-1&¤tTime>=this._fadeEndTime){this._fadeEndTime=-1;if(this._stopOnFadeEnd)this.Stop();this._audioDomHandler.PostTrigger("fade-ended", +this._tag,this._aiId)}}GetOverallVolume(){const ret=this._volume*this.GetMasterVolume();return isFinite(ret)?ret:0}SetMuted(m){m=!!m;if(this._isMuted===m)return;this._isMuted=m;this._UpdateMuted()}IsMuted(){return this._isMuted}IsSilent(){return this._audioDomHandler.IsSilent()}_UpdateMuted(){}SetLooping(l){}IsLooping(){return this._isLooping}SetPlaybackRate(r){if(this._playbackRate===r)return;this._playbackRate=r;this._UpdatePlaybackRate()}_UpdatePlaybackRate(){}GetPlaybackRate(){return this._playbackRate}Seek(pos){}SetSuspended(s){}SetPannerEnabled(e){e= +!!e;if(this._isPannerEnabled===e)return;this._isPannerEnabled=e;if(this._isPannerEnabled){if(!this._pannerNode){this._pannerNode=this.GetAudioContext()["createPanner"]();this._pannerNode["panningModel"]=this._audioDomHandler.GetPanningModel();this._pannerNode["distanceModel"]=this._audioDomHandler.GetDistanceModel();this._pannerNode["refDistance"]=this._audioDomHandler.GetReferenceDistance();this._pannerNode["maxDistance"]=this._audioDomHandler.GetMaxDistance();this._pannerNode["rolloffFactor"]=this._audioDomHandler.GetRolloffFactor()}this._gainNode["disconnect"](); +this._gainNode["connect"](this._pannerNode);this._pannerNode["connect"](this.GetDestinationNode())}else{this._pannerNode["disconnect"]();this._gainNode["disconnect"]();this._gainNode["connect"](this.GetDestinationNode())}}SetPan(x,y,angle,innerAngle,outerAngle,outerGain){if(!this._isPannerEnabled)return;this.SetPanXYA(x,y,angle);const toDegrees=self.AudioDOMHandler.ToDegrees;this._pannerNode["coneInnerAngle"]=toDegrees(innerAngle);this._pannerNode["coneOuterAngle"]=toDegrees(outerAngle);this._pannerNode["coneOuterGain"]= +outerGain}SetPanXYA(x,y,angle){if(!this._isPannerEnabled)return;this._pannerNode["setPosition"](x,y,0);this._pannerNode["setOrientation"](Math.cos(angle),Math.sin(angle),0)}SetUID(uid){this._instUid=uid}GetUID(){return this._instUid}GetResumePosition(){}Reconnect(toNode){const outNode=this._pannerNode||this._gainNode;outNode["disconnect"]();outNode["connect"](toNode)}GetState(){return{"aiid":this.GetAiId(),"tag":this._tag,"duration":this.GetDuration(),"volume":this._volume,"isPlaying":this.IsPlaying(), +"playbackTime":this.GetPlaybackTime(),"playbackRate":this.GetPlaybackRate(),"uid":this._instUid,"bufferOriginalUrl":this.GetOriginalUrl(),"bufferUrl":"","bufferType":this.GetContentType(),"isMusic":this.IsMusic(),"isLooping":this.IsLooping(),"isMuted":this.IsMuted(),"resumePosition":this.GetResumePosition(),"pan":this.GetPanState()}}_LoadAdditionalState(d){this.SetPlaybackRate(d["playbackRate"]);this.SetMuted(d["isMuted"])}GetPanState(){if(!this._pannerNode)return null;const pn=this._pannerNode;return{"pos":[pn["positionX"]["value"], +pn["positionY"]["value"],pn["positionZ"]["value"]],"orient":[pn["orientationX"]["value"],pn["orientationY"]["value"],pn["orientationZ"]["value"]],"cia":pn["coneInnerAngle"],"coa":pn["coneOuterAngle"],"cog":pn["coneOuterGain"],"uid":this._instUid}}LoadPanState(d){if(!d){this.SetPannerEnabled(false);return}this.SetPannerEnabled(true);const pn=this._pannerNode;pn["setPosition"](...pn["pos"]);pn["setOrientation"](...pn["orient"]);pn["coneInnerAngle"]=pn["cia"];pn["coneOuterAngle"]=pn["coa"];pn["coneOuterGain"]= +pn["cog"];this._instUid=pn["uid"]}}}; +'use strict';{self.C3Html5AudioInstance=class C3Html5AudioInstance extends self.C3AudioInstance{constructor(audioDomHandler,buffer,tag){super(audioDomHandler,buffer,tag);this._buffer.GetOutputNode()["connect"](this._gainNode);this._buffer.onended=()=>this._OnEnded()}Release(){this.Stop();this._buffer.GetOutputNode()["disconnect"]();super.Release()}GetAudioElement(){return this._buffer.GetAudioElement()}_OnEnded(){this._isStopped=true;this._instUid=-1;this._audioDomHandler.PostTrigger("ended",this._tag, +this._aiId)}HasEnded(){return this.GetAudioElement()["ended"]}CanBeRecycled(){if(this._isStopped)return true;return this.HasEnded()}GetPlaybackTime(applyPlaybackRate){let ret=this.GetAudioElement()["currentTime"];if(applyPlaybackRate)ret*=this._playbackRate;if(!this._isLooping)ret=Math.min(ret,this.GetDuration());return ret}Play(isLooping,vol,seekPos,scheduledTime){const audioElem=this.GetAudioElement();if(audioElem.playbackRate!==1)audioElem.playbackRate=1;if(audioElem.loop!==isLooping)audioElem.loop= +isLooping;this.SetVolume(vol);if(audioElem.muted)audioElem.muted=false;if(audioElem.currentTime!==seekPos)try{audioElem.currentTime=seekPos}catch(err){console.warn(`[Construct 3] Exception seeking audio '${this._buffer.GetUrl()}' to position '${seekPos}': `,err)}this._audioDomHandler.TryPlayMedia(audioElem);this._isStopped=false;this._isPaused=false;this._isLooping=isLooping;this._playbackRate=1}Stop(){const audioElem=this.GetAudioElement();if(!audioElem.paused)audioElem.pause();this._audioDomHandler.RemovePendingPlay(audioElem); +this._isStopped=true;this._isPaused=false;this._instUid=-1}Pause(){if(this._isPaused||this._isStopped||this.HasEnded())return;const audioElem=this.GetAudioElement();if(!audioElem.paused)audioElem.pause();this._audioDomHandler.RemovePendingPlay(audioElem);this._isPaused=true}Resume(){if(!this._isPaused||this._isStopped||this.HasEnded())return;this._audioDomHandler.TryPlayMedia(this.GetAudioElement());this._isPaused=false}_UpdateMuted(){this.GetAudioElement().muted=this._isMuted||this.IsSilent()}SetLooping(l){l= +!!l;if(this._isLooping===l)return;this._isLooping=l;this.GetAudioElement().loop=l}_UpdatePlaybackRate(){let r=this._playbackRate;if(this._isTimescaled)r*=this._audioDomHandler.GetTimeScale();try{this.GetAudioElement()["playbackRate"]=r}catch(err){console.warn(`[Construct 3] Unable to set playback rate '${r}':`,err)}}Seek(pos){if(this._isStopped||this.HasEnded())return;try{this.GetAudioElement()["currentTime"]=pos}catch(err){console.warn(`[Construct 3] Error seeking audio to '${pos}': `,err)}}GetResumePosition(){return this.GetPlaybackTime()}SetSuspended(s){if(s)if(this.IsPlaying()){this.GetAudioElement()["pause"](); +this._resumeMe=true}else this._resumeMe=false;else if(this._resumeMe){this._audioDomHandler.TryPlayMedia(this.GetAudioElement());this._resumeMe=false}}}}; +'use strict';{self.C3WebAudioInstance=class C3WebAudioInstance extends self.C3AudioInstance{constructor(audioDomHandler,buffer,tag){super(audioDomHandler,buffer,tag);this._bufferSource=null;this._onended_handler=e=>this._OnEnded(e);this._hasPlaybackEnded=true;this._activeSource=null;this._startTime=0;this._resumePosition=0;this._muteVol=1}Release(){this.Stop();this._ReleaseBufferSource();this._onended_handler=null;super.Release()}_ReleaseBufferSource(){if(this._bufferSource)this._bufferSource["disconnect"](); +this._bufferSource=null;this._activeSource=null}_OnEnded(e){if(this._isPaused||this._resumeMe)return;if(e.target!==this._activeSource)return;this._hasPlaybackEnded=true;this._isStopped=true;this._instUid=-1;this._ReleaseBufferSource();this._audioDomHandler.PostTrigger("ended",this._tag,this._aiId)}HasEnded(){if(!this._isStopped&&this._bufferSource&&this._bufferSource["loop"])return false;if(this._isPaused)return false;return this._hasPlaybackEnded}CanBeRecycled(){if(!this._bufferSource||this._isStopped)return true; +return this.HasEnded()}GetPlaybackTime(applyPlaybackRate){let ret=0;if(this._isPaused)ret=this._resumePosition;else ret=this.GetCurrentTime()-this._startTime;if(applyPlaybackRate)ret*=this._playbackRate;if(!this._isLooping)ret=Math.min(ret,this.GetDuration());return ret}Play(isLooping,vol,seekPos,scheduledTime){this._muteVol=1;this.SetVolume(vol);this._ReleaseBufferSource();this._bufferSource=this.GetAudioContext()["createBufferSource"]();this._bufferSource["buffer"]=this._buffer.GetAudioBuffer(); +this._bufferSource["connect"](this._gainNode);this._activeSource=this._bufferSource;this._bufferSource["onended"]=this._onended_handler;this._bufferSource["loop"]=isLooping;this._bufferSource["start"](scheduledTime,seekPos);this._hasPlaybackEnded=false;this._isStopped=false;this._isPaused=false;this._isLooping=isLooping;this._playbackRate=1;this._startTime=this.GetCurrentTime()-seekPos}Stop(){if(this._bufferSource)try{this._bufferSource["stop"](0)}catch(err){}this._isStopped=true;this._isPaused=false; +this._instUid=-1}Pause(){if(this._isPaused||this._isStopped||this.HasEnded())return;this._resumePosition=this.GetPlaybackTime(true);if(this._isLooping)this._resumePosition%=this.GetDuration();this._isPaused=true;this._bufferSource["stop"](0)}Resume(){if(!this._isPaused||this._isStopped||this.HasEnded())return;this._ReleaseBufferSource();this._bufferSource=this.GetAudioContext()["createBufferSource"]();this._bufferSource["buffer"]=this._buffer.GetAudioBuffer();this._bufferSource["connect"](this._gainNode); +this._activeSource=this._bufferSource;this._bufferSource["onended"]=this._onended_handler;this._bufferSource["loop"]=this._isLooping;this._UpdateVolume();this._UpdatePlaybackRate();this._startTime=this.GetCurrentTime()-this._resumePosition/(this._playbackRate||.001);this._bufferSource["start"](0,this._resumePosition);this._isPaused=false}GetOverallVolume(){return super.GetOverallVolume()*this._muteVol}_UpdateMuted(){this._muteVol=this._isMuted||this.IsSilent()?0:1;this._UpdateVolume()}SetLooping(l){l= +!!l;if(this._isLooping===l)return;this._isLooping=l;if(this._bufferSource)this._bufferSource["loop"]=l}_UpdatePlaybackRate(){let r=this._playbackRate;if(this._isTimescaled)r*=this._audioDomHandler.GetTimeScale();if(this._bufferSource)this._bufferSource["playbackRate"]["value"]=r}Seek(pos){if(this._isStopped||this.HasEnded())return;if(this._isPaused)this._resumePosition=pos;else{this.Pause();this._resumePosition=pos;this.Resume()}}GetResumePosition(){return this._resumePosition}SetSuspended(s){if(s)if(this.IsPlaying()){this._resumeMe= +true;this._resumePosition=this.GetPlaybackTime(true);if(this._isLooping)this._resumePosition%=this.GetDuration();this._bufferSource["stop"](0)}else this._resumeMe=false;else if(this._resumeMe){this._ReleaseBufferSource();this._bufferSource=this.GetAudioContext()["createBufferSource"]();this._bufferSource["buffer"]=this._buffer.GetAudioBuffer();this._bufferSource["connect"](this._gainNode);this._activeSource=this._bufferSource;this._bufferSource["onended"]=this._onended_handler;this._bufferSource["loop"]= +this._isLooping;this._UpdateVolume();this._UpdatePlaybackRate();this._startTime=this.GetCurrentTime()-this._resumePosition/(this._playbackRate||.001);this._bufferSource["start"](0,this._resumePosition);this._resumeMe=false}}_LoadAdditionalState(d){super._LoadAdditionalState(d);this._resumePosition=d["resumePosition"]}}}; +'use strict';{class AudioFXBase{constructor(audioDomHandler){this._audioDomHandler=audioDomHandler;this._audioContext=audioDomHandler.GetAudioContext();this._index=-1;this._tag="";this._type="";this._params=null}Release(){this._audioContext=null}_SetIndex(i){this._index=i}GetIndex(){return this._index}_SetTag(t){this._tag=t}GetTag(){return this._tag}CreateGain(){return this._audioContext["createGain"]()}GetInputNode(){}ConnectTo(node){}SetAudioParam(ap,value,ramp,time){ap["cancelScheduledValues"](0); +if(time===0){ap["value"]=value;return}const curTime=this._audioContext["currentTime"];time+=curTime;switch(ramp){case 0:ap["setValueAtTime"](value,time);break;case 1:ap["setValueAtTime"](ap["value"],curTime);ap["linearRampToValueAtTime"](value,time);break;case 2:ap["setValueAtTime"](ap["value"],curTime);ap["exponentialRampToValueAtTime"](value,time);break}}GetState(){return{"type":this._type,"tag":this._tag,"params":this._params}}}self.C3AudioFilterFX=class C3AudioFilterFX extends AudioFXBase{constructor(audioDomHandler, +type,freq,detune,q,gain,mix){super(audioDomHandler);this._type="filter";this._params=[type,freq,detune,q,gain,mix];this._inputNode=this.CreateGain();this._wetNode=this.CreateGain();this._wetNode["gain"]["value"]=mix;this._dryNode=this.CreateGain();this._dryNode["gain"]["value"]=1-mix;this._filterNode=this._audioContext["createBiquadFilter"]();this._filterNode["type"]=type;this._filterNode["frequency"]["value"]=freq;this._filterNode["detune"]["value"]=detune;this._filterNode["Q"]["value"]=q;this._filterNode["gain"]["vlaue"]= +gain;this._inputNode["connect"](this._filterNode);this._inputNode["connect"](this._dryNode);this._filterNode["connect"](this._wetNode)}Release(){this._inputNode["disconnect"]();this._filterNode["disconnect"]();this._wetNode["disconnect"]();this._dryNode["disconnect"]();super.Release()}ConnectTo(node){this._wetNode["disconnect"]();this._wetNode["connect"](node);this._dryNode["disconnect"]();this._dryNode["connect"](node)}GetInputNode(){return this._inputNode}SetParam(param,value,ramp,time){switch(param){case 0:value= +Math.max(Math.min(value/100,1),0);this._params[5]=value;this.SetAudioParam(this._wetNode["gain"],value,ramp,time);this.SetAudioParam(this._dryNode["gain"],1-value,ramp,time);break;case 1:this._params[1]=value;this.SetAudioParam(this._filterNode["frequency"],value,ramp,time);break;case 2:this._params[2]=value;this.SetAudioParam(this._filterNode["detune"],value,ramp,time);break;case 3:this._params[3]=value;this.SetAudioParam(this._filterNode["Q"],value,ramp,time);break;case 4:this._params[4]=value; +this.SetAudioParam(this._filterNode["gain"],value,ramp,time);break}}};self.C3AudioDelayFX=class C3AudioDelayFX extends AudioFXBase{constructor(audioDomHandler,delayTime,delayGain,mix){super(audioDomHandler);this._type="delay";this._params=[delayTime,delayGain,mix];this._inputNode=this.CreateGain();this._wetNode=this.CreateGain();this._wetNode["gain"]["value"]=mix;this._dryNode=this.CreateGain();this._dryNode["gain"]["value"]=1-mix;this._mainNode=this.CreateGain();this._delayNode=this._audioContext["createDelay"](delayTime); +this._delayNode["delayTime"]["value"]=delayTime;this._delayGainNode=this.CreateGain();this._delayGainNode["gain"]["value"]=delayGain;this._inputNode["connect"](this._mainNode);this._inputNode["connect"](this._dryNode);this._mainNode["connect"](this._wetNode);this._mainNode["connect"](this._delayNode);this._delayNode["connect"](this._delayGainNode);this._delayGainNode["connect"](this._mainNode)}Release(){this._inputNode["disconnect"]();this._wetNode["disconnect"]();this._dryNode["disconnect"]();this._mainNode["disconnect"](); +this._delayNode["disconnect"]();this._delayGainNode["disconnect"]();super.Release()}ConnectTo(node){this._wetNode["disconnect"]();this._wetNode["connect"](node);this._dryNode["disconnect"]();this._dryNode["connect"](node)}GetInputNode(){return this._inputNode}SetParam(param,value,ramp,time){const DbToLinear=self.AudioDOMHandler.DbToLinear;switch(param){case 0:value=Math.max(Math.min(value/100,1),0);this._params[2]=value;this.SetAudioParam(this._wetNode["gain"],value,ramp,time);this.SetAudioParam(this._dryNode["gain"], +1-value,ramp,time);break;case 4:this._params[1]=DbToLinear(value);this.SetAudioParam(this._delayGainNode["gain"],DbToLinear(value),ramp,time);break;case 5:this._params[0]=value;this.SetAudioParam(this._delayNode["delayTime"],value,ramp,time);break}}};self.C3AudioConvolveFX=class C3AudioConvolveFX extends AudioFXBase{constructor(audioDomHandler,buffer,normalize,mix){super(audioDomHandler);this._type="convolution";this._params=[normalize,mix];this._bufferOriginalUrl="";this._bufferUrl="";this._bufferType= +"";this._inputNode=this.CreateGain();this._wetNode=this.CreateGain();this._wetNode["gain"]["value"]=mix;this._dryNode=this.CreateGain();this._dryNode["gain"]["value"]=1-mix;this._convolveNode=this._audioContext["createConvolver"]();this._convolveNode["normalize"]=normalize;this._convolveNode["buffer"]=buffer;this._inputNode["connect"](this._convolveNode);this._inputNode["connect"](this._dryNode);this._convolveNode["connect"](this._wetNode)}Release(){this._inputNode["disconnect"]();this._convolveNode["disconnect"](); +this._wetNode["disconnect"]();this._dryNode["disconnect"]();super.Release()}ConnectTo(node){this._wetNode["disconnect"]();this._wetNode["connect"](node);this._dryNode["disconnect"]();this._dryNode["connect"](node)}GetInputNode(){return this._inputNode}SetParam(param,value,ramp,time){switch(param){case 0:value=Math.max(Math.min(value/100,1),0);this._params[1]=value;this.SetAudioParam(this._wetNode["gain"],value,ramp,time);this.SetAudioParam(this._dryNode["gain"],1-value,ramp,time);break}}_SetBufferInfo(bufferOriginalUrl, +bufferUrl,bufferType){this._bufferOriginalUrl=bufferOriginalUrl;this._bufferUrl=bufferUrl;this._bufferType=bufferType}GetState(){const ret=super.GetState();ret["bufferOriginalUrl"]=this._bufferOriginalUrl;ret["bufferUrl"]="";ret["bufferType"]=this._bufferType;return ret}};self.C3AudioFlangerFX=class C3AudioFlangerFX extends AudioFXBase{constructor(audioDomHandler,delay,modulation,freq,feedback,mix){super(audioDomHandler);this._type="flanger";this._params=[delay,modulation,freq,feedback,mix];this._inputNode= +this.CreateGain();this._dryNode=this.CreateGain();this._dryNode["gain"]["value"]=1-mix/2;this._wetNode=this.CreateGain();this._wetNode["gain"]["value"]=mix/2;this._feedbackNode=this.CreateGain();this._feedbackNode["gain"]["value"]=feedback;this._delayNode=this._audioContext["createDelay"](delay+modulation);this._delayNode["delayTime"]["value"]=delay;this._oscNode=this._audioContext["createOscillator"]();this._oscNode["frequency"]["value"]=freq;this._oscGainNode=this.CreateGain();this._oscGainNode["gain"]["value"]= +modulation;this._inputNode["connect"](this._delayNode);this._inputNode["connect"](this._dryNode);this._delayNode["connect"](this._wetNode);this._delayNode["connect"](this._feedbackNode);this._feedbackNode["connect"](this._delayNode);this._oscNode["connect"](this._oscGainNode);this._oscGainNode["connect"](this._delayNode["delayTime"]);this._oscNode["start"](0)}Release(){this._oscNode["stop"](0);this._inputNode["disconnect"]();this._delayNode["disconnect"]();this._oscNode["disconnect"]();this._oscGainNode["disconnect"](); +this._dryNode["disconnect"]();this._wetNode["disconnect"]();this._feedbackNode["disconnect"]();super.Release()}ConnectTo(node){this._wetNode["disconnect"]();this._wetNode["connect"](node);this._dryNode["disconnect"]();this._dryNode["connect"](node)}GetInputNode(){return this._inputNode}SetParam(param,value,ramp,time){switch(param){case 0:value=Math.max(Math.min(value/100,1),0);this._params[4]=value;this.SetAudioParam(this._wetNode["gain"],value/2,ramp,time);this.SetAudioParam(this._dryNode["gain"], +1-value/2,ramp,time);break;case 6:this._params[1]=value/1E3;this.SetAudioParam(this._oscGainNode["gain"],value/1E3,ramp,time);break;case 7:this._params[2]=value;this.SetAudioParam(this._oscNode["frequency"],value,ramp,time);break;case 8:this._params[3]=value/100;this.SetAudioParam(this._feedbackNode["gain"],value/100,ramp,time);break}}};self.C3AudioPhaserFX=class C3AudioPhaserFX extends AudioFXBase{constructor(audioDomHandler,freq,detune,q,modulation,modfreq,mix){super(audioDomHandler);this._type= +"phaser";this._params=[freq,detune,q,modulation,modfreq,mix];this._inputNode=this.CreateGain();this._dryNode=this.CreateGain();this._dryNode["gain"]["value"]=1-mix/2;this._wetNode=this.CreateGain();this._wetNode["gain"]["value"]=mix/2;this._filterNode=this._audioContext["createBiquadFilter"]();this._filterNode["type"]="allpass";this._filterNode["frequency"]["value"]=freq;this._filterNode["detune"]["value"]=detune;this._filterNode["Q"]["value"]=q;this._oscNode=this._audioContext["createOscillator"](); +this._oscNode["frequency"]["value"]=modfreq;this._oscGainNode=this.CreateGain();this._oscGainNode["gain"]["value"]=modulation;this._inputNode["connect"](this._filterNode);this._inputNode["connect"](this._dryNode);this._filterNode["connect"](this._wetNode);this._oscNode["connect"](this._oscGainNode);this._oscGainNode["connect"](this._filterNode["frequency"]);this._oscNode["start"](0)}Release(){this._oscNode["stop"](0);this._inputNode["disconnect"]();this._filterNode["disconnect"]();this._oscNode["disconnect"](); +this._oscGainNode["disconnect"]();this._dryNode["disconnect"]();this._wetNode["disconnect"]();super.Release()}ConnectTo(node){this._wetNode["disconnect"]();this._wetNode["connect"](node);this._dryNode["disconnect"]();this._dryNode["connect"](node)}GetInputNode(){return this._inputNode}SetParam(param,value,ramp,time){switch(param){case 0:value=Math.max(Math.min(value/100,1),0);this._params[5]=value;this.SetAudioParam(this._wetNode["gain"],value/2,ramp,time);this.SetAudioParam(this._dryNode["gain"], +1-value/2,ramp,time);break;case 1:this._params[0]=value;this.SetAudioParam(this._filterNode["frequency"],value,ramp,time);break;case 2:this._params[1]=value;this.SetAudioParam(this._filterNode["detune"],value,ramp,time);break;case 3:this._params[2]=value;this.SetAudioParam(this._filterNode["Q"],value,ramp,time);break;case 6:this._params[3]=value;this.SetAudioParam(this._oscGainNode["gain"],value,ramp,time);break;case 7:this._params[4]=value;this.SetAudioParam(this._oscNode["frequency"],value,ramp, +time);break}}};self.C3AudioGainFX=class C3AudioGainFX extends AudioFXBase{constructor(audioDomHandler,g){super(audioDomHandler);this._type="gain";this._params=[g];this._node=this.CreateGain();this._node["gain"]["value"]=g}Release(){this._node["disconnect"]();super.Release()}ConnectTo(node){this._node["disconnect"]();this._node["connect"](node)}GetInputNode(){return this._node}SetParam(param,value,ramp,time){const DbToLinear=self.AudioDOMHandler.DbToLinear;switch(param){case 4:this._params[0]=DbToLinear(value); +this.SetAudioParam(this._node["gain"],DbToLinear(value),ramp,time);break}}};self.C3AudioTremoloFX=class C3AudioTremoloFX extends AudioFXBase{constructor(audioDomHandler,freq,mix){super(audioDomHandler);this._type="tremolo";this._params=[freq,mix];this._node=this.CreateGain();this._node["gain"]["value"]=1-mix/2;this._oscNode=this._audioContext["createOscillator"]();this._oscNode["frequency"]["value"]=freq;this._oscGainNode=this.CreateGain();this._oscGainNode["gain"]["value"]=mix/2;this._oscNode["connect"](this._oscGainNode); +this._oscGainNode["connect"](this._node["gain"]);this._oscNode["start"](0)}Release(){this._oscNode["stop"](0);this._oscNode["disconnect"]();this._oscGainNode["disconnect"]();this._node["disconnect"]();super.Release()}ConnectTo(node){this._node["disconnect"]();this._node["connect"](node)}GetInputNode(){return this._node}SetParam(param,value,ramp,time){switch(param){case 0:value=Math.max(Math.min(value/100,1),0);this._params[1]=value;this.SetAudioParam(this._node["gain"],1-value/2,ramp,time);this.SetAudioParam(this._oscGainNode["gain"], +value/2,ramp,time);break;case 7:this._params[0]=value;this.SetAudioParam(this._oscNode["frequency"],value,ramp,time);break}}};self.C3AudioRingModFX=class C3AudioRingModFX extends AudioFXBase{constructor(audioDomHandler,freq,mix){super(audioDomHandler);this._type="ringmod";this._params=[freq,mix];this._inputNode=this.CreateGain();this._wetNode=this.CreateGain();this._wetNode["gain"]["value"]=mix;this._dryNode=this.CreateGain();this._dryNode["gain"]["value"]=1-mix;this._ringNode=this.CreateGain();this._ringNode["gain"]["value"]= +0;this._oscNode=this._audioContext["createOscillator"]();this._oscNode["frequency"]["value"]=freq;this._oscNode["connect"](this._ringNode["gain"]);this._oscNode["start"](0);this._inputNode["connect"](this._ringNode);this._inputNode["connect"](this._dryNode);this._ringNode["connect"](this._wetNode)}Release(){this._oscNode["stop"](0);this._oscNode["disconnect"]();this._ringNode["disconnect"]();this._inputNode["disconnect"]();this._wetNode["disconnect"]();this._dryNode["disconnect"]();super.Release()}ConnectTo(node){this._wetNode["disconnect"](); +this._wetNode["connect"](node);this._dryNode["disconnect"]();this._dryNode["connect"](node)}GetInputNode(){return this._inputNode}SetParam(param,value,ramp,time){switch(param){case 0:value=Math.max(Math.min(value/100,1),0);this._params[1]=value;this.SetAudioParam(this._wetNode["gain"],value,ramp,time);this.SetAudioParam(this._dryNode["gain"],1-value,ramp,time);break;case 7:this._params[0]=value;this.SetAudioParam(this._oscNode["frequency"],value,ramp,time);break}}};self.C3AudioDistortionFX=class C3AudioDistortionFX extends AudioFXBase{constructor(audioDomHandler, +threshold,headroom,drive,makeupgain,mix){super(audioDomHandler);this._type="distortion";this._params=[threshold,headroom,drive,makeupgain,mix];this._inputNode=this.CreateGain();this._preGain=this.CreateGain();this._postGain=this.CreateGain();this._SetDrive(drive,makeupgain);this._wetNode=this.CreateGain();this._wetNode["gain"]["value"]=mix;this._dryNode=this.CreateGain();this._dryNode["gain"]["value"]=1-mix;this._waveShaper=this._audioContext["createWaveShaper"]();this._curve=new Float32Array(65536); +this._GenerateColortouchCurve(threshold,headroom);this._waveShaper.curve=this._curve;this._inputNode["connect"](this._preGain);this._inputNode["connect"](this._dryNode);this._preGain["connect"](this._waveShaper);this._waveShaper["connect"](this._postGain);this._postGain["connect"](this._wetNode)}Release(){this._inputNode["disconnect"]();this._preGain["disconnect"]();this._waveShaper["disconnect"]();this._postGain["disconnect"]();this._wetNode["disconnect"]();this._dryNode["disconnect"]();super.Release()}_SetDrive(drive, +makeupgain){if(drive<.01)drive=.01;this._preGain["gain"]["value"]=drive;this._postGain["gain"]["value"]=Math.pow(1/drive,.6)*makeupgain}_GenerateColortouchCurve(threshold,headroom){const n=65536;const n2=n/2;for(let i=0;ithis._OnGetInitialState(e)],["ready-for-sw-messages",()=>this._OnReadyForSWMessages()],["alert",e=>this._OnAlert(e)],["close",()=>this._OnClose()],["set-focus",e=>this._OnSetFocus(e)],["vibrate",e=>this._OnVibrate(e)],["lock-orientation",e=>this._OnLockOrientation(e)], +["unlock-orientation",()=>this._OnUnlockOrientation()],["navigate",e=>this._OnNavigate(e)],["request-fullscreen",e=>this._OnRequestFullscreen(e)],["exit-fullscreen",()=>this._OnExitFullscreen()],["set-hash",e=>this._OnSetHash(e)]]);window.addEventListener("online",()=>this._OnOnlineStateChanged(true));window.addEventListener("offline",()=>this._OnOnlineStateChanged(false));window.addEventListener("hashchange",()=>this._OnHashChange());document.addEventListener("backbutton",()=>this._OnCordovaBackButton()); +if(typeof Windows!=="undefined")Windows["UI"]["Core"]["SystemNavigationManager"]["getForCurrentView"]().addEventListener("backrequested",e=>this._OnWin10BackRequested(e))}_OnGetInitialState(e){this._exportType=e["exportType"];return{"location":location.toString(),"isOnline":!!navigator.onLine,"referrer":document.referrer,"title":document.title,"isCookieEnabled":!!navigator.cookieEnabled,"screenWidth":screen.width,"screenHeight":screen.height,"windowOuterWidth":window.outerWidth,"windowOuterHeight":window.outerHeight, +"isScirraArcade":typeof window["is_scirra_arcade"]!=="undefined"}}_OnReadyForSWMessages(){if(!window["C3_RegisterSW"]||!window["OfflineClientInfo"])return;window["OfflineClientInfo"]["SetMessageCallback"](e=>this.PostToRuntime("sw-message",e["data"]))}_OnOnlineStateChanged(isOnline){this.PostToRuntime("online-state",{"isOnline":isOnline})}_OnCordovaBackButton(){this.PostToRuntime("backbutton")}_OnWin10BackRequested(e){e["handled"]=true;this.PostToRuntime("backbutton")}GetNWjsWindow(){if(this._exportType=== +"nwjs")return nw["Window"]["get"]();else return null}_OnAlert(e){alert(e["message"])}_OnClose(){if(navigator["app"]&&navigator["app"]["exitApp"])navigator["app"]["exitApp"]();else if(navigator["device"]&&navigator["device"]["exitApp"])navigator["device"]["exitApp"]();else window.close()}_OnSetFocus(e){const isFocus=e["isFocus"];if(this._exportType==="nwjs"){const win=this.GetNWjsWindow();if(isFocus)win["focus"]();else win["blur"]()}else if(isFocus)window.focus();else window.blur()}_OnVibrate(e){if(navigator["vibrate"])navigator["vibrate"](e["pattern"])}_OnLockOrientation(e){const orientation= +e["orientation"];if(screen["orientation"]&&screen["orientation"]["lock"])screen["orientation"]["lock"](orientation).catch(err=>console.warn("[Construct 3] Failed to lock orientation: ",err));else try{let result=false;if(screen["lockOrientation"])result=screen["lockOrientation"](orientation);else if(screen["webkitLockOrientation"])result=screen["webkitLockOrientation"](orientation);else if(screen["mozLockOrientation"])result=screen["mozLockOrientation"](orientation);else if(screen["msLockOrientation"])result= +screen["msLockOrientation"](orientation);if(!result)console.warn("[Construct 3] Failed to lock orientation")}catch(err){console.warn("[Construct 3] Failed to lock orientation: ",err)}}_OnUnlockOrientation(){try{if(screen["orientation"]&&screen["orientation"]["unlock"])screen["orientation"]["unlock"]();else if(screen["unlockOrientation"])screen["unlockOrientation"]();else if(screen["webkitUnlockOrientation"])screen["webkitUnlockOrientation"]();else if(screen["mozUnlockOrientation"])screen["mozUnlockOrientation"](); +else if(screen["msUnlockOrientation"])screen["msUnlockOrientation"]()}catch(err){}}_OnNavigate(e){const type=e["type"];if(type==="back")if(navigator["app"]&&navigator["app"]["backHistory"])navigator["app"]["backHistory"]();else window.back();else if(type==="forward")window.forward();else if(type==="home")window.home();else if(type==="reload")location.reload();else if(type==="url"){const url=e["url"];const target=e["target"];const exportType=e["exportType"];if(exportType==="windows-uwp"&&typeof Windows!== +"undefined")Windows["System"]["Launcher"]["launchUriAsync"](new Windows["Foundation"]["Uri"](url));else if(self["cordova"]&&self["cordova"]["InAppBrowser"])self["cordova"]["InAppBrowser"]["open"](url,"_system");else if(exportType==="preview")window.open(url,"_blank");else if(!this._isScirraArcade)if(target===2)window.top.location=url;else if(target===1)window.parent.location=url;else window.location=url}else if(type==="new-window"){const url=e["url"];const tag=e["tag"];const exportType=e["exportType"]; +if(exportType==="windows-uwp"&&typeof Windows!=="undefined")Windows["System"]["Launcher"]["launchUriAsync"](new Windows["Foundation"]["Uri"](url));else if(self["cordova"]&&self["cordova"]["InAppBrowser"])self["cordova"]["InAppBrowser"]["open"](url,"_system");else window.open(url,tag)}}_OnRequestFullscreen(e){const opts={"navigationUI":"auto"};const navUI=e["navUI"];if(navUI===1)opts["navigationUI"]="hide";else if(navUI===2)opts["navigationUI"]="show";const elem=document.documentElement;if(elem["requestFullscreen"])elem["requestFullscreen"](opts); +else if(elem["mozRequestFullScreen"])elem["mozRequestFullScreen"](opts);else if(elem["msRequestFullscreen"])elem["msRequestFullscreen"](opts);else if(elem["webkitRequestFullScreen"])if(typeof Element["ALLOW_KEYBOARD_INPUT"]!=="undefined")elem["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"]);else elem["webkitRequestFullScreen"]()}_OnExitFullscreen(){if(document["exitFullscreen"])document["exitFullscreen"]();else if(document["mozCancelFullScreen"])document["mozCancelFullScreen"]();else if(document["msExitFullscreen"])document["msExitFullscreen"](); +else if(document["webkitCancelFullScreen"])document["webkitCancelFullScreen"]()}_OnSetHash(e){location.hash=e["hash"]}_OnHashChange(){this.PostToRuntime("hashchange",{"location":location.toString()})}};self.RuntimeInterface.AddDOMHandlerClass(HANDLER_CLASS)}; +'use strict';{const DOM_COMPONENT_ID="touch";const HANDLER_CLASS=class TouchDOMHandler extends self.DOMHandler{constructor(iRuntime){super(iRuntime,DOM_COMPONENT_ID);this.AddRuntimeMessageHandler("request-permission",e=>this._OnRequestPermission(e))}async _OnRequestPermission(e){const type=e["type"];let result=true;if(type===0)result=await this._RequestOrientationPermission();else if(type===1)result=await this._RequestMotionPermission();this.PostToRuntime("permission-result",{"type":type,"result":result})}async _RequestOrientationPermission(){if(!self["DeviceOrientationEvent"]|| +!self["DeviceOrientationEvent"]["requestPermission"])return true;try{const state=await self["DeviceOrientationEvent"]["requestPermission"]();return state==="granted"}catch(err){console.warn("[Touch] Failed to request orientation permission: ",err);return false}}async _RequestMotionPermission(){if(!self["DeviceMotionEvent"]||!self["DeviceMotionEvent"]["requestPermission"])return true;try{const state=await self["DeviceMotionEvent"]["requestPermission"]();return state==="granted"}catch(err){console.warn("[Touch] Failed to request motion permission: ", +err);return false}}};self.RuntimeInterface.AddDOMHandlerClass(HANDLER_CLASS)}; +'use strict';{const DOM_COMPONENT_ID="mouse";const HANDLER_CLASS=class MouseDOMHandler extends self.DOMHandler{constructor(iRuntime){super(iRuntime,DOM_COMPONENT_ID);this.AddRuntimeMessageHandler("cursor",e=>this._OnChangeCursorStyle(e))}_OnChangeCursorStyle(e){document.documentElement.style.cursor=e}};self.RuntimeInterface.AddDOMHandlerClass(HANDLER_CLASS)}; +'use strict';{const DOM_COMPONENT_ID="platform-info";const HANDLER_CLASS=class PlatformInfoDOMHandler extends self.DOMHandler{constructor(iRuntime){super(iRuntime,DOM_COMPONENT_ID);this.AddRuntimeMessageHandlers([["get-initial-state",()=>this._OnGetInitialState()],["request-wake-lock",()=>this._OnRequestWakeLock()],["release-wake-lock",()=>this._OnReleaseWakeLock()]]);window.addEventListener("resize",()=>this._OnResize());this._screenWakeLock=null}_OnGetInitialState(){return{"screenWidth":screen.width, +"screenHeight":screen.height,"windowOuterWidth":window.outerWidth,"windowOuterHeight":window.outerHeight,"safeAreaInset":this._GetSafeAreaInset(),"supportsWakeLock":!!navigator["wakeLock"]}}_GetSafeAreaInset(){const elem=document.body;const elemStyle=elem.style;elemStyle.setProperty("--temp-sai-top","env(safe-area-inset-top)");elemStyle.setProperty("--temp-sai-right","env(safe-area-inset-right)");elemStyle.setProperty("--temp-sai-bottom","env(safe-area-inset-bottom)");elemStyle.setProperty("--temp-sai-left", +"env(safe-area-inset-left)");const computedStyle=getComputedStyle(elem);const ret=[computedStyle.getPropertyValue("--temp-sai-top"),computedStyle.getPropertyValue("--temp-sai-right"),computedStyle.getPropertyValue("--temp-sai-bottom"),computedStyle.getPropertyValue("--temp-sai-left")].map(str=>{const n=parseInt(str,10);return isFinite(n)?n:0});elemStyle.removeProperty("--temp-sai-top");elemStyle.removeProperty("--temp-sai-right");elemStyle.removeProperty("--temp-sai-bottom");elemStyle.removeProperty("--temp-sai-left"); +return ret}_OnResize(){this.PostToRuntime("window-resize",{"windowOuterWidth":window.outerWidth,"windowOuterHeight":window.outerHeight,"safeAreaInset":this._GetSafeAreaInset()})}async _OnRequestWakeLock(){if(this._screenWakeLock)return;try{this._screenWakeLock=await navigator["wakeLock"]["request"]("screen");this._screenWakeLock.addEventListener("release",()=>this._OnWakeLockReleased());console.log("[Construct 3] Screen wake lock acquired");this.PostToRuntime("wake-lock-acquired")}catch(err){console.warn("[Construct 3] Failed to acquire screen wake lock: ", +err);this.PostToRuntime("wake-lock-error")}}_OnReleaseWakeLock(){if(!this._screenWakeLock)return;this._screenWakeLock["release"]();this._screenWakeLock=null}_OnWakeLockReleased(){console.log("[Construct 3] Screen wake lock released");this._screenWakeLock=null;this.PostToRuntime("wake-lock-released")}};self.RuntimeInterface.AddDOMHandlerClass(HANDLER_CLASS)}; diff --git a/games/shadow-fight/scripts/offlineclient.js b/games/shadow-fight/scripts/offlineclient.js new file mode 100644 index 00000000..8a6145d1 --- /dev/null +++ b/games/shadow-fight/scripts/offlineclient.js @@ -0,0 +1,2 @@ +'use strict';{class OfflineClient{constructor(){this._broadcastChannel=typeof BroadcastChannel==="undefined"?null:new BroadcastChannel("offline");this._queuedMessages=[];this._onMessageCallback=null;if(this._broadcastChannel)this._broadcastChannel.onmessage=e=>this._OnBroadcastChannelMessage(e)}_OnBroadcastChannelMessage(e){if(this._onMessageCallback){this._onMessageCallback(e);return}this._queuedMessages.push(e)}SetMessageCallback(f){this._onMessageCallback=f;for(let e of this._queuedMessages)this._onMessageCallback(e); +this._queuedMessages.length=0}}window.OfflineClientInfo=new OfflineClient}; diff --git a/games/shadow-fight/scripts/register-sw.js b/games/shadow-fight/scripts/register-sw.js new file mode 100644 index 00000000..f152b5ff --- /dev/null +++ b/games/shadow-fight/scripts/register-sw.js @@ -0,0 +1 @@ +'use strict';{window.C3_RegisterSW=async function C3_RegisterSW(){if(!navigator.serviceWorker)return;try{const reg=await navigator.serviceWorker.register("sw.js",{scope:"./"});console.info("Registered service worker on "+reg.scope)}catch(err){console.warn("Failed to register service worker: ",err)}}}; diff --git a/games/shadow-fight/scripts/supportcheck.js b/games/shadow-fight/scripts/supportcheck.js new file mode 100644 index 00000000..f6c0d1a7 --- /dev/null +++ b/games/shadow-fight/scripts/supportcheck.js @@ -0,0 +1,5 @@ +'use strict';(function(){var isKasperskyScriptInjected=!!document.querySelector('script[src*="kaspersky"]');var tmpCanvas=document.createElement("canvas");var hasWebGL=!!(tmpCanvas.getContext("webgl")||tmpCanvas.getContext("experimental-webgl"));var missingFeatures=[];if(!hasWebGL)missingFeatures.push("WebGL");if(typeof WebAssembly==="undefined")missingFeatures.push("WebAssembly");if(!("noModule"in HTMLScriptElement.prototype))missingFeatures.push("JavaScript Modules");if(missingFeatures.length=== +0&&!isKasperskyScriptInjected)window["C3_IsSupported"]=true;else{var msgWrap=document.createElement("div");msgWrap.id="notSupportedWrap";document.body.appendChild(msgWrap);var msgTitle=document.createElement("h2");msgTitle.id="notSupportedTitle";if(isKasperskyScriptInjected)msgTitle.textContent="Kaspersky Internet Security broke this export";else msgTitle.textContent="Software update needed";msgWrap.appendChild(msgTitle);var msgBody=document.createElement("p");msgBody.className="notSupportedMessage"; +var msgText="This content is not supported because your device's software is out-of-date. ";var ua=navigator.userAgent;if(/android/i.test(ua))msgText+='

On Android, fix this by making sure the
Android System Webview app has updates enabled and is up-to-date.';else if(/iphone|ipad|ipod/i.test(ua))msgText+="

Note: using the iOS simulator requires Xcode 12+. Otherwise try testing on a real device instead."; +else if((/msie/i.test(ua)||/trident/i.test(ua))&&!/edge\//i.test(ua))msgText+="

Note: Internet Explorer is not supported. Try using Chrome or Firefox instead.";else if(isKasperskyScriptInjected)msgText="It appears a script was added to this export by Kaspersky software. This prevents the exported project from working. Try disabling Kaspersky and exporting again.";else msgText+="Try installing any available software updates. Alternatively try on a different device."; +msgText+="

Missing features: "+missingFeatures.join(", ")+"
User agent: "+navigator.userAgent+"
";msgBody.innerHTML=msgText;msgWrap.appendChild(msgBody)}})(); diff --git a/games/shadow-fight/style.css b/games/shadow-fight/style.css new file mode 100644 index 00000000..1e9e0074 --- /dev/null +++ b/games/shadow-fight/style.css @@ -0,0 +1,39 @@ +html, body { + padding: 0; + margin: 0; + overflow: hidden; + + background: #000000; + color: white; +} + +html, body, canvas { + touch-action: none; + touch-action-delay: none; +} + +#notSupportedWrap { + margin: 2em auto 1em auto; + width: 75%; + max-width: 45em; + border: 2px solid #aaa; + border-radius: 1em; + padding: 2em; + background-color: #f0f0f0; + font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif; + color: black; +} + +#notSupportedTitle { + font-size: 1.8em; +} + +.notSupportedMessage { + font-size: 1.2em; +} + +.notSupportedMessage em { + color: #888; +} + + diff --git a/games/shadow-fight/workermain.js b/games/shadow-fight/workermain.js new file mode 100644 index 00000000..19c3def4 --- /dev/null +++ b/games/shadow-fight/workermain.js @@ -0,0 +1,9 @@ +'use strict';{let hasInitialised=false;let runtime=null;let scriptsType="";self.addEventListener("message",e=>{const data=e.data;const type=data["type"];if(type==="init-runtime")InitRuntime(data);else throw new Error(`unknown message '${type}'`);});self.c3_import=url=>import(url);function IsAbsoluteURL(url){return/^(?:[a-z\-]+:)?\/\//.test(url)||url.substr(0,5)==="data:"||url.substr(0,5)==="blob:"}function IsRelativeURL(url){return!IsAbsoluteURL(url)}async function LoadScripts(scriptsArr){if(scriptsType=== +"classic")importScripts(...scriptsArr);else if(scriptsArr.length===1){const url=scriptsArr[0];await import(((IsRelativeURL(url)?"./":"")+url))}else{const scriptStr=scriptsArr.map(url=>`import "${IsRelativeURL(url)?"./":""}${url}";`).join("\n");const blobUrl=URL.createObjectURL(new Blob([scriptStr],{type:"application/javascript"}));await import(blobUrl)}}async function InitRuntime(data){if(hasInitialised)throw new Error("already initialised");hasInitialised=true;const messagePort=data["messagePort"]; +const baseUrl=data["baseUrl"];const exportType=data["exportType"];scriptsType=data["scriptsType"];self.devicePixelRatio=data["devicePixelRatio"];const workerDependencyScripts=data["workerDependencyScripts"].map(urlOrBlob=>{let url=urlOrBlob;if(urlOrBlob instanceof Blob)url=URL.createObjectURL(urlOrBlob);else url=(new URL(url,baseUrl)).toString();return url});const runOnStartupFunctions=[];self.runOnStartup=function runOnStartup(f){if(typeof f!=="function")throw new Error("runOnStartup called without a function"); +runOnStartupFunctions.push(f)};const engineScripts=data["engineScripts"].map(url=>(new URL(url,baseUrl)).toString());try{await LoadScripts([...workerDependencyScripts,...engineScripts])}catch(err){console.error("[C3 runtime] Failed to load all engine scripts in worker: ",err);return}const projectScripts=data["projectScripts"];const scriptsStatus=data["projectScriptsStatus"];self["C3_ProjectScriptsStatus"]=scriptsStatus;if(scriptsType==="module"){const mainProjectScript=data["mainProjectScript"];const allProjectScripts= +data["projectScripts"];for(let [originalUrl,loadUrl]of allProjectScripts){if(!loadUrl)loadUrl=originalUrl;if(originalUrl===mainProjectScript)try{await LoadScripts([loadUrl]);if(exportType==="preview"&&!scriptsStatus[originalUrl])ReportProjectMainScriptError(originalUrl,"main script did not run to completion",messagePort)}catch(err){ReportProjectMainScriptError(originalUrl,err,messagePort)}else if(originalUrl==="scriptsInEvents.js"||originalUrl.endsWith("/scriptsInEvents.js"))await LoadScripts([loadUrl])}}else if(projectScripts&& +projectScripts.length>0)try{await LoadScripts(projectScripts.map(e=>e[1]))}catch(err){console.error("[Preview] Error loading project scripts: ",err);ReportProjectScriptError(projectScripts,scriptsStatus,messagePort);return}data["runOnStartupFunctions"]=runOnStartupFunctions;if(exportType==="preview"&&typeof self.C3.ScriptsInEvents!=="object"){const msg="Failed to load JavaScript code used in events. Check all your JavaScript code has valid syntax.";console.error("[C3 runtime] "+msg);messagePort.postMessage({"type":"alert-error", +"message":msg});return}messagePort.postMessage({"type":"creating-runtime"});runtime=self["C3_CreateRuntime"](data);await self["C3_InitRuntime"](runtime,data)}async function ReportProjectScriptError(projectScripts,scriptsStatus,messagePort){let msg;for(const [originalUrl,src]of projectScripts){if(scriptsStatus[originalUrl])continue;try{await LoadScripts([src])}catch(err){if(originalUrl==="scriptsInEvents.js")msg="Failed to load JavaScript code used in events. Check all your JavaScript code has valid syntax."; +else msg=`Failed to load project script '${originalUrl}'. Check all your JavaScript code has valid syntax.`;console.error("[Preview] "+msg,err);messagePort.postMessage({"type":"alert-error","message":msg});return}}}function ReportProjectMainScriptError(url,err,messagePort){console.error(`[Preview] Failed to load project main script (${url}): `,err);const msg=`Failed to load project main script (${url}). Check all your JavaScript code has valid syntax. Press F12 and check the console for error details.`; +messagePort.postMessage({"type":"alert-error","message":msg})}};