commit d146b0dff41e088de2ab11697cdc429b916b852e Author: giomba Date: Fri May 29 10:52:18 2020 +0200 First commit as downloaded from shuttlestudio.it diff --git a/shuttlestudio.it/giochi/albanovsdinos/box2d.wasm b/shuttlestudio.it/giochi/albanovsdinos/box2d.wasm new file mode 100644 index 0000000..106566a Binary files /dev/null and b/shuttlestudio.it/giochi/albanovsdinos/box2d.wasm differ diff --git a/shuttlestudio.it/giochi/albanovsdinos/box2d.wasm.js b/shuttlestudio.it/giochi/albanovsdinos/box2d.wasm.js new file mode 100644 index 0000000..630d78b --- /dev/null +++ b/shuttlestudio.it/giochi/albanovsdinos/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 + + + +AL BANO vs DINOS + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + \ No newline at end of file diff --git a/shuttlestudio.it/giochi/albanovsdinos/media/acuto-1.webm b/shuttlestudio.it/giochi/albanovsdinos/media/acuto-1.webm new file mode 100644 index 0000000..fabca06 Binary files /dev/null and b/shuttlestudio.it/giochi/albanovsdinos/media/acuto-1.webm differ diff --git a/shuttlestudio.it/giochi/albanovsdinos/media/acuto-2.webm b/shuttlestudio.it/giochi/albanovsdinos/media/acuto-2.webm new file mode 100644 index 0000000..3e05f0a Binary files /dev/null and b/shuttlestudio.it/giochi/albanovsdinos/media/acuto-2.webm differ diff --git a/shuttlestudio.it/giochi/albanovsdinos/media/albanobastatiprego.webm b/shuttlestudio.it/giochi/albanovsdinos/media/albanobastatiprego.webm new file mode 100644 index 0000000..e8a44d9 Binary files /dev/null and b/shuttlestudio.it/giochi/albanovsdinos/media/albanobastatiprego.webm differ diff --git a/shuttlestudio.it/giochi/albanovsdinos/media/click.webm b/shuttlestudio.it/giochi/albanovsdinos/media/click.webm new file mode 100644 index 0000000..3ec6f55 Binary files /dev/null and b/shuttlestudio.it/giochi/albanovsdinos/media/click.webm differ diff --git a/shuttlestudio.it/giochi/albanovsdinos/media/morto.webm b/shuttlestudio.it/giochi/albanovsdinos/media/morto.webm new file mode 100644 index 0000000..efca003 Binary files /dev/null and b/shuttlestudio.it/giochi/albanovsdinos/media/morto.webm differ diff --git a/shuttlestudio.it/giochi/albanovsdinos/media/steccata.webm b/shuttlestudio.it/giochi/albanovsdinos/media/steccata.webm new file mode 100644 index 0000000..1cfd718 Binary files /dev/null and b/shuttlestudio.it/giochi/albanovsdinos/media/steccata.webm differ diff --git a/shuttlestudio.it/giochi/albanovsdinos/offline.json b/shuttlestudio.it/giochi/albanovsdinos/offline.json new file mode 100644 index 0000000..8d7f668 --- /dev/null +++ b/shuttlestudio.it/giochi/albanovsdinos/offline.json @@ -0,0 +1 @@ +{"version":1590654323207,"fileList":["box2d.wasm","box2d.wasm.js","scripts/c3runtime.js","data.json","style.css","scripts/offlineclient.js","images/shared-0-sheet3.png","images/shared-0-sheet2.png","images/shared-0-sheet1.png","images/albano_front_a-sheet0.png","images/dino_trex_a-sheet0.png","images/dino_trex_a-sheet1.png","images/dino_trex_a-sheet2.png","images/shared-0-sheet0.png","scripts/opus.wasm.js","scripts/opus.wasm.wasm","scripts/main.js","scripts/dispatchworker.js","scripts/jobworker.js","scripts/workermain.js","scripts/supportcheck.js","icons/icon-64.png","icons/icon-32.png","icons/loading-logo.png","icons/icon-512.png","icons/icon-16.png","icons/icon-128.png","icons/icon-256.png","media/click.webm","media/acuto-2.webm","media/acuto-1.webm","media/steccata.webm","media/albanobastatiprego.webm","media/morto.webm","scripts/register-sw.js"]} \ No newline at end of file diff --git a/shuttlestudio.it/giochi/albanovsdinos/scripts/c3runtime.js b/shuttlestudio.it/giochi/albanovsdinos/scripts/c3runtime.js new file mode 100644 index 0000000..a5254d2 --- /dev/null +++ b/shuttlestudio.it/giochi/albanovsdinos/scripts/c3runtime.js @@ -0,0 +1,2 @@ +// Generated by Construct 3, the game and app creator :: https://www.construct.net +'use strict';(function(n,e){if('object'==typeof exports&&'object'==typeof module)module.exports=e();else if('function'==typeof define&&define.amd)define([],e);else{var t=e();for(var r in t)('object'==typeof exports?exports:n)[r]=t[r]}})(this,function(){var g=Math.acos,a=Math.round,_=Math.min,r=Math.floor,p=Math.ceil,G=Math.sqrt,t=Math.pow,C=Math.cos,w=Math.sin,B=Math.max,F=Math.abs,h=Math.PI;return function(n){function s(t){if(e[t])return e[t].exports;var a=e[t]={i:t,l:!1,exports:{}};return n[t].call(a.exports,a,a.exports,s),a.l=!0,a.exports}var e={};return s.m=n,s.c=e,s.d=function(t,e,a){s.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:a})},s.n=function(t){var e=t&&t.__esModule?function(){return t['default']}:function(){return t};return s.d(e,'a',e),e},s.o=function(a,e){return Object.prototype.hasOwnProperty.call(a,e)},s.p='',s(s.s=4)}([function(n,s){'use strict';Object.defineProperty(s,'__esModule',{value:!0}),s.setMatrixArrayType=function(a){s.ARRAY_TYPE=t=a},s.toRadian=function(t){return t*r},s.equals=function(a,e){return F(a-e)<=_*B(1,F(a),F(e))};var _=s.EPSILON=1e-6,t=s.ARRAY_TYPE='undefined'==typeof Float32Array?Array:Float32Array,e=s.RANDOM=Math.random,r=h/180},function(n,e,s){'use strict';function a(_,e,t){var a=e[0],r=e[1],g=e[2],l=e[3],s=e[4],n=e[5],d=e[6],u=e[7],h=e[8],c=t[0],m=t[1],f=t[2],S=t[3],p=t[4],G=t[5],y=t[6],I=t[7],T=t[8];return _[0]=c*a+m*l+f*d,_[1]=c*r+m*s+f*u,_[2]=c*g+m*n+f*h,_[3]=S*a+p*l+G*d,_[4]=S*r+p*s+G*u,_[5]=S*g+p*n+G*h,_[6]=y*a+I*l+T*d,_[7]=y*r+I*s+T*u,_[8]=y*g+I*n+T*h,_}function r(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n}Object.defineProperty(e,'__esModule',{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new g.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat4=function(a,e){return a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=e[4],a[4]=e[5],a[5]=e[6],a[6]=e[8],a[7]=e[9],a[8]=e[10],a},e.clone=function(a){var e=new g.ARRAY_TYPE(9);return e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[8]=a[8],e},e.copy=function(a,e){return a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=e[3],a[4]=e[4],a[5]=e[5],a[6]=e[6],a[7]=e[7],a[8]=e[8],a},e.fromValues=function(_,e,t,a,r,c,l,s,n){var d=new g.ARRAY_TYPE(9);return d[0]=_,d[1]=e,d[2]=t,d[3]=a,d[4]=r,d[5]=c,d[6]=l,d[7]=s,d[8]=n,d},e.set=function(_,e,t,a,r,c,l,s,n,d){return _[0]=e,_[1]=t,_[2]=a,_[3]=r,_[4]=c,_[5]=l,_[6]=s,_[7]=n,_[8]=d,_},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(n,e){if(n===e){var t=e[1],a=e[2],r=e[5];n[1]=e[3],n[2]=e[6],n[3]=t,n[5]=e[7],n[6]=a,n[7]=r}else n[0]=e[0],n[1]=e[3],n[2]=e[6],n[3]=e[1],n[4]=e[4],n[5]=e[7],n[6]=e[2],n[7]=e[5],n[8]=e[8];return n},e.invert=function(_,e){var t=e[0],a=e[1],r=e[2],g=e[3],l=e[4],s=e[5],n=e[6],d=e[7],u=e[8],p=u*l-s*d,c=-u*g+s*n,m=d*g-l*n,h=t*p+a*c+r*m;return h?(h=1/h,_[0]=p*h,_[1]=(-u*a+r*d)*h,_[2]=(s*a-r*l)*h,_[3]=c*h,_[4]=(u*t-r*n)*h,_[5]=(-s*t+r*g)*h,_[6]=m*h,_[7]=(-d*t+a*n)*h,_[8]=(l*t-a*g)*h,_):null},e.adjoint=function(_,e){var t=e[0],a=e[1],r=e[2],c=e[3],l=e[4],s=e[5],n=e[6],d=e[7],u=e[8];return _[0]=l*u-s*d,_[1]=r*d-a*u,_[2]=a*s-r*l,_[3]=s*n-c*u,_[4]=t*u-r*n,_[5]=r*c-t*s,_[6]=c*d-l*n,_[7]=a*n-t*d,_[8]=t*l-a*c,_},e.determinant=function(_){var e=_[0],t=_[1],a=_[2],r=_[3],c=_[4],l=_[5],s=_[6],n=_[7],d=_[8];return e*(d*c-l*n)+t*(-d*r+l*s)+a*(n*r-c*s)},e.multiply=a,e.translate=function(_,e,t){var a=e[0],r=e[1],g=e[2],l=e[3],s=e[4],n=e[5],d=e[6],u=e[7],p=e[8],c=t[0],m=t[1];return _[0]=a,_[1]=r,_[2]=g,_[3]=l,_[4]=s,_[5]=n,_[6]=c*a+m*l+d,_[7]=c*r+m*s+u,_[8]=c*g+m*n+p,_},e.rotate=function(_,e,t){var a=e[0],r=e[1],d=e[2],l=e[3],n=e[4],u=e[5],c=e[6],g=e[7],m=e[8],p=w(t),h=C(t);return _[0]=h*a+p*l,_[1]=h*r+p*n,_[2]=h*d+p*u,_[3]=h*l-p*a,_[4]=h*n-p*r,_[5]=h*u-p*d,_[6]=c,_[7]=g,_[8]=m,_},e.scale=function(n,e,t){var a=t[0],r=t[1];return n[0]=a*e[0],n[1]=a*e[1],n[2]=a*e[2],n[3]=r*e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n},e.fromTranslation=function(a,e){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=e[0],a[7]=e[1],a[8]=1,a},e.fromRotation=function(n,e){var t=w(e),a=C(e);return n[0]=a,n[1]=t,n[2]=0,n[3]=-t,n[4]=a,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n},e.fromScaling=function(a,e){return a[0]=e[0],a[1]=0,a[2]=0,a[3]=0,a[4]=e[1],a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},e.fromMat2d=function(a,e){return a[0]=e[0],a[1]=e[1],a[2]=0,a[3]=e[2],a[4]=e[3],a[5]=0,a[6]=e[4],a[7]=e[5],a[8]=1,a},e.fromQuat=function(_,e){var t=e[0],a=e[1],r=e[2],g=e[3],l=t+t,s=a+a,n=r+r,d=t*l,u=a*l,h=a*s,c=r*l,m=r*s,f=r*n,S=g*l,p=g*s,G=g*n;return _[0]=1-h-f,_[3]=u-G,_[6]=c+p,_[1]=u+G,_[4]=1-d-f,_[7]=m-S,_[2]=c-p,_[5]=m+S,_[8]=1-d-h,_},e.normalFromMat4=function(h,e){var t=e[0],a=e[1],r=e[2],G=e[3],l=e[4],s=e[5],n=e[6],d=e[7],u=e[8],T=e[9],c=e[10],m=e[11],f=e[12],b=e[13],p=e[14],C=e[15],y=t*s-a*l,P=t*n-r*l,x=t*d-G*l,A=a*n-r*s,R=a*d-G*s,S=r*d-G*n,_=u*b-T*f,D=u*p-c*f,I=u*C-m*f,E=T*p-c*b,w=T*C-m*b,g=c*C-m*p,B=y*g-P*w+x*E+A*I-R*D+S*_;return B?(B=1/B,h[0]=(s*g-n*w+d*E)*B,h[1]=(n*I-l*g-d*D)*B,h[2]=(l*w-s*I+d*_)*B,h[3]=(r*w-a*g-G*E)*B,h[4]=(t*g-r*I+G*D)*B,h[5]=(a*I-t*w-G*_)*B,h[6]=(b*S-p*R+C*A)*B,h[7]=(p*x-f*S-C*P)*B,h[8]=(f*R-b*x+C*y)*B,h):null},e.projection=function(n,e,t){return n[0]=2/e,n[1]=0,n[2]=0,n[3]=0,n[4]=-2/t,n[5]=0,n[6]=-1,n[7]=1,n[8]=1,n},e.str=function(t){return'mat3('+t[0]+', '+t[1]+', '+t[2]+', '+t[3]+', '+t[4]+', '+t[5]+', '+t[6]+', '+t[7]+', '+t[8]+')'},e.frob=function(a){return G(t(a[0],2)+t(a[1],2)+t(a[2],2)+t(a[3],2)+t(a[4],2)+t(a[5],2)+t(a[6],2)+t(a[7],2)+t(a[8],2))},e.add=function(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},e.subtract=r,e.multiplyScalar=function(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},e.multiplyScalarAndAdd=function(n,e,t,a){return n[0]=e[0]+t[0]*a,n[1]=e[1]+t[1]*a,n[2]=e[2]+t[2]*a,n[3]=e[3]+t[3]*a,n[4]=e[4]+t[4]*a,n[5]=e[5]+t[5]*a,n[6]=e[6]+t[6]*a,n[7]=e[7]+t[7]*a,n[8]=e[8]+t[8]*a,n},e.exactEquals=function(a,e){return a[0]===e[0]&&a[1]===e[1]&&a[2]===e[2]&&a[3]===e[3]&&a[4]===e[4]&&a[5]===e[5]&&a[6]===e[6]&&a[7]===e[7]&&a[8]===e[8]},e.equals=function(_,e){var t=_[0],a=_[1],r=_[2],c=_[3],l=_[4],s=_[5],n=_[6],d=_[7],u=_[8],m=e[0],h=e[1],p=e[2],f=e[3],y=e[4],G=e[5],I=e[6],T=e[7],b=e[8];return F(t-m)<=g.EPSILON*B(1,F(t),F(m))&&F(a-h)<=g.EPSILON*B(1,F(a),F(h))&&F(r-p)<=g.EPSILON*B(1,F(r),F(p))&&F(c-f)<=g.EPSILON*B(1,F(c),F(f))&&F(l-y)<=g.EPSILON*B(1,F(l),F(y))&&F(s-G)<=g.EPSILON*B(1,F(s),F(G))&&F(n-I)<=g.EPSILON*B(1,F(n),F(I))&&F(d-T)<=g.EPSILON*B(1,F(d),F(T))&&F(u-b)<=g.EPSILON*B(1,F(u),F(b))};var _=s(0),g=function(n){if(n&&n.__esModule)return n;var e={};if(null!=n)for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}(_),l=e.mul=a,d=e.sub=r},function(e,t,n){'use strict';function s(){var t=new I.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t}function l(n){var e=n[0],t=n[1],a=n[2];return G(e*e+t*t+a*a)}function d(n,e,t){var a=new I.ARRAY_TYPE(3);return a[0]=n,a[1]=e,a[2]=t,a}function u(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n}function c(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}function m(n,e,t){return n[0]=e[0]/t[0],n[1]=e[1]/t[1],n[2]=e[2]/t[2],n}function f(n,e){var t=e[0]-n[0],a=e[1]-n[1],r=e[2]-n[2];return G(t*t+a*a+r*r)}function y(n,e){var t=e[0]-n[0],a=e[1]-n[1],r=e[2]-n[2];return t*t+a*a+r*r}function P(n){var e=n[0],t=n[1],a=n[2];return e*e+t*t+a*a}function S(n,e){var t=e[0],a=e[1],r=e[2],s=t*t+a*a+r*r;return 0r?h:g(r)},t.str=function(t){return'vec3('+t[0]+', '+t[1]+', '+t[2]+')'},t.exactEquals=function(a,e){return a[0]===e[0]&&a[1]===e[1]&&a[2]===e[2]},t.equals=function(_,e){var t=_[0],a=_[1],r=_[2],d=e[0],l=e[1],s=e[2];return F(t-d)<=I.EPSILON*B(1,F(t),F(d))&&F(a-l)<=I.EPSILON*B(1,F(a),F(l))&&F(r-s)<=I.EPSILON*B(1,F(r),F(s))};var R=n(0),I=function(n){if(n&&n.__esModule)return n;var e={};if(null!=n)for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}(R),D=t.sub=u,E=t.mul=c,k=t.div=m,L=t.dist=f,v=t.sqrDist=y,O=t.len=l,T=t.sqrLen=P,b=t.forEach=function(){var r=s();return function(e,t,l,c,s,n){var d,g;for(t||(t=3),l||(l=0),g=c?_(c*t+l,e.length):e.length,d=l;de[5]&e[0]>e[10]?(a=2*G(1+e[0]-e[5]-e[10]),n[3]=(e[6]-e[9])/a,n[0]=.25*a,n[1]=(e[1]+e[4])/a,n[2]=(e[8]+e[2])/a):e[5]>e[10]?(a=2*G(1+e[5]-e[0]-e[10]),n[3]=(e[8]-e[2])/a,n[0]=(e[1]+e[4])/a,n[1]=.25*a,n[2]=(e[6]+e[9])/a):(a=2*G(1+e[10]-e[0]-e[5]),n[3]=(e[1]-e[4])/a,n[0]=(e[8]+e[2])/a,n[1]=(e[6]+e[9])/a,n[2]=.25*a),n},e.fromRotationTranslationScale=function(_,e,t,a){var r=e[0],g=e[1],l=e[2],s=e[3],n=r+r,d=g+g,u=l+l,h=r*n,c=r*d,m=r*u,f=g*d,G=g*u,p=l*u,I=s*n,y=s*d,T=s*u,b=a[0],C=a[1],v=a[2];return _[0]=(1-(f+p))*b,_[1]=(c+T)*b,_[2]=(m-y)*b,_[3]=0,_[4]=(c-T)*C,_[5]=(1-(h+p))*C,_[6]=(G+I)*C,_[7]=0,_[8]=(m+y)*v,_[9]=(G-I)*v,_[10]=(1-(h+f))*v,_[11]=0,_[12]=t[0],_[13]=t[1],_[14]=t[2],_[15]=1,_},e.fromRotationTranslationScaleOrigin=function(g,e,t,a,r){var l=e[0],h=e[1],s=e[2],n=e[3],d=l+l,u=h+h,G=s+s,c=l*d,m=l*u,f=l*G,T=h*u,p=h*G,b=s*G,y=n*d,C=n*u,v=n*G,P=a[0],x=a[1],S=a[2],_=r[0],A=r[1],I=r[2];return g[0]=(1-(T+b))*P,g[1]=(m+v)*P,g[2]=(f-C)*P,g[3]=0,g[4]=(m-v)*x,g[5]=(1-(c+b))*x,g[6]=(p+y)*x,g[7]=0,g[8]=(f+C)*S,g[9]=(p-y)*S,g[10]=(1-(c+T))*S,g[11]=0,g[12]=t[0]+_-(g[0]*_+g[4]*A+g[8]*I),g[13]=t[1]+A-(g[1]*_+g[5]*A+g[9]*I),g[14]=t[2]+I-(g[2]*_+g[6]*A+g[10]*I),g[15]=1,g},e.fromQuat=function(_,e){var t=e[0],a=e[1],r=e[2],g=e[3],l=t+t,s=a+a,n=r+r,d=t*l,u=a*l,h=a*s,c=r*l,m=r*s,f=r*n,S=g*l,p=g*s,G=g*n;return _[0]=1-h-f,_[1]=u+G,_[2]=c-p,_[3]=0,_[4]=u-G,_[5]=1-d-f,_[6]=m+S,_[7]=0,_[8]=c+p,_[9]=m-S,_[10]=1-d-h,_[11]=0,_[12]=0,_[13]=0,_[14]=0,_[15]=1,_},e.frustum=function(_,e,t,a,r,c,l){var s=1/(t-e),n=1/(r-a),d=1/(c-l);return _[0]=2*c*s,_[1]=0,_[2]=0,_[3]=0,_[4]=0,_[5]=2*c*n,_[6]=0,_[7]=0,_[8]=(t+e)*s,_[9]=(r+a)*n,_[10]=(l+c)*d,_[11]=-1,_[12]=0,_[13]=0,_[14]=2*(l*c)*d,_[15]=0,_},e.perspective=function(l,e,t,a,r){var d=1/_(e/2),s=1/(a-r);return l[0]=d/t,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=d,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=(r+a)*s,l[11]=-1,l[12]=0,l[13]=0,l[14]=2*r*a*s,l[15]=0,l},e.perspectiveFromFieldOfView=function(l,e,t,a){var r=_(e.upDegrees*h/180),c=_(e.downDegrees*h/180),s=_(e.leftDegrees*h/180),n=_(e.rightDegrees*h/180),d=2/(s+n),u=2/(r+c);return l[0]=d,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=u,l[6]=0,l[7]=0,l[8]=-(.5*((s-n)*d)),l[9]=.5*((r-c)*u),l[10]=a/(t-a),l[11]=-1,l[12]=0,l[13]=0,l[14]=a*t/(t-a),l[15]=0,l},e.ortho=function(_,e,t,a,r,c,l){var s=1/(e-t),n=1/(a-r),d=1/(c-l);return _[0]=-2*s,_[1]=0,_[2]=0,_[3]=0,_[4]=0,_[5]=-2*n,_[6]=0,_[7]=0,_[8]=0,_[9]=0,_[10]=2*d,_[11]=0,_[12]=(e+t)*s,_[13]=(r+a)*n,_[14]=(l+c)*d,_[15]=1,_},e.lookAt=function(n,e,t,a){var r=e[0],g=e[1],m=e[2],h=a[0],y=a[1],T=a[2],S=t[0],_=t[1],b=t[2],I,C,v,P,x,A,R,D,w,B;return F(r-S)I&&(I=-I,d=-d,u=-u,h=-h,S=-S),1e-6<1-I?(G=g(I),T=w(G),b=w((1-a)*G)/T,C=w(a*G)/T):(b=1-a,C=a),e[0]=b*l+C*d,e[1]=b*t+C*u,e[2]=b*s+C*h,e[3]=b*n+C*S,e}function s(n,e){var t=e[0]+e[4]+e[8],a;if(0e[0]&&(_=1),e[8]>e[3*_+_]&&(_=2);var d=(_+1)%3,l=(_+2)%3;a=G(e[3*_+_]-e[3*d+d]-e[3*l+l]+1),n[_]=.5*a,a=.5/a,n[3]=(e[3*d+l]-e[3*l+d])*a,n[d]=(e[3*d+_]+e[3*_+d])*a,n[l]=(e[3*l+_]+e[3*_+l])*a}return n}Object.defineProperty(t,'__esModule',{value:!0}),t.setAxes=t.sqlerp=t.rotationTo=t.equals=t.exactEquals=t.normalize=t.sqrLen=t.squaredLength=t.len=t.length=t.lerp=t.dot=t.scale=t.mul=t.add=t.set=t.copy=t.fromValues=t.clone=void 0,t.create=d,t.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},t.setAxisAngle=u,t.getAxisAngle=function(e,t){var a=2*g(t[3]),n=w(a/2);return 0==n?(e[0]=1,e[1]=0,e[2]=0):(e[0]=t[0]/n,e[1]=t[1]/n,e[2]=t[2]/n),a},t.multiply=r,t.rotateX=function(_,e,t){t*=.5;var d=e[0],r=e[1],u=e[2],l=e[3],s=w(t),n=C(t);return _[0]=d*n+l*s,_[1]=r*n+u*s,_[2]=u*n-r*s,_[3]=l*n-d*s,_},t.rotateY=function(_,e,t){t*=.5;var d=e[0],r=e[1],u=e[2],l=e[3],s=w(t),n=C(t);return _[0]=d*n-u*s,_[1]=r*n+l*s,_[2]=u*n+d*s,_[3]=l*n-r*s,_},t.rotateZ=function(_,e,t){t*=.5;var d=e[0],r=e[1],u=e[2],l=e[3],s=w(t),n=C(t);return _[0]=d*n+r*s,_[1]=r*n-d*s,_[2]=u*n+l*s,_[3]=l*n-u*s,_},t.calculateW=function(n,e){var t=e[0],a=e[1],r=e[2];return n[0]=t,n[1]=a,n[2]=r,n[3]=G(F(1-t*t-a*a-r*r)),n},t.slerp=c,t.invert=function(_,e){var t=e[0],a=e[1],r=e[2],d=e[3],l=t*t+a*a+r*r+d*d,s=l?1/l:0;return _[0]=-t*s,_[1]=-a*s,_[2]=-r*s,_[3]=d*s,_},t.conjugate=function(a,e){return a[0]=-e[0],a[1]=-e[1],a[2]=-e[2],a[3]=e[3],a},t.fromMat3=s,t.fromEuler=function(_,e,d,u){var c=.5*h/180;e*=c,d*=c,u*=c;var g=w(e),l=C(e),s=w(d),n=C(d),p=w(u),m=C(u);return _[0]=g*n*m-l*s*p,_[1]=l*s*m+g*n*p,_[2]=l*n*p-g*s*m,_[3]=l*n*m+g*s*p,_},t.str=function(t){return'quat('+t[0]+', '+t[1]+', '+t[2]+', '+t[3]+')'};var l=a(0),p=n(l),m=a(1),f=n(m),y=a(2),P=n(y),A=a(3),R=n(A),S=t.clone=R.clone,_=t.fromValues=R.fromValues,E=t.copy=R.copy,I=t.set=R.set,B=t.add=R.add,L=t.mul=r,O=t.scale=R.scale,M=t.dot=R.dot,v=t.lerp=R.lerp,W=t.length=R.length,T=t.len=W,b=t.squaredLength=R.squaredLength,x=t.sqrLen=b,D=t.normalize=R.normalize,k=t.exactEquals=R.exactEquals,N=t.equals=R.equals,V=t.rotationTo=function(){var s=P.create(),e=P.fromValues(1,0,0),t=P.fromValues(0,1,0);return function(r,_,l){var a=P.dot(_,l);return-.999999>a?(P.cross(s,e,_),1e-6>P.len(s)&&P.cross(s,t,_),P.normalize(s,s),u(r,s,Math.PI),r):.999999=d&&0<=u&&1>=u}function S(e,t,a){return(t[0]-e[0])*(a[1]-e[1])-(a[0]-e[0])*(t[1]-e[1])}function G(e,t,a){return 0S(e,t,a)}function f(e,t,a){return 0>=S(e,t,a)}function g(e,t,a,n){var r=Math.sqrt;if(!n)return 0===S(e,t,a);var s=tmpPoint1,_=tmpPoint2;s[0]=t[0]-e[0],s[1]=t[1]-e[1],_[0]=a[0]-t[0],_[1]=a[1]-t[1];var d=s[0]*_[0]+s[1]*_[1],u=r(s[0]*s[0]+s[1]*s[1]),c=r(_[0]*_[0]+_[1]*_[1]),g=Math.acos(d/(u*c));return gt?t%a+a:t%a]}function l(e){e.length=0}function a(t,a,n,r){for(var s=n;sI.length)return l;if(S++,S>g)return console.warn('quickDecomp: max level ('+g+') reached.'),l;for(var K=0;KU&&(U+=n.length),N=b,Ur[a][0])&&(a=s);return!G(x(t,a-1),x(t,a),x(t,a+1))&&(n(t),!0)}}}{let e=!1,t=!1,n='dev';self.C3=class{constructor(){throw TypeError('static class can\'t be instantiated')}static SetReady(){e=!0}static IsReady(){return e}static SetAppStarted(){t=!0}static HasAppStarted(){return t}static SetBuildMode(e){n=e}static GetBuildMode(){return n}static IsReleaseBuild(){return'final'===n}},C3.isDebug=!1,C3.isDebugDefend=!1,C3.hardwareConcurrency=navigator.hardwareConcurrency||2}'use strict',C3.QueryParser=class{constructor(e){this._queryString=e,this._parameters=new Map,this._Parse()}_Parse(){let e=this._queryString;(e.startsWith('?')||e.startsWith('#'))&&(e=e.substr(1));const t=e.split('&');for(const e of t)this._ParseParameter(e)}_ParseParameter(e){if(e){if(!e.includes('='))return void this._parameters.set(e,null);const t=e.indexOf('='),a=decodeURIComponent(e.substring(0,t)),n=decodeURIComponent(e.substring(t+1));this._parameters.set(a,n)}}LogAll(){for(const e of this._parameters)console.log('[QueryParser] Parameter \''+e[0]+'\' = '+(null===e[1]?'null':'\''+e[1]+'\''))}Has(e){return this._parameters.has(e)}Get(e){const t=this._parameters.get(e);return'undefined'==typeof t?null:t}ClearHash(){history.replaceState('',document.title,location.pathname+location.search)}Reparse(e){this._queryString=e,this._parameters.clear(),this._Parse()}},C3.QueryString=new C3.QueryParser(location.search),C3.LocationHashString=new C3.QueryParser(location.hash),'dev'!==C3.QueryString.Get('mode')&&C3.SetBuildMode('final'),'use strict';{function t(e,t,a){if(!0===t)a(),n.set(e,!0);else if(t&&t.length)a(t[0]),n.set(e,!0);else;}const r=navigator.userAgent;let a={linux:/linux|openbsd|freebsd|netbsd/i.test(r),chromeOS:/CrOS/.test(r),windowsTizen:/trident|iemobile|msie|tizen/i.test(r),genericMS:/trident|iemobile|msie|edge\//i.test(r),opera:/OPR\//.test(r),blackberry:/bb10/i.test(r),edge:/edge\//i.test(r),trident:/trident/i.test(r),webkit:/webkit/i.test(r),safari:/safari\//i.test(r),chrome:/chrome\//i.test(r),chromium:/chromium\//i.test(r),crosswalk:/crosswalk|xwalk/i.test(r),nwjs:/nwjs/i.test(r),amazonwebapp:/amazonwebappplatform/i.test(r),webview:/wv\)/.test(r),android:/android/i.test(r),nokia:/nokiabrowser\/[0-9.]+/i.test(r)},s={windows:/windows\s+nt\s+\d+\.\d+/i.exec(r),OSX:/mac\s+os\s+x\s+[0-9_]+/i.exec(r),android:/android\s+[0-9.]+/i.exec(r),opera:/OPR\/[0-9.]+/.exec(r),tizen:/tizen\s+[0-9.]+/i.exec(r),iphone:/iphone\s+os\s+[0-9_]+/i.exec(r),ipad:/ipad[^)]*os\s+[0-9_]+/i.exec(r),winPhone:/windows\s+phone\s+[0-9.]+/i.exec(r),winPhoneOS:/windows\s+phone\s+os\s+[0-9.]+/i.exec(r),chrome:/chrome\/[0-9.]+/i.exec(r),chromium:/chromium\/[0-9.]+/i.exec(r),nwjs:/nwjs\/[0-9.]+/i.exec(r),firefox:/firefox\/[0-9.]+/i.exec(r),ie:/msie\s+[0-9.]+/i.exec(r),edge:/edge\/[0-9.]+/i.exec(r),edgeChromium:/edg\/[0-9.]+/i.exec(r),silk:/silk\/[0-9.]+/i.exec(r)},_='(unknown)',e='(unknown)',d='(unknown)',u='(unknown)',g='(unknown)',c='(unknown)',h='(unknown)',f='browser',l=!1,m=!1,n=new Map;t('isWindows',s.windows,t=>{_='Windows';const a=t.split(' ')[2];a&&('5.0'===a?e='2000':'5.1'===a?e='XP':'5.2'===a?e='XP':'6.0'===a?e='Vista':'6.1'===a?e='7':'6.2'===a?e='8':'6.3'===a?e='8.1':'10.0'===a?e='10':void 0)}),t('isOSX',s.OSX,t=>{_='Mac OS X';const a=t.split(' ')[3];a&&(e=a.replace('_','.'))}),t('isLinux',a.linux,()=>{_='Linux'}),t('isChromeOS',a.chromeOS,()=>{_='Chrome OS'}),t('isAndroid',!a.windowsTizen&&s.android,t=>{_='Android';const a=t.split(' ')[1];a&&(e=a)}),t('isTizen',s.tizen,t=>{_='Tizen';const a=t.split(' ')[1];a&&(e=a)}),t('isIPhone',!a.windowsTizen&&s.iphone,t=>{_='iOS';const a=t.split(' ')[2];a&&(e=a.replace('_','.'))}),t('isIPad',!a.windowsTizen&&s.ipad,t=>{_='iOS';const a=t.split(' ')[3];a&&(e=a.replace('_','.'))}),t('isWindowsPhone',s.winPhone,t=>{_='Windows Phone';const a=t.split(' ')[2];a&&(e=a)}),t('isWindowsPhoneOS',s.winPhoneOS,t=>{_='Windows Phone';const a=t.split(' ')[3];a&&(e=a)}),t('isBlackberry',a.blackberry,()=>{_='Blackberry',e='10',u='stock',h='webkit'}),t('isChrome',!a.edge&&!a.opera&&s.chrome,e=>{u='Chrome',h='Chromium';const t=e.split('/')[1];t&&(g=t)}),t('isOpera',s.opera,e=>{u='Opera',h='Chromium';const t=e.split('/')[1];t&&(g=t)}),t('isChromium',s.chromium,e=>{u='Chromium',h='Chromium';const t=e.split('/')[1];t&&(g=t)}),t('isFirefox',s.firefox,e=>{u='Firefox',h='Gecko';const t=e.split('/')[1];t&&(g=t)}),t('isInternetExplorer',s.ie,e=>{u='Internet Explorer',h='Trident';const t=e.split(' ')[1];t&&(g=t)}),t('isTrident','Internet Explorer'!=u&&a.trident,()=>{h='Trident';const e=/rv:[0-9.]+/i.exec(r);if(e&&e.length){u='Internet Explorer';const t=e[0].split(':')[1];t&&(g=t)}}),t('isEdge',s.edge,e=>{u='Edge',h='Edge';const t=e.split('/')[1];t&&(g=t)}),t('isEdgeChromium',s.edgeChromium,e=>{u='Edge',h='Chromium';const t=e.split('/')[1];t&&(g=t)}),t('isSafari',a.safari&&!a.nokia&&!a.chrome&&!a.chromium&&!a.genericIE&&!a.blackberry,()=>{u='Safari',h='WebKit';const e=/version\/[0-9.]+/i.exec(r),t=/crios\/[0-9.]+/i.exec(r),n=/fxios\/[0-9.]+/i.exec(r);if(e&&e.length){const t=e[0].split('/')[1];t&&(g=t)}if(t&&t.length){u='Chrome for iOS';const e=t[0].split('/')[1];e&&(g=e)}if(n&&n.length){u='Firefox for iOS';const e=n[0].split('/')[1];e&&(g=e)}}),t('isSilk',s.silk,e=>{u='Silk';const t=e.split('/')[1];t&&(g=t)}),t('isCrosswalk',a.crosswalk,()=>f='crosswalk'),t('isCordova',self.device&&(self.device.cordova||self.device.phonegap),()=>f='cordova'),t('isNWJS',s.nwjs,e=>{f='nwjs',u='NW.js',h='Chromium';const t=e.split('/')[1];t&&(g=t)}),t('isAmazonWebApp',a.amazonwebapp,()=>f='webapp'),t('isHomeScreenWebApp','nwjs'!=f&&'undefined'!=typeof window&&(window.matchMedia&&window.matchMedia('(display-mode: standalone)').matches||navigator.standalone),()=>f='webapp'),t('isFalseSafari','Safari'==u&&('Android'==_||'Tizen'==_||'Blackberry'==_),()=>u='stock'),t('isAndroidWebview','Chrome'==u&&'browser'==f&&a.webview,()=>f='webview'),t('isFirefoxOS','Firefox'==u&&'(unknown)'==_,()=>_='Firefox OS'),t('isAndroidFallback','(unknown)'==_&&!a.windowsTizen&&a.android,()=>_='Android'),t('isTridentFallback','(unknown)'==_&&a.trident,()=>h='Trident'),t('isWebkitFallback','(unknown)'==_&&a.webkit,()=>h='WebKit'),t('is64Bit',(e=>e.test(r)||e.test(navigator.platform)||'x64'===navigator.cpuClass)(/x86_64|x86-64|win64|x64;|x64\)|x64_|amd64|wow64|ia64|arm64|arch64|sparc64|ppc64|irix64/i),()=>d='64-bit'),t('is32Bit',(e=>e.test(r)||e.test(navigator.platform)||'x86'===navigator.cpuClass)(/x86;|x86\)|i86|i386|i486|i586|i686|armv1|armv2|armv3|armv4|armv5|armv6|armv7/i),()=>d='32-bit'),t('is64BitFallback','(unknown)'==d&&'Mac OS X'==_&&10.7<=parseFloat(e),()=>d='64-bit'),t('is32BitFallback','(unknown)'==d&&'Windows'==_||'Android'==_&&5>parseFloat(e),()=>d='32-bit'),t('is32BitBrowser','32-bit'==d||/wow64/i.test(r),()=>c='32-bit'),t('is64BitBrowser',/win64/i.test(r),()=>c='64-bit'),t('isDesktop',(()=>'Windows'==_||'Mac OS X'==_||'Linux'==_||'Chrome OS'==_||'nwjs'==f)(),()=>l=!0),'Edge'==h&&'undefined'!=typeof Windows&&'undefined'!=typeof Windows.System&&(f='windows-store'),m='nwjs'==f;const y='Mac OS X'==_&&navigator.maxTouchPoints&&2{e.onsuccess=()=>t(e.result),e.onerror=()=>a(e.error)})}function r(e){return new Promise((t,a)=>{e.oncomplete=()=>t(),e.onerror=()=>a(e.error),e.onabort=()=>a(e.error)})}function a(e,t){return _(e,t)}function s(e,t){return _(e,t,!0)}async function _(t,n,r=!1,a=!0){const s=await e(t);try{const e=s.transaction([h],r?'readwrite':'readonly');return n(e)}catch(e){if(a&&'InvalidStateError'===e.name)return y.delete(t),_(t,n,r,!1);throw e}}function e(e){u(e);let t=y.get(e);return t instanceof Promise||(t=d(e),y.set(e,t),t.catch(()=>y.delete(e))),t}async function d(e){u(e);const a=indexedDB.open(e,g);return a.addEventListener('upgradeneeded',t=>{try{const e=t.target.result;e.createObjectStore(h)}catch(t){console.error(`Failed to create objectstore for database ${e}`,t)}}),t(a)}function u(e){if('string'!=typeof e)throw new TypeError('expected string')}function p(e,t){const n=e.objectStore(h).openCursor();return new Promise(r=>{const a=[];n.onsuccess=n=>{const s=n.target.result;s?('entries'===t?a.push([s.key,s.value]):'keys'===t?a.push(s.key):'values'===t?a.push(s.value):void 0,s.continue()):r(a)}})}const g=2,h='keyvaluepairs',y=new Map,l='undefined'!=typeof IDBObjectStore&&'function'==typeof IDBObjectStore.prototype.getAll,m='undefined'!=typeof IDBObjectStore&&'function'==typeof IDBObjectStore.prototype.getAllKeys;self.KVStorageContainer=class{constructor(e){u(e),this.name=e}async ready(){await e(this.name)}set(a,n){return u(a),s(this.name,async e=>{const s=e.objectStore('keyvaluepairs').put(n,a),l=t(s),_=r(e);await Promise.all([_,l])})}get(n){return u(n),a(this.name,async a=>{const s=a.objectStore('keyvaluepairs').get(n),e=t(s),l=r(a),[_,d]=await Promise.all([l,e]);return d})}delete(a){return u(a),s(this.name,async n=>{const s=n.objectStore('keyvaluepairs').delete(a),e=t(s),l=r(n);await Promise.all([l,e])})}clear(){return s(this.name,async a=>{const n=a.objectStore('keyvaluepairs').clear(),s=t(n),e=r(a);await Promise.all([e,s])})}keys(){return a(this.name,async a=>{let n;if(m){const e=a.objectStore('keyvaluepairs').getAllKeys();n=t(e)}else n=p(a,'keys');const s=r(a),[e,l]=await Promise.all([s,n]);return l})}values(){return a(this.name,async a=>{let n;if(l){const e=a.objectStore('keyvaluepairs').getAll();n=t(e)}else n=p(a,'values');const s=r(a),[e,_]=await Promise.all([s,n]);return _})}entries(){return a(this.name,async t=>{const a=p(t,'entries'),n=r(t),[s,e]=await Promise.all([n,a]);return e})}}}{function t(e){throw new Error(`"${e}" is not implemented`)}function n(e){if('function'==typeof e)throw new Error(`localforage callback API is not implemented; please use the promise API instead`)}function r(e){return'object'==typeof e?new Promise(t=>{const{port1:a,port2:n}=new MessageChannel;n.onmessage=e=>t(e.data),a.postMessage(e)}):Promise.resolve(e)}const s=[/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],l=new WeakMap;let e=!1;'undefined'==typeof indexedDB&&(e=!0,console.warn('Unable to use local storage because indexedDB is not defined'));class _{constructor(e){this._inst=e,l.set(this,new Map)}_MaybeSwitchToMemoryFallback(t){if(!e)for(const a of s)if(t&&a.test(t.message)){console.error('Unable to use local storage, reverting to in-memory store: ',t,t.message),e=!0;break}}async _getItemFallback(e){const t=l.get(this).get(e),a=await r(t);return'undefined'==typeof a?null:a}async _setItemFallback(e,t){t=await r(t),l.get(this).set(e,t)}_removeItemFallback(e){l.get(this).delete(e)}_clearFallback(){l.get(this).clear()}_keysFallback(){return Array.from(l.get(this).keys())}IsUsingFallback(){return e}async getItem(t,a){if(n(a),e)return await this._getItemFallback(t);let r;try{r=await this._inst.get(t)}catch(a){return this._MaybeSwitchToMemoryFallback(a),e?await this._getItemFallback(t):(console.error(`Error reading '${t}' from storage, returning null: `,a),null)}return'undefined'==typeof r?null:r}async setItem(t,a,r){if(n(r),'undefined'==typeof a&&(a=null),e)return void(await this._setItemFallback(t,a));try{await this._inst.set(t,a)}catch(n){if(this._MaybeSwitchToMemoryFallback(n),e)await this._setItemFallback(t,a);else throw n}}async removeItem(t,a){if(n(a),e)return void this._removeItemFallback(t);try{await this._inst.delete(t)}catch(a){this._MaybeSwitchToMemoryFallback(a),e?this._removeItemFallback(t):console.error(`Error removing '${t}' from storage: `,a)}}async clear(t){if(n(t),e)return void this._clearFallback();try{await this._inst.clear()}catch(t){this._MaybeSwitchToMemoryFallback(t),e?this._clearFallback():console.error(`Error clearing storage: `,t)}}async keys(t){if(n(t),e)return this._keysFallback();let a=[];try{a=await this._inst.keys()}catch(t){if(this._MaybeSwitchToMemoryFallback(t),e)return this._keysFallback();console.error(`Error getting storage keys: `,t)}return a}ready(t){return n(t),e?Promise.resolve(!0):this._inst.ready()}createInstance(e){if('object'!=typeof e)throw new TypeError('invalid options object');const t=e.name;if('string'!=typeof t)throw new TypeError('invalid store name');const a=new KVStorageContainer(t);return new _(a)}length(){t('localforage.length()')}key(){t('localforage.key()')}iterate(){t('localforage.iterate()')}setDriver(){t('localforage.setDriver()')}config(){t('localforage.config()')}defineDriver(){t('localforage.defineDriver()')}driver(){t('localforage.driver()')}supports(){t('localforage.supports()')}dropInstance(){t('localforage.dropInstance()')}disableMemoryMode(){e=!1}}self.localforage=new _(new KVStorageContainer('localforage'))}{if(C3.Supports={},C3.Supports.WebAnimations=(()=>{try{if('Safari'===C3.Platform.Browser)return!1;if('undefined'==typeof document)return!1;const e=document.createElement('div');if('undefined'==typeof e.animate)return!1;const t=e.animate([{opacity:'0'},{opacity:'1'}],1e3);return'undefined'!=typeof t.reverse}catch(e){return!1}})(),C3.Supports.DialogElement='undefined'!=typeof HTMLDialogElement,C3.Supports.RequestIdleCallback=!!self.requestIdleCallback,C3.Supports.ImageBitmap=!!self.createImageBitmap,C3.Supports.ImageBitmapOptions=!1,C3.Supports.ImageBitmap)try{self.createImageBitmap(new ImageData(32,32),{premultiplyAlpha:'none'}).then(()=>{C3.Supports.ImageBitmapOptions=!0}).catch(()=>{C3.Supports.ImageBitmapOptions=!1})}catch(e){C3.Supports.ImageBitmapOptions=!1}C3.Supports.ClipboardReadText=!!(navigator.clipboard&&navigator.clipboard.readText&&'Firefox'!==C3.Platform.Browser),C3.Supports.Proxies='undefined'!=typeof Proxy,C3.Supports.DownloadAttribute=(()=>{if('undefined'==typeof document)return!1;const e=document.createElement('a');return'undefined'!=typeof e.download})(),C3.Supports.CanvasToBlob=(()=>'undefined'!=typeof HTMLCanvasElement&&HTMLCanvasElement.prototype.toBlob)(),C3.Supports.CSSElement='undefined'!=typeof CSS&&CSS.supports('background','element(#test)'),C3.Supports.Fetch='function'==typeof fetch,C3.Supports.PersistentStorage=!!(self.isSecureContext&&'Opera'!==C3.Platform.Browser&&navigator.storage&&navigator.storage.persist),C3.Supports.StorageQuotaEstimate=!!(self.isSecureContext&&navigator.storage&&navigator.storage.estimate),C3.Supports.Fullscreen=(()=>{if('undefined'==typeof document)return!1;if('iOS'===C3.Platform.OS)return!1;const e=document.documentElement;return!!(e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen)})();const t=[{name:'A',value:12},{name:'B',value:13},{name:'C',value:13},{name:'D',value:13},{name:'E',value:13},{name:'F',value:13},{name:'G',value:14},{name:'H',value:12},{name:'I',value:12},{name:'J',value:13},{name:'K',value:14}],n=Math.ceil(496/t.length),r=(n+'').length,s=[];for(const l of t)for(let e=0;e<=n;e++)s.push({name:l.name+(e+'').padStart(r,'0'),value:l.value});s.sort((e,t)=>t.value-e.value);const a=s.reduce((e,t)=>{const a=t.name.slice(0,1),n=e.slice(-1);return n===a?e:e+a},'');C3.Supports.ArraySortProbablyStable='GKBCDEFJAHI'===a}{if(!String.prototype.trimStart){const e=/^[\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(){return this.replace(e,'')}}if(!String.prototype.trimEnd){const e=/[\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(){return this.replace(e,'')}}if(Array.prototype.values||(Array.prototype.values=function*(){for(const e of this)yield e}),!Array.prototype.flat){function e(t,a){return t.reduce((t,n)=>0navigator.webkitTemporaryStorage.queryUsageAndQuota((t,a)=>e({usage:t,quota:a}),t))}),'undefined'==typeof HTMLCollection||HTMLCollection.prototype[Symbol.iterator]||(HTMLCollection.prototype[Symbol.iterator]=function(){let e=0;return{next:()=>e>=this.length?{done:!0}:{value:this.item(e++),done:!1}}}),'undefined'==typeof NodeList||NodeList.prototype[Symbol.iterator]||(NodeList.prototype[Symbol.iterator]=function(){let e=0;return{next:()=>e>=this.length?{done:!0}:{value:this.item(e++),done:!1}}}),'undefined'==typeof DOMTokenList||DOMTokenList.prototype[Symbol.iterator]||(DOMTokenList.prototype[Symbol.iterator]=function(){let e=0;return{next:()=>e>=this.length?{done:!0}:{value:this.item(e++),done:!1}}}),('undefined'==typeof FileList||FileList.prototype[Symbol.iterator]||(FileList.prototype[Symbol.iterator]=function(){let e=0;return{next:()=>e>=this.length?{done:!0}:{value:this.item(e++),done:!1}}}),'undefined'==typeof TextEncoder&&(self.TextEncoder=class{constructor(){Object.defineProperty(this,'encoding',{value:'utf-8',writable:!1})}encode(t){for(var a=t.length,n=-1,r=new Uint8Array(3*a),s=0,l=0,_=0;_!==a;){if(s=t.charCodeAt(_),_+=1,55296<=s&&56319>=s){if(_===a){r[n+=1]=239,r[n+=1]=191,r[n+=1]=189;break}if(l=t.charCodeAt(_),!(56320<=l&&57343>=l)){r[n+=1]=239,r[n+=1]=191,r[n+=1]=189;continue}else if(s=1024*(s-55296)+l-56320+65536,_+=1,65535>>18,r[n+=1]=128|63&s>>>12,r[n+=1]=128|63&s>>>6,r[n+=1]=128|63&s;continue}}127>=s?r[n+=1]=0|s:2047>=s?(r[n+=1]=192|s>>>6,r[n+=1]=128|63&s):(r[n+=1]=224|s>>>12,r[n+=1]=128|63&s>>>6,r[n+=1]=128|63&s)}return new Uint8Array(r.buffer.slice(0,n+1))}toString(){return'[object TextEncoder]'}},TextEncoder[Symbol.toStringTag]='TextEncoder'),'undefined'==typeof TextDecoder)){function t(e){const t=e[Symbol.iterator]();return{next:()=>t.next(),[Symbol.iterator](){return this}}}function e(e){const t=e.next();if(t.done)throw new Error('unexpected end of input');if(0!=(128^192&t.value))throw new Error('invalid byte');return 63&t.value}const n=new Map;n.set('utf-8',(a,n)=>{let r;if(a.buffer)r=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);else if(r instanceof ArrayBuffer)r=new Uint8Array(a);else throw new Error('Invalid parameter');const s=t(r),l=[];try{for(const t of s){let a;if(127>t)a=127&t;else if(223>t)a=(31&t)<<6|e(s);else if(239>t)a=(15&t)<<12|e(s)<<6|e(s);else if(247>t)a=(7&t)<<18|e(s)<<12|e(s)<<6|e(s);else throw new Error('Invalid character');l.push(String.fromCodePoint(a))}}catch(e){if(n)throw e;l.push('\uFFFD')}return l.join('')}),n.set('utf8',n.get('utf-8')),n.set('utf-16le',()=>{throw new Error('utf-16le decoder not implemented')}),self.TextDecoder=class{constructor(e='utf-8',t={}){const a=n.get(e);if(!a)throw new Error(`TextDecoder polyfill does not support "${e}"`);Object.defineProperty(this,'fatal',{value:!0===t.fatal,writable:!1}),Object.defineProperty(this,'_decoder',{value:a,writable:!1}),Object.defineProperty(this,'encoding',{value:e,writable:!1})}decode(e){return this._decoder(e,this.fatal)}toString(){return'[object TextDecoder]'}},TextDecoder[Symbol.toStringTag]='TextDecoder'}'undefined'==typeof self.isSecureContext&&(self.isSecureContext='https:'===location.protocol),'undefined'==typeof self.globalThis&&(self.globalThis=self)}{function e(e){let t=C3.GetCallStack();console.error('Assertion failure: '+e+'\n\nStack trace:\n'+t)}self.assert=function(t,a){t||e(a)}}{C3.IsNumber=function(e){return'number'==typeof e},C3.IsFiniteNumber=function(e){return C3.IsNumber(e)&&isFinite(e)},C3.RequireNumber=function(e){if(!C3.IsNumber(e))throw new TypeError('expected number')},C3.RequireOptionalNumber=function(e){C3.IsNullOrUndefined(e)},C3.RequireNumberInRange=function(e,t,a){if(!C3.IsNumber(e)||isNaN(e)||t>e||aC3.getName(e))),a=[...t].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: ${a}`),u.clear(),e.clear()}}function s(e){let t=new Set;for(let a in e)t.add(a);return t}function _(t,a){let n=s(a),r=m.get(t);if(r){let e=[];for(let t of r.values())n.has(t)?n.delete(t):e.push(t);C3.appendArray(e,[...n]),e.length&&console.warn(`[Defence] '${C3.getName(t)}' constructor creates inconsistent properties: ${e.join(', ')}`)}else m.set(t,n)}C3.GetCallStack=function(){return new Error().stack},C3.Debugger=function(){debugger},C3.cast=function(e,t){return e&&e instanceof t?e:null},C3.getName=function(e){return'undefined'==typeof e?'undefined':null===e?'null':'boolean'==typeof e?'':C3.IsNumber(e)?'':C3.IsString(e)?'':C3.IsArray(e)?'':'symbol'==typeof e?'<'+e.toString()+'>':C3.IsFunction(e)?e.name&&'Function'!==e.name?e.name:'':'object'==typeof e?e.constructor&&e.constructor.name&&'Object'!==e.constructor.name?e.constructor.name:'':''},C3.getType=function(e){return null===e?'null':Array.isArray(e)?'array':typeof e},C3.range=function*(e,t){if(!isFinite(Math.abs(e-t)))throw new Error('Invalid parameters');if(e>t)for(let a=e-1;a>=t;a--)yield a;else for(let a=e;a1/e}const a=2*Math.PI,n=Math.PI/180,r=180/Math.PI;C3.wrap=function(e,t,n){var r=Math.floor;if(e=r(e),t=r(t),n=r(n),en?n:e},C3.clampAngle=function(e){return e%=a,0>e&&(e+=a),e},C3.toRadians=function(e){return e*n},C3.toDegrees=function(e){return e*r},C3.distanceTo=function(e,t,a,n){return Math.hypot(a-e,n-t)},C3.distanceSquared=function(t,a,n,r){const s=n-t,e=r-a;return s*s+e*e},C3.angleTo=function(e,t,a,n){return Math.atan2(n-t,a-e)},C3.angleDiff=function(t,a){var n=Math.cos,r=Math.sin;if(t===a)return 0;let s=r(t),e=n(t),l=r(a),_=n(a),d=s*l+e*_;return 1<=d?0:-1>=d?Math.PI:Math.acos(d)},C3.angleRotate=function(t,a,n){var r=Math.cos,s=Math.sin;let e=s(t),l=r(t),_=s(a),d=r(a);return Math.acos(e*_+l*d)>n?0=e*l-s*_},C3.angleLerp=function(e,t,a){let n=C3.angleDiff(e,t);return C3.angleClockwise(t,e)?C3.clampAngle(e+n*a):C3.clampAngle(e-n*a)},C3.lerp=function(e,t,a){return e+a*(t-e)},C3.unlerp=function(e,t,a){return e===t?0:(a-e)/(t-e)},C3.relerp=function(t,e,a,n,r){return C3.lerp(n,r,C3.unlerp(t,e,a))},C3.qarp=function(e,t,a,n){return C3.lerp(C3.lerp(e,t,n),C3.lerp(t,a,n),n)},C3.cubic=function(t,e,a,n,r){return C3.lerp(C3.qarp(t,e,a,r),C3.qarp(e,a,n,r),r)},C3.cosp=function(e,t,a){return(e+t+(e-t)*Math.cos(a*Math.PI))/2},C3.isPOT=function(e){return 0t;t<<=1)e|=e>>t;return e+1},C3.roundToNearestFraction=function(e,t){return Math.round(e*t)/t},C3.floorToNearestFraction=function(e,t){return Math.floor(e*t)/t},C3.round6dp=function(e){return Math.round(1e6*e)/1e6},C3.toFixed=function(e,t){let a=e.toFixed(t),n=a.length-1;for(;0<=n&&'0'===a.charAt(n);--n);return 0<=n&&'.'===a.charAt(n)&&--n,0>n?a:a.substr(0,n+1)},C3.PackRGB=function(e,t,a){return C3.clamp(e,0,255)|C3.clamp(t,0,255)<<8|C3.clamp(a,0,255)<<16};const s=1024;C3.PackRGBAEx=function(e,t,n,r){var l=Math.floor;return e=C3.clamp(l(1024*e),-8192,8191),t=C3.clamp(l(1024*t),-8192,8191),n=C3.clamp(l(1024*n),-8192,8191),r=C3.clamp(l(1023*r),0,1023),0>e&&(e+=16384),0>t&&(t+=16384),0>n&&(n+=16384),-(16384*(16384*e)*s+16384*t*s+n*s+r)},C3.PackRGBEx=function(e,t,a){return C3.PackRGBAEx(e,t,a,1)},C3.GetRValue=function(e){if(0<=e)return(255&e)/255;else{let t=Math.floor(-e/274877906944);return 8191>8)/255;else{let t=Math.floor(-e%274877906944/16777216);return 8191>16)/255;else{let t=Math.floor(-e%16777216/s);return 8191r(n-s))return a.slice(0);if(s=t/a[1]*a[0],1>r(n-s))return[a[1],a[0]]}let l=C3.greatestCommonDivisor(t,n);return[t/l,n/l]},C3.segmentsIntersect=function(_,a,d,c,e,f,g,h){var S=Math.abs;let G=0,I=0,T=0,b=0,C=0,P=0,A=0,R=0;if(_C)return!1;if(aA)return!1;let D=e-_+g-d,s=f-a+h-c,t=d-_,u=c-a,v=g-e,E=h-f,x=S(u*v-E*t);return!(S(v*s-E*D)>x)&&S(t*s-u*D)<=x},C3.segmentsIntersectPreCalc=function(_,a,d,c,e,f,g,h,S,G,I,l){var m=Math.abs;let n=0,T=0,b=0,C=0;if(Sn)return!1;if(Gb)return!1;let P=S-_+I-d,s=G-a+l-c,t=d-_,u=c-a,v=I-S,A=l-G,x=m(u*v-A*t);return!(m(v*s-A*P)>x)&&m(t*s-u*P)<=x},C3.segmentIntersectsQuad=function(t,a,r,s,_){let e=0,d=0,u=0,c=0;t0!==e.size).filter(e=>t(e)).map(async e=>{try{return await C3.CloneFile(e)}catch(e){return null}}),n=await Promise.all(a);return n.filter(e=>e)},C3.IsFileAnImage=function(e){return-1!==e.type.search(/image\/.*/)},C3.IsFileAnSVG=function(e){return'image/svg+xml'===e.type},C3.GetFileExtension=function(e){let t=e.lastIndexOf('.');return 1>t?'':e.substr(t)},C3.GetFileNamePart=function(e){let t=e.lastIndexOf('.');return 1>t?e:e.substr(0,t)},C3.NormalizeFileSeparator=function(e){return e.replace(/\\/g,'/')},C3.ParseFilePath=function(t){t=C3.NormalizeFileSeparator(t);let n=/^\w\:\//.exec(t);n?(n=n[0],t=t.slice(3),'/'!==t[0]&&(t='/'+t)):n='',t=t.replace(/\/{2,}/g,'/'),1{self.setTimeout(a,e,t)})},C3.swallowException=function(e){try{e()}catch(e){C3.isDebug&&console.warn('Swallowed exception: ',e)}},C3.noop=function(){},C3.equalsNoCase=function(e,t){return'string'==typeof e&&'string'==typeof t&&(e===t||(e=e.normalize(),t=t.normalize(),e.length===t.length&&e.toLowerCase()===t.toLowerCase()))},C3.equalsCase=function(e,t){return'string'==typeof e&&'string'==typeof t&&(e===t||e.normalize()===t.normalize())},C3.stableSort=function(t,e){if(C3.Supports.ArraySortProbablyStable)return void t.sort(e);const a=t.map((e,t)=>[e,t]);a.sort((t,n)=>{const a=e(t[0],n[0]);return 0===a?t[1]-n[1]:a});for(let n=0,r=t.length;nn&&C3.extendArray(e,t,a)},C3.shallowAssignArray=function(e,t){C3.clearArray(e),C3.appendArray(e,t)},C3.appendArray=function(e,t){if(1e4>t.length)e.push(...t);else for(let a=0,n=t.length;at||t>=e.length)){let a=e.length-1;for(let n=t;na:5==t&&e>=a},C3.hasAnyOwnProperty=function(e){for(let t in e)if(e.hasOwnProperty(t))return!0;return!1},C3.PromiseAllWithProgress=function(t,a){return t.length?new Promise((n,r)=>{const s=[];let e=0,l=!1;for(let _=0,d=t.length;_{l||(s[_]=r,++e,e===t.length?n(s):a(e,t.length))}).catch(e=>{l=!0,r(e)})}):Promise.resolve([])};let n=[];C3.AddLibraryMemoryCallback=function(e){n.push(e)},C3.GetEstimatedLibraryMemoryUsage=function(){let e=0;for(let t of n){let a=t();e+=a}return Math.floor(e)};const r=new MessageChannel;r.port2.onmessage=function(t){const a=t.data,n=e.get(a);e.delete(a),n&&n(t.timeStamp)};let s=1;const e=new Map;C3.RequestUnlimitedAnimationFrame=function(t){const a=s++;return e.set(a,t),r.port1.postMessage(a),a},C3.CancelUnlimitedAnimationFrame=function(t){e.delete(t)},C3.PostTask=C3.RequestUnlimitedAnimationFrame,C3.WaitForNextTask=function(){return new Promise(e=>C3.PostTask(e))};const l=new Set;C3.RequestPostAnimationFrame=function(e){const t=self.requestAnimationFrame(async a=>{await C3.WaitForNextTask(),l.has(t)&&(l.delete(t),e(a))});return l.add(t),t},C3.CancelPostAnimationFrame=function(e){l.has(e)&&(self.cancelAnimationFrame(e),l.delete(e))}}'use strict',C3.IsAbsoluteURL=function(e){return /^(?:[a-z]+:)?\/\//.test(e)||'data:'===e.substr(0,5)||'blob:'===e.substr(0,5)},C3.IsRelativeURL=function(e){return!C3.IsAbsoluteURL(e)},C3.ThrowIfNotOk=function(e){if(!e.ok)throw new Error(`fetch '${e.url}' response returned ${e.status} ${e.statusText}`)},C3.FetchOk=function(e,t){return fetch(e,t).then(e=>(C3.ThrowIfNotOk(e),e))},C3.FetchText=function(e){return C3.FetchOk(e).then(e=>e.text())},C3.FetchJson=function(e){return C3.FetchOk(e).then(e=>e.json())},C3.FetchBlob=function(e){return C3.FetchOk(e).then(e=>e.blob())},C3.FetchArrayBuffer=function(e){return C3.FetchOk(e).then(e=>e.arrayBuffer())},C3.FetchImage=function(e){return new Promise((t,n)=>{const a=new Image;a.onload=()=>t(a),a.onerror=e=>n(e),a.src=e})},C3.BlobToArrayBuffer=function(e){return new Promise((t,a)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>a(n.error),n.readAsArrayBuffer(e)})},C3.BlobToString=function(e){return new Promise((t,a)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>a(n.error),n.readAsText(e)})},C3.BlobToJson=function(e){return C3.BlobToString(e).then(e=>JSON.parse(e))},C3.BlobToImage=async function(e,t){let n=URL.createObjectURL(e);try{const e=await C3.FetchImage(n);return URL.revokeObjectURL(n),n='',t&&'function'==typeof e.decode&&(await e.decode()),e}finally{n&&URL.revokeObjectURL(n)}},C3.CreateCanvas=function(e,t){if('undefined'!=typeof document&&'function'==typeof document.createElement){const a=document.createElement('canvas');return a.width=e,a.height=t,a}return new OffscreenCanvas(e,t)},C3.CanvasToBlob=function(e,t,a){return'number'!=typeof a&&(a=1),t=t||'image/png',a=C3.clamp(a,0,1),e.toBlob?new Promise(n=>e.toBlob(n,t,a)):e.convertToBlob?e.convertToBlob({type:t,quality:a}):C3.Asyncify(()=>C3.CanvasToBlobSync(e,t,a))},C3.CanvasToBlobSync=function(e,t,a){return'number'!=typeof a&&(a=1),t=t||'image/png',a=C3.clamp(a,0,1),C3.DataURIToBinaryBlobSync(e.toDataURL(t,a))},C3.DataURIToBinaryBlobSync=function(e){const t=C3.ParseDataURI(e);return C3.BinaryStringToBlob(t.data,t.mime_type)},C3.ParseDataURI=function(t){if('data:'!==t.substr(0,5))throw new URIError('expected data: uri');let a=t.indexOf(',');if(0>a)throw new URIError('expected comma in data: uri');let n=t.substring(5,a),r=t.substring(a+1),e=n.split(';'),s=e[0]||'',l=e[1],_=e[2],d;return d='base64'===l||'base64'===_?atob(r):decodeURIComponent(r),{mime_type:s,data:d}},C3.BinaryStringToBlob=function(t,a){let n=t.length,e=n>>2,r=new Uint8Array(n),s=new Uint32Array(r.buffer,0,e),l,_;for(l=0,_=0;lC3.DrawableToBlob(e,n,r));if(C3.Supports.ImageBitmap)return createImageBitmap(t).then(e=>C3.DrawableToBlob(e,n,r));else{const a=C3.CreateCanvas(t.width,t.height),s=a.getContext('2d');return s.putImageData(t,0,0),C3.CanvasToBlob(a,n,r)}},C3.CopySet=function(e,t){e.clear();for(const a of t)e.add(a)},C3.MapToObject=function(e){const t=Object.create(null);for(const[a,n]of e.entries())t[a]=n;return t},C3.ObjectToMap=function(e,t){t.clear();for(const[a,n]of Object.entries(e))t.set(a,n)},C3.ToSuperJSON=function t(a){if('object'==typeof a&&null!==a){if(a instanceof Set)return{_c3type_:'set',data:[...a].map(e=>t(e))};if(a instanceof Map)return{_c3type_:'map',data:[...a].map(e=>[e[0],t(e[1])])};else{const n=Object.create(null);for(const[r,s]of Object.entries(a))n[r]=t(s);return n}}return a},C3.FromSuperJSON=function t(a){if('object'==typeof a&null!==a){if('set'===a._c3type_)return new Set(a.data.map(e=>t(e)));if('map'===a._c3type_)return new Map(a.data.map(e=>[e[0],t(e[1])]));else{const n=Object.create(null);for(const[r,s]of Object.entries(a))n[r]=t(s);return n}}return a},C3.CSSToCamelCase=function(e){let t='',a=!1;for(const n of e)'-'===n?a=!0:a?(t+=n.toUpperCase(),a=!1):t+=n;return t},C3.IsIterator=function(e){return'object'==typeof e&&'function'==typeof e.next},'use strict';{function t(e){return 0===e.length?'00':1===e.length?'0'+e:e}function a(e,t,a){return 0>a&&(a+=1),1n.length)return!1;const r=parseInt(n[0].trim(),10)/255,s=parseInt(n[1].trim(),10)/255,l=parseInt(n[2].trim(),10)/255;return isFinite(r)&&this.setR(r),isFinite(s)&&this.setG(s),isFinite(l)&&this.setB(l),this.setA(1),!0}parseCommaSeparatedPercentageRgb(t){if('string'!=typeof t)return!1;t=t.replace(/^rgb\(|\)|%/,'');const n=t.split(',');if(3>n.length)return!1;const r=parseInt(n[0].trim(),10)/100,s=parseInt(n[1].trim(),10)/100,l=parseInt(n[2].trim(),10)/100;return isFinite(r)&&this.setR(r),isFinite(s)&&this.setG(s),isFinite(l)&&this.setB(l),this.setA(1),!0}parseCommaSeparatedRgba(t){if('string'!=typeof t)return!1;t=t.replace(/^rgba\(|\)|%/,'');const n=t.split(',');if(4>n.length)return!1;const r=parseInt(n[0].trim(),10)/255,s=parseInt(n[1].trim(),10)/255,l=parseInt(n[2].trim(),10)/255,e=parseFloat(n[3].trim());return isFinite(r)&&this.setR(r),isFinite(s)&&this.setG(s),isFinite(l)&&this.setB(l),isFinite(e)&&this.setA(e),!0}parseCommaSeparatedPercentageRgba(t){if('string'!=typeof t)return!1;t=t.replace(/^rgba\(|\)|%/,'');const n=t.split(',');if(4>n.length)return!1;const r=parseInt(n[0].trim(),10)/100,s=parseInt(n[1].trim(),10)/100,l=parseInt(n[2].trim(),10)/100,e=parseFloat(n[3].trim());return isFinite(r)&&this.setR(r),isFinite(s)&&this.setG(s),isFinite(l)&&this.setB(l),isFinite(e)&&this.setA(e),!0}parseString(e){if('string'!=typeof e)return!1;if(e=e.replace(/\s+/,''),e.includes(',')){if(e.startsWith('rgb('))return e.includes('%')?this.parseCommaSeparatedPercentageRgb(e):this.parseCommaSeparatedRgb(e);if(e.startsWith('rgba('))return e.includes('%')?this.parseCommaSeparatedPercentageRgba(e):this.parseCommaSeparatedRgba(e);if(e.startsWith('hsl(')||e.startsWith('hsla('))return this.parseHSLString(e);else{const t=e.split(',');return e.includes('%')?3===t.length?this.parseCommaSeparatedPercentageRgb(e):4===t.length&&this.parseCommaSeparatedPercentageRgba(e):3===t.length?this.parseCommaSeparatedRgb(e):4===t.length&&this.parseCommaSeparatedRgba(e)}}else return this.parseHexString(e)}toJSON(){return[this._r,this._g,this._b,this._a]}setFromHSLA(t,n,r,s){let l,_,u;if(t%=360,n=C3.clamp(n,0,100),r=C3.clamp(r,0,100),s=C3.clamp(s,0,1),t/=360,n/=100,r/=100,0===n)l=_=u=r;else{const e=.5>r?r*(1+n):r+n-r*n,s=2*r-e;l=a(s,e,t+1/3),_=a(s,e,t),u=a(s,e,t-1/3)}return this.setR(l),this.setG(_),this.setB(u),this.setA(s),this}parseHSLString(t){const a=t.replace(/ |hsl|hsla|\(|\)|;/gi,''),s=n.exec(a),e=r.exec(a);return s&&4===s.length?(this.setFromHSLA(+s[1],+s[2],+s[3],1),!0):!!(e&&5===e.length)&&(this.setFromHSLA(+s[1],+s[2],+s[3],+s[4]),!0)}toHSLAString(){const t=this._r,n=this._g,r=this._b,e=this._a,s=C3.Color.GetHue(t,n,r),a=C3.Color.GetSaturation(t,n,r),l=C3.Color.GetLuminosity(t,n,r);return`hsla(${s}, ${a}%, ${l}%, ${e})`}toHSLAArray(){const e=this._r,t=this._g,a=this._b;return[C3.Color.GetHue(e,t,a),C3.Color.GetSaturation(e,t,a),C3.Color.GetLuminosity(e,t,a),this._a]}setFromJSON(e){!Array.isArray(e)||3>e.length||(this._r=e[0],this._g=e[1],this._b=e[2],this._a=4<=e.length?e[3]:1)}set r(e){this.setR(e)}get r(){return this.getR()}set g(e){this.setG(e)}get g(){return this.getG()}set b(e){this.setB(e)}get b(){return this.getB()}set a(e){this.setA(e)}get a(){return this.getA()}setAtIndex(e,t){switch(e){case 0:this.setR(t);break;case 1:this.setG(t);break;case 2:this.setB(t);break;case 3:this.setA(t);break;default:throw new RangeError('invalid color index');}}getAtIndex(e){switch(e){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 Diff(t,a){var n=Math.min,r=Math.max;const s=new C3.Color;return s.setR(r(t._r,a._r)-n(t._r,a._r)),s.setG(r(t._g,a._g)-n(t._g,a._g)),s.setB(r(t._b,a._b)-n(t._b,a._b)),s.setA(r(t._a,a._a)-n(t._a,a._a)),s}static GetHue(t,a,n){const r=Math.max(t,a,n),s=Math.min(t,a,n);if(r===s)return 0;let e=0;return r===t?e=(a-n)/(r-s)+(an&&(this._right=+n),this._bottom>r&&(this._bottom=+r)}clampFlipped(t,a,n,r){this._lefta&&(this._top=+a),this._right>n&&(this._right=+n),this._bottomthis._right&&this.swapLeftRight(),this._top>this._bottom&&this.swapTopBottom()}intersectsRect(e){return!(e._rightthis._right||e._top>this._bottom)}intersectsRectOffset(e,t,a){return!(e._right+tthis._right||e._top+a>this._bottom)}containsPoint(e,t){return e>=this._left&&e<=this._right&&t>=this._top&&t<=this._bottom}containsRect(e){return e._left>=this._left&&e._top>=this._top&&e._right<=this._right&&e._bottom<=this._bottom}expandToContain(e){e._leftthis._right&&(this._right=+e._right),e._bottom>this._bottom&&(this._bottom=+e._bottom)}lerpInto(e){this._left=C3.lerp(e._left,e._right,this._left),this._top=C3.lerp(e._top,e._bottom,this._top),this._right=C3.lerp(e._left,e._right,this._right),this._bottom=C3.lerp(e._top,e._bottom,this._bottom)}},'use strict';{function t(t,r,a,s){ts?r:s):(n=ta?r:a):as?t:s):(n=ra?t:a)}let n=0,e=0;C3.Quad=class{constructor(t,a,n,r,s,e,l,_){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,t instanceof C3.Quad?this.copy(t):this.set(t||0,a||0,n||0,r||0,s||0,e||0,l||0,_||0)}set(t,a,n,r,s,e,l,_){this._tlx=+t,this._tly=+a,this._trx=+n,this._try=+r,this._brx=+s,this._bry=+e,this._blx=+l,this._bly=+_}setRect(e,t,a,n){this.set(e,t,a,t,a,n,e,n)}copy(e){this._tlx=e._tlx,this._tly=e._tly,this._trx=e._trx,this._try=e._try,this._brx=e._brx,this._bry=e._bry,this._blx=e._blx,this._bly=e._bly}equals(e){return this._tlx===e._tlx&&this._tly===e._tly&&this._trx===e._trx&&this._try===e._try&&this._brx===e._brx&&this._bry===e._bry&&this._blx===e._blx&&this._bly===e._bly}setTlx(e){this._tlx=+e}getTlx(){return this._tlx}setTly(e){this._tly=+e}getTly(){return this._tly}setTrx(e){this._trx=+e}getTrx(){return this._trx}setTry(e){this._try=+e}getTry(){return this._try}setBrx(e){this._brx=+e}getBrx(){return this._brx}setBry(e){this._bry=+e}getBry(){return this._bry}setBlx(e){this._blx=+e}getBlx(){return this._blx}setBly(e){this._bly=+e}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(e,t){e[t++]=this._tlx,e[t++]=this._tly,e[t++]=this._trx,e[t++]=this._try,e[t++]=this._brx,e[t++]=this._bry,e[t++]=this._blx,e[t]=this._bly}writeToTypedArray3D(e,t,a){e[t++]=this._tlx,e[t++]=this._tly,e[t++]=a,e[t++]=this._trx,e[t++]=this._try,e[t++]=a,e[t++]=this._brx,e[t++]=this._bry,e[t++]=a,e[t++]=this._blx,e[t++]=this._bly,e[t]=a}offset(e,t){this._tlx+=+e,this._tly+=+t,this._trx+=+e,this._try+=+t,this._brx+=+e,this._bry+=+t,this._blx+=+e,this._bly+=+t}round(){var e=Math.round;this._tlx=e(this._tlx),this._tly=e(this._tly),this._trx=e(this._trx),this._try=e(this._try),this._brx=e(this._brx),this._bry=e(this._bry),this._blx=e(this._blx),this._bly=e(this._bly)}floor(){var e=Math.floor;this._tlx=e(this._tlx),this._tly=e(this._tly),this._trx=e(this._trx),this._try=e(this._try),this._brx=e(this._brx),this._bry=e(this._bry),this._blx=e(this._blx),this._bly=e(this._bly)}ceil(){var e=Math.ceil;this._tlx=e(this._tlx),this._tly=e(this._tly),this._trx=e(this._trx),this._try=e(this._try),this._brx=e(this._brx),this._bry=e(this._bry),this._blx=e(this._blx),this._bly=e(this._bly)}setFromRect(e){this._tlx=e._left,this._tly=e._top,this._trx=e._right,this._try=e._top,this._brx=e._right,this._bry=e._bottom,this._blx=e._left,this._bly=e._bottom}setFromRotatedRect(e,t){0===t?this.setFromRect(e):this.setFromRotatedRectPrecalc(e,Math.sin(t),Math.cos(t))}setFromRotatedRectPrecalc(t,a,n){const r=t._left*a,s=t._top*a,e=t._right*a,l=t._bottom*a,_=t._left*n,d=t._top*n,u=t._right*n,c=t._bottom*n;this._tlx=_-s,this._tly=d+r,this._trx=u-s,this._try=d+e,this._brx=u-l,this._bry=c+e,this._blx=_-l,this._bly=c+r}getBoundingBox(a){t(this._tlx,this._trx,this._brx,this._blx),a._left=n,a._right=e,t(this._tly,this._try,this._bry,this._bly),a._top=n,a._bottom=e}containsPoint(t,a){let r=this._trx-this._tlx,s=this._try-this._tly;const _=this._brx-this._tlx,e=this._bry-this._tly,u=t-this._tlx,g=a-this._tly;let h=r*r+s*s,f=r*_+s*e,y=r*u+s*g;const S=_*_+e*e,l=_*u+e*g;let m=1/(h*S-f*f),G=(S*y-f*l)*m,I=(h*l-f*y)*m;return!!(0<=G&&0G+I)||(r=this._blx-this._tlx,s=this._bly-this._tly,h=r*r+s*s,f=r*_+s*e,y=r*u+s*g,m=1/(h*S-f*f),G=(S*y-f*l)*m,I=(h*l-f*y)*m,0<=G&&0G+I)}midX(){return(this._tlx+this._trx+this._brx+this._blx)/4}midY(){return(this._tly+this._try+this._bry+this._bly)/4}intersectsSegment(e,t,a,n){return!!(this.containsPoint(e,t)||this.containsPoint(a,n))||C3.segmentIntersectsQuad(e,t,a,n,this)}intersectsQuad(t){let a=t.midX(),n=t.midY();if(this.containsPoint(a,n))return!0;if(a=this.midX(),n=this.midY(),t.containsPoint(a,n))return!0;const r=this._tlx,s=this._tly,e=this._trx,l=this._try,_=this._brx,d=this._bry,u=this._blx,g=this._bly;return C3.segmentIntersectsQuad(r,s,e,l,t)||C3.segmentIntersectsQuad(e,l,_,d,t)||C3.segmentIntersectsQuad(_,d,u,g,t)||C3.segmentIntersectsQuad(u,g,r,s,t)}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(e,t){const a=this._getAtIndex(e);this._setAtIndex(e,this._getAtIndex(t)),this._setAtIndex(t,a)}_getAtIndex(e){switch(e){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(e,t){switch(t=+t,e){case 0:this._tlx=t;break;case 1:this._tly=t;break;case 2:this._trx=t;break;case 3:this._try=t;break;case 4:this._brx=t;break;case 5:this._bry=t;break;case 6:this._blx=t;break;case 7:this._bly=t;break;default:throw new RangeError('invalid quad point index');}}}}{const e=[0,0,1,0,1,1,0,1],t=C3.New(C3.Quad);C3.CollisionPoly=class extends C3.DefendedBase{constructor(t,a=!0){super(),t||(t=e),this._ptsArr=Float64Array.from(t),this._bbox=new C3.Rect,this._isBboxChanged=!0,this._enabled=a}Release(){}pointsArr(){return this._ptsArr}pointCount(){return this._ptsArr.length/2}setPoints(e){this._ptsArr.length===e.length?this._ptsArr.set(e):this._ptsArr=Float64Array.from(e),this._isBboxChanged=!0}copy(e){this.setPoints(e._ptsArr)}setBboxChanged(){this._isBboxChanged=!0}_updateBbox(){if(!this._isBboxChanged)return;const t=this._ptsArr;let a=t[0],n=t[1],r=a,s=n;for(let e=0,l=t.length;er&&(r=l),_s&&(s=_)}this._bbox.set(a,n,r,s),this._isBboxChanged=!1}setFromRect(e,t,a){let n=this._ptsArr;8!==n.length&&(n=new Float64Array(8),this._ptsArr=n),n[0]=e.getLeft()-t,n[1]=e.getTop()-a,n[2]=e.getRight()-t,n[3]=e.getTop()-a,n[4]=e.getRight()-t,n[5]=e.getBottom()-a,n[6]=e.getLeft()-t,n[7]=e.getBottom()-a,this._bbox.copy(e),(0!==t||0!==a)&&this._bbox.offset(-t,-a),this._isBboxChanged=!1}setFromQuad(e,a,n){t.copy(e),t.offset(a,n),this.setPoints(t.toArray()),this._isBboxChanged=!0}transform(t,n,r){let s=0,l=1;0!==r&&(s=Math.sin(r),l=Math.cos(r)),this.transformPrecalc(t,n,s,l)}transformPrecalc(t,a,n,r){const s=this._ptsArr;for(let e=0,l=s.length;e!e.includes(t))}static IsNamePredefined(e){return this._CreateEaseMap(),[...d.keys()].includes(e)}static GetEase(t){this._CreateEaseMap();const a=n.get(t);return a?e.get(a):e.get(t)}static GetEaseFromIndex(e){this._CreateEaseMap();const t=this.GetEaseNames();return t[e]}static GetIndexForEase(e){this._CreateEaseMap();const t=this.GetEaseNames();return t.indexOf(e)}static _CreateEaseMap(){0!==e.size||(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(e,t){u._AddEase(e,t,'predefined')}static _AddPrivateCustomEase(e,t){u._AddEase(e,t,'private')}static AddCustomEase(e,t){this._CreateEaseMap(),u._AddEase(e,t,'custom')}static RemoveCustomEase(t){this.IsNamePredefined(t)||[...m.keys()].includes(t)||(l.delete(t),e.delete(t))}static _AddEase(t,a,n){switch(e.set(t,a),n){case'predefined':d.set(t,a);break;case'custom':l.set(t,a);break;case'private':m.set(t,a);break;default:throw new Error('unexpected ease mode');}}static NoEase(t,a,e,n){return e*t/n+a}static EaseInQuad(t,n,e,r){return e*(t/=r)*t+n}static EaseOutQuad(t,n,e,r){return-e*(t/=r)*(t-2)+n}static EaseInOutQuad(t,n,e,r){return 1>(t/=r/2)?e/2*t*t+n:-e/2*(--t*(t-2)-1)+n}static EaseInCubic(t,n,e,r){return e*(t/=r)*t*t+n}static EaseOutCubic(t,n,e,r){return e*((t=t/r-1)*t*t+1)+n}static EaseInOutCubic(t,n,e,r){return 1>(t/=r/2)?e/2*t*t*t+n:e/2*((t-=2)*t*t+2)+n}static EaseInQuart(t,n,e,r){return e*(t/=r)*t*t*t+n}static EaseOutQuart(t,n,e,r){return-e*((t=t/r-1)*t*t*t-1)+n}static EaseInOutQuart(t,n,e,r){return 1>(t/=r/2)?e/2*t*t*t*t+n:-e/2*((t-=2)*t*t*t-2)+n}static EaseInQuint(t,n,e,r){return e*(t/=r)*t*t*t*t+n}static EaseOutQuint(t,n,e,r){return e*((t=t/r-1)*t*t*t*t+1)+n}static EaseInOutQuint(t,n,e,r){return 1>(t/=r/2)?e/2*t*t*t*t*t+n:e/2*((t-=2)*t*t*t*t+2)+n}static EaseInSine(t,a,e,n){return-e*g(t/n*(S/2))+e+a}static EaseOutSine(t,a,e,n){return e*h(t/n*(S/2))+a}static EaseInOutSine(t,a,e,n){return-e/2*(g(S*t/n)-1)+a}static EaseInExpo(t,a,e,n){return 0===t?a:e*f(2,10*(t/n-1))+a}static EaseOutExpo(t,a,e,n){return t===n?a+e:e*(-f(2,-10*t/n)+1)+a}static EaseInOutExpo(t,n,e,r){return 0===t?n:t===r?n+e:1>(t/=r/2)?e/2*f(2,10*(t-1))+n:e/2*(-f(2,-10*--t)+2)+n}static EaseInCirc(t,n,e,r){return-e*(y(1-(t/=r)*t)-1)+n}static EaseOutCirc(t,n,e,r){return e*y(1-(t=t/r-1)*t)+n}static EaseInOutCirc(t,n,e,r){return 1>(t/=r/2)?-e/2*(y(1-t*t)-1)+n:e/2*(y(1-(t-=2)*t)+1)+n}static EaseInElastic(e,a,n,r){let s=1.70158,u=0,c=n;return 0===e?a:1===(e/=r)?a+n:(u||(u=.3*r),c<_(n)?(c=n,s=u/4):s=u/(2*S)*t(n/c),-(c*f(2,10*(e-=1))*h((e*r-s)*(2*S)/u))+a)}static EaseOutElastic(e,a,n,r){let s=1.70158,u=0,c=n;return 0===e?a:1===(e/=r)?a+n:(u||(u=.3*r),c<_(n)?(c=n,s=u/4):s=u/(2*S)*t(n/c),c*f(2,-10*e)*h((e*r-s)*(2*S)/u)+n+a)}static EaseInOutElastic(e,a,n,r){let s=1.70158,u=0,c=n;return 0===e?a:2==(e/=r/2)?a+n:(u||(u=r*(.3*1.5)),c<_(n)?(c=n,s=u/4):s=u/(2*S)*t(n/c),1>e?-.5*(c*f(2,10*(e-=1))*h((e*r-s)*(2*S)/u))+a:.5*(c*f(2,-10*(e-=1))*h((e*r-s)*(2*S)/u))+n+a)}static EaseInBack(t,n,e,r,s){return void 0===s&&(s=1.70158),e*(t/=r)*t*((s+1)*t-s)+n}static EaseOutBack(t,n,e,r,s){return void 0===s&&(s=1.70158),e*((t=t/r-1)*t*((s+1)*t+s)+1)+n}static EaseInOutBack(t,n,e,r,s){return void 0===s&&(s=1.70158),1>(t/=r/2)?e/2*(t*t*(((s*=1.525)+1)*t-s))+n:e/2*((t-=2)*t*(((s*=1.525)+1)*t+s)+2)+n}static EaseInBounce(t,a,e,n){return e-u.EaseOutBounce(n-t,0,e,n)+a}static EaseOutBounce(t,n,e,r){return(t/=r)<1/2.75?e*(7.5625*t*t)+n:t<2/2.75?e*(7.5625*(t-=1.5/2.75)*t+.75)+n:t<2.5/2.75?e*(7.5625*(t-=2.25/2.75)*t+.9375)+n:e*(7.5625*(t-=2.625/2.75)*t+.984375)+n}static EaseInOutBounce(t,a,e,n){return tn-3*a+3*t-e,r=(e,t,a)=>3*a-6*t+3*e,a=(e,t)=>3*(t-e),C=(t,n,e,a)=>((n*t+e)*t+a)*t,c=(t,n,e,a)=>3*n*t*t+2*e*t+a,s=(s,d,e,g,h,f)=>{if(1==s)return 1;let y=0,S=1,G=f[S],b=f[10];for(;10!=S&&G<=s;)S++,G=f[S],y+=I;S--,G=f[S];const n=(s-G)/(f[S+1]-G);let P=y+n*I;const x=T(d,e,g,h),t=r(d,e,g,h),u=a(d,e,g,h),v=c(P,x,t,u);if(0===v)return P;if(.02<=v){for(let e=0;4>e;++e){const e=C(P,x,t,u)-s,a=c(P,x,t,u);P-=e/a}return P}else{let n=y,e=y+I,r=0,l,a;do{P=n+(e-n)/2;let d=C(P,x,t,u)-s;0++r}while(l&&a);return P}}}(),'use strict';{function e(e){if(!C3.IsString(e));}C3.ProbabilityTable=class{constructor(){this._items=[],this._totalWeight=0}Release(){this.Clear(),this._items=null}Clear(){C3.clear2DArray(this._items),this._totalWeight=0}GetTotalWeight(){return this._totalWeight}Sample(e=Math.random()*this.GetTotalWeight()){let t=0;for(const[a,n]of this._items)if(t+=a,er(e)));for(let a=0,n=this._listeners.length,r;ar(e)));return Promise.all(t).then(()=>!e.defaultPrevented)}_FireAndWait_AsyncOptional(e){const t=[];this._IncreaseFireDepth();for(let a=0,n=this._captureListeners.length;a!e.defaultPrevented):!e.defaultPrevented}async _FireAndWaitAsync(e){return await this._FireAndWait_AsyncOptional(e)}async _FireAndWaitAsyncSequential(e){this._IncreaseFireDepth();for(let t=0,a=this._captureListeners.length;t(u.push({func:n,resolve:s,reject:e,stack:r}),l?void a(u.pop()):void(-1===c&&t(16))))},C3.Asyncify.SetHighThroughputMode=function(e){if(e)++d;else if(--d,0>d)throw new Error('already turned off high throughput mode')}}{function t(){a=-1}function n(){l=-1,_=-1;let t=Date.now();for(let n of e)if(n._CheckTimeout(t)){let e=n._GetDeadline();(-1===_||e<_)&&(_=e)}else e.delete(n);if(-1!==_){let a=Math.max(_-t+s,r);l=self.setTimeout(n,a)}}const r=1e3,s=100;let a=-1;C3.FastGetDateNow=function(){return-1===a&&(a=Date.now(),self.setTimeout(t,16)),a};let l=-1,_=-1,e=new Set;C3.IdleTimeout=class{constructor(e,t){this._callback=e,this._timeout=1e3*t,this._deadline=0,this._isActive=!1}Reset(){let t=C3.FastGetDateNow();this._deadline=t+this._timeout,this._isActive||(e.add(this),this._isActive=!0),-1===l?(_=this._deadline,l=self.setTimeout(n,this._timeout+100)):this._deadline<_&&_>t+r&&(self.clearTimeout(l),_=this._deadline,l=self.setTimeout(n,this._timeout+100))}_CheckTimeout(e){return!(e>=this._deadline)||(this._callback()?(this._deadline=e+this._timeout,!0):(this._isActive=!1,!1))}_GetDeadline(){return this._deadline}Cancel(){this._isActive&&(e.delete(this),this._isActive=!1,0===e.size&&-1!==l&&(self.clearTimeout(l),l=-1,_=-1))}Release(){this.Cancel(),this._callback=null}}}'use strict',C3.Disposable=class e{constructor(e){this._disposed=!1,this._disposeAction=e}Dispose(){this._disposed||(this._disposed=!0,this._disposeAction&&(this._disposeAction(),this._disposeAction=null))}IsDisposed(){return this._disposed}Release(){this.Dispose()}static Release(t){return new e(()=>t.Release())}static From(t,a,n,r,s){if('undefined'==typeof r||null===r)r=!1;else if('boolean'!=typeof r&&'object'!=typeof r)throw new TypeError('invalid event listener options');if(s&&(n=n.bind(s)),a.includes(' ')){a=a.split(' ');const s=new C3.CompositeDisposable;for(let e of a)t.addEventListener(e,n,r),s.Add(C3.New(C3.Disposable,()=>t.removeEventListener(e,n,r)));return s}return t.addEventListener(a,n,r),C3.New(C3.Disposable,()=>t.removeEventListener(a,n,r))}},C3.StubDisposable=class extends C3.Disposable{SetAction(e){this._disposeAction=e}},C3.CompositeDisposable=class extends C3.Disposable{constructor(...e){super(),this._disposables=new Set;for(let t of e)this.Add(t)}Add(...e){if(this._disposed)throw new Error('already disposed');for(let t of e)this._disposables.add(t)}Remove(e){if(this._disposed)throw new Error('already disposed');this._disposables.delete(e)}RemoveAll(){if(this._disposed)throw new Error('already disposed');if(this._disposables){for(let e of this._disposables)e.Dispose();this._disposables.clear()}}IsDisposed(){return this._disposed}Dispose(){if(this._disposed)throw new Error('already disposed');this._disposed=!0;for(let e of this._disposables)e.Dispose();this._disposables.clear(),this._disposables=null}Release(){this.Dispose()}},'use strict',C3.KahanSum=class extends C3.DefendedBase{constructor(){super(),this._c=0,this._y=0,this._t=0,this._sum=0}Add(e){e=+e,this._y=e-this._c,this._t=this._sum+this._y,this._c=this._t-this._sum-this._y,this._sum=this._t}Subtract(e){this._sum-=+e}Get(){return this._sum}Reset(){this._c=0,this._y=0,this._t=0,this._sum=0}Set(e){this._c=0,this._y=0,this._t=0,this._sum=+e}Release(){}},'use strict';{const t={};t.RBnode=function(e){this.tree=e,this.right=this.tree.sentinel,this.left=this.tree.sentinel,this.parent=null,this.color=!1,this.key=null},t.RedBlackSet=function(e){this.size=0,this.sentinel=new t.RBnode(this),this.sentinel.color=!1,this.root=this.sentinel,this.root.parent=this.sentinel,this.compare=e||this.default_compare},t.RedBlackSet.prototype.default_compare=function(e,t){return ethis.compare(n.key,s.key)?s.left:s.right;n.parent=r,r==this.sentinel?this.root=n:0>this.compare(n.key,r.key)?r.left=n:r.right=n,n.left=this.sentinel,n.right=this.sentinel,n.color=!0,this.insertFixup(n),this.size++}else{var l=this.get_(a);l.key=a}},t.RedBlackSet.prototype.insertFixup=function(e){for(;e!=this.sentinel&&e!=this.root&&!0==e.parent.color;)if(e.parent==e.parent.parent.left){var t=e.parent.parent.right;!0==t.color?(e.parent.color=!1,t.color=!1,e.parent.parent.color=!0,e=e.parent.parent):(e==e.parent.right&&(e=e.parent,this.leftRotate(e)),e.parent.color=!1,e.parent.parent.color=!0,e.parent.parent!=this.sentinel&&this.rightRotate(e.parent.parent))}else{var t=e.parent.parent.left;!0==t.color?(e.parent.color=!1,t.color=!1,e.parent.parent.color=!0,e=e.parent.parent):(e==e.parent.left&&(e=e.parent,this.rightRotate(e)),e.parent.color=!1,e.parent.parent.color=!0,e.parent.parent!=this.sentinel&&this.leftRotate(e.parent.parent))}this.root.color=!1},t.RedBlackSet.prototype.delete_=function(e){var t,a;t=e.left==this.sentinel||e.right==this.sentinel?e:this.successor_(e),a=t.left==this.sentinel?t.right:t.left,a.parent=t.parent,t.parent==this.sentinel?this.root=a:t==t.parent.left?t.parent.left=a:t.parent.right=a,t!=e&&(e.key=t.key),!1==t.color&&this.deleteFixup(a),this.size--},t.RedBlackSet.prototype.deleteFixup=function(e){for(;e!=this.root&&!1==e.color;)if(e==e.parent.left){var t=e.parent.right;!0==t.color&&(t.color=!1,e.parent.color=!0,this.leftRotate(e.parent),t=e.parent.right),!1==t.left.color&&!1==t.right.color?(t.color=!0,e=e.parent):(!1==t.right.color&&(t.left.color=!1,t.color=!0,this.rightRotate(t),t=e.parent.right),t.color=e.parent.color,e.parent.color=!1,t.right.color=!1,this.leftRotate(e.parent),e=this.root)}else{var t=e.parent.left;!0==t.color&&(t.color=!1,e.parent.color=!0,this.rightRotate(e.parent),t=e.parent.left),!1==t.right.color&&!1==t.left.color?(t.color=!0,e=e.parent):(!1==t.left.color&&(t.right.color=!1,t.color=!0,this.leftRotate(t),t=e.parent.left),t.color=e.parent.color,e.parent.color=!1,t.left.color=!1,this.rightRotate(e.parent),e=this.root)}e.color=!1},t.RedBlackSet.prototype.remove=function(e){var t=this.get_(e);if(t!=this.sentinel){var a=t.key;return this.delete_(t),a}return null},t.RedBlackSet.prototype.removeSwapped=function(e,t){this.remove(t)},t.RedBlackSet.prototype.min=function(e){for(;e.left!=this.sentinel;)e=e.left;return e},t.RedBlackSet.prototype.max=function(e){for(;e.right!=this.sentinel;)e=e.right;return e},t.RedBlackSet.prototype.successor_=function(e){if(e.right!=this.sentinel)return this.min(e.right);for(var t=e.parent;t!=this.sentinel&&e==t.right;)e=t,t=t.parent;return t},t.RedBlackSet.prototype.predeccessor_=function(e){if(e.left!=this.sentinel)return this.max(e.left);for(var t=e.parent;t!=this.sentinel&&e==t.left;)e=t,t=t.parent;return t},t.RedBlackSet.prototype.successor=function(e){if(0this.compare(e,t.key)?t.left:t.right;return t},t.RedBlackSet.prototype.contains=function(e){return null!=this.get_(e).key},t.RedBlackSet.prototype.getValues=function(){var e=[];return this.forEach(function(t){e.push(t)}),e},t.RedBlackSet.prototype.insertAll=function(a){if('array'==t.typeOf(a))for(var n=0;nn)return!1;var r=0;if(this.isEmpty())return!0;for(var s=this.min(this.root);s!=this.sentinel;s=this.successor_(s))t.contains.call(a,a,s.key)&&r++;return r==this.getCount()},t.RedBlackSet.prototype.intersection=function(e){var a=new t.RedBlackSet(this.compare);if(this.isEmpty())return a;for(var n=this.min(this.root);n!=this.sentinel;n=this.successor_(n))e.contains.call(e,n.key,n.key,this)&&a.insert(n.key);return a},C3.RedBlackSet=class extends C3.DefendedBase{constructor(e){super(),this._rbSet=new t.RedBlackSet(e),this._enableQueue=!1,this._queueInsert=new Set,this._queueRemove=new Set}Add(e){this._enableQueue?this._rbSet.contains(e)?this._queueRemove.delete(e):this._queueInsert.add(e):this._rbSet.insert(e)}Remove(e){this._enableQueue?this._rbSet.contains(e)?this._queueRemove.add(e):this._queueInsert.delete(e):this._rbSet.remove(e)}Has(e){return this._enableQueue?!!this._queueInsert.has(e)||!this._queueRemove.has(e)&&this._rbSet.contains(e):this._rbSet.contains(e)}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 0===this.GetSize()}Front(){if(this.IsEmpty())throw new Error('empty set');if(this._enableQueue)throw new Error('cannot be used in queueing mode');const e=this._rbSet,t=e.min(e.root);return t.key}Shift(){if(this.IsEmpty())throw new Error('empty set');if(this._enableQueue)throw new Error('cannot be used in queueing mode');const e=this.Front();return this.Remove(e),e}SetQueueingEnabled(e){if((e=!!e,this._enableQueue!==e)&&(this._enableQueue=e,!e)){for(const e of this._queueRemove)this._rbSet.remove(e);this._queueRemove.clear();for(const e of this._queueInsert)this._rbSet.insert(e);this._queueInsert.clear()}}ForEach(e){this._rbSet.forEach(e)}*values(){if(!this.IsEmpty()){const e=this._rbSet;for(let t=e.min(e.root);t!=e.sentinel;t=e.successor_(t))yield t.key}}[Symbol.iterator](){return this.values()}}}'use strict',C3.PromiseThrottle=class{constructor(e=C3.hardwareConcurrency){this._maxParallel=e,this._queue=[],this._activeCount=0}Add(e){return new Promise((t,a)=>{this._queue.push({func:e,resolve:t,reject:a}),this._MaybeStartNext()})}_FindInQueue(e){for(let t=0,a=this._queue.length;t=this._maxParallel)){this._activeCount++;const e=this._queue.shift();try{const t=await e.func();e.resolve(t)}catch(t){e.reject(t)}this._activeCount--,this._MaybeStartNext()}}static async Batch(t,n){const r=[];let s=!1;const l=async()=>{for(let e;e=n.pop();){if(s)return;try{r.push((await e()))}catch(e){throw s=!0,e}}},e=[];for(;t--;)e.push(l());return await Promise.all(e),r}},'use strict',C3.RateLimiter=class{constructor(e,t,a){this._callback=e,this._interval=t,this._intervalOnBattery=a||2*t,this._timerId=-1,this._lastCallTime=-Infinity,this._timerCallFunc=()=>this._OnTimer(),this._ignoreReset=!1,this._canRunImmediate=!1,this._callbackArguments=null}SetCanRunImmediate(e){this._canRunImmediate=!!e}_GetInterval(){return'undefined'!=typeof C3.Battery&&C3.Battery.IsOnBatteryPower()?this._intervalOnBattery:this._interval}Call(...e){if(-1===this._timerId){this._callbackArguments=e;let t=C3.FastGetDateNow(),a=t-this._lastCallTime,n=this._GetInterval();a>=n&&this._canRunImmediate?(this._lastCallTime=t,this._RunCallback()):this._timerId=self.setTimeout(this._timerCallFunc,Math.max(n-a,4))}}_RunCallback(){this._ignoreReset=!0;const e=this._callbackArguments;this._callbackArguments=null,e?this._callback(...e):this._callback(),this._ignoreReset=!1}Reset(){this._ignoreReset||(this._CancelTimer(),this._callbackArguments=null,this._lastCallTime=C3.FastGetDateNow())}_OnTimer(){this._timerId=-1,this._lastCallTime=C3.FastGetDateNow(),this._RunCallback()}_CancelTimer(){-1!==this._timerId&&(self.clearTimeout(this._timerId),this._timerId=-1)}Release(){this._CancelTimer(),this._callback=null,this._callbackArguments=null,this._timerCallFunc=null}},'use strict',C3.SVGRasterManager=class{constructor(){this._images=new Map,this._allowNpotSurfaces=!1,this._getBaseSizeCallback=null,this._rasterAtSizeCallback=null,this._releaseResultCallback=null,this._redrawCallback=null}SetNpotSurfaceAllowed(e){this._allowNpotSurfaces=!!e}IsNpotSurfaceAllowed(){return this._allowNpotSurfaces}SetGetBaseSizeCallback(e){this._getBaseSizeCallback=e}GetBaseSize(e){if(!this._getBaseSizeCallback)throw new Error('no get base size callback set');return this._getBaseSizeCallback(e)}SetRasterAtSizeCallback(e){this._rasterAtSizeCallback=e}RasterAtSize(t,a,n,r,s,e){if(!this._rasterAtSizeCallback)throw new Error('no raster at size callback set');return this._rasterAtSizeCallback(t,a,n,r,s,e)}SetReleaseResultCallback(e){this._releaseResultCallback=e}ReleaseResult(e){if(!this._releaseResultCallback)throw new Error('no release result callback set');this._releaseResultCallback(e)}SetRedrawCallback(e){this._redrawCallback=e}Redraw(){if(!this._redrawCallback)throw new Error('no redraw callback set');this._redrawCallback()}AddImage(e){let t=this._images.get(e);return t||(t=C3.New(C3.SVGRasterImage,this,e),this._images.set(e,t)),t.IncReference(),t}_RemoveImage(e){this._images.delete(e.GetDataSource())}},'use strict';{const t=2048;C3.SVGRasterImage=class{constructor(e,t){this._manager=e,this._dataSource=t,this._refCount=0,this._baseWidth=0,this._baseHeight=0,this._getBaseSizePromise=this._manager.GetBaseSize(t).then(e=>{this._baseWidth=e[0],this._baseHeight=e[1],this._manager.Redraw()}).catch(e=>{console.error('[SVG] Error loading SVG: ',e),this._hadError=!0,this._manager.Redraw()}),this._rasterSurfaceWidth=0,this._rasterSurfaceHeight=0,this._rasterImageWidth=0,this._rasterImageHeight=0,this._isRasterizing=!1,this._rasterizedResult=null,this._forceRaster=!1,this._hadError=!1}Release(){if(0>=this._refCount)throw new Error('already released');this._refCount--,0===this._refCount&&this._Release()}_Release(){this._rasterizedResult&&(this._manager.ReleaseResult(this._rasterizedResult),this._rasterizedResult=null),this._manager._RemoveImage(this),this._manager=null}GetDataSource(){return this._dataSource}IncReference(){this._refCount++}HasReferences(){return 0t){const n=t/u;r*=n,s*=n,l=a(e(l*n),t),_=a(e(_*n),t)}if(re?(r=_*e,s=_):(r=l,s=l/e)}if(this._manager.IsNpotSurfaceAllowed()&&(l=e(r),_=e(s)),!(l<=this._rasterSurfaceWidth&&_<=this._rasterSurfaceHeight&&!this._forceRaster)){this._isRasterizing=!0,this._rasterSurfaceWidth=l,this._rasterSurfaceHeight=_;const e=await this._manager.RasterAtSize(this._dataSource,n,this._rasterSurfaceWidth,this._rasterSurfaceHeight,r,s);this._rasterizedResult&&this._manager.ReleaseResult(this._rasterizedResult),this._rasterizedResult=e,this._rasterImageWidth=r,this._rasterImageHeight=s,this._isRasterizing=!1,this._forceRaster=!1,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}}}{function t(e){return l.get(e)}C3.UTF8_BOM='\uFEFF';const n=new Set([...'0123456789']);C3.IsNumericChar=function(e){return n.has(e)};const r=new Set([...' \t\n\r\xA0\x85\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u2028\u2029\u202F\u205F\u3000']);C3.IsWhitespaceChar=function(e){return r.has(e)},C3.FilterWhitespace=function(e){return[...e].filter(e=>!C3.IsWhitespaceChar(e)).join('')},C3.IsStringAllWhitespace=function(e){for(const t of e)if(!C3.IsWhitespaceChar(t))return!1;return!0},C3.IsUnprintableChar=function(e){return 1===e.length&&32>e.charCodeAt(0)},C3.FilterUnprintableChars=function(e){return[...e].filter(e=>!C3.IsUnprintableChar(e)).join('')};const s=new Set([...'0123456789.+-e']);C3.IsStringNumber=function(e){if(e=e.trim(),!e.length)return!1;let t=e.charAt(0);if('-'!==t&&!n.has(t))return!1;for(let t of e)if(!s.has(t))return!1;return!0},C3.RemoveTrailingDigits=function(e){let t=e.length;for(;0','>'],['"','"'],['\'',''']]),e=/[&<>"']/g;C3.EscapeHTML=function(a){return a.replace(e,t)},C3.EscapeJS=function(e){let t=C3.ReplaceAll(e,'\\','\\\\');return t=C3.ReplaceAll(t,'"','\\"'),t=C3.ReplaceAll(t,'\t','\\t'),t=C3.ReplaceAll(t,'\r',''),C3.ReplaceAll(t,'\n','\\n')},C3.EscapeXML=function(e){let t=C3.ReplaceAll(e,'&','&');return t=C3.ReplaceAll(t,'<','<'),t=C3.ReplaceAll(t,'>','>'),C3.ReplaceAll(t,'"','"')};const _=/[-[\]{}()*+?.,\\^$|#\s]/g;C3.EscapeRegex=function(e){return e.replace(_,'\\$&')},C3.FindAll=function(t,n,r=!1){if(!n)return[];r||(t=t.toLowerCase(),n=n.toLowerCase());const s=n.length;let l=0,_=0,d=[];for(;-1<(_=t.indexOf(n,l));)d.push(_),l=_+s;return d},C3.ReplaceAll=function(e,t,a){return e.replace(new RegExp(C3.EscapeRegex(t),'g'),()=>a)},C3.ReplaceAllCaseInsensitive=function(e,t,a){return e.replace(new RegExp(C3.EscapeRegex(t),'gi'),()=>a)},C3.SetElementContent=function(e,t){'string'==typeof t?e.textContent=t:t.isPlainText()?e.textContent=t.toString():(e.innerHTML=t.toHTML(),t instanceof C3.BBString&&t.attachLinkHandlers(e))},C3.StringLikeEquals=function(e,t){return e instanceof C3.HtmlString||e instanceof C3.BBString?e.equals(t):t instanceof C3.HtmlString||t instanceof C3.BBString?t.equals(e):e===t},C3.StringSubstitute=function(t,...a){let n=t;for(let r=0,s=a.length;rn?1:ae){let t=e/u;return t=10>t?a(10*t)/10:a(t),langSub(n+'kilobytes',t)}if(1073741824>e){let t=e/1048576;return t=10>t?a(10*t)/10:a(t),langSub(n+'megabytes',t)}if(1099511627776>e){let t=e/1073741824;return t=10>t?a(10*t)/10:a(t),langSub(n+'gigabytes',t)}else{let t=e/1099511627776;return t=10>t?a(10*t)/10:a(t),langSub(n+'terabytes',t)}};const g={approximate:!1,days:!0,hours:!0,minutes:!0,seconds:!0};C3.FormatTime=function(t,n){var r=Math.floor;n=Object.assign({},g,n),C3.Lang.PushContext('common.time');const s=[];if(n.days){const e=r(t/86400);0t?'-':'';t=Math.abs(t);let s=t.toString(),l=n-s.length;for(let e=0;ee.toUpperCase())},C3.CompareVersionStrings=function(e,t){let n=e.split('.').map(e=>e.trim()),r=t.split('.').map(e=>e.trim());C3.resizeArray(n,4,'0'),C3.resizeArray(r,4,'0'),n=n.map(e=>parseInt(e,10)),r=r.map(e=>parseInt(e,10));for(let s=0;4>s;++s){const e=n[s]-r[s];if(0!=e)return 0>e?-1:1}return 0},C3.CreateGUID=function(){return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,e=>{const t=Math.floor(16*Math.random()),a='x'===e?t:8|3&t;return a.toString(16)})},C3.StringHammingDistance=function(t,n){if(t.length!==n.length)throw new Error('strings must be same length');let a=0;for(let r=0,s=t.length;rn.length&&(s=t,t=n,n=s),m=Array(t.length+1),l=0;l<=t.length;l++)m[l]=l;for(l=1;l<=n.length;l++){for(u=l,_=1;_<=t.length;_++)p=n[l-1]===t[_-1]?m[_-1]:r(m[_-1]+1,r(u+1,m[_]+1)),m[_-1]=u,u=p;m[t.length]=u}return m[t.length]}}{function t(t,r,l){const _=n.get(l);if(!_)return'class'===l?r?'':``:t;if('string'!=typeof _){if(Array.isArray(_)){let e=_[0],t=_[1];return r?'':`<${e} class="${t}">`}}else if('a'===_&&!r){const e=parseInt(l.substring(1),10)-1;if(0>e||e>=s.length)throw new Error('invalid bbcode link substitution');const t=s[e];if('string'==typeof t)return``;if('function'==typeof t)return``;throw new TypeError('invalid bbcode link action')}else return'<'+r+_+'>'}const n=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']]]),a=/\[(\/?)([a-zA-Z0-9]+)\]/g,r=/\[(\/?)(.*?)\]/g;let s=null,e=0;const l=/\n/g;C3.BBString=class{constructor(e,t){if(this._bbstr=t&&t.noEscape?e:C3.EscapeHTML(e),this._htmlstr='',this._convertLineBreaks=!1,this._linkActions=[],t&&(this._convertLineBreaks=!!t.convertLineBreaks,t.links)){if(9')),this._htmlstr=n}return this._htmlstr}attachLinkHandlers(e){if(this._linkActions.length)for(let t=0,a=this._linkActions.length;tr)return;if(1===t.length){const e=t[0],s=e.text,_=e.styles;if(100>=s.length&&!s.includes('\n')){let{width:e,height:t}=n(s,_);if(e+=l,e<=r)return void this._AddLine([{text:s,styles:_,width:e,height:t}],e,t)}}let e;if('word'===s)e=this._TokeniseWords(t);else{e=[];for(const n of t)C3.appendArray(e,[...n.text].map(e=>[{text:e,styles:n.styles}]))}this._WrapText(e,n,r,l)}_TokeniseWords(t){const n=[];let r=[],s=!1;for(const l of t){const t=l.text,_=l.styles;for(const l of t)if('\n'===l)0({text:e.text,styles:e.styles,width:e.width,height:e.height}))}_AddWordToLine(e,t){const a=e.length?e[e.length-1]:null;let n=0;a&&t[0].styles===a.styles&&(a.text+=t[0].text,a.width=-1,a.height=-1,n=1);for(let a=t.length;n=r))s=t,l=d,_=u;else if(0e||e>=t.length)throw new RangeError('invalid blend index');return t[e]}GetSrcBlendByIndex(e){return this._GetBlendByIndex(e)[0]}GetDestBlendByIndex(e){return this._GetBlendByIndex(e)[1]}GetNamedBlend(e){const t=this._namedBlendModeMap.get(e);if('undefined'==typeof t)throw new Error('invalid blend name');return t}Finish(){this.EndBatch(),this._frameNumber++}GetFrameNumber(){return this._frameNumber}IncrementFrameNumber(){this._frameNumber++}}}'use strict',C3.Gfx.StateGroup=class{constructor(t,a,n,r,s,e){this._renderer=t,this._refCount=0,this._shaderProgram=null,this._shaderProgramName='',this._srcBlend=n,this._destBlend=r,this._color=C3.New(C3.Color),this._color.set(s),this._zElevation=e,'string'==typeof a?this._shaderProgramName=a:(this._shaderProgram=a,this._shaderProgramName=this._shaderProgram.GetName())}Release(){if(0=this._width||0>=this._height)throw new Error('invalid texture data size');if(d.isSvg){const e=C3.CreateCanvas(this._width,this._height),t=e.getContext('2d');t.drawImage(n,0,0,this._width,this._height),n=e}const u=C3.isPOT(this._width)&&C3.isPOT(this._height),c=this._renderer.GetMaxTextureSize();if(this._width>c||this._height>c)throw new Error('texture data exceeds maximum texture size');const g=this._renderer.GetContext(),p=this._renderer.GetWebGLVersionNumber();this._texture=g.createTexture(),g.bindTexture(g.TEXTURE_2D,this._texture),g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d.premultiplyAlpha);const l=t(this._pixelFormat,g);if(!this._renderer.SupportsNPOTTextures()&&!u&&this._isTiled){if(null===n)throw new Error('cannot pass null data when creating a NPOT tiled texture without NPOT support');if(n instanceof ArrayBuffer&&(n=new ImageData(new Uint8ClampedArray(n),this._width,this._height)),n instanceof ImageData){const e=C3.CreateCanvas(this._width,this._height),t=e.getContext('2d');t.putImageData(n,0,0),n=e}const e=C3.CreateCanvas(C3.nextHighestPowerOfTwo(this._width),C3.nextHighestPowerOfTwo(this._height)),t=e.getContext('2d');t.imageSmoothingEnabled='nearest'!==this._sampling,t.drawImage(n,0,0,this._width,this._height,0,0,e.width,e.height),g.texImage2D(g.TEXTURE_2D,0,l.internalformat,l.format,l.type,e)}else if(2<=p){let e;e=this._isMipMapped?Math.floor(Math.log2(Math.max(this._width,this._height))+1):1,g.texStorage2D(g.TEXTURE_2D,e,l.sizedinternalformat,this._width,this._height),n instanceof ArrayBuffer?g.texSubImage2D(g.TEXTURE_2D,0,0,0,this._width,this._height,l.format,l.type,new Uint8Array(n)):null!==n&&g.texSubImage2D(g.TEXTURE_2D,0,0,0,l.format,l.type,n)}else n instanceof ArrayBuffer?g.texImage2D(g.TEXTURE_2D,0,l.internalformat,this._width,this._height,0,l.format,l.type,new Uint8Array(n)):null===n?g.texImage2D(g.TEXTURE_2D,0,l.internalformat,this._width,this._height,0,l.format,l.type,null):g.texImage2D(g.TEXTURE_2D,0,l.internalformat,l.format,l.type,n);null!==n&&this._SetTextureParameters(g),g.bindTexture(g.TEXTURE_2D,null),this._renderer._ResetLastTexture(),this._refCount=1,e.add(this)}_CreateDynamic(d,u,c){var g=Math.floor;if(c=Object.assign({},_,c),this._texture)throw new Error('already created texture');if(this._isTiled=!!c.isTiled,this._tileType=c.tileType,this._sampling=c.sampling,this._pixelFormat=c.pixelFormat,this._isMipMapped=!!c.mipMap,this._mipMapQuality=c.mipMapQuality,!r.has(this._sampling))throw new Error('invalid sampling');if(!a.has(this._pixelFormat))throw new Error('invalid pixel format');if(!s.has(this._mipMapQuality))throw new Error('invalid mipmap quality');this._isStatic=!1,this._width=g(d),this._height=g(u);const h=C3.isPOT(this._width)&&C3.isPOT(this._height),f=this._renderer.GetMaxTextureSize();if(0>=this._width||0>=this._height)throw new Error('invalid texture size');if(this._width>f||this._height>f)throw new Error('texture exceeds maximum texture size');if(!this._renderer.SupportsNPOTTextures()&&this._isTiled&&!h)throw new Error('non-power-of-two tiled textures not supported');const l=this._renderer.GetContext(),m=this._renderer.GetWebGLVersionNumber();this._texture=l.createTexture(),l.bindTexture(l.TEXTURE_2D,this._texture),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,c.premultiplyAlpha);const n=t(this._pixelFormat,l),y=2<=m?n.sizedinternalformat:n.internalformat;l.texImage2D(l.TEXTURE_2D,0,y,this._width,this._height,0,n.format,n.type,null),this._SetTextureParameters(l),l.bindTexture(l.TEXTURE_2D,null),this._renderer._ResetLastTexture(),this._refCount=1,e.add(this)}_GetMipMapHint(e){if('default'===this._mipMapQuality)return this._isStatic?e.NICEST:e.FASTEST;if('low'===this._mipMapQuality)return e.FASTEST;if('high'===this._mipMapQuality)return e.NICEST;throw new Error('invalid mipmap quality')}_SetTextureParameters(e){const t=C3.isPOT(this._width)&&C3.isPOT(this._height);if(!this._isTiled)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);else if('repeat-x'===this._tileType)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);else if('repeat-y'===this._tileType)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT);else if('repeat'===this._tileType)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT);else throw new Error('invalid tile type');if('nearest'===this._sampling)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),this._isMipMapped=!1;else if(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),(t||this._renderer.SupportsNPOTTextures())&&this._isMipMapped){e.hint(e.GENERATE_MIPMAP_HINT,this._GetMipMapHint(e)),e.generateMipmap(e.TEXTURE_2D);const t='trilinear'===this._sampling&&!this._renderer.HasMajorPerformanceCaveat();e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.LINEAR_MIPMAP_NEAREST)}else e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),this._isMipMapped=!1}_Update(r,a){if(('undefined'==typeof HTMLImageElement||!(r instanceof HTMLImageElement))&&('undefined'==typeof HTMLVideoElement||!(r instanceof HTMLVideoElement))&&('undefined'==typeof HTMLCanvasElement||!(r instanceof HTMLCanvasElement))&&('undefined'==typeof ImageBitmap||!(r instanceof ImageBitmap))&&('undefined'==typeof OffscreenCanvas||!(r instanceof OffscreenCanvas))&&!(r instanceof ImageData))throw new Error('invalid texture source');if(!this._texture||0>=this._refCount)throw new Error('texture not created');if(this._isStatic)throw new Error('cannot update static texture');a=Object.assign({},n,a);const s=r.width||r.videoWidth,l=r.height||r.videoHeight,e=this._renderer.GetWebGLVersionNumber(),_=this._renderer.GetContext();_.bindTexture(_.TEXTURE_2D,this._texture),_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);const d=t(this._pixelFormat,_),u=2<=e?d.sizedinternalformat:d.internalformat;try{if(this._width===s&&this._height===l){const e=C3.isPOT(this._width)&&C3.isPOT(this._height);_.texSubImage2D(_.TEXTURE_2D,0,0,0,d.format,d.type,r),(e||this._renderer.SupportsNPOTTextures())&&this._isMipMapped&&(_.hint(_.GENERATE_MIPMAP_HINT,this._GetMipMapHint(_)),_.generateMipmap(_.TEXTURE_2D))}else{this._width=s,this._height=l;const e=C3.isPOT(this._width)&&C3.isPOT(this._height);if(!this._renderer.SupportsNPOTTextures()&&this._isTiled&&!e)throw new Error('non-power-of-two tiled textures not supported');_.texImage2D(_.TEXTURE_2D,0,u,d.format,d.type,r),(e||this._renderer.SupportsNPOTTextures())&&this._isMipMapped&&(_.hint(_.GENERATE_MIPMAP_HINT,this._GetMipMapHint(_)),_.generateMipmap(_.TEXTURE_2D))}}catch(e){console.error('Error updating WebGL texture: ',e)}_.bindTexture(_.TEXTURE_2D,null),this._renderer._ResetLastTexture()}_Delete(){if(0=this._refCount)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 e=this._width*this._height;switch(this._pixelFormat){case'rgba8':e*=4;break;case'rgb8':e*=3;break;case'rgba4':case'rgb5_a1':case'rgb565':e*=2;}return this._isMipMapped&&(e+=Math.floor(e/3)),e}static OnContextLost(){e.clear()}static allTextures(){return e.values()}}}{const t=new Set(['nearest','bilinear','trilinear']),n={sampling:'trilinear',alpha:!0,readback:!0,isDefaultSize:!0,multisampling:0},r=new Set;C3.Gfx.WebGLRenderTarget=class{constructor(e){this._renderer=e,this._frameBuffer=null,this._texture=null,this._renderBuffer=null,this._width=0,this._height=0,this._isDefaultSize=!0,this._sampling='trilinear',this._alpha=!0,this._readback=!0,this._multisampling=0}_Create(a,s,e){e=Object.assign({},n,e);const l=this._renderer.GetWebGLVersionNumber();if(this._texture||this._renderBuffer)throw new Error('already created render target');if(this._sampling=e.sampling,this._alpha=!!e.alpha,this._readback=!!e.readback,this._isDefaultSize=!!e.isDefaultSize,this._multisampling=e.multisampling,!t.has(this._sampling))throw new Error('invalid sampling');if(0l||this._readback))throw new Error('invalid use of multisampling');if(2>l&&(this._readback=!0),this._width=a,this._height=s,0>=this._width||0>=this._height)throw new Error('invalid render target size');const _=this._renderer.GetContext();if(this._frameBuffer=_.createFramebuffer(),_.bindFramebuffer(_.FRAMEBUFFER,this._frameBuffer),this._readback){this._texture=this._renderer.CreateDynamicTexture(this._width,this._height,{sampling:this._sampling,pixelFormat:this._alpha?'rgba8':'rgb8',mipMap:!1});const e=this._texture._GetTexture();_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_2D,e,0)}else{this._renderBuffer=_.createRenderbuffer(),_.bindRenderbuffer(_.RENDERBUFFER,this._renderBuffer);const e=this._alpha?_.RGBA8:_.RGB8;if(0e&&(this._multisampling=e)}else this._multisampling=0}0===this._multisampling?_.renderbufferStorage(_.RENDERBUFFER,e,this._width,this._height):_.renderbufferStorageMultisample(_.RENDERBUFFER,this._multisampling,e,this._width,this._height),_.framebufferRenderbuffer(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.RENDERBUFFER,this._renderBuffer),_.bindRenderbuffer(_.RENDERBUFFER,null)}_.bindFramebuffer(_.FRAMEBUFFER,null),r.add(this)}_Resize(e,t){if(this._width!==e||this._height!==t){this._width=e,this._height=t;const a=this._renderer.GetContext();a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),this._texture?this._texture._Update(new ImageData(this._width,this._height)):(a.bindRenderbuffer(a.RENDERBUFFER,this._renderBuffer),a.renderbufferStorage(a.RENDERBUFFER,this._alpha?a.RGBA8:a.RGB8,this._width,this._height),a.bindRenderbuffer(a.RENDERBUFFER,null)),a.bindFramebuffer(a.FRAMEBUFFER,null)}}_Delete(){if(!this._texture&&!this._renderBuffer)throw new Error('already deleted render target');r.delete(this);const e=this._renderer.GetContext();e.bindFramebuffer(e.FRAMEBUFFER,this._frameBuffer),this._texture?(e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0),this._renderer.DeleteTexture(this._texture),this._texture=null):this._renderBuffer&&(e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,null),e.deleteRenderbuffer(this._renderBuffer),this._renderBuffer=null),e.bindFramebuffer(e.FRAMEBUFFER,null),2<=this._renderer.GetWebGLVersionNumber()&&(e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null)),e.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'nearest'!==this._sampling}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 e={sampling:this._sampling,alpha:this._alpha,readback:this._readback};return this._isDefaultSize||(e.width=this._width,e.height=this._height),e}IsCompatibleWithOptions(e){return e=Object.assign({},n,e),'nearest'!==e.sampling===this.IsLinearSampling()&&!!e.alpha===this.HasAlpha()&&!(2<=this._renderer.GetWebGLVersionNumber()&&!!e.readback!==this.IsReadback())&&('number'==typeof e.width||'number'==typeof e.height?!this.IsDefaultSize()&&this.GetWidth()===e.width&&this.GetHeight()===e.height:this.IsDefaultSize())}_GetWebGLTexture(){return this._texture?this._texture._GetTexture():null}GetEstimatedMemoryUsage(){return this._texture?this._texture.GetEstimatedMemoryUsage():this._width*this._height*(this._alpha?4:3)}static async DebugReadPixelsToBlob(e,t){const a=await e.ReadBackRenderTargetToImageData(t,!0);return await C3.ImageDataToBlob(a)}static OnContextLost(){r.clear()}static allRenderTargets(){return r.values()}static ResizeAll(e,t){for(const a of r)a.IsDefaultSize()&&a._Resize(e,t)}}}{const e=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{static async Compile(t,a,n,r){const s=t.GetContext(),e=s.createShader(s.FRAGMENT_SHADER);s.shaderSource(e,a),s.compileShader(e);const l=s.createShader(s.VERTEX_SHADER);s.shaderSource(l,n),s.compileShader(l);const _=s.createProgram();s.attachShader(_,e),s.attachShader(_,l),s.bindAttribLocation(_,0,'aPos'),s.bindAttribLocation(_,1,'aTex'),s.bindAttribLocation(_,2,'aPoints'),s.linkProgram(_);const d=t._GetParallelShaderCompileExtension();if(d?await t._WaitForObjectReady(()=>s.getProgramParameter(_,d.COMPLETION_STATUS_KHR)):await C3.Wait(5),!s.getShaderParameter(e,s.COMPILE_STATUS)){const t=s.getShaderInfoLog(e);throw s.deleteShader(e),s.deleteShader(l),s.deleteProgram(_),new Error('Error compiling fragment shader: '+t)}if(!s.getShaderParameter(l,s.COMPILE_STATUS)){const t=s.getShaderInfoLog(l);throw s.deleteShader(e),s.deleteShader(l),s.deleteProgram(_),new Error('Error compiling vertex shader: '+t)}if(!s.getProgramParameter(_,s.LINK_STATUS)){const t=s.getProgramInfoLog(_);throw s.deleteShader(e),s.deleteShader(l),s.deleteProgram(_),new Error('Error linking shader program: '+t)}const u=C3.FilterUnprintableChars(s.getProgramInfoLog(_)||'').trim();return u&&!C3.IsStringAllWhitespace(u)&&console.info(`[WebGL] Shader program '${r}' compilation log: `,u),s.deleteShader(e),s.deleteShader(l),_}static async Create(t,a,n,r){const s=await C3.Gfx.WebGLShaderProgram.Compile(t,a.src,n,r);return new C3.Gfx.WebGLShaderProgram(t,s,a,r)}constructor(t,a,n,r){const s=t.GetContext(),e=t.GetBatchState();t.EndBatch(),s.useProgram(a),this._gl=s,this._renderer=t,this._name=r,this._shaderProgram=a,this._isDeviceTransform=''===r;const l=s.getAttribLocation(a,'aPos'),_=s.getAttribLocation(a,'aTex'),d=s.getAttribLocation(a,'aPoints');-1!==l&&(s.bindBuffer(s.ARRAY_BUFFER,t._vertexBuffer),s.vertexAttribPointer(l,t.GetNumVertexComponents(),s.FLOAT,!1,0,0),s.enableVertexAttribArray(l)),-1!==_&&(s.bindBuffer(s.ARRAY_BUFFER,t._texcoordBuffer),s.vertexAttribPointer(_,2,s.FLOAT,!1,0,0),s.enableVertexAttribArray(_)),-1!==d&&(s.bindBuffer(s.ARRAY_BUFFER,t._pointBuffer),s.vertexAttribPointer(d,4,s.FLOAT,!1,0,0),s.enableVertexAttribArray(d)),s.bindBuffer(s.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=n.extendBoxHorizontal||0,this._extendBoxVertical=n.extendBoxVertical||0,this._crossSampling=!!n.crossSampling,this._mustPreDraw=!!n.mustPreDraw,this._preservesOpaqueness=!!n.preservesOpaqueness,this._animated=!!n.animated;const u=n.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||0!==this._extendBoxHorizontal||0!==this._extendBoxVertical,this._hasCurrentMatP=!1,this._hasCurrentMatMV=!1,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 s of u){const e=s[0],t=s[2],a=new C3.Gfx.WebGLShaderUniform(this,e,t);'color'===t?a.Init3f(0,0,0):a.Init1f(0),this._uCustomParameters.push(a)}this._isDeviceTransform?this._UpdateDeviceTransformUniforms(e.currentMatP):(this.UpdateMatP(e.currentMatP,!0),this.UpdateMatMV(e.currentMV,!0));const c=e.currentShader;s.useProgram(c?c._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 0!==this._extendBoxHorizontal||0!==this._extendBoxVertical}GetBoxExtendHorizontal(){return this._extendBoxHorizontal}GetBoxExtendVertical(){return this._extendBoxVertical}UsesAnySrcRectOrPixelSize(){return this._usesAnySrcRectOrPixelSize}NeedsPostDrawOrExtendsBox(){return this._needsPostDrawOrExtendBox}GetParameterCount(){return this._uCustomParameters.length}GetParameterType(e){return this._uCustomParameters[e].GetType()}AreCustomParametersAlreadySetInBatch(e){for(let t=0,a=e.length;t{const t=e.font.GetName();for(const a of d)(a.IsBBCodeEnabled()||C3.equalsNoCase(a.GetFontName(),t))&&a._SetTextChanged()}),C3.Gfx.WebGLText=class{constructor(e,t){t=Object.assign({},n,t),this._renderer=e,this._fontName='Arial',this._fontSize=16,this._lineHeight=0,this._isBold=!1,this._isItalic=!1,this._colorStr='black',this._isBBcodeEnabled=!1,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=!1,this._isUpdating=!1,this._isAsync=!0,this._drawMaxCharCount=-1,this._drawCharCount=0,this._cssWidth=0,this._cssHeight=0,this._width=0,this._height=0,this._zoom=1,this._changed=!1,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=(e,t)=>this._MeasureText(e,t),this._texture=null,this._textureWidth=0,this._textureHeight=0,this._rcTex=new C3.Rect,this._scaleFactor=1,this._needToRecreateTexture=!1,this._textureTimeout=new C3.IdleTimeout(()=>{this.ReleaseTexture(),this._SetTextCanvasSize(8,8)},t.timeout),this.ontextureupdate=null,this._wasReleased=!1,d.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=!0,d.delete(this)}_SetChanged(){this._changed=!0}_SetTextChanged(){this._SetChanged(),this._wrappedText.Clear(),this._textChanged=!0}SetIsAsync(e){this._isAsync=!!e}IsAsync(){return this._isAsync}SetBBCodeEnabled(e){e=!!e,this._isBBcodeEnabled===e||(this._isBBcodeEnabled=e,this._textContext&&(this._textContext.textBaseline=this._isBBcodeEnabled?'alphabetic':'top'),this._SetTextChanged())}IsBBCodeEnabled(){return this._isBBcodeEnabled}SetFontName(e){e||(e='serif'),this._fontName===e||(this._fontName=e,this._SetTextChanged())}GetFontName(){return this._fontName}SetFontSize(e){.1>e&&(e=.1),this._fontSize===e||(this._fontSize=e,this._SetTextChanged())}SetLineHeight(e){this._lineHeight===e||(this._lineHeight=e,this._SetChanged())}SetBold(e){e=!!e,this._isBold===e||(this._isBold=e,this._SetTextChanged())}SetItalic(e){e=!!e,this._isItalic===e||(this._isItalic=e,this._SetTextChanged())}SetDrawMaxCharacterCount(e){e=Math.floor(e),this._drawMaxCharCount===e||(this._drawMaxCharCount=e,this._SetChanged())}GetDrawMaxCharacterCount(){return this._drawMaxCharCount}_GetStyleTag(e,t){for(let a=e.length-1;0<=a;--a){const n=e[a];if(n.tag===t)return n}return null}_HasStyleTag(e,t){return!!this._GetStyleTag(e,t)}_GetFontString(t,a){let n='';(this._isBold||this._HasStyleTag(a,'b'))&&(n+='bold'),(this._isItalic||this._HasStyleTag(a,'i'))&&(n+=' italic');const r=this._GetStyleTag(a,'size'),s=r?parseFloat(r.param):this._fontSize;n+=t?' '+s+'pt':' '+s*this._scaleFactor*this._zoom*self.devicePixelRatio+'pt';let e=this._fontName;const l=this._GetStyleTag(a,'font');return l&&l.param&&(e=l.param,this.onloadfont&&!this._alreadyLoadedFonts.has(e)&&(this.onloadfont(e),this._alreadyLoadedFonts.add(e))),e&&(n+=' "'+e+'"'),n}SetColor(e){e instanceof C3.Color&&(e=e.getCssRgb()),this._colorStr===e||(this._colorStr=e,this._SetChanged())}SetColorRgb(e,t,a){r.setRgb(e,t,a),this.SetColor(r)}SetHorizontalAlignment(t){if(!e.has(t))throw new Error('invalid horizontal alignment');this._horizontalAlign===t||(this._horizontalAlign=t,this._SetChanged())}SetVerticalAlignment(e){if(!s.has(e))throw new Error('invalid vertical alignment');this._verticalAlign===e||(this._verticalAlign=e,this._SetChanged())}SetWordWrapMode(e){if(!l.has(e))throw new Error('invalid word wrap mode');this._wrapMode===e||(this._wrapMode=e,this._SetTextChanged())}SetText(e){this._text===e||(this._text=e,this._SetTextChanged())}SetSize(t,a,n){var r=Math.min;if('undefined'==typeof n&&(n=1),0>=t||0>=t)return;if(this._cssWidth===t&&this._cssHeight===a&&this._zoom===n)return;1===this._zoom!=(1===n)&&(this._needToRecreateTexture=!0);const s=this._cssWidth,e=this._zoom;this._cssWidth=t,this._cssHeight=a,this._zoom=n;const l=self.devicePixelRatio;this._width=this._cssWidth*this._zoom*l,this._height=this._cssHeight*this._zoom*l;const _=Math.max(this._width,this._height),d=r(this._renderer.GetMaxTextureSize(),2048);let u=1;_>d&&(u=d/_,this._width=r(this._width*u,d),this._height=r(this._height*u,d)),this._scaleFactor=u,0=this._width||0>=this._height||(this._changed=!1,this._isUpdating=!0,this._isAsync?C3.Asyncify(()=>this._DoUpdate()):this._DoUpdate())}_DoUpdate(){var e=Math.ceil;this._wasReleased||(this._SetTextCanvasSize(e(this._width),e(this._height)),this._MaybeWrapText(),this._DrawTextToCanvas(),this._UpdateTexture(),this._textureTimeout.Reset(),this._isUpdating=!1)}_SetTextCanvasSize(e,t){this._textCanvas||(this._textCanvas=C3.CreateCanvas(16,16));let a=!1;(this._lastCanvasWidth!==e||this._lastCanvasHeight!==t)&&(this._lastCanvasWidth=e,this._lastCanvasHeight=t,this._textCanvas.width=e,this._textCanvas.height=t,a=!0),this._textContext||(this._textContext=this._textCanvas.getContext('2d'),a=!0),a?(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):this._textContext.clearRect(0,0,e,t)}_MaybeCreateMeasureContext(){this._measureContext||(this._measureContext=C3.CreateCanvas(16,16).getContext('2d'))}_SetMeasureFontString(e){this._lastMeasureCanvasFont===e||(this._lastMeasureCanvasFont=e,this._measureContext.font=e)}_MaybeWrapText(){this._textChanged&&(this._MaybeCreateMeasureContext(),this._isBBcodeEnabled&&(!this._bbString||this._bbString.toString()!==this._text)&&(this._bbString=new C3.BBString(this._text,{noEscape:!0})),this._wrappedText.WordWrap(this._isBBcodeEnabled?this._bbString.toFragmentList():this._text,this._measureTextCallback,this._cssWidth,this._wrapMode,0),this._textChanged=!1)}_MeasureText(n,a){this._SetMeasureFontString(this._GetFontString(!0,a));const r=this._GetStyleTag(a,'size'),s=r?parseFloat(r.param):this._fontSize;return{width:this._measureContext.measureText(n).width,height:t(s)}}_SetDrawFontString(e){this._lastTextCanvasFont===e||(this._lastTextCanvasFont=e,this._textContext.font=e)}_SetDrawCanvasColor(e){this._lastTextCanvasFillStyle===e||(this._lastTextCanvasFillStyle=e,this._textContext.fillStyle=e,this._textContext.strokeStyle=e)}_SetDrawCanvasOpacity(e){this._lastTextCanvasOpacity===e||(this._lastTextCanvasOpacity=e,this._textContext.globalAlpha=e)}_SetDrawCanvasLineWith(e){this._lastTextCanvasLineWidth===e||(this._lastTextCanvasLineWidth=e,this._textContext.lineWidth=e)}_DrawTextToCanvas(){this._drawCharCount=0;const t=this._scaleFactor*this._zoom*self.devicePixelRatio,n=(4+this._lineHeight)*t;let r=0;const s=this._wrappedText.GetLines(),l=s.reduce((e,r)=>e+r.height*t+n,0)-this._lineHeight*t;'center'===this._verticalAlign?r=Math.max(this._height/2-l/2,0):'bottom'===this._verticalAlign&&(r=this._height-l-2);for(let a=0,e=s.length;athis._height-4*t)break;}else if(0=this._height-l)break;0<=_&&this._DrawTextLine(e,r,t),this._isBBcodeEnabled||(r+=l),r+=n}}_DrawTextLine(t,a,n){let r=0;'center'===this._horizontalAlign?r=(this._width-t.width*n)/2:'right'===this._horizontalAlign&&(r=this._width-t.width*n);for(const s of t.fragments)this._DrawTextFragment(s,r,a,n,t.height),r+=s.width*n}_DrawTextFragment(t,y,S,G,s){const f=this._textContext,h=s/16;let I=t.width*G;const T=t.height*G,C=t.height/16,l=(4+this._lineHeight)*G,m=t.styles;let n=t.text;if(-1!==this._drawMaxCharCount){if(this._drawCharCount>=this._drawMaxCharCount)return;this._drawCharCount+n.length>this._drawMaxCharCount&&(n=n.substr(0,this._drawMaxCharCount-this._drawCharCount),I=this._MeasureText(n,m).width*G),this._drawCharCount+=n.length}const b=this._GetStyleTag(m,'background'),p=this._HasStyleTag(m,'u'),v=this._HasStyleTag(m,'s');if((!C3.IsStringAllWhitespace(n)||b||p||v)&&!this._HasStyleTag(m,'hide')){const e=this._GetStyleTag(m,'offsetx');y+=e?parseFloat(e.param)*G:0;const r=this._GetStyleTag(m,'offsety');S+=r?parseFloat(r.param)*G:0,b&&(this._SetDrawCanvasColor(b.param),f.fillRect(y,S-T,I,T+l));const d=this._GetStyleTag(m,'color');this._SetDrawCanvasColor(d?d.param:this._colorStr);const s=this._GetStyleTag(m,'opacity');this._SetDrawCanvasOpacity(s?parseFloat(s.param)/100:1);const t=this._HasStyleTag(m,'stroke');if(t&&this._SetDrawCanvasLineWith(C*this._scaleFactor*this._zoom),p&&a(f,t,y,S+G*h,I,G*h),v&&a(f,t,y,S-T/4,I,G*C),this._SetDrawFontString(this._GetFontString(!1,m)),_(f,t,n,y,S,I),!t){this._SetDrawCanvasLineWith(C*this._scaleFactor*this._zoom);const e=this._GetStyleTag(m,'outline');e&&(this._SetDrawCanvasColor(e.param),_(f,!0,n,y,S,I))}}}_UpdateTexture(){var e=Math.ceil;this._renderer.IsContextLost()||(this._textureWidth=e(this._width),this._textureHeight=e(this._height),this._rcTex.set(0,0,this._width/this._textureWidth,this._height/this._textureHeight),this._needToRecreateTexture&&(this.ReleaseTexture(),this._needToRecreateTexture=!1),!this._texture&&(this._texture=this._renderer.CreateDynamicTexture(this._textureWidth,this._textureHeight,{mipMap:1===this._zoom,mipMapQuality:'high'})),this._renderer.UpdateTexture(this._textCanvas,this._texture),this.ontextureupdate&&this.ontextureupdate())}GetTexRect(){return this._rcTex}ReleaseTexture(){this._texture&&(!this._renderer.IsContextLost()&&this._renderer.DeleteTexture(this._texture),this._texture=null)}static OnContextLost(){for(const e of d)e.ReleaseTexture()}static GetAll(){return d.values()}}}{class e{constructor(e){this._gl=e.GetContext(),this._version=e.GetWebGLVersionNumber(),this._timerExt=e._GetDisjointTimerQueryExtension(),this._query=null,this._isActive=!1,this._hasResult=!1,this._result=0,this._query=1===this._version?this._timerExt.createQueryEXT():this._gl.createQuery()}Release(){this._DeleteQueryObject(),this._gl=null,this._timerExt=null,this._hasResult=!1}_DeleteQueryObject(){this._query&&(1===this._version?this._timerExt.deleteQueryEXT(this._query):this._gl.deleteQuery(this._query),this._query=null)}BeginTimeElapsed(){if(this._isActive)throw new Error('query already active');1===this._version?this._timerExt.beginQueryEXT(this._timerExt.TIME_ELAPSED_EXT,this._query):this._gl.beginQuery(this._timerExt.TIME_ELAPSED_EXT,this._query),this._isActive=!0}EndTimeElapsed(){if(!this._isActive)throw new Error('query not active');1===this._version?this._timerExt.endQueryEXT(this._timerExt.TIME_ELAPSED_EXT):this._gl.endQuery(this._timerExt.TIME_ELAPSED_EXT),this._isActive=!1}CheckForResult(){if(!this._query||this._hasResult||this._isActive)return;let e=!1;e=1===this._version?this._timerExt.getQueryObjectEXT(this._query,this._timerExt.QUERY_RESULT_AVAILABLE_EXT):this._gl.getQueryParameter(this._query,this._gl.QUERY_RESULT_AVAILABLE);const t=this._gl.getParameter(this._timerExt.GPU_DISJOINT_EXT);e&&!t&&(this._result=1===this._version?this._timerExt.getQueryObjectEXT(this._query,this._timerExt.QUERY_RESULT_EXT):this._gl.getQueryParameter(this._query,this._gl.QUERY_RESULT),this._result/=1e9,this._hasResult=!0),(e||t)&&this._DeleteQueryObject()}HasResult(){return this._hasResult}GetResult(){if(!this._hasResult)throw new Error('no result available');return this._result}}C3.Gfx.WebGLTimeElapsedQuery=class{constructor(e){this._renderer=e,this._frameNumber=e.GetFrameNumber(),this._isActive=!1,this._parentQuery=null,this._isNested=!1,this._realQuery=null,this._queries=[]}Release(){for(const t of this._queries)t instanceof e&&t.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 e=this._renderer._GetTimeQueryStack();0e.HasResult())}GetResult(){return this._queries.reduce((e,t)=>e+t.GetResult(),0)}GetFrameNumber(){return this._frameNumber}}}'use strict',C3.Gfx.WebGLQueryResultBuffer=class{constructor(e,t=1e3){this._renderer=e,this._maxQueries=t,this._buffer=[],this._renderer._AddQueryResultBuffer(this)}Release(){this.Clear(),this._renderer._RemoveQueryResultBuffer(this),this._renderer=null}Clear(){for(const e of this._buffer)e.Release();C3.clearArray(this._buffer)}AddTimeElapsedQuery(){const e=new C3.Gfx.WebGLTimeElapsedQuery(this._renderer);if(this._buffer.push(e),this._buffer.length>this._maxQueries){const e=this._buffer.shift();e.Release()}return e}CheckForResults(e){for(const t of this._buffer){if(t.GetFrameNumber()>=e)return;if(t.IsNested())return;t.CheckForResult()}}GetFrameRangeResultSum(e,t){if(t<=e)return NaN;let a=0;for(const n of this._buffer){if(n.GetFrameNumber()>=t)break;if(!(n.GetFrameNumber()'],[_.GetTextureFillFragmentShaderSource(),l,''],[_.GetPointFragmentShaderSource(),_.GetPointVertexShaderSource(),''],[_.GetColorFillFragmentShaderSource(),l,''],[_.GetLinearGradientFillFragmentShaderSource(),l,''],[_.GetHardEllipseFillFragmentShaderSource(),l,''],[_.GetHardEllipseOutlineFragmentShaderSource(),l,''],[_.GetSmoothEllipseFillFragmentShaderSource(),l,''],[_.GetSmoothEllipseOutlineFragmentShaderSource(),l,''],[_.GetSmoothLineFillFragmentShaderSource(),l,''],[_.GetTilemapFragmentShaderSource(),_.GetDefaultVertexShaderSource(this._is3d,!0),'']],s=await Promise.all(g.map(t=>this.CreateShaderProgram({src:t[0]},t[1],t[2])));this._spTextureFill=s[0],this._spDeviceTransformTextureFill=s[1],this._spPoints=s[2],this._spColorFill=s[3],this._spLinearGradientFill=s[4],this._spHardEllipseFill=s[5],this._spHardEllipseOutline=s[6],this._spSmoothEllipseFill=s[7],this._spSmoothEllipseOutline=s[8],this._spSmoothLineFill=s[9],this._spTilemapFill=s[10],this._currentStateGroup=null,this.SetTextureFillMode()}Is3D(){return this._is3d}GetNumVertexComponents(){return this._is3d?3:2}SetBaseZ(t){this._baseZ=t}GetBaseZ(){return this._baseZ}SetCurrentZ(t){this._currentZ=t,this._currentStateGroup=null}GetCurrentZ(){return this._currentZ}async CreateShaderProgram(n,e,t){const r=await C3.Gfx.WebGLShaderProgram.Create(this,n,e,t);return this._AddShaderProgram(r),r}ResetLastProgram(){this._lastProgram=null}SetSize(s,e,t){if(this._width!==s||this._height!==e||t){this.EndBatch();const t=this._gl,r=this._batchState;this._width=s,this._height=e;const a=this.GetScissoredViewportWidth(),l=this.GetScissoredViewportHeight();this._UpdateViewportRenderer(a,l,this._width,this._height),this._UpdateViewportBatch(a,l,this._matP),this._spDeviceTransformTextureFill&&(t.useProgram(this._spDeviceTransformTextureFill.GetShaderProgram()),this._spDeviceTransformTextureFill._UpdateDeviceTransformUniforms(this._matP),this._lastProgram=this._spDeviceTransformTextureFill,this._batchState.currentShader=this._spDeviceTransformTextureFill),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE0),this._lastTexture0=null,this._lastTexture1=null,this._currentRenderTarget&&this._currentRenderTarget._Resize(this._width,this._height),t.bindFramebuffer(t.FRAMEBUFFER,null),this._currentRenderTarget=null,r.currentFramebuffer=null}}_UpdateViewportRenderer(s,e,t,r){this._cam[2]=100,mat4.lookAt(this._matMV,this._cam,this._look,this._up),mat4.perspective(this._matP,45,s/e,this.GetNearZ(),this.GetFarZ());const a=[0,0],l=[0,0],n=self.devicePixelRatio;this.Project(0,0,s,e,a),this.Project(1,1,s,e,l),this._worldScale[0]=n/(l[0]-a[0]),this._worldScale[1]=-n/(l[1]-a[1]),this._lastBackbufferWidth=t,this._lastBackbufferHeight=r}_UpdateViewportBatch(s,e,t){const r=this._gl,a=this._batchState;r.viewport(0,0,s,e);const l=this._allShaderPrograms,n=a.currentShader;for(let r=0,a=l.length;r=this._lastVertexPtr&&(this.EndBatch(),a=0),1===this._topOfBatch)this._batch[this._batchPtr-1]._indexCount+=6;else{const e=this.PushBatch();e.InitQuad(this._is3d?a:3*(a/2),6),this._topOfBatch=1}}_WriteQuadToVertexBuffer(t){t.writeToTypedArray3D(this._vertexData,this._vertexPtr,this._baseZ+this._currentZ),this._vertexPtr+=12}Quad(t){this._ExtendQuadBatch(),this._WriteQuadToVertexBuffer(t),f.writeToTypedArray(this._texcoordData,this._texPtr),this._texPtr+=8}Quad2(n,e,t,r,a,c,_,l){this._ExtendQuadBatch();const g=this._vertexData;let s=this._vertexPtr;const p=this._baseZ+this._currentZ;this._is3d?(g[s++]=n,g[s++]=e,g[s++]=p,g[s++]=t,g[s++]=r,g[s++]=p,g[s++]=a,g[s++]=c,g[s++]=p,g[s++]=_,g[s++]=l,g[s++]=p):(g[s++]=n,g[s++]=e,g[s++]=t,g[s++]=r,g[s++]=a,g[s++]=c,g[s++]=_,g[s++]=l),this._vertexPtr=s,f.writeToTypedArray(this._texcoordData,this._texPtr),this._texPtr+=8}Quad3(a,e){this._ExtendQuadBatch(),this._WriteQuadToVertexBuffer(a),e.writeAsQuadToTypedArray(this._texcoordData,this._texPtr),this._texPtr+=8}Quad4(a,e){this._ExtendQuadBatch(),this._WriteQuadToVertexBuffer(a),e.writeToTypedArray(this._texcoordData,this._texPtr),this._texPtr+=8}FullscreenQuad(d,g){var t=Math.max,r=Math.min;if(mat4.copy(l,this._lastMV),vec3.copy(n,this._cam),vec3.copy(_,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(),this._isScissorViewport){const a=this._viewportScissorWidth/2,e=this._viewportScissorHeight/2;s.set(-a,e,-a+this._viewportScissorWidth,e-this._viewportScissorHeight),y.setFromRect(s),s.set(0,0,this._viewportScissorWidth/this._width,this._viewportScissorHeight/this._height),this.Quad3(y,s)}else if('crop'===d&&this._currentRenderTarget&&g){const a=this._width/2,e=this._height/2,d=g.GetWidth(),n=g.GetHeight(),_=this._currentRenderTarget.GetWidth(),l=this._currentRenderTarget.GetHeight(),m=r(_,d),u=r(l,n),c=t(n-l,0),p=t(l-n,0);s.set(-a,e-p,-a+m,e-u-p),y.setFromRect(s),s.set(0,c,m,u+c),s.divide(d,n),this.Quad3(y,s)}else{let[n,e]=this.GetRenderTargetSize(this._currentRenderTarget);const t=n/2,r=e/2;this.Rect2(-t,r,t,-r)}mat4.copy(this._matMV,l),vec3.copy(this._cam,n),vec3.copy(this._look,_),this.UpdateModelView()}ConvexPoly(d){const e=d.length/2;if(3>e)throw new Error('need at least 3 points');const u=e-2,c=d[0],a=d[1];for(let e=0;e=this._lineWidthStack.length)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(t){if('butt'===t)this.PushLineCapButt();else if('square'===t)this.PushLineCapSquare();else if('zag'===t)this.PushLineCapZag();else throw new Error('invalid line cap')}PushLineCapButt(){if(100<=this._lineCapStack.length)throw new Error('pushed too many line caps - check push/pop pairs');this._lineCapStack.push(0),this._lineCap=0}PushLineCapSquare(){if(100<=this._lineCapStack.length)throw new Error('pushed too many line caps - check push/pop pairs');this._lineCapStack.push(1),this._lineCap=1}PushLineCapZag(){if(100<=this._lineCapStack.length)throw new Error('pushed too many line caps - check push/pop pairs');this._lineCapStack.push(2),this._lineCap=2}PopLineCap(){if(1>=this._lineCapStack.length)throw new Error('cannot pop last line cap - check push/pop pairs');this._lineCapStack.pop(),this._lineCap=this._lineCapStack[this._lineCapStack.length-1]}SetLineOffset(t){this._lineOffset=t,this._lineOffsetStack[this._lineOffsetStack.length-1]=t}GetLineOffset(){return this._lineOffset}PushLineOffset(t){if(100<=this._lineOffsetStack.length)throw new Error('pushed too many line offsets - check push/pop pairs');this._lineOffsetStack.push(t),this._lineOffset=t}PopLineOffset(){if(1>=this._lineOffsetStack.length)throw new Error('cannot pop last line offset - check push/pop pairs');this._lineOffsetStack.pop(),this._lineOffset=this._lineOffsetStack[this._lineOffsetStack.length-1]}SetPointTextureCoords(a){if(!this._lastPointTexCoords.equals(a)){this._lastPointTexCoords.copy(a);const e=this.PushBatch();e.InitSetPointTexCoords(a),this._topOfBatch=0}}Point(s,e,t,r){7996<=this._pointPtr&&this.EndBatch();let a=this._pointPtr;const l=this._baseZ+this._currentZ;if(2===this._topOfBatch&&this._lastPointZ===l)this._batch[this._batchPtr-1]._indexCount++;else{const t=this.PushBatch();t.InitPoints(a,l),this._topOfBatch=2,this._lastPointZ=l}const n=this._pointData;n[a++]=s,n[a++]=e,n[a++]=t,n[a++]=r,this._pointPtr=a}SetProgram(a){if(this._lastProgram!==a){const e=this.PushBatch();e.InitSetProgram(a),this._lastProgram=a,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(a){const e=this.PushBatch();e.InitSetGradientColor(a),this._topOfBatch=0}SetHardEllipseFillMode(){this.SetProgram(this._spHardEllipseFill)}SetHardEllipseOutlineMode(){this.SetProgram(this._spHardEllipseOutline)}SetSmoothEllipseFillMode(){this.SetProgram(this._spSmoothEllipseFill)}SetSmoothEllipseOutlineMode(){this.SetProgram(this._spSmoothEllipseOutline)}SetEllipseParams(n,e,t=1){const r=this.PushBatch();r.InitSetEllipseParams(n,e,t),this._topOfBatch=0}SetSmoothLineFillMode(){this.SetProgram(this._spSmoothLineFill)}SetTilemapFillMode(){this.SetProgram(this._spTilemapFill)}SetTilemapInfo(s,e,t,r,a,d,n){if(this._lastProgram!==this._spTilemapFill)throw new Error('must set tilemap fill mode first');const _=this.PushBatch();_.InitSetTilemapInfo(s,e,t,r,a,d,n),this._topOfBatch=0}SetProgramParameters(g,e,t,r,a,m,n,_,l,h,d){const y=this._lastProgram,u=y._hasAnyOptionalUniforms,s=!!d.length;if(u&&!y.AreOptionalUniformsAlreadySetInBatch(e,t,r,a,m,n,_,l,h)||s&&!y.AreCustomParametersAlreadySetInBatch(d)){const c=this.PushBatch();if(c.InitSetProgramParameters(),u){y.SetOptionalUniformsInBatch(e,t,r,a,m,n,_,l,h);const d=c._mat4param;d[0]=m,d[1]=n,e.writeToTypedArray(d,2),d[6]=_,d[7]=l,t.writeToTypedArray(d,12);const s=c._colorParam;a.writeToTypedArray(s,0);const u=s[1];s[1]=s[3],s[3]=u,r.writeToTypedArray(c._srcOriginRect,0),c._startIndex=h,c._texParam=y._uSamplerBack.IsUsed()?g?g.GetTexture():null:null}s&&(y.SetCustomParametersInBatch(d),C3.shallowAssignArray(c._shaderParams,d)),this._topOfBatch=0}}ClearRgba(n,e,t,r){const s=this.PushBatch();s.InitClearSurface2(n,e,t,r),this._topOfBatch=0}Clear(a){const e=this.PushBatch();e.InitClearSurface(a),this._topOfBatch=0}ClearRect(n,e,t,r){this.ClearRect4(n,e,t,r,0,0,0,0)}ClearRect2(t){this.ClearRect4(t.getLeft(),t.getTop(),t.width(),t.height(),0,0,0,0)}ClearRect3(a,e){this.ClearRect4(a.getLeft(),a.getTop(),a.width(),a.height(),e.getR(),e.getG(),e.getB(),e.getA())}ClearRect4(s,e,t,d,n,_,r,l){if(!(0>t||0>d)){const u=this.PushBatch();u.InitClearRect(s,e,t,d,n,_,r,l),this._topOfBatch=0}}Start(){}Finish(){super.Finish(),this._gl.flush()}CheckForQueryResults(){for(const t of this._allQueryResultBuffers)t.CheckForResults(this._frameNumber)}IsContextLost(){return!this._gl||this._gl.isContextLost()||this._isInitialisingAfterContextRestored}OnContextLost(){C3.Gfx.WebGLRendererTexture.OnContextLost(),C3.Gfx.WebGLRenderTarget.OnContextLost(),C3.Gfx.WebGLText.OnContextLost();for(const t of this._allQueryResultBuffers)t.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 t of this._stateGroups.values())t.OnContextLost();for(const t of this._allShaderPrograms)t.Release();this._ClearAllShaderPrograms()}async OnContextRestored(){this._isInitialisingAfterContextRestored=!0,await this.InitState(),this._isInitialisingAfterContextRestored=!1;for(const t of this._stateGroups.values())t.OnContextRestored(this);this.SetSize(this._width,this._height,!0)}CreateStaticTexture(a,e){if(this.IsContextLost())throw new Error('context lost');this.EndBatch();const t=C3.New(C3.Gfx.WebGLRendererTexture,this);return t._CreateStatic(a,e),t}CreateStaticTextureAsync(a,n){return this.IsContextLost()?Promise.reject('context lost'):(n=Object.assign({},n),C3.Supports.ImageBitmapOptions&&(this.SupportsNPOTTextures()||!n.isTiled)?(n.premultiplyAlpha=!1,createImageBitmap(a,{premultiplyAlpha:'premultiply'}).then(t=>C3.Asyncify(()=>this.CreateStaticTexture(t,n)))):C3.Supports.ImageBitmap?createImageBitmap(a).then(t=>C3.Asyncify(()=>this.CreateStaticTexture(t,n))):a instanceof Blob?C3.BlobToImage(a,!0).then(t=>this.CreateStaticTextureAsync(t,n)):'undefined'!=typeof HTMLImageElement&&a instanceof HTMLImageElement&&'function'==typeof a.decode?a.decode().then(()=>C3.Asyncify(()=>this.CreateStaticTexture(a,n))):C3.Asyncify(()=>this.CreateStaticTexture(a,n)))}CreateDynamicTexture(n,e,t){this.EndBatch();const r=C3.New(C3.Gfx.WebGLRendererTexture,this);return r._CreateDynamic(n,e,t),r}UpdateTexture(a,e,t){this.EndBatch(),e._Update(a,t)}DeleteTexture(t){t&&(t.SubtractReference(),0=e||0>=s)throw new Error('invalid size');this.EndBatch();const _=C3.New(C3.Gfx.WebGLRenderTarget,this);return _._Create(e,s,Object.assign({isDefaultSize:l},n)),this._currentRenderTarget=null,this._batchState.currentFramebuffer=null,_}SetRenderTarget(s){if(s===this._currentRenderTarget)return;let e,l,d,u;s?(s.IsDefaultSize()&&s._Resize(this._width,this._height),d=s.GetWidth(),u=s.GetHeight(),e=d,l=u):(d=this._width,u=this._height,e=this.GetScissoredViewportWidth(),l=this.GetScissoredViewportHeight());const c=this._lastBackbufferWidth!==d||this._lastBackbufferHeight!==u;c&&this._UpdateViewportRenderer(e,l,d,u);const n=this.PushBatch();n.InitSetRenderTarget(s,c,this._matP),this._currentRenderTarget=s,this._topOfBatch=0}GetRenderTarget(){return this._currentRenderTarget}GetRenderTargetSize(t){return t?[t.GetWidth(),t.GetHeight()]:[this._width,this._height]}CopyRenderTarget(a,e='stretch'){if(2>this._version||this._currentRenderTarget&&0this._version)){const e=this.PushBatch();e.InitInvalidateFramebuffer(a._GetFramebuffer()),this._topOfBatch=0}}DeleteRenderTarget(a){this.SetRenderTarget(null),this.EndBatch();const e=a.GetTexture();e===this._lastTexture0&&(this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._lastTexture0=null),e===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),a._Delete()}async ReadBackRenderTargetToImageData(s,e){this.EndBatch();const t=this._currentRenderTarget;let d,u,c;s?(d=s.GetWidth(),u=s.GetHeight(),c=s._GetFramebuffer()):(d=this.GetWidth(),u=this.GetHeight(),c=null);const g=this._gl;g.bindFramebuffer(g.FRAMEBUFFER,c);const _=()=>{g.bindFramebuffer(g.FRAMEBUFFER,null),this._currentRenderTarget=null,this._batchState.currentFramebuffer=null,this.SetRenderTarget(t)};let l;if(!e&&2<=this.GetWebGLVersionNumber()){g.bindFramebuffer(g.READ_FRAMEBUFFER,c);const a=g.createBuffer(),e=4*(d*u),t=g.PIXEL_PACK_BUFFER;g.bindBuffer(t,a),g.bufferData(t,e,g.STREAM_READ),g.readPixels(0,0,d,u,g.RGBA,g.UNSIGNED_BYTE,0),g.bindFramebuffer(g.READ_FRAMEBUFFER,null),g.bindBuffer(t,null),_();const n=g.fenceSync(g.SYNC_GPU_COMMANDS_COMPLETE,0);await this._WaitForObjectReady(()=>g.getSyncParameter(n,g.SYNC_STATUS)===g.SIGNALED),g.deleteSync(n),l=new ImageData(d,u),g.bindBuffer(t,a),g.getBufferSubData(t,0,new Uint8Array(l.data.buffer),0,e),g.bindBuffer(t,null),g.deleteBuffer(a)}else l=new ImageData(d,u),g.readPixels(0,0,d,u,g.RGBA,g.UNSIGNED_BYTE,new Uint8Array(l.data.buffer)),_();return l}StartQuery(a){if(this.SupportsGPUProfiling()){const e=this.PushBatch();e.InitStartQuery(a),this._topOfBatch=0}}EndQuery(a){if(this.SupportsGPUProfiling()){const e=this.PushBatch();e.InitEndQuery(a),this._topOfBatch=0}}_WaitForObjectReady(a){const e=new Promise(e=>d.add({resolve:e,checkFunc:a}));return-1===t&&(t=self.requestAnimationFrame(m)),e}IsDesynchronized(){return!!this._attribs.desynchronized}GetEstimatedBackBufferMemoryUsage(){return this._width*this._height*(this._attribs.alpha?4:3)}GetEstimatedRenderBufferMemoryUsage(){let t=0;for(const e of C3.Gfx.WebGLRenderTarget.allRenderTargets())e.GetTexture()||(t+=e.GetEstimatedMemoryUsage());return t}GetEstimatedTextureMemoryUsage(){let t=0;for(const e of C3.Gfx.WebGLRendererTexture.allTextures())t+=e.GetEstimatedMemoryUsage();return t}GetEstimatedTotalMemoryUsage(){return this.GetEstimatedBackBufferMemoryUsage()+this.GetEstimatedRenderBufferMemoryUsage()+this.GetEstimatedTextureMemoryUsage()}GetWebGLVersionString(){return this._versionString}GetWebGLVersionNumber(){return this._version}SupportsNPOTTextures(){return 2<=this.GetWebGLVersionNumber()}GetMaxTextureSize(){return this._maxTextureSize}GetMinPointSize(){return this._minPointSize}GetMaxPointSize(){return this._maxPointSize}SupportsHighP(){return 0!==this._highpPrecision}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(t){this._allQueryResultBuffers.add(t)}_RemoveQueryResultBuffer(t){this._allQueryResultBuffers.delete(t)}_GetTimeQueryStack(){return this._timeQueryStack}GetContext(){return this._gl}_InitBlendModes(t){this._InitBlendModeData([['normal',t.ONE,t.ONE_MINUS_SRC_ALPHA],['additive',t.ONE,t.ONE],['xor',t.ONE,t.ONE_MINUS_SRC_ALPHA],['copy',t.ONE,t.ZERO],['destination-over',t.ONE_MINUS_DST_ALPHA,t.ONE],['source-in',t.DST_ALPHA,t.ZERO],['destination-in',t.ZERO,t.SRC_ALPHA],['source-out',t.ONE_MINUS_DST_ALPHA,t.ZERO],['destination-out',t.ZERO,t.ONE_MINUS_SRC_ALPHA],['source-atop',t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],['destination-atop',t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA]])}CreateWebGLText(){return C3.New(C3.Gfx.WebGLText,this)}}}{function e(e){if(!e)return'';const t=e.split('.');if(2>t.length)return'';const a=t[t.length-1].toLowerCase();return r.get(a)||''}function t(e){return new Promise((t,a)=>{const n=document.createElement('script');n.onload=t,n.onerror=a,n.async=!1,n.src=e,document.head.appendChild(n)})}const n=new Set(['local','remote']),r=new Map([['mp4','video/mp4'],['webm','video/webm'],['m4a','audio/mp4'],['mp3','audio/mpeg'],['js','application/javascript'],['wasm','application/wasm'],['svg','image/svg+xml']]);C3.AssetManager=class extends C3.DefendedBase{constructor(e,t){if(super(),!n.has(t.defaultLoadPolicy))throw new Error('invalid load policy');if(this._runtime=e,this._localUrlBlobs=new Map,this._localBlobUrlCache=new Map,this._isCordova=!!t.isCordova,this._isiOSCordova=!!t.isiOSCordova,this._supportedAudioFormats=t.supportedAudioFormats||{},this._audioFiles=new Map,this._preloadSounds=!1,this._mediaSubfolder='',this._fontsSubfolder='',this._iconsSubfolder='',this._defaultLoadPolicy=t.defaultLoadPolicy,this._allAssets=[],this._assetsByUrl=new Map,this._webFonts=[],this._loadPromises=[],this._hasFinishedInitialLoad=!1,this._totalAssetSizeToLoad=0,this._assetSizeLoaded=0,this._lastLoadProgress=0,this._hasHadErrorLoading=!1,this._loadingRateLimiter=C3.New(C3.RateLimiter,()=>this._FireLoadingProgressEvent(),50),this._promiseThrottle=new C3.PromiseThrottle(Math.max(C3.hardwareConcurrency,8)),t.localUrlBlobs)for(const[e,a]of Object.entries(t.localUrlBlobs))this._localUrlBlobs.set(e.toLowerCase(),a);this._iAssetManager=new IAssetManager(this)}Release(){this._localUrlBlobs.clear();for(const e of this._localBlobUrlCache.values())URL.revokeObjectURL(e);this._localBlobUrlCache.clear();for(const e of this._allAssets)e.Release();C3.clearArray(this._allAssets),this._assetsByUrl.clear(),C3.clearArray(this._loadPromises),this._runtime=null}GetRuntime(){return this._runtime}_SetMediaSubfolder(e){this._mediaSubfolder=e}GetMediaSubfolder(){return this._mediaSubfolder}_SetFontsSubfolder(e){this._fontsSubfolder=e}GetFontsSubfolder(){return this._fontsSubfolder}_SetIconsSubfolder(e){this._iconsSubfolder=e}GetIconsSubfolder(){return this._iconsSubfolder}_HasLocalUrlBlob(e){return this._localUrlBlobs.has(e.toLowerCase())}_GetLocalUrlBlob(e){return this._localUrlBlobs.get(e.toLowerCase())||null}GetLocalUrlAsBlobUrl(e){const t=this._GetLocalUrlBlob(e);if(!t)return e;let a=this._localBlobUrlCache.get(t);return a||(a=URL.createObjectURL(t),this._localBlobUrlCache.set(t,a)),a}FetchBlob(e,t){t=t||this._defaultLoadPolicy;const a=this._GetLocalUrlBlob(e);if(a)return Promise.resolve(a);if(C3.IsRelativeURL(e)){const a=e.toLowerCase();return this._isCordova?this.CordovaFetchLocalFileAsBlob(a):'local'===t?this._promiseThrottle.Add(()=>C3.FetchBlob(a)):C3.FetchBlob(a)}return C3.FetchBlob(e)}FetchArrayBuffer(e){const t=this._GetLocalUrlBlob(e);if(t)return C3.BlobToArrayBuffer(t);if(C3.IsRelativeURL(e)){const t=e.toLowerCase();return this._isCordova?this.CordovaFetchLocalFileAsArrayBuffer(t):'local'===this._defaultLoadPolicy?this._promiseThrottle.Add(()=>C3.FetchArrayBuffer(t)):C3.FetchArrayBuffer(t)}return C3.FetchArrayBuffer(e)}FetchText(e){const t=this._GetLocalUrlBlob(e);if(t)return C3.BlobToString(t);if(C3.IsRelativeURL(e)){const t=e.toLowerCase();return this._isCordova?this.CordovaFetchLocalFileAsText(t):'local'===this._defaultLoadPolicy?this._promiseThrottle.Add(()=>C3.FetchText(t)):C3.FetchText(t)}return C3.FetchText(e)}async FetchJson(e){const t=await this.FetchText(e);return JSON.parse(t)}_CordovaFetchLocalFileAs(e,t){return this._runtime.PostComponentMessageToDOMAsync('runtime','cordova-fetch-local-file',{filename:e,as:t})}CordovaFetchLocalFileAsText(e){return this._CordovaFetchLocalFileAs(e,'text')}async CordovaFetchLocalFileAsBlob(t){const a=await this._CordovaFetchLocalFileAs(t,'buffer'),n=e(t);return new Blob([a],{type:n})}async CordovaFetchLocalFileAsBlobURL(e){e=e.toLowerCase();let t=this._localBlobUrlCache.get(e);if(t)return t;const n=await this.CordovaFetchLocalFileAsBlob(e);return t=URL.createObjectURL(n),this._localBlobUrlCache.set(e,t),t}CordovaFetchLocalFileAsArrayBuffer(e){return this._CordovaFetchLocalFileAs(e,'buffer')}GetMediaFileUrl(e){return this._HasLocalUrlBlob(e)?this.GetLocalUrlAsBlobUrl(e):this._mediaSubfolder+e.toLowerCase()}GetProjectFileUrl(e,t=''){if(C3.IsAbsoluteURL(e)){if(t)throw new Error('cannot specify subfolder with remote URL');return Promise.resolve(e)}return this._HasLocalUrlBlob(e)?Promise.resolve(this.GetLocalUrlAsBlobUrl(e)):this._isCordova?this.CordovaFetchLocalFileAsBlobURL(t+e):Promise.resolve(t+e.toLowerCase())}LoadProjectFileUrl(e){return this.GetProjectFileUrl(e)}LoadImage(e){if(e.loadPolicy&&!n.has(e.loadPolicy))throw new Error('invalid load policy');let t=this._assetsByUrl.get(e.url);return t?t:(t=C3.New(C3.ImageAsset,this,{url:e.url,size:e.size||0,loadPolicy:e.loadPolicy||this._defaultLoadPolicy}),this._allAssets.push(t),this._assetsByUrl.set(t.GetURL(),t),this._hasFinishedInitialLoad||(this._totalAssetSizeToLoad+=t.GetSize(),this._loadPromises.push(t.Load().then(()=>this._AddLoadedSize(t.GetSize())))),t)}async WaitForAllToLoad(){try{await Promise.all(this._loadPromises),this._lastLoadProgress=1}catch(e){console.error('Error loading: ',e),this._hasHadErrorLoading=!0,this._FireLoadingProgressEvent()}}SetInitialLoadFinished(){this._hasFinishedInitialLoad=!0}HasHadErrorLoading(){return this._hasHadErrorLoading}_AddLoadedSize(e){this._assetSizeLoaded+=e,this._loadingRateLimiter.Call()}_FireLoadingProgressEvent(){const e=C3.New(C3.Event,'loadingprogress');this._lastLoadProgress=C3.clamp(this._assetSizeLoaded/this._totalAssetSizeToLoad,0,1),e.progress=this._lastLoadProgress,this._runtime.Dispatcher().dispatchEvent(e)}GetLoadProgress(){return this._lastLoadProgress}_SetWebFonts(e){C3.shallowAssignArray(this._webFonts,e),this._webFonts.length&&this._loadPromises.push(this._LoadWebFonts())}_LoadWebFonts(){if('undefined'==typeof FontFace)return Promise.resolve();const e=[];for(const[t,a,n]of this._webFonts)this._totalAssetSizeToLoad+=n,e.push(this._LoadWebFont(t,a).then(()=>this._AddLoadedSize(n)));return Promise.all(e)}async _LoadWebFont(e,t){try{const a=await this.GetProjectFileUrl(t,this._fontsSubfolder),n=new FontFace(e,`url('${a}')`);this._runtime.IsInWorker()?self.fonts.add(n):document.fonts.add(n),await n.load()}catch(t){console.warn(`[C3 runtime] Failed to load web font '${e}': `,t)}}IsAudioFormatSupported(e){return!!this._supportedAudioFormats[e]}_SetAudioFiles(t,e){this._preloadSounds=!!e;for(const[n,a,r]of t)this._audioFiles.set(n,{fileName:n,formats:a.map(e=>({type:e[0],fileExtension:e[1],fullName:n+e[1],fileSize:e[2]})),isMusic:r})}GetPreferredAudioFile(e){const t=this._audioFiles.get(e.toLowerCase());if(!t)return null;let a=null;for(const n of t.formats)if(a||'audio/webm; codecs=opus'!==n.type||(a=n),this.IsAudioFormatSupported(n.type))return n;return a}GetProjectAudioFileUrl(e){const t=this.GetPreferredAudioFile(e);return t?{url:this.GetMediaFileUrl(t.fullName),type:t.type}:null}GetAudioToPreload(){if(this._preloadSounds){const e=[];for(const t of this._audioFiles.values()){if(t.isMusic)continue;const a=this.GetPreferredAudioFile(t.fileName);a&&e.push({originalUrl:t.fileName,url:this.GetMediaFileUrl(a.fullName),type:a.type,fileSize:a.fileSize})}return e}return[]}GetIAssetManager(){return this._iAssetManager}async LoadScripts(...e){const a=await Promise.all(e.map(e=>this.GetProjectFileUrl(e)));this._runtime.IsInWorker()?importScripts(...a):await Promise.all(a.map(e=>t(e)))}async CompileWebAssembly(e){if(WebAssembly.compileStreaming){const t=await this.GetProjectFileUrl(e);return await WebAssembly.compileStreaming(fetch(t))}else{const t=await C3.FetchArrayBuffer(e);return await WebAssembly.compile(t)}}async LoadStyleSheet(e){const t=await this.GetProjectFileUrl(e);return await this._runtime.PostComponentMessageToDOMAsync('runtime','add-stylesheet',{url:t})}}}'use strict',C3.Asset=class extends C3.DefendedBase{constructor(e,t){super(),this._assetManager=e,this._runtime=e.GetRuntime(),this._url=t.url,this._size=t.size,this._loadPolicy=t.loadPolicy,this._blob=null,this._isLoaded=!1,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(){return'local'===this._loadPolicy||this._blob?(this._isLoaded=!0,Promise.resolve()):this._loadPromise?this._loadPromise:(this._loadPromise=this._assetManager.FetchBlob(this._url,this._loadPolicy).then(e=>{this._isLoaded=!0,this._loadPromise=null,this._blob=e}).catch(e=>console.error('Error loading resource: ',e)),this._loadPromise)}IsLoaded(){return this._isLoaded}GetBlob(){return this._blob?Promise.resolve(this._blob):this._assetManager.FetchBlob(this._url,this._loadPolicy)}},'use strict';{const e=new C3.PromiseThrottle,t=new Set;C3.ImageAsset=class extends C3.Asset{constructor(e,a){super(e,a),this._texturePromise=null,this._webglTexture=null,this._refCount=0,this._imageWidth=-1,this._imageHeight=-1,t.add(this)}Release(){if(this.ReleaseTexture(),0!==this._refCount)throw new Error('released image asset which still has texture references');this._texturePromise=null,t.delete(this),super.Release()}static OnWebGLContextLost(){for(const e of t)e._texturePromise=null,e._webglTexture=null,e._refCount=0}LoadStaticTexture(t,a){return(this._refCount++,this._webglTexture)?Promise.resolve(this._webglTexture):this._texturePromise?this._texturePromise:(this._texturePromise=this.GetBlob().then(n=>e.Add(()=>t.CreateStaticTextureAsync(n,a).then(e=>(this._texturePromise=null,0===this._refCount)?(t.DeleteTexture(e),null):(this._webglTexture=e,this._imageWidth=e.GetWidth(),this._imageHeight=e.GetHeight(),this._webglTexture)))).catch(e=>{throw console.error('Failed to load texture: ',e),e}),this._texturePromise)}ReleaseTexture(){if(0>=this._refCount)throw new Error('texture released too many times');if(this._refCount--,0===this._refCount&&this._webglTexture){const e=this._webglTexture.GetRenderer();e.DeleteTexture(this._webglTexture),this._webglTexture=null}}GetTexture(){return this._webglTexture}GetWidth(){return this._imageWidth}GetHeight(){return this._imageHeight}async LoadToDrawable(){const e=await this.GetBlob();return C3.Supports.ImageBitmapOptions?await createImageBitmap(e,{premultiplyAlpha:'none'}):C3.Supports.ImageBitmap?await createImageBitmap(e):await C3.BlobToImage(e)}}}{function e(e,t){return e.GetWorldInfo()._GetLastCachedZIndex()-t.GetWorldInfo()._GetLastCachedZIndex()}C3.RenderCell=class extends C3.DefendedBase{constructor(e,t,a){super(),this._grid=e,this._x=t,this._y=a,this._instances=[],this._isSorted=!0,this._pendingRemoval=new Set,this._isAnyPendingRemoval=!1}Release(){C3.clearArray(this._instances),this._pendingRemoval.clear(),this._grid=null}Reset(){C3.clearArray(this._instances),this._isSorted=!0,this._pendingRemoval.clear(),this._isAnyPendingRemoval=!1}SetChanged(){this._isSorted=!1}IsEmpty(){return!this._instances.length||!(this._instances.length>this._pendingRemoval.size)&&(this._FlushPending(),!0)}Insert(e){return this._pendingRemoval.has(e)?(this._pendingRemoval.delete(e),void(0===this._pendingRemoval.size&&(this._isAnyPendingRemoval=!1))):void(this._instances.push(e),this._isSorted=1===this._instances.length)}Remove(e){this._pendingRemoval.add(e),this._isAnyPendingRemoval=!0,50<=this._pendingRemoval.size&&this._FlushPending()}_FlushPending(){return this._isAnyPendingRemoval?this._instances.length===this._pendingRemoval.size?void this.Reset():void(C3.arrayRemoveAllInSet(this._instances,this._pendingRemoval),this._pendingRemoval.clear(),this._isAnyPendingRemoval=!1):void 0}_EnsureSorted(){this._isSorted||(this._instances.sort(e),this._isSorted=!0)}Dump(e){this._FlushPending(),this._EnsureSorted(),this._instances.length&&e.push(this._instances)}}}'use strict',C3.RenderGrid=class extends C3.DefendedBase{constructor(e,t){super(),this._cellWidth=e,this._cellHeight=t,this._cells=C3.New(C3.PairMap)}Release(){this._cells.Release(),this._cells=null}GetCell(e,t,a){let n=this._cells.Get(e,t);return n?n:a?(n=C3.New(C3.RenderCell,this,e,t),this._cells.Set(e,t,n),n):null}XToCell(e){return Math.floor(e/this._cellWidth)}YToCell(e){return Math.floor(e/this._cellHeight)}Update(t,a,n){if(a)for(let r=a.getLeft(),s=a.getRight();r<=s;++r)for(let s=a.getTop(),e=a.getBottom();s<=e;++s){if(n&&n.containsPoint(r,s))continue;const e=this.GetCell(r,s,!1);e&&(e.Remove(t),e.IsEmpty()&&this._cells.Delete(r,s))}if(n)for(let r=n.getLeft(),s=n.getRight();r<=s;++r)for(let s=n.getTop(),e=n.getBottom();s<=e;++s)a&&a.containsPoint(r,s)||this.GetCell(r,s,!0).Insert(t)}QueryRange(t,e){let n=this.XToCell(t.getLeft());for(const r=this.YToCell(t.getTop()),a=this.XToCell(t.getRight()),s=this.YToCell(t.getBottom());n<=a;++n)for(let t=r;t<=s;++t){const a=this.GetCell(n,t,!1);a&&a.Dump(e)}}MarkRangeChanged(t){let n=t.getLeft();for(const r=t.getTop(),a=t.getRight(),s=t.getBottom();n<=a;++n)for(let e=r;e<=s;++e){const t=this.GetCell(n,e,!1);t&&t.SetChanged()}}},'use strict';{function t(e,t){return e.GetWorldInfo()._GetLastCachedZIndex()-t.GetWorldInfo()._GetLastCachedZIndex()}function a(e,t){return e.GetWorldInfo().GetZElevation()-t.GetWorldInfo().GetZElevation()}const n=new C3.Rect,r=new C3.Quad,s=[],l=new C3.Rect,_=new C3.Rect,u=vec3.fromValues(0,1,0);C3.Layer=class extends C3.DefendedBase{constructor(e,t,a){super(),this._layout=e,this._runtime=e.GetRuntime(),this._name=a[0],this._index=t,this._sid=a[2],this._isVisible=!!a[3],this._backgroundColor=C3.New(C3.Color),this._backgroundColor.setFromJSON(a[4].map(e=>e/255)),this._isTransparent=!!a[5],this._parallaxX=a[6],this._parallaxY=a[7],this._color=C3.New(C3.Color,1,1,1,a[8]),this._premultipliedColor=C3.New(C3.Color),this._isForceOwnTexture=a[9],this._useRenderCells=a[10],this._scaleRate=a[11],this._blendMode=a[12],this._srcBlend=0,this._destBlend=0,this._curRenderTarget=null,this._scale=1,this._zElevation=a[16],this._angle=0,this._isAngleEnabled=!0,this._viewport=C3.New(C3.Rect),this._viewportZ0=C3.New(C3.Rect),this._startupInitialInstances=[],this._initialInstances=[],this._createdGlobalUids=[],this._instances=[],this._zIndicesUpToDate=!1,this._anyInstanceZElevated=!1,this._effectList=C3.New(C3.EffectList,this,a[15]),this._renderGrid=null,this._lastRenderList=[],this._isRenderListUpToDate=!1,this._lastRenderCells=C3.New(C3.Rect,0,0,-1,-1),this._curRenderCells=C3.New(C3.Rect,0,0,-1,-1),this._iLayer=new ILayer(this),this._UpdatePremultipliedColor(),this._useRenderCells&&(this._renderGrid=C3.New(C3.RenderGrid,this._runtime.GetOriginalViewportWidth(),this._runtime.GetOriginalViewportHeight()));for(const n of a[14]){const e=this._runtime.GetObjectClassByIndex(n[1]);this._layout._AddInitialObjectClass(e),e.GetDefaultInstanceData()||(e.SetDefaultInstanceData(n),e._SetDefaultLayerIndex(this._index)),this._initialInstances.push(n)}C3.shallowAssignArray(this._startupInitialInstances,this._initialInstances)}static Create(e,t,a){return C3.New(C3.Layer,e,t,a)}Release(){this._layout=null,this._runtime=null}CreateInitialInstances(e){const t=this._layout.IsFirstVisit();let a=0;const n=this._initialInstances;for(let r=0,s=n.length;ra||(t&&this._useRenderCells&&e.GetWorldInfo()._RemoveFromRenderCells(),this._instances.splice(a,1),this.SetZIndicesChanged(),this._MaybeResetAnyInstanceZElevatedFlag())}_SetAnyInstanceZElevated(){this._anyInstanceZElevated=!0}_MaybeResetAnyInstanceZElevatedFlag(){0===this._instances.length&&(this._anyInstanceZElevated=!1)}_SortInstancesByLastCachedZIndex(e){if(e){const e=new Set;for(const t of this._instances){const a=t.GetWorldInfo()._GetLastCachedZIndex();0<=a&&e.add(a)}let t=-1;for(const a of this._instances){const n=a.GetWorldInfo();if(!(0<=n._GetLastCachedZIndex())){for(++t;e.has(t);)++t;n._SetZIndex(t)}}}this._instances.sort(t)}_Start(){this.SetBlendMode(this.GetBlendMode(),!0)}_End(){for(const e of this._instances)e.GetObjectClass().IsGlobal()||this._runtime.DestroyInstance(e);this._runtime.FlushPendingInstances(),C3.clearArray(this._instances),this._anyInstanceZElevated=!1,this.SetZIndicesChanged()}RecreateInitialObjects(t,a){const n=this._runtime.GetEventSheetManager(),r=this._runtime.GetAllObjectClasses(),s=t.IsFamily();for(const e of this._initialInstances){const l=e[0],_=l[0],d=l[1];if(!a.containsPoint(_,d))continue;const u=r[e[1]];if(u!==t)if(!s)continue;else if(!t.FamilyHasMember(u))continue;const c=this._runtime.CreateInstanceFromData(e,this,!1);if(n.BlockFlushingInstances(!0),c._TriggerOnCreated(),c.IsInContainer())for(const e of c.siblings())e._TriggerOnCreated();n.BlockFlushingInstances(!1)}}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=!1}IsVisible(){return this._isVisible}SetVisible(e){e=!!e,this._isVisible===e||(this._isVisible=e,this._runtime.UpdateRender())}GetViewport(){return this._viewport}GetViewportForZ(t,a){const n=this._viewportZ0;if(0===t)a.copy(n);else{const r=this.Get2DScaleFactorToZ(t),s=n.midX(),e=n.midY(),l=.5*n.width()/r,_=.5*n.height()/r;a.set(s-l,e-_,s+l,e+_)}}GetOpacity(){return this._color.getA()}SetOpacity(e){e=C3.clamp(e,0,1),this._color.getA()===e||(this._color.setA(e),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(e){this._scaleRate===e||(this._scaleRate=e,this._runtime.UpdateRender())}GetParallaxX(){return this._parallaxX}GetParallaxY(){return this._parallaxY}SetParallax(e,t){if((this._parallaxX!==e||this._parallaxY!==t)&&(this._parallaxX=e,this._parallaxY=t,this._runtime.UpdateRender(),1!==this._parallaxX||1!==this._parallaxY))for(const e of this._instances)e.GetObjectClass()._SetAnyInstanceParallaxed(!0)}SetParallaxX(e){this.SetParallax(e,this.GetParallaxY())}SetParallaxY(e){this.SetParallax(this.GetParallaxX(),e)}SetZElevation(e){this._zElevation=+e}GetZElevation(){return this._zElevation}SetAngle(e){this._angle=C3.clampAngle(e)}GetAngle(){return this._isAngleEnabled?C3.clampAngle(this._layout.GetAngle()+this._angle):0}GetOwnAngle(){return this._angle}HasInstances(){return 0Number.EPSILON){this._UpdateZIndices();const e=this._useRenderCells&&0===this.GetZElevation()&&!this._anyInstanceZElevated;e?this._DrawInstances_RenderCells(t):this._DrawInstances(t,this._instances)}t.SetBaseZ(0),t.SetCurrentZ(0),t.SetCameraXYZ(0,0,100),t.SetLookXYZ(0,0,0),s&&this._DrawLayerOwnTextureToRenderTarget(t,e,a,n),l&&t.EndQuery(l),this._curRenderTarget=null}_DrawInstances(t,a){const n=this._viewport,r=this._curRenderTarget;let s=null;for(let e=0,l=a.length;ethis._width-t&&(e=this._width-t),ethis._height-t&&(e=this._height-t),ee||(this._width=e)}GetHeight(){return this._height}SetHeight(e){!isFinite(e)||1>e||(this._height=e)}GetEventSheet(){return this._eventSheet}GetLayers(){return this._layers}GetLayerCount(){return this._layers.length}GetLayer(e){return'number'==typeof e?this.GetLayerByIndex(e):this.GetLayerByName(e.toString())}GetLayerByIndex(e){return e=C3.clamp(Math.floor(e),0,this._layers.length-1),this._layers[e]}GetLayerByName(e){return this._layersByName.get(e.toLowerCase())||null}GetLayerBySID(e){return this._layersBySid.get(e)||null}HasOpaqueBottomLayer(){for(const e of this._layers)if(e.ShouldDraw())return e._IsOpaque();return!1}IsFirstVisit(){return this._isFirstVisit}_GetInitialObjectClasses(){return[...this._initialObjectClasses]}_AddInitialObjectClass(e){if(e.IsInContainer())for(const t of e.GetContainer().GetObjectTypes())this._initialObjectClasses.add(t);else this._initialObjectClasses.add(e)}_GetTextureLoadedObjectTypes(){return[...this._textureLoadedTypes]}_Load(e,t){if(e===this||!t)return Promise.resolve();e&&(C3.CopySet(this._textureLoadedTypes,e._textureLoadedTypes),e._textureLoadedTypes.clear());const a=[];for(const n of this._initialObjectClasses)this._textureLoadedTypes.has(n)||(a.push(n.LoadTextures(t)),this._textureLoadedTypes.add(n));return Promise.all(a)}async MaybeLoadTexturesFor(e){if(e.IsFamily())throw new Error('cannot load textures for family');const t=this._runtime.GetWebGLRenderer();if(!(!t||t.IsContextLost()||this._textureLoadedTypes.has(e))){this._textureLoadedTypes.add(e);const a=e.LoadTextures(t);this._AddPendingTextureLoadPromise(a),await a,e.OnDynamicTextureLoadComplete(),this._runtime.UpdateRender()}}_AddPendingTextureLoadPromise(e){this._textureLoadPendingPromises.add(e),e.then(()=>this._textureLoadPendingPromises.delete(e)).catch(()=>this._textureLoadPendingPromises.delete(e))}WaitForPendingTextureLoadsToComplete(){return Promise.all([...this._textureLoadPendingPromises])}MaybeUnloadTexturesFor(e){if(e.IsFamily()||0e.PreloadTexturesWithInstances(this._runtime.GetWebGLRenderer()))),e&&(t.Dispatcher().dispatchEvent(new C3.Event('beforefirstlayoutstart')),await t.DispatchUserScriptEventAsyncWait(new C3.Event('beforeprojectstart'))),await this.DispatchUserScriptEventAsyncWait(new C3.Event('beforelayoutstart')),t.IsLoadingState()||(await t.TriggerAsync(C3.Plugins.System.Cnds.OnLayoutStart,null,null)),await this.DispatchUserScriptEventAsyncWait(new C3.Event('afterlayoutstart')),e&&(t.Dispatcher().dispatchEvent(new C3.Event('afterfirstlayoutstart')),await t.DispatchUserScriptEventAsyncWait(new C3.Event('afterprojectstart'))),n._RunQueuedTriggers(a),await this.WaitForPendingTextureLoadsToComplete(),this._isFirstVisit=!1}_MoveGlobalObjectsToThisLayout(e){for(const t of this._runtime.GetAllObjectClasses())if(!t.IsFamily()&&t.IsWorldType())for(const n of t.GetInstances()){const t=n.GetWorldInfo(),a=t.GetLayer(),r=C3.clamp(a.GetIndex(),0,this._layers.length-1),s=this._layers[r];t._SetLayer(s),s._MaybeAddInstance(n)}if(!e)for(const e of this._layers)e._SortInstancesByLastCachedZIndex(!1)}_CreateInitialInstances(){for(const e of this._layers)e.CreateInitialInstances(this._createdInstances),e.UpdateViewport(),e._Start()}_CreatePersistedInstances(){let t=!1;for(const[e,a]of Object.entries(this._persistData)){const n=this._runtime.GetObjectClassBySID(parseInt(e,10));if(n&&!n.IsFamily()&&n.HasPersistBehavior()){for(const r of a){let a=null;if(n.IsWorldType()&&(a=this.GetLayerBySID(r.w.l),!a))continue;const s=this._runtime.CreateInstanceFromData(n,a,!1,0,0,!0);s.LoadFromJson(r),t=!0,this._createdInstances.push(s)}C3.clearArray(a)}}for(const e of this._layers)e._SortInstancesByLastCachedZIndex(!0),e.SetZIndicesChanged();t&&(this._runtime.FlushPendingInstances(),this._runtime._RefreshUidMap())}_CreateAndLinkContainerInstances(t){for(const a of t){if(!a.IsInContainer())continue;const n=a.GetWorldInfo(),r=a.GetIID();for(const s of a.GetObjectClass().GetContainer().objectTypes()){if(s===a.GetObjectClass())continue;const e=s.GetInstances();if(e.length>r)a._AddSibling(e[r]);else{let e;e=n?this._runtime.CreateInstanceFromData(s,n.GetLayer(),!0,n.GetX(),n.GetY(),!0):this._runtime.CreateInstanceFromData(s,null,!0,0,0,!0),this._runtime.FlushPendingInstances(),s._UpdateIIDs(),a._AddSibling(e),t.push(e)}}}}_CreateInitialNonWorldInstances(){for(const e of this._initialNonWorld){const t=this._runtime.GetObjectClassByIndex(e[1]);t.IsInContainer()||this._runtime.CreateInstanceFromData(e,null,!0)}}_CreateGlobalNonWorlds(){const t=[],a=this._initialNonWorld;let n=0;for(let r=0,s=a.length;r=this._isEndingLayout)throw new Error('already unset');this._isEndingLayout--}}IsEndingLayout(){return 0/g;C3.TimelineManager=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e,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=!1,this._changingLayout=!1,this._isTickingTimelines=!1,this._tickFunc=()=>this._OnTick(),this._tick2Func=()=>this._OnTick2(),this._beforeLayoutChange=()=>this._OnBeforeChangeLayout(),this._layoutChange=()=>this._OnAfterChangeLayout(),this._instanceDestroy=e=>this._OnInstanceDestroy(e.instance)}Release(){this.RemoveRuntimeListeners(),this._tickFunc=null,this._tick2Func=null,this._beforeLayoutChange=null,this._layoutChange=null,this._instanceDestroy=null;for(const e of this._timelines)e.Stop(),e.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,this._runtime=null}AddRuntimeListeners(){const e=this._runtime.Dispatcher();e.addEventListener('pretick',this._tickFunc),e.addEventListener('tick2',this._tick2Func),e.addEventListener('beforelayoutchange',this._beforeLayoutChange),e.addEventListener('layoutchange',this._layoutChange),e.addEventListener('instancedestroy',this._instanceDestroy)}RemoveRuntimeListeners(){const e=this._runtime.Dispatcher();e.removeEventListener('pretick',this._tickFunc),e.removeEventListener('tick2',this._tick2Func),e.removeEventListener('beforelayoutchange',this._beforeLayoutChange),e.removeEventListener('layoutchange',this._layoutChange),e.removeEventListener('instancedestroy',this._instanceDestroy)}Create(e){this._timelineDataManager.Add(e);const t=C3.TimelineState.CreateInitial(e,this);this.Add(t),this.SetTimelineObjectClassesToMap(t),this._timelinesCreatedByTemplate.set(t.GetName(),0)}CreateFromTemplate(t){const a=this.GetTimelineDataManager(),n=t.GetTemplateName(),r=a.Get(n),s=C3.TimelineState.CreateFromTemplate(`${n}:${this._timelinesCreatedByTemplate.get(n)}`,r,this);return this._IncreaseTemplateTimelinesCount(n),this.Add(s),s}_IncreaseTemplateTimelinesCount(e){this._timelinesCreatedByTemplate.set(e,this._timelinesCreatedByTemplate.get(e)+1)}_SetCreatedTemplateTimelinesCount(){for(const e of this._timelines){if(e.IsTemplate())continue;const t=e.GetTemplateName();this._IncreaseTemplateTimelinesCount(t)}}_ClearCreatedTemplateTimelinesCount(){for(const e of this._timelinesCreatedByTemplate.keys())this._timelinesCreatedByTemplate.set(e,0)}Add(e){this._timelines.push(e),this._timelinesByName.set(e.GetName().toLowerCase(),e)}Remove(e){e.IsTemplate()||(this._RemoveFromArray(this._timelines,e),this._RemoveFromArray(this._scheduledTimelines,e),this._RemoveFromArray(this._playingTimelines,e),this._timelinesByName.delete(e.GetName().toLowerCase()),this.RemoveTimelineFromObjectClassMap(e),e.Release())}_RemoveFromArray(e,t){const a=e.indexOf(t);-1!==a&&e.splice(a,1)}Trigger(e){this._runtime.Trigger(e,this._pluginInstance,null)}GetRuntime(){return this._runtime}GetTimelineDataManager(){return this._timelineDataManager}SetPluginInstance(e){this._pluginInstance=e}GetPluginInstance(){return this._pluginInstance}*GetTimelines(){for(const e of this._timelines)yield e}SetTimelineObjectClassToMap(e,t){this._objectClassToTimelineMap.has(e)||this._objectClassToTimelineMap.set(e,new Set),this._objectClassToTimelineMap.get(e).add(t)}SetTimelineObjectClassesToMap(e){for(const t of e.GetObjectClasses())this.SetTimelineObjectClassToMap(t,e)}RemoveTimelineFromObjectClassMap(e){for(const[t,a]of this._objectClassToTimelineMap.entries())a.has(e)&&(a.delete(e),0===a.size&&this._objectClassToTimelineMap.delete(t))}GetTimelinesForObjectClass(e){return this._objectClassToTimelineMap.has(e)?this._objectClassToTimelineMap.get(e):void 0}GetTimelineOfTemplateForInstances(e,t){if(t)for(const n of this._timelines){const a=t.every(e=>n.HasTrackInstance(e.instance,e.trackId));if(a&&n.GetName().includes(e.GetName()))return n}}GetTimelineByName(e){return this._timelinesByName.get(e.toLowerCase())||null}GetScheduledOrPlayingTimelineByName(e){for(const t of this._scheduledTimelines)if(t.GetName()===e)return t;for(const t of this._playingTimelines)if(t.GetName()===e)return t;return null}*GetTimelinesByName(t){if(e.test(t)){e.lastIndex=0;let n;const r=new Set;do if(n=e.exec(t),n){const e=n[1].split(',');for(const t of e)r.add(t)}while(n);for(const e of r.values()){const t=this.GetTimelineByName(e);t&&(yield t)}r.clear()}else{const e=this.GetTimelineByName(t);e&&(yield e)}}*GetTimelinesByTags(e){for(const t of this._timelines)t.HasTags(e)&&(yield t)}AddScheduledTimeline(e){this._scheduledTimelines.includes(e)||this._scheduledTimelines.push(e),this._MaybeEnableRuntimeListeners()}RemovePlayingTimeline(e){this._RemoveFromArray(this._playingTimelines,e),this._MaybeDisableRuntimeListeners()}ScheduleTimeline(e){e.SetPlaying(!1),e.SetScheduled(!0),e.SetMarkedForRemoval(!1),this._scheduledTimelines.includes(e)||this._scheduledTimelines.push(e),this._MaybeEnableRuntimeListeners()}DeScheduleTimeline(e){e.SetPlaying(!1),e.SetScheduled(!1),e.ResolvePlayPromise(),this._RemoveFromArray(this._scheduledTimelines,e),this._MaybeDisableRuntimeListeners()}CompleteTimeline(e){e.SetPlaying(!1),e.SetScheduled(!1),e.SetMarkedForRemoval(!0)}CompleteTimelineAndResolve(e){this.CompleteTimeline(e),e.ResolvePlayPromise()}_OnTick(){if(!this._hasRuntimeListeners)return;if(this._changingLayout)return;let t=!1;for(this._isTickingTimelines=!0;this._scheduledTimelines.length;){const e=this._scheduledTimelines.pop();e.SetInitialState(),this._playingTimelines.push(e)}const n=this._runtime.GetDt(),r=this._runtime.GetTimeScale();for(const a of this._playingTimelines){if(a.IsMarkedForRemoval())continue;const s=a.Tick(n,r);!t&&s&&(t=!0)}this._isTickingTimelines=!1,t&&this.GetRuntime().UpdateRender()}_OnTick2(){if(this._hasRuntimeListeners){for(const e of this._playingTimelines)e.IsMarkedForRemoval()&&(this._MaybeExecuteTimelineFinishTriggers(e),this._RemoveFromArray(this._playingTimelines,e));this._MaybeDisableRuntimeListeners()}}_MaybeExecuteTimelineFinishTriggers(e){e.IsReleased()||!e.HasValidTracks()||e.IsComplete()&&e.InitialStateSet()&&e.FinishTriggers()}_MaybeEnableRuntimeListeners(){this._hasRuntimeListeners||(this._hasRuntimeListeners=!0)}_MaybeDisableRuntimeListeners(){this._playingTimelines.length||this._scheduledTimelines.length||this._isTickingTimelines||(this._hasRuntimeListeners=!1)}_OnBeforeChangeLayout(){for(this._changingLayout=!0;this._scheduledTimelines.length;)this.DeScheduleTimeline(this._scheduledTimelines.pop());for(;this._playingTimelines.length;){const e=this._playingTimelines.pop();e.IsReleased()||(this.CompleteTimeline(e),e.Reset(!1))}this._MaybeDisableRuntimeListeners();for(const e of this._timelines)e.CleanCaches()}_OnAfterChangeLayout(){this._changingLayout=!1}_OnInstanceDestroy(e){const t=e.GetObjectClass(),n=this.GetTimelinesForObjectClass(t);if(n)for(const e of n)e.IsTemplate()||e.HasValidTracks()||(this._MaybeExecuteTimelineFinishTriggers(e),this.Remove(e))}_SaveToJson(){return{timelinesJson:this._SaveTimelinesToJson(),scheduledTimelinesJson:this._SaveScheduledTimelinesToJson(),playingTimelinesJson:this._SavePlayingTimelinesToJson(),hasRuntimeListeners:this._hasRuntimeListeners,changingLayout:this._changingLayout,isTickingTimelines:this._isTickingTimelines}}_LoadFromJson(e){e&&(this._ClearCreatedTemplateTimelinesCount(),this._LoadTimelinesFromJson(e.timelinesJson),this._LoadScheduledTimelinesFromJson(e.scheduledTimelinesJson),this._LoadPlayingTimelinesFromJson(e.playingTimelinesJson),this._hasRuntimeListeners=!e.hasRuntimeListeners,this._changingLayout=!!e.changingLayout,this._isTickingTimelines=!!e.isTickingTimelines,this._SetCreatedTemplateTimelinesCount(),this._MaybeEnableRuntimeListeners(),this._MaybeDisableRuntimeListeners())}_SaveTimelinesToJson(){return this._timelines.map(e=>e._SaveToJson())}_LoadTimelinesFromJson(e){for(const t of e){let e=this.GetTimelineByName(t.name);if(e)e._LoadFromJson(t);else{const a=this._GetTemplateNameFromJson(t);if(!a)continue;const n=this.GetTimelineByName(a);e=this.CreateFromTemplate(n),e._LoadFromJson(t)}e.HasTracks()||this.Remove(e)}}_GetTemplateNameFromJson(e){const t=e.name,a=t.split(':');return a&&2===a.length?a[0]:null}_SaveScheduledTimelinesToJson(){return this._SaveTimelines(this._scheduledTimelines)}_LoadScheduledTimelinesFromJson(e){this._LoadTimelines(e,this._scheduledTimelines)}_SavePlayingTimelinesToJson(){return this._SaveTimelines(this._playingTimelines)}_LoadPlayingTimelinesFromJson(e){this._LoadTimelines(e,this._playingTimelines)}_IsTimelineInJson(e,t){for(const a of t)if(a===e.GetName())return!0;return!1}_SaveTimelines(e){return e.map(e=>e.GetName())}_LoadTimelines(e,t){const n=e=>t=>t.GetName()===e;for(const a of t)this._IsTimelineInJson(a,e)||this._RemoveFromArray(t,a);for(const r of e){const s=this.GetTimelineByName(r);if(s){const a=t.find(n(r));a||t.push(s)}}}}}{const e=0;C3.TimelineState=class extends C3.DefendedBase{constructor(t,a,n){super(),this._runtime=n.GetRuntime(),this._timelineManager=n,this._timelineDataItem=a,this._name=t,this._tracks=[];for(const e of this._timelineDataItem.GetTrackData().trackDataItems())this._tracks.push(C3.TrackState.Create(this,e));this._playPromise=null,this._playResolve=null,this._playheadTime=C3.New(C3.KahanSum),this._playheadTime.Set(0),this._playbackRate=1,this._pingPongState=e,this._currentRepeatCount=1,this._isPlaying=!1,this._isScheduled=!1,this._initialStateSet=!1,this._complete=!0,this._released=!1,this._markedForRemoval=!1,this._completedTick=-1,this._implicitPause=!1,this._isTemplate=!1,this._finishedTriggers=!1,this._tags=[''],this._stringTags='',this._tagsChanged=!1}static CreateInitial(t,a){const n=a.GetTimelineDataManager(),r=n.GetNameId(),s=n.Get(t[r]),e=C3.New(C3.TimelineState,t[r],s,a);return e.SetIsTemplate(!0),e}static CreateFromTemplate(e,t,a){return C3.New(C3.TimelineState,e,t,a)}static get WORLD_INSTANCE_BOX_CHANGE(){return 1}static get LAYOUT_RENDER_CHANGE(){return C3.nextHighestPowerOfTwo(1)}Release(){if(!this.IsReleased()){this._timelineManager.DeScheduleTimeline(this),this._timelineManager.CompleteTimelineAndResolve(this);for(const e of this._tracks)e.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=!0,this._playPromise=null,this._playResolve=null}}GetTimelineManager(){return this._timelineManager}GetRuntime(){return this._runtime}GetTracks(){return this._tracks}HasTracks(){return!!this._tracks.length}GetTrackById(e){for(const t of this._tracks)if(C3.equalsNoCase(t.GetId(),e))return t;return null}SetName(e){this._name=e}GetName(){return this._name}GetTimelineDataItem(){return this._timelineDataItem}GetTemplateName(){return this._timelineDataItem.GetName()}GetTotalTime(){return this._timelineDataItem.GetTotalTime()}SetTotalTime(e){this._timelineDataItem.SetTotalTime(e)}GetStep(){return this._timelineDataItem.GetStep()}SetStep(e){this._timelineDataItem.SetStep(e)}GetInterpolationMode(){return this._timelineDataItem.GetInterpolationMode()}SetInterpolationMode(e){this._timelineDataItem.SetInterpolationMode(e)}GetResultMode(){return this._timelineDataItem.GetResultMode()}SetResultMode(e){this._timelineDataItem.GetResultMode(e)}SetEase(e){for(const t of this.GetTracks())t.SetEase(e)}GetLoop(){return this._timelineDataItem.GetLoop()}GetPingPong(){return this._timelineDataItem.GetPingPong()}GetRepeatCount(){return this._timelineDataItem.GetRepeatCount()}SetPlaybackRate(e){return this._playbackRate=e}GetPlaybackRate(){return this._playbackRate}IsForwardPlayBack(){return!this.IsPlaying()||0{this._playResolve=e}),this._playPromise)}ResolvePlayPromise(){this._playPromise&&(this._playResolve(),this._playPromise=null,this._playResolve=null)}SetTags(e){this._tags=C3.TimelineState._GetTagArray(e),this._tagsChanged=!0}GetTags(){return this._tags}GetStringTags(){return this._tagsChanged&&(this._stringTags=this._tags.join(' ')),this._tagsChanged=!1,this._stringTags}HasTags(e){if(!this._tags)return!1;if(!this._tags.length)return!1;const t=C3.TimelineState._GetTagArray(e);return!!t&&!!t.length&&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(){this._finishedTriggers||(this._finishedTriggers=!0,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(e){this._isPlaying=e}IsCompletedTick(){return this._completedTick===this._runtime.GetTickCount()}IsPlaying(){return!!this.IsCompletedTick()||this._isPlaying}SetScheduled(e){this._isScheduled=e}IsScheduled(){return this._isScheduled}SetComplete(e){this._complete=e;const t=this.GetTime();(0>=t||t>=this.GetTotalTime())&&(this._complete=!0)}IsComplete(){return this._complete}IsReleased(){return this._released}SetMarkedForRemoval(e){this._markedForRemoval=e}IsMarkedForRemoval(){return this._markedForRemoval}SetImplicitPause(e){this._implicitPause=e}IsImplicitPause(){return this._implicitPause}SetIsTemplate(e){this._isTemplate=!!e}IsTemplate(){return this._isTemplate}InitialStateSet(){return this._initialStateSet}GetTime(){return this._playheadTime.Get()}SetTime(e){this._SetTime(e),this.SetComplete(!1),this.IsComplete()||this.SetImplicitPause(!0),(this.IsPlaying()||this.IsScheduled()||!this._initialStateSet)&&(this.IsPlaying()||this.IsScheduled()||this._initialStateSet?this.IsPlaying()?this.Stop():this.IsScheduled()&&(this._timelineManager.DeScheduleTimeline(this),this.SetInitialStateFromSetTime()):this.SetInitialStateFromSetTime());let t=!1;for(const n of this._tracks){n.SetResumeState();const e=n.Interpolate(this._playheadTime.Get(),!1,!0);!t&&e&&(t=!0)}t&&this.GetRuntime().UpdateRender(),this._OnSetTime()}_SetTime(e){0>e?this._playheadTime.Set(0):e>=this.GetTotalTime()?this._playheadTime.Set(this.GetTotalTime()):this._playheadTime.Set(e)}_OnSetTime(){C3.Plugins.Timeline&&this.constructor===C3.TimelineState&&(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))}Resume(){if(!this.IsReleased()){if(this.IsForwardPlayBack()){if(this._playheadTime.Get()>=this.GetTotalTime())return;}else if(0>=this._playheadTime.Get())return;this.Play(!0)}}Play(e=!1){return!this.IsReleased()&&!this.IsScheduled()&&(this.IsPlaying()&&this.IsCompletedTick()?this._SchedulePlayingTimeline():!this.IsPlaying()&&!!(this.IsComplete()||e||this.IsImplicitPause())&&this._ScheduleStoppedTimeline())}_SchedulePlayingTimeline(){return this.SetImplicitPause(!1),this._timelineManager.RemovePlayingTimeline(this),this._timelineManager.ScheduleTimeline(this),this.GetPlayPromise(),!0}_ScheduleStoppedTimeline(){return this.SetImplicitPause(!1),this._timelineManager.ScheduleTimeline(this),this.GetPlayPromise(),!0}Stop(e=!1){this.IsReleased()||(this.SetComplete(e),this._timelineManager.CompleteTimeline(this),this.IsComplete()&&this.ResolvePlayPromise())}Reset(e=!0){if(this.IsReleased())return;if(!this.IsPlaying()&&this.IsScheduled())return this._timelineManager.DeScheduleTimeline(this);if(this.IsComplete())return;this.Stop(!0),this.IsForwardPlayBack()?this._SetTime(0):this._SetTime(this.GetTotalTime());let t=!1;for(const n of this._tracks){const e=n.Interpolate(this._playheadTime.Get());!t&&e&&(t=!0)}e&&this._OnSetTime(),t&&e&&this.GetRuntime().UpdateRender()}SetInitialStateFromSetTime(){this.SetInitialState(!0)}SetInitialState(t){if(!this.IsMarkedForRemoval())if(t){this._initialStateSet=!0;for(const e of this._tracks)e.SetInitialState()}else if(this.SetPlaying(!0),this.SetScheduled(!1),this.OnStarted(),this.IsComplete()){this._completedTick=-1,this._pingPongState=e,this._currentRepeatCount=1,this._complete=!1,this._finishedTriggers=!1,this._initialStateSet=!0,this.IsForwardPlayBack()?this._SetTime(0):this._SetTime(this.GetTotalTime());for(const e of this._tracks)e.SetInitialState()}else for(const e of this._tracks)e.SetResumeState()}Tick(e,t){this._playheadTime.Add(e*t*this._playbackRate);let a;if(this.GetLoop()||this.GetPingPong()?this.GetLoop()&&!this.GetPingPong()?a=this._LoopCompleteCheck():!this.GetLoop()&&this.GetPingPong()?a=this._PingPongCompleteCheck():this.GetLoop()&&this.GetPingPong()&&(a=this._LoopPingPongCompleteCheck()):a=this._SimpleCompleteCheck(),a){for(const e of this._tracks)e.SetEndState();return this.Stop(!0),this.OnCompleted(),!0}else{let e=!1;for(const t of this._tracks){const a=t.Interpolate(this._playheadTime.Get(),!0);!e&&a&&(e=!0)}return e}}_SimpleCompleteCheck(){if(this.IsForwardPlayBack()){if(this._playheadTime.Get()>=this.GetTotalTime())if(this._currentRepeatCount=this._playheadTime.Get())if(this._currentRepeatCount=this.GetTotalTime()&&this._SetTime(0):0>=this._playheadTime.Get()&&this._SetTime(this.GetTotalTime()),!1}_PingPongCompleteCheck(){if(this.IsForwardPlayBack()){if(this._playheadTime.Get()>=this.GetTotalTime())if(this._SetTime(this.GetTotalTime()),this.SetPlaybackRate(-1*this.GetPlaybackRate()),1!==this._pingPongState)this._pingPongState===e&&(this._pingPongState=1);else if(this._currentRepeatCount=this._playheadTime.Get())if(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate()),1!==this._pingPongState)this._pingPongState===e&&(this._pingPongState=1);else if(this._currentRepeatCount=this.GetTotalTime()&&(this._SetTime(this.GetTotalTime()),this.SetPlaybackRate(-1*this.GetPlaybackRate())):0>=this._playheadTime.Get()&&(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate())),!1}AddTrack(){const e=this._timelineDataItem.GetTrackData().AddEmptyTrackDataItem(),t=C3.TrackState.Create(this,e);return this._tracks.push(t),t}CleanCaches(){for(const e of this._tracks)e.CleanCaches()}ClearTrackInstances(){for(const e of this._tracks)e.ClearInstance()}SetTrackInstance(e,t){if(t)for(const a of this._tracks)if(e){if(a.GetId()!==e)continue;a.SetInstance(t),this._timelineManager.SetTimelineObjectClassToMap(t.GetObjectClass(),this);break}else{if(a.HasInstance())continue;a.SetInstance(t),this._timelineManager.SetTimelineObjectClassToMap(t.GetObjectClass(),this);break}}HasTrackInstance(e,t){for(const a of this._tracks)if(t){if(t===a.GetId()&&e===a.GetInstance())return!0;}else if(e===a.GetInstance())return!0;return!1}HasValidTracks(){return this._tracks.some(e=>e.CanInstanceBeValid())}GetPropertyTrack(e){for(const t of this.GetTracks())for(const a of t.GetPropertyTracks())if(a.GetPropertyName()===e)return a}GetKeyframeWithTags(e){let t=e?e.split(' '):[];const a=new Set(t.map(e=>e.toLowerCase().trim()));t=[...a.values()];for(const n of this.GetTracks())for(const e of n.GetKeyframeDataItems()){const a=t.every(t=>e.HasTag(t));if(a)return e}}GetObjectClasses(){const e=[];for(const t of this.GetTracks())e.push(t.GetObjectClass());return e.filter(e=>e)}_SaveToJson(){return{tracksJson:this._SaveTracksToJson(),name:this._name,playheadTime:this._playheadTime.Get(),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}}_LoadFromJson(e){e&&(this._LoadTracksFromJson(e.tracksJson),this._name=e.name,this._playheadTime.Set(e.playheadTime),this._playbackRate=e.playbackRate,this._pingPongState=e.pingPongState,this._currentRepeatCount=e.currentRepeatCount,this._isPlaying=!!e.isPlaying,this._isScheduled=!!e.isScheduled,this._initialStateSet=!!e.initialStateSet,this._finishedTriggers=!!e.hasOwnProperty('finishedTriggers')&&!!e.finishedTriggers,this._complete=!!e.complete,this._released=!!e.released,this._markedForRemoval=!!e.markedForRemoval,this._completedTick=e.completedTick,this._implicitPause=!!e.implicitPause,this._isTemplate=!!e.isTemplate,this._tags=e.tags.split(' '),this._stringTags=e.stringTags,this._tagsChanged=!!e.tagsChanged)}_SaveTracksToJson(){return this._tracks.map(e=>e._SaveToJson())}_LoadTracksFromJson(e){e.forEach((e,t)=>{const a=this._tracks[t];a._LoadFromJson(e)}),this._tracks.filter(e=>e.CanInstanceBeValid())}static _HasTag(e){const t=this.GetTags();return''===e?1===t.length&&''===t[0]:t.includes(e)}static _GetTagArray(e){return C3.IsArray(e)?e.slice(0):C3.IsString(e)?e.split(' '):void 0}}}'use strict',C3.TrackState=class extends C3.DefendedBase{constructor(e,t){super(),this._timeline=e,this._trackDataItem=t,this._trackData=t.GetTrackData(),this._instanceUid=NaN,this._objectClassIndex=NaN,this._instance=null,this._worldInfo=null,this._lastKeyframeDataItem=null,this._keyframeDataItems=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemArray(),this._propertyTracks=[];for(const a of this._trackDataItem.GetPropertyTrackData().propertyTrackDataItems())this._propertyTracks.push(C3.PropertyTrackState.Create(this,a))}static Create(e,t){return C3.New(C3.TrackState,e,t)}Release(){this._keyframeDataItems=null;for(const e of this._propertyTracks)e.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 e of this._propertyTracks)e.CleanCaches();this._instance=null,this._worldInfo=null}GetTimeline(){return this._timeline}GetRuntime(){return this._timeline.GetRuntime()}GetKeyframeDataItems(){return this._keyframeDataItems?this._keyframeDataItems:(this._keyframeDataItems=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemArray(),this._keyframeDataItems)}GetPropertyTracks(){return this._propertyTracks}GetPropertyTrack(e){for(const t of this._propertyTracks)if(t.GetPropertyName()===e)return t}MaybeGetInstance(){this._instance||this.GetInstance()}IsInstanceValid(){return!!this._instance&&!this._instance.IsDestroyed()}CanInstanceBeValid(){const e=this.GetInstanceUID(),t=this.GetRuntime().GetInstanceByUID(e);return!!t&&!t.IsDestroyed()}GetObjectClass(){const e=this.GetObjectClassIndex();return-1===e?void 0:this.GetRuntime().GetObjectClassByIndex(e)}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 e=this.GetInstanceUID();return this._instance=this.GetRuntime().GetInstanceByUID(e),this._instance}SetInstance(e){if(this._instance!==e){this.CleanCaches(),this._instance=e,this._objectClassIndex=e.GetObjectClass().GetIndex(),this._instanceUid=e.GetUID(),this._worldInfo=e.GetWorldInfo();for(const t of this.propertyTrackItems()){const e=t.propertyTrack,n=t.sourceAdapter,a=e.GetSourceAdapterId();switch(a){case'instance-variable':{const a=n.GetEditorIndex(),r=inst.GetObjectClass(),s=r.GetInstanceVariableIndexByName(t.name),e=r.GetInstanceVariableName(s),l=r.GetInstanceVariableType(s);e===t.name&&l===t.type&&n.UpdateInstanceVariableIndex(s);break}case'behavior':{const r=t.behaviorType,s=this.GetObjectClass(),l=inst.GetObjectClass(),e=n.GetBehaviorType(l);if(r&&e){const t=r.GetName(),a=s.GetBehaviorIndexByName(t),_=l.GetBehaviorIndexByName(t),d=n.GetEditorIndex();n.UpdateBehaviorTypeSid(e.GetSID())}break}}}}}*propertyTrackItems(){for(const e of this._propertyTracks){const t=e.GetSourceAdapter(),n=this.GetObjectClass(),r={propertyTrack:e,sourceAdapter:t};switch(e.GetSourceAdapterId()){case'world-instance':{r.property=e.GetPropertyName();break}case'instance-variable':{const e=t.GetEditorIndex();r.name=n.GetInstanceVariableName(e),r.type=n.GetInstanceVariableType(e);break}case'effect':{const s=n.GetEffectList(),a=t.GetEffectType(s);r.effectType=a;break}case'behavior':{const e=t.GetBehaviorType(n);r.behaviorType=e;break}case'plugin':{r.plugin=n.GetPlugin();break}}yield r}}GetWorldInfo(){if(this._worldInfo&&this.IsInstanceValid())return this._worldInfo;const e=this.GetInstance();return e&&(this._worldInfo=e.GetWorldInfo()),this._worldInfo}GetTrackDataItem(){return this._trackDataItem}GetInstanceUID(){return this._instanceUid?this._instanceUid:this._trackDataItem.GetInstanceUID()}SetInstanceUID(e){this._trackDataItem.SetInstanceUID(e)}GetInterpolationMode(){return this._trackDataItem.GetInterpolationMode()}SetInterpolationMode(e){this._trackDataItem.SetInterpolationMode(e)}GetResultMode(){return this._trackDataItem.GetResultMode()}GetId(){return this._trackDataItem.GetId()}SetResultMode(e){this._trackDataItem.SetResultMode(e)}SetEase(e){for(const t of this.GetKeyframeDataItems())t.SetEase(e);for(const t of this.GetPropertyTracks())t.SetEase(e)}GetEnable(){return this._trackDataItem.GetEnable()}SetEnable(e){this._trackDataItem.SetEnable(e)}GetObjectClassIndex(){return isNaN(this._objectClassIndex)?this._trackDataItem.GetObjectClassIndex():this._objectClassIndex}SetObjectClassIndex(e){this._trackDataItem.SetObjectClassIndex(e)}SetInitialState(){if(this.MaybeGetInstance(),!!this.IsInstanceValid()){for(const e of this._propertyTracks)e.SetInitialState();const e=this.GetTimeline(),t=e.IsForwardPlayBack(),a=e.GetTotalTime(),n=t?0:a;this._lastKeyframeDataItem=this._trackData.GetKeyFrameDataItemAtTime(n,this._trackDataItem),this.Interpolate(n)}}SetResumeState(){if(this.MaybeGetInstance(),!!this.IsInstanceValid()){const e=this._timeline.IsForwardPlayBack(),t=this._timeline.GetTime();this._timeline.IsForwardPlayBack()?this._lastKeyframeDataItem=this._trackData.GetFirstKeyFrameDataItemLowerOrEqualThan(t,this._trackDataItem):(this._lastKeyframeDataItem=this._trackData.GetFirstKeyFrameDataItemHigherOrEqualThan(t,this._trackDataItem),!this._lastKeyframeDataItem&&(this._lastKeyframeDataItem=this._trackData.GetLastKeyframeDataItem(this._trackDataItem)));for(const e of this._propertyTracks)e.SetResumeState()}}SetEndState(){if(!this.GetTimeline().IsComplete()&&(this.MaybeGetInstance(),!!this.IsInstanceValid())){const e=this._timeline.GetTime(),t=this._timeline.GetTotalTime();e>=t?this.Interpolate(t,!0):0>=e&&this.Interpolate(0,!0)}}Interpolate(t,a=!1,n=!1){if(this.MaybeGetInstance(),!this.IsInstanceValid())return!1;this._lastKeyframeDataItem=this.MaybeTriggerKeyframeReachedConditions(t,a);let r=!1,s=!1;for(const e of this._propertyTracks){const a=e.Interpolate(t,n);r||0==(a&C3.TimelineState.WORLD_INSTANCE_BOX_CHANGE)||(r=!0),s||0==(a&C3.TimelineState.LAYOUT_RENDER_CHANGE)||(s=!0)}if(r){const e=this.GetWorldInfo();e&&e.SetBboxChanged()}return s}MaybeTriggerKeyframeReachedConditions(e,t){if(!t)return;const a=this.GetTimeline();let n=this._trackData.GetKeyFrameDataItemAtTime(e,this._trackDataItem);return n?this.OnKeyframeReached(n):(n=a.IsForwardPlayBack()?this._trackData.GetFirstKeyFrameDataItemLowerOrEqualThan(e,this._trackDataItem):this._trackData.GetFirstKeyFrameDataItemHigherOrEqualThan(e,this._trackDataItem),n!==this._lastKeyframeDataItem&&this.OnKeyframeReached(n)),n}OnKeyframeReached(e){if(C3.Plugins.Timeline&&this.GetTimeline().constructor===C3.TimelineState){const t=this.GetTimeline();C3.Plugins.Timeline.Cnds.SetTriggerTimeline(t),C3.Plugins.Timeline.Cnds.SetTriggerKeyframe(e);const a=t.GetTimelineManager();a.Trigger(C3.Plugins.Timeline.Cnds.OnAnyKeyframeReached),a.Trigger(C3.Plugins.Timeline.Cnds.OnKeyframeReached),C3.Plugins.Timeline.Cnds.SetTriggerTimeline(null),C3.Plugins.Timeline.Cnds.SetTriggerKeyframe(null)}}AddKeyframe(){const e=this._trackDataItem.GetKeyframeData(),t=e.AddEmptyKeyframeDataItem();return t}AddPropertyTrack(){const e=this._trackDataItem.GetPropertyTrackData(),t=e.AddEmptyPropertyTrackDataItem(),a=C3.PropertyTrackState.Create(this,t);return this._propertyTracks.push(a),a}DeleteKeyframes(e){const t=this._trackDataItem.GetKeyframeData();t.DeleteKeyframeDataItems(e)}DeletePropertyKeyframes(e){for(const t of this._propertyTracks)t.DeletePropertyKeyframes(e)}SaveState(){for(const e of this._propertyTracks)e.SaveState()}CompareInitialStateWithCurrent(){if(this.MaybeGetInstance(),!!this.IsInstanceValid())for(const e of this._propertyTracks)e.CompareInitialStateWithCurrent()}CompareSaveStateWithCurrent(){if(this.MaybeGetInstance(),!this.IsInstanceValid())return;let e=!1;for(const t of this._propertyTracks){const a=t.CompareSaveStateWithCurrent();!e&&a&&(e=!0)}if(e){const e=this.AddKeyframe();e.SetTime(this.GetTimeline().GetTime()),e.SetEase('noease'),e.SetEnable(!0),e.SetTags('')}}_SaveToJson(){return{propertyTracksJson:this._SavePropertyTracksToJson(),lastKeyframeDataItemJson:this._SaveLastKeyframeDataItemToJson(),instanceUid:this._instanceUid}}_LoadFromJson(e){e&&(this._LoadPropertyTracksFromJson(e.propertyTracksJson),this._LoadLastKeyframeDataItemFromJson(e.lastKeyframeDataItemJson),this._LoadInstanceFromJson(e.instanceUid))}_SaveLastKeyframeDataItemToJson(){const e=this._trackDataItem.GetKeyframeData();return e.GetKeyframeDataItemIndex(this._lastKeyframeDataItem)}_SavePropertyTracksToJson(){return this._propertyTracks.map(e=>e._SaveToJson())}_LoadPropertyTracksFromJson(e){e.forEach((e,t)=>{const a=this._propertyTracks[t];a._LoadFromJson(e)})}_LoadInstanceFromJson(e){if(C3.IsFiniteNumber(e)){const t=this.GetRuntime().GetInstanceByUID(e);if(t){const e=this.GetTimeline();e.ClearTrackInstances(),e.SetTrackInstance(this._trackDataItem.GetId(),t)}}}_LoadLastKeyframeDataItemFromJson(e){const t=this._trackDataItem.GetKeyframeData();this._lastKeyframeDataItem=t.GetKeyframeDataItemFromIndex(e)}},'use strict',C3.PropertyTrackState=class extends C3.DefendedBase{constructor(e,t){super(),this._track=e,this._propertyTrackDataItem=t,this._propertyTrackData=t.GetPropertyTrackData(),this._sourceAdapter=this.GetSourceAdapter(),this._propertyKeyframeDataItems=this._propertyTrackDataItem.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray()}static Create(e,t){return C3.New(C3.PropertyTrackState,e,t)}Release(){this._track=null,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()}GetSourceAdapter(){if(this._sourceAdapter)return this._sourceAdapter;const e=this._propertyTrackDataItem.GetSourceAdapterId();let t;return'behavior'===e?t=new C3.PropertyTrackState.BehaviorSourceAdapter(this):'effect'===e?t=new C3.PropertyTrackState.EffectSourceAdapter(this):'instance-variable'===e?t=new C3.PropertyTrackState.InstanceVariableSourceAdapter(this):'plugin'===e?t=new C3.PropertyTrackState.PluginSourceAdapter(this):'world-instance'===e?t=new C3.PropertyTrackState.WorldInstanceSourceAdapter(this):'value'===e?t=new C3.PropertyTrackState.ValueSourceAdapter(this):void 0,this._sourceAdapter=t,this._sourceAdapter}GetSourceAdapterId(){return this._propertyTrackDataItem.GetSourceAdapterId()}SetSourceAdapterId(e){this._propertyTrackDataItem.SetSourceAdapterId(e)}GetSourceAdapterArgs(){return this._propertyTrackDataItem.GetSourceAdapterArguments()}SetSourceAdapterArgs(e){this._propertyTrackDataItem.SetSourceAdapterArguments(e)}GetSourceAdapterValue(){return this.GetSourceAdapter().GetValue()}GetPropertyName(){return this._propertyTrackDataItem.GetProperty()}SetPropertyName(e){this._propertyTrackDataItem.SetProperty(e)}GetPropertyType(){return this._propertyTrackDataItem.GetType()}SetPropertyType(e){this._propertyTrackDataItem.SetType(e)}GetPropertyKeyframeType(){return this.GetPropertyTrackData().GetFirstPropertyKeyframeDataItem(this._propertyTrackDataItem).GetType()}GetMin(){return this._propertyTrackDataItem.GetMin()}SetMin(e){this._propertyTrackDataItem.SetMin(e)}GetMax(){return this._propertyTrackDataItem.GetMax()}SetMax(e){this._propertyTrackDataItem.SetMax(e)}GetEnable(){return this._propertyTrackDataItem.GetEnable()}SetEnable(e){this._propertyTrackDataItem.SetEnable(e)}GetInterpolationMode(){return this._propertyTrackDataItem.GetInterpolationMode()}SetInterpolationMode(e){this._propertyTrackDataItem.SetInterpolationMode(e)}GetResultMode(){return this._propertyTrackDataItem.GetResultMode()}SetResultMode(e){this._propertyTrackDataItem.SetResultMode(e)}SetEase(e){for(const t of this.GetPropertyKeyframeDataItems())t.SetEase(e)}GetPropertyKeyframeDataItems(){return this._propertyKeyframeDataItems?this._propertyKeyframeDataItems:(this._propertyKeyframeDataItems=this._propertyTrackDataItem.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray(),this._propertyKeyframeDataItems)}*GetPropertyKeyframeValues(){for(const e of this.GetPropertyKeyframeDataItems())yield e.GetValueWithResultMode()}CleanCaches(){this.GetSourceAdapter().CleanCaches()}GetCurrentState(){return this.GetSourceAdapter().GetCurrentState()}SetInitialState(){this.GetSourceAdapter().SetInitialState()}SetResumeState(){this.GetSourceAdapter().SetResumeState()}Interpolate(t,a=!1){const n=this._propertyTrackDataItem;let r=this._propertyTrackData.GetPropertyKeyFrameDataItemAtTime(t,n),s;return r?s=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherThan(t,n):(r=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(t,n),s=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(t,n)),this.GetSourceAdapter().Interpolate(t,r,s,a)}static GetStartPropertyKeyframeForTime(t,a){const n=a.GetPropertyTrackDataItem(),r=a._propertyTrackData;let s=r.GetPropertyKeyFrameDataItemAtTime(t,n);return s||(s=r.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(t,n)),s}static GetEndPropertyKeyframeForTime(t,a){const n=a.GetPropertyTrackDataItem(),r=a._propertyTrackData;let s=r.GetPropertyKeyFrameDataItemAtTime(t,n);return s?r.GetFirstPropertyKeyFrameDataItemHigherThan(t,n):r.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(t,n)}AddPropertyKeyframe(){const e=this._propertyTrackDataItem.GetPropertyKeyframeData(),t=e.AddEmptyPropertyKeyframeDataItem();return t}DeletePropertyKeyframes(e){const t=this._propertyTrackDataItem.GetPropertyKeyframeData();t.DeletePropertyKeyframeDataItems(e)}SaveState(){this.GetSourceAdapter().SaveState()}CompareInitialStateWithCurrent(){const e=this.GetSourceAdapter().CompareInitialStateWithCurrent();if(e){const e=this._propertyTrackData.GetFirstPropertyKeyframeDataItem(this._propertyTrackDataItem),t=this.GetSourceAdapter().GetCurrentState();e.SetAbsoluteValue(t)}}CompareSaveStateWithCurrent(){const e=this.GetSourceAdapter().CompareSaveStateWithCurrent();return e&&this.AddPropertyKeyframeAtCurrentTime(),this.GetSourceAdapter().ClearSaveState(),e}AddPropertyKeyframeAtCurrentTime(){const e=this.GetTimeline().GetTime(),t=this.GetSourceAdapter(),a=C3.PropertyTrackState.GetStartPropertyKeyframeForTime(e,this),n=this.AddPropertyKeyframe();n.SetType(a.GetType()),n.SetTime(e),n.SetEase(a.GetEase()),n.SetEnable(!0),n.SetValue(t.GetValueAtTime()),n.SetAbsoluteValue(t.GetCurrentState())}_SaveToJson(){return{sourceAdapterJson:this.GetSourceAdapter()._SaveToJson()}}_LoadFromJson(e){e&&this.GetSourceAdapter()._LoadFromJson(e.sourceAdapterJson)}},'use strict';{const t=C3.PropertyTrackState;t.PropertySourceAdapter=class{constructor(e){this._propertyTrack=e,this._propertyAdapter=null}Release(){this._propertyAdapter&&(this._propertyAdapter.Release(),this._propertyAdapter=null),this._propertyTrack=null}GetPropertyTrack(){return this._propertyTrack}CleanCaches(){this._propertyAdapter&&this._propertyAdapter.CleanCaches()}GetPropertyAdapter(){return this._propertyAdapter?this._propertyAdapter:(this._propertyAdapter=this._CreatePropertyAdapter(),this._propertyAdapter)}GetEditorIndex(){}GetIndex(){return this.GetEditorIndex()}GetTarget(){}SetInitialState(){this.GetPropertyAdapter().SetInitialState()}SetResumeState(){this.GetPropertyAdapter().SetResumeState()}Interpolate(a,n,r,s){const e=t.PropertySourceAdapter.GetInterpolateFunc(this._propertyTrack),l=e(a,n,r,this._propertyTrack);return this.GetPropertyAdapter().ChangeProperty(a,l,n,r,s)}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 t.PropertySourceAdapter.GetValueAtTime(this._propertyTrack)}_CreatePropertyAdapter(){const e=this._propertyTrack.GetPropertyType(),a=this._propertyTrack.GetPropertyKeyframeType();return'combo'===a||'boolean'===a||'text'===a||'string'===a?new t.PropertyInterpolationAdapter.NoInterpolationAdapter(this):'numeric'===a||'number'===a||'angle'===a?'combo'===e?new t.PropertyInterpolationAdapter.NoInterpolationAdapter(this):new t.PropertyInterpolationAdapter.NumericInterpolationAdapter(this):'color'===a||'offsetColor'===a?new t.PropertyInterpolationAdapter.ColorInterpolationAdapter(this):void 0}_SaveToJson(){return{propertyAdapterJson:this.GetPropertyAdapter()._SaveToJson()}}_LoadFromJson(e){e&&this.GetPropertyAdapter()._LoadFromJson(e.propertyAdapterJson)}static GetValueAtTime(a){const n=a.GetTrack(),r=n.GetTimeline().GetTime(),s=t.GetStartPropertyKeyframeForTime(r,a),e=t.GetEndPropertyKeyframeForTime(r,a),l=t.PropertySourceAdapter.GetInterpolateFunc(a);return l(r,s,e,a)}static GetValue(e,t,a){let n=e.GetResultMode();return'combo'===e.GetPropertyType()&&(n='absolute'),'relative'===n?t+a:'absolute'===n?a:void 0}static GetInterpolateFunc(e){const a=e.GetPropertyKeyframeType();return'numeric'===a?t.NumericTypeAdapter.Interpolate:'angle'===a?t.AngleTypeAdapter.Interpolate:'boolean'===a?t.BooleanTypeAdapter.Interpolate:'color'===a?t.ColorTypeAdapter.Interpolate:'text'===a?t.TextTypeAdapter.Interpolate:void 0}static GetWillChangeFunc(e){const a=e.GetPropertyKeyframeType();return'numeric'===a?t.NumericTypeAdapter.WillChange:'angle'===a?t.AngleTypeAdapter.WillChange:'boolean'===a?t.BooleanTypeAdapter.WillChange:'color'===a?t.ColorTypeAdapter.WillChange:'text'===a?t.TextTypeAdapter.WillChange:void 0}}}{class e extends C3.PropertyTrackState.PropertySourceAdapter{constructor(e){super(e)}}C3.PropertyTrackState.WorldInstanceSourceAdapter=e}{const e=0;class t extends C3.PropertyTrackState.PropertySourceAdapter{constructor(e){super(e),this._updatedIndex=NaN}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[e]}GetIndex(){return this._updatedIndex?this._updatedIndex:super.GetIndex()}GetTarget(){return this._propertyTrack.GetTrack().GetInstance()}UpdateInstanceVariableIndex(t){const a=this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[e];a===t||(this._updatedIndex=t)}Interpolate(e,t,a,n){this.GetPropertyAdapter().CanChange(t.GetValue())&&super.Interpolate(e,t,a,n)}_SaveToJson(){return Object.assign(super._SaveToJson(),{index:this._updatedIndex})}_LoadFromJson(e){e&&(super._LoadFromJson(e),this._updatedIndex=e.index)}}C3.PropertyTrackState.InstanceVariableSourceAdapter=t}{const t=0;class e extends C3.PropertyTrackState.PropertySourceAdapter{constructor(e){super(e),this._sid=NaN}GetEditorIndex(){const e=this._propertyTrack.GetPropertyTrackDataItem();return e.GetSourceAdapterArguments()[1]}GetTarget(){const a=this._propertyTrack.GetPropertyTrackDataItem(),n=this._propertyTrack.GetTrack(),r=this._sid?this._sid:a.GetSourceAdapterArguments()[t],s=n.GetInstance(),e=s.GetBehaviorIndexBySID(r),l=s.GetBehaviorInstances()[e];return l.GetSdkInstance()}GetBehaviorType(e){const t=this._propertyTrack.GetPropertyTrackDataItem(),a=t.GetSourceAdapterArguments()[2];return e.GetBehaviorTypeByName(a)}UpdateBehaviorTypeSid(e){const a=this._propertyTrack.GetPropertyTrackDataItem();a.GetSourceAdapterArguments()[t]===e||(this._sid=e)}Interpolate(t,a,n,r){const s=this._propertyTrack.GetTrack(),e=s.GetInstance();this.GetBehaviorType(e.GetObjectClass())&&super.Interpolate(t,a,n,r)}_SaveToJson(){return Object.assign(super._SaveToJson(),{sid:this._sid})}_LoadFromJson(e){e&&(super._LoadFromJson(e),this._sid=e.sid)}}C3.PropertyTrackState.BehaviorSourceAdapter=e}{class e extends C3.PropertyTrackState.PropertySourceAdapter{constructor(e){super(e)}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[1]}GetTarget(){const t=this._propertyTrack,a=t.GetTrack(),n=a.GetWorldInfo(),r=n.GetInstanceEffectList(),s=r.GetEffectList(),e=this.GetEffectType(s),l=e.GetIndex();return r.IsEffectIndexActive(l)?r.GetEffectParametersForIndex(l):null}GetEffectType(e){const t=this._propertyTrack,a=t.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0];return e.GetEffectTypeByName(a)}Interpolate(e,t,a,n){this._IsEffectActive()&&super.Interpolate(e,t,a,n)}_IsEffectActive(){const t=this._propertyTrack,a=t.GetTrack(),n=a.GetWorldInfo(),r=n.GetInstanceEffectList(),s=r.GetEffectList(),e=this.GetEffectType(s);if(e){const t=e.GetIndex();return r.IsEffectIndexActive(t)}}}C3.PropertyTrackState.EffectSourceAdapter=e}{class e extends C3.PropertyTrackState.PropertySourceAdapter{constructor(e){super(e)}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0]}GetTarget(){return this._propertyTrack.GetTrack().GetInstance().GetSdkInstance()}Interpolate(t,a,n,r){const s=this._propertyTrack.GetTrack(),e=s.GetObjectClass().GetPlugin(),l=s.GetInstance().GetObjectClass().GetPlugin();e!==l||super.Interpolate(t,a,n,r)}}C3.PropertyTrackState.PluginSourceAdapter=e}{class e extends C3.PropertyTrackState.PropertySourceAdapter{constructor(e){super(e),this._value=0}SetInitialState(){const e=this._propertyTrack.GetPropertyTrackData();let t=this._propertyTrack.GetPropertyTrackDataItem();t=e.GetFirstPropertyKeyframeDataItem(t),this._value=t.GetValueWithResultMode()}SetResumeState(){}GetValue(){return this._value}Interpolate(e,t,a){const n=C3.PropertyTrackState.NumericTypeAdapter.Interpolate;this._value=n(e,t,a,this._propertyTrack)}SaveState(){}ClearSaveState(){}GetCurrentState(){return this._value}CompareInitialStateWithCurrent(){return!1}CompareSaveStateWithCurrent(){return!1}_SaveToJson(){return{value:this._value}}_LoadFromJson(e){e&&(this._value=e.value)}}C3.PropertyTrackState.ValueSourceAdapter=e}'use strict',C3.PropertyTrackState.PropertyInterpolationAdapter=class{constructor(e){this._sourceAdapter=e,this._propertyTrack=e.GetPropertyTrack(),this._worldInfo=this._propertyTrack.GetTrack().GetWorldInfo(),this._property=this._propertyTrack.GetPropertyName(),this._firstAbsoluteUpdate=!1,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}GetWorldInfo(){return this._worldInfo?this._worldInfo:(this._worldInfo=this._propertyTrack.GetTrack().GetWorldInfo(),this._worldInfo)}SetFirstAbsoluteUpdate(e){this._firstAbsoluteUpdate=!!e}GetFirstAbsoluteUpdate(){return this._firstAbsoluteUpdate}SetInitialState(){}SetResumeState(){}SetSaveState(){this._saveState=this.GetCurrentState()}ClearSaveState(){this._saveState=null}GetCurrentState(){}CompareInitialStateWithCurrent(){}CompareSaveStateWithCurrent(){}CanChange(e){const t=typeof this._Getter();return t==typeof e}ChangeProperty(){}_FirstKeyframeGetter(){const e=this._PickTimelinePlaybackMode(()=>{const e=this._propertyTrack.GetPropertyTrackDataItem(),t=this._propertyTrack.GetPropertyTrackData();return t.GetFirstPropertyKeyframeDataItem(e)},()=>{const e=this._propertyTrack.GetPropertyTrackDataItem(),t=this._propertyTrack.GetPropertyTrackData();return t.GetLastPropertyKeyframeDataItem(e)});return e.GetAbsoluteValue()}_CurrentKeyframeGetter(){const e=this._propertyTrack.GetTimeline(),t=e.GetTime(),a=this._PickTimelinePlaybackMode(()=>{const e=this._propertyTrack.GetPropertyTrackDataItem(),a=this._propertyTrack.GetPropertyTrackData();return a.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(t,e)},()=>{const e=this._propertyTrack.GetPropertyTrackDataItem(),a=this._propertyTrack.GetPropertyTrackData(),n=a.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(t,e);return n?n:a.GetLastPropertyKeyframeDataItem(e)});return a.GetAbsoluteValue()}_PickTimelinePlaybackMode(e,t){const a=this._propertyTrack.GetTimeline();return a.IsForwardPlayBack()?e():t()}_PickResultMode(e,t){const a=this._propertyTrack.GetResultMode();return'relative'===a?e():t()}_PickFirstAbsoluteUpdate(e,t){return this.GetFirstAbsoluteUpdate()?(this.SetFirstAbsoluteUpdate(!1),e()):t()}_GetAbsoluteInitialValue(){}_GetIndex(){return this._sourceAdapter.GetIndex()}_GetTarget(){return this._target?this._target:(this._target=this._sourceAdapter.GetTarget(),this._target)}_PickSource(t,a,n,r,s){const e=this._propertyTrack.GetSourceAdapterId();return'behavior'===e?t():'effect'===e?a():'instance-variable'===e?n():'plugin'===e?r():'world-instance'===e?s():void 0}_SaveToJson(){return{firstAbsoluteUpdate:this._firstAbsoluteUpdate,saveState:this._saveState}}_LoadFromJson(e){e&&(this._firstAbsoluteUpdate=e.firstAbsoluteUpdate,this._saveState=e.saveState)}},'use strict';{class e extends C3.PropertyTrackState.PropertyInterpolationAdapter{constructor(e){super(e),this._lastValueR=0,this._lastValueG=0,this._lastValueB=0}SetInitialState(){this.SetFirstAbsoluteUpdate(!0);const e=this._GetAbsoluteInitialValue(this._FirstKeyframeGetter());this._lastValueR=e.getR(),this._lastValueG=e.getG(),this._lastValueB=e.getB()}SetResumeState(){if(!this._CompareColors(this._FirstKeyframeGetter(),this._CurrentKeyframeGetter())){this.SetFirstAbsoluteUpdate(!0);const e=this._GetAbsoluteInitialValue(this._CurrentKeyframeGetter());this._lastValueR=e.getR(),this._lastValueG=e.getG(),this._lastValueB=e.getB()}}GetCurrentState(){const e=this._propertyTrack.GetSourceAdapterId(),t=this._GetTarget(),a=this._GetIndex();switch(e){case'behavior':t.GetPropertyValueByIndex(a);break;case'effect':return t[a].toArray().slice(0,3);case'plugin':return t.GetPropertyValueByIndex(a);case'world-instance':return this._Getter().toArray().slice(0,3);}}CompareInitialStateWithCurrent(){const e=this._FirstKeyframeGetter();return!this._CompareColors(e,this._Getter())}CompareSaveStateWithCurrent(){return!C3.IsNullOrUndefined(this._saveState)&&!this._CompareColors(this._saveState,this._Getter())}_CompareColors(e,t){return e.equalsIgnoringAlpha(t)}_FirstKeyframeGetter(){const e=super._FirstKeyframeGetter();return this._GetColorFromArray(e)}_CurrentKeyframeGetter(){const e=super._CurrentKeyframeGetter();return this._GetColorFromArray(e)}_GetAbsoluteInitialValue(e){const t=this._GetColorFromArray(e);return C3.Color.Diff(t,this._Getter())}_GetColorFromArray(e){return C3.IsInstanceOf(e,C3.Color)?e:new C3.Color(e[0],e[1],e[2])}CanChange(){return!0}ChangeProperty(t,a){const n=a[0],r=a[1],e=a[2],s=this._lastValueR,l=this._lastValueG,_=this._lastValueB;return this._PickFirstAbsoluteUpdate(()=>{this._Setter(-s,-l,-_)},()=>{this._Setter(-s+n,-l+r,-_+e)}),this._lastValueR=n,this._lastValueG=r,this._lastValueB=e,C3.TimelineState.LAYOUT_RENDER_CHANGE}_Getter(){const e=this._propertyTrack.GetSourceAdapterId(),t=this._GetTarget(),a=this._GetIndex();return'behavior'===e?this._GetColorFromArray(t.GetPropertyValueByIndex(a)):'effect'===e?t[a].clone():'plugin'===e?this._GetColorFromArray(t.GetPropertyValueByIndex(a)):'world-instance'===e?this.GetWorldInfo().GetUnpremultipliedColor().clone():void 0}_Setter(t,a,n){const r=this._propertyTrack.GetSourceAdapterId(),s=this._GetTarget(),e=this._GetIndex();'behavior'===r?s.SetPropertyColorOffsetValueByIndex(e,t,a,n):'effect'===r?s[e].addRgb(t,a,n):'plugin'===r?s.SetPropertyColorOffsetValueByIndex(e,t,a,n):'world-instance'===r?this.GetWorldInfo().OffsetUnpremultipliedColorRGB(t,a,n):void 0}_SaveToJson(){return Object.assign(super._SaveToJson(),{r:this._lastValueR,g:this._lastValueG,b:this._lastValueB})}_LoadFromJson(e){e&&(super._LoadFromJson(e),this._lastValueR=e.r,this._lastValueG=e.g,this._lastValueB=e.b)}}C3.PropertyTrackState.PropertyInterpolationAdapter.ColorInterpolationAdapter=e}{class e extends C3.PropertyTrackState.PropertyInterpolationAdapter{constructor(e){super(e)}SetInitialState(){}SetResumeState(){}GetCurrentState(){return this._Getter()}CompareInitialStateWithCurrent(){const e=this._FirstKeyframeGetter();return e!==this.GetCurrentState()}CompareSaveStateWithCurrent(){return!C3.IsNullOrUndefined(this._saveState)&&this._saveState!==this.GetCurrentState()}ChangeProperty(t,a){const n=C3.PropertyTrackState.PropertySourceAdapter.GetWillChangeFunc(this._propertyTrack),r=this._propertyTrack.GetSourceAdapterId(),s=n(this._GetIndex(),this._GetTarget(),a,r);if(s)return this._Setter(a),'behavior'===r||'effect'===r||'instance-variable'===r?void 0:'plugin'===r?C3.TimelineState.LAYOUT_RENDER_CHANGE:void 0}_Getter(){const e=this._propertyTrack.GetSourceAdapterId(),t=this._GetTarget(),a=this._GetIndex();switch(e){case'behavior':return t.GetPropertyValueByIndex(a);case'effect':return t[a];case'instance-variable':return t.GetInstanceVariableValue(a);case'plugin':return t.GetPropertyValueByIndex(a);;}}_Setter(e){const t=this._propertyTrack.GetSourceAdapterId(),a=this._GetTarget(),n=this._GetIndex();'behavior'===t?a.SetPropertyValueByIndex(n,e):'effect'===t?a[n]=e:'instance-variable'===t?a.SetInstanceVariableValue(n,e):'plugin'===t?a.SetPropertyValueByIndex(n,e):void 0}}C3.PropertyTrackState.PropertyInterpolationAdapter.NoInterpolationAdapter=e}{const t=new Map,e=(a,n,r,s)=>t.set(a,{setter:n,getter:r,round:s});e('offsetX',(e,t)=>e.OffsetX(t),e=>e.GetX(),!0),e('offsetY',(e,t)=>e.OffsetY(t),e=>e.GetY(),!0),e('offsetWidth',(e,t)=>e.OffsetWidth(t),e=>e.GetWidth(),!0),e('offsetHeight',(e,t)=>e.OffsetHeight(t),e=>e.GetHeight(),!0),e('offsetAngle',(e,t)=>e.OffsetAngle(t),e=>e.GetAngle(),!1),e('offsetOpacity',(e,t)=>e.OffsetOpacity(t),e=>e.GetOpacity(),!1),e('offsetOriginX',(e,t)=>e.OffsetOriginX(t),e=>e.GetOriginX(),!1),e('offsetOriginY',(e,t)=>e.OffsetOriginY(t),e=>e.GetOriginY(),!1),e('offsetZElevation',(e,t)=>e.OffsetZElevation(t),e=>e.GetZElevation(),!0);class a extends C3.PropertyTrackState.PropertyInterpolationAdapter{constructor(e){super(e),this._lastValue=0,this._instance_getter=null,this._instance_setter=null,this._round=!1;const a=this._propertyTrack.GetPropertyName();if('world-instance'===this._propertyTrack.GetSourceAdapterId()){const e=t.get(a);this._instance_getter=e.getter,this._instance_setter=e.setter,this._round=e.round}}Release(){this._instance_getter=null,this._instance_setter=null,super.Release()}SetInitialState(){this._lastValue=this._PickResultMode(()=>this._PickTimelinePlaybackMode(()=>0,()=>C3.PropertyTrackState.PropertySourceAdapter.GetValueAtTime(this._propertyTrack)),()=>(this.SetFirstAbsoluteUpdate(!0),this._GetAbsoluteInitialValue(this._FirstKeyframeGetter())))}SetResumeState(){this._FirstKeyframeGetter()===this._CurrentKeyframeGetter()||this._PickResultMode(()=>{},()=>{this.SetFirstAbsoluteUpdate(!0),this._lastValue=this._GetAbsoluteInitialValue(this._CurrentKeyframeGetter())})}GetCurrentState(){return this._Getter()}CompareInitialStateWithCurrent(){const e=this._FirstKeyframeGetter();return e!==this.GetCurrentState()}CompareSaveStateWithCurrent(){return!C3.IsNullOrUndefined(this._saveState)&&this._saveState!==this.GetCurrentState()}_GetAbsoluteInitialValue(e){return e-this.GetCurrentState()}ChangeProperty(t,a,n,r,s){return this._PickResultMode(()=>{this._Setter(a-this._lastValue,n,r),this._lastValue=a,this._MaybeEnsureValue(t,n,r,s,this._lastValue,a)},()=>{this._PickFirstAbsoluteUpdate(()=>{this._Setter(this._lastValue,n,r),this._lastValue=a},()=>{this._Setter(a-this._lastValue,n,r),this._lastValue=a,this._MaybeEnsureValue(t,n,r,s,this._lastValue,a)})}),this._PickSource(()=>{},()=>C3.TimelineState.LAYOUT_RENDER_CHANGE,()=>{},()=>C3.TimelineState.LAYOUT_RENDER_CHANGE,()=>C3.TimelineState.LAYOUT_RENDER_CHANGE)}_Getter(){const e=this._GetTarget(),t=this._GetIndex();return this._PickSource(()=>e.GetPropertyValueByIndex(t),()=>e[t],()=>e.GetInstanceVariableValue(t),()=>e.GetPropertyValueByIndex(t),()=>this._instance_getter(this.GetWorldInfo()))}_Setter(e){const t=this._GetTarget(),a=this._GetIndex();this._PickSource(()=>t.OffsetPropertyValueByIndex(a,e),()=>t[a]+=e,()=>t.SetInstanceVariableOffset(a,e),()=>t.OffsetPropertyValueByIndex(a,e),()=>this._instance_setter(this.GetWorldInfo(),e))}_MaybeEnsureValue(t,a,n,r,s,e){r?a&&t===a.GetTime()?this._AddDelta(a.GetValueWithResultMode(),a,n):n&&t===n.GetTime()?this._AddDelta(n.GetValueWithResultMode(),a,n):!n&&this._AddDelta(a.GetValueWithResultMode(),a,n):a&&t===a.GetTime()?this._AddDelta(a.GetValueWithResultMode(),a,n):n&&t===n.GetTime()?this._AddDelta(n.GetValueWithResultMode(),a,n):0==e-s&&this._AddDelta(a.GetValueWithResultMode(),a,n)}_AddDelta(t,a,n){const r=t.toString(),s=r.split('.')[1]||'',e=s.length,l=this._Getter();let _;_=0===e?this._round?Math.round(l):l:C3.toFixed(l,e),this._Setter(_-l,a,n),this._lastValue+=_-l}_SaveToJson(){return Object.assign(super._SaveToJson(),{v:this._lastValue})}_LoadFromJson(e){e&&(super._LoadFromJson(e),this._lastValue=e.v)}}C3.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapter=a}'use strict',C3.PropertyTrackState.NumericTypeAdapter=class{constructor(){}static WillChange(t,a,n,r){let s;return'behavior'===r?s=a.GetPropertyValueByIndex(t):'effect'===r?s=a[t]:'instance-variable'===r?s=a.GetInstanceVariableValue(t):'plugin'===r?s=a.GetPropertyValueByIndex(t):void 0,s!==n}static Interpolate(t,r,s,_){var d=Math.floor;if(!s){let e=_.GetPropertyTrackDataItem();const t=_.GetPropertyTrackData();return e=t.GetLastPropertyKeyframeDataItem(e),e.GetValueWithResultMode()}let u=_.GetInterpolationMode();if('default'===u&&(u='continuous'),'combo'===_.GetPropertyType()&&(u='discrete'),'discrete'===u)return r.GetValueWithResultMode();if('continuous'===u||'step'===u){if('step'===u){const e=_.GetTimeline().GetStep();if(0!==e){const a=1/e;t=d(t*a)/a}}const c=r.GetTime(),g=s.GetTime(),p=r.GetValueWithResultMode(),h=s.GetValueWithResultMode();if(p===h)return p;const f=C3.normalize(t,c,g),l=r.GetEase();let m;const e=r.GetAddOn('cubic-bezier'),n=s.GetAddOn('cubic-bezier');if(e&&e.GetStartEnable()&&n&&n.GetEndEnable()){const t=g-c;m=Ease.GetEase(l)(t*f,0,1,t),m=Ease.GetEase('cubicbezier')(m,p,p+e.GetStartAnchor(),h+n.GetEndAnchor(),h)}else m=Ease.GetEase(l)((g-c)*f,p,h-p,g-c);return'integer'===_.GetPropertyType()?d(m):m}}},'use strict',C3.PropertyTrackState.AngleTypeAdapter=class{constructor(){}static WillChange(t,a,n,r){let s;return'behavior'===r?s=a.GetPropertyValueByIndex(t):'effect'===r?s=a[t]:'instance-variable'===r?s=a.GetInstanceVariableValue(t):'plugin'===r?s=a.GetPropertyValueByIndex(t):void 0,s!==n}static Interpolate(t,n,r,s){if(!r){let e=s.GetPropertyTrackDataItem();const t=s.GetPropertyTrackData();return e=t.GetLastPropertyKeyframeDataItem(e),e.GetValueWithResultMode()}let l=s.GetInterpolationMode();if('default'===l&&(l='continuous'),'combo'===s.GetPropertyType()&&(l='discrete'),'discrete'===l)return n.GetValueWithResultMode();if('continuous'===l||'step'===l){if('step'===l){const e=s.GetTimeline().GetStep();if(0!==e){const a=1/e;t=Math.floor(t*a)/a}}const e=n.GetTime(),a=r.GetTime(),_=n.GetValueWithResultMode(),d=r.GetValueWithResultMode();if(_===d)return _;let u=C3.normalize(t,e,a);const c=Ease.GetEase(n.GetEase());return C3.angleLerp(_,d,c(u,0,1,1))}}},'use strict',C3.PropertyTrackState.BooleanTypeAdapter=class{constructor(){}static WillChange(t,a,n,r){let s;return'behavior'===r?s=a.GetPropertyValueByIndex(t):'effect'===r?s=a[t]:'instance-variable'===r?s=a.GetInstanceVariableValue(t):'plugin'===r?s=a.GetPropertyValueByIndex(t):void 0,!!s!=!!n}static Interpolate(e,t,a,n){if(!a){let e=n.GetPropertyTrackDataItem();const t=n.GetPropertyTrackData();return e=t.GetLastPropertyKeyframeDataItem(e),e.GetValueWithResultMode()?1:0}return t.GetValueWithResultMode()?1:0}},'use strict';{const _=[0,0,0],t=[0,0,0];C3.PropertyTrackState.ColorTypeAdapter=class{constructor(){}static WillChange(a,n,r,e){var s=Math.floor;let l;return'behavior'===e?l=n.GetPropertyValueByIndex(a):'effect'===e?l=n[a]:'instance-variable'===e?l=n.GetInstanceVariableValue(a):'plugin'===e?l=n.GetPropertyValueByIndex(a):void 0,Array.isArray(r)?(_[0]=r[0],_[1]=r[1],_[2]=r[2]):(TEMP_COLOR_ARRAY_3.parseCommaSeparatedRgb(r),_[0]=s(255*TEMP_COLOR_ARRAY_3.getR()),_[1]=s(255*TEMP_COLOR_ARRAY_3.getG()),_[2]=s(255*TEMP_COLOR_ARRAY_3.getB())),Array.isArray(l)?(t[0]=l[0],t[1]=l[1],t[2]=l[2]):(TEMP_COLOR_ARRAY_3.parseCommaSeparatedRgb(l),t[0]=s(255*TEMP_COLOR_ARRAY_3.getR()),t[1]=s(255*TEMP_COLOR_ARRAY_3.getG()),t[2]=s(255*TEMP_COLOR_ARRAY_3.getB())),_[0]!==t[0]||_[1]!==t[1]||_[2]!==t[2]}static Interpolate(y,a,c,t){if(!c){let a=t.GetPropertyTrackDataItem();const n=t.GetPropertyTrackData();a=n.GetLastPropertyKeyframeDataItem(a);const r=a.GetValueWithResultMode();return _[0]=r[0],_[1]=r[1],_[2]=r[2],_}let d=t.GetInterpolationMode();if('default'===d&&(d='continuous'),'discrete'===d){const e=a.GetValueWithResultMode();return _[0]=e[0],_[1]=e[1],_[2]=e[2],_}if('continuous'===d||'step'===d){if('step'===d){const e=t.GetTimeline().GetStep();if(0!==e){const t=1/e;y=Math.floor(y*t)/t}}const g=a.GetTime(),h=c.GetTime(),f=a.GetValueWithResultMode(),S=c.GetValueWithResultMode(),G=C3.normalize(y,g,h),l=a.GetEase(),m=f[0],e=f[1],n=f[2],I=S[0],p=S[1],T=S[2],r=Ease.GetEase(l),s=h-g,b=s*G;return _[0]=m===I?m:r(b,m,I-m,s),_[1]=e===p?e:r(b,e,p-e,s),_[2]=n===T?n:r(b,n,T-n,s),_}}}}'use strict',C3.PropertyTrackState.TextTypeAdapter=class{constructor(){}static WillChange(t,a,n,r){let s;return'behavior'===r?s=a.GetPropertyValueByIndex(t):'effect'===r?s=a[t]:'instance-variable'===r?s=a.GetInstanceVariableValue(t):'plugin'===r?s=a.GetPropertyValueByIndex(t):void 0,s!==n}static Interpolate(e,t,a,n){if(!a){let e=n.GetPropertyTrackDataItem();const t=n.GetPropertyTrackData();return e=t.GetLastPropertyKeyframeDataItem(e),e.GetValueWithResultMode()}return t.GetValueWithResultMode()}},'use strict',C3.TimelineDataManager=class{constructor(){this._timelineDataItems=new Map}Release(){for(const e of this._timelineDataItems.values())e.Release();this._timelineDataItems.clear(),this._timelineDataItems=null}Add(e){const t=new C3.TimelineDataItem(e),a=t.GetName();this._timelineDataItems.set(a,t)}Get(e){return this._timelineDataItems.get(e)}GetNameId(){return 0}static _CreateDataItems(t,a,n,r){if(a)for(const s of a)C3.TimelineDataManager._CreateDataItem('create',s,t,n,r)}static _LoadDataItemsFromJson(e,t,a,n){e.length?t.forEach((t,a)=>{e[a]._LoadFromJson(t)}):t.forEach(t=>{C3.TimelineDataManager._CreateDataItem('load',t,e,a,n)})}static _CreateDataItem(t,a,n,r,s){let e;if('function'==typeof r)'load'===t?e=new r(null,s):'create'===t?e=new r(a,s):void 0;else if('object'==typeof r){const n=r.prop,l=a[n],_=r.map.get(l);'load'===t?e=new _(null,s):'create'===t?e=new _(a,s):void 0}switch(t){case'load':e._LoadFromJson(a),n.push(e);break;case'create':if('function'==typeof e.GetEnable&&!e.GetEnable())return e.Release();n.push(e);}}},'use strict',C3.TimelineDataItem=class{constructor(e){this._name='',this._totalTime=NaN,this._step=0,this._interpolationMode='default',this._resultMode='default',this._loop=!1,this._pingPong=!1,this._repeatCount=1,this._trackData=null,e&&(this._name=e[0],this._totalTime=e[1],this._step=e[2],this._interpolationMode=e[3],this._resultMode=e[4],this._loop=!!e[6],this._pingPong=!!e[7],this._repeatCount=e[8],this._trackData=new C3.TrackData(e[5],this))}Release(){this._trackData.Release(),this._trackData=null}GetTrackData(){return this._trackData||(this._trackData=new C3.TrackData(null,this)),this._trackData}GetName(){return this._name}SetName(e){this._name=e}GetTotalTime(){return this._totalTime}SetTotalTime(e){this._totalTime=e}GetStep(){return this._step}SetStep(e){this._step=e}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(e){this._interpolationMode=e}GetResultMode(){return this._resultMode}SetResultMode(e){this._resultMode=e}GetLoop(){return this._loop}GetPingPong(){return this._pingPong}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(e){e&&(this.GetTrackData()._LoadFromJson(e.trackDataJson),this._name=e.name,this._totalTime=e.totalTime,this._step=e.step,this._interpolationMode=e.interpolationMode,this._resultMode=e.resultMode,this._loop=e.loop,this._pingPong=e.pingPong,this._repeatCount=e.repeatCount)}},'use strict';{const e=0;class t{constructor(t,a){this._trackData=a,this._instanceData=null,this._instanceUid=NaN,this._objectClassIndex=NaN,this._interpolationMode='default',this._resultMode='default',this._enabled=!1,this._keyframeData=null,this._propertyTrackData=null,this._id='',t&&(this._instanceData=t[e],this._instanceUid=t[e][2],this._objectClassIndex=t[e][1],this._interpolationMode=t[1],this._resultMode=t[2],this._enabled=!!t[3],t[6]&&(this._id=t[6]),this._keyframeData=new C3.KeyframeData(t[4],this),this._propertyTrackData=new C3.PropertyTrackData(t[5],this))}Release(){this._trackData=null,this._keyframeData&&(this._keyframeData.Release(),this._keyframeData=null),this._propertyTrackData&&(this._propertyTrackData.Release(),this._propertyTrackData=null)}GetTrackData(){return this._trackData}GetKeyframeData(){return this._keyframeData||(this._keyframeData=new C3.KeyframeData(null,this)),this._keyframeData}GetPropertyTrackData(){return this._propertyTrackData||(this._propertyTrackData=new C3.PropertyTrackData(null,this)),this._propertyTrackData}GetInstanceData(){return this._instanceData}GetObjectClassIndex(){return this._objectClassIndex}SetObjectClassIndex(e){this._objectClassIndex=e}GetInstanceUID(){return this._instanceUid}SetInstanceUID(e){this._instanceUid=e}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(e){this._interpolationMode=e}GetResultMode(){return this._resultMode}SetResultMode(e){this._resultMode=e}GetEnable(){return this._enabled}SetEnable(e){this._enabled=!!e}GetId(){return this._id}_SaveToJson(){return{keyframeDataJson:this._keyframeData._SaveToJson(),propertyTrackDataJson:this._propertyTrackData._SaveToJson(),instanceData:this._instanceData,instanceUid:this._instanceUid,objectClassIndex:this._objectClassIndex,interpolationMode:this._interpolationMode,resultMode:this._resultMode,enabled:this._enabled,id:this._id}}_LoadFromJson(e){e&&(this._instanceData=e.instanceData,this._instanceUid=e.instanceUid,this._objectClassIndex=e.objectClassIndex,this._interpolationMode=e.interpolationMode,this._resultMode=e.resultMode,this._enabled=e.enabled,this._id=e.id,this.GetKeyframeData()._LoadFromJson(e.keyframeDataJson),this.GetPropertyTrackData()._LoadFromJson(e.propertyTrackDataJson))}}C3.TrackData=class{constructor(e,a){this._timelineData=a,this._trackDataItems=[],this._keyframeTimeMap=new Map,C3.TimelineDataManager._CreateDataItems(this._trackDataItems,e,t,this)}Release(){this._timelineData=null;for(const e of this._trackDataItems)e.Release();C3.clearArray(this._trackDataItems),this._trackDataItems=null,this._keyframeTimeMap.clear(),this._keyframeTimeMap=null}AddEmptyTrackDataItem(){const e=new t(null,this);return this._trackDataItems.push(e),e}GetFirstKeyframeDataItem(e){return e.GetKeyframeData().GetKeyframeDataItemArray()[0]}GetLastKeyframeDataItem(e){const t=e.GetKeyframeData().GetKeyframeDataItemArray();return t[t.length-1]}GetKeyFrameDataItemAtTime(e,t){const a=this._keyframeTimeMap.get(t);if(!!a&&a.has(e))return a.get(e);for(const n of t.GetKeyframeData().keyframeDataItems())if(n.GetTime()===e)return a||this._keyframeTimeMap.set(t,new Map),this._keyframeTimeMap.get(t).set(e,n),n}GetFirstKeyFrameDataItemHigherThan(e,t){for(const a of t.GetKeyframeData().keyframeDataItems())if(a.GetTime()>e)return a}GetFirstKeyFrameDataItemHigherOrEqualThan(e,t){for(const a of t.GetKeyframeData().keyframeDataItems())if(a.GetTime()>=e)return a}GetFirstKeyFrameDataItemLowerOrEqualThan(e,t){for(const a of t.GetKeyframeData().keyframeDataItemsReverse())if(a.GetTime()<=e)return a}*trackDataItems(){for(const e of this._trackDataItems)yield e}_SaveToJson(){return{trackDataItemsJson:this._trackDataItems.map(e=>e._SaveToJson())}}_LoadFromJson(e){e&&C3.TimelineDataManager._LoadDataItemsFromJson(this._trackDataItems,e.trackDataItemsJson,t,this)}}}{const e=0;class t{constructor(t,a){this._propertyTrackData=a,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=!1,this._propertyKeyframeData=null,t&&(this._sourceAdapterId=t[e][0],this._sourceAdapterArguments=t[e].slice(1),this._property=t[1],this._type=t[2],this._min=t[3],this._max=t[4],this._interpolationMode=t[5],this._resultMode=t[6],this._enabled=!!t[7],this._propertyKeyframeData=new C3.PropertyKeyframeData(t[8],this))}Release(){this._propertyKeyframeData.Release(),this._propertyKeyframeData=null,this._propertyTrackData=null,this._sourceAdapterArguments=null}GetPropertyTrackData(){return this._propertyTrackData}GetPropertyKeyframeData(){return this._propertyKeyframeData||(this._propertyKeyframeData=new C3.PropertyKeyframeData(null,this)),this._propertyKeyframeData}GetSourceAdapterId(){return this._sourceAdapterId}SetSourceAdapterId(e){this._sourceAdapterId=e}GetSourceAdapterArguments(){return this._sourceAdapterArguments}SetSourceAdapterArguments(e){this._sourceAdapterArguments=e}GetProperty(){return this._property}SetProperty(e){this._property=e}GetType(){return this._type}SetType(e){this._type=e}GetMin(){return this._min}SetMin(e){this._min=e}GetMax(){return this._max}SetMax(e){this._max=e}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(e){this._interpolationMode=e}GetResultMode(){return this._resultMode}SetResultMode(e){this._resultMode=e}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(e){e&&(this._sourceAdapterId=e.sourceAdapterId,this._sourceAdapterArguments=e.sourceAdapterArguments,this._property=e.property,this._type=e.type,this._min=e.min,this._max=e.max,this._interpolationMode=e.interpolationMode,this._resultMode=e.resultMode,this._enabled=e.enabled,this.GetPropertyKeyframeData()._LoadFromJson(e.propertyKeyframeDataJson))}}C3.PropertyTrackData=class{constructor(e,a){this._trackDataItem=a,this._propertyTrackDataItems=[],this._propertyKeyframeTimeMap=new Map,C3.TimelineDataManager._CreateDataItems(this._propertyTrackDataItems,e,t,this)}Release(){this._trackDataItem=null;for(const e of this._propertyTrackDataItems)e.Release();C3.clearArray(this._propertyTrackDataItems),this._propertyTrackDataItems=null,this._propertyKeyframeTimeMap.clear(),this._propertyKeyframeTimeMap=null}GetTrackDataItem(){return this._trackDataItem}AddEmptyPropertyTrackDataItem(){const e=new t(null,this);return this._propertyTrackDataItems.push(e),e}GetFirstPropertyKeyframeDataItem(e){const t=e.GetPropertyKeyframeData();return t.GetPropertyKeyframeDataItemArray()[0]}GetLastPropertyKeyframeDataItem(e){const t=e.GetPropertyKeyframeData(),a=t.GetPropertyKeyframeDataItemArray();return a[a.length-1]}GetPropertyKeyFrameDataItemAtTime(t,a){const n=this._propertyKeyframeTimeMap.get(a);if(!!n&&n.has(t))return n.get(t);const r=a.GetPropertyKeyframeData();for(const s of r.propertyKeyframeDataItems())if(s.GetTime()===t)return n||this._propertyKeyframeTimeMap.set(a,new Map),this._propertyKeyframeTimeMap.get(a).set(t,s),s}GetFirstPropertyKeyFrameDataItemHigherThan(e,t){const a=t.GetPropertyKeyframeData();for(const n of a.propertyKeyframeDataItems())if(n.GetTime()>e)return n}GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(e,t){const a=t.GetPropertyKeyframeData();for(const n of a.propertyKeyframeDataItems())if(n.GetTime()>=e)return n}GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(e,t){const a=t.GetPropertyKeyframeData();for(const n of a.propertyKeyframeDataItemsReverse())if(n.GetTime()<=e)return n}*propertyTrackDataItems(){for(const e of this._propertyTrackDataItems)yield e}_SaveToJson(){return{propertyTrackDataItemsJson:this._propertyTrackDataItems.map(e=>e._SaveToJson())}}_LoadFromJson(e){e&&C3.TimelineDataManager._LoadDataItemsFromJson(this._propertyTrackDataItems,e.propertyTrackDataItemsJson,t,this)}}}{class e{constructor(e,t){if(this._keyframeData=t,this._time=-1,this._ease='noease',this._enable=!1,this._tags=null,this._lowerTags=null,!!e){this._time=e[0],this._ease=e[1],this._enable=!!e[2];const t=e[3];this._tags=t?t.split(' '):[],this._lowerTags=new Set(this._tags.map(e=>e.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(e){this._time=e}GetEase(){return this._ease}SetEase(e){this._ease=e}GetEnable(){return this._enable}SetEnable(e){this._enable=!!e}GetTags(){return this._tags}SetTags(e){this._tags=e?e.split(' '):[],this._lowerTags=new Set(this._tags.map(e=>e.toLowerCase()))}GetLowerTags(){return this._lowerTags}HasTag(e){return this._lowerTags.has(e.toLowerCase())}_SaveToJson(){return{time:this._time,ease:this._ease,enable:this._enable,tags:this._tags}}_LoadFromJson(e){e&&(this._time=e.time,this._ease=e.ease,this._enable=e.enable,this._tags=e.tags,this._lowerTags=new Set(this._tags.map(e=>e.toLowerCase())))}}C3.KeyframeData=class{constructor(t,a){this._trackDataItem=a,this._keyframeDataItems=[],C3.TimelineDataManager._CreateDataItems(this._keyframeDataItems,t,e,this)}Release(){this._trackDataItem=null;for(const e of this._keyframeDataItems)e.Release();C3.clearArray(this._keyframeDataItems),this._keyframeDataItems=null}GetTrackDataItem(){return this._trackDataItem}GetKeyframeDataItemCount(){return this._keyframeDataItems.length}GetKeyframeDataItemArray(){return this._keyframeDataItems}AddEmptyKeyframeDataItem(){const t=new e(null,this);return this._keyframeDataItems.push(t),t}DeleteKeyframeDataItems(e){for(const t of this._keyframeDataItems){if(!e(t))continue;const a=this._keyframeDataItems.indexOf(t);-1===a||(t.Release(),this._keyframeDataItems.splice(a,1))}this.SortKeyframeDataItems()}SortKeyframeDataItems(){this._keyframeDataItems.sort((e,t)=>e.GetTime()-t.GetTime())}GetKeyframeDataItemIndex(e){return this._keyframeDataItems.indexOf(e)}GetKeyframeDataItemFromIndex(e){return this._keyframeDataItems[e]}*keyframeDataItems(){for(const e of this._keyframeDataItems)yield e}*keyframeDataItemsReverse(){for(let e=this._keyframeDataItems.length-1;0<=e;e--)yield this._keyframeDataItems[e]}_SaveToJson(){return{keyframeDataItemsJson:this._keyframeDataItems.map(e=>e._SaveToJson())}}_LoadFromJson(t){t&&C3.TimelineDataManager._LoadDataItemsFromJson(this._keyframeDataItems,t.keyframeDataItemsJson,e,this)}}}{const e=0;class t{constructor(t,a){this._propertyKeyframeData=a,this._value=null,this._aValue=null,this._type='',this._time=NaN,this._ease='noease',this._enable=!1,this._addonData=null,t&&(this._value=t[e][0],this._aValue=t[e][1],this._type=t[e][2],this._time=t[1],this._ease=t[2],this._enable=!!t[3],this._addonData=null,!!t[4]&&(this._addonData=new C3.AddonData(t[4],this)))}Release(){this._propertyKeyframeData=null,this._addonData&&(this._addonData.Release(),this._addonData=null)}GetAddonData(){return this._addonData}GetValue(){return this._value}SetValue(e){'color'===this._type&&C3.IsFiniteNumber(e)?(this._value[0]=C3.GetRValue(e),this._value[1]=C3.GetGValue(e),this._value[2]=C3.GetBValue(e)):this._value=e}GetAbsoluteValue(){return this._aValue}SetAbsoluteValue(e){'color'===this._type&&C3.IsFiniteNumber(e)?(this._aValue[0]=C3.GetRValue(e),this._aValue[1]=C3.GetGValue(e),this._aValue[2]=C3.GetBValue(e)):this._aValue=e}GetValueWithResultMode(){const e=this._propertyKeyframeData.GetPropertyTrackDataItem().GetResultMode();return'relative'===e?this.GetValue():'absolute'===e?this.GetAbsoluteValue():void 0}GetType(){return this._type}SetType(e){this._type=e}GetTime(){return this._time}SetTime(e){this._time=e}GetEase(){return this._ease}SetEase(e){this._ease=e}GetEnable(){return this._enable}SetEnable(e){this._enable=!!e}GetAddOn(e){if(this.GetAddonData())for(const t of this.GetAddonData().addonDataItems())if(t.GetId()===e)return t}_SaveToJson(){const e=this._addonData;return{addonDataJson:e?e._SaveToJson():e,value:this._value,aValue:this._aValue,type:this._type,time:this._time,ease:this._ease,enable:this._enable}}_LoadFromJson(e){e&&(e.addonDataJson&&this._addonData._SetFromJson(e.addonDataJson),this._value=e.value,this._aValue=e.aValue,this._type=e.type,this._time=e.time,this._ease=e.ease,this._enable=e.enable)}}C3.PropertyKeyframeData=class{constructor(e,a){this._propertyTrackDataItem=a,this._propertyKeyframeDataItems=[],C3.TimelineDataManager._CreateDataItems(this._propertyKeyframeDataItems,e,t,this)}Release(){this._propertyTrackDataItem=null;for(const e of this._propertyKeyframeDataItems)e.Release();C3.clearArray(this._propertyKeyframeDataItems),this._propertyKeyframeDataItems=null}AddEmptyPropertyKeyframeDataItem(){const e=new t(null,this);return this._propertyKeyframeDataItems.push(e),e}DeletePropertyKeyframeDataItems(e){for(const t of this._propertyKeyframeDataItems){if(!e(t))continue;const a=this._propertyKeyframeDataItems.indexOf(t);-1===a||(t.Release(),this._propertyKeyframeDataItems.splice(a,1))}this.SortPropertyKeyFrameDataItems()}SortPropertyKeyFrameDataItems(){this._propertyKeyframeDataItems.sort((e,t)=>e.GetTime()-t.GetTime())}GetPropertyTrackDataItem(){return this._propertyTrackDataItem}GetPropertyKeyframeDataItemCount(){this._propertyKeyframeDataItems.length}GetPropertyKeyframeDataItemArray(){return this._propertyKeyframeDataItems}*propertyKeyframeDataItems(){for(const e of this._propertyKeyframeDataItems)yield e}*propertyKeyframeDataItemsReverse(){for(let e=this._propertyKeyframeDataItems.length-1;0<=e;e--)yield this._propertyKeyframeDataItems[e]}_SaveToJson(){return{propertyKeyframeDataItemsJson:this._propertyKeyframeDataItems.map(e=>e._SaveToJson())}}_LoadFromJson(e){e&&C3.TimelineDataManager._LoadDataItemsFromJson(this._propertyKeyframeDataItems,e.propertyKeyframeDataItemsJson,t,this)}}}{class e{constructor(e,t){this._addonData=t,this._id=e[0],this._data=e[1]}Release(){this._addonData=null,this._data=null}GetAddonData(){return this._addonData}GetId(){return this._id}_SaveToJson(){return{id:this._id,data:this._data}}_LoadFromJson(e){e&&(this._id=e.id,this._data=e.data)}}class t extends e{constructor(e,t){super(e,t),this._startAnchor=this._data[0],this._startEnable=!!this._data[1],this._endAnchor=this._data[2],this._endEnable=!!this._data[3]}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(e){e&&(super._LoadFromJson(e),this._startAnchor=e.startAnchor,this._startEnable=!!e.startEnable,this._endAnchor=e.endAnchor,this._endEnable=!!e.endEnable)}}C3.AddonData=class{constructor(e,a){this._propertyKeyframeDataItem=a,this._addonDataItems=[],C3.TimelineDataManager._CreateDataItems(this._addonDataItems,e,{prop:0,map:new Map([['cubic-bezier',t]])},this)}Release(){this._propertyKeyframeDataItem=null;for(const e of this._addonDataItems)e.Release();C3.clearArray(this._addonDataItems),this._addonDataItems=null}GetPropertyKeyframeDataItem(){return this._propertyKeyframeDataItem}*addonDataItems(){for(const e of this._addonDataItems)yield e}_SaveToJson(){return{addonDataItemsJson:this._addonDataItems.map(e=>e._SaveToJson())}}_LoadFromJson(e){e&&C3.TimelineDataManager._LoadDataItemsFromJson(this._addonDataItems,e.addonDataItemsJson,{prop:'id',map:new Map([['cubic-bezier',t]])},this)}}}{let e=0;C3.Tween=class extends C3.TimelineState{constructor(t,a){super(`tween-${e++}`,t,a),this._id='',this._destroyInstanceOnComplete=!1,this._initialValueMode='start-value',this._on_completed_callbacks=null,this._on_started_callbacks=null}GetInstance(){const e=this.GetTracks();if(e&&e.length){const t=e[0];if(t){const e=t.GetInstance();return t.IsInstanceValid()?e:null}}}AddStartedCallback(e){this._on_started_callbacks||(this._on_started_callbacks=[]),this._on_started_callbacks.push(e)}AddCompletedCallback(e){this._on_completed_callbacks||(this._on_completed_callbacks=[]),this._on_completed_callbacks.push(e)}RemoveStartedCallback(e){if(this._on_started_callbacks){const t=this._on_started_callbacks.indexOf(e);-1!==t&&this._on_started_callbacks.splice(t,1)}}RemoveCompletedCallback(e){if(this._on_completed_callbacks){const t=this._on_completed_callbacks.indexOf(e);-1!==t&&this._on_completed_callbacks.splice(t,1)}}SetStartValue(t,a){for(const e of this._tracks)for(const n of e._propertyTracks){if(n.GetPropertyName()!==a)continue;const r=n.GetPropertyTrackData(),s=n.GetPropertyTrackDataItem(),e=r.GetFirstPropertyKeyframeDataItem(s);e.SetValue(t),e.SetAbsoluteValue(t)}}_GetPropertyTrackState(e){for(const t of this._tracks)for(const a of t._propertyTracks)if(a.GetPropertyName()===e)return a}BeforeSetEndValues(e,t){for(const n of t){const e=this._GetPropertyTrackState(n);this.SetStartValue(e.GetCurrentState(),n)}this.IsForwardPlayBack()?(this.SetTotalTime(this.GetTotalTime()-this.GetTime()),this._SetTime(0)):(this.SetTotalTime(this.GetTime()),this._SetTime(this.GetTotalTime())),this.SetInitialStateFromSetTime()}SetEndValue(t,a){const n=this._GetPropertyTrackState(a),r=n.GetPropertyTrackData(),s=n.GetPropertyTrackDataItem(),e=r.GetLastPropertyKeyframeDataItem(s);e.SetTime(this.GetTotalTime()),e.SetValue(t),e.SetAbsoluteValue(t)}SetId(e){this._id=e}GetId(){return this._id}SetInitialValueMode(e){this._initialValueMode=e}GetInitialValueMode(){return this._initialValueMode}SetDestroyInstanceOnComplete(e){this._destroyInstanceOnComplete=e}GetDestroyInstanceOnComplete(){return this._destroyInstanceOnComplete}OnStarted(){if(this._on_started_callbacks)for(const e of this._on_started_callbacks)e(this);if(!this.IsComplete())for(const e of this._tracks)e.CompareSaveStateWithCurrent()}OnCompleted(){this._completedTick=this._runtime.GetTickCount()}FinishTriggers(){if(!this._finishedTriggers&&(this._finishedTriggers=!0,this._on_completed_callbacks))for(const e of this._on_completed_callbacks)e(this)}SetTime(e){this._DeleteIntermediateKeyframes(),super.SetTime(e)}SetInitialState(e){if(!this.InitialStateSet()&&'current-state'===this.GetInitialValueMode())for(const e of this._tracks)e.CompareInitialStateWithCurrent();super.SetInitialState(e)}Stop(e=!1){if(super.Stop(e),!this.IsComplete())for(const e of this._tracks)e.SaveState()}Reset(){this._DeleteIntermediateKeyframes(),super.Reset()}_DeleteIntermediateKeyframes(){for(const e of this._tracks){const t=e=>{const t=e.GetTime(),a=this.GetTotalTime();return 0!==t&&t!==a};e.DeleteKeyframes(t),e.DeletePropertyKeyframes(t)}}MaybeTriggerKeyframeReachedConditions(){}Tick(){const e=this.GetInstance(),t=this.GetRuntime().GetDt(e);super.Tick(t,1)}_SaveToJson(){const e=super._SaveToJson(),t=this.GetTimelineDataItem();return Object.assign(e,{tweenDataItemJson:t._SaveToJson(),id:this._id,destroyInstanceOnComplete:this._destroyInstanceOnComplete,initialValueMode:this._initialValueMode})}_LoadFromJson(e){if(e){const t=this.GetTimelineDataItem();t._LoadFromJson(e.tweenDataItemJson),super._LoadFromJson(e),this._id=e.id,this._destroyInstanceOnComplete=e.destroyInstanceOnComplete,this._initialValueMode=e.initialValueMode}}static IsPlaying(e){return e.IsPlaying()}static Build(t){const a=t.runtime.GetTimelineManager(),n=new C3.TimelineDataItem;if(t.json){n._LoadFromJson(t.json.tweenDataItemJson);const e=new C3.Tween(n,a);return e._LoadFromJson(t.json),e}else{const r=new C3.Tween(n,a);C3.IsArray(t.propertyTracksConfig)||(t.propertyTracksConfig=[t.propertyTracksConfig]),r.SetId(t.id),r.SetTags(t.tags),r.SetInitialValueMode(t.initialValueMode),r.SetDestroyInstanceOnComplete(t.releaseOnComplete),r.SetTotalTime(t.time),r.SetStep(0),r.SetInterpolationMode('default'),r.SetResultMode(t.propertyTracksConfig[0].resultMode);const s=r.AddTrack();s.SetInstanceUID(t.instance.GetUID()),s.SetInterpolationMode('default'),s.SetResultMode(t.propertyTracksConfig[0].resultMode),s.SetEnable(!0),s.SetObjectClassIndex(t.instance.GetObjectClass().GetIndex());const e=s.AddKeyframe();e.SetTime(0),e.SetEase('noease'),e.SetEnable(!0),e.SetTags('');const l=s.AddKeyframe();l.SetTime(t.time),l.SetEase('noease'),l.SetEnable(!0),l.SetTags('');for(const e of t.propertyTracksConfig){const a=s.AddPropertyTrack();a.SetSourceAdapterId(e.sourceId),a.SetSourceAdapterArgs(e.sourceArgs),a.SetPropertyName(e.property),a.SetPropertyType(e.type),a.SetMin(NaN),a.SetMax(NaN),a.SetInterpolationMode('default'),a.SetResultMode(e.resultMode),a.SetEnable(!0);const n=a.AddPropertyKeyframe();n.SetType(e.valueType),n.SetTime(0),n.SetEase(e.ease),n.SetEnable(!0),n.SetValue(e.startValue),n.SetAbsoluteValue(e.startValue);const r=a.AddPropertyKeyframe();r.SetType(e.valueType),r.SetTime(t.time),r.SetEase(e.ease),r.SetEnable(!0),r.SetValue(e.endValue),r.SetAbsoluteValue(e.endValue)}return r}}}}'use strict',C3.Transition=class extends C3.DefendedBase{constructor(e){super(),this._name=e[0],this._transitionKeyframes=[];for(const t of e[1]){const e=C3.TransitionKeyframe.Create(this,t);this._transitionKeyframes.push(e)}this._precalculatedSamples=new Map,this._transitionKeyframeCache=new Map,this._PreCalcSamples(),Ease.AddCustomEase(this._name,(e,t,a,n)=>this.Interpolate(e,t,a,n))}static Create(e){return C3.New(C3.Transition,e)}Release(){for(const e of this._transitionKeyframes)e.Release();C3.clearArray(this._transitionKeyframes),this._transitionKeyframes=null,this._precalculatedSamples.clear(),this._precalculatedSamples=null,this._transitionKeyframeCache.clear(),this._transitionKeyframeCache=null}GetTransitionKeyFrameAt(e){const t=this._transitionKeyframeCache.get(e);if(t)return t;for(const t of this._transitionKeyframes)if(t.GetValueX()===e)return this._transitionKeyframeCache.set(e,t),t}GetFirstTransitionKeyFrameHigherThan(e){for(const t of this._transitionKeyframes)if(t.GetValueX()>e)return t}GetFirstTransitionKeyFrameHigherOrEqualThan(e){for(const t of this._transitionKeyframes)if(t.GetValueX()>=e)return t}GetFirstTransitionKeyFrameLowerOrEqualThan(e){for(let t=this._transitionKeyframes.length-1;0<=t;t--){const a=this._transitionKeyframes[t];if(a.GetValueX()<=e)return a}}Interpolate(t,a,s,_){const d=t/_;let e=this.GetTransitionKeyFrameAt(d),u=null;e?u=this.GetFirstTransitionKeyFrameHigherThan(d):(e=this.GetFirstTransitionKeyFrameLowerOrEqualThan(d),u=this.GetFirstTransitionKeyFrameHigherOrEqualThan(d));const c=u.GetValueX()-e.GetValueX(),h=C3.mapToRange(d,e.GetValueX(),u.GetValueX(),0,c),y=e.GetValueX(),S=e.GetValueY(),G=e.GetValueX()+e.GetStartAnchorX(),l=e.GetValueY()+e.GetStartAnchorY(),m=u.GetValueX()+u.GetEndAnchorX(),n=u.GetValueY()+u.GetEndAnchorY(),I=u.GetValueX(),p=u.GetValueY();let T=Ease.GetEase('spline')(h,y,S,G,l,m,n,I,p,this._precalculatedSamples.get(e));return T+=e.GetValueY(),(1-T)*a+T*(a+s)}_PreCalcSamples(){this._precalculatedSamples.clear();for(let t=0;tthis._InvokeFunctionFromJS(e,t)}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(e){const t=C3.New(C3.EventSheet,this,e);this._allSheets.push(t),this._sheetsByName.set(t.GetName().toLowerCase(),t)}_AddTriggerToPostInit(e){this._triggersToPostInit.push(e)}_PostInit(){for(const e of this._functionBlocksByName.values())e._PostInit(!1);for(const e of this._allSheets)e._PostInit();for(const e of this._allSheets)e._UpdateDeepIncludes();for(const e of this._triggersToPostInit)e._PostInit(!1);C3.clearArray(this._triggersToPostInit),this._localVarStack._SetInitialValues(this._localVarInitialValues)}GetRuntime(){return this._runtime}GetEventSheetByName(e){return this._sheetsByName.get(e.toLowerCase())||null}_RegisterGroup(e){this._allGroups.push(e),this._groupsByName.set(e.GetGroupName(),e)}_RegisterEventBlock(e){this._blocksBySid.set(e.GetSID(),e)}_RegisterCondition(e){this._cndsBySid.set(e.GetSID(),e)}_RegisterAction(e){this._actsBySid.set(e.GetSID(),e)}_RegisterFunctionBlock(e){this._functionBlocksByName.set(e.GetFunctionName().toLowerCase(),e)}_RegisterEventVariable(e){this._eventVarsBySid.set(e.GetSID(),e),e.IsGlobal()?this._allGlobalVars.push(e):this._allLocalVars.push(e)}_DeduplicateSolModifierList(n){2<=n.length&&n.sort(e);let r=this._allUniqueSolModifiers.get(n.length);r||(r=[],this._allUniqueSolModifiers.set(n.length,r));for(let s=0,a=r.length;sr=e);return this._queuedDebugTriggers.push([t,a,n,r]),s}*_RunQueuedDebugTriggersGen(){if(this._runtime.HitBreakpoint())throw new Error('should not be in breakpoint');for(const t=this._runtime.GetLayoutManager();this._queuedDebugTriggers.length;){const[a,n,r,s]=this._queuedDebugTriggers.shift(),e=yield*this._DebugTrigger(t,a,n,r);s(e)}}async RunQueuedDebugTriggersAsync(){for(const e of this._RunQueuedDebugTriggersGen())await this._runtime.DebugBreak(e)}_FastTrigger(t,n,r,s){let l=!1;const _=t.GetMainRunningLayout(),d=_.GetEventSheet();if(d){this._executingTriggerDepth++,this._runtime.PushCurrentLayout(_);const e=d.deepIncludes();for(let t=0,a=e.length;te.ShouldRelease());for(const t of e)t.Release()}ClearAllScheduledWaits(){for(const e of this._scheduledWaits)e.Release();C3.clearArray(this._scheduledWaits)}RemoveInstancesFromScheduledWaits(e){for(const t of this._scheduledWaits)t.RemoveInstances(e)}AddAsyncActionPromise(e){this._asyncActionPromises.push(e)}ClearAsyncActionPromises(){C3.clearArray(this._asyncActionPromises)}GetPromiseForAllAsyncActions(){const e=Promise.all(this._asyncActionPromises);return this._asyncActionPromises=[],e}_SaveToJson(){return{groups:this._SaveGroupsToJson(),cnds:this._SaveCndsToJson(),acts:this._SaveActsToJson(),vars:this._SaveVarsToJson(),waits:this._SaveScheduledWaitsToJson()}}_LoadFromJson(e){this._LoadGroupsFromJson(e.groups),this._LoadCndsFromJson(e.cnds),this._LoadActsFromJson(e.acts),this._LoadVarsFromJson(e.vars),this._LoadScheduledWaitsFromJson(e.waits)}_SaveGroupsToJson(){const e={};for(const t of this.GetAllGroups())e[t.GetSID().toString()]=t.IsGroupActive();return e}_LoadGroupsFromJson(e){for(const[t,n]of Object.entries(e)){const e=parseInt(t,10),a=this.GetEventGroupBySID(e);a&&a.SetGroupActive(n)}}_SaveCndsToJson(){const e={};for(const[t,a]of this._cndsBySid){const n=a._SaveToJson();n&&(e[t.toString()]=n)}return e}_LoadCndsFromJson(e){for(const[t,n]of Object.entries(e)){const e=parseInt(t,10),a=this.GetConditionBySID(e);a&&a._LoadFromJson(n)}}_SaveActsToJson(){const e={};for(const[t,a]of this._actsBySid){const n=a._SaveToJson();n&&(e[t.toString()]=n)}return e}_LoadActsFromJson(e){for(const[t,n]of Object.entries(e)){const e=parseInt(t,10),a=this.GetActionBySID(e);a&&a._LoadFromJson(n)}}_SaveVarsToJson(){const e={};for(const[t,a]of this._eventVarsBySid)!a.IsConstant()&&(a.IsGlobal()||a.IsStatic())&&(e[t.toString()]=a.GetValue());return e}_LoadVarsFromJson(e){for(const[t,n]of Object.entries(e)){const e=parseInt(t,10),a=this.GetEventVariableBySID(e);a&&a.SetValue(n)}}_SaveScheduledWaitsToJson(){return this._scheduledWaits.filter(e=>!e.IsPromise()).map(e=>e._SaveToJson())}_LoadScheduledWaitsFromJson(e){this.ClearAllScheduledWaits();for(const t of e){const e=C3.ScheduledWait._CreateFromJson(this,t);e&&this._scheduledWaits.push(e)}}_GetPerfRecords(){return[...this._runtime.GetLayoutManager().runningLayouts()].map(e=>e.GetEventSheet()).filter(e=>e).map(e=>e._GetPerfRecord())}FindFirstFunctionBlockParent(e){for(;e;){const t=e.GetScopeParent();if(t instanceof C3.FunctionBlock)return t;e=e.GetParent()}return null}_InvokeFunctionFromJS(t,a){Array.isArray(a)||(a=[]);const n=this.GetFunctionBlockByName(t.toLowerCase());if(!n)return null;if(!n.IsEnabled())return n.GetDefaultReturnValue();const r=n.GetFunctionParameters();if(a.lengthe.DebugCanRunFast()),e.canRunAllActionsFast=this._actions.every(e=>e.DebugCanRunFast()),e.canRunAllSubEventsFast=this._subEvents.every(e=>e.DebugCanRunFast()),e.canRunSelfFast=e.canRunAllConditionsFast&&e.canRunAllActionsFast&&e.canRunAllSubEventsFast}_UpdateCanRunFastRecursive(){let e=this;do e._UpdateCanRunFast(),e=e.GetParent();while(e)}_IdentifyTopLevelGroup(){if(!this.IsGroup())return;let e=this.GetParent();for(this._isTopLevelGroup=!0;e;){if(!e.IsGroup()){this._isTopLevelGroup=!1;break}e=e.GetParent()}}_IdentifySolModifiersIncludingParents(){const e=this._runtime.GetAllObjectClasses();if(this._solModifiers===e)this._solModifiersIncludingParents=e;else{this._solModifiersIncludingParents=C3.cloneArray(this._solModifiers);for(let e=this.GetParent();e;){for(const t of e._solModifiers)this._AddParentSolModifier(t);e=e.GetParent()}const e=this.GetEventSheetManager();this._solModifiers=e._DeduplicateSolModifierList(this._solModifiers),this._solModifiersIncludingParents=e._DeduplicateSolModifierList(this._solModifiersIncludingParents)}}_IdentifyTriggerParents(){if(this.HasAnyTriggeredCondition()){this._triggerParents=[];for(let e=this.GetParent();e;)this._triggerParents.push(e),e=e.GetParent();this._triggerParents.reverse()}}SetSolWriterAfterCnds(){this._isSolWriterAfterCnds=!0,this._parent&&this._parent.SetSolWriterAfterCnds()}IsSolWriterAfterCnds(){return this._isSolWriterAfterCnds}GetSolModifiers(){return this._solModifiers}GetSolModifiersIncludingParents(){return this._hasGotSolModifiersIncludingParents||(this._hasGotSolModifiersIncludingParents=!0,this._IdentifySolModifiersIncludingParents()),this._solModifiersIncludingParents}HasSolModifier(e){return this._solModifiers.includes(e)}GetTriggerParents(){return this._triggerParents}GetEventSheet(){return this._eventSheet}GetEventSheetManager(){return this._eventSheet.GetEventSheetManager()}GetRuntime(){return this._runtime}GetParent(){return this._parent}_SetScopeParent(e){this._scopeParent=e}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(e){this._debugData.isBreakpoint=!!e,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(e){if(e=!!e,!this._isGroup)throw new Error('not a group');if(this._isGroupActive!==e){this._isGroupActive=e;for(const e of this._containedIncludes)e.UpdateActive();if(this._containedIncludes.length){const e=this._runtime.GetCurrentLayout(),t=e.GetEventSheet();t&&t._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(e=>e.IsTrigger())}GetConditions(){return this._conditions}GetConditionCount(){return this._conditions.length}GetConditionAt(e){if(e=Math.floor(e),0>e||e>=this._conditions.length)throw new RangeError('invalid condition index');return this._conditions[e]}GetConditionByDebugIndex(e){return this.GetConditionAt(e)}IsFirstConditionOfType(e){let t=e.GetIndex();if(0===t)return!0;for(--t;0<=t;--t)if(this._conditions[t].GetObjectClass()===e.GetObjectClass())return!1;return!0}GetActions(){return this._actions}GetActionCount(){return this._actions.length}GetActionAt(e){if(e=Math.floor(e),0>e||e>=this._actions.length)throw new RangeError('invalid action index');return this._actions[e]}GetActionByDebugIndex(e){e=Math.floor(e);const t=this._actions.find(t=>t.GetDebugIndex()===e);if(!t)throw new RangeError('invalid action debug index');return t}_HasActionIndex(e){return e=Math.floor(e),0<=e&&ee instanceof C3.EventVariable)}RunPreTrigger(t){t.SetCurrentEvent(this);let a=!1;const n=this._conditions;for(let r=0,e=n.length;re.Get(0));e.GetLocalVarStack().Push(),this._scopeParent.SetFunctionParameters(a)}else this._scopeParent.EvaluateFunctionParameters(t)}RunAsFunctionCall(t,a){let n,r;const s=0C3.EventVariable.Create(e,this,t)),this._isEnabled=n[3],this._isAsync=n[4],this._nextAsyncId=0,this._currentAsyncId=-1,this._asyncMap=new Map,this._eventBlock=C3.EventBlock.Create(e,t,a),this._eventBlock._SetScopeParent(this)}static Create(e,t,a){return C3.New(C3.FunctionBlock,e,t,a)}_PostInit(){for(const e of this._functionParameters)e._PostInit();this._eventBlock._PostInit(!1)}_GetEventVariableNameInScope(e){for(const t of this._functionParameters)if(C3.equalsNoCase(e,t.GetName()))return t;return null}_GetAllLocalVariablesInScope(){return this._functionParameters}GetFunctionParameters(){return this._functionParameters}GetFunctionParameterCount(){return this._functionParameters.length}EvaluateFunctionParameters(e){const t=this._functionParameters;for(let a=0,n=t.length;ae.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 e=this._nextAsyncId++;this._currentAsyncId=e;let t;const a=new Promise(e=>t=e);return this._asyncMap.set(e,{resolve:t,pauseCount:0}),[e,a]}MaybeFinishAsyncFunctionCall(e){const t=this._asyncMap.get(e);0===t.pauseCount&&(t.resolve(),this._asyncMap.delete(e)),this._currentAsyncId=-1}PauseCurrentAsyncFunction(){const e=this._asyncMap.get(this._currentAsyncId);return e.pauseCount++,this._currentAsyncId}ResumeAsyncFunction(e){this._currentAsyncId=e;const t=this._asyncMap.get(e);t.pauseCount--}},'use strict';{const e=[];C3.EventVariable=class extends C3.DefendedBase{constructor(e,t,a){super();const n=e.GetEventSheetManager();this._eventSheet=e,this._eventSheetManager=n,this._runtime=e.GetRuntime(),this._parent=t,this._localVarStack=n.GetLocalVarStack(),this._name=a[1],this._type=a[2],this._initialValue=a[3],this._isStatic=!!a[4],this._isConstant=!!a[5],this._isFunctionParameter=t instanceof C3.FunctionBlock,this._sid=a[6],this._jsPropName=this._runtime.GetJsPropName(a[8]),this._scriptSetter=e=>this.SetValue(e),this._scriptGetter=()=>this.GetValue(),this._hasSingleValue=!this._parent||this._isStatic||this._isConstant,this._value=this._initialValue,this._localIndex=-1,this.IsBoolean()&&(this._value=this._value?1:0),!this.IsLocal()||this.IsStatic()||this.IsConstant()||(this._localIndex=n._GetNextLocalVarIndex(this)),n._RegisterEventVariable(this)}static Create(e,t,a){return C3.New(C3.EventVariable,e,t,a)}_PostInit(){}GetName(){return this._name}GetJsPropName(){return this._jsPropName}GetParent(){return this._parent}IsGlobal(){return!this.GetParent()}IsLocal(){return!this.IsGlobal()}IsFunctionParameter(){return this._isFunctionParameter}IsStatic(){return this._isStatic}IsConstant(){return this._isConstant}IsNumber(){return 0===this._type}IsString(){return 1===this._type}IsBoolean(){return 2===this._type}IsElseBlock(){return!1}GetSID(){return this._sid}GetInitialValue(){return this._initialValue}GetSolModifiers(){return e}Run(){!this.IsLocal()||this.IsStatic()||this.IsConstant()||this.SetValue(this.GetInitialValue())}DebugCanRunFast(){return!0}*DebugRun(e){this.Run(e)}SetValue(e){this.IsNumber()?'number'!=typeof e&&(e=parseFloat(e)):this.IsString()?'string'!=typeof e&&(e=e.toString()):this.IsBoolean()&&(e=e?1:0),this._hasSingleValue?this._value=e:this._localVarStack.GetCurrent()[this._localIndex]=e}GetValue(){return this._hasSingleValue?this._value:this._localVarStack.GetCurrent()[this._localIndex]}GetTypedValue(){let e=this.GetValue();return this.IsBoolean()&&(e=!!e),e}ResetToInitialValue(){this._value=this._initialValue}_GetScriptInterfaceDescriptor(){return{configurable:!1,enumerable:!0,get:this._scriptGetter,set:this._scriptSetter}}}}{const e=[];C3.EventInclude=class extends C3.DefendedBase{constructor(e,t,a){super();const n=e.GetEventSheetManager();this._eventSheet=e,this._eventSheetManager=n,this._runtime=e.GetRuntime(),this._parent=t,this._includeSheet=null,this._includeSheetName=a[1],this._isActive=!0}static Create(e,t,a){return C3.New(C3.EventInclude,e,t,a)}_PostInit(){this._includeSheet=this._eventSheetManager.GetEventSheetByName(this._includeSheetName),this._eventSheet._AddShallowInclude(this);for(let e=this.GetParent();e;)e instanceof C3.EventBlock&&e.IsGroup()&&e._AddContainedInclude(this),e=e.GetParent();this.UpdateActive(),this._runtime.IsDebug()&&this._eventSheet._GetPerfRecord().children.push(this._includeSheet._GetPerfRecord())}GetParent(){return this._parent}GetSolModifiers(){return e}GetIncludeSheet(){return this._includeSheet}Run(){const e=!!this.GetParent(),t=this._runtime.GetAllObjectClasses();e&&this._eventSheetManager.PushCleanSol(t),this._includeSheet.Run(),e&&this._eventSheetManager.PopSol(t)}*DebugRun(){const e=!!this.GetParent(),t=this._runtime.GetAllObjectClasses();e&&this._eventSheetManager.PushCleanSol(t),yield*this._includeSheet.DebugRun(),e&&this._eventSheetManager.PopSol(t)}DebugCanRunFast(){return!1}IsActive(){return this._isActive}UpdateActive(){for(let e=this.GetParent();e;){if(e instanceof C3.EventBlock&&e.IsGroup()&&!e.IsGroupActive())return void(this._isActive=!1);e=e.GetParent()}this._isActive=!0}}}{function t(e,t){return e>=t?e%t:0>e?(e<=-t&&(e%=t),0>e&&(e+=t),e):e}C3.ExpNode=class extends C3.DefendedBase{constructor(e){super(),this._owner=e,this._runtime=e.GetRuntime()}_PostInit(){}static CreateNode(t,a){const d=a[0];return C3.New([e,s,l,_,n,r][d],t,a)}};class n extends C3.ExpNode{constructor(e,t){super(e),this._systemPlugin=this._runtime.GetSystemPlugin(),this._func=this._runtime.GetObjectReference(t[1]),(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 r extends C3.ExpNode{constructor(e,t){super(e),this._functionBlock=null,this._functionName=t[1],this._owner.SetVariesPerInstance()}_PostInit(){const e=this._runtime.GetEventSheetManager();this._functionBlock=e.GetFunctionBlockByName(this._functionName),this._functionName=null;const t=this._owner.GetEventBlock(),a=this._functionBlock.GetEventBlock();this._combinedSolModifiers=[...new Set([...t.GetSolModifiersIncludingParents(),...a.GetSolModifiersIncludingParents()])],this._combinedSolModifiers=e._DeduplicateSolModifierList(this._combinedSolModifiers)}GetBoundMethod(){const e=this._functionBlock;if(e.IsEnabled()){const t=e.GetEventBlock();return C3.EventBlock.prototype.RunAsExpressionFunctionCall.bind(t,this._combinedSolModifiers,e.GetReturnType(),e.GetDefaultReturnValue())}else{const t=e.GetDefaultReturnValue();return()=>t}}}class s extends C3.ExpNode{constructor(e,t){super(e),this._objectClass=this._runtime.GetObjectClassByIndex(t[1]),this._func=this._runtime.GetObjectReference(t[2]),this._returnsString=!!t[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(...a){const n=this._objectClass,r=n.GetCurrentSol().GetExpressionInstances(),s=r.length;if(0===s)return this._returnsString?'':0;const e=t(this._owner.GetSolIndex(),s);return this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(n),this._func.apply(r[e].GetSdkInstance(),a)}ExpObject_InstExpr(a,...n){const r=this._objectClass,s=r.GetInstances(),e=s.length;if(0===e)return this._returnsString?'':0;const l=t(a,e);return this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(r),this._func.apply(s[l].GetSdkInstance(),n)}}class l extends C3.ExpNode{constructor(e,t){super(e),this._objectClass=this._runtime.GetObjectClassByIndex(t[1]),this._varIndex=t[3],this._returnsString=!!t[2],this._owner._MaybeVaryFor(this._objectClass)}ExpInstVar(){const e=this._objectClass.GetCurrentSol().GetExpressionInstances(),a=e.length;if(0===a)return this._returnsString?'':0;const n=t(this._owner.GetSolIndex(),a);return e[n]._GetInstanceVariableValueUnchecked(this._varIndex)}ExpInstVar_Family(){const a=this._objectClass,n=a.GetCurrentSol().GetExpressionInstances(),r=n.length;if(0===r)return this._returnsString?'':0;const s=t(this._owner.GetSolIndex(),r),e=n[s],l=e.GetObjectClass().GetFamilyInstanceVariableOffset(a.GetFamilyIndex());return e._GetInstanceVariableValueUnchecked(this._varIndex+l)}ExpInstVar_InstExpr(a){const n=this._objectClass,r=n.GetInstances(),s=r.length;if(0===s)return this._returnsString?'':0;const e=t(a,s),l=r[e];let _=0;return n.IsFamily()&&(_=l.GetObjectClass().GetFamilyInstanceVariableOffset(n.GetFamilyIndex())),l._GetInstanceVariableValueUnchecked(this._varIndex+_)}}class e extends C3.ExpNode{constructor(e,t){super(e),this._objectClass=this._runtime.GetObjectClassByIndex(t[1]),this._behaviorType=this._objectClass.GetBehaviorTypeByName(t[2]),this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(t[2]),this._func=this._runtime.GetObjectReference(t[3]),this._returnsString=!!t[4],this._eventStack=this._runtime.GetEventSheetManager().GetEventStack(),this._owner._MaybeVaryFor(this._objectClass)}ExpBehavior(...a){const n=this._objectClass,r=n.GetCurrentSol().GetExpressionInstances(),s=r.length;if(0===s)return this._returnsString?'':0;const e=t(this._owner.GetSolIndex(),s);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(n);const l=r[e];let _=0;return n.IsFamily()&&(_=l.GetObjectClass().GetFamilyBehaviorOffset(n.GetFamilyIndex())),this._func.apply(l.GetBehaviorInstances()[this._behaviorIndex+_].GetSdkInstance(),a)}ExpBehavior_InstExpr(a,...n){const r=this._objectClass,s=r.GetInstances(),e=s.length;if(0===e)return this._returnsString?'':0;const l=t(a,e);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(r);const _=s[l];let d=0;return r.IsFamily()&&(d=_.GetObjectClass().GetFamilyBehaviorOffset(r.GetFamilyIndex())),this._func.apply(_.GetBehaviorInstances()[this._behaviorIndex+d].GetSdkInstance(),n)}}class _ extends C3.ExpNode{constructor(e,t){super(e),this._eventVar=null,this._eventVarName=t[1]}_PostInit(){this._eventVar=this._runtime.GetEventSheetManager().GetEventVariableByName(this._eventVarName,this._owner.GetEventBlock()),this._eventVarName=null}GetVar(){return this._eventVar}}}{function t(e){const t=self.C3_ExpressionFuncs[e];if(!t)throw new Error('invalid expression number');return t}C3.Parameter=class extends C3.DefendedBase{constructor(e,t,a){super(),this._owner=e,this._index=a,this._type=t,this.Get=null,this._variesPerInstance=!1,this._isConstant=!1}static Create(t,a,p){const G=a[0];return C3.New([s,_,f,d,c,u,g,s,d,d,y,S,f,m,_,h,e,l,n][G],t,G,p,a)}_PostInit(){}SetVariesPerInstance(){this._variesPerInstance=!0}_MaybeVaryFor(e){!this._variesPerInstance&&e&&(e.GetPlugin().IsSingleGlobal()||(this._variesPerInstance=!0))}VariesPerInstance(){return this._variesPerInstance}GetIndex(){return this._index}GetRuntime(){return this._owner.GetRuntime()}GetEventBlock(){return this._owner.GetEventBlock()}IsConstant(){return this._isConstant}};class s extends C3.Parameter{constructor(a,n,r,s){super(a,n,r),this._solIndex=0;const e=s[1];this._expressionNumber=e[0],this._numberedNodes=[],this._expressionFunc=null;for(let t=1,l=e.length;te||e>=this._numberedNodes.length)throw new RangeError('invalid numbered node');return this._numberedNodes[e]}_PostInit(){for(const e of this._numberedNodes)e._PostInit();const e=t(this._expressionNumber);this._expressionFunc=this._numberedNodes.length?e(this):e}GetSolIndex(){return this._solIndex}GetExpression(e){return this._solIndex=e,this._expressionFunc()}}class _ extends s{constructor(e,t,a,n){super(e,t,a,n),this.Get=this.GetStringExpression,14===t&&(this.GetEventBlock().SetAllSolModifiers(),this._owner instanceof C3.Action&&this.GetEventBlock().SetSolWriterAfterCnds())}GetStringExpression(e){this._solIndex=e;const t=this._expressionFunc();return'string'==typeof t?t:''}_GetFastTriggerValue(){return t(this._expressionNumber)()}}class u extends s{constructor(e,t,a,n){super(e,t,a,n),this.Get=this.GetLayer,this._isConstant=!1}GetLayer(e){this._solIndex=e;const t=this._expressionFunc(),a=this.GetRuntime().GetCurrentLayout();return a.GetLayer(t)}}class d extends C3.Parameter{constructor(e,t,a,n){super(e,t,a),this._combo=n[1],this.Get=this.GetCombo,this._isConstant=!0}GetCombo(){return this._combo}}class e extends C3.Parameter{constructor(e,t,a,n){super(e,t,a),this._bool=n[1],this.Get=this.GetBoolean,this._isConstant=!0}GetBoolean(){return this._bool}}class c extends C3.Parameter{constructor(t,a,n,r){super(t,a,n),this._objectClass=this.GetRuntime().GetObjectClassByIndex(r[1]),this.Get=this.GetObjectClass;const s=this.GetEventBlock();s._AddSolModifier(this._objectClass),this._owner instanceof C3.Action?s.SetSolWriterAfterCnds():s.GetParent()&&s.GetParent().SetSolWriterAfterCnds(),this._isConstant=!0}GetObjectClass(){return this._objectClass}}class g extends C3.Parameter{constructor(e,t,a,n){super(e,t,a),this._layout=this.GetRuntime().GetLayoutManager().GetLayoutByName(n[1]),this.Get=this.GetLayout,this._isConstant=!0}GetLayout(){return this._layout}}class h extends C3.Parameter{constructor(e,t,a,n){super(e,t,a),this._timeline=this.GetRuntime().GetTimelineManager().GetTimelineByName(n[1]),this.Get=this.GetTimeline,this._isConstant=!0}GetTimeline(){return this._timeline}}class f extends C3.Parameter{constructor(e,t,a,n){super(e,t,a),this._fileInfo=n[1],this.Get=this.GetFile,this._isConstant=!0}GetFile(){return this._fileInfo}}class y extends C3.Parameter{constructor(t,a,n,r){super(t,a,n),this._instVarIndex=r[1];const s=this._owner.GetObjectClass();s&&s.IsFamily()?(this.Get=this.GetFamilyInstanceVariable,this.SetVariesPerInstance()):(this.Get=this.GetInstanceVariable,this._isConstant=!0)}GetInstanceVariable(){return this._instVarIndex}GetFamilyInstanceVariable(t){t=t||0;const n=this._owner.GetObjectClass(),r=n.GetCurrentSol(),s=r.GetInstances();let l=null;if(s.length)l=s[t%s.length].GetObjectClass();else if(r.HasAnyElseInstances()){const e=r.GetElseInstances();l=e[t%e.length].GetObjectClass()}else if(0[e[0].GetUID(),e[1].GetUID(),e[2]])),e[t]=n}return{ex:e}}_LoadFromJson(e){const t=this._runtime,n=e.ex;if(n){const r=this.GetSavedDataMap();r.clear();for(const[a,s]of Object.entries(n)){let e=s;'collmemory'===a&&(e=C3.New(C3.PairMap,s.map(e=>[t.GetInstanceByUID(e[0]),t.GetInstanceByUID(e[1]),e[2]]).filter(e=>e[0]&&e[1]))),r.set(a,e)}}else this._savedData&&(this._savedData.clear(),this._savedData=null)}}}{function e(e,t){for(let a=0,n=e.length;ae.VariesPerInstance())?(this.Run=this._RunObject_AllParamsVary,this.DebugRun=this._DebugRunObject_AllParamsVary):this._anyParamVariesPerInstance?(this.Run=this._RunObject_SomeParamsVary,this.DebugRun=this._DebugRunObject_SomeParamsVary):this._parameters.every(e=>e.IsConstant())?(e(this._parameters,this._results),this.Run=this._RunObject_ParamsConst,this.DebugRun=this._DebugRunObject_ParamsConst):(this.Run=this._RunObject_ParamsDontVary,this.DebugRun=this._DebugRunObject_ParamsDontVary):(this.Run=this._RunObject_ParamsConst,this.DebugRun=this._DebugRunObject_ParamsConst)}_SetSystemRunMethod(){const e=this._systemPlugin,t=this._systemPlugin;this._SetRunMethodForBoundFunc(e,t,this._RunSystem)}_SetSingleGlobalRunMethod(){const e=this._objectClass.GetPlugin(),t=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();this._SetRunMethodForBoundFunc(e,t,this._RunSingleGlobal)}_SetCallFunctionRunMethod(){const e=this._eventBlock.GetEventSheetManager(),t=e.GetFunctionBlockByName(this._callFunctionName);t.IsEnabled()?(this._callEventBlock=t.GetEventBlock(),this._combinedSolModifiers=[...new Set([...this._eventBlock.GetSolModifiersIncludingParents(),...this._callEventBlock.GetSolModifiersIncludingParents()])],this._combinedSolModifiers=e._DeduplicateSolModifierList(this._combinedSolModifiers),this.Run=C3.EventBlock.prototype.RunAsFunctionCall.bind(this._callEventBlock,this._combinedSolModifiers,this._parameters),this.DebugRun=this._DebugRunCallFunction):(this.Run=n,this.DebugRun=r)}_SetRunMethodForBoundFunc(t,a,n){const r=this._func,s=this._parameters;if(0===s.length)this.Run=t._GetBoundACEMethod(r,a);else if(1===s.length){const n=s[0];if(n.IsConstant())this.Run=t._GetBoundACEMethod_1param(r,a,n.Get(0));else{const s=t._GetBoundACEMethod(r,a);this.Run=function(){return s(n.Get(0))}}}else if(2===s.length){const n=s[0],l=s[1];if(n.IsConstant()&&l.IsConstant())this.Run=t._GetBoundACEMethod_2params(r,a,n.Get(0),l.Get(0));else{const s=t._GetBoundACEMethod(r,a);this.Run=function(){return s(n.Get(0),l.Get(0))}}}else if(3===s.length){const n=s[0],l=s[1],_=s[2];if(n.IsConstant()&&l.IsConstant()&&_.IsConstant())this.Run=t._GetBoundACEMethod_3params(r,a,n.Get(0),l.Get(0),_.Get(0));else{const s=t._GetBoundACEMethod(r,a);this.Run=function(){return s(n.Get(0),l.Get(0),_.Get(0))}}}else this.Run=n}GetSID(){return this._sid}IsAsync(){return 1===this._actionReturnType}CanBailOut(){return 2===this._actionReturnType}HasReturnType(){return 0!==this._actionReturnType}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(e){this._debugData.isBreakpoint=!!e,this._eventBlock._UpdateCanRunFastRecursive()}_DebugReturnsGenerator(){return this._debugData.canDebug}DebugCanRunFast(){return!this.IsBreakpoint()&&!this._runtime.DebugBreakNext()&&!this._DebugReturnsGenerator()}GetSavedDataMap(){return this._savedData||(this._savedData=new Map),this._savedData}GetUnsavedDataMap(){return this._unsavedData||(this._unsavedData=new Map),this._unsavedData}_RunSystem(){const t=this._results;return e(this._parameters,t),this._func.apply(this._systemPlugin,t)}*_DebugRunSystem(){if((this.IsBreakpoint()||this._runtime.DebugBreakNext())&&(yield this),this._DebugReturnsGenerator()){const t=this._results;e(this._parameters,t);const a=yield*this._func.apply(this._systemPlugin,t);return a}return this.Run()}*_DebugRunCallFunction(){(this.IsBreakpoint()||this._runtime.DebugBreakNext())&&(yield this);const e=yield*this._callEventBlock.DebugRunAsFunctionCall(this._combinedSolModifiers,this._parameters);return e}_RunSingleGlobal(){const t=this._results;return e(this._parameters,t),this._func.apply(this._objectClass.GetSingleGlobalInstance().GetSdkInstance(),t)}*_DebugRunSingleGlobal(){if((this.IsBreakpoint()||this._runtime.DebugBreakNext())&&(yield this),this._DebugReturnsGenerator()){const t=this._results;e(this._parameters,t);const a=yield*this._func.apply(this._objectClass.GetSingleGlobalInstance().GetSdkInstance(),t);return a}return this.Run()}_RunObject_ParamsConst(){const e=this._results,t=this._objectClass.GetCurrentSol().GetInstances();for(let a=0,n=t.length;aa.getRight()||0>a.getBottom()||a.getLeft()>t.GetWidth()||a.getTop()>t.GetHeight()}function d(t,a,n){const r=this.GetCurrentSol(),s=r.GetInstances();if(!s.length)return!1;let e=s[0],l=e.GetWorldInfo(),_=e,u=C3.distanceSquared(l.GetX(),l.GetY(),a,n);for(let r=1,d=s.length;ru)&&(u=d,_=e)}return r.PickOne(_),!0}function e(e){const t=this.GetWorldInfo();t.GetX()===e||(t.SetX(e),t.SetBboxChanged())}function f(e){const t=this.GetWorldInfo();t.GetY()===e||(t.SetY(e),t.SetBboxChanged())}function g(e,t){const a=this.GetWorldInfo();a.EqualsXY(e,t)||(a.SetXY(e,t),a.SetBboxChanged())}function h(e,t){if(e){const n=e.GetPairedInstance(this._inst);if(n){const[r,a]=n.GetImagePoint(t),s=this.GetWorldInfo();s.GetX()===r&&s.GetY()===a||(s.SetXY(r,a),s.SetBboxChanged())}}}function te(e){if(0!==e){const t=this.GetWorldInfo();t.OffsetXY(t.GetCosAngle()*e,t.GetSinAngle()*e),t.SetBboxChanged()}}function j(e,t){if(0!==t){const a=this.GetWorldInfo();e=C3.toRadians(e),a.OffsetXY(Math.cos(e)*t,Math.sin(e)*t),a.SetBboxChanged()}}function k(){return this.GetWorldInfo().GetX()}function l(){return this.GetWorldInfo().GetY()}function m(){return this._runtime.GetDt(this._inst)}function n(e,t){return C3.compare(this.GetWorldInfo().GetWidth(),e,t)}function ae(e,t){return C3.compare(this.GetWorldInfo().GetHeight(),e,t)}function p(e){const t=this.GetWorldInfo();t.GetWidth()===e||(t.SetWidth(e),t.SetBboxChanged())}function q(e){const t=this.GetWorldInfo();t.GetHeight()===e||(t.SetHeight(e),t.SetBboxChanged())}function r(e,t){const a=this.GetWorldInfo();a.GetWidth()===e&&a.GetHeight()===t||(a.SetSize(e,t),a.SetBboxChanged())}function s(){return this.GetWorldInfo().GetWidth()}function t(){return this.GetWorldInfo().GetHeight()}function u(){return this.GetWorldInfo().GetBoundingBox().getLeft()}function v(){return this.GetWorldInfo().GetBoundingBox().getTop()}function w(){return this.GetWorldInfo().GetBoundingBox().getRight()}function x(){return this.GetWorldInfo().GetBoundingBox().getBottom()}function y(e,t){return C3.angleDiff(this.GetWorldInfo().GetAngle(),C3.toRadians(t))<=C3.toRadians(e)}function z(e){return C3.angleClockwise(this.GetWorldInfo().GetAngle(),C3.toRadians(e))}function A(t,n){const a=C3.toRadians(t),r=C3.toRadians(n),s=this.GetWorldInfo().GetAngle(),e=!C3.angleClockwise(r,a);return e?C3.angleClockwise(s,a)||!C3.angleClockwise(s,r):C3.angleClockwise(s,a)&&!C3.angleClockwise(s,r)}function B(e){const t=this.GetWorldInfo(),a=C3.clampAngle(C3.toRadians(e));isNaN(a)||t.GetAngle()===a||(t.SetAngle(a),t.SetBboxChanged())}function C(e){if(!(isNaN(e)||0===e)){const t=this.GetWorldInfo();t.SetAngle(t.GetAngle()+C3.toRadians(e)),t.SetBboxChanged()}}function D(e){if(!(isNaN(e)||0===e)){const t=this.GetWorldInfo();t.SetAngle(t.GetAngle()-C3.toRadians(e)),t.SetBboxChanged()}}function E(t,n){const r=this.GetWorldInfo(),s=r.GetAngle(),e=C3.angleRotate(s,C3.toRadians(n),C3.toRadians(t));isNaN(e)||s===e||(r.SetAngle(e),r.SetBboxChanged())}function F(t,n,r){const s=this.GetWorldInfo(),e=s.GetAngle(),l=n-s.GetX(),a=r-s.GetY(),_=Math.atan2(a,l),d=C3.angleRotate(e,_,C3.toRadians(t));isNaN(d)||e===d||(s.SetAngle(d),s.SetBboxChanged())}function G(t,n){const r=this.GetWorldInfo(),s=r.GetAngle(),e=t-r.GetX(),a=n-r.GetY(),l=Math.atan2(a,e);isNaN(l)||s===l||(r.SetAngle(l),r.SetBboxChanged())}function H(){return C3.toDegrees(this.GetWorldInfo().GetAngle())}function I(e,t){return C3.compare(C3.round6dp(100*this.GetWorldInfo().GetOpacity()),e,t)}function J(){return this.GetWorldInfo().IsVisible()}function K(e){const t=this.GetWorldInfo();e=2===e?!t.IsVisible():0!=e,t.IsVisible()===e||(t.SetVisible(e),this._runtime.UpdateRender())}function L(e){const t=C3.clamp(e/100,0,1),a=this.GetWorldInfo();a.GetOpacity()===t||(a.SetOpacity(t),this._runtime.UpdateRender())}function M(e){Pe.setFromRgbValue(e);const t=this.GetWorldInfo();t.GetUnpremultipliedColor().equalsIgnoringAlpha(Pe)||(t.SetUnpremultipliedColor(Pe),this._runtime.UpdateRender())}function N(){const e=this.GetWorldInfo().GetUnpremultipliedColor();return C3.PackRGBAEx(e.getR(),e.getG(),e.getB(),e.getA())}function O(){return C3.round6dp(100*this.GetWorldInfo().GetOpacity())}function P(e){return!!e&&this.GetWorldInfo().GetLayer()===e}function Q(t){const a=this.GetCurrentSol(),n=a.GetInstances();if(!n.length)return!1;let r=n[0],s=r;for(let e=1,a=n.length;ed||_===d&&r.GetZIndex()>l.GetZIndex())&&(s=a):(_t||t>=e.length)){const l=r.GetShaderProgram().GetParameterType(t);if('color'===l){Pe.setFromRgbValue(n);const r=e[t];if(Pe.equalsIgnoringAlpha(r))return;r.copyRgb(Pe)}else{if('percent'===l&&(n/=100),e[t]===n)return;e[t]=n}a.IsEffectIndexActive(s)&&this._runtime.UpdateRender()}}}function ie(e,t,a){return C3.compare(this.GetInstance().GetInstanceVariableValue(e),t,a)}function se(e){return!!this.GetInstance().GetInstanceVariableValue(e)}function oe(t,a){const n=this.GetCurrentSol(),r=n.GetInstances();if(!r.length)return!1;let s=r[0],l=s,_=s.GetInstanceVariableValue(a);for(let e=1,n=r.length;e_)&&(_=n,l=s)}return n.PickOne(l),!0}function le(e){return this._runtime.GetCurrentCondition().IsInverted()?de(this,e):_e(this,e)}function _e(e,t){const a=e.GetRuntime().GetInstanceByUID(t);if(!a)return!1;const n=e.GetCurrentSol();if(!n.IsSelectAll()&&!n._GetOwnInstances().includes(a))return!1;if(e.IsFamily()){if(a.GetObjectClass().BelongsToFamily(e))return n.PickOne(a),e.ApplySolToContainer(),!0;}else if(a.GetObjectClass()===e)return n.PickOne(a),e.ApplySolToContainer(),!0;return!1}function de(t,n){const r=t.GetCurrentSol();if(r.IsSelectAll()){r._SetSelectAll(!1),r.ClearArrays();const s=t.GetInstances();for(let t=0,a=s.length;tthis.SetSignalled()).catch(e=>{console.warn('[C3 runtime] Promise rejected in \'Wait for previous actions to complete\': ',e),this.SetSignalled()})}IsTimer(){return'timer'===this._type}IsSignal(){return'signal'===this._type}IsPromise(){return'promise'===this._type}GetSignalTag(){return this._signalTag}IsSignalled(){return this._isSignalled}SetSignalled(){this._isSignalled=!0}_ShouldRun(){return this.IsTimer()?this._time<=this._eventSheetManager.GetRuntime().GetGameTime():this.IsSignalled()}_RestoreState(e){e._Restore(this._event,this._actIndex);for(const[t,n]of this._sols.entries()){const e=t.GetCurrentSol();n._Restore(e)}const t=this._callingFunctionBlock;t&&(t.SetFunctionParameters(this._functionParameters),t.IsAsync()&&t.ResumeAsyncFunction(this._asyncId))}_Run(e){this._RestoreState(e),this._event._ResumeActionsAndSubEvents(e),this._callingFunctionBlock&&this._callingFunctionBlock.IsAsync()&&this._callingFunctionBlock.MaybeFinishAsyncFunctionCall(this._asyncId),this._eventSheetManager.ClearSol(this._solModifiers),this._shouldRelease=!0}async _DebugRun(e){this._RestoreState(e);for(const t of this._event._DebugResumeActionsAndSubEvents(e))await this._eventSheetManager.GetRuntime().DebugBreak(t);this._callingFunctionBlock&&this._callingFunctionBlock.IsAsync()&&this._callingFunctionBlock.MaybeFinishAsyncFunctionCall(this._asyncId),this._eventSheetManager.ClearSol(this._solModifiers),this._shouldRelease=!0}ShouldRelease(){return this._shouldRelease}RemoveInstances(e){for(const t of this._sols.values())t.RemoveInstances(e)}_SaveToJson(){const e={},t={t:this._time,st:this._signalTag,s:this._isSignalled,ev:this._event.GetSID(),sm:this._solModifiers.map(e=>e.GetSID()),sols:e};this._event._HasActionIndex(this._actIndex)&&(t.act=this._event.GetActionAt(this._actIndex).GetSID());for(const[t,a]of this._sols)e[t.GetSID().toString()]=a._SaveToJson();return t}static _CreateFromJson(t,a){const n=t.GetRuntime(),r=t.GetEventBlockBySID(a.ev);if(!r)return null;let s=0;if(a.hasOwnProperty('act')){const e=t.GetActionBySID(a.act);if(!e)return null;s=e.GetIndex()}const l=C3.New(C3.ScheduledWait,t);l._time=a.t,l._type=-1===l._time?'signal':'timer',l._signalTag=a.st,l._isSignalled=a.s,l._event=r,l._actIndex=s;for(const e of a.sm){const t=n.GetObjectClassBySID(e);t&&l._solModifiers.push(t)}for(const[r,s]of Object.entries(a.sols)){const e=parseInt(r,10),a=n.GetObjectClassBySID(e);if(!a)continue;const _=C3.New(C3.SolState,null);_._LoadFromJson(t,s),l._sols.set(a,_)}return l}},'use strict',C3.SolState=class extends C3.DefendedBase{constructor(e){super(),this._objectClass=null,this._isSelectAll=!0,this._instances=[],e&&(this._objectClass=e.GetObjectClass(),this._isSelectAll=e.IsSelectAll(),C3.shallowAssignArray(this._instances,e._GetOwnInstances()))}Release(){this._objectClass=null,C3.clearArray(this._instances)}_Restore(e){e._SetSelectAll(this._isSelectAll),C3.shallowAssignArray(e._GetOwnInstances(),this._instances)}RemoveInstances(e){C3.arrayRemoveAllInSet(this._instances,e)}_SaveToJson(){return{sa:this._isSelectAll,insts:this._instances.map(e=>e.GetUID())}}_LoadFromJson(e,t){const n=e.GetRuntime();this._isSelectAll=!!t.sa,C3.clearArray(this._instances);for(const r of t.insts){const e=n.GetInstanceByUID(r);e&&this._instances.push(e)}}},'use strict';{function t(e,t){let a=e.get(t);return a||(a=new Map,e.set(t,a)),a}C3.SDKPluginBase=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e.runtime,this._isSingleGlobal=!!e.isSingleGlobal,this._isWorldType=!!e.isWorld,this._isRotatable=!!e.isRotatable,this._mustPredraw=!!e.mustPredraw,this._hasEffects=!!e.hasEffects,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}_GetBoundACEMethod(e,t){if(!t)throw new Error('missing \'this\' binding');let a=this._boundACEMethodCache.get(e);return a?a:(a=e.bind(t),this._boundACEMethodCache.set(e,a),a)}_GetBoundACEMethod_1param(a,n,r){if(!n)throw new Error('missing \'this\' binding');const s=t(this._boundACEMethodCache_1param,a);let e=s.get(r);return e?e:(e=a.bind(n,r),s.set(r,e),e)}_GetBoundACEMethod_2params(a,n,r,s){if(!n)throw new Error('missing \'this\' binding');const e=t(this._boundACEMethodCache_2params,a),l=t(e,r);let _=l.get(s);return _?_:(_=a.bind(n,r,s),l.set(s,_),_)}_GetBoundACEMethod_3params(a,n,r,s,e){if(!n)throw new Error('missing \'this\' binding');const l=t(this._boundACEMethodCache_3params,a),_=t(l,r),d=t(_,s);let u=d.get(e);return u?u:(u=a.bind(n,r,s,e),d.set(e,u),u)}_SetSingleGlobalObjectClass(e){if(!this.IsSingleGlobal())throw new Error('must be single-global plugin');this._singleGlobalObjectClass=e}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()}}}'use strict',C3.SDKDOMPluginBase=class extends C3.SDKPluginBase{constructor(e,t){super(e),this._domComponentId=t,this._nextElementId=0,this._instMap=new Map}Release(){super.Release()}_AddElement(e){const t=this._nextElementId++;return this._instMap.set(t,e),t}_RemoveElement(e){this._instMap.delete(e)}AddElementMessageHandler(e,t){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,e,e=>{const a=this._instMap.get(e.elementId);t(a,e)})}},'use strict',C3.SDKTypeBase=class extends C3.DefendedBase{constructor(e){super(),this._objectClass=e,this._runtime=e.GetRuntime(),this._plugin=e.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(){}LoadTextures(){}ReleaseTextures(){}OnDynamicTextureLoadComplete(){}PreloadTexturesWithInstances(){}LoadTilePolyData(){}GetScriptInterfaceClass(){return null}},'use strict',C3.SDKInstanceBase=class extends C3.DefendedBase{constructor(e,t){super(),this._inst=e,this._domComponentId=t,this._runtime=e.GetRuntime(),this._objectClass=this._inst.GetObjectClass(),this._sdkType=this._objectClass.GetSdkType(),this._tickFunc=null,this._tick2Func=null,this._isTicking=!1,this._isTicking2=!1,this._disposables=null,this._wasReleased=!1}Release(){this._wasReleased=!0,this._StopTicking(),this._StopTicking2(),this._tickFunc=null,this._tick2Func=null,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(e){return this._runtime.Trigger(e,this._inst,null)}DebugTrigger(e){return this._runtime.DebugTrigger(e,this._inst,null)}TriggerAsync(e){return this._runtime.TriggerAsync(e,this._inst,null)}FastTrigger(e,t){return this._runtime.FastTrigger(e,this._inst,t)}DebugFastTrigger(e,t){return this._runtime.DebugFastTrigger(e,this._inst,t)}ScheduleTriggers(e){return this._runtime.ScheduleTriggers(e)}AddDOMMessageHandler(e,t){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,e,t)}AddDOMMessageHandlers(e){for(const[t,a]of e)this.AddDOMMessageHandler(t,a)}PostToDOM(e,t){this._runtime.PostComponentMessageToDOM(this._domComponentId,e,t)}PostToDOMAsync(e,t){return this._runtime.PostComponentMessageToDOMAsync(this._domComponentId,e,t)}_PostToDOMMaybeSync(e,t){this._runtime.IsInWorker()?this.PostToDOM(e,t):window.c3_runtimeInterface._OnMessageFromRuntime({type:'event',component:this._domComponentId,handler:e,data:t,responseId:null})}GetCurrentImageInfo(){return null}GetImagePoint(){const e=this._inst.GetWorldInfo();return[e.GetX(),e.GetY()]}Tick(){}Tick2(){}_StartTicking(){this._isTicking||(!this._tickFunc&&(this._tickFunc=()=>this.Tick()),this._runtime.Dispatcher().addEventListener('tick',this._tickFunc),this._isTicking=!0)}_StopTicking(){this._isTicking&&(this._runtime.Dispatcher().removeEventListener('tick',this._tickFunc),this._isTicking=!1)}IsTicking(){return this._isTicking}_StartTicking2(){this._isTicking2||(!this._tick2Func&&(this._tick2Func=()=>this.Tick2()),this._runtime.Dispatcher().addEventListener('tick2',this._tick2Func),this._isTicking2=!0)}_StopTicking2(){this._isTicking2&&(this._runtime.Dispatcher().removeEventListener('tick2',this._tick2Func),this._isTicking2=!1)}IsTicking2(){return this._isTicking2}GetDebuggerProperties(){return[]}SaveToJson(){return null}LoadFromJson(){}LoadTilemapData(){}TestPointOverlapTile(){}GetPropertyValueByIndex(){}SetPropertyValueByIndex(){}OffsetPropertyValueByIndex(e,t){if(0!==t){const a=this.GetPropertyValueByIndex(e);if('number'!=typeof a)throw new Error('expected number');this.SetPropertyValueByIndex(e,a+t)}}SetPropertyColorOffsetValueByIndex(){}CallAction(e,...t){e.call(this,...t)}CallExpression(e,...t){return e.call(this,...t)}GetScriptInterfaceClass(){return null}},'use strict',C3.SDKWorldInstanceBase=class extends C3.SDKInstanceBase{constructor(e,t){super(e,t),this._worldInfo=e.GetWorldInfo(),this._webglcontextlost_handler=null,this._webglcontextrestored_handler=null}Release(){if(this._webglcontextlost_handler){const e=this._runtime.Dispatcher();e.removeEventListener('webglcontextlost',this._webglcontextlost_handler),e.removeEventListener('webglcontextrestored',this._webglcontextrestored_handler),this._webglcontextlost_handler=null,this._webglcontextrestored_handler=null}this._worldInfo=null,super.Release()}HandleWebGLContextLoss(){if(!this._webglcontextlost_handler){this._webglcontextlost_handler=()=>this.OnWebGLContextLost(),this._webglcontextrestored_handler=()=>this.OnWebGLContextRestored();const e=this._runtime.Dispatcher();e.addEventListener('webglcontextlost',this._webglcontextlost_handler),e.addEventListener('webglcontextrestored',this._webglcontextrestored_handler)}}OnWebGLContextLost(){}OnWebGLContextRestored(){}GetWorldInfo(){return this._worldInfo}},'use strict';{const t=C3.New(C3.Rect);C3.SDKDOMInstanceBase=class extends C3.SDKWorldInstanceBase{constructor(e,t){super(e,t),this._elementId=this.GetPlugin()._AddElement(this),this._isElementShowing=!0,this._autoFontSize=!1,this._lastRect=C3.New(C3.Rect,0,0,-1,-1);const a=this._runtime.GetCanvasManager();this._lastWindowWidth=a.GetLastWidth(),this._lastWindowHeight=a.GetLastHeight(),this._isPendingUpdateState=!1,this._StartTicking()}Release(){this.GetPlugin()._RemoveElement(this._elementId),this.PostToDOMElement('destroy'),this._elementId=-1,super.Release()}PostToDOMElement(e,t){t||(t={}),t.elementId=this._elementId,this.PostToDOM(e,t)}_PostToDOMElementMaybeSync(e,t){t||(t={}),t.elementId=this._elementId,this._PostToDOMMaybeSync(e,t)}PostToDOMElementAsync(e,t){return t||(t={}),t.elementId=this._elementId,this.PostToDOMAsync(e,t)}CreateElement(e){e||(e={});const t=this.GetWorldInfo().IsVisible();e.elementId=this._elementId,e.isVisible=t,Object.assign(e,this.GetElementState()),this._isElementShowing=!!e.isVisible,this.PostToDOM('create',e),this._UpdatePosition(!0)}SetElementVisible(e){e=!!e,this._isElementShowing===e||(this._isElementShowing=e,this.PostToDOMElement('set-visible',{isVisible:e}))}Tick(){this._UpdatePosition(!1)}_ShouldPreserveElement(){const e=this._runtime.GetCanvasManager().GetFullscreenMode();return'Android'===C3.Platform.OS&&('scale-inner'===e||'scale-outer'===e||'crop'===e)}_UpdatePosition(a){var r=Math.round;const s=this.GetWorldInfo(),_=s.GetLayer(),e=s.GetX(),d=s.GetY();let[u,c]=_.LayerToCanvasCss(e,d),[g,f]=_.LayerToCanvasCss(e+s.GetWidth(),d+s.GetHeight());const y=this._runtime.GetCanvasManager(),l=y.GetCssWidth(),m=y.GetCssHeight();if(!s.IsVisible()||!_.IsVisible())return void this.SetElementVisible(!1);if(!this._ShouldPreserveElement()){if(0>=g||0>=f||u>=l||c>=m)return void this.SetElementVisible(!1);1>u&&(u=1),1>c&&(c=1),g>=l&&(g=l-1),f>=m&&(f=m-1)}t.set(u,c,g,f);const n=y.GetLastWidth(),S=y.GetLastHeight();if(!a&&t.equals(this._lastRect)&&this._lastWindowWidth===n&&this._lastWindowHeight===S)return void this.SetElementVisible(!0);this._lastRect.copy(t),this._lastWindowWidth=n,this._lastWindowHeight=S,this.SetElementVisible(!0);let p=null;this._autoFontSize&&(p=_.GetDisplayScale()-.2),this.PostToDOMElement('update-position',{left:r(this._lastRect.getLeft())+y.GetCanvasClientX(),top:r(this._lastRect.getTop())+y.GetCanvasClientY(),width:r(this._lastRect.width()),height:r(this._lastRect.height()),fontSize:p})}FocusElement(){this.PostToDOMElement('focus',{focus:!0})}BlurElement(){this.PostToDOMElement('focus',{focus:!1})}SetElementCSSStyle(e,t){this.PostToDOMElement('set-css-style',{prop:C3.CSSToCamelCase(e),val:t})}UpdateElementState(){this._isPendingUpdateState||(this._isPendingUpdateState=!0,Promise.resolve().then(()=>{this._isPendingUpdateState=!1,this.PostToDOMElement('update-state',this.GetElementState())}))}GetElementState(){}GetElementId(){return this._elementId}}}'use strict',C3.SDKBehaviorBase=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e.runtime,this._myObjectClasses=C3.New(C3.ArraySet),this._myInstances=C3.New(C3.ArraySet),this._iBehavior=null;const t=e.scriptInterfaceClass;if(!t)this._iBehavior=new IBehavior(this);else if(this._iBehavior=new t(this),!(this._iBehavior instanceof IBehavior))throw new TypeError('script interface class must derive from IBehavior')}Release(){this._myInstances.Release(),this._myObjectClasses.Release(),this._runtime=null}GetRuntime(){return this._runtime}OnCreate(){}_AddObjectClass(e){this._myObjectClasses.Add(e)}GetObjectClasses(){return this._myObjectClasses.GetArray()}_AddInstance(e){this._myInstances.Add(e)}_RemoveInstance(e){this._myInstances.Delete(e)}GetInstances(){return this._myInstances.GetArray()}GetIBehavior(){return this._iBehavior}},'use strict',C3.SDKBehaviorTypeBase=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e.GetRuntime(),this._behaviorType=e,this._objectClass=e.GetObjectClass(),this._behavior=e.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}},'use strict',C3.SDKBehaviorInstanceBase=class extends C3.DefendedBase{constructor(e,t){super(),this._behInst=e,this._domComponentId=t,this._inst=e.GetObjectInstance(),this._runtime=e.GetRuntime(),this._behaviorType=e.GetBehaviorType(),this._sdkType=this._behaviorType.GetSdkType(),this._isTicking=!1,this._isTicking2=!1,this._isPostTicking=!1,this._disposables=null}Release(){this._StopTicking(),this._StopTicking2(),this._StopPostTicking(),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}Trigger(e){return this._runtime.Trigger(e,this._inst,this._behaviorType)}DebugTrigger(e){return this._runtime.DebugTrigger(e,this._inst,this._behaviorType)}TriggerAsync(e){return this._runtime.TriggerAsync(e,this._inst,this._behaviorType)}PostCreate(){}Tick(){}Tick2(){}PostTick(){}_StartTicking(){this._isTicking||(this._runtime._AddBehInstToTick(this),this._isTicking=!0)}_StopTicking(){this._isTicking&&(this._runtime._RemoveBehInstToTick(this),this._isTicking=!1)}IsTicking(){return this._isTicking}_StartTicking2(){this._isTicking2||(this._runtime._AddBehInstToTick2(this),this._isTicking2=!0)}_StopTicking2(){this._isTicking2&&(this._runtime._RemoveBehInstToTick2(this),this._isTicking2=!1)}IsTicking2(){return this._isTicking2}_StartPostTicking(){this._isPostTicking||(this._runtime._AddBehInstToPostTick(this),this._isPostTicking=!0)}_StopPostTicking(){this._isPostTicking&&(this._runtime._RemoveBehInstToPostTick(this),this._isPostTicking=!1)}IsPostTicking(){return this._isPostTicking}GetDebuggerProperties(){return[]}AddDOMMessageHandler(e,t){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,e,t)}OnSpriteFrameChanged(){}SaveToJson(){return null}LoadFromJson(){}GetPropertyValueByIndex(){}SetPropertyValueByIndex(){}OffsetPropertyValueByIndex(e,t){if(0!==t){const a=this.GetPropertyValueByIndex(e);if('number'!=typeof a)throw new Error('expected number');this.SetPropertyValueByIndex(e,a+t)}}SetPropertyColorOffsetValueByIndex(){}CallAction(e,...t){e.call(this,...t)}CallExpression(e,...t){return e.call(this,...t)}GetScriptInterfaceClass(){return null}},'use strict';{function t(t,n){const a=t[0],r=n[0],s=a-r;if(0!=s)return s;const e=t[1],l=n[1];return e-l}let n=null;const r=new Set,s=[],l=[];let e=!1;self.IRuntime=class{constructor(t,a){n=t,Object.defineProperties(this,{assets:{value:n.GetAssetManager().GetIAssetManager(),writable:!1},objects:{value:a,writable:!1},globalVars:{value:{},writable:!1},projectName:{value:n.GetProjectName(),writable:!1},projectVersion:{value:n.GetProjectVersion(),writable:!1},storage:{value:new IStorage(n),writable:!1},isInWorker:{value:n.IsInWorker(),writable:!1}}),n.UserScriptDispatcher().addEventListener('keydown',e=>r.has(e.key)?void e.stopPropagation():void r.add(e.key)),n.UserScriptDispatcher().addEventListener('keyup',e=>r.delete(e.key)),n.Dispatcher().addEventListener('window-blur',()=>r.clear()),n.IsInWorker()&&(self.alert=t=>(e||(e=!0,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.')),this.alert(t)))}_InitGlobalVars(e){Object.defineProperties(this.globalVars,e)}addEventListener(e,t){n.UserScriptDispatcher().addEventListener(e,t)}removeEventListener(e,t){n.UserScriptDispatcher().removeEventListener(e,t)}callFunction(t,...a){const r=n.GetEventSheetManager(),s=r.GetFunctionBlockByName(t);if(!s)throw new Error(`cannot find function name '${t}'`);if(!s.IsEnabled())return s.GetDefaultReturnValue();if(a.lengthe.GetILayout())}goToLayout(e){const t=n.GetLayoutManager();let a=null;if('number'==typeof e||'string'==typeof e)a=t.GetLayout(e);else throw new TypeError('expected string or number');if(!a)throw new Error('invalid layout');t.IsPendingChangeMainLayout()||t.ChangeMainLayout(a)}get keyboard(){const e=n._GetCommonScriptInterfaces().keyboard;if(!e)throw new Error('runtime.keyboard used but Keyboard object missing - add it to your project first');return e}get mouse(){const e=n._GetCommonScriptInterfaces().mouse;if(!e)throw new Error('runtime.mouse used but Mouse object missing - add it to your project first');return e}get touch(){const e=n._GetCommonScriptInterfaces().touch;if(!e)throw new Error('runtime.touch used but Touch object missing - add it to your project first');return e}invokeDownload(e,t){n.InvokeDownload(e,t)}getInstanceByUid(e){const t=n.GetInstanceByUID(e);return t?t.GetInterfaceClass():null}sortZOrder(e,r){const _=n.GetCurrentLayout();for(const t of e){const e=n._UnwrapScriptInterface(t);if(!e||!e.GetWorldInfo())throw new Error('invalid instance');const a=e.GetWorldInfo();s.push([a.GetLayer().GetIndex(),a.GetZIndex()]),l.push(e)}if(0===s.length)return;s.sort(t),l.sort((e,t)=>r(e.GetInterfaceClass(),t.GetInterfaceClass()));let d=!1;for(let t=0,a=s.length;te.GetInterfaceClass())}getFirstInstance(){const e=t.get(this).GetInstances();return 0e.GetInterfaceClass())}getFirstPickedInstance(){const e=t.get(this).GetCurrentSol().GetInstances();return 0e.GetILayer())}}}{const e=new WeakMap;self.ILayer=class{constructor(t){e.set(this,t),Object.defineProperties(this,{name:{value:t.GetName(),writable:!1},index:{value:t.GetIndex(),writable:!1},layout:{value:t.GetLayout().GetILayout(),writable:!1}})}static _Unwrap(t){return e.get(t)}get isVisible(){return e.get(this).IsVisible()}set isVisible(t){e.get(this).SetVisible(t)}get opacity(){return e.get(this).GetOpacity()}set opacity(t){t=C3.clamp(+t,0,1),isNaN(t)||e.get(this).SetOpacity(t)}getViewport(){return e.get(this).GetViewport().toDOMRect()}}}{function e(e){let t=n.get(e);return t?t:(t=C3.New(C3.Event.Dispatcher),n.set(e,t),t)}const t=new WeakMap,n=new WeakMap;let r=null;self.IInstance=class{constructor(){t.set(this,r);const e={runtime:{value:r.GetRuntime().GetIRuntime(),writable:!1},objectType:{value:r.GetObjectClass().GetIObjectClass(),writable:!1},uid:{value:r.GetUID(),writable:!1}};r._GetInstVarsScriptDescriptor(e),r._GetBehaviorsScriptDescriptor(e),Object.defineProperties(this,e),r.GetRuntime()._MapScriptInterface(this,r)}static _Init(e){r=e}static _GetInitInst(){return r}_Release(){const e=n.get(this);e&&(e.Release(),n.delete(this)),t.delete(this)}addEventListener(t,a,n){e(this).addEventListener(t,a,n)}removeEventListener(t,a,n){e(this).removeEventListener(t,a,n)}dispatchEvent(t){e(this).dispatchEvent(t)}destroy(){const e=t.get(this);e.GetRuntime().DestroyInstance(e)}}}{const t=new WeakMap,n=new Map([['normal',0],['additive',1],['copy',3],['destination-over',4],['source-in',5],['destination-in',6],['source-out',7],['destination-out',8],['source-atop',9],['destination-atop',10]]),e=new Map([...n.entries()].map(e=>[e[1],e[0]])),r=C3.New(C3.Color);self.IWorldInstance=class extends IInstance{constructor(){super();const n=IInstance._GetInitInst();t.set(this,n);const r=[],s=n.GetWorldInfo(),a=s.GetInstanceEffectList();if(a){const e=s.GetObjectClass().GetEffectList().GetAllEffectTypes().length;for(let t=0;tn.length)throw new Error('expected 3 elements');r.setRgb(n[0],n[1],n[2]);const a=t.get(this),s=a.GetWorldInfo();s.GetUnpremultipliedColor().equalsIgnoringAlpha(r)||(s.SetUnpremultipliedColor(r),a.GetRuntime().UpdateRender())}get colorRgb(){const e=t.get(this).GetWorldInfo().GetUnpremultipliedColor();return[e.getR(),e.getG(),e.getB()]}set blendMode(a){const r=n.get(a);if('number'!=typeof r)throw new Error('invalid blend mode');const s=t.get(this),e=s.GetWorldInfo();e.SetBlendMode(r),s.GetRuntime().UpdateRender()}get blendMode(){return e.get(t.get(this).GetWorldInfo().GetBlendMode())}moveToTop(){t.get(this).GetWorldInfo().ZOrderMoveToTop()}moveToBottom(){t.get(this).GetWorldInfo().ZOrderMoveToBottom()}moveToLayer(e){const a=ILayer._Unwrap(e);if(!a)throw new Error('invalid layer');t.get(this).GetWorldInfo().ZOrderMoveToLayer(a)}moveAdjacentToInstance(e,a){t.get(this).GetWorldInfo().ZOrderMoveAdjacentToInstance(t.get(e),a)}containsPoint(e,a){return t.get(this).GetWorldInfo().ContainsPoint(+e,+a)}testOverlap(n){const r=t.get(this),e=t.get(n);return r.GetRuntime().GetCollisionEngine().TestOverlap(r,e)}testOverlapSolid(){const e=t.get(this),a=e.GetRuntime().GetCollisionEngine().TestOverlapSolid(e);return a?a.GetInterfaceClass():null}}}{const e=new WeakMap;self.IDOMInstance=class extends IWorldInstance{constructor(){super(),e.set(this,IInstance._GetInitInst())}focus(){e.get(this).GetSdkInstance().FocusElement()}blur(){e.get(this).GetSdkInstance().BlurElement()}setCssStyle(t,a){e.get(this).GetSdkInstance().SetElementCSSStyle(t,a)}}}{const e=new WeakMap;let t=null;self.IBehaviorInstance=class{constructor(){e.set(this,t);const a={runtime:{value:t.GetRuntime().GetIRuntime(),writable:!1},behavior:{value:t.GetBehavior().GetIBehavior(),writable:!1}};Object.defineProperties(this,a)}static _Init(e){t=e}static _GetInitInst(){return t}get instance(){return e.get(this).GetObjectInstance().GetInterfaceClass()}}}{const e=new WeakMap;self.IBehavior=class{constructor(t){e.set(this,t);const a={runtime:{value:t.GetRuntime().GetIRuntime(),writable:!1}};Object.defineProperties(this,a)}getAllInstances(){return e.get(this).GetInstances().map(e=>e.GetInterfaceClass())}}}{const t=new WeakMap;self.IEffectInstance=class{constructor(e,a){t.set(this,e),Object.defineProperties(this,{index:{value:a,writable:!1}})}get name(){const e=t.get(this),a=e.GetObjectClass().GetEffectList().GetAllEffectTypes();return a[this.index].GetName()}get isActive(){const e=t.get(this),a=e.GetInstanceEffectList();return a.IsEffectIndexActive(this.index)}set isActive(a){a=!!a;const n=t.get(this),r=n.GetInstanceEffectList();r.IsEffectIndexActive(this.index)===a||(r.SetEffectIndexActive(this.index,a),r.UpdateActiveEffects(),n.GetRuntime().UpdateRender())}setParameter(n,r){n=Math.floor(+n);const s=t.get(this),l=s.GetInstanceEffectList(),e=l.GetEffectParametersForIndex(this.index);if(0>n||n>=e.length)throw new RangeError('invalid effect parameter index');const _=e[n];if(_ instanceof C3.Color){if(!Array.isArray(r)||3>r.length)throw new TypeError('expected array with 3 elements');const t=r[0],a=r[1],n=r[2];if(_.equalsRgb(t,a,n))return;_.setRgb(t,a,n)}else{if('number'!=typeof r)throw new TypeError('expected number');if(_===r)return;e[n]=r}l.IsEffectIndexActive(this.index)&&s.GetRuntime().UpdateRender()}getParameter(n){n=Math.floor(+n);const r=t.get(this),s=r.GetInstanceEffectList(),l=s.GetEffectParametersForIndex(this.index);if(0>n||n>=l.length)throw new RangeError('invalid effect parameter index');const e=l[n];return e instanceof C3.Color?[e.getR(),e.getG(),e.getB()]:e}}}'use strict',C3.Plugins={},C3.Behaviors={},C3.PluginManager=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e,this._allPlugins=[],this._pluginsByCtor=new Map,this._systemPlugin=null,this._allBehaviors=[],this._behaviorsByCtor=new Map,this._solidBehavior=null,this._jumpthruBehavior=null}CreatePlugin(e){const t=this._runtime.GetObjectReference(e[0]);if(!t)throw new Error('missing plugin');C3.AddCommonACEs(e,t);const a=C3.New(t,{runtime:this._runtime,isSingleGlobal:e[1],isWorld:e[2],isRotatable:e[5],hasEffects:e[8],mustPredraw:e[9]});a.OnCreate(),this._allPlugins.push(a),this._pluginsByCtor.set(t,a)}CreateSystemPlugin(){this._systemPlugin=C3.New(C3.Plugins.System,{runtime:this._runtime,isSingleGlobal:!0}),this._systemPlugin.OnCreate()}CreateBehavior(e){const t=this._runtime.GetObjectReference(e[1]);if(!t)throw new Error('missing behavior');const a=C3.New(t,{runtime:this._runtime});a.OnCreate(),this._allBehaviors.push(a),this._behaviorsByCtor.set(t,a),!this._solidBehavior&&C3.Behaviors.solid&&a instanceof C3.Behaviors.solid?this._solidBehavior=a:!this._jumpthruBehavior&&C3.Behaviors.jumpthru&&a instanceof C3.Behaviors.jumpthru&&(this._jumpthruBehavior=a)}GetPluginByConstructorFunction(e){return this._pluginsByCtor.get(e)||null}HasBehaviorByConstructorFunction(e){return this._behaviorsByCtor.has(e)}GetBehaviorByConstructorFunction(e){return this._behaviorsByCtor.get(e)||null}GetSystemPlugin(){return this._systemPlugin}GetSolidBehavior(){return this._solidBehavior}GetJumpthruBehavior(){return this._jumpthruBehavior}},'use strict';{const e=new Set;C3.ImageInfo=class 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=!1,this._imageAsset=null,this._textureState='',this._rcTex=C3.New(C3.Rect),e.add(this)}Release(){this.ReleaseTexture(),this._imageAsset=null,e.delete(this)}static OnWebGLContextLost(){for(const t of e)t._textureState='',t._rcTex.set(0,0,0,0)}LoadData(e){this._url=e[0],this._size=e[1],this._pixelFormat=e[2],this._offsetX=e[3],this._offsetY=e[4],this._width=e[5],this._height=e[6],this._hasMetaData=!0}LoadAnimationFrameData(e){this._url=e[0],this._size=e[1],this._offsetX=e[2],this._offsetY=e[3],this._width=e[4],this._height=e[5],this._pixelFormat=e[11],this._hasMetaData=!0}LoadDynamicAsset(e,t){if(this._imageAsset)throw new Error('already loaded asset');this._url=t;const a={};return C3.IsAbsoluteURL(t)&&(a.loadPolicy='remote'),this.LoadAsset(e,a),this._imageAsset.Load()}ReplaceWith(e){if(e===this)throw new Error('cannot replace with self');this.ReleaseTexture(),this._url=e._url,this._size=e._size,this._pixelFormat=e._pixelFormat,this._offsetX=e._offsetX,this._offsetY=e._offsetY,this._width=e._width,this._height=e._height,this._hasMetaData=e._hasMetaData,this._imageAsset=e._imageAsset,this._textureState=e._textureState,this._rcTex=e._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(e,t){if(this._imageAsset)throw new Error('already got asset');t=Object.assign({},t,{url:this.GetURL(),size:this.GetSize()}),this._imageAsset=e.LoadImage(t)}IsLoaded(){return this._imageAsset&&this._imageAsset.IsLoaded()}async LoadStaticTexture(e,t){if(!this._imageAsset)throw new Error('no asset');if(this._textureState)throw new Error('already loaded texture');this._textureState='loading';const a=await this._imageAsset.LoadStaticTexture(e,t);return a?(this._textureState='loaded',this._hasMetaData||(this._width=a.GetWidth(),this._height=a.GetHeight(),this._hasMetaData=!0),this._rcTex.set(this._offsetX,this._offsetY,this._offsetX+this._width,this._offsetY+this._height),this._rcTex.divide(a.GetWidth(),a.GetHeight()),a):(this._textureState='',null)}ReleaseTexture(){this._textureState&&(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 e=await this._imageAsset.LoadToDrawable(),t=C3.CreateCanvas(this._width,this._height),a=t.getContext('2d');return a.drawImage(e,this._offsetX,this._offsetY,this._width,this._height,0,0,this._width,this._height),t}}}'use strict',C3.AnimationInfo=class extends C3.DefendedBase{constructor(e){super(),this._name=e[0],this._speed=e[1],this._isLooping=!!e[2],this._repeatCount=e[3],this._repeatTo=e[4],this._isPingPong=!!e[5],this._sid=e[6],this._frames=e[7].map(e=>C3.New(C3.AnimationFrameInfo,e))}Release(){for(const e of this._frames)e.Release();C3.clearArray(this._frames)}LoadAllAssets(e){for(const t of this._frames)t.GetImageInfo().LoadAsset(e)}LoadAllTextures(e,t){return Promise.all(this._frames.map(a=>a.GetImageInfo().LoadStaticTexture(e,t)))}ReleaseAllTextures(){for(const e of this._frames)e.GetImageInfo().ReleaseTexture()}GetName(){return this._name}GetSID(){return this._sid}GetFrameCount(){return this._frames.length}GetFrames(){return this._frames}GetFrameAt(e){if(e=Math.floor(e),0>e||e>=this._frames.length)throw new RangeError('invalid frame');return this._frames[e]}GetSpeed(){return this._speed}IsLooping(){return this._isLooping}GetRepeatCount(){return this._repeatCount}GetRepeatTo(){return this._repeatTo}IsPingPong(){return this._isPingPong}},'use strict',C3.AnimationFrameInfo=class extends C3.DefendedBase{constructor(e){super(),this._imageInfo=C3.New(C3.ImageInfo),this._imageInfo.LoadAnimationFrameData(e),this._duration=e[6],this._origin=C3.New(C3.Vector2,e[7],e[8]),this._imagePoints=e[9].map(e=>C3.New(C3.ImagePoint,this,e)),this._imagePointsByName=new Map;for(const t of this._imagePoints)this._imagePointsByName.set(t.GetName().toLowerCase(),t);this._collisionPoly=null;const t=e[10];6<=t.length&&(this._collisionPoly=C3.New(C3.CollisionPoly,t))}Release(){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(e){return this._imagePointsByName.get(e.toLowerCase())||null}GetImagePointByIndex(e){return e=Math.floor(e),0>e||e>=this._imagePoints.length?null:this._imagePoints[e]}GetImagePointCount(){return this._imagePoints.length}},'use strict',C3.ImagePoint=class extends C3.DefendedBase{constructor(e,t){super(),this._afi=e,this._name=t[0],this._pos=C3.New(C3.Vector2,t[1],t[2])}Release(){}GetName(){return this._name}GetX(){return this._pos.getX()}GetY(){return this._pos.getY()}GetVec2(){return this._pos}},'use strict',C3.ObjectClass=class extends C3.DefendedBase{constructor(t,a,n){super();const r=t.GetObjectReference(n[1]);if(this._runtime=t,this._plugin=t.GetPluginManager().GetPluginByConstructorFunction(r),this._sdkType=null,this._instSdkCtor=r.Instance,this._index=a,this._sid=n[11],this._name=n[0],this._jsPropName=this._runtime.GetJsPropName(n[14]),this._isGlobal=!!n[9],this._isFamily=!!n[2],this._isOnLoaderLayout=!!n[10],this._instVars=n[3].map(e=>({sid:e[0],type:e[1],name:e[2],jsPropName:t.GetJsPropName(e[3])})),this._behaviorsCount=n[4],this._effectsCount=n[5],this._isWorldType=this._plugin.IsWorldType(),this._effectList=null,this._collisionGrid=C3.New(C3.SparseGrid,t.GetOriginalViewportWidth(),t.GetOriginalViewportHeight()),this._anyCollisionCellChanged=!0,this._anyInstanceParallaxed=!1,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=!1,this._container=null,this._behaviorTypes=n[8].map(e=>C3.BehaviorType.Create(this,e)),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=!1,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=!0,this._plugin.HasEffects()&&(this._effectList=C3.New(C3.EffectList,this,n[12])),n[6]&&(this._imageInfo=C3.New(C3.ImageInfo),this._imageInfo.LoadData(n[6])),n[7]){this._animations=n[7].map(e=>C3.New(C3.AnimationInfo,e)),this._animationsByName=new Map,this._animationsBySid=new Map;for(const e of this._animations)this._animationsByName.set(e.GetName().toLowerCase(),e),this._animationsBySid.set(e.GetSID(),e)}this._isFamily?(this._familyMembers=[],this._familyMembersSet=new Set,this._familyIndex=this._runtime._GetNextFamilyIndex()):(this._families=[],this._familiesSet=new Set,this._familyInstVarMap=[],this._familyBehaviorMap=[],this._familyEffectMap=[]),this._sdkType=C3.New(r.Type,this),this._iObjectClass=null,this._instanceUserScriptClass=null;const s=this._sdkType.GetScriptInterfaceClass();if(!s)this._iObjectClass=new IObjectClass(this);else if(this._iObjectClass=new s(this),!(this._iObjectClass instanceof IObjectClass))throw new TypeError('script interface class must derive from IObjectClass');n[13]&&n[13].length&&this._sdkType.LoadTilePolyData(n[13]),(!this._runtime.UsesLoaderLayout()||this._isFamily||this._isOnLoaderLayout||!this._isWorldType)&&this.OnCreate(),this._plugin.IsSingleGlobal()&&(this._plugin._SetSingleGlobalObjectClass(this),this._CreateSingleGlobalInstance(n))}static Create(e,t,a){return C3.New(C3.ObjectClass,e,t,a)}Release(){if(this._imageInfo&&(this._imageInfo.Release(),this._imageInfo=null),this._animations){for(const e of this._animations)e.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(e){for(let t=1,a=e.length;tthis._textureRefCount)throw new Error('released textures too many times');0===this._textureRefCount&&this._sdkType.ReleaseTextures()}}OnDynamicTextureLoadComplete(){if(this._isFamily)throw new Error('not applicable to family');this._sdkType.OnDynamicTextureLoadComplete()}PreloadTexturesWithInstances(e){return this._isFamily?Promise.resolve():this._sdkType.PreloadTexturesWithInstances(e)}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(e){return e&&this._usedBehaviorCtors.has(e)}GetInstanceVariablesCount(){return this._instVars.length}GetInstanceVariableSIDs(){return this._instVars.map(e=>e.sid)}GetInstanceVariableIndexBySID(e){return this._instVars.findIndex(t=>t.sid===e)}GetInstanceVariableIndexByName(e){return this._instVars.findIndex(t=>t.name===e)}_GetAllInstanceVariableNames(){return this._instVars.map(e=>e.name)}_GetAllInstanceVariableJsPropNames(){return this._instVars.map(e=>e.jsPropName)}GetInstanceVariableType(e){if(e=Math.floor(e),0>e||e>=this._instVars.length)throw new RangeError('invalid instance variable index');return this._instVars[e].type}GetInstanceVariableName(e){if(e=Math.floor(e),0>e||e>=this._instVars.length)throw new RangeError('invalid instance variable index');return this._instVars[e].name}GetEffectTypesCount(){return this._effectsCount}GetBehaviorTypesIncludingInherited(){return this._behaviorTypesIncludingInherited}GetBehaviorTypeByName(e){return this._behaviorsByName.get(e.toLowerCase())||null}GetBehaviorIndexByName(e){const t=this._behaviorNameToIndex.get(e.toLowerCase());return'undefined'==typeof t?-1:t}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(e){this._defaultInstanceData=e}GetDefaultInstanceData(){return this._defaultInstanceData}_SetDefaultLayerIndex(e){this._defaultLayerIndex=e}GetDefaultLayerIndex(){return this._defaultLayerIndex}GetAnimations(){return this._animations}GetAnimationCount(){return this._animations.length}GetFamilies(){return this._families}BelongsToFamily(e){return this._familiesSet.has(e)}GetFamilyMembers(){return this._familyMembers}FamilyHasMember(e){return this._familyMembersSet.has(e)}GetFamilyBehaviorOffset(e){return this._familyBehaviorMap[e]}GetFamilyInstanceVariableOffset(e){return this._familyInstVarMap[e]}GetAnimationByName(e){if(!this._animations)throw new Error('no animations');return this._animationsByName.get(e.toLowerCase())||null}GetAnimationBySID(e){if(!this._animations)throw new Error('no animations');return this._animationsBySid.get(e)||null}GetFirstAnimationFrame(){if(!this._animations)throw new Error('no animations');return this._animations[0].GetFrameAt(0)}GetDefaultInstanceSize(){if(this._animations){const e=this.GetFirstAnimationFrame().GetImageInfo();return[e.GetWidth(),e.GetHeight()]}return this._imageInfo?[this._imageInfo.GetWidth(),this._imageInfo.GetHeight()]:[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 e of this._runtime._GetInstancesPendingCreate())e.GetObjectClass()===this&&(yield e)}GetInstanceCount(){return this._instances.length}_AddInstance(e){this._instances.push(e)}_SetIIDsStale(){this._iidsStale=!0}_UpdateIIDs(){if(this._iidsStale&&!this._isFamily){const e=this._instances;let t=0;for(let a=e.length;te.SaveToJson())};return this._savedData&&this._savedData.size&&(e.ex=C3.ToSuperJSON(this._savedData)),e}_LoadFromJson(e){this._savedData&&(this._savedData.clear(),this._savedData=null);const t=e.ex;t&&(this._savedData=C3.FromSuperJSON(t));const a=this._instances,n=e.instances;for(let t=0,r=Math.min(a.length,n.length);te.IsWorldType())}},'use strict';{const t=[];let a=0;const n=new WeakMap,e=new WeakMap;C3.Instance=class extends C3.DefendedBase{constructor(n){super(),this._runtime=n.runtime,this._objectType=n.objectType,this._worldInfo=null,this._sdkInst=null,this._iScriptInterface=null,this._iid=0,this._uid=n.uid,this._puid=a++,this._flags=0,this._instVarValues=t,this._behaviorInstances=t;const r=this._objectType.GetBehaviorTypesIncludingInherited();0C3.New(C3.BehaviorInstance,{runtime:this._runtime,behaviorType:e,instance:this,index:t}))),this._siblings=this._objectType.IsInContainer()?[]:null,this._timeScale=-1,this._dispatcher=null;const s=this.GetPlugin();if(s.MustPreDraw()&&(this._flags|=4),s.IsWorldType())if(this._worldInfo=C3.New(C3.WorldInfo,this,n.layer),n.worldData)this._worldInfo.Init(n.worldData);else{this._worldInfo.InitNoData();const[e,t]=this._objectType.GetDefaultInstanceSize();this._worldInfo.SetSize(e,t),this.GetObjectClass().UsesEffects()&&this._worldInfo.GetInstanceEffectList().LoadDefaultEffectParameters()}n.instVarData?this._LoadInstanceVariableData(n.instVarData):this._LoadDefaultInstanceVariables()}Release(){if(this._iScriptInterface&&(this._iScriptInterface._Release(),this._iScriptInterface=null),0e||!isFinite(e))&&(e=0),this._timeScale=e}RestoreTimeScale(){this._timeScale=-1}Dispatcher(){return this._dispatcher||(this._dispatcher=C3.New(C3.Event.Dispatcher)),this._dispatcher}Draw(e){this._sdkInst.Draw(e)}OnCreate(e){this._sdkInst.OnCreate(e)}_SetHasTilemap(){this._flags|=2}HasTilemap(){return 0!=(2&this._flags)}_MarkDestroyed(){this._flags|=1}IsDestroyed(){return 0!=(1&this._flags)}MustPreDraw(){return 0!=(4&this._flags)}_IsSolidEnabled(){return 0!=(8&this._flags)}_SetSolidEnabled(e){e?this._flags|=8:this._flags&=-9}_IsJumpthruEnabled(){return 0!=(16&this._flags)}_SetJumpthruEnabled(e){e?this._flags|=16:this._flags&=-17}SetFlag(e,t){e<<=16,t?this._flags|=e:this._flags&=~e}GetFlag(e){return 0!=(this._flags&e<<16)}GetCurrentImageInfo(){return this._sdkInst.GetCurrentImageInfo()}GetImagePoint(e){return this._sdkInst.GetImagePoint(e)}GetObjectClass(){return this._objectType}BelongsToObjectClass(e){return e.IsFamily()?e.FamilyHasMember(this.GetObjectClass()):this.GetObjectClass()===e}IsInContainer(){return null!==this._siblings}_AddSibling(e){this._siblings.push(e)}GetSiblings(){return this._siblings}siblings(){return this._siblings}SetSiblingsSinglePicked(){for(const e of this.siblings())e.GetObjectClass().GetCurrentSol().SetSinglePicked(e)}_PushSiblingsToSolInstances(){for(const e of this.siblings())e.GetObjectClass().GetCurrentSol()._PushInstance(e)}_SetSiblingsToSolInstancesIndex(e){for(const t of this.siblings())t.GetObjectClass().GetCurrentSol()._GetOwnInstances()[e]=t}_PushSiblingsToSolElseInstances(){for(const e of this.siblings())e.GetObjectClass().GetCurrentSol()._PushElseInstance(e)}_SetSiblingsToSolElseInstancesIndex(e){for(const t of this.siblings())t.GetObjectClass().GetCurrentSol()._GetOwnElseInstances()[e]=t}GetPlugin(){return this._objectType.GetPlugin()}_SetIID(e){this._iid=e}GetIID(){return this._objectType._UpdateIIDs(),this._iid}GetUID(){return this._uid}GetPUID(){return this._puid}GetBehaviorInstances(){return this._behaviorInstances}GetBehaviorInstanceFromCtor(e){if(!e)return null;for(const t of this._behaviorInstances)if(t.GetBehavior()instanceof e)return t;return null}GetBehaviorSdkInstanceFromCtor(e){if(!e)return null;const t=this.GetBehaviorInstanceFromCtor(e);return t?t.GetSdkInstance():null}GetBehaviorIndexBySID(e){const t=this._behaviorInstances;for(let a=0,n=t.length;ae||e>=t.length)throw new RangeError('invalid instance variable');return t[e]}_GetInstanceVariableValueUnchecked(e){return this._instVarValues[e]}SetInstanceVariableValue(e,t){e|=0;const n=this._instVarValues;if(0>e||e>=n.length)throw new RangeError('invalid instance variable');const r=n[e];if('number'==typeof r)n[e]='number'==typeof t?t:parseFloat(t);else if('boolean'==typeof r)n[e]='boolean'==typeof t?t:!!t;else if('string'==typeof r)n[e]='string'==typeof t?t:t.toString();else throw new Error('unknown instance variable type')}SetInstanceVariableOffset(e,t){if(0!==t){e|=0;const a=this._instVarValues;if(0>e||e>=a.length)throw new RangeError('invalid instance variable');const n=a[e];if('number'==typeof n)a[e]+='number'==typeof t?t:parseFloat(t);else if('boolean'==typeof n)throw new Error('can not set offset of boolean variable');else if('string'==typeof n)throw new Error('can not set offset of string variable');else throw new Error('unknown instance variable type')}}GetSavedDataMap(){let e=n.get(this);return e?e:(e=new Map,n.set(this,e),e)}GetUnsavedDataMap(){let t=e.get(this);return t?t:(t=new Map,e.set(this,t),t)}_TriggerOnCreated(){this._runtime.Trigger(this.GetPlugin().constructor.Cnds.OnCreated,this,null)}_TriggerOnDestroyed(){this._runtime.Trigger(this.GetPlugin().constructor.Cnds.OnDestroyed,this,null)}_GetDebuggerProperties(){return this._sdkInst.GetDebuggerProperties()}SaveToJson(e='full'){const t={};if('full'===e?t.uid=this.GetUID():t.c3=!0,'visual-state'!==e){const e=n.get(this);if(e&&e.size&&(t.ex=C3.ToSuperJSON(e)),-1!==this.GetTimeScale()&&(t.mts=this.GetTimeScale()),0r||r>=this._instVarValues.length)continue;let s=a;null===s&&(s=NaN),this._instVarValues[r]=s}}if(this.GetPlugin().IsWorldType()){const a=t.w,n=a.l;if(this._worldInfo.GetLayer().GetSID()!==n){const t=this._worldInfo.GetLayer(),a=t.GetLayout().GetLayerBySID(n);a?(this._worldInfo._SetLayer(a),t._RemoveInstance(this,!0),a._AddInstance(this,!0),a.SetZIndicesChanged(),this._worldInfo.SetBboxChanged()):'full'===e&&this._runtime.DestroyInstance(this)}this._worldInfo._LoadFromJson(a)}if('visual-state'!==e){const e=t.behs;if(e)for(const[t,a]of Object.entries(e)){const e=parseInt(t,10),n=this.GetBehaviorIndexBySID(e);0>n||n>=this._behaviorInstances.length||this._behaviorInstances[n].LoadFromJson(a)}}const a=t.data;a&&this._sdkInst.LoadFromJson(a)}GetInterfaceClass(){return this._iScriptInterface||this._InitUserScriptInterface()}_InitUserScriptInterface(){const e=this._worldInfo?IWorldInstance:IInstance,t=this._sdkInst.GetScriptInterfaceClass(),a=this._objectType._GetUserScriptInstanceClass();if(IInstance._Init(this),this._iScriptInterface=new(a||t||e),IInstance._Init(null),t&&!(this._iScriptInterface instanceof e))throw new TypeError(`script interface class '${t.name}' does not extend the right base class '${e.name}'`);if(a){const n=t||e;if(!(this._iScriptInterface instanceof n))throw new TypeError(`setInstanceClass(): class '${a.name}' does not extend the right base class '${n.name}'`)}return this._iScriptInterface}_GetInstVarsScriptDescriptor(e){if(0!==this._instVarValues.length){const t={},n=this._objectType._GetAllInstanceVariableJsPropNames();for(let e=0,a=n.length;e',this.GetSrcBlend(),this.GetDestBlend(),this._colorPremultiplied,this._zElevation)}}GetWebGLStateGroup(){return this._stateGroup}HasDefaultColor(){return this._color===s}SetBlendMode(e){this._blendMode===e||(this._blendMode=e,this._UpdateWebGLStateGroup())}GetBlendMode(){return this._blendMode}GetSrcBlend(){return this._runtime.GetWebGLRenderer().GetSrcBlendByIndex(this._blendMode)}GetDestBlend(){return this._runtime.GetWebGLRenderer().GetDestBlendByIndex(this._blendMode)}_SetLayer(e){this._layer=e,0!==this.GetZElevation()&&this._layer._SetAnyInstanceZElevated()}GetLayer(){return this._layer}GetLayout(){return this.GetLayer().GetLayout()}_SetZIndex(e){this._zIndex=0|e}GetZIndex(){return this._layer._UpdateZIndices(),this._zIndex}_GetLastCachedZIndex(){return this._zIndex}_SetFlag(e,t){t?this._flags|=e:this._flags&=~e}IsVisible(){return 0!=(this._flags&d)}SetVisible(e){this._SetFlag(d,e)}IsCollisionEnabled(){return 0!=(8&this._flags)}SetCollisionEnabled(e){e=!!e,this.IsCollisionEnabled()===e||(this._SetFlag(8,e),e?this.SetBboxChanged():this._RemoveFromCollisionCells())}SetSolidCollisionFilter(e,t){if(this._SetFlag(32,e),this._solidFilterTags&&this._solidFilterTags.clear(),!t.trim())return void(this._solidFilterTags=null);this._solidFilterTags||(this._solidFilterTags=new Set);for(const a of t.split(' '))a&&this._solidFilterTags.add(a.toLowerCase())}IsSolidCollisionAllowed(e){const t=0!=(32&this._flags),a=this._solidFilterTags;if(!e||!a)return!t;for(const n of a)if(e.has(n))return t;return!t}SetBboxChanged(){this._flags|=18,this._objectClass._SetAnyCollisionCellChanged(!0),this._runtime.UpdateRender(),this._layer.UsesRenderCells()&&(this._CalculateBbox(),this._UpdateRenderCell()),0!=(4&this._flags)&&this._inst.Dispatcher().dispatchEvent(a)}_CalculateBbox(){const t=this._boundingBox,a=this._boundingQuad,n=this._x,r=this._y,s=this._w,e=this._h;t.setWH(n-this._ox*s,r-this._oy*e,s,e),0===this._a?a.setFromRect(t):(t.offset(-n,-r),a.setFromRotatedRectPrecalc(t,this._sinA,this._cosA),a.offset(n,r),a.getBoundingBox(t)),t.normalize(),this._flags&=-3}_UpdateBbox(){0!=(2&this._flags)&&this._CalculateBbox()}GetBoundingBox(){return this._UpdateBbox(),this._boundingBox}GetBoundingQuad(){return this._UpdateBbox(),this._boundingQuad}OverwriteBoundingBox(e){this._boundingBox.copy(e),this._boundingQuad.setFromRect(this._boundingBox),this._flags&=-3,this._UpdateCollisionCell(),this._UpdateRenderCell()}SetBboxChangeEventEnabled(e){this._SetFlag(4,e)}IsBboxChangeEventEnabled(){return 0!=(4&this._flags)}IsInViewport(e){return 0===this._zElevation?e.intersectsRect(this.GetBoundingBox()):this._IsInViewport_ZElevated()}_IsInViewport_ZElevated(){const e=this.GetLayer(),t=this.GetTotalZElevation();return!(t>=e.GetCameraZ())&&(e.GetViewportForZ(t,n),n.intersectsRect(this.GetBoundingBox()))}SetSourceCollisionPoly(e){this._sourceCollisionPoly=e;const t=this._transformedPolyInfo;t&&(t.width=-1,t.height=-1,t.angle=0)}GetSourceCollisionPoly(){return this._sourceCollisionPoly}HasOwnCollisionPoly(){return!!this._sourceCollisionPoly}GetTransformedCollisionPoly(){return this._GetCustomTransformedCollisionPolyPrecalc(this.GetWidth(),this.GetHeight(),this.GetAngle(),this.GetSinAngle(),this.GetCosAngle())}GetCustomTransformedCollisionPoly(t,n,r){let s=0,l=1;return 0!==r&&(s=Math.sin(r),l=Math.cos(r)),this._GetCustomTransformedCollisionPolyPrecalc(t,n,r,s,l)}_GetCustomTransformedCollisionPolyPrecalc(t,n,r,s,a){let e=this._transformedPolyInfo;return(null===e&&(e={poly:C3.New(C3.CollisionPoly),width:-1,height:-1,angle:0},this._transformedPolyInfo=e),e.width===t&&e.height===n&&e.angle===r)?e.poly:(this._sourceCollisionPoly?(e.poly.copy(this._sourceCollisionPoly),e.poly.transformPrecalc(t,n,s,a)):e.poly.setFromQuad(this.GetBoundingQuad(),-this.GetX(),-this.GetY()),e.width=t,e.height=n,e.angle=r,e.poly)}HasTilemap(){return this._inst.HasTilemap()}ContainsPoint(e,t){return!!this.GetBoundingBox().containsPoint(e,t)&&!!this.GetBoundingQuad().containsPoint(e,t)&&(this.HasTilemap()?this._inst.GetSdkInstance().TestPointOverlapTile(e,t):!this.HasOwnCollisionPoly()||this.GetTransformedCollisionPoly().containsPoint(e-this.GetX(),t-this.GetY()))}_IsCollisionCellChanged(){return 0!=(16&this._flags)}_UpdateCollisionCell(){if(this._IsCollisionCellChanged()&&this.IsCollisionEnabled()){const a=this.GetBoundingBox(),n=this._objectClass._GetCollisionCellGrid(),r=this._collisionCells;if(t.set(n.XToCell(a.getLeft()),n.YToCell(a.getTop()),n.XToCell(a.getRight()),n.YToCell(a.getBottom())),!r.equals(t)){const a=this._inst;r===e?(n.Update(a,null,t),this._collisionCells=C3.New(C3.Rect,t)):(n.Update(a,r,t),r.copy(t)),this._flags&=-17}}}_RemoveFromCollisionCells(){const t=this._collisionCells;t===e||(this._objectClass._GetCollisionCellGrid().Update(this._inst,t,null),this._collisionCells=e)}_UpdateRenderCell(){const a=this.GetLayer();if(a.UsesRenderCells()){const n=a.GetRenderGrid(),r=this.GetBoundingBox(),s=this._renderCells;if(t.set(n.XToCell(r.getLeft()),n.YToCell(r.getTop()),n.XToCell(r.getRight()),n.YToCell(r.getBottom())),!s.equals(t)){const e=this._inst;s===l?(n.Update(e,null,t),this._renderCells=C3.New(C3.Rect,t)):(n.Update(e,s,t),s.copy(t)),a.SetRenderListStale()}}}_RemoveFromRenderCells(){const e=this._renderCells;e===l||(this.GetLayer().GetRenderGrid().Update(this._inst,e,null),this._renderCells=l)}GetRenderCellRange(){return this._renderCells}ZOrderMoveToTop(){const e=this._inst,t=this._layer,a=t._GetInstances();a.length&&a[a.length-1]===e||(t._RemoveInstance(e,!1),t._AddInstance(e,!1),this._runtime.UpdateRender())}ZOrderMoveToBottom(){const e=this._inst,t=this._layer,a=t._GetInstances();a.length&&a[0]===e||(t._RemoveInstance(e,!1),t._PrependInstance(e,!1),this._runtime.UpdateRender())}ZOrderMoveToLayer(e){const t=this._inst,a=this._layer;if(a.GetLayout()!==e.GetLayout())throw new Error('layer from different layout');e===a||(a._RemoveInstance(t,!0),this._SetLayer(e),e._AddInstance(t,!0),this._runtime.UpdateRender())}ZOrderMoveAdjacentToInstance(t,a){const n=this._inst,r=this._layer;if(t.GetUID()!==n.GetUID()){const s=t.GetWorldInfo();if(!s)throw new Error('expected world instance');const e=s.GetLayer();r.GetIndex()!==e.GetIndex()&&(r._RemoveInstance(n,!0),this._SetLayer(e),e._AddInstance(n,!0)),e.MoveInstanceAdjacent(n,t,!!a),this._runtime.UpdateRender()}}GetInstanceEffectList(){return this._instanceEffectList}_SetHasAnyActiveEffect(e){this._SetFlag(64,e)}HasAnyActiveEffect(){return 0!=(64&this._flags)}_SaveToJson(){const e={x:this.GetX(),y:this.GetY(),w:this.GetWidth(),h:this.GetHeight(),l:this.GetLayer().GetSID(),zi:this.GetZIndex()};0!==this.GetZElevation()&&(e.ze=this.GetZElevation()),0!==this.GetAngle()&&(e.a=this.GetAngle()),this.HasDefaultColor()||(e.c=this._color.toJSON()),.5!==this.GetOriginX()&&(e.oX=this.GetOriginX()),.5!==this.GetOriginY()&&(e.oY=this.GetOriginY()),0!==this.GetBlendMode()&&(e.bm=this.GetBlendMode()),this.IsVisible()||(e.v=this.IsVisible()),this.IsCollisionEnabled()||(e.ce=this.IsCollisionEnabled()),this.IsBboxChangeEventEnabled()&&(e.be=this.IsBboxChangeEventEnabled()),this._instanceEffectList&&(e.fx=this._instanceEffectList._SaveToJson());const t=0!=(32&this._flags);return t&&(e.sfi=t),this._solidFilterTags&&(e.sft=[...this._solidFilterTags].join(' ')),e}_LoadFromJson(e){_=!1,this.SetX(e.x),this.SetY(e.y),this.SetWidth(e.w),this.SetHeight(e.h),this._SetZIndex(e.zi),this.SetZElevation(e.hasOwnProperty('ze')?e.ze:0),this.SetAngle(e.hasOwnProperty('a')?e.a:0),e.hasOwnProperty('c')?r.setFromJSON(e.c):e.hasOwnProperty('o')?(r.copyRgb(this._color),r.a=e.o):r.setRgba(1,1,1,1),this._SetColor(r),this.SetOriginX(e.hasOwnProperty('oX')?e.oX:.5),this.SetOriginY(e.hasOwnProperty('oY')?e.oY:.5),this.SetBlendMode(e.hasOwnProperty('bm')?e.bm:0),this.SetVisible(!e.hasOwnProperty('v')||e.v),this.SetCollisionEnabled(!e.hasOwnProperty('ce')||e.ce),this.SetBboxChangeEventEnabled(!!e.hasOwnProperty('be')&&e.be),this.SetSolidCollisionFilter(!!e.hasOwnProperty('sfi')&&e.sfi,e.hasOwnProperty('sft')?e.sft:''),this._instanceEffectList&&e.hasOwnProperty('fx')&&this._instanceEffectList._LoadFromJson(e.fx),this.SetBboxChanged(),_=!0,this._UpdateWebGLStateGroup()}}}'use strict',C3.BehaviorType=class extends C3.DefendedBase{constructor(t,a){super();const n=t.GetRuntime(),r=n.GetPluginManager(),s=n.GetObjectReference(a[1]);r.HasBehaviorByConstructorFunction(s)||r.CreateBehavior(a),this._runtime=n,this._objectClass=t,this._behavior=r.GetBehaviorByConstructorFunction(s),this._sdkType=null,this._instSdkCtor=s.Instance,this._sid=a[2],this._name=a[0],this._jsPropName=this._runtime.GetJsPropName(a[3]),this._sdkType=C3.New(s.Type,this),this.OnCreate()}static Create(e,t){return C3.New(C3.BehaviorType,e,t)}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}},'use strict',C3.BehaviorInstance=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e.runtime,this._behaviorType=e.behaviorType,this._behavior=this._behaviorType.GetBehavior(),this._inst=e.instance,this._index=e.index,this._sdkInst=null,this._iScriptInterface=null,this._behavior._AddInstance(this._inst)}Release(){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(e){if(this._sdkInst)throw new Error('already got sdk instance');this._sdkInst=C3.New(this._behaviorType.GetInstanceSdkCtor(),this,e),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(e,t){this._sdkInst.OnSpriteFrameChanged(e,t)}_GetDebuggerProperties(){return this._sdkInst.GetDebuggerProperties()}SaveToJson(){return this._sdkInst.SaveToJson()}LoadFromJson(e){return this._sdkInst.LoadFromJson(e)}static SortByTickSequence(t,n){const a=t.GetObjectInstance(),r=n.GetObjectInstance(),s=a.GetObjectClass().GetIndex(),e=r.GetObjectClass().GetIndex();if(s!==e)return s-e;const l=a.GetPUID(),_=r.GetPUID();return l===_?t.GetBehaviorInstance()._GetIndex()-n.GetBehaviorInstance()._GetIndex():l-_}_InitScriptInterface(){const e=IBehaviorInstance,t=this._sdkInst.GetScriptInterfaceClass();if(IBehaviorInstance._Init(this),this._iScriptInterface=new(t||e),IBehaviorInstance._Init(null),t&&!(this._iScriptInterface instanceof e))throw new TypeError(`script interface class '${t.name}' does not extend the right base class '${e.name}'`)}GetScriptInterface(){return this._iScriptInterface}},'use strict',C3.EffectList=class extends C3.DefendedBase{constructor(e,t){super(),this._owner=e,this._allEffectTypes=[],this._activeEffectTypes=[],this._effectTypesByName=new Map,this._effectParams=[],this._preservesOpaqueness=!0;for(const n of t){const e=C3.New(C3.EffectType,this,n,this._allEffectTypes.length);this._allEffectTypes.push(e),this._effectTypesByName.set(e.GetName().toLowerCase(),e),3<=n.length&&this._effectParams.push(this._LoadSingleEffectParameters(n[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(e){if(e.length){this._allEffectTypes=e.concat(this._allEffectTypes);for(const t of e)this._effectTypesByName.set(t.GetName().toLowerCase(),t);for(let e=0,t=this._allEffectTypes.length;e({name:e.GetName(),active:e.IsActive(),params:C3.EffectList.SaveFxParamsToJson(this._effectParams[e.GetIndex()])}))}LoadFromJson(e){for(const t of e){const e=this.GetEffectTypeByName(t.name);e&&(e.SetActive(t.active),this._effectParams[e.GetIndex()]=C3.EffectList.LoadFxParamsFromJson(t.params))}this.UpdateActiveEffects()}},'use strict',C3.EffectType=class extends C3.DefendedBase{constructor(e,t,a){super(),this._effectList=e,this._id=t[0],this._name=t[1],this._index=a,this._shaderProgram=null,this._isActive=!0}Release(){this._effectList=null,this._shaderProgram=null}Clone(e){const t=C3.New(C3.EffectType,e,[this._id,this._name],-1);return t._shaderProgram=this._shaderProgram,t._isActive=this._isActive,t}_InitRenderer(e){const t=e.GetShaderProgramByName(this._id);if(!t)throw new Error('failed to find shader program \''+this._id+'\'');this._shaderProgram=t}GetEffectList(){return this._effectList}GetName(){return this._name}_SetIndex(e){this._index=e}GetIndex(){return this._index}GetOwner(){return this._effectList.GetOwner()}GetRuntime(){return this._effectList.GetRuntime()}SetActive(e){this._isActive=!!e}IsActive(){return this._isActive}GetShaderProgram(){return this._shaderProgram}GetDefaultParameterValues(){const e=[];for(let t=0,a=this._shaderProgram.GetParameterCount();te.GetShaderProgram().UsesDest())}IsEffectIndexActive(e){return this._activeEffectFlags[e]}SetEffectIndexActive(e,t){this._activeEffectFlags[e]=!!t}_SaveToJson(){return this._effectList.GetAllEffectTypes().map(e=>({name:e.GetName(),active:this._activeEffectFlags[e.GetIndex()],params:C3.EffectList.SaveFxParamsToJson(this._effectParams[e.GetIndex()])}))}_LoadFromJson(e){for(const t of e){const e=this._effectList.GetEffectTypeByName(t.name);e&&(this._activeEffectFlags[e.GetIndex()]=t.active,this._effectParams[e.GetIndex()]=C3.EffectList.LoadFxParamsFromJson(t.params))}this.UpdateActiveEffects()}},'use strict';{const t=[],r=[],a=[],s=C3.New(C3.CollisionPoly),n=C3.New(C3.CollisionPoly),_=C3.New(C3.Quad),u=C3.New(C3.Rect),g=C3.New(C3.Rect);C3.CollisionEngine=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e,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(e,t){const a=e.GetWorldInfo(),n=t.GetWorldInfo();a&&n&&a.IsCollisionEnabled()&&n.IsCollisionEnabled()&&this._registeredCollisions.push([e,t])}AddRegisteredCollisionCandidates(t,n,r){for(const[e,s]of this._registeredCollisions){let a=null;if(t===e)a=s;else if(t===s)a=e;else continue;a.BelongsToObjectClass(n)&&!r.includes(a)&&r.push(a)}}CheckRegisteredCollision(t,e){if(!this._registeredCollisions.length)return!1;for(const[a,n]of this._registeredCollisions)if(t===a&&e===n||t===n&&e===a)return!0;return!1}ClearRegisteredCollisions(){C3.clearArray(this._registeredCollisions)}TestOverlap(t,a){if(!t||!a||t===a)return!1;const n=t.GetWorldInfo(),e=a.GetWorldInfo();if(!n.IsCollisionEnabled()||!e.IsCollisionEnabled())return!1;this._collisionCheckCount++;const r=n.GetLayer(),s=e.GetLayer(),l=r!==s&&!r._IsCollisionCompatibleWith(s);return l?this._TestOverlap_DifferentLayers(n,e):this._TestOverlap_SameLayers(n,e)}_TestOverlap_SameLayers(e,t){if(!e.GetBoundingBox().intersectsRect(t.GetBoundingBox()))return!1;if(this._polyCheckCount++,!e.GetBoundingQuad().intersectsQuad(t.GetBoundingQuad()))return!1;if(e.HasTilemap()&&t.HasTilemap())return!1;if(e.HasTilemap())return this.TestTilemapOverlap(e,t);if(t.HasTilemap())return this.TestTilemapOverlap(t,e);if(!e.HasOwnCollisionPoly()&&!t.HasOwnCollisionPoly())return!0;const a=e.GetTransformedCollisionPoly(),n=t.GetTransformedCollisionPoly();return a.intersectsPoly(n,t.GetX()-e.GetX(),t.GetY()-e.GetY())}_TestOverlap_DifferentLayers(t,r){const a=t.GetLayer(),l=r.GetLayer();s.copy(t.GetTransformedCollisionPoly()),n.copy(r.GetTransformedCollisionPoly());const _=s.pointsArr();for(let n=0,s=_.length;nr;++r){const d=2*r-1;if(s.SetXY(e+a*c*d,l+n*c*d),s.SetBboxChanged(),!this.TestOverlap(t,_))if(_=this.TestOverlapSolid(t),_)u=_;else return u&&this.PushInFractional(t,a*d,n*d,u,16,!0),!0}return s.SetXY(e,l),s.SetBboxChanged(),!1}PushInFractional(t,a,n,r,s,_){let d=2,u=!1,c=!1;const p=t.GetWorldInfo();let m=p.GetX(),f=p.GetY();for(;d<=s;){const s=1/d;d*=2,p.OffsetXY(a*s*(u?1:-1),n*s*(u?1:-1)),p.SetBboxChanged(),this.TestOverlap(t,r)||_&&this.TestOverlapSolid(t)?(u=!0,c=!0):(u=!1,c=!1,m=p.GetX(),f=p.GetY())}c&&(p.SetXY(m,f),p.SetBboxChanged())}PushOutSolidNearest(t,a=100){var n=Math.floor;let r=0;const s=t.GetWorldInfo(),e=s.GetX(),l=s.GetY();let _=0,u=this.TestOverlapSolid(t);if(!u)return!0;for(;r<=a;){let a=0,d=0;if(0==_?(a=0,d=-1,r++):1==_?(a=1,d=-1):2==_?(a=1,d=0):3==_?(a=1,d=1):4==_?(a=0,d=1):5==_?(a=-1,d=1):6==_?(a=-1,d=0):7==_?(a=-1,d=-1):void 0,_=(_+1)%8,s.SetXY(n(e+a*r),n(l+d*r)),s.SetBboxChanged(),!this.TestOverlap(t,u)&&(u=this.TestOverlapSolid(t),!u))return!0}return s.SetXY(e,l),s.SetBboxChanged(),!1}CalculateBounceAngle(_,a,S,c){var d=Math.sin,e=Math.cos,f=Math.PI;const G=_.GetWorldInfo(),g=G.GetX(),h=G.GetY(),I=Math.max(10,C3.distanceTo(a,S,g,h)),l=C3.angleTo(a,S,g,h),m=c||this.TestOverlapSolid(_);if(!m)return C3.clampAngle(l+f);let n=m,T=0,b=0;const C=C3.toRadians(5);let r;for(r=1;36>r;++r){const t=l-r*C;if(G.SetXY(a+e(t)*I,S+d(t)*I),G.SetBboxChanged(),!this.TestOverlap(_,n)&&(n=c?null:this.TestOverlapSolid(_),!n)){T=t;break}}for(36===r&&(T=C3.clampAngle(l+f)),n=m,r=1;36>r;++r){const t=l+r*C;if(G.SetXY(a+e(t)*I,S+d(t)*I),G.SetBboxChanged(),!this.TestOverlap(_,n)&&(n=c?null:this.TestOverlapSolid(_),!n)){b=t;break}}if(36===r&&(b=C3.clampAngle(l+f)),G.SetXY(g,h),G.SetBboxChanged(),b===T)return b;const P=C3.angleDiff(b,T)/2;let A=C3.angleClockwise(b,T)?C3.clampAngle(T+P+f):C3.clampAngle(b+P);const t=e(l),u=d(l),v=e(A),R=d(A),x=t*v+u*R;return C3.angleTo(0,0,t-2*x*v,u-2*x*R)}TestSegmentOverlap(t,a,n,r,s){var e=Math.min,l=Math.max;if(!s)return!1;const _=s.GetWorldInfo();if(!_.IsCollisionEnabled())return!1;if(this._collisionCheckCount++,u.set(e(t,n),e(a,r),l(t,n),l(a,r)),!_.GetBoundingBox().intersectsRect(u))return!1;if(s.HasTilemap())return this._TestSegmentOverlapTilemap(t,a,n,r,s,_);if(this._polyCheckCount++,!_.GetBoundingQuad().intersectsSegment(t,a,n,r))return!1;if(!_.HasOwnCollisionPoly())return!0;const d=_.GetTransformedCollisionPoly();return d.intersectsSegment(_.GetX(),_.GetY(),t,a,n,r)}_TestSegmentOverlapTilemap(t,a,s,e,d,c){const p=c.GetX(),f=c.GetY(),l=d.GetSdkInstance(),m=r;g.set(t,a,s,e),g.normalize(),l.GetCollisionRectCandidates(g,m);for(let n=0,r=m.length;nthis._loadingProgress=e.progress,this._webglPercentText=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(e=>this._splashDoneResolve=e)}_SetGPUPowerPreference(e){this._gpuPreference=e}async CreateCanvas(e){this._canvas=e.canvas,this._canvas.addEventListener('webglcontextlost',e=>this._OnWebGLContextLost(e)),this._canvas.addEventListener('webglcontextrestored',e=>this._OnWebGLContextRestored(e));const t={powerPreference:this._gpuPreference,enableGpuProfiling:!0};'Android'===C3.Platform.OS&&'Chromium'===C3.Platform.BrowserEngine&&75>C3.Platform.BrowserVersionNumber&&(console.warn('[Construct 3] Disabling WebGL 2 because this device appears to be affected by crbug.com/934823. Install software updates to avoid this.'),t.maxWebGLVersion=1),'standard'===this._runtime.GetCompositingMode()?t.alpha=!0:(t.alpha=!1,t.lowLatency=!0),this._webglRenderer=C3.New(C3.Gfx.WebGLRenderer,this._canvas,t),await this._webglRenderer.InitState(),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=!!e.isFullscreen,this.SetSize(e.windowInnerWidth,e.windowInnerHeight,!0),this._shaderData=self.C3_Shaders,await this._LoadShaderPrograms();let n=!1;for(const t of this._runtime._GetAllEffectLists()){for(const e of t.GetAllEffectTypes())e._InitRenderer(this._webglRenderer),e.GetShaderProgram().UsesDest()&&(n=!0);t.UpdateActiveEffects()}this._runtime._SetUsesAnyBackgroundBlending(n),this._webglRenderer.SupportsGPUProfiling()&&(this._gpuFrameTimingsBuffer=C3.New(C3.Gfx.WebGLQueryResultBuffer,this._webglRenderer))}async _LoadShaderPrograms(){if(this._shaderData){const e=[];for(const[t,a]of Object.entries(this._shaderData)){const n=C3.Gfx.WebGLShaderProgram.GetDefaultVertexShaderSource(this._webglRenderer.Is3D());e.push(this._webglRenderer.CreateShaderProgram(a,n,t))}await Promise.all(e),this._webglRenderer.ResetLastProgram(),this._webglRenderer.SetTextureFillMode()}}Release(){this._runtime=null,this._webglRenderer=null,this._canvas=null}_OnWindowResize(e){const t=e.devicePixelRatio;this._runtime.IsInWorker()&&(self.devicePixelRatio=t),this._runtime._SetDevicePixelRatio(t),this.SetSize(e.innerWidth,e.innerHeight),this._runtime.UpdateRender()}_OnFullscreenChange(e){this._isDocumentFullscreen=!!e.isFullscreen,this.SetSize(e.innerWidth,e.innerHeight,!0),this._runtime.UpdateRender()}_OnFullscreenError(e){this._isDocumentFullscreen=!!e.isFullscreen,this.SetSize(e.innerWidth,e.innerHeight,!0),this._runtime.UpdateRender()}SetSize(e,t,n=!1){var r=Math.floor;if(e=r(e),t=r(t),0>=e||0>=t)throw new Error('invalid size');if(this._windowInnerWidth!==e||this._windowInnerHeight!==t||n){this._windowInnerWidth=e,this._windowInnerHeight=t;const a=this.GetCurrentFullscreenMode();'letterbox-scale'===a?this._CalculateLetterboxScale(e,t):'letterbox-integer-scale'===a?this._CalculateLetterboxIntegerScale(e,t):'off'===a?this._CalculateFixedSizeCanvas(e,t):this._CalculateFullsizeCanvas(e,t),this._UpdateFullscreenScalingQuality(a),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,!0)}}_CalculateLetterboxScale(t,a){var n=Math.round,r=Math.floor;const s=this._runtime.GetDevicePixelRatio(),e=this._runtime.GetOriginalViewportWidth(),l=this._runtime.GetOriginalViewportHeight(),_=e/l;t/a>_?(this._canvasCssWidth=n(a*_),this._canvasCssHeight=a,this._canvasCssOffsetX=r((t-this._canvasCssWidth)/2),this._canvasCssOffsetY=0):(this._canvasCssWidth=t,this._canvasCssHeight=n(t/_),this._canvasCssOffsetX=0,this._canvasCssOffsetY=r((a-this._canvasCssHeight)/2)),this._canvasDeviceWidth=n(this._canvasCssWidth*s),this._canvasDeviceHeight=n(this._canvasCssHeight*s),this._runtime.SetViewportSize(e,l)}_CalculateLetterboxIntegerScale(t,n){var r=Math.max,s=Math.round,l=Math.floor;const e=this._runtime.GetDevicePixelRatio();1!==e&&(t+=1,n+=1);const _=this._runtime.GetOriginalViewportWidth(),d=this._runtime.GetOriginalViewportHeight(),u=_/d,c=t/n;let g;if(c>u){const t=n*u;g=t*e/_}else{const a=t/u;g=a*e/d}1g&&(g=1/Math.ceil(1/g)),this._canvasDeviceWidth=s(_*g),this._canvasDeviceHeight=s(d*g),this._canvasCssWidth=this._canvasDeviceWidth/e,this._canvasCssHeight=this._canvasDeviceHeight/e,this._canvasCssOffsetX=r(l((t-this._canvasCssWidth)/2),0),this._canvasCssOffsetY=r(l((n-this._canvasCssHeight)/2),0),this._runtime.SetViewportSize(_,d)}_CalculateFullsizeCanvas(t,a){var n=Math.round;const r=this._runtime.GetDevicePixelRatio();this._canvasCssWidth=t,this._canvasCssHeight=a,this._canvasDeviceWidth=n(this._canvasCssWidth*r),this._canvasDeviceHeight=n(this._canvasCssHeight*r),this._canvasCssOffsetX=0,this._canvasCssOffsetY=0;const s=this.GetDisplayScale();this._runtime.SetViewportSize(this._canvasCssWidth/s,this._canvasCssHeight/s)}_CalculateFixedSizeCanvas(t,a){var n=Math.round,r=Math.floor;const s=this._runtime.GetDevicePixelRatio();this._canvasCssWidth=this._runtime.GetViewportWidth(),this._canvasCssHeight=this._runtime.GetViewportHeight(),this._canvasDeviceWidth=n(this._canvasCssWidth*s),this._canvasDeviceHeight=n(this._canvasCssHeight*s),this.IsDocumentFullscreen()?(this._canvasCssOffsetX=r((t-this._canvasCssWidth)/2),this._canvasCssOffsetY=r((a-this._canvasCssHeight)/2)):(this._canvasCssOffsetX=0,this._canvasCssOffsetY=0),this._runtime.SetViewportSize(this._runtime.GetViewportWidth(),this._runtime.GetViewportHeight())}_UpdateFullscreenScalingQuality(e){if('high'===this._wantFullscreenScalingQuality)this._drawWidth=this._canvasDeviceWidth,this._drawHeight=this._canvasDeviceHeight,this._fullscreenScalingQuality='high';else{let t,n;if('off'===this.GetCurrentFullscreenMode()?(t=this._runtime.GetViewportWidth(),n=this._runtime.GetViewportHeight()):(t=this._runtime.GetOriginalViewportWidth(),n=this._runtime.GetOriginalViewportHeight()),this._canvasDeviceWidthe&&(this._drawHeight=this._drawWidth/a)}else if('scale-outer'===e){const e=t/n,a=this._windowInnerWidth/this._windowInnerHeight;a>e?this._drawWidth=this._drawHeight*a:ar||'scale-inner'===t&&st.IsCompatibleWithOptions(e));let n;return-1===a?n=this._webglRenderer.CreateRenderTarget(e):(n=t[a],t.splice(a,1)),this._usedAdditionalRenderTargets.add(n),n}ReleaseAdditionalRenderTarget(e){if(!this._usedAdditionalRenderTargets.has(e))throw new Error('render target not in use');this._usedAdditionalRenderTargets.delete(e),this._availableAdditionalRenderTargets.push(e)}*activeLayersGpuProfiles(){for(const e of this._runtime.GetLayoutManager().runningLayouts())for(const t of e.GetLayers()){const e=this._layersGpuProfile.get(t);e&&(yield e)}}GetLayerTimingsBuffer(e){if(!this._webglRenderer.SupportsGPUProfiling())return null;let t=this._layersGpuProfile.get(e);return t||(t={name:e.GetName(),timingsBuffer:C3.New(C3.Gfx.WebGLQueryResultBuffer,this._webglRenderer),curUtilisation:0,lastUtilisation:0},this._layersGpuProfile.set(e,t)),t.timingsBuffer}_Update1sFrameRange(){if(this._webglRenderer.SupportsGPUProfiling()&&0===this._gpuTimeEndFrame){this._gpuTimeEndFrame=this._webglRenderer.GetFrameNumber(),this._gpuCurUtilisation=NaN;for(const e of this.activeLayersGpuProfiles())e.curUtilisation=NaN}}_UpdateTick(){var e=Math.min;if(this._webglRenderer.SupportsGPUProfiling()&&isNaN(this._gpuCurUtilisation)&&(this._gpuCurUtilisation=this._gpuFrameTimingsBuffer.GetFrameRangeResultSum(this._gpuTimeStartFrame,this._gpuTimeEndFrame),!isNaN(this._gpuCurUtilisation))){if(this._runtime.IsDebug())for(const e of this.activeLayersGpuProfiles())if(e.curUtilisation=e.timingsBuffer.GetFrameRangeResultSum(this._gpuTimeStartFrame,this._gpuTimeEndFrame),isNaN(e.curUtilisation))return;if(this._gpuFrameTimingsBuffer.DeleteAllBeforeFrameNumber(this._gpuTimeEndFrame),this._gpuLastUtilisation=e(this._gpuCurUtilisation,1),this._runtime.IsDebug()){for(const t of this.activeLayersGpuProfiles())t.timingsBuffer.DeleteAllBeforeFrameNumber(this._gpuTimeEndFrame),t.lastUtilisation=e(t.curUtilisation,1);C3Debugger.UpdateGPUProfile(this._gpuLastUtilisation,[...this.activeLayersGpuProfiles()])}this._gpuTimeStartFrame=this._gpuTimeEndFrame,this._gpuTimeEndFrame=0}}GetGPUFrameTimingsBuffer(){return this._gpuFrameTimingsBuffer}GetGPUUtilisation(){return this._gpuLastUtilisation}SnapshotCanvas(e,t){return(this._snapshotFormat=e,this._snapshotQuality=t,this._snapshotPromise)?this._snapshotPromise:(this._snapshotPromise=new Promise(e=>{this._snapshotResolve=e}),this._snapshotPromise)}_MaybeTakeSnapshot(){this._snapshotFormat&&(C3.CanvasToBlob(this._canvas,this._snapshotFormat,this._snapshotQuality).then(e=>{this._snapshotUrl=URL.createObjectURL(e),this._snapshotPromise=null,this._snapshotResolve(this._snapshotUrl)}),this._snapshotFormat='',this._snapshotQuality=1)}GetCanvasSnapshotUrl(){return this._snapshotUrl}InitLoadingScreen(e){if(2===e)this._webglPercentText=C3.New(C3.Gfx.WebGLText,this._webglRenderer),this._webglPercentText.SetIsAsync(!1),this._webglPercentText.SetFontName('Arial'),this._webglPercentText.SetFontSize(16),this._webglPercentText.SetHorizontalAlignment('center'),this._webglPercentText.SetVerticalAlignment('center'),this._webglPercentText.SetSize(300,200);else if(0===e){const e=this._runtime.GetAssetManager();let t;if(this._runtime.IsPreview()){if(!e._HasLocalUrlBlob('loading-logo.png'))return;t=e.GetLocalUrlAsBlobUrl('loading-logo.png')}else t=e.GetIconsSubfolder()+'loading-logo.png';this._loadingLogoAsset=e.LoadImage({url:t}),this._loadingLogoAsset.LoadStaticTexture(this._webglRenderer).catch(()=>console.warn(`[C3 runtime] Failed to load 'loading-logo.png' for loading screen. Check the project has an icon with that name.`))}else 4==e&&(this._LoadSvgSplashImage('splash-images/splash-logo.svg').then(e=>{'done'===this._splashState?this._webglRenderer.DeleteTexture(e):this._splashTextures.logo=e}).catch(e=>console.warn('Failed to load splash image: ',e)),this._LoadBitmapSplashImage('splash-images/splash-poweredby-512.png').then(e=>{'done'===this._splashState?this._webglRenderer.DeleteTexture(e):this._splashTextures.powered=e}).catch(e=>console.warn('Failed to load splash image: ',e)),this._LoadBitmapSplashImage('splash-images/splash-website-512.png').then(e=>{'done'===this._splashState?this._webglRenderer.DeleteTexture(e):this._splashTextures.website=e}).catch(e=>console.warn('Failed to load splash image: ',e)))}async _LoadSvgSplashImage(e){e=new URL(e,this._runtime.GetBaseURL()).toString();const t=await C3.FetchBlob(e),n=await this._runtime.RasterSvgImage(t,2048,2048);return await this._webglRenderer.CreateStaticTextureAsync(n,{mipMapQuality:'high'})}async _LoadBitmapSplashImage(e){e=new URL(e,this._runtime.GetBaseURL()).toString();const t=await C3.FetchBlob(e);return await this._webglRenderer.CreateStaticTextureAsync(t,{mipMapQuality:'high'})}StartLoadingScreen(){this._loaderStartTime=Date.now(),this._runtime.Dispatcher().addEventListener('loadingprogress',this._loadingprogress_handler),this._rafId=requestAnimationFrame(()=>this._DrawLoadingScreen())}async EndLoadingScreen(){this._loadingProgress=1,4===this._runtime.GetLoaderStyle()&&(await this._splashDonePromise),this._splashDoneResolve=null,this._splashDonePromise=null,-1!==this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=-1),this._runtime.Dispatcher().removeEventListener('loadingprogress',this._loadingprogress_handler),this._loadingprogress_handler=null,this._webglPercentText&&(this._webglPercentText.Release(),this._webglPercentText=null),this._loadingLogoAsset&&(this._loadingLogoAsset.Release(),this._loadingLogoAsset=null),this._webglRenderer.Start(),this._splashTextures.logo&&(this._webglRenderer.DeleteTexture(this._splashTextures.logo),this._splashTextures.logo=null),this._splashTextures.powered&&(this._webglRenderer.DeleteTexture(this._splashTextures.powered),this._splashTextures.powered=null),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()}_DrawLoadingScreen(){if(-1!==this._rafId){const e=this._webglRenderer;e.Start(),this._rafId=-1;const t=this._runtime.GetAssetManager().HasHadErrorLoading(),a=this._runtime.GetLoaderStyle();if(3!==a&&(this.SetCssTransform(e),e.ClearRgba(0,0,0,0),e.ResetColor(),e.SetTextureFillMode(),e.SetTexture(null)),0===a)this._DrawProgressBarAndLogoLoadingScreen(t);else if(1===a)this._DrawProgressBarLoadingScreen(t,120,0);else if(2===a)this._DrawPercentTextLoadingScreen(t);else if(3===a)C3.noop();else if(4===a)this._DrawSplashLoadingScreen(t);else throw new Error('invalid loader style');e.Finish(),this._rafId=requestAnimationFrame(()=>this._DrawLoadingScreen())}}_DrawPercentTextLoadingScreen(e){e?this._webglPercentText.SetColorRgb(1,0,0):this._webglPercentText.SetColorRgb(.6,.6,.6),this._webglPercentText.SetText(Math.round(100*this._loadingProgress)+'%');const t=this._canvasCssWidth/2,a=this._canvasCssHeight/2;n.setRect(t-150,a-100,t+150,a+100),this._webglRenderer.SetTexture(this._webglPercentText.GetTexture()),this._webglRenderer.Quad3(n,this._webglPercentText.GetTexRect())}_DrawProgressBarLoadingScreen(t,a,n){const r=this._webglRenderer;r.SetColorFillMode(),t?r.SetColorRgba(1,0,0,1):r.SetColorRgba(.118,.565,1,1);const e=this._canvasCssWidth/2,l=this._canvasCssHeight/2,_=a/2;s.setWH(e-_,l-4+n,Math.floor(a*this._loadingProgress),8),r.Rect(s),s.setWH(e-_,l-4+n,a,8),s.offset(-.5,-.5),s.inflate(.5,.5),r.SetColorRgba(0,0,0,1),r.LineRect2(s),s.inflate(1,1),r.SetColorRgba(1,1,1,1),r.LineRect2(s)}_DrawProgressBarAndLogoLoadingScreen(t){if(!this._loadingLogoAsset)return void this._DrawProgressBarLoadingScreen(t,120,0);const a=this._loadingLogoAsset.GetTexture();if(!a)return void this._DrawProgressBarLoadingScreen(t,120,0);const r=a.GetWidth(),s=a.GetHeight(),e=this._canvasCssWidth/2,l=this._canvasCssHeight/2,_=r/2,d=s/2;n.setRect(e-_,l-d,e+_,l+d),this._webglRenderer.SetTexture(a),this._webglRenderer.Quad(n),this._DrawProgressBarLoadingScreen(t,r,d+16)}_DrawSplashLoadingScreen(t){var _=Math.min,d=Math.max,e=Math.ceil;const u=this._webglRenderer,c=this._splashTextures.logo,g=this._splashTextures.powered,f=this._splashTextures.website,y=Date.now();0===this._splashFrameNumber&&(this._loaderStartTime=y);const l=this._runtime.IsPreview()||this._runtime.IsFBInstantAvailable()&&!this._runtime.IsCordova(),m=l?0:200,n=l?0:3e3;let S=1;'fade-in'===this._splashState?S=_((y-this._loaderStartTime)/300,1):'fade-out'===this._splashState&&(S=d(1-(y-this._splashFadeOutStartTime)/300,0)),u.SetColorFillMode(),u.SetColorRgba(.231*S,.251*S,.271*S,S),s.set(0,0,this._canvasCssWidth,this._canvasCssHeight),u.Rect(s);const G=e(this._canvasCssWidth),a=e(this._canvasCssHeight);let I,T;256=n&&1<=this._loadingProgress&&(this._splashState='fade-out',this._splashFadeOutStartTime=y),('fade-out'===this._splashState&&y-this._splashFadeOutStartTime>=300+m||l&&1<=this._loadingProgress&&500>y-this._loaderStartTime)&&this._splashDoneResolve()}}}{const l={messagePort:null,baseUrl:'',headless:!1,hasDom:!0,isInWorker:!1,useAudio:!0,projectData:'',exportType:''};let _=!0;C3.Runtime=class extends C3.DefendedBase{constructor(e){e=Object.assign({},l,e),super(),this._messagePort=e.messagePort,this._baseUrl=e.baseUrl,this._isHeadless=!!e.headless,this._hasDom=!!e.hasDom,this._isInWorker=!!e.isInWorker,_=e.ife,this._useAudio=!!e.useAudio,this._exportType=e.exportType,this._isiOSCordova=!!e.isiOSCordova,this._isiOSWebView=!!e.isiOSWebView,this._isFBInstantAvailable=!!e.isFBInstantAvailable,this._opusWasmScriptUrl=e.opusWasmScriptUrl,this._opusWasmBinaryUrl=e.opusWasmBinaryUrl,this._dataJsonFilename='data.json',this._isDebug=!!('preview'===this._exportType&&e.isDebug),this._breakpointsEnabled=this._isDebug,this._isDebugging=this._isDebug,this._debuggingDisabled=0;const a=e.previewImageBlobs,t=e.previewProjectFileBlobs;t&&Object.assign(a,t);const s=e.projectData;s&&(a[this._dataJsonFilename]=s),this._additionalLoadPromises=[],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=!1,this._isLoading=!0,this._usesAnyBackgroundBlending=!1;const d='html5'===this._exportType||'scirra-arcade'===this._exportType||'instant-games'===this._exportType;this._assetManager=C3.New(C3.AssetManager,this,{defaultLoadPolicy:d?'remote':'local',localUrlBlobs:a,isCordova:'cordova'===this._exportType,isiOSCordova:this._isiOSCordova,supportedAudioFormats:e.supportedAudioFormats}),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=!1,this._isFlushingPendingInstances=!1,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=!1,this._needRender=!0,this._pauseOnBlur=!1,this._isPausedOnBlur=!1,this._tickCallbacks={normal:t=>{this._rafId=-1,this._ruafId=-1,this.Tick(t)},tickOnly:t=>{this._ruafId=-1,this.Tick(t,!1,'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=!1,this._isInTick=!1,this._hasStartedTicking=!1,this._isLayoutFirstTick=!0,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=!1,this._saveToSlotName='',this._loadFromSlotName='',this._loadFromJson=null,this._lastSaveJson='',this._triggerOnCreateAfterLoad=[],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=!1,this._didRequestDeviceMotionEvent=!1,this._isReadyToHandleEvents=!1,this._waitingToHandleEvents=[],this._eventObjects={pretick:C3.New(C3.Event,'pretick',!1),tick:C3.New(C3.Event,'tick',!1),tick2:C3.New(C3.Event,'tick2',!1),instancedestroy:C3.New(C3.Event,'instancedestroy',!1),beforelayoutchange:C3.New(C3.Event,'beforelayoutchange',!1),layoutchange:C3.New(C3.Event,'layoutchange',!1)},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,e.jobScheduler),e.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(t){return C3.New(C3.Runtime,t)}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,this._canvasManager&&(this._canvasManager.Release(),this._canvasManager=null),this._dispatcher.Release(),this._dispatcher=null,this._tickEvent=null}['_OnMessageFromDOM'](t){const e=t.type;if('event'===e)this._OnEventFromDOM(t);else if('result'===e)this._OnResultFromDOM(t);else throw new Error(`unknown message '${e}'`)}_OnEventFromDOM(u){if(!this._isReadyToHandleEvents)return void this._waitingToHandleEvents.push(u);const c=u.component,g=u.handler,p=u.data,e=u.dispatchOpts,t=!!(e&&e.dispatchRuntimeEvent),a=!!(e&&e.dispatchUserScriptEvent),n=u.responseId;if('runtime'===c){if(t){const t=new C3.Event(g);t.data=p,this._dispatcher.dispatchEventAndWaitAsyncSequential(t)}if(a){const t=new C3.Event(g,!0);for(const[e,a]of Object.entries(p))t[e]=a;this.DispatchUserScriptEvent(t)}}const r=this._domEventHandlers.get(c);if(!r)return void(t||a||console.warn(`[Runtime] No DOM event handlers for component '${c}'`));const s=r.get(g);if(!s)return void(t||a||console.warn(`[Runtime] No DOM handler '${g}' for component '${c}'`));let _=null;try{_=s(p)}catch(e){return console.error(`Exception in '${c}' handler '${g}':`,e),void(null!==n&&this._PostResultToDOM(n,!1,''+e))}null!==n&&(_&&_.then?_.then(t=>this._PostResultToDOM(n,!0,t)).catch(e=>{console.error(`Rejection from '${c}' handler '${g}':`,e),this._PostResultToDOM(n,!1,''+e)}):this._PostResultToDOM(n,!0,_))}_PostResultToDOM(t,e,a){this._messagePort.postMessage({type:'result',responseId:t,isOk:e,result:a})}_OnResultFromDOM(r){const e=r.responseId,a=r.isOk,n=r.result,t=this._pendingResponsePromises.get(e);a?t.resolve(n):t.reject(n),this._pendingResponsePromises.delete(e)}AddDOMComponentMessageHandler(r,e,a){let n=this._domEventHandlers.get(r);if(n||(n=new Map,this._domEventHandlers.set(r,n)),n.has(e))throw new Error(`[Runtime] Component '${r}' already has handler '${e}'`);n.set(e,a)}PostComponentMessageToDOM(t,e,a){this._messagePort.postMessage({type:'event',component:t,handler:e,data:a,responseId:null})}PostComponentMessageToDOMAsync(r,e,a){const n=this._nextDomResponseId++,t=new Promise((t,e)=>{this._pendingResponsePromises.set(n,{resolve:t,reject:e})});return this._messagePort.postMessage({type:'event',component:r,handler:e,data:a,responseId:n}),t}PostToDebugger(t){if(!this.IsDebug())throw new Error('not in debug mode');this.PostComponentMessageToDOM('runtime','post-to-debugger',t)}async Init(t){this.IsDebug()?await C3Debugger.Init(this):self.C3Debugger&&self.C3Debugger.InitPreview(this);const[e]=await Promise.all([this._assetManager.FetchJson(this._dataJsonFilename),this._MaybeLoadOpusDecoder(),this._jobScheduler.Init()]);this._LoadDataJson(e),await this._InitialiseCanvas(t),this.IsPreview()||console.info('Made with Construct 3, the game and app creator :: https://www.construct.net');const a=this.GetWebGLRenderer();a?(console.info(`[C3 runtime] Hosted in ${this.IsInWorker()?'worker':'DOM'}, rendering with WebGL ${a.GetWebGLVersionNumber()} [${a.GetUnmaskedRenderer()}] (${a.IsDesynchronized()?'desynchronized':'standard'} compositing)`),a.HasMajorPerformanceCaveat()&&console.warn('[C3 runtime] WebGL indicates a major performance caveat. Software rendering may be in use. This can result in significantly degraded performance.')):console.info(`[C3 runtime] Hosted in ${this.IsInWorker()?'worker':'DOM'}, headless`),this._isReadyToHandleEvents=!0;for(const e of this._waitingToHandleEvents)this._OnEventFromDOM(e);C3.clearArray(this._waitingToHandleEvents),this._canvasManager&&this._canvasManager.StartLoadingScreen();for(const e of t.runOnStartupFunctions)this._additionalLoadPromises.push(this._RunOnStartupFunction(e));if(await Promise.all([this._assetManager.WaitForAllToLoad(),...this._additionalLoadPromises]),C3.clearArray(this._additionalLoadPromises),!this._assetManager.HasHadErrorLoading())return this._canvasManager&&(await this._canvasManager.EndLoadingScreen()),await this._dispatcher.dispatchEventAndWaitAsync(new C3.Event('beforeruntimestart')),await this.Start(),this._messagePort.postMessage({type:'runtime-ready'}),this}async _RunOnStartupFunction(t){try{await t(this._iRuntime)}catch(t){console.error('[C3 runtime] Error in runOnStartup function: ',t)}}_LoadDataJson(r){const e=r.project;this._projectName=e[0],this._projectVersion=e[16],this._projectUniqueId=e[31],this._appId=e[38],this._isPixelRoundingEnabled=!!e[9],this._originalViewportWidth=this._viewportWidth=e[10],this._originalViewportHeight=this._viewportHeight=e[11],this._parallaxXorigin=this._originalViewportWidth/2,this._parallaxYorigin=this._originalViewportHeight/2,this._compositingMode=e[36],this._framerateMode=e[37],'low-latency'===this._compositingMode&&this.IsAndroidWebView()&&77>=C3.Platform.BrowserVersionNumber&&(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=e[14],this._usesLoaderLayout=!!e[18],this._loaderStyle=e[19],this._nextUid=e[21],this._pauseOnBlur=e[22],this._assetManager._SetAudioFiles(e[7],e[25]),this._assetManager._SetMediaSubfolder(e[8]),this._assetManager._SetFontsSubfolder(e[32]),this._assetManager._SetIconsSubfolder(e[28]),this._assetManager._SetWebFonts(e[29]),this._canvasManager&&(this._canvasManager.SetFullscreenMode(C3.CanvasManager._FullscreenModeNumberToString(e[12])),this._canvasManager.SetFullscreenScalingQuality(e[23]?'high':'low'),this._canvasManager._SetGPUPowerPreference(e[34])),this._pluginManager.CreateSystemPlugin(),this._objectReferenceTable=self.C3_GetObjectRefTable();for(const t of e[2])this._pluginManager.CreatePlugin(t);this._objectReferenceTable=self.C3_GetObjectRefTable(),this._LoadJsPropNameTable();for(const t of e[3]){const a=C3.ObjectClass.Create(this,this._allObjectClasses.length,t);this._allObjectClasses.push(a),this._objectClassesByName.set(a.GetName().toLowerCase(),a),this._objectClassesBySid.set(a.GetSID(),a)}for(const t of e[4]){const a=this._allObjectClasses[t[0]];a._LoadFamily(t)}for(const t of e[27]){const a=t.map(t=>this._allObjectClasses[t]);this._allContainers.push(C3.New(C3.Container,this,a))}for(const e of this._allObjectClasses)e._OnAfterCreate();for(const t of e[5])this._layoutManager.Create(t);const a=e[1];if(a){const t=this._layoutManager.GetLayoutByName(a);t&&this._layoutManager.SetFirstLayout(t)}for(const t of e[33])this._timelineManager.Create(t);for(const t of e[35])this._transitionManager.Create(t);this._InitScriptInterfaces();for(const t of e[6])this._eventSheetManager.Create(t);this._eventSheetManager._PostInit(),this._InitGlobalVariableScriptInterface(),C3.clearArray(this._objectReferenceTable),this.FlushPendingInstances();let n='any';const l=e[20];1===l?n='portrait':2===l&&(n='landscape'),this.PostComponentMessageToDOM('runtime','set-target-orientation',{targetOrientation:n})}GetLoaderStyle(){return this._loaderStyle}IsFBInstantAvailable(){return this._isFBInstantAvailable}IsLoading(){return this._isLoading}AddLoadPromise(t){this._additionalLoadPromises.push(t)}_GetNextFamilyIndex(){return this._familyCount++}GetFamilyCount(){return this._familyCount}_AddEffectList(t){this._allEffectLists.push(t)}_GetAllEffectLists(){return this._allEffectLists}async _InitialiseCanvas(t){this._canvasManager&&(await this._canvasManager.CreateCanvas(t),this._canvasManager.InitLoadingScreen(this._loaderStyle))}async _MaybeLoadOpusDecoder(){if(this._assetManager.IsAudioFormatSupported('audio/webm; codecs=opus'))return;let t=null,n=null;try{this.IsiOSCordova()?n=await this._assetManager.CordovaFetchLocalFileAsArrayBuffer(this._opusWasmBinaryUrl):t=await this._assetManager.FetchBlob(this._opusWasmBinaryUrl)}catch(t){return void console.info('Failed to fetch Opus decoder WASM; assuming project has no Opus audio.',t)}n?this.AddJobWorkerBuffer(n,'opus-decoder-wasm'):this.AddJobWorkerBlob(t,'opus-decoder-wasm'),await this.AddJobWorkerScripts([this._opusWasmScriptUrl])}async _WasmDecodeWebMOpus(t){const e=await this.AddJob('OpusDecode',{arrayBuffer:t},[t]);return e}async Start(){if(this._hasStarted=!0,this._startTime=Date.now(),this._usesLoaderLayout){for(const t of this._allObjectClasses)t.IsFamily()||t.IsOnLoaderLayout()||!t.IsWorldType()||t.OnCreate();this._assetManager.WaitForAllToLoad().then(()=>{this._isLoading=!1,this._OnLoadFinished()})}else this._isLoading=!1;this._assetManager.SetInitialLoadFinished(),this.IsDebug()&&C3Debugger.RuntimeInit(_);for(const t of this._layoutManager.GetAllLayouts())t._CreateGlobalNonWorlds();const t=this._layoutManager.GetFirstLayout();await t._Load(null,this.GetWebGLRenderer()),await t._StartRunning(!0),this._fpsLastTime=performance.now(),this._usesLoaderLayout||this._OnLoadFinished();const e=await this.PostComponentMessageToDOMAsync('runtime','before-start-ticking');e.isSuspended?this._suspendCount++:this.Tick()}_OnLoadFinished(){this.Trigger(C3.Plugins.System.Cnds.OnLoadFinished,null,null),this.PostComponentMessageToDOM('runtime','register-sw')}GetObjectReference(t){t=Math.floor(t);const n=this._objectReferenceTable;if(0>t||t>=n.length)throw new Error('invalid object reference');return n[t]}_LoadJsPropNameTable(){for(const t of self.C3_JsPropNameTable){const e=C3.first(Object.keys(t));this._jsPropNameTable.push(e)}}GetJsPropName(t){t=Math.floor(t);const n=this._jsPropNameTable;if(0>t||t>=n.length)throw new Error('invalid prop reference');return n[t]}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 0===this.GetCurrentEventStackFrame().GetConditionIndex()}GetCurrentAction(){return this._eventSheetManager.GetCurrentAction()}GetPluginManager(){return this._pluginManager}GetSystemPlugin(){return this._pluginManager.GetSystemPlugin()}GetObjectClassByIndex(t){if(t=Math.floor(t),0>t||t>=this._allObjectClasses.length)throw new RangeError('invalid index');return this._allObjectClasses[t]}GetObjectClassByName(t){return this._objectClassesByName.get(t.toLowerCase())||null}GetObjectClassBySID(t){return this._objectClassesBySid.get(t)||null}GetSingleGlobalObjectClassByCtor(t){const e=this._pluginManager.GetPluginByConstructorFunction(t);return e?e.GetSingleGlobalObjectClass():null}GetAllObjectClasses(){return this._allObjectClasses}Dispatcher(){return this._dispatcher}UserScriptDispatcher(){return this._userScriptDispatcher}DispatchUserScriptEvent(t){const a=this.IsDebug()&&!this._eventSheetManager.IsInEventEngine();a&&C3Debugger.StartMeasuringScriptTime(),this._userScriptDispatcher.dispatchEvent(t),a&&C3Debugger.AddScriptTime()}DispatchUserScriptEventAsyncWait(e){return this._userScriptDispatcher.dispatchEventAndWaitAsync(e)}GetOriginalViewportWidth(){return this._originalViewportWidth}GetOriginalViewportHeight(){return this._originalViewportHeight}SetOriginalViewportSize(t,e){this._originalViewportWidth=t,this._originalViewportHeight=e}GetViewportWidth(){return this._viewportWidth}GetViewportHeight(){return this._viewportHeight}SetViewportSize(t,e){this._viewportWidth=t,this._viewportHeight=e}_SetDevicePixelRatio(t){this._devicePixelRatio=t}GetDevicePixelRatio(){return this._devicePixelRatio}GetParallaxXOrigin(){return this._parallaxXorigin}GetParallaxYOrigin(){return this._parallaxYorigin}GetCanvasManager(){return this._canvasManager}GetDrawWidth(){return this._canvasManager?this._canvasManager.GetDrawWidth():this._viewportWidth}GetDrawHeight(){return this._canvasManager?this._canvasManager.GetDrawHeight():this._viewportHeight}GetRenderScale(){return this._canvasManager?this._canvasManager.GetRenderScale():1}GetDisplayScale(){return this._canvasManager?this._canvasManager.GetDisplayScale():1}GetCanvasClientX(){return this._canvasManager?this._canvasManager.GetCanvasClientX():0}GetCanvasClientY(){return this._canvasManager?this._canvasManager.GetCanvasClientY():0}GetCanvasCssWidth(){return this._canvasManager?this._canvasManager.GetCssWidth():0}GetCanvasCssHeight(){return this._canvasManager?this._canvasManager.GetCssHeight():0}GetFullscreenMode(){return this._canvasManager?this._canvasManager.GetFullscreenMode():'off'}GetAdditionalRenderTarget(t){return this._canvasManager?this._canvasManager.GetAdditionalRenderTarget(t):null}ReleaseAdditionalRenderTarget(t){this._canvasManager&&this._canvasManager.ReleaseAdditionalRenderTarget(t)}_SetUsesAnyBackgroundBlending(t){this._usesAnyBackgroundBlending=!!t}UsesAnyBackgroundBlending(){return this._usesAnyBackgroundBlending}GetGPUUtilisation(){return this._canvasManager?this._canvasManager.GetGPUUtilisation():NaN}IsLinearSampling(){return'nearest'!==this.GetSampling()}GetFramerateMode(){return this._framerateMode}GetCompositingMode(){return this._compositingMode}GetSampling(){return this._sampling}UsesLoaderLayout(){return this._usesLoaderLayout}GetLayoutManager(){return this._layoutManager}GetMainRunningLayout(){return this._layoutManager.GetMainRunningLayout()}GetTimelineManager(){return this._timelineManager}GetTransitionManager(){return this._transitionManager}GetAssetManager(){return this._assetManager}LoadImage(t){return this._assetManager.LoadImage(t)}CreateInstance(r,e,a,n){return this.CreateInstanceFromData(r,e,!1,a,n)}CreateInstanceFromData(h,e,f,n,t,s){let y=null,S=null;if(h instanceof C3.ObjectClass){if(S=h,S.IsFamily()){const t=S.GetFamilyMembers(),e=Math.floor(this.Random()*t.length);S=t[e]}y=S.GetDefaultInstanceData()}else y=h,S=this.GetObjectClassByIndex(y[1]);const G=S.GetPlugin().IsWorldType();if(this._isLoading&&G&&!S.IsOnLoaderLayout())return null;const d=e;G||(e=null);let _=f&&!s&&y&&!this._instancesByUid.has(y[2])?y[2]:this._nextUid++;const l=y?y[0]:null,g=C3.New(C3.Instance,{runtime:this,objectType:S,layer:e,worldData:l,instVarData:y?y[3]:null,uid:_});this._instancesByUid.set(_,g);let c=null;if(G&&(c=g.GetWorldInfo(),'undefined'!=typeof n&&'undefined'!=typeof t&&(c.SetX(n),c.SetY(t)),S._SetAnyCollisionCellChanged(!0)),e&&(e._AddInstance(g,!0),(1!==e.GetParallaxX()||1!==e.GetParallaxY())&&S._SetAnyInstanceParallaxed(!0),e.GetLayout().MaybeLoadTexturesFor(S)),this._objectCount++,S.IsInContainer()&&!f&&!s){for(const r of S.GetContainer().objectTypes()){if(r===S)continue;const e=this.CreateInstanceFromData(r,d,!1,c?c.GetX():n,c?c.GetY():t,!0);g._AddSibling(e)}for(const t of g.siblings()){t._AddSibling(g);for(const e of g.siblings())t!==e&&t._AddSibling(e)}}S._SetIIDsStale();const I=y?C3.cloneArray(y[5]):null,m=y?y[4].map(t=>C3.cloneArray(t)):null;if(g._CreateSdkInstance(I,m),G&&l&&14===l.length){const t=l[13];g._SetHasTilemap(),g.GetSdkInstance().LoadTilemapData(t[2],t[0],t[1])}return this._instancesPendingCreate.push(g),this._hasPendingInstances=!0,this.IsDebug()&&C3Debugger.InstanceCreated(g),g}DestroyInstance(t){if(this._instancesToReleaseAtEndOfTick.has(t))return;const e=t.GetObjectClass();let a=this._instancesPendingDestroy.get(e);if(a){if(a.has(t))return;a.add(t)}else a=new Set,a.add(t),this._instancesPendingDestroy.set(e,a);if(this.IsDebug()&&C3Debugger.InstanceDestroyed(t),t._MarkDestroyed(),this._hasPendingInstances=!0,t.IsInContainer())for(const e of t.siblings())this.DestroyInstance(e);if(this._isFlushingPendingInstances&&C3.NotYetImplemented(),!this._layoutManager.IsEndingLayout()){const e=this.GetEventSheetManager();e.BlockFlushingInstances(!0),t._TriggerOnDestroyed(),e.BlockFlushingInstances(!1)}}FlushPendingInstances(){this._hasPendingInstances&&(this._isFlushingPendingInstances=!0,this._FlushInstancesPendingCreate(),this._FlushInstancesPendingDestroy(),this._isFlushingPendingInstances=!1,this._hasPendingInstances=!1,this.UpdateRender())}_FlushInstancesPendingCreate(){for(const t of this._instancesPendingCreate){const e=t.GetObjectClass();e._AddInstance(t);for(const a of e.GetFamilies())a._AddInstance(t),a._SetIIDsStale()}C3.clearArray(this._instancesPendingCreate)}_FlushInstancesPendingDestroy(){this._dispatcher.SetDelayRemoveEventsEnabled(!0);for(const[t,e]of this._instancesPendingDestroy.entries())this._FlushInstancesPendingDestroyForObjectClass(t,e),e.clear();this._instancesPendingDestroy.clear(),this._dispatcher.SetDelayRemoveEventsEnabled(!1)}_FlushInstancesPendingDestroyForObjectClass(t,r){C3.arrayRemoveAllInSet(t.GetInstances(),r),t._SetIIDsStale(),this._instancesToReleaseAffectedObjectClasses.add(t),0===t.GetInstances().length&&t._SetAnyInstanceParallaxed(!1);for(const e of t.GetFamilies())C3.arrayRemoveAllInSet(e.GetInstances(),r),e._SetIIDsStale(),this._instancesToReleaseAffectedObjectClasses.add(e);if(t.GetPlugin().IsWorldType()){const t=new Set([...r].map(t=>t.GetWorldInfo().GetLayer()));for(const e of t)e._RemoveAllInstancesInSet(r)}for(const s of r){const t=this._eventObjects.instancedestroy;t.instance=s,this._dispatcher.dispatchEvent(t),this._instancesByUid.delete(s.GetUID());const e=s.GetWorldInfo();e&&(e._RemoveFromCollisionCells(),e._RemoveFromRenderCells()),this._instancesToReleaseAtEndOfTick.add(s),this._objectCount--}}_GetInstancesPendingCreate(){return this._instancesPendingCreate}_GetNewUID(){return this._nextUid++}_MapInstanceByUID(t,e){this._instancesByUid.set(t,e)}_OnWebGLContextLost(){this._dispatcher.dispatchEvent(C3.New(C3.Event,'webglcontextlost')),this.SetSuspended(!0);for(const t of this._allObjectClasses)!t.IsFamily()&&t.HasLoadedTextures()&&t.ReleaseTextures();this.GetMainRunningLayout()._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(!1),this.UpdateRender()}_OnVisibilityChange(e){this.SetSuspended(e.hidden)}_OnWindowBlur(e){this.IsPreview()&&this._pauseOnBlur&&!C3.Platform.IsMobile&&(e.data.parentHasFocus||(this.SetSuspended(!0),this._isPausedOnBlur=!0))}_OnWindowFocus(){this._isPausedOnBlur&&(this.SetSuspended(!1),this._isPausedOnBlur=!1)}_RequestAnimationFrame(){const t=this._tickCallbacks;'vsync'===this._framerateMode?-1===this._rafId&&(this._rafId=self.requestAnimationFrame(t.normal)):'unlimited-tick'===this._framerateMode?(-1===this._ruafId&&(this._ruafId=C3.RequestUnlimitedAnimationFrame(t.tickOnly)),-1===this._rafId&&(this._rafId=self.requestAnimationFrame(t.renderOnly))):-1===this._ruafId&&(this._ruafId=C3.RequestUnlimitedAnimationFrame(t.normal))}_CancelAnimationFrame(){-1!==this._rafId&&(self.cancelAnimationFrame(this._rafId),this._rafId=-1),-1!==this._ruafId&&(C3.CancelUnlimitedAnimationFrame(this._ruafId),this._ruafId=-1)}IsSuspended(){return 0this._suspendCount&&(this._suspendCount=0);const a=this.IsSuspended();if(!e&&a)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(e&&!a){console.log('[Construct 3] Resuming');const t=performance.now();this._lastTickTime=t,this._fpsLastTime=t,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),this.HitBreakpoint()||this.Tick(t)}}_AddBehInstToTick(t){this._behInstsToTick.Add(t)}_AddBehInstToPostTick(t){this._behInstsToPostTick.Add(t)}_AddBehInstToTick2(t){this._behInstsToTick2.Add(t)}_RemoveBehInstToTick(t){this._behInstsToTick.Remove(t)}_RemoveBehInstToPostTick(t){this._behInstsToPostTick.Remove(t)}_RemoveBehInstToTick2(t){this._behInstsToTick2.Remove(t)}_BehaviorTick(){this._behInstsToTick.SetQueueingEnabled(!0);for(const t of this._behInstsToTick)t.Tick();this._behInstsToTick.SetQueueingEnabled(!1)}_BehaviorPostTick(){this._behInstsToPostTick.SetQueueingEnabled(!0);for(const t of this._behInstsToPostTick)t.PostTick();this._behInstsToPostTick.SetQueueingEnabled(!1)}_BehaviorTick2(){this._behInstsToTick2.SetQueueingEnabled(!0);for(const t of this._behInstsToTick2)t.Tick2();this._behInstsToTick2.SetQueueingEnabled(!1)}*_DebugBehaviorTick(){this._behInstsToTick.SetQueueingEnabled(!0);for(const t of this._behInstsToTick){const e=t.Tick();C3.IsIterator(e)&&(yield*e)}this._behInstsToTick.SetQueueingEnabled(!1)}*_DebugBehaviorPostTick(){this._behInstsToPostTick.SetQueueingEnabled(!0);for(const t of this._behInstsToPostTick){const e=t.PostTick();C3.IsIterator(e)&&(yield*e)}this._behInstsToPostTick.SetQueueingEnabled(!1)}*_DebugBehaviorTick2(){this._behInstsToTick2.SetQueueingEnabled(!0);for(const t of this._behInstsToTick2){const e=t.Tick2();C3.IsIterator(e)&&(yield*e)}this._behInstsToTick2.SetQueueingEnabled(!1)}async Tick(l,r,_){this._hasStartedTicking=!0;const n='background-wake'===_;if(this._hasStarted&&(!this.IsSuspended()||r||n)){const e=performance.now();this._isInTick=!0,l||(l=e),this._MeasureDt(l);const t=this.Step_BeforePreTick();this.IsDebugging()&&(await t);const a=this._dispatcher.dispatchEventAndWait_AsyncOptional(this._eventObjects.pretick);a instanceof Promise&&(await a);const s=this.Step_AfterPreTick();this.IsDebugging()&&(await s),this._NeedsHandleSaveOrLoad()&&(await this._HandleSaveOrLoad()),this.GetLayoutManager().IsPendingChangeMainLayout()&&(await this._MaybeChangeLayout());const r=this.Step_RunEventsEtc();this.IsDebugging()&&(await r),'background-wake'!=_&&'skip-render'!=_&&this.Render(),this.IsSuspended()||n||this._RequestAnimationFrame(),this._tickCount++,this._tickCountNoSave++,this._execCount++,this._isInTick=!1,this._mainThreadTimeCounter+=performance.now()-e}}async Step_BeforePreTick(){const t=this._eventSheetManager,e=this.IsDebug();this.FlushPendingInstances(),t.BlockFlushingInstances(!0),this.PushCurrentLayout(this.GetMainRunningLayout()),e&&C3Debugger.StartMeasuringTime(),this.IsDebugging()?await t.DebugRunScheduledWaits():t.RunScheduledWaits(),e&&C3Debugger.AddEventsTime(),this.PopCurrentLayout(),t.BlockFlushingInstances(!1),this.FlushPendingInstances(),t.BlockFlushingInstances(!0)}async Step_AfterPreTick(){const r=this.IsDebug(),e=this.IsDebugging(),a=this._dispatcher,n=this._eventObjects,t=this._userScriptEventObjects;r&&C3Debugger.StartMeasuringTime(),e?await this.DebugIterateAndBreak(this._DebugBehaviorTick()):this._BehaviorTick(),e?await this.DebugIterateAndBreak(this._DebugBehaviorPostTick()):this._BehaviorPostTick(),r&&C3Debugger.AddBehaviorTickTime(),r&&C3Debugger.StartMeasuringTime(),e?await this.DebugFireGeneratorEventAndBreak(n.tick):a.dispatchEvent(n.tick),r&&C3Debugger.AddPluginTickTime(),this._eventSheetManager.BlockFlushingInstances(!1),this.DispatchUserScriptEvent(t.tick)}async Step_RunEventsEtc(){const r=this._eventSheetManager,e=this._dispatcher,a=this._eventObjects,n=this.IsDebug(),t=this.IsDebugging();if(n&&C3Debugger.StartMeasuringTime(),t?await r.DebugRunEvents(this._layoutManager):r.RunEvents(this._layoutManager),n&&C3Debugger.AddEventsTime(),this._collisionEngine.ClearRegisteredCollisions(),0e++;)await this._DoChangeLayout(t.GetPendingChangeMainLayout())}_MeasureDt(t){if(0!==this._lastTickTime){const e=Math.max(t-this._lastTickTime,0);this._dt1=e/1e3;const a=1/this._minimumFramerate;.5a&&(this._dt1=a)}this._lastTickTime=t,this._dt=this._dt1*this._timeScale,this._gameTime.Add(this._dt),this._wallTime.Add(this._dt1),this._canvasManager&&this._canvasManager._UpdateTick(),1e3<=t-this._fpsLastTime&&(this._fpsLastTime+=1e3,1e3<=t-this._fpsLastTime&&(this._fpsLastTime=t),this._fps=this._fpsFrameCount,this._fpsFrameCount=0,this._mainThreadTime=Math.min(this._mainThreadTimeCounter/1e3,1),this._mainThreadTimeCounter=0,this._canvasManager&&this._canvasManager._Update1sFrameRange(),this._collisionEngine._Update1sStats(),this.IsDebug()&&C3Debugger.Update1sPerfStats()),this._fpsFrameCount++}async _DoChangeLayout(r){const e=this._dispatcher,a=this.GetLayoutManager(),n=a.GetMainRunningLayout();await n._StopRunning(),n._Unload(r,this.GetWebGLRenderer()),n===r&&this._eventSheetManager.ClearAllScheduledWaits(),this._collisionEngine.ClearRegisteredCollisions(),e.dispatchEvent(this._eventObjects.beforelayoutchange),C3.Asyncify.SetHighThroughputMode(!0),await r._Load(n,this.GetWebGLRenderer()),C3.Asyncify.SetHighThroughputMode(!1),await r._StartRunning(!1),e.dispatchEvent(this._eventObjects.layoutchange),this.UpdateRender(),this._isLayoutFirstTick=!0,this.FlushPendingInstances()}UpdateRender(){this._needRender=!0}GetWebGLRenderer(){return this._canvasManager?this._canvasManager.GetWebGLRenderer():null}Render(){if(!this._canvasManager||this._canvasManager.IsWebGLContextLost())return;const r=this.GetWebGLRenderer();if(r.Start(),r.CheckForQueryResults(),!this._needRender)return void r.IncrementFrameNumber();const e=this.IsDebug();e&&C3Debugger.StartMeasuringTime(),this._needRender=!1;let a=null;r.SupportsGPUProfiling()&&(a=this._canvasManager.GetGPUFrameTimingsBuffer().AddTimeElapsedQuery(),r.StartQuery(a)),r.SetTextureFillMode(),r.SetAlphaBlend(),r.SetColorRgba(1,1,1,1),r.SetRenderTarget(null),r.SetTexture(null);const s=this._layoutManager.GetMainRunningLayout();s.Draw(r),a&&r.EndQuery(a),r.Finish(),e&&(C3Debugger.AddDrawCallsTime(),C3Debugger.UpdateInspectHighlight()),this._canvasManager&&this._canvasManager._MaybeTakeSnapshot()}Trigger(l,e,a){if(!this._hasStarted)return!1;const n=!this._isInTick&&!this._eventSheetManager.IsInTrigger();let t=0;n&&(t=performance.now());const _=this.IsDebug();_&&this.SetDebuggingEnabled(!1);const d=this._eventSheetManager._Trigger(this._layoutManager,l,e,a);if(n){const a=performance.now()-t;this._mainThreadTimeCounter+=a,_&&C3Debugger.AddTriggersTime(a)}return _&&this.SetDebuggingEnabled(!0),d}DebugTrigger(t,e,a){if(!this.IsDebug())return this.Trigger(t,e,a);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,t,e,a)}async TriggerAsync(r,e,a){if(!this.IsDebugging())return this.Trigger(r,e,a);if(!this._hasStarted)return!1;if(this.HitBreakpoint())return this._eventSheetManager.QueueDebugTrigger(r,e,a);if(!this.GetMainRunningLayout())return this._eventSheetManager.QueueTrigger(r,e,a);const n=performance.now(),t=this._eventSheetManager._DebugTrigger(this._layoutManager,r,e,a);let s=t.next();for(;!s.done;)await this.DebugBreak(s.value),s=t.next();return this.IsSuspended()||this._eventSheetManager.IsInTrigger()||(await this._eventSheetManager.RunQueuedDebugTriggersAsync(),this._hasStartedTicking&&!this._isInTick&&this._RequestAnimationFrame()),this._mainThreadTimeCounter+=performance.now()-n,s.value}FastTrigger(r,e,a){const n=this.IsDebug();n&&this.SetDebuggingEnabled(!1);const t=this._eventSheetManager._FastTrigger(this._layoutManager,r,e,a);return n&&this.SetDebuggingEnabled(!0),t}DebugFastTrigger(t,e,a){return this._eventSheetManager._DebugFastTrigger(this._layoutManager,t,e,a)}ScheduleTriggers(t){return this._scheduleTriggersThrottle.Add(t)}PushCurrentLayout(t){this._currentLayoutStack.push(t)}PopCurrentLayout(){if(!this._currentLayoutStack.length)throw new Error('layout stack empty');this._currentLayoutStack.pop()}GetCurrentLayout(){return this._currentLayoutStack.length?this._currentLayoutStack[this._currentLayoutStack.length-1]:this.GetMainRunningLayout()}GetDt(t){return t&&-1!==t.GetTimeScale()?this._dt1*t.GetTimeScale():this._dt}_GetDtFast(){return this._dt}GetDt1(){return this._dt1}GetTimeScale(){return this._timeScale}SetTimeScale(t){(isNaN(t)||0>t)&&(t=0),this._timeScale=t}SetMinimumFramerate(t){this._minimumFramerate=C3.clamp(t,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(t){if(this._isLoadingState)throw new Error('cannot call while loading state - wait until afterload event');return this._instancesByUid.get(t)||null}_RefreshUidMap(){this._instancesByUid.clear();for(const t of this._allObjectClasses)if(!t.IsFamily())for(const e of t.GetInstances())this._instancesByUid.set(e.GetUID(),e)}IsPreview(){return'preview'===this._exportType}IsDebug(){return this._isDebug}GetExportType(){return this._exportType}IsCordova(){return'cordova'===this._exportType}IsAndroidWebView(){return'Android'===C3.Platform.OS&&('cordova'===this._exportType||'playable-ad'===this._exportType||'instant-games'===this._exportType)}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,this._isPixelRoundingEnabled===e||(this._isPixelRoundingEnabled=e,this.UpdateRender())}IsPixelRoundingEnabled(){return this._isPixelRoundingEnabled}SaveToSlot(t){this._saveToSlotName=t}LoadFromSlot(t){this._loadFromSlotName=t}LoadFromJsonString(t){this._loadFromJson=t}GetLastSaveJsonString(){return this._lastSaveJson}_NeedsHandleSaveOrLoad(){return!!(this._saveToSlotName||this._loadFromSlotName||null!==this._loadFromJson)}async _HandleSaveOrLoad(){if(this._saveToSlotName&&(this.FlushPendingInstances(),await this._DoSaveToSlot(this._saveToSlotName),this._ClearSaveOrLoad()),this._loadFromSlotName&&(await this._DoLoadFromSlot(this._loadFromSlotName),this._ClearSaveOrLoad(),this.IsDebug()&&C3Debugger.StepIfPausedInDebugger()),null!==this._loadFromJson){this.FlushPendingInstances();try{await this._DoLoadFromJsonString(this._loadFromJson),this._lastSaveJson=this._loadFromJson,await this.TriggerAsync(C3.Plugins.System.Cnds.OnLoadComplete,null),this._lastSaveJson=''}catch(t){console.error('[Construct 3] Failed to load state from JSON string: ',t),await this.TriggerAsync(C3.Plugins.System.Cnds.OnLoadFailed,null)}this._ClearSaveOrLoad()}}_ClearSaveOrLoad(){this._saveToSlotName='',this._loadFromSlotName='',this._loadFromJson=null}_GetProjectStorage(){return this._projectStorage||(this._projectStorage=localforage.createInstance({name:'c3-localstorage-'+this.GetProjectUniqueId(),description:this.GetProjectName()})),this._projectStorage}_GetSavegamesStorage(){return this._savegamesStorage||(this._savegamesStorage=localforage.createInstance({name:'c3-savegames-'+this.GetProjectUniqueId(),description:this.GetProjectName()})),this._savegamesStorage}async _DoSaveToSlot(t){const e=await this._SaveToJsonString();try{await this._GetSavegamesStorage().setItem(t,e),console.log('[Construct 3] Saved state to storage ('+e.length+' chars)'),this._lastSaveJson=e,await this.TriggerAsync(C3.Plugins.System.Cnds.OnSaveComplete,null),this._lastSaveJson=''}catch(t){console.error('[Construct 3] Failed to save state to storage: ',t),await this.TriggerAsync(C3.Plugins.System.Cnds.OnSaveFailed,null)}}async _DoLoadFromSlot(t){try{const e=await this._GetSavegamesStorage().getItem(t);if(!e)throw new Error('empty slot');console.log('[Construct 3] Loaded state from storage ('+e.length+' chars)'),await this._DoLoadFromJsonString(e),this._lastSaveJson=e,await this.TriggerAsync(C3.Plugins.System.Cnds.OnLoadComplete,null),this._lastSaveJson=''}catch(t){console.error('[Construct 3] Failed to load state from storage: ',t),await this.TriggerAsync(C3.Plugins.System.Cnds.OnLoadFailed,null)}}async _SaveToJsonString(){const t={c3save:!0,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 e of this._allObjectClasses)e.IsFamily()||e.HasNoSaveBehavior()||(t.types[e.GetSID().toString()]=e._SaveToJson());for(const e of this._layoutManager.GetAllLayouts())t.layouts[e.GetSID().toString()]=e._SaveToJson();const e=this._CreateUserScriptEvent('save');return e.saveData=null,await this.DispatchUserScriptEventAsyncWait(e),t.user_script_data=e.saveData,JSON.stringify(t)}IsLoadingState(){return this._isLoadingState}_TriggerOnCreateAfterLoad(t){C3.shallowAssignArray(this._triggerOnCreateAfterLoad,t)}async _DoLoadFromJsonString(r){const e=JSON.parse(r);if(e.c2save)throw new Error('C2 saves are incompatible with C3 runtime');if(!e.c3save)throw new Error('not valid C3 save data');if(1e||e>=t.length)throw new Error('missing sibling instance');a._AddSibling(t[e])}}this._timelineManager._LoadFromJson(e.timelines),this._dispatcher.dispatchEvent(C3.New(C3.Event,'afterload'));const t=this._CreateUserScriptEvent('load');t.saveData=e.user_script_data,await this.DispatchUserScriptEventAsyncWait(t),this.UpdateRender()}async AddJobWorkerScripts(t){const e=await Promise.all(t.map(t=>this._assetManager.FetchBlob(t))),a=e.map(t=>URL.createObjectURL(t));this._jobScheduler.ImportScriptsToJobWorkers(a)}AddJobWorkerBlob(t,e){this._jobScheduler.SendBlobToJobWorkers(t,e)}AddJobWorkerBuffer(t,e){this._jobScheduler.SendBufferToJobWorkers(t,e)}AddJob(t,e,a){return this._jobScheduler.AddJob(t,e,a)}BroadcastJob(t,e,a){return this._jobScheduler.BroadcastJob(t,e,a)}InvokeDownload(t,e){this.PostComponentMessageToDOM('runtime','invoke-download',{url:t,filename:e})}async RasterSvgImage(l,e,a,n,_,d){if(n=n||e,_=_||a,this.IsInWorker()){const t=await this.PostComponentMessageToDOMAsync('runtime','raster-svg-image',{blob:l,imageWidth:e,imageHeight:a,surfaceWidth:n,surfaceHeight:_,imageBitmapOpts:d});return t.imageBitmap}else{const t=await self.C3_RasterSvgImageBlob(l,e,a,n,_);return d?await self.createImageBitmap(t,d):t}}async GetSvgImageSize(t){return this.IsInWorker()?await this.PostComponentMessageToDOMAsync('runtime','get-svg-image-size',{blob:t}):await self.C3_GetSvgImageSize(t)}RequestDeviceOrientationEvent(){this._didRequestDeviceOrientationEvent||(this._didRequestDeviceOrientationEvent=!0,this.PostComponentMessageToDOM('runtime','enable-device-orientation'))}RequestDeviceMotionEvent(){this._didRequestDeviceMotionEvent||(this._didRequestDeviceMotionEvent=!0,this.PostComponentMessageToDOM('runtime','enable-device-motion'))}Random(){return this._randomNumberCallback()}SetRandomNumberGeneratorCallback(t){this._randomNumberCallback=t}_GetRemotePreviewStatusInfo(){return{fps:this.GetFPS(),cpu:this.GetMainThreadTime(),gpu:this.GetGPUUtilisation(),layout:this.GetMainRunningLayout()?this.GetMainRunningLayout().GetName():'',renderer:this.GetWebGLRenderer().GetUnmaskedRenderer()}}HitBreakpoint(){return!!this.IsDebug()&&C3Debugger.HitBreakpoint()}DebugBreak(t){return this.IsDebugging()?C3Debugger.DebugBreak(t):Promise.resolve()}DebugBreakNext(){return!!this.IsDebugging()&&C3Debugger.BreakNext()}SetDebugBreakpointsEnabled(e){this._breakpointsEnabled=!!e,this._UpdateDebuggingFlag()}AreDebugBreakpointsEnabled(){return this._breakpointsEnabled}IsDebugging(){return this._isDebugging}SetDebuggingEnabled(t){t?this._debuggingDisabled--:this._debuggingDisabled++,this._UpdateDebuggingFlag()}_UpdateDebuggingFlag(){this._isDebugging=this.IsDebug()&&this._breakpointsEnabled&&0===this._debuggingDisabled}IsCPUProfiling(){return this.IsDebug()&&C3Debugger.IsCPUProfiling()}IsGPUProfiling(){return this.IsDebug()&&this.GetWebGLRenderer().SupportsGPUProfiling()&&C3Debugger.IsGPUProfiling()}async DebugIterateAndBreak(t){if(t)for(const e of t)await this.DebugBreak(e)}DebugFireGeneratorEventAndBreak(t){return this.DebugIterateAndBreak(this._dispatcher.dispatchGeneratorEvent(t))}_InvokeFunctionFromJS(e){return this._eventSheetManager._InvokeFunctionFromJS(e.name,e.params)}GetIRuntime(){return this._iRuntime}_CreateUserScriptEvent(e){const t=C3.New(C3.Event,e,!1);return t.runtime=this._iRuntime,t}_InitScriptInterfaces(){const t={};for(const e of this._allObjectClasses)t[e.GetJsPropName()]={value:e.GetIObjectClass(),enumerable:!0,writable:!1};const e=Object.create(Object.prototype,t);this._iRuntime=new IRuntime(this,e),this._userScriptEventObjects={tick:this._CreateUserScriptEvent('tick')}}_InitGlobalVariableScriptInterface(){const t={};for(const e of this.GetEventSheetManager().GetAllGlobalVariables())t[e.GetJsPropName()]=e._GetScriptInterfaceDescriptor();this._iRuntime._InitGlobalVars(t)}_GetCommonScriptInterfaces(){return this._commonScriptInterfaces}_MapScriptInterface(t,e){this._interfaceMap.set(t,e)}_UnwrapScriptInterface(t){return this._interfaceMap.get(t)}},self.C3_CreateRuntime=C3.Runtime.Create,self.C3_InitRuntime=(t,e)=>t.Init(e)}'use strict',C3.JobSchedulerRuntime=class extends C3.DefendedBase{constructor(e,t){super(),this._runtime=e,this._jobPromises=new Map,this._nextJobId=0,this._inputPort=t.inputPort,t.outputPort.onmessage=e=>this._OnJobWorkerMessage(e),this._maxNumWorkers=t.maxNumWorkers,this._jobWorkerCount=1,this._isCreatingWorker=!1,this._hadErrorCreatingWorker=!1,this._isBroken=!1,this._testOkResolve=null}async Init(){await this._TestMessageChannelWorks()}ImportScriptsToJobWorkers(e){this._isBroken||this._inputPort.postMessage({type:'_import_scripts',scripts:e})}SendBlobToJobWorkers(e,t){this._isBroken||this._inputPort.postMessage({type:'_send_blob',blob:e,id:t})}SendBufferToJobWorkers(e,t){this._isBroken||this._inputPort.postMessage({type:'_send_buffer',buffer:e,id:t},[e])}AddJob(t,a,n,r,s){if(this._isBroken)return Promise.reject('messagechannels broken');n||(n=[]);const e=this._nextJobId++,l={type:t,isBroadcast:!1,jobId:e,params:a,transferables:n},_=new Promise((t,a)=>{this._jobPromises.set(e,{resolve:t,progress:r,reject:a,cancelled:!1})});return s&&s.SetAction(()=>this._CancelJob(e)),this._inputPort.postMessage(l,n),this._MaybeCreateExtraWorker(),_}BroadcastJob(t,a,n){if(!this._isBroken){n||(n=[]);const r=this._nextJobId++,s={type:t,isBroadcast:!0,jobId:r,params:a,transferables:n};this._inputPort.postMessage(s,n)}}_CancelJob(e){const t=this._jobPromises.get(e);t&&(t.cancelled=!0,t.resolve=null,t.progress=null,t.reject=null,this._inputPort.postMessage({type:'_cancel',jobId:e}))}_OnJobWorkerMessage(e){const t=e.data,a=t.type,n=t.jobId;switch(a){case'result':this._OnJobResult(n,t.result);break;case'progress':this._OnJobProgress(n,t.progress);break;case'error':this._OnJobError(n,t.error);break;case'ready':this._OnJobWorkerReady();break;case'_testMessageChannelOk':this._OnTestMessageChannelOk();break;default:throw new Error(`unknown message from worker '${a}'`);}}_OnJobResult(e,t){const a=this._jobPromises.get(e);if(!a)throw new Error('invalid job ID');a.cancelled||a.resolve(t),this._jobPromises.delete(e)}_OnJobProgress(e,t){const a=this._jobPromises.get(e);if(!a)throw new Error('invalid job ID');!a.cancelled&&a.progress&&a.progress(t)}_OnJobError(e,t){const a=this._jobPromises.get(e);if(!a)throw new Error('invalid job ID');a.cancelled||a.reject(t),this._jobPromises.delete(e)}_OnJobWorkerReady(){this._isCreatingWorker&&(this._isCreatingWorker=!1,this._jobWorkerCount++,this._jobWorkerCount=this._maxNumWorkers||this._isCreatingWorker||this._hadErrorCreatingWorker||this._jobPromises.size<=this._jobWorkerCount))try{this._isCreatingWorker=!0;const e=await this._runtime.PostComponentMessageToDOMAsync('runtime','create-job-worker');e.outputPort.onmessage=e=>this._OnJobWorkerMessage(e)}catch(e){this._hadErrorCreatingWorker=!0,this._isCreatingWorker=!1,console.error(`[Construct 3] Failed to create job worker; stopping creating any more (created ${this._jobWorkerCount} so far)`,e)}}_TestMessageChannelWorks(){return this._inputPort.postMessage({type:'_testMessageChannel'}),self.setTimeout(()=>this._CheckMessageChannelTestTimedOut(),2e3),new Promise(e=>this._testOkResolve=e)}_OnTestMessageChannelOk(){this._testOkResolve(),this._testOkResolve=null}_CheckMessageChannelTestTimedOut(){this._testOkResolve&&(console.warn('MessageChannel determined to be broken. Job scheduler disabled.'),this._isBroken=!0,this._testOkResolve(),this._testOkResolve=null)}},self.C3_Shaders={},'use strict';{function t(e,t){const n=e[1],r=t[1];if('number'==typeof n&&'number'==typeof r)return n-r;else{const e=''+n,t=''+r;return et?1:0}}let n=null,r='',s='',l=[],e='',_='',u='';const y=C3.New(C3.ArrayStack);C3.Plugins.System=class extends C3.SDKPluginBase{constructor(e){super(e),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(e){this._runtime.Trigger(e,null,null)}GetRegex(t,a){return n&&t===r&&a===s||(n=new RegExp(t,a),r=t,s=a),n.lastIndex=0,n}GetRegexMatches(t,a,n){if(t===e&&a===_&&n===u)return l;const r=this.GetRegex(a,n);return l=t.match(r),e=t,_=a,u=n,l}async _LoadTexturesForObjectClasses(e,t){if(t.length){this._imagesLoadingTotal+=t.length;const a=[];for(const n of t)a.push(e.MaybeLoadTexturesFor(n));await C3.PromiseAllWithProgress(a,()=>{this._imagesLoadingComplete++}),this._imagesLoadingComplete++,this._imagesLoadingComplete===this._imagesLoadingTotal&&(this._runtime.Trigger(C3.Plugins.System.Cnds.OnImageLoadingComplete,null,null),this._imagesLoadingComplete=0,this._imagesLoadingTotal=0)}}_UnloadTexturesForObjectClasses(e,t){for(const a of t)0===a.GetInstanceCount()&&e.MaybeUnloadTexturesFor(a)}_GetForEachStack(){return y}_Repeat(t){const a=this._runtime.GetEventSheetManager(),n=a.GetEventStack(),r=n.GetCurrentStackFrame(),s=r.GetCurrentEvent(),e=s.GetSolModifiers(),l=r.IsSolModifierAfterCnds(),_=n.Push(s),d=a.GetLoopStack(),u=d.Push();if(u.SetEnd(t),l)for(let n=0;n=r&&!p.IsStopped();--t)s.PushCopySol(d),p.SetIndex(t),_.Retrigger(e,c),s.PopSol(d);else for(let t=n;t>=r&&!p.IsStopped();--t)p.SetIndex(t),_.Retrigger(e,c);}else if(u)for(let t=n;t<=r&&!p.IsStopped();++t)s.PushCopySol(d),p.SetIndex(t),_.Retrigger(e,c),s.PopSol(d);else for(let t=n;t<=r&&!p.IsStopped();++t)p.SetIndex(t),_.Retrigger(e,c);return a.Pop(),g.Pop(),!1}*_DebugFor(t,n,r){const s=this._runtime.GetEventSheetManager(),a=s.GetEventStack(),e=a.GetCurrentStackFrame(),_=e.GetCurrentEvent(),d=_.GetSolModifiers(),u=e.IsSolModifierAfterCnds(),c=a.Push(_),g=s.GetLoopStack(),p=g.Push();if(p.SetName(t),p.SetEnd(r),r=r&&!p.IsStopped();--t)s.PushCopySol(d),p.SetIndex(t),yield*_.DebugRetrigger(e,c),s.PopSol(d);else for(let t=n;t>=r&&!p.IsStopped();--t)p.SetIndex(t),yield*_.DebugRetrigger(e,c);}else if(u)for(let t=n;t<=r&&!p.IsStopped();++t)s.PushCopySol(d),p.SetIndex(t),yield*_.DebugRetrigger(e,c),s.PopSol(d);else for(let t=n;t<=r&&!p.IsStopped();++t)p.SetIndex(t),yield*_.DebugRetrigger(e,c);return a.Pop(),g.Pop(),!1}_ForEach(t){const a=this._runtime.GetEventSheetManager(),r=a.GetEventStack(),s=r.GetCurrentStackFrame(),_=s.GetCurrentEvent(),e=_.GetSolModifiers(),d=s.IsSolModifierAfterCnds(),u=r.Push(_),c=a.GetLoopStack(),p=c.Push(),h=t.IsInContainer(),l=t.GetCurrentSol(),m=y.Push();if(C3.shallowAssignArray(m,l.GetInstances()),p.SetEnd(m.length),d)for(let n=0,r=m.length;n=r+e?(n.set('Every_lastTime',r+e),s>=n.get('Every_lastTime')+.04&&n.set('Every_lastTime',s),n.set('Every_seconds',t),!0):(s=t&&e<=n},CompareVar(e,t,a){return C3.compare(e.GetValue(),t,a)},CompareBoolVar(e){return!!e.GetValue()},CompareTime(e,t){const n=this._runtime.GetGameTime();if(0===e){const e=this._runtime.GetCurrentCondition(),a=e.GetSavedDataMap();return!a.get('CompareTime_executed')&&n>=t&&(a.set('CompareTime_executed',!0),!0)}return C3.compare(n,e,t)},IsNaN(e){return isNaN(e)},AngleWithin(e,t,a){return C3.angleDiff(C3.toRadians(e),C3.toRadians(a))<=C3.toRadians(t)},IsClockwiseFrom(e,t){return C3.angleClockwise(C3.toRadians(e),C3.toRadians(t))},IsBetweenAngles(t,n,a){let r=C3.toRadians(t),s=C3.toRadians(n),e=C3.toRadians(a),l=!C3.angleClockwise(e,s);return l?C3.angleClockwise(r,s)||!C3.angleClockwise(r,e):C3.angleClockwise(r,s)&&!C3.angleClockwise(r,e)},IsValueType(e,t){return'number'==typeof e?0===t:1===t},PickByComparison(t,n,r,s){if(!t)return!1;const a=this._GetForEachStack(),l=a.Push(),_=t.GetCurrentSol();C3.shallowAssignArray(l,_.GetInstances()),_.IsSelectAll()&&C3.clearArray(_._GetOwnElseInstances());const u=this._runtime.GetCurrentCondition();let c=0;for(let d=0,e=l.length;d=r.length)return!1;const s=r[a];return n.PickOne(s),t.ApplySolToContainer(),!0},PickRandom(t){if(!t)return!1;const a=t.GetCurrentSol(),n=a.GetInstances(),r=Math.floor(this._runtime.Random()*n.length);if(r>=n.length)return!1;const s=n[r];return a.PickOne(s),t.ApplySolToContainer(),!0},PickAll(e){if(!e)return!1;if(!e.GetInstanceCount())return!1;const t=e.GetCurrentSol();return t._SetSelectAll(!0),e.ApplySolToContainer(),!0},PickOverlappingPoint(a,n,r){if(!a)return!1;const s=a.GetCurrentSol(),e=s.GetInstances(),l=this._runtime.GetCurrentEvent(),_=l.IsOrBlock(),d=this._runtime.GetCurrentCondition().IsInverted();s.IsSelectAll()?(C3.shallowAssignArray(t,e),s.ClearArrays(),s._SetSelectAll(!1)):_?(C3.shallowAssignArray(t,s._GetOwnElseInstances()),C3.clearArray(s._GetOwnElseInstances())):(C3.shallowAssignArray(t,s._GetOwnInstances()),C3.clearArray(s._GetOwnInstances()));for(let e=0,l=t.length;et&&(t=0),!!e){const a=e.GetCurrentSol(),n=a.GetInstances();for(const e of n)e.SetTimeScale(t)}},RestoreObjectTimescale(e){if(e){const t=e.GetCurrentSol(),n=t.GetInstances();for(const e of n)e.RestoreTimeScale()}},Wait(e){if(!(0>e))return this._runtime.GetEventSheetManager().AddScheduledWait().InitTimer(e),!0},WaitForSignal(e){return this._runtime.GetEventSheetManager().AddScheduledWait().InitSignal(e),!0},WaitForPreviousActions(){const e=this._runtime.GetEventSheetManager();return e.AddScheduledWait().InitPromise(e.GetPromiseForAllAsyncActions()),!0},Signal(e){const t=e.toLowerCase();for(const a of this._runtime.GetEventSheetManager().scheduledWaits())a.IsSignal()&&a.GetSignalTag()===t&&a.SetSignalled()},async SnapshotCanvas(e,t){const a=this._runtime.GetCanvasManager();a&&(this.UpdateRender(),await a.SnapshotCanvas(0===e?'image/png':'image/jpeg',t/100),await this._runtime.TriggerAsync(C3.Plugins.System.Cnds.OnCanvasSnapshot,null))},SetCanvasSize(e,t){if(!(0>=e||0>=t)){this._runtime.SetViewportSize(e,t);const n=this._runtime.GetCurrentLayout();n.BoundScrolling();for(const e of n.GetLayers())e.UpdateViewport();const a=this._runtime.GetCanvasManager();a&&('off'===a.GetCurrentFullscreenMode()?a.SetSize(a.GetLastWidth(),a.GetLastHeight(),!0):(this._runtime.SetOriginalViewportSize(e,t),a.SetSize(a.GetLastWidth(),a.GetLastHeight(),!0)),this._runtime.UpdateRender())}},SetFullscreenQuality(e){const t=this._runtime.GetCanvasManager();t&&'off'!==t.GetCurrentFullscreenMode()&&(t.SetFullscreenScalingQuality(0===e?'low':'high'),t.SetSize(t.GetLastWidth(),t.GetLastHeight(),!0))},SaveState(e){this._runtime.SaveToSlot(e)},LoadState(e){this._runtime.LoadFromSlot(e)},LoadStateJSON(e){this._runtime.LoadFromJsonString(e)},SetHalfFramerateMode(){},ResetPersisted(){for(const e of this._runtime.GetLayoutManager().GetAllLayouts())e.ResetPersistData()},SetPixelRounding(e){this._runtime.SetPixelRoundingEnabled(0!==e)},SetMinimumFramerate(e){this._runtime.SetMinimumFramerate(e)},SortZOrderByInstVar(_,e){if(!_)return;const d=_.GetCurrentSol(),u=d.GetInstances(),g=r,p=s,h=this._runtime.GetCurrentLayout(),l=_.IsFamily(),m=_.GetFamilyIndex();for(let t=0,a=u.length;tr||r>=t.length)){const e=_.GetShaderProgram().GetParameterType(r);if('color'===e){n.setFromRgbValue(s);const e=t[r];if(n.equalsIgnoringAlpha(e))return;e.copyRgb(n)}else{if('percent'===e&&(s/=100),t[r]===s)return;t[r]=s}_.IsActive()&&this._runtime.UpdateRender()}}}},SetLayerForceOwnTexture(e,t){e&&(t=!!t,e.IsForceOwnTexture()===t||(e.SetForceOwnTexture(t),this.UpdateRender()))},SetLayoutScale(e){const t=this._runtime.GetCurrentLayout();t.GetScale()===e||(t.SetScale(e),this.UpdateRender())},SetLayoutAngle(e){e=C3.clampAngle(C3.toRadians(+e));const t=this._runtime.GetCurrentLayout();t.GetAngle()===e||(t.SetAngle(e),this.UpdateRender())},SetLayoutEffectEnabled(e,t){const a=this._runtime.GetCurrentLayout(),n=a.GetEffectList(),r=n.GetEffectTypeByName(t);if(r){const t=1===e;r.IsActive()===t||(r.SetActive(t),n.UpdateActiveEffects(),this._runtime.UpdateRender())}},SetLayoutEffectParam(e,t,r){const a=this._runtime.GetCurrentLayout(),s=a.GetEffectList(),l=s.GetEffectTypeByName(e);if(l){const e=l.GetIndex(),_=s.GetEffectParametersForIndex(e);if(t=Math.floor(t),!(0>t||t>=_.length)){const e=l.GetShaderProgram().GetParameterType(t);if('color'===e){n.setFromRgbValue(r);const e=_[t];if(n.equalsIgnoringAlpha(e))return;e.copyRgb(n)}else{if('percent'===e&&(r/=100),_[t]===r)return;_[t]=r}l.IsActive()&&this._runtime.UpdateRender()}}},ScrollX(e){const t=this._runtime.GetCurrentLayout();t.SetScrollX(e)},ScrollY(e){const t=this._runtime.GetCurrentLayout();t.SetScrollY(e)},Scroll(e,t){const a=this._runtime.GetCurrentLayout();a.SetScrollX(e),a.SetScrollY(t)},ScrollToObject(e){if(e){const t=e.GetFirstPicked();if(t){const e=t.GetWorldInfo();if(e){const t=this._runtime.GetCurrentLayout();t.SetScrollX(e.GetX()),t.SetScrollY(e.GetY())}}}},async LoadObjectTextures(e){const t=this._runtime.GetMainRunningLayout();if(t&&e&&!this._runtime.IsLoading()){const a=e.IsFamily()?e.GetFamilyMembers():[e];await this._LoadTexturesForObjectClasses(t,a)}},async LoadObjectTexturesByName(e){await C3.Plugins.System.Acts.LoadObjectTextures.call(this,this._runtime.GetObjectClassByName(e))},UnloadObjectTextures(e){const t=this._runtime.GetMainRunningLayout();if(t&&e){const a=e.IsFamily()?e.GetFamilyMembers():[e];this._UnloadTexturesForObjectClasses(t,a)}},UnloadObjectTexturesByName(e){C3.Plugins.System.Acts.UnloadObjectTexturesByName.call(this,this._runtime.GetObjectClassByName(e))},UnloadUnusedTextures(){const e=this._runtime.GetMainRunningLayout();if(e){const t=e._GetTextureLoadedObjectTypes();this._UnloadTexturesForObjectClasses(e,t)}},async LoadLayoutTextures(e){const t=this._runtime.GetMainRunningLayout();e&&t&&!this._runtime.IsLoading()&&(await this._LoadTexturesForObjectClasses(t,e._GetInitialObjectClasses()))},async LoadLayoutTexturesByName(e){const t=this._runtime.GetMainRunningLayout(),a=this._runtime.GetLayoutManager().GetLayoutByName(e);a&&t&&!this._runtime.IsLoading()&&(await this._LoadTexturesForObjectClasses(t,a._GetInitialObjectClasses()))},SetFunctionReturnValue(e){const t=this._eventStack.GetCurrentExpFuncStackFrame();if(t)switch(t.GetFunctionReturnType()){case 1:'number'==typeof e&&t.SetFunctionReturnValue(e);break;case 2:'string'==typeof e&&t.SetFunctionReturnValue(e);break;case 3:t.SetFunctionReturnValue(e);}},MapFunction(t,a,n){const r=this._GetFunctionMap(t.toLowerCase(),!0),s=r.strMap,e=a.toLowerCase();s.has(e)&&console.warn(`[Construct 3] Function map '${t}' string '${a}' already in map; overwriting entry`);const l=C3.first(s.values())||r.defaultFunc;if(l){const r=0!==l.GetReturnType(),s=0!==n.GetReturnType();if(r!=s)return void console.error(`[Construct 3] Function map '${t}' string '${a}' function return type not compatible with other functions in the map; entry ignored`)}s.set(e,n)},MapFunctionDefault(t,a){const e=this._GetFunctionMap(t.toLowerCase(),!0);e.defaultFunc&&console.warn(`[Construct 3] Function map '${t}' already has a default; overwriting entry`);const n=C3.first(e.strMap.values())||e.defaultFunc;if(n){const r=0!==n.GetReturnType(),s=0!==a.GetReturnType();if(r!=s)return void console.error(`[Construct 3] Function map '${t}' default: function return type not compatible with other functions in the map; entry ignored`)}e.defaultFunc=a},CallMappedFunction(t,a,n){n=Math.floor(n);const r=this._GetFunctionMap(t.toLowerCase(),!1);if(!r)return void console.warn(`[Construct 3] Call mapped function: map name '${t}' not found; call ignored`);let s=r.strMap.get(a.toLowerCase());if(!s)if(r.defaultFunc)s=r.defaultFunc,n=0;else return void console.warn(`[Construct 3] Call mapped function: no function associated with map '${t}' string '${a}'; call ignored (consider setting a default)`);if(s.IsEnabled()){if(0!==s.GetReturnType())return void console.warn(`[Construct 3] Call mapped function: map '${t}' string '${a}' has a return type so cannot be called`);const e=this._runtime,r=e.GetEventSheetManager(),_=r.GetCurrentEvent(),d=_.GetSolModifiersIncludingParents(),u=0e&&(a=e);return a},clamp(e,t,a){return C3.clamp(e,t,a)},distance(e,t,a,n){return C3.distanceTo(e,t,a,n)},angle(e,t,a,n){return C3.toDegrees(C3.angleTo(e,t,a,n))},lerp(e,t,a){return C3.lerp(e,t,a)},unlerp(e,t,a){return C3.unlerp(e,t,a)},qarp(e,t,a,n){return C3.qarp(e,t,a,n)},cubic(t,e,a,n,r){return C3.cubic(t,e,a,n,r)},cosp(e,t,a){return C3.cosp(e,t,a)},anglediff(e,t){return C3.toDegrees(C3.angleDiff(C3.toRadians(e),C3.toRadians(t)))},anglelerp(e,t,a){return C3.toDegrees(C3.angleLerp(C3.toRadians(e),C3.toRadians(t),a))},anglerotate(e,t,a){return C3.toDegrees(C3.angleRotate(C3.toRadians(e),C3.toRadians(t),C3.toRadians(a)))},setbit(e,t,n){return e|=0,t|=0,n=0===n?0:1,e&~(1<a?e.substr(t):e.substr(t,a):''},right(e,t){return'string'==typeof e?e.substr(e.length-t):''},trim(e){return'string'==typeof e?e.trim():''},tokenat(e,t,a){if('string'!=typeof e||'string'!=typeof a)return'';let n=e.split(a);return t=Math.floor(t),0>t||t>=n.length?'':n[t]},tokencount(e,t){return'string'==typeof e&&'string'==typeof t&&e.length?e.split(t).length:0},find(e,t){return'string'==typeof e&&'string'==typeof t?e.search(new RegExp(C3.EscapeRegex(t),'i')):-1},findcase(e,t){return'string'==typeof e&&'string'==typeof t?e.search(new RegExp(C3.EscapeRegex(t),'')):-1},replace(e,t,a){return'string'==typeof e&&'string'==typeof t&&'string'==typeof a?e.replace(new RegExp(C3.EscapeRegex(t),'gi'),a):'string'==typeof e?e:''},regexsearch(e,t,a){const n=this.GetRegex(t,a);return e?e.search(n):-1},regexreplace(t,a,n,r){const s=this.GetRegex(a,n);return t?t.replace(s,r):''},regexmatchcount(e,t,a){const n=this.GetRegexMatches(e.toString(),t,a);return n?n.length:0},regexmatchat(t,a,n,r){r=Math.floor(r);const s=this.GetRegexMatches(t.toString(),a,n);return!s||0>r||r>=s.length?'':s[r]},zeropad(e,t){let n=0>e?'-':'';0>e&&(e=-e);const r=t-e.toString().length;return n+='0'.repeat(Math.max(r,0)),n+e.toString()},urlencode(e){return encodeURIComponent(e)},urldecode(e){return decodeURIComponent(e)},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(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetViewport().getLeft():0},viewporttop(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetViewport().getTop():0},viewportright(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetViewport().getRight():0},viewportbottom(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetViewport().getBottom():0},viewportwidth(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetViewport().width():0},viewportheight(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetViewport().height():0},canvastolayerx(e,t,a){const n=this._runtime.GetCurrentLayout().GetLayer(e);return n?n.CanvasCssToLayer(t,a)[0]:0},canvastolayery(e,t,a){const n=this._runtime.GetCurrentLayout().GetLayer(e);return n?n.CanvasCssToLayer(t,a)[1]:0},layertocanvasx(e,t,a){const n=this._runtime.GetCurrentLayout().GetLayer(e);return n?n.LayerToCanvasCss(t,a)[0]:0},layertocanvasy(e,t,a){const n=this._runtime.GetCurrentLayout().GetLayer(e);return n?n.LayerToCanvasCss(t,a)[1]:0},layerscale(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetOwnScale():0},layerangle(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?C3.toDegrees(t.GetOwnAngle()):0},layeropacity(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?100*t.GetOpacity():0},layerscalerate(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetScaleRate():0},layerparallaxx(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?100*t.GetParallaxX():0},layerparallaxy(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?100*t.GetParallaxY():0},layerzelevation(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetZElevation():0},layerindex(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetIndex():-1},canvassnapshot(){const e=this._runtime.GetCanvasManager();return e?e.GetCanvasSnapshotUrl():''},loopindex(e){const t=this._loopStack;if(!t.IsInLoop())return 0;if(e){const a=t.FindByName(e);return a?a.GetIndex():0}return t.GetCurrent().GetIndex()},savestatejson(){return this._runtime.GetLastSaveJsonString()},callmapped(t,a,...r){const s=this._GetFunctionMap(t.toLowerCase(),!1);if(!s)return console.warn(`[Construct 3] Call mapped function: map name '${t}' not found; returning 0`),0;let _=s.strMap.get(a.toLowerCase());if(!_)if(s.defaultFunc)_=s.defaultFunc;else return console.warn(`[Construct 3] Call mapped function: no function associated with map '${t}' string '${a}'; returning 0 (consider setting a default)`),0;const d=_.GetReturnType(),u=_.GetDefaultReturnValue();if(0===d)return console.warn(`[Construct 3] Call mapped function: map '${t}' string '${a}' has no return type so cannot be called from an expression; returning 0`),0;if(!_.IsEnabled())return u;const c=this._runtime,g=c.GetEventSheetManager(),p=g.GetCurrentEvent(),h=p.GetSolModifiersIncludingParents(),f=0a.LoadAllTextures(e,t)))}ReleaseTextures(){for(const e of this._animations)e.ReleaseAllTextures()}OnDynamicTextureLoadComplete(){this._UpdateAllCurrentTexture()}_UpdateAllCurrentTexture(){for(const e of this._objectClass.instancesIncludingPendingCreate())e.GetSdkInstance()._UpdateCurrentTexture()}FinishCondition(e){C3.Plugins.Sprite._FinishCondition(this,e)}},'use strict';{const t=C3.New(C3.Quad),n=C3.New(C3.Vector2);C3.Plugins.Sprite.Instance=class extends C3.SDKWorldInstanceBase{constructor(t,a){super(t);let n=!0,r='',s=0,l=!0;a&&(n=!!a[0],r=a[1],s=a[2],l=a[3]),this._currentAnimation=this._objectClass.GetAnimationByName(r)||this._objectClass.GetAnimations()[0],this._currentFrameIndex=C3.clamp(s,0,this._currentAnimation.GetFrameCount()-1),this._currentAnimationFrame=this._currentAnimation.GetFrameAt(this._currentFrameIndex);const _=this._currentAnimationFrame.GetImageInfo();this._currentTexture=_.GetTexture(),this._currentRcTex=_.GetTexRect(),this.HandleWebGLContextLoss(),t.SetFlag(2,!0),t.SetFlag(1,0<=this._currentAnimation.GetSpeed()),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 u=this.GetWorldInfo();this._bquadRef=u.GetBoundingQuad(),u.SetVisible(n),u.SetCollisionEnabled(l),u.SetOriginX(this._currentAnimationFrame.GetOriginX()),u.SetOriginY(this._currentAnimationFrame.GetOriginY()),u.SetSourceCollisionPoly(this._currentAnimationFrame.GetCollisionPoly()),u.SetBboxChanged(),(1!==this._objectClass.GetAnimationCount()||1!==this._objectClass.GetAnimations()[0].GetFrameCount())&&0!==this._currentAnimationSpeed&&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(a){var n=Math.round;const r=this._currentTexture;if(null!==r){const s=this._bquadRef,e=this._currentRcTex;if(a.SetTexture(r),this._runtime.IsPixelRoundingEnabled()){const r=this.GetWorldInfo(),l=n(r.GetX())-r.GetX(),_=n(r.GetY())-r.GetY();t.copy(s),t.offset(l,_),a.Quad3(t,e)}else a.Quad3(s,e)}}_DrawCollisionPoly(t){const a=this.GetWorldInfo(),n=a.GetTransformedCollisionPoly();t.SetColorFillMode(),t.SetColorRgba(1,0,0,1);const r=n.pointsArr(),s=a.GetX(),e=a.GetY();for(let a=0,n=r.length;a=l&&(u?(this.SetPlayingForwards(!1),this._currentFrameIndex=l-2):d?this._currentFrameIndex=a:(this._animationRepeats++,this._animationRepeats>=_?this._FinishAnimation(!1):this._currentFrameIndex=a)),0>this._currentFrameIndex&&(u?(this._currentFrameIndex=1,this.SetPlayingForwards(!0),!d&&(this._animationRepeats++,this._animationRepeats>=_&&this._FinishAnimation(!0))):d?this._currentFrameIndex=a:(this._animationRepeats++,this._animationRepeats>=_?this._FinishAnimation(!0):this._currentFrameIndex=a)),this._currentFrameIndex=C3.clamp(this._currentFrameIndex,0,l-1);const c=e.GetFrameAt(this._currentFrameIndex);n>this._frameStartTime+c.GetDuration()/t&&(this._frameStartTime=n),this._OnFrameChanged(r,c)}}_FinishAnimation(e){this._currentFrameIndex=e?0:this._currentAnimation.GetFrameCount()-1,this.SetAnimationPlaying(!1),this._animTriggerName=this._currentAnimation.GetName(),this.SetInAnimationTrigger(!0),this.Trigger(C3.Plugins.Sprite.Cnds.OnAnyAnimFinished),this.Trigger(C3.Plugins.Sprite.Cnds.OnAnimFinished),this.SetInAnimationTrigger(!1),this._animationRepeats=0}_OnFrameChanged(t,a){const n=this.GetWorldInfo(),r=t.GetImageInfo(),s=a.GetImageInfo(),e=r.GetWidth(),l=r.GetHeight(),_=s.GetWidth(),d=s.GetHeight();e!==_&&n.SetWidth(n.GetWidth()*(_/e)),l!==d&&n.SetHeight(n.GetHeight()*(d/l)),n.SetOriginX(a.GetOriginX()),n.SetOriginY(a.GetOriginY()),n.SetSourceCollisionPoly(a.GetCollisionPoly()),n.SetBboxChanged(),this._currentAnimationFrame=a,this._currentTexture=s.GetTexture(),this._currentRcTex=s.GetTexRect();const u=this.GetInstance().GetBehaviorInstances();for(let e=0,n=u.length;ethis.CallAction(e.SetAnim,t,0)},{name:'plugins.sprite.debugger.animation-properties.current-frame',value:this._currentFrameIndex,onedit:t=>this.CallAction(e.SetAnimFrame,t)},{name:'plugins.sprite.debugger.animation-properties.is-playing',value:this.IsAnimationPlaying(),onedit:t=>t?this.CallAction(e.StartAnim,0):this.CallAction(e.StopAnim)},{name:'plugins.sprite.debugger.animation-properties.speed',value:this._currentAnimationSpeed,onedit:t=>this.CallAction(e.SetAnimSpeed,t)},{name:'plugins.sprite.debugger.animation-properties.repeats',value:this._animationRepeats,onedit:e=>this._animationRepeats=e}]}]}SaveToJson(){const e={a:this._currentAnimation.GetSID()};0!==this._frameStartTime&&(e.fs=this._frameStartTime);const t=this.GetAnimationTime();0!==t&&(e.at=t),0!==this._currentFrameIndex&&(e.f=this._currentFrameIndex),0!==this._currentAnimationSpeed&&(e.cas=this._currentAnimationSpeed),1!==this._animationRepeats&&(e.ar=this._animationRepeats),0!==this._currentAnimationRepeatTo&&(e.rt=this._currentAnimationRepeatTo),this.IsAnimationPlaying()||(e.ap=this.IsAnimationPlaying()),this.IsPlayingForwards()||(e.af=this.IsPlayingForwards());const a=this.GetWorldInfo();return a.IsCollisionEnabled()&&(e.ce=a.IsCollisionEnabled()),e}LoadFromJson(t){const a=this.GetObjectClass().GetAnimationBySID(t.a);a&&(this._currentAnimation=a),this._frameStartTime=t.hasOwnProperty('fs')?t.fs:0,this._animationTimer.Set(t.hasOwnProperty('at')?t.at:0);const n=t.hasOwnProperty('f')?t.f:0;this._currentFrameIndex=C3.clamp(n,0,this._currentAnimation.GetFrameCount()-1),this._currentAnimationSpeed=t.hasOwnProperty('cas')?t.cas:0,this._animationRepeats=t.hasOwnProperty('ar')?t.ar:1;const r=t.hasOwnProperty('rt')?t.rt:0;this._currentAnimationRepeatTo=C3.clamp(r,0,this._currentAnimation.GetFrameCount()-1),this.SetAnimationPlaying(!t.hasOwnProperty('ap')||!!t.ap),this.SetPlayingForwards(!t.hasOwnProperty('af')||!!t.af);const s=this._currentAnimation.GetFrameAt(this._currentFrameIndex),e=s.GetImageInfo();this._currentAnimationFrame=s,this._currentTexture=e.GetTexture(),this._currentRcTex=e.GetTexRect();const l=this.GetWorldInfo();l.SetOriginX(s.GetOriginX()),l.SetOriginY(s.GetOriginY()),l.SetSourceCollisionPoly(s.GetCollisionPoly()),l.SetCollisionEnabled(!!t.ce)}GetPropertyValueByIndex(e){const t=this.GetWorldInfo();return 3===e?t.IsCollisionEnabled():void 0}SetPropertyValueByIndex(e,t){const a=this.GetWorldInfo();3===e?a.SetCollisionEnabled(!!t):void 0}GetScriptInterfaceClass(){return ISpriteInstance}};const r=new WeakMap,s=new Map([['current-frame',0],['beginning',1]]);self.ISpriteInstance=class extends IWorldInstance{constructor(){super(),r.set(this,IInstance._GetInitInst().GetSdkInstance())}getImagePointX(e){if('string'!=typeof e&&'number'!=typeof e)throw new TypeError('expected string or number');return r.get(this).GetImagePoint(e)[0]}getImagePointY(e){if('string'!=typeof e&&'number'!=typeof e)throw new TypeError('expected string or number');return r.get(this).GetImagePoint(e)[1]}stopAnimation(){r.get(this).SetAnimationPlaying(!1)}startAnimation(e='current-frame'){const t=s.get(e);if('undefined'==typeof t)throw new Error('invalid mode');r.get(this)._StartAnim(t)}setAnimation(t,a='beginning'){const n=s.get(a);if('undefined'==typeof n)throw new Error('invalid mode');r.get(this)._SetAnim(t,n)}get animationName(){return r.get(this)._GetCurrentAnimationName()}set animationFrame(e){r.get(this)._SetAnimFrame(e)}get animationFrame(){return r.get(this)._GetAnimFrame()}set animationSpeed(e){r.get(this)._SetAnimSpeed(e)}get animationSpeed(){return r.get(this)._GetAnimSpeed()}set animationRepeatToFrame(e){r.get(this)._SetAnimRepeatToFrame(e)}get animationRepeatToFrame(){return r.get(this)._GetAnimRepeatToFrame()}get imageWidth(){return r.get(this).GetCurrentImageInfo().GetWidth()}get imageHeight(){return r.get(this).GetCurrentImageInfo().GetHeight()}}}{function t(t,n,r,a){const s=n.GetUID(),e=r.GetUID();sn(r,e.instance)));const f=G.GetCurrentSol(),b=y.GetCurrentSol(),u=f.GetInstances();let v=null;for(let e=0;en(r,e.instance)));const b=T.GetCurrentSol(),C=y.GetCurrentSol(),u=b.GetInstances();let v=null;for(let e=0;ethis.GetWorldInfo().GetWidth()},IsFlipped(){return 0>this.GetWorldInfo().GetHeight()},OnURLLoaded(){return!0},OnURLFailed(){return!0},IsCollisionEnabled(){return this.GetWorldInfo().IsCollisionEnabled()}}}'use strict',C3.Plugins.Sprite.Acts={Spawn(t,a,n){if(!t||!a)return;const[r,s]=this.GetImagePoint(n),e=this._runtime.CreateInstance(t,a,r,s);if(!e)return;if(t.GetPlugin().IsRotatable()){const t=e.GetWorldInfo();t.SetAngle(this.GetWorldInfo().GetAngle()),t.SetBboxChanged()}const l=this._runtime.GetEventSheetManager();if(l.BlockFlushingInstances(!0),e._TriggerOnCreated(),e.IsInContainer())for(const t of e.siblings())t._TriggerOnCreated();l.BlockFlushingInstances(!1);const _=this._runtime.GetCurrentAction(),d=_.GetSavedDataMap();let u=!1;if((!d.has('Spawn_LastExec')||d.get('Spawn_LastExec')r.GetWidth()?-1:1,e=0>r.GetHeight()?-1:1,l=n.GetWidth()*t*s,_=n.GetHeight()*t*e;(r.GetWidth()!==l||r.GetHeight()!==_)&&(r.SetSize(l,_),r.SetBboxChanged())},async LoadURL(t,a){const n=this._currentAnimationFrame,r=n.GetImageInfo(),s=this.GetWorldInfo(),e=this._runtime;if(r.GetURL()===t)return 0===a&&(s.SetSize(r.GetWidth(),r.GetHeight()),s.SetBboxChanged()),void this.Trigger(C3.Plugins.Sprite.Cnds.OnURLLoaded);const l=C3.New(C3.ImageInfo);return await l.LoadDynamicAsset(e,t),l.IsLoaded()?void(await l.LoadStaticTexture(e.GetWebGLRenderer(),{sampling:this._runtime.GetSampling()}),r.ReplaceWith(l),this._sdkType._UpdateAllCurrentTexture(),!this.WasReleased()&&0===a&&(s.SetSize(r.GetWidth(),r.GetHeight()),s.SetBboxChanged()),e.UpdateRender(),!this.WasReleased()&&(await this.TriggerAsync(C3.Plugins.Sprite.Cnds.OnURLLoaded))):void this.Trigger(C3.Plugins.Sprite.Cnds.OnURLFailed)},SetCollisions(e){this.GetWorldInfo().SetCollisionEnabled(e)},SetSolidCollisionFilter(e,t){this.GetWorldInfo().SetSolidCollisionFilter(0===e,t)},SetEffect(e){this.GetWorldInfo().SetBlendMode(e),this._runtime.UpdateRender()}},'use strict',C3.Plugins.Sprite.Exps={AnimationFrame(){return this._currentFrameIndex},AnimationFrameCount(){return this._currentAnimation.GetFrameCount()},AnimationName(){return this._currentAnimation.GetName()},AnimationSpeed(){return this._GetAnimSpeed()},OriginalAnimationSpeed(){return this._currentAnimation.GetSpeed()},ImagePointX(e){return this.GetImagePoint(e)[0]},ImagePointY(e){return this.GetImagePoint(e)[1]},ImagePointCount(){return this._currentAnimationFrame.GetImagePointCount()},ImageWidth(){return this.GetCurrentImageInfo().GetWidth()},ImageHeight(){return this.GetCurrentImageInfo().GetHeight()}},'use strict',C3.Plugins.ValerypopoffTouchPlusPlugin=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Plugins.ValerypopoffTouchPlusPlugin.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict',C3.Plugins.ValerypopoffTouchPlusPlugin.Instance=class extends C3.SDKInstanceBase{constructor(e,t){function a(e,t){var a=e.GetFamilyMembers();return!!(a&&0!=a.length)&&!!(0<=a.indexOf(t))}function n(e,t){var a=e.GetFamilyMembers();if(!a||0==a.length)return!1;var n={};try{a.forEach(e=>{t.forEach(t=>{if(e==t[0])throw n})})}catch(t){if(t===n)return!0;throw t}return!1}super(e),this.dontClickThroughObjects=!1,this.dontClickThroughObjectsOnOtherLayers=!1,this.dontClickThroughLayers=!1,this.ignoreInvisibleObjects=!1,this.ignoreInvisibleLayers=!1,t&&(this.dontClickThroughObjects=t[0],this.dontClickThroughObjectsOnOtherLayers=t[1],this.dontClickThroughLayers=t[2],this.ignoreInvisibleObjects=t[3],this.ignoreInvisibleLayers=t[4]);const r=['IsTouchingObject'],s=['OnDoubleTapGestureObject','OnHoldGestureObject','OnTapGestureObject','OnTouchObject'];this.TypesLayersWithCoords=function(e,t){for(var a=[],n=[],r=this._runtime._layoutManager.GetMainRunningLayout(),s=void 0,l=0,_;l{s.forEach(t=>{if(e.name==t){{e==C3.Plugins.Touch.Cnds[t]&&(C3.Plugins.Touch.Cnds['old_'+t]=C3.Plugins.Touch.Cnds[t]);var r=d.get(e);d.delete(e),e==C3.Plugins.Touch.Cnds[t]&&(C3.Plugins.Touch.Cnds[t]=function(e){var r=C3.Plugins.Touch.Cnds['old_'+t].apply(this,[e]);if(!r)return r;var s=l.TypesLayersWithCoords(this._curTouchX,this._curTouchY),_=s.TypesLayers,d=s.JustTypes;if(l.dontClickThroughObjects&&(0==_.length||_[_.length-1][0]!=e&&!a(e,_[_.length-1][0])))return!1;if(l.dontClickThroughObjectsOnOtherLayers){if(0==_.length)return!1;var u;_.forEach(t=>{null==u&&t[0]==e&&(u=t[1])});for(var c=_.length-1;0<=c&&(_[c][0]!=e||_[c][1]!=u);c--)if(_[c][0]!=e&&!a(e,_[c][0])&&_[c][1]!=u)return!1}if(l.dontClickThroughLayers){if(0==_.length)return!1;if(_[_.length-1][1]!=s.topmost_layer)return!1}return!!(-1!=d.indexOf(e)||n(e,_))&&r}),d.set(C3.Plugins.Touch.Cnds[t],r)}r.forEach(e=>{var a=e[0].GetConditions();a.forEach(e=>{e._objectClass&&e._objectClass._plugin instanceof C3.Plugins.Touch&&(e._func=C3.Plugins.Touch.Cnds[t],e.Run=C3.Plugins.Touch.Cnds[t].bind(this._runtime.GetPluginManager().GetPluginByConstructorFunction(C3.Plugins.Touch).GetSingleGlobalInstance().GetSdkInstance(),e._parameters[0].GetObjectClass()))})})}})})}}var c=this._runtime.GetEventSheetManager()._cndsBySid;for(var g of c.keys()){var p=c.get(g);r.forEach(e=>{p&&p._objectClass&&p._objectClass._plugin instanceof C3.Plugins.Touch&&p._func.name==e&&(C3.Plugins.Touch.Cnds['old_'+e]=C3.Plugins.Touch.Cnds[e],C3.Plugins.Touch.Cnds[e]=function(t){var r=C3.Plugins.Touch.Cnds['old_'+e].apply(this,[t]);if(!r)return r;var s=l.TypesLayersWithCoords(this._curTouchX,this._curTouchY),_=s.TypesLayers,d=s.JustTypes;if(l.dontClickThroughObjects&&(0==_.length||_[_.length-1][0]!=t&&!a(t,_[_.length-1][0])))return!1;if(l.dontClickThroughObjectsOnOtherLayers){if(0==_.length)return!1;var u;_.forEach(e=>{null==u&&e[0]==t&&(u=e[1])});for(var c=_.length-1;0<=c&&(_[c][0]!=t||_[c][1]!=u);c--)if(_[c][0]!=t&&!a(t,_[c][0])&&_[c][1]!=u)return!1}if(l.dontClickThroughLayers){if(0==_.length)return!1;if(_[_.length-1][1]!=s.topmost_layer)return!1}return!!(-1!=d.indexOf(t)||n(t,_))&&r},p._func=C3.Plugins.Touch.Cnds[e])})}this._runtime.GetEventSheetManager()._allSheets.forEach(e=>{function t(){function e(t){if(!(this instanceof C3.EventScript)&&!(this instanceof C3.EventInclude)&&!(this instanceof C3.EventVariable)){this._hasElseBlock=!!t,this._IdentifyTopLevelGroup(),this._IdentifySolModifiersIncludingParents(),this._IdentifyTriggerParents();for(const e of this._conditions)e.GetObjectClass()&&e.GetObjectClass().GetPlugin()instanceof C3.Plugins.Touch&&e._PostInit();const n=this._subEvents;for(let t=0,r=n.length;t{if(this._runtime.GetPluginManager().GetPluginByConstructorFunction(C3.Plugins.Touch)){var e=this._runtime.GetLayoutManager().GetAllLayouts();if(e){var t=!1;e.forEach(e=>{var a=e._eventSheetName;this._runtime.GetLayoutManager().GetMainRunningLayout()&&a&&this._runtime.GetEventSheetManager()&&this._runtime.GetEventSheetManager().GetEventSheetByName(a)&&this._runtime.GetEventSheetManager()._cndsBySid||(t=!0)}),t||(clearTimeout(_),this.highjack())}}},200)}Release(){super.Release()}SaveToJson(){return{}}LoadFromJson(){}},'use strict',C3.Plugins.ValerypopoffTouchPlusPlugin.Cnds={},'use strict',C3.Plugins.ValerypopoffTouchPlusPlugin.Acts={SetDontClickThroughObjects(e){0===e?this.dontClickThroughObjects=!1:1===e?this.dontClickThroughObjects=!0:2===e?this.dontClickThroughObjects=!this.dontClickThroughObjects:void 0},SetDontClickThroughObjectsOnOtherLayers(e){0===e?this.dontClickThroughObjectsOnOtherLayers=!1:1===e?this.dontClickThroughObjectsOnOtherLayers=!0:2===e?this.dontClickThroughObjectsOnOtherLayers=!this.dontClickThroughObjectsOnOtherLayers:void 0},SetDontClickThroughLayers(e){0===e?this.dontClickThroughLayers=!1:1===e?this.dontClickThroughLayers=!0:2===e?this.dontClickThroughLayers=!this.dontClickThroughLayers:void 0},SetIgnoreInvisibleObjects(e){0===e?this.ignoreInvisibleObjects=!1:1===e?this.ignoreInvisibleObjects=!0:2===e?this.ignoreInvisibleObjects=!this.ignoreInvisibleObjects:void 0},SetIgnoreInvisibleLayers(e){0===e?this.ignoreInvisibleLayers=!1:1===e?this.ignoreInvisibleLayers=!0:2===e?this.ignoreInvisibleLayers=!this.ignoreInvisibleLayers:void 0}},'use strict',C3.Plugins.ValerypopoffTouchPlusPlugin.Exps={},'use strict',C3.Plugins.Touch=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict';{function e(){return t.GetSingleGlobalInstance().GetSdkInstance()}C3.Plugins.Touch.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return ITouchObjectType}};let t=null;self.ITouchObjectType=class extends IObjectClass{constructor(e){super(e),t=e,e.GetRuntime()._GetCommonScriptInterfaces().touch=this}requestPermission(t){const a=e();if('orientation'===t)return a._RequestPermission(0);if('motion'===t)return a._RequestPermission(1);throw new Error('invalid type')}}}'use strict',C3.Plugins.Touch.Instance=class extends C3.SDKInstanceBase{constructor(e,t){super(e,'touch'),this._touches=new Map,this._useMouseInput=!1,this._isMouseDown=!1,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=[],t&&(this._useMouseInput=t[0]),this.AddDOMMessageHandler('permission-result',e=>this._OnPermissionResult(e));const a=this.GetRuntime().Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(a,'pointerdown',e=>this._OnPointerDown(e.data)),C3.Disposable.From(a,'pointermove',e=>this._OnPointerMove(e.data)),C3.Disposable.From(a,'pointerup',e=>this._OnPointerUp(e.data,!1)),C3.Disposable.From(a,'pointercancel',e=>this._OnPointerUp(e.data,!0)),C3.Disposable.From(a,'deviceorientation',e=>this._OnDeviceOrientation(e.data)),C3.Disposable.From(a,'devicemotion',e=>this._OnDeviceMotion(e.data)),C3.Disposable.From(a,'tick2',()=>this._OnTick2()))}Release(){this._touches.clear(),super.Release()}_OnPointerDown(t){if('mouse'===t.pointerType)if(this._useMouseInput)this._isMouseDown=!0;else return;const a=t.pointerId;if(!this._touches.has(a)){const n=t.clientX-this._runtime.GetCanvasClientX(),r=t.clientY-this._runtime.GetCanvasClientY(),s=t.timeStamp,e=this._touches.size;this._triggerIndex=e,this._triggerId=a;const l=C3.New(C3.Plugins.Touch.TouchInfo);l.Init(s,n,r,a,e),this._touches.set(a,l),this.Trigger(C3.Plugins.Touch.Cnds.OnNthTouchStart),this.Trigger(C3.Plugins.Touch.Cnds.OnTouchStart),this._curTouchX=n,this._curTouchY=r,this.Trigger(C3.Plugins.Touch.Cnds.OnTouchObject)}}_OnPointerMove(t){if('mouse'!==t.pointerType||this._isMouseDown){const a=this._touches.get(t.pointerId);if(a){const n=t.timeStamp;if(!(2>n-a.GetTime())){const r=t.clientX-this._runtime.GetCanvasClientX(),s=t.clientY-this._runtime.GetCanvasClientY();a.Update(n,r,s,t.width,t.height,t.pressure)}}}}_OnPointerUp(t,a){if('mouse'===t.pointerType)if(this._isMouseDown)this._isMouseDown=!1;else return;const n=t.timeStamp,r=t.pointerId,s=this._touches.get(r);if(s){if(this._triggerIndex=s.GetStartIndex(),this._triggerId=s.GetId(),this.Trigger(C3.Plugins.Touch.Cnds.OnNthTouchEnd),this.Trigger(C3.Plugins.Touch.Cnds.OnTouchEnd),!a){const e=s.ShouldTriggerTap(n);'single-tap'===e?(this.Trigger(C3.Plugins.Touch.Cnds.OnTapGesture),this._curTouchX=s.GetX(),this._curTouchY=s.GetY(),this.Trigger(C3.Plugins.Touch.Cnds.OnTapGestureObject)):'double-tap'===e&&(this.Trigger(C3.Plugins.Touch.Cnds.OnDoubleTapGesture),this._curTouchX=s.GetX(),this._curTouchY=s.GetY(),this.Trigger(C3.Plugins.Touch.Cnds.OnDoubleTapGestureObject))}s.Release(),this._touches.delete(r)}}_RequestPermission(e){return this._PostToDOMMaybeSync('request-permission',{type:e}),new Promise((t,a)=>{this._permissionPromises.push({type:e,resolve:t,reject:a})})}_OnPermissionResult(e){const t=e.result,n=e.type;this._triggerPermission=n;const a=this._permissionPromises.filter(e=>e.type===n);for(const n of a)n.resolve(t?'granted':'denied');this._permissionPromises=this._permissionPromises.filter(e=>e.type!==n),t?(this.Trigger(C3.Plugins.Touch.Cnds.OnPermissionGranted),0===n?this._runtime.RequestDeviceOrientationEvent():this._runtime.RequestDeviceMotionEvent()):this.Trigger(C3.Plugins.Touch.Cnds.OnPermissionDenied)}_OnDeviceOrientation(e){this._orientAlpha=e.alpha,this._orientBeta=e.beta,this._orientGamma=e.gamma}_OnDeviceMotion(e){const t=e.acceleration;t&&(this._accX=t.x,this._accY=t.y,this._accZ=t.z);const a=e.accelerationIncludingGravity;a&&(this._accWithGX=a.x,this._accWithGY=a.y,this._accWithGZ=a.z)}_OnTick2(){const e=performance.now();let t=0;for(const a of this._touches.values())a.GetTime()<=e-50&&a._SetLastTime(e),a.ShouldTriggerHold(e)&&(this._triggerIndex=a.GetStartIndex(),this._triggerId=a.GetId(),this._getTouchIndex=t,this.Trigger(C3.Plugins.Touch.Cnds.OnHoldGesture),this._curTouchX=a.GetX(),this._curTouchY=a.GetY(),this.Trigger(C3.Plugins.Touch.Cnds.OnHoldGestureObject),this._getTouchIndex=0),++t}_GetTouchByIndex(e){e=Math.floor(e);for(const t of this._touches.values()){if(0===e)return t;--e}return null}_IsClientPosOnCanvas(e,t){return 0<=e&&0<=t&&e({name:'$'+e.GetId(),value:e.GetX()+', '+e.GetY()}))}]}},'use strict';{const e=[];C3.Plugins.Touch.Cnds={OnTouchStart(){return!0},OnTouchEnd(){return!0},IsInTouch(){return 0=e+1},OnHoldGesture(){return!0},OnTapGesture(){return!0},OnDoubleTapGesture(){return!0},OnHoldGestureObject(e){return!!e&&!!this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY)&&this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(e,this._curTouchX,this._curTouchY,!1)},OnTapGestureObject(e){return!!e&&!!this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY)&&this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(e,this._curTouchX,this._curTouchY,!1)},OnDoubleTapGestureObject(e){return!!e&&!!this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY)&&this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(e,this._curTouchX,this._curTouchY,!1)},OnPermissionGranted(e){return this._triggerPermission===e},OnPermissionDenied(e){return this._triggerPermission===e}}}'use strict',C3.Plugins.Touch.Acts={RequestPermission(e){this._RequestPermission(e)}},'use strict',C3.Plugins.Touch.Exps={TouchCount(){return this._touches.size},X(e){const t=this._GetTouchByIndex(this._getTouchIndex);return t?t.GetPositionForLayer(this._runtime.GetCurrentLayout(),e,!0):0},Y(e){const t=this._GetTouchByIndex(this._getTouchIndex);return t?t.GetPositionForLayer(this._runtime.GetCurrentLayout(),e,!1):0},XAt(e,t){const a=this._GetTouchByIndex(e);return a?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),t,!0):0},YAt(e,t){const a=this._GetTouchByIndex(e);return a?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),t,!1):0},XForID(e,t){const a=this._touches.get(e);return a?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),t,!0):0},YForID(e,t){const a=this._touches.get(e);return a?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),t,!1):0},AbsoluteX(){const e=this._GetTouchByIndex(0);return e?e.GetX():0},AbsoluteY(){const e=this._GetTouchByIndex(0);return e?e.GetY():0},AbsoluteXAt(e){const t=this._GetTouchByIndex(e);return t?t.GetX():0},AbsoluteYAt(e){const t=this._GetTouchByIndex(e);return t?t.GetY():0},AbsoluteXForID(e){const t=this._touches.get(e);return t?t.GetX():0},AbsoluteYForID(e){const t=this._touches.get(e);return t?t.GetY():0},SpeedAt(e){const t=this._GetTouchByIndex(e);return t?t.GetSpeed():0},SpeedForID(e){const t=this._touches.get(e);return t?t.GetSpeed():0},AngleAt(e){const t=this._GetTouchByIndex(e);return t?C3.toDegrees(t.GetAngle()):0},AngleForID(e){const t=this._touches.get(e);return t?C3.toDegrees(t.GetAngle()):0},Alpha(){return this._runtime.RequestDeviceOrientationEvent(),this._orientAlpha},Beta(){return this._runtime.RequestDeviceOrientationEvent(),this._orientBeta},Gamma(){return this._runtime.RequestDeviceOrientationEvent(),this._orientGamma},AccelerationXWithG(){return this._runtime.RequestDeviceMotionEvent(),this._accWithGX},AccelerationYWithG(){return this._runtime.RequestDeviceMotionEvent(),this._accWithGY},AccelerationZWithG(){return this._runtime.RequestDeviceMotionEvent(),this._accWithGZ},AccelerationX(){return this._runtime.RequestDeviceMotionEvent(),this._accX},AccelerationY(){return this._runtime.RequestDeviceMotionEvent(),this._accY},AccelerationZ(){return this._runtime.RequestDeviceMotionEvent(),this._accZ},TouchIndex(){return this._triggerIndex},TouchID(){return this._triggerId},WidthForID(e){const t=this._touches.get(e);return t?t.GetWidth():0},HeightForID(e){const t=this._touches.get(e);return t?t.GetHeight():0},PressureForID(e){const t=this._touches.get(e);return t?t.GetPressure():0}},'use strict';{const t=15;let a=-1e3,n=-1e3,r=-1e4;C3.Plugins.Touch.TouchInfo=class 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=!1,this._isTooFarForHold=!1}Release(){}Init(t,a,n,r,s){this._pointerId=r,this._startIndex=s,this._time=t,this._lastTime=t,this._startTime=t,this._startX=a,this._startY=n,this._x=a,this._y=n,this._lastX=a,this._lastY=n}Update(a,n,r,s,e,l){this._lastTime=this._time,this._time=a,this._lastX=this._x,this._lastY=this._y,this._x=n,this._y=r,this._width=s,this._height=e,this._pressure=l,!this._isTooFarForHold&&C3.distanceTo(this._startX,this._startY,this._x,this._y)>=t&&(this._isTooFarForHold=!0)}GetId(){return this._pointerId}GetStartIndex(){return this._startIndex}GetTime(){return this._time}_SetLastTime(e){this._lastTime=e}GetX(){return this._x}GetY(){return this._y}GetSpeed(){const e=C3.distanceTo(this._x,this._y,this._lastX,this._lastY),t=(this._time-this._lastTime)/1e3;return 0=s-this._startTime&&!this._isTooFarForHold&&C3.distanceTo(this._startX,this._startY,this._x,this._y)=s-r&&25>C3.distanceTo(a,n,this._x,this._y)?(a=-1e3,n=-1e3,r=-1e4,'double-tap'):(a=this._x,n=this._y,r=s,'single-tap'):''}GetPositionForLayer(e,t,a){if('undefined'==typeof t){const t=e.GetLayerByIndex(0);return t.CanvasCssToLayer_DefaultTransform(this._x,this._y)[a?0:1]}else{const n=e.GetLayer(t);return n?n.CanvasCssToLayer(this._x,this._y)[a?0:1]:0}}}}'use strict',C3.Plugins.Spritefont2=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Plugins.Spritefont2.Type=class extends C3.SDKTypeBase{constructor(e){super(e),this._spriteFont=C3.New(SpriteFont)}Release(){super.Release()}OnCreate(){this.GetImageInfo().LoadAsset(this._runtime)}LoadTextures(e){return this.GetImageInfo().LoadStaticTexture(e,{sampling:this._runtime.GetSampling(),isTiled:!0})}ReleaseTextures(){this.GetImageInfo().ReleaseTexture()}GetSpriteFont(){return this._spriteFont}UpdateSettings(t,a,n,r){const s=this.GetImageInfo(),e=this._spriteFont;e.SetWidth(s.GetWidth()),e.SetHeight(s.GetHeight()),e.SetCharacterWidth(t),e.SetCharacterHeight(a),e.SetCharacterSet(n),e.SetSpacingData(r),e.UpdateCharacterMap()}},'use strict';{const t=['left','center','right'],a=['top','center','bottom'],n=C3.New(C3.Quad);C3.Plugins.Spritefont2.Instance=class extends C3.SDKWorldInstanceBase{constructor(e,t){super(e),this._text='',this._enableBBcode=!0,this._characterWidth=16,this._characterHeight=16,this._characterSet='';let n=[];if(this._characterScale=1,this._characterSpacing=0,this._lineHeight=0,this._horizontalAlign=0,this._verticalAlign=0,this._wrapByWord=!0,this._spriteFontText=null,this._typewriterStartTime=-1,this._typewriterEndTime=-1,this._typewriterLength=0,t){this._text=t[0],this._enableBBcode=t[1],this._characterWidth=t[2],this._characterHeight=t[3],this._characterSet=t[4],n=t[5],this._characterScale=t[6],this._characterSpacing=t[7],this._lineHeight=t[8],this._horizontalAlign=t[9],this._verticalAlign=t[10],this._wrapByWord=0===t[11];const e=this.GetWorldInfo();e.SetVisible(t[12])}this._sdkType.UpdateSettings(this._characterWidth,this._characterHeight,this._characterSet,n),this._spriteFontText=C3.New(SpriteFontText,this._sdkType.GetSpriteFont());const a=this.GetWorldInfo();this._spriteFontText.SetSize(a.GetWidth(),a.GetHeight()),this._UpdateSettings()}Release(){this._CancelTypewriter(),this._spriteFontText.Release(),this._spriteFontText=null,super.Release()}_UpdateSettings(){const e=this._spriteFontText;e&&(e.SetBBCodeEnabled(this._enableBBcode),e.SetText(this._text),e.SetWordWrapMode(this._wrapByWord?'word':'character'),e.SetHorizontalAlign(t[this._horizontalAlign]),e.SetVerticalAlign(a[this._verticalAlign]),e.SetScale(this._characterScale),e.SetSpacing(this._characterSpacing),e.SetLineHeight(this._lineHeight))}Draw(t){var r=Math.round;const a=this._objectClass.GetImageInfo(),s=a.GetTexture();if(!s)return;t.SetTexture(s);const e=this.GetWorldInfo();let l=e.GetBoundingQuad();const _=this._spriteFontText;if(this._runtime.IsPixelRoundingEnabled()){const t=r(e.GetX())-e.GetX(),a=r(e.GetY())-e.GetY();n.copy(l),n.offset(t,a),l=n}_.SetSize(e.GetWidth(),e.GetHeight()),_.GetSpriteFont().SetTexRect(a.GetTexRect()),_.SetColor(e.GetUnpremultipliedColor()),_.Draw(t,l.getTlx(),l.getTly(),e.GetAngle())}SaveToJson(){const e={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()};return-1!==this._typewriterEndTime&&(o.tw={st:this._typewriterStartTime,en:this._typewriterEndTime,l:this._typewriterLength}),e}LoadFromJson(e){if(this._CancelTypewriter(),this._text=e.t,this._enableBBcode=e.ebbc,this._characterScale=e.csc,this._characterSpacing=e.csp,this._lineHeight=e.lh,this._horizontalAlign=e.ha,this._verticalAlign=e.va,this._wrapByWord=e.w,e.hasOwnProperty('tw')){const t=e.tw;this._typewriterStartTime=t.st,this._typewriterEndTime=t.en,this._typewriterLength=e.l}const t=this._sdkType.GetSpriteFont();t.SetCharacterWidth(e.cw),t.SetCharacterHeight(e.ch),t.SetCharacterSet(e.cs),t.SetSpacingData(e.sd),this._UpdateSettings(),-1!==this._typewriterEndTime&&this._StartTicking()}GetPropertyValueByIndex(e){return 0===e?this._text:1===e?this._enableBBcode:2===e?this._sdkType.GetSpriteFont().GetCharacterWidth():3===e?this._sdkType.GetSpriteFont().GetCharacterHeight():4===e?this._sdkType.GetSpriteFont().GetCharacterSet():5===e?this._sdkType.GetSpriteFont().GetSpacingData():6===e?this._characterScale:7===e?this._characterSpacing:8===e?this._lineHeight:9===e?this._horizontalAlign:10===e?this._verticalAlign:11===e?this._wrapByWord?1:0:void 0}SetPropertyValueByIndex(e,t){switch(e){case 0:if(this._text===t)return;this._text=t,this._UpdateSettings();break;case 1:if(this._enableBBcode===!!t)return;this._enableBBcode=!!t,this._UpdateSettings();break;case 2:this._sdkType.GetSpriteFont().SetCharacterWidth(t);break;case 3:this._sdkType.GetSpriteFont().SetCharacterHeight(t);break;case 4:this._sdkType.GetSpriteFont().SetCharacterSet(t);break;case 5:this._sdkType.GetSpriteFont().SetSpacingData(t);break;case 6:if(this._characterScale===t)return;this._characterScale=t,this._UpdateSettings();break;case 7:if(this._characterSpacing===t)return;this._characterSpacing=t,this._UpdateSettings();break;case 8:if(this._lineHeight===t)return;this._lineHeight=t,this._UpdateSettings();break;case 9:if(this._horizontalAlign===t)return;this._horizontalAlign=t,this._UpdateSettings();break;case 10:if(this._verticalAlign===t)return;this._verticalAlign=t,this._UpdateSettings();break;case 11:if(this._wrapByWord===(0===t))return;this._wrapByWord=0===t,this._UpdateSettings();}}_SetText(e){this._text===e||(this._text=e,this._spriteFontText.SetText(e),this._runtime.UpdateRender())}GetText(){return this._text}_StartTypewriter(e,t){this._SetText(e),this._typewriterStartTime=this._runtime.GetGameTime(),this._typewriterEndTime=this._typewriterStartTime+t,this._typewriterLength=C3.BBString.StripAnyTags(e).length,this._spriteFontText.SetDrawMaxCharacterCount(0),this._StartTicking()}_CancelTypewriter(){this._typewriterStartTime=-1,this._typewriterEndTime=-1,this._typewriterLength=0,this._spriteFontText.SetDrawMaxCharacterCount(-1),this._StopTicking()}_FinishTypewriter(){-1===this._typewriterEndTime||(this._CancelTypewriter(),this.Trigger(C3.Plugins.Spritefont2.Cnds.OnTypewriterTextFinished),this._runtime.UpdateRender())}_SetScale(e){this._characterScale===e||(this._characterScale=e,this._spriteFontText.SetScale(this._characterScale),this._runtime.UpdateRender())}_GetScale(){return this._characterScale}_SetCharacterSpacing(e){this._characterSpacing===e||(this._characterSpacing=e,this._spriteFontText.SetSpacing(this._characterSpacing),this._runtime.UpdateRender())}_GetCharacterSpacing(){return this._characterSpacing}_SetLineHeight(e){this._lineHeight===e||(this._lineHeight=e,this._spriteFontText.SetLineHeight(this._lineHeight),this._runtime.UpdateRender())}_GetLineHeight(){return this._lineHeight}_SetHAlign(e){this._horizontalAlign===e||(this._horizontalAlign=e,this._UpdateSettings(),this._runtime.UpdateRender())}_GetHAlign(){return this._horizontalAlign}_SetVAlign(e){this._verticalAlign===e||(this._verticalAlign=e,this._UpdateSettings(),this._runtime.UpdateRender())}_GetVAlign(){return this._verticalAlign}_SetWrapByWord(e){e=!!e,this._wrapByWord===e||(this._wrapByWord=e,this._UpdateSettings(),this._runtime.UpdateRender())}_IsWrapByWord(){return this._wrapByWord}Tick(){const e=this._runtime.GetGameTime();if(e>=this._typewriterEndTime)this._CancelTypewriter(),this.Trigger(C3.Plugins.Spritefont2.Cnds.OnTypewriterTextFinished),this._runtime.UpdateRender();else{let t=C3.relerp(this._typewriterStartTime,this._typewriterEndTime,e,0,this._typewriterLength);t=Math.floor(t),t!==this._spriteFontText.GetDrawMaxCharacterCount()&&(this._spriteFontText.SetDrawMaxCharacterCount(t),this._runtime.UpdateRender())}}GetDebuggerProperties(){return[{title:'plugins.spritefont2.name',properties:[{name:'plugins.spritefont2.properties.text.name',value:this._text,onedit:e=>this._SetText(e)}]}]}GetScriptInterfaceClass(){return ISpriteFontInstance}};const r=new WeakMap,s=new Map([['left',0],['center',1],['right',2]]),e=new Map([['top',0],['center',1],['bottom',2]]),l=new Map([['word',!0],['character',!1]]);self.ISpriteFontInstance=class extends IWorldInstance{constructor(){super(),r.set(this,IInstance._GetInitInst().GetSdkInstance())}get text(){return r.get(this).GetText()}set text(e){const t=r.get(this);t._CancelTypewriter(),t._SetText(e)}typewriterText(e,t){const a=r.get(this);a._CancelTypewriter(),a._StartTypewriter(e,t)}typewriterFinish(){r.get(this)._FinishTypewriter()}set characterScale(e){r.get(this)._SetScale(e)}get characterScale(){return r.get(this)._GetScale()}set characterSpacing(e){r.get(this)._SetCharacterSpacing(e)}get characterSpacing(){return r.get(this)._GetCharacterSpacing()}set lineHeight(e){r.get(this)._SetLineHeight(e)}get lineHeight(){return r.get(this)._GetLineHeight()}set horizontalAlign(e){const t=s.get(e);if('undefined'==typeof t)throw new Error('invalid mode');r.get(this)._SetHAlign(t)}get horizontalAlign(){return t[r.get(this)._GetHAlign()]}set verticalAlign(t){const a=e.get(t);if('undefined'==typeof a)throw new Error('invalid mode');r.get(this)._SetVAlign(a)}get verticalAlign(){return a[r.get(this)._GetVAlign()]}set wordWrapMode(e){const t=l.get(e);if('undefined'==typeof t)throw new Error('invalid mode');r.get(this)._SetWrapByWord(t)}get wordWrapMode(){return r.get(this)._IsWrapByWord()?'word':'character'}}}'use strict',C3.Plugins.Spritefont2.Cnds={CompareText(e,t){return t?this._text===e:C3.equalsNoCase(this._text,e)},IsRunningTypewriterText(){return-1!==this._typewriterEndTime},OnTypewriterTextFinished(){return!0}},'use strict',C3.Plugins.Spritefont2.Acts={SetText(e){this._CancelTypewriter(),'number'==typeof e&&1e9>e&&(e=Math.round(1e10*e)/1e10),this._SetText(e.toString())},AppendText(e){this._CancelTypewriter(),'number'==typeof e&&1e9>e&&(e=Math.round(1e10*e)/1e10),e=e.toString(),e&&this._SetText(this._text+e)},TypewriterText(e,t){this._CancelTypewriter(),'number'==typeof e&&1e9>e&&(e=Math.round(1e10*e)/1e10),this._StartTypewriter(e.toString(),t)},TypewriterFinish(){this._FinishTypewriter()},SetScale(e){this._SetScale(e)},SetCharacterSpacing(e){this._SetCharacterSpacing(e)},SetLineHeight(e){this._SetLineHeight(e)},SetCharacterWidth(t,n){let r=!1;const s=this._sdkType.GetSpriteFont();for(const l of t)if(' '===l)s.SetSpaceWidth(n),r=!0;else{const e=s.GetCharacter(l);e&&(e.SetDisplayWidth(n),r=!0)}r&&s.SetCharacterWidthsChanged(),this._runtime.UpdateRender()},SetEffect(e){this.GetWorldInfo().SetBlendMode(e),this._runtime.UpdateRender()},SetHAlign(e){this._SetHAlign(e)},SetVAlign(e){this._SetVAlign(e)},SetWrapping(e){this._SetWrapByWord(0===e)}},'use strict',C3.Plugins.Spritefont2.Exps={CharacterWidth(e){const t=this._sdkType.GetSpriteFont().GetCharacter(e);return t?t.GetDisplayWidth():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(){return this._enableBBcode?C3.BBString.StripAnyTags(this._text):this._text},TextWidth(){const e=this.GetWorldInfo();return this._spriteFontText.SetSize(e.GetWidth(),e.GetHeight()),this._spriteFontText.GetTextWidth()},TextHeight(){const e=this.GetWorldInfo();return this._spriteFontText.SetSize(e.GetWidth(),e.GetHeight()),this._spriteFontText.GetTextHeight()}},'use strict';{const e={width:256,height:256,characterWidth:16,characterHeight:16,characterSet:''};self.SpriteFont=class{constructor(t){if(t=Object.assign({},e,t),0>=t.width||0>=t.height||0>=t.characterWidth||0>=t.characterHeight)throw new Error('invalid size');this._width=t.width,this._height=t.height,this._characterWidth=t.characterWidth,this._characterHeight=t.characterHeight,this._characterSet=t.characterSet,this._spacingData='',this._spacingParsed=null,this._hasAnyCustomWidths=!1,this._spaceWidth=-1,this._texRect=new C3.Rect(0,0,1,1),this._characterMap=new Map,this._mapChanged=!0,this._allTexts=new Set}Release(){this._texRect=null,this._ReleaseCharacters(),this._characterMap=null,this._allTexts&&this._allTexts.clear(),this._allTexts=null}_ReleaseCharacters(){for(let e of this._characterMap.values())e.Release();this._characterMap.clear()}_AddSpriteFontText(e){this._allTexts.add(e)}_RemoveSpriteFontText(e){this._allTexts.delete(e)}UpdateCharacterMap(){var t=Math.floor;if(this._mapChanged){this._ReleaseCharacters();let a=[...this._characterSet],n=t(this._width/this._characterWidth),r=t(this._height/this._characterHeight);for(let s=0,e=a.length;s=n*r);++s){let e=s%n,r=t(s/n),l=a[s];this._characterMap.set(l,C3.New(SpriteFontCharacter,this,l,e*this._characterWidth,r*this._characterHeight))}if(this._hasAnyCustomWidths=!1,this._spaceWidth=-1,Array.isArray(this._spacingParsed))for(let e of this._spacingParsed){if(!Array.isArray(e))continue;if(2!==e.length)continue;let t=e[0],n=e[1];if('number'==typeof t&&isFinite(t)&&'string'==typeof n&&t!==this._characterWidth)for(let e of n){let a=this._characterMap.get(e);a?(a.SetDisplayWidth(t),this._hasAnyCustomWidths=!0):' '===e&&(this._spaceWidth=t,this._hasAnyCustomWidths=!0)}}this._mapChanged=!1;for(let e of this._allTexts)e._SetWrapChanged()}}SetCharacterWidthsChanged(){this._hasAnyCustomWidths=!0;for(const e of this._allTexts)e._SetWrapChanged()}GetCharacter(e){return this.UpdateCharacterMap(),this._characterMap.get(e)||null}HasAnyCustomWidths(){return this._hasAnyCustomWidths}SetWidth(e){if(e=Math.floor(e),0>=e)throw new Error('invalid size');this._width===e||(this._width=e,this._mapChanged=!0)}GetWidth(){return this._width}SetHeight(e){if(e=Math.floor(e),0>=e)throw new Error('invalid size');this._height===e||(this._height=e,this._mapChanged=!0)}GetHeight(){return this._height}SetTexRect(e){if(!this._texRect.equals(e)){this._texRect.copy(e);for(const e of this._characterMap.values())e._UpdateTexRect()}}GetTexRect(){return this._texRect}SetCharacterWidth(e){if(e=Math.floor(e),0>=e)throw new Error('invalid size');this._characterWidth===e||(this._characterWidth=e,this._mapChanged=!0)}GetCharacterWidth(){return this._characterWidth}SetCharacterHeight(e){if(e=Math.floor(e),0>=e)throw new Error('invalid size');this._characterHeight===e||(this._characterHeight=e,this._mapChanged=!0)}GetCharacterHeight(){return this._characterHeight}SetCharacterSet(e){this._characterSet===e||(this._characterSet=e,this._mapChanged=!0)}GetCharacterSet(){return this._characterSet}SetSpacingData(e){if(this._spacingData!==e&&(this._spacingData=e,this._mapChanged=!0,this._spacingParsed=null,this._spacingData.length))try{this._spacingParsed=JSON.parse(this._spacingData)}catch(e){this._spacingParsed=null}}GetSpacingData(){return this._spacingData}SetSpaceWidth(e){0>e&&(e=-1),this._spaceWidth===e||(this._spaceWidth=e,0<=this._spaceWidth&&(this._hasAnyCustomWidths=!0))}GetSpaceWidth(){return 0>this._spaceWidth?this._characterWidth:this._spaceWidth}}}'use strict',self.SpriteFontCharacter=class{constructor(t,a,n,r){let s=t.GetCharacterWidth(),e=t.GetCharacterHeight();this._spriteFont=t,this._char=a,this._pxRect=new C3.Rect(n,r,n+s,r+e),this._texRect=new C3.Rect,this._displayWidth=-1,this._UpdateTexRect()}Release(){this._spriteFont=null,this._pxRect=null,this._texRect=null}_UpdateTexRect(){let e=this._spriteFont.GetWidth(),t=this._spriteFont.GetHeight();this._texRect.copy(this._pxRect),this._texRect.divide(e,t),this._texRect.lerpInto(this._spriteFont.GetTexRect())}GetSpriteFont(){return this._spriteFont}GetChar(){return this._char}GetTexRect(){return this._texRect}SetDisplayWidth(e){this._displayWidth=e}GetDisplayWidth(){return 0>this._displayWidth?this._spriteFont.GetCharacterWidth():this._displayWidth}},'use strict';{const _=new C3.Rect,a=new C3.Quad,S=new C3.Color,t=new Set(['left','center','right']),n=new Set(['top','center','bottom']),e=new Set(['word','character']);self.SpriteFontText=class{constructor(e){this._spriteFont=e,this._cssWidth=0,this._cssHeight=0,this._text='',this._isBBcodeEnabled=!1,this._bbString=null,this._wrappedText=C3.New(C3.WordWrap),this._wrapMode='word',this._wrapChanged=!1,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=(e,t)=>this._MeasureText(e,t),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(t,a){const n=this._GetStyleTag(a,'scale'),r=n?parseFloat(n.param):this._scale,s=this._GetStyleTag(a,'scalex'),_=(s?parseFloat(s.param):1)*r,e=this._GetStyleTag(a,'scaley'),d=(e?parseFloat(e.param):1)*r,u=this._spriteFont.GetCharacterHeight()*d+this._lineHeight,c=this.GetSpriteFont(),g=c.GetCharacterWidth()*_,p=this.GetSpacing();if(c.HasAnyCustomWidths()){let n=0,r=0;for(const s of t){let t=g;const a=c.GetCharacter(s);a?t=a.GetDisplayWidth()*_:' '===s&&(t=c.GetSpaceWidth()*_),r+=t,++n}return{width:r+n*p,height:u}}else{const e=[...t].length,a=Math.max(e,0);return{width:g*e+a*p,height:u}}}_SetWrapChanged(){this._wrapChanged=!0,this._wrappedText.Clear()}SetSize(e,t){0>=e||0>=t||this._cssWidth===e&&this._cssHeight===t||(this._cssWidth!==e&&this._SetWrapChanged(),this._cssWidth=e,this._cssHeight=t)}SetDrawMaxCharacterCount(e){this._drawMaxCharCount=Math.floor(e)}GetDrawMaxCharacterCount(){return this._drawMaxCharCount}_GetStyleTag(e,t){for(let a=e.length-1;0<=a;--a){const n=e[a];if(n.tag===t)return n}return null}_HasStyleTag(e,t){return!!this._GetStyleTag(e,t)}_MaybeWrapText(){if(this._wrapChanged){this._isBBcodeEnabled&&(!this._bbString||this._bbString.toString()!==this._text)&&(this._bbString=new C3.BBString(this._text,{noEscape:!0}));const e=-this.GetSpacing();this._wrappedText.WordWrap(this._isBBcodeEnabled?this._bbString.toFragmentList():this._text,this._measureTextCallback,this._cssWidth,this._wrapMode,e),this._wrapChanged=!1}}Draw(t,a,n,r){var s=Math.floor;this._MaybeWrapText(),this._drawCharCount=0;let l=0;const _=this._lineHeight,u=C3.cloneArray(this._wrappedText.GetLines()),c=Math.sin(r),g=Math.cos(r),e=u.reduce((e,t)=>e+t.height,0)-_;'center'===this._verticalAlign?l=Math.max(s(this._cssHeight/2-e/2),0):'bottom'===this._verticalAlign&&(l=s(this._cssHeight-e));for(let s=0,e=u.length;sthis._cssHeight-(r-_))break;0<=l&&this._DrawLine(t,e,a,n,l,c,g),l+=r}}_DrawLine(t,a,n,r,s,e,l){var _=Math.floor,d=Math.max;const u=a.height;let c=0;'center'===this._horizontalAlign?c=d(_((this._cssWidth-a.width)/2),0):'right'===this._horizontalAlign&&(c=d(_(this._cssWidth-a.width),0));for(const _ of a.fragments)this._DrawFragment(t,_,n,r,c,s,e,l,u),c+=_.width}_DrawFragment(G,t,d,f,g,I,T,b,c){let e=t.text,l=t.width;const P=t.styles;if(-1!==this._drawMaxCharCount){if(this._drawCharCount>=this._drawMaxCharCount)return;this._drawCharCount+e.length>this._drawMaxCharCount&&(e=e.substr(0,this._drawMaxCharCount-this._drawCharCount),l=this._MeasureText(e,P).width),this._drawCharCount+=e.length}const R=this._GetStyleTag(P,'background');if(!(C3.IsStringAllWhitespace(e)&&!R||this._HasStyleTag(P,'hide'))){const n=this._GetStyleTag(P,'scale'),p=n?parseFloat(n.param):this._scale,m=this._GetStyleTag(P,'scalex'),r=(m?parseFloat(m.param):1)*p,s=this._GetStyleTag(P,'scaley'),t=(s?parseFloat(s.param):1)*p,u=this._spriteFont.GetCharacterHeight()*t,h=this._lineHeight;I+=c-h-u;const v=this._GetStyleTag(P,'offsetx');g+=v?parseFloat(v.param):0;const x=this._GetStyleTag(P,'offsety');I+=x?parseFloat(x.param):0,R&&(G.SetColorFillMode(),S.parseString(R.param),S.setA(1),G.SetColor(S),_.set(g,I,g+l,I+u),_.getRight()>this._cssWidth&&_.setRight(this._cssWidth),a.setFromRotatedRectPrecalc(_,T,b),a.offset(d,f),G.Quad(a),G.SetTextureFillMode());const y=this._GetStyleTag(P,'color');y?(S.parseString(y.param),S.setA(this._color.getA())):S.copy(this._color);const D=this._GetStyleTag(P,'opacity');D&&S.setA(S.getA()*parseFloat(D.param)/100),S.premultiply(),G.SetColor(S);const A=this._spriteFont.GetCharacterWidth()*r,E=Math.abs(this.GetSpacing());for(const t of e){const n=this._spriteFont.GetCharacter(t);if(n){const e=n.GetDisplayWidth()*r;if(g+e>this._cssWidth+E+1e-5)return;_.set(g,I,g+A,I+u),a.setFromRotatedRectPrecalc(_,T,b),a.offset(d,f),G.Quad3(a,n.GetTexRect()),g+=e+this._spacing}else g+=this._spriteFont.GetSpaceWidth()*r+this._spacing}}}GetSpriteFont(){return this._spriteFont}SetBBCodeEnabled(e){e=!!e,this._isBBcodeEnabled===e||(this._isBBcodeEnabled=e,this._SetWrapChanged())}IsBBCodeEnabled(){return this._isBBcodeEnabled}SetText(e){this._text===e||(this._text=e,this._SetWrapChanged())}SetWordWrapMode(t){if(!e.has(t))throw new Error('invalid word wrap mode');this._wrapMode===t||(this._wrapMode=t,this._SetWrapChanged())}SetHorizontalAlign(e){if(!t.has(e))throw new Error('invalid alignment');this._horizontalAlign=e}SetVerticalAlign(e){if(!n.has(e))throw new Error('invalid alignment');this._verticalAlign=e}SetScale(e){this._scale===e||(this._scale=e,this._SetWrapChanged())}GetScale(){return this._scale}SetSpacing(e){this._spacing===e||(this._spacing=e,this._SetWrapChanged())}GetSpacing(){return this._spacing}SetLineHeight(e){this._lineHeight=e,this._SetWrapChanged()}GetLineHeight(){return this._lineHeight}SetOpacity(e){e=C3.clamp(e,0,1),this._color.a=e}SetColor(e){this._color.equals(e)||this._color.copy(e)}GetColor(){return this._color}GetTextWidth(){return this._MaybeWrapText(),this._wrappedText.GetMaxLineWidth()}GetTextHeight(){this._MaybeWrapText();const e=this._spriteFont.GetCharacterHeight()*this._scale,t=this._lineHeight;return this._wrappedText.GetLineCount()*(e+t)-t}}}'use strict',C3.Plugins.Audio=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict';{function e(){if(self.C3Audio_DOMInterface)return self.C3Audio_DOMInterface;throw new Error('audio scripting API cannot be used here - make sure the project is using DOM mode, not worker mode')}C3.Plugins.Audio.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return IAudioObjectType}},self.IAudioObjectType=class extends IObjectClass{constructor(e){super(e)}get audioContext(){return e().GetAudioContext()}get destinationNode(){return e().GetDestinationNode()}}}{const t=['interactive','balanced','playback'];C3.Plugins.Audio.Instance=class extends C3.SDKInstanceBase{constructor(a,n){super(a,'audio'),this._nextPlayTime=0,this._triggerTag='',this._timeScaleMode=0,this._saveLoadMode=0,this._playInBackground=!1,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=!1,this._sampleRate=0,this._effectCount=new Map,this._preloadTotal=0,this._preloadCount=0;let r='interactive';n&&(this._timeScaleMode=n[0],this._saveLoadMode=n[1],this._playInBackground=n[2],r=t[n[3]],this._panningModel=n[4],this._distanceModel=n[5],this._listenerZ=-n[6],this._referenceDistance=n[7],this._maxDistance=n[8],this._rolloffFactor=n[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 s=this.GetRuntime().Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(s,'instancedestroy',e=>this._OnInstanceDestroyed(e.instance)),C3.Disposable.From(s,'afterload',()=>this._OnAfterLoad()),C3.Disposable.From(s,'suspend',()=>this._OnSuspend()),C3.Disposable.From(s,'resume',()=>this._OnResume())),this._runtime.AddLoadPromise(this.PostToDOMAsync('create-audio-context',{preloadList:this._runtime.GetAssetManager().GetAudioToPreload().map(e=>({originalUrl:e.originalUrl,url:e.url,type:e.type,fileSize:e.fileSize})),isiOSCordova:this._runtime.IsiOSCordova(),timeScaleMode:this._timeScaleMode,latencyHint:r,panningModel:this._panningModel,distanceModel:this._distanceModel,refDistance:this._referenceDistance,maxDistance:this._maxDistance,rolloffFactor:this._rolloffFactor,listenerPos:[this._listenerX,this._listenerY,this._listenerZ]}).then(e=>{this._sampleRate=e.sampleRate})),this._StartTicking()}Release(){this._listenerInst=null,super.Release()}_OnInstanceDestroyed(e){this._listenerInst===e&&(this._listenerInst=null)}DbToLinearNoCap(e){return Math.pow(10,e/20)}DbToLinear(e){const t=this.DbToLinearNoCap(e);return isFinite(t)?Math.max(Math.min(t,1),0):0}LinearToDbNoCap(e){return 20*(Math.log(e)/2.302585092994046)}LinearToDb(e){return this.LinearToDbNoCap(Math.max(Math.min(e,1),0))}_OnSuspend(){this._playInBackground||this.PostToDOM('set-suspended',{isSuspended:!0})}_OnResume(){this._playInBackground||this.PostToDOM('set-suspended',{isSuspended:!1})}_OnUpdateState(e){const t=e.tickCount,a=this._lastAIState.filter(e=>e.hasOwnProperty('placeholder')&&(e.placeholder>t||-1===e.placeholder));this._lastAIState=e.audioInstances,this._lastAnalysersData=e.analysers,0C3.equalsNoCase(e,t.tag)&&t.isPlaying)}_MaybeMarkAsPlaying(t,a,n,r){if(this._IsTagPlaying(t))return null;const s={tag:t,duration:0,volume:r,isPlaying:!0,playbackTime:0,playbackRate:1,uid:-1,bufferOriginalUrl:'',bufferUrl:'',bufferType:'',isMusic:a,isLooping:n,isMuted:!1,resumePosition:0,pan:null,placeholder:-1};return this._lastAIState.push(s),s}async _OnTrigger(e){const t=e.type;this._triggerTag=e.tag;const n=e.aiid;if('ended'===t){for(const e of this._lastAIState)if(e.aiid===n){e.isPlaying=!1;break}await this.TriggerAsync(C3.Plugins.Audio.Cnds.OnEnded)}else'fade-ended'===t&&(await this.TriggerAsync(C3.Plugins.Audio.Cnds.OnFadeEnded))}Tick(){const e={timeScale:this._runtime.GetTimeScale(),gameTime:this._runtime.GetGameTime(),instPans:this.GetInstancePans(),tickCount:this._runtime.GetTickCountNoSave()};if(this._listenerInst){const t=this._listenerInst.GetWorldInfo();this._listenerX=t.GetX(),this._listenerY=t.GetY(),e.listenerPos=[this._listenerX,this._listenerY,this._listenerZ]}this.PostToDOM('tick',e)}rotatePtAround(t,n,r,s,a){if(0===r)return[t,n];const e=Math.sin(r),l=Math.cos(r);t-=s,n-=a;const _=t*e,d=n*e,u=t*l,g=n*l;return t=u-d,n=g+_,t+=s,n+=a,[t,n]}GetInstancePans(){return this._lastAIState.filter(e=>-1!==e.uid).map(e=>this._runtime.GetInstanceByUID(e.uid)).filter(e=>e).map(t=>{const a=t.GetWorldInfo(),n=a.GetLayer().GetAngle(),[r,s]=this.rotatePtAround(a.GetX(),a.GetY(),-n,this._listenerX,this._listenerY);return{uid:t.GetUID(),x:r,y:s,angle:a.GetAngle()-n}})}GetAnalyserData(e,t){for(const a of this._lastAnalysersData)if(a.index===t&&C3.equalsNoCase(a.tag,e))return a;return null}_IncrementEffectCount(e){this._effectCount.set(e,(this._effectCount.get(e)||0)+1)}_ShouldSave(e){return!e.hasOwnProperty('placeholder')&&3!==this._saveLoadMode&&!(e.isMusic&&1===this._saveLoadMode)&&!!(e.isMusic||2!==this._saveLoadMode)}SaveToJson(){return{isSilent:this._isSilent,masterVolume:this._masterVolume,listenerZ:this._listenerZ,listenerUid:this._listenerInst?this._listenerInst.GetUID():-1,playing:this._lastAIState.filter(e=>this._ShouldSave(e)),effects:this._lastFxState,analysers:this._lastAnalysersData}}LoadFromJson(e){this._isSilent=e.isSilent,this._masterVolume=e.masterVolume,this._listenerZ=e.listenerZ,this._listenerInst=null,this._loadListenerUid=e.listenerUid,this._lastAIState=e.playing,this._lastFxState=e.effects,this._lastAnalysersData=e.analysers}_OnAfterLoad(){if(-1!==this._loadListenerUid&&(this._listenerInst=this._runtime.GetInstanceByUID(this._loadListenerUid),this._loadListenerUid=-1,this._listenerInst)){const e=this._listenerInst.GetWorldInfo();this._listenerX=e.GetX(),this._listenerY=e.GetY()}for(const e of this._lastAIState){const t=this._runtime.GetAssetManager().GetProjectAudioFileUrl(e.bufferOriginalUrl);t?(e.bufferUrl=t.url,e.bufferType=t.type):e.bufferUrl=null}for(const e of Object.values(this._lastFxState))for(const t of e)if(t.hasOwnProperty('bufferOriginalUrl')){const e=this._runtime.GetAssetManager().GetProjectAudioFileUrl(t.bufferOriginalUrl);e&&(t.bufferUrl=e.url,t.bufferType=e.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(e=>null!==e.bufferUrl),effects:this._lastFxState})}GetDebuggerProperties(){var e=Math.round;const t=[];for(const[e,a]of Object.entries(this._lastFxState))t.push({name:'$'+e,value:a.map(e=>e.type).join(', ')});return[{title:'plugins.audio.debugger.tag-effects',properties:t},{title:'plugins.audio.debugger.currently-playing',properties:[{name:'plugins.audio.debugger.currently-playing-count',value:this._lastAIState.length},...this._lastAIState.map((t,a)=>({name:'$#'+a,value:`${t.bufferOriginalUrl} ("${t.tag}") ${e(10*t.playbackTime)/10} / ${e(10*t.duration)/10}`}))]}]}}}'use strict',C3.Plugins.Audio.Cnds={OnEnded(e){return C3.equalsNoCase(this._triggerTag,e)},OnFadeEnded(e){return C3.equalsNoCase(this._triggerTag,e)},PreloadsComplete(){return this._preloadCount===this._preloadTotal},AdvancedAudioSupported(){return!0},IsSilent(){return this._isSilent},IsAnyPlaying(){for(const e of this._lastAIState)if(e.isPlaying)return!0;return!1},IsTagPlaying(e){return this._IsTagPlaying(e)}},'use strict';{const t=['lowpass','highpass','bandpass','lowshelf','highshelf','peaking','notch','allpass'];C3.Plugins.Audio.Acts={async Play(t,a,n,r){if(!this._isSilent){const s=t[1],e=this._runtime.GetAssetManager().GetProjectAudioFileUrl(t[0]);if(e){const l=this._nextPlayTime;this._nextPlayTime=0;const _=this._MaybeMarkAsPlaying(r.toLowerCase(),s,0!==a,this.DbToLinear(n));try{await this.PostToDOMAsync('play',{originalUrl:t[0],url:e.url,type:e.type,isMusic:s,tag:r.toLowerCase(),isLooping:0!==a,vol:this.DbToLinear(n),pos:0,off:l,trueClock:!!self.C3_GetAudioContextCurrentTime})}finally{_&&(_.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtPosition(t,a,r,n,s,e,_,d,u,c){if(!this._isSilent){const g=t[1],p=this._runtime.GetAssetManager().GetProjectAudioFileUrl(t[0]);if(p){const l=this._nextPlayTime;this._nextPlayTime=0;const m=this._MaybeMarkAsPlaying(c.toLowerCase(),g,0!==a,this.DbToLinear(r));try{await this.PostToDOMAsync('play',{originalUrl:t[0],url:p.url,type:p.type,isMusic:g,tag:c.toLowerCase(),isLooping:0!==a,vol:this.DbToLinear(r),pos:0,off:l,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:n,y:s,angle:C3.toRadians(e),innerAngle:C3.toRadians(_),outerAngle:C3.toRadians(d),outerGain:this.DbToLinear(u)}})}finally{m&&(m.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtObject(t,a,r,n,s,e,_,u){if(!this._isSilent&&n){const c=n.GetFirstPicked();if(c&&c.GetWorldInfo()){const g=c.GetWorldInfo(),d=g.GetLayer().GetAngle(),[p,h]=this.rotatePtAround(g.GetX(),g.GetY(),-d,this._listenerX,this._listenerY),l=t[1],m=this._runtime.GetAssetManager().GetProjectAudioFileUrl(t[0]);if(m){const n=this._nextPlayTime;this._nextPlayTime=0;const f=this._MaybeMarkAsPlaying(u.toLowerCase(),l,0!==a,this.DbToLinear(r));try{await this.PostToDOMAsync('play',{originalUrl:t[0],url:m.url,type:m.type,isMusic:l,tag:u.toLowerCase(),isLooping:0!==a,vol:this.DbToLinear(r),pos:0,off:n,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:p,y:h,angle:g.GetAngle()-d,innerAngle:C3.toRadians(s),outerAngle:C3.toRadians(e),outerGain:this.DbToLinear(_),uid:c.GetUID()}})}finally{f&&(f.placeholder=this._runtime.GetTickCountNoSave())}}}}},async PlayByName(t,n,r,s,l){if(!this._isSilent){const e=1===t,_=this._runtime.GetAssetManager().GetProjectAudioFileUrl(n);if(_){const t=this._nextPlayTime;this._nextPlayTime=0;const a=this._MaybeMarkAsPlaying(l.toLowerCase(),e,0!==r,this.DbToLinear(s));try{await this.PostToDOMAsync('play',{originalUrl:n,url:_.url,type:_.type,isMusic:e,tag:l.toLowerCase(),isLooping:0!==r,vol:this.DbToLinear(s),pos:0,off:t,trueClock:!!self.C3_GetAudioContextCurrentTime})}finally{a&&(a.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtPositionByName(t,n,r,s,_,e,d,u,c,g,p){if(!this._isSilent){const h=1===t,l=this._runtime.GetAssetManager().GetProjectAudioFileUrl(n);if(l){const t=this._nextPlayTime;this._nextPlayTime=0;const a=this._MaybeMarkAsPlaying(p.toLowerCase(),h,0!==r,this.DbToLinear(s));try{await this.PostToDOMAsync('play',{originalUrl:n,url:l.url,type:l.type,isMusic:h,tag:p.toLowerCase(),isLooping:0!==r,vol:this.DbToLinear(s),pos:0,off:t,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:_,y:e,angle:C3.toRadians(d),innerAngle:C3.toRadians(u),outerAngle:C3.toRadians(c),outerGain:this.DbToLinear(g)}})}finally{a&&(a.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtObjectByName(t,r,s,_,a,d,u,c,g){if(!this._isSilent&&!this._isSilent&&a){const p=a.GetFirstPicked();if(p&&p.GetWorldInfo()){const h=p.GetWorldInfo(),e=h.GetLayer().GetAngle(),[f,l]=this.rotatePtAround(h.GetX(),h.GetY(),-e,this._listenerX,this._listenerY),m=1===t,n=this._runtime.GetAssetManager().GetProjectAudioFileUrl(r);if(n){const t=this._nextPlayTime;this._nextPlayTime=0;const a=this._MaybeMarkAsPlaying(g.toLowerCase(),m,0!==s,this.DbToLinear(_));try{await this.PostToDOMAsync('play',{originalUrl:r,url:n.url,type:n.type,isMusic:m,tag:g.toLowerCase(),isLooping:0!==s,vol:this.DbToLinear(_),pos:0,off:t,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:f,y:l,angle:h.GetAngle()-e,innerAngle:C3.toRadians(d),outerAngle:C3.toRadians(u),outerGain:this.DbToLinear(c),uid:p.GetUID()}})}finally{a&&(a.placeholder=this._runtime.GetTickCountNoSave())}}}}},SetLooping(e,t){this.PostToDOM('set-looping',{tag:e.toLowerCase(),isLooping:0===t})},SetMuted(e,t){this.PostToDOM('set-muted',{tag:e.toLowerCase(),isMuted:0===t})},SetVolume(e,t){this.PostToDOM('set-volume',{tag:e.toLowerCase(),vol:this.DbToLinear(t)})},FadeVolume(e,t,a,n){this.PostToDOM('fade-volume',{tag:e.toLowerCase(),vol:this.DbToLinear(t),duration:a,stopOnEnd:0===n})},async Preload(e){const t=e[1],a=this._runtime.GetAssetManager().GetProjectAudioFileUrl(e[0]);a&&(this._preloadTotal++,await this.PostToDOMAsync('preload',{originalUrl:e[0],url:a.url,type:a.type,isMusic:t}),this._preloadCount++)},async PreloadByName(e,t){const a=this._runtime.GetAssetManager().GetProjectAudioFileUrl(t);a&&(this._preloadTotal++,await this.PostToDOMAsync('preload',{originalUrl:t,url:a.url,type:a.type,isMusic:1===e}),this._preloadCount++)},SetPlaybackRate(e,t){this.PostToDOM('set-playback-rate',{tag:e.toLowerCase(),rate:Math.max(t,0)})},Stop(e){this.PostToDOM('stop',{tag:e.toLowerCase()})},StopAll(){this.PostToDOM('stop-all')},SetPaused(e,t){this.PostToDOM('set-paused',{tag:e.toLowerCase(),paused:0===t})},Seek(e,t){this.PostToDOM('seek',{tag:e.toLowerCase(),pos:t})},SetSilent(e){2===e&&(e=this._isSilent?1:0),e=0===e,this._isSilent===e||(this._isSilent=e,this.PostToDOM('set-silent',{isSilent:e}))},SetMasterVolume(e){const t=this.DbToLinear(e);this._masterVolume===t||(this._masterVolume=t,this.PostToDOM('set-master-volume',{vol:t}))},AddFilterEffect(a,n,r,s,e,l,_){a=a.toLowerCase();const d=t[n];this._IncrementEffectCount(a),this.PostToDOM('add-effect',{type:'filter',tag:a,params:[d,r,s,e,l,C3.clamp(_/100,0,1)]})},AddDelayEffect(e,t,n,r){e=e.toLowerCase(),this._IncrementEffectCount(e),this.PostToDOM('add-effect',{type:'delay',tag:e,params:[t,this.DbToLinear(n),C3.clamp(r/100,0,1)]})},AddFlangerEffect(t,n,r,s,l,e){t=t.toLowerCase(),this._IncrementEffectCount(t),this.PostToDOM('add-effect',{type:'flanger',tag:t,params:[n/1e3,r/1e3,s,l/100,C3.clamp(e/100,0,1)]})},AddPhaserEffect(t,n,r,s,l,e,_){t=t.toLowerCase(),this._IncrementEffectCount(t),this.PostToDOM('add-effect',{type:'phaser',tag:t,params:[n,r,s,l,e,C3.clamp(_/100,0,1)]})},AddConvolutionEffect(t,n,r,s){t=t.toLowerCase();const l=this._runtime.GetAssetManager().GetProjectAudioFileUrl(n[0]);l&&(this._IncrementEffectCount(t),this.PostToDOM('add-effect',{type:'convolution',tag:t,bufferOriginalUrl:n[0],bufferUrl:l.url,bufferType:l.type,params:[0===r,C3.clamp(s/100,0,1)]}))},AddGainEffect(e,t){e=e.toLowerCase(),this._IncrementEffectCount(e),this.PostToDOM('add-effect',{type:'gain',tag:e,params:[this.DbToLinear(t)]})},AddMuteEffect(e){e=e.toLowerCase(),this._IncrementEffectCount(e),this.PostToDOM('add-effect',{type:'gain',tag:e,params:[0]})},AddTremoloEffect(e,t,n){e=e.toLowerCase(),this._IncrementEffectCount(e),this.PostToDOM('add-effect',{type:'tremolo',tag:e,params:[t,C3.clamp(n/100,0,1)]})},AddRingModEffect(e,t,n){e=e.toLowerCase(),this._IncrementEffectCount(e),this.PostToDOM('add-effect',{type:'ringmod',tag:e,params:[t,C3.clamp(n/100,0,1)]})},AddDistortionEffect(t,n,r,s,l,e){t=t.toLowerCase(),this._IncrementEffectCount(t),this.PostToDOM('add-effect',{type:'distortion',tag:t,params:[this.DbToLinearNoCap(n),this.DbToLinearNoCap(r),s,this.DbToLinearNoCap(l),C3.clamp(e/100,0,1)]})},AddCompressorEffect(t,n,r,s,l,e){t=t.toLowerCase(),this._IncrementEffectCount(t),this.PostToDOM('add-effect',{type:'compressor',tag:t,params:[n,r,s,l/1e3,e/1e3]})},AddAnalyserEffect(e,t,n){e=e.toLowerCase(),this._IncrementEffectCount(e),this.PostToDOM('add-effect',{type:'analyser',tag:e,params:[t,n]})},RemoveEffects(e){e=e.toLowerCase(),this._effectCount.set(e,0),this.PostToDOM('remove-effects',{tag:e}),this._lastFxState={}},SetEffectParameter(t,a,n,r,s,e){this.PostToDOM('set-effect-param',{tag:t.toLowerCase(),index:Math.floor(a),param:n,value:r,ramp:s,time:e})},SetListenerObject(e){if(e){const t=e.GetFirstPicked();t&&t.GetWorldInfo()&&(this._listenerInst=t)}},SetListenerZ(e){this._listenerZ=e},ScheduleNextPlay(e){this._nextPlayTime=Math.max(e,0)},UnloadAudio(e){const t=e[1],a=this._runtime.GetAssetManager().GetProjectAudioFileUrl(e[0]);a&&this.PostToDOM('unload',{url:a.url,type:a.type,isMusic:t})},UnloadAudioByName(e,t){const a=this._runtime.GetAssetManager().GetProjectAudioFileUrl(t);a&&this.PostToDOM('unload',{url:a.url,type:a.type,isMusic:1===e})},UnloadAll(){this.PostToDOM('unload-all')}}}'use strict',C3.Plugins.Audio.Exps={Duration(e){const t=this._GetFirstAudioStateByTag(e);return t?t.duration:0},PlaybackTime(e){const t=this._GetFirstAudioStateByTag(e);return t?t.playbackTime:0},PlaybackRate(e){const t=this._GetFirstAudioStateByTag(e);return t?t.playbackRate:0},Volume(e){const t=this._GetFirstAudioStateByTag(e);return t?this.LinearToDb(t.volume):0},MasterVolume(){return this.LinearToDb(this._masterVolume)},EffectCount(e){return this._effectCount.get(e.toLowerCase())||0},AnalyserFreqBinCount(e,t){const a=this.GetAnalyserData(e,Math.floor(t));return a?a.binCount:0},AnalyserFreqBinAt(t,a,n){var r=Math.floor;const s=this.GetAnalyserData(t,r(a));return s?(n=r(n),0>n||n>=s.binCount?0:s.freqBins[n]):0},AnalyserPeakLevel(e,t){const a=this.GetAnalyserData(e,Math.floor(t));return a?a.peak:0},AnalyserRMSLevel(e,t){const a=this.GetAnalyserData(e,Math.floor(t));return a?a.rms:0},SampleRate(){return this._sampleRate},CurrentTime(){return self.C3_GetAudioContextCurrentTime?self.C3_GetAudioContextCurrentTime():performance.now()/1e3}},'use strict',C3.Plugins.LocalStorage=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Plugins.LocalStorage.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict',C3.Plugins.LocalStorage.Instance=class extends C3.SDKInstanceBase{constructor(e){super(e),this._currentKey='',this._lastValue='',this._keyNamesList=[],this._errorMessage='',this._pendingGets=0,this._pendingSets=0,this._storage=this._runtime._GetProjectStorage(),this._debugCache=new Map,this._isLoadingDebugCache=!1}Release(){super.Release()}async _TriggerStorageError(e){this._errorMessage=this._GetErrorString(e),await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnError)}_GetErrorString(e){return e?'string'==typeof e?e:'string'==typeof e.message?e.message:'string'==typeof e.name?e.name:'string'==typeof e.data?e.data:'unknown error':'unknown error'}GetDebuggerProperties(){return this._isLoadingDebugCache||this._DebugCacheStorage(),[{title:'plugins.localstorage.name',properties:[...this._debugCache.entries()].map(e=>({name:'$'+e[0],value:e[1],onedit:t=>this._storage.setItem(e[0],t)}))}]}async _DebugCacheStorage(){this._isLoadingDebugCache=!0;try{const e=await this._storage.keys();e.sort((e,t)=>{const a=e.toLowerCase(),n=t.toLowerCase();return athis._storage.getItem(e)));this._debugCache.clear();for(let a=0,n=e.length;a{this._currentKey=e,this._lastValue=a,await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnAnyItemSet),await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnItemSet)})}catch(e){await this._TriggerStorageError(e)}finally{this._pendingSets--,0===this._pendingSets&&(await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnAllSetsComplete))}},async SetBinaryItem(e,t){if(t){const a=t.GetFirstPicked(this._inst);if(a){const t=a.GetSdkInstance();if(t){const a=t.GetArrayBufferReadOnly();this._pendingSets++;try{await this._storage.setItem(e,a),await this.ScheduleTriggers(async()=>{this._currentKey=e,this._lastValue='',await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnAnyItemSet),await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnItemSet)})}catch(e){await this._TriggerStorageError(e)}finally{this._pendingSets--,0===this._pendingSets&&(await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnAllSetsComplete))}}}}},async GetItem(t){this._pendingGets++;try{const a=await this._storage.getItem(t);await this.ScheduleTriggers(async()=>{this._currentKey=t,this._lastValue=e(a)?a:'',await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnAnyItemGet),await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnItemGet)})}catch(e){await this._TriggerStorageError(e)}finally{this._pendingGets--,0===this._pendingGets&&(await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnAllGetsComplete))}},async GetBinaryItem(e,t){if(!t)return;const a=t.GetFirstPicked(this._inst);if(!a)return;const n=a.GetSdkInstance();this._pendingGets++;try{let t=await this._storage.getItem(e);t=t instanceof ArrayBuffer?t:new ArrayBuffer(0),await this.ScheduleTriggers(async()=>{this._lastValue='',this._currentKey=e,n.SetArrayBufferTransfer(t),await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnAnyItemGet),await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnItemGet)})}catch(e){await this._TriggerStorageError(e)}finally{this._pendingGets--,0===this._pendingGets&&(await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnAllGetsComplete))}},async CheckItemExists(t){try{const a=await this._storage.getItem(t);await this.ScheduleTriggers(async()=>{this._currentKey=t,'undefined'==typeof a||null===a?(this._lastValue='',await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnItemMissing)):(this._lastValue=e(a)?a:'',await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnItemExists))})}catch(e){await this._TriggerStorageError(e)}},async RemoveItem(e){try{await this._storage.removeItem(e),await this.ScheduleTriggers(async()=>{this._currentKey=e,this._lastValue='',await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnAnyItemRemoved),await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnItemRemoved)})}catch(e){await this._TriggerStorageError(e)}},async ClearStorage(){try{await this._storage.clear(),await this.ScheduleTriggers(async()=>{this._currentKey='',this._lastValue='',C3.clearArray(this._keyNamesList),await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnCleared)})}catch(e){await this._TriggerStorageError(e)}},async GetAllKeyNames(){try{const e=await this._storage.keys();await this.ScheduleTriggers(async()=>{this._keyNamesList=e,await this.TriggerAsync(C3.Plugins.LocalStorage.Cnds.OnAllKeyNamesLoaded)})}catch(e){await this._TriggerStorageError(e)}}}}'use strict',C3.Plugins.LocalStorage.Exps={ItemValue(){return this._lastValue},Key(){return this._currentKey},KeyCount(){return this._keyNamesList.length},KeyAt(e){return e=Math.floor(e),0>e||e>=this._keyNamesList.length?'':this._keyNamesList[e]},ErrorMessage(){return this._errorMessage}},'use strict',C3.Plugins.Keyboard=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict';{function e(){return t.GetSingleGlobalInstance().GetSdkInstance()}C3.Plugins.Keyboard.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return IKeyboardObjectType}};let t=null;self.IKeyboardObjectType=class extends IObjectClass{constructor(e){super(e),t=e,e.GetRuntime()._GetCommonScriptInterfaces().keyboard=this}isKeyDown(t){const a=e();if('string'==typeof t)return a.IsKeyDown(t);if('number'==typeof t)return a.IsKeyCodeDown(t);throw new TypeError('expected string or number')}}}'use strict',C3.Plugins.Keyboard.Instance=class extends C3.SDKInstanceBase{constructor(e){super(e),this._keysDownByString=new Set,this._keysDownByWhich=new Set,this._triggerWhich=0,this._triggerString='',this._triggerTypedKey='';const t=this.GetRuntime().Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(t,'keydown',e=>this._OnKeyDown(e.data)),C3.Disposable.From(t,'keyup',e=>this._OnKeyUp(e.data)),C3.Disposable.From(t,'window-blur',()=>this._OnWindowBlur()))}Release(){super.Release()}_OnKeyDown(e){const t=e.which,a=e.code||t.toString(),n=e.key;this._keysDownByString.has(a)||(this._keysDownByString.add(a),this._keysDownByWhich.add(t),this._triggerString=a,this._triggerWhich=t,this._triggerTypedKey=n,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 t=e.which,a=e.code||t.toString(),n=e.key;this._keysDownByString.delete(a),this._keysDownByWhich.delete(t),this._triggerString=a,this._triggerWhich=t,this._triggerTypedKey=n,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 e of this._keysDownByWhich)this._keysDownByWhich.delete(e),this._triggerWhich=e,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(e){return this._keysDownByString.has(e)}IsKeyCodeDown(e){return this._keysDownByWhich.has(e)}SaveToJson(){return{tk:this._triggerWhich,tkk:this._triggerTypedKey}}LoadFromJson(e){this._triggerWhich=e.tk,e.hasOwnProperty('tkk')&&(this._triggerTypedKey=e.tkk)}GetDebuggerProperties(){return[{title:'plugins.keyboard.name',properties:[{name:'plugins.keyboard.debugger.last-key-code',value:this._triggerWhich},{name:'plugins.keyboard.debugger.last-key-string',value:C3.Plugins.Keyboard.Exps.StringFromKeyCode(this._triggerWhich)},{name:'plugins.keyboard.debugger.last-typed-key',value:this._triggerTypedKey}]}]}},'use strict';{const e=['ShiftLeft','ShiftRight','ControlLeft','ControlRight','AltLeft','AltRight','MetaLeft','MetaRight'];C3.Plugins.Keyboard.Cnds={IsKeyDown(e){return this._keysDownByWhich.has(e)},OnKey(e){return this._triggerWhich===e},OnAnyKey(){return!0},OnAnyKeyReleased(){return!0},OnKeyReleased(e){return this._triggerWhich===e},IsKeyCodeDown(e){return e=Math.floor(e),this._keysDownByWhich.has(e)},OnKeyCode(e){return this._triggerWhich===e},OnKeyCodeReleased(e){return this._triggerWhich===e},OnLeftRightKeyPressed(t){const a=e[t];return this._triggerString===a},OnLeftRightKeyReleased(t){const a=e[t];return this._triggerString===a},IsLeftRightKeyDown(t){const a=e[t];return this._keysDownByString.has(a)}}}'use strict',C3.Plugins.Keyboard.Acts={},'use strict';{function e(e){return e=Math.floor(e),8===e?'backspace':9===e?'tab':13===e?'enter':16===e?'shift':17===e?'control':18===e?'alt':19===e?'pause':20===e?'capslock':27===e?'esc':33===e?'pageup':34===e?'pagedown':35===e?'end':36===e?'home':37===e?'\u2190':38===e?'\u2191':39===e?'\u2192':40===e?'\u2193':45===e?'insert':46===e?'del':91===e?'left window key':92===e?'right window key':93===e?'select':96===e?'numpad 0':97===e?'numpad 1':98===e?'numpad 2':99===e?'numpad 3':100===e?'numpad 4':101===e?'numpad 5':102===e?'numpad 6':103===e?'numpad 7':104===e?'numpad 8':105===e?'numpad 9':106===e?'numpad *':107===e?'numpad +':109===e?'numpad -':110===e?'numpad .':111===e?'numpad /':112===e?'F1':113===e?'F2':114===e?'F3':115===e?'F4':116===e?'F5':117===e?'F6':118===e?'F7':119===e?'F8':120===e?'F9':121===e?'F10':122===e?'F11':123===e?'F12':144===e?'numlock':145===e?'scroll lock':186===e?';':187===e?'=':188===e?',':189===e?'-':190===e?'.':191===e?'/':192===e?'\'':219===e?'[':220===e?'\\':221===e?']':222===e?'#':223===e?'`':String.fromCharCode(e)}C3.Plugins.Keyboard.Exps={LastKeyCode(){return this._triggerWhich},StringFromKeyCode(t){return e(t)},TypedKey(){return this._triggerTypedKey}}}'use strict',C3.Plugins.PlatformInfo=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Plugins.PlatformInfo.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict',C3.Plugins.PlatformInfo.Instance=class extends C3.SDKInstanceBase{constructor(e){super(e,'platform-info'),this._screenWidth=0,this._screenHeight=0,this._windowOuterWidth=0,this._windowOuterHeight=0,this._safeAreaInset=[0,0,0,0],this.AddDOMMessageHandler('window-resize',e=>this._OnWindowResize(e)),navigator.connection&&navigator.connection.addEventListener('change',()=>this._OnNetworkChange()),this._runtime.AddLoadPromise(this.PostToDOMAsync('get-initial-state').then(e=>{this._screenWidth=e.screenWidth,this._screenHeight=e.screenHeight,this._windowOuterWidth=e.windowOuterWidth,this._windowOuterHeight=e.windowOuterHeight,this._safeAreaInset=e.safeAreaInset}))}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)}},'use strict',C3.Plugins.PlatformInfo.Cnds={IsOnMobile(){return C3.Platform.IsMobile},IsOnWindows(){return'Windows'===C3.Platform.OS},IsOnMacOS(){return'Mac OS X'===C3.Platform.OS},IsOnLinux(){return'Linux'===C3.Platform.OS},IsOnChromeOS(){return'Chrome OS'===C3.Platform.OS},IsOnAndroid(){return'Android'===C3.Platform.OS},IsOniOS(){return'iOS'===C3.Platform.OS},IsWebExport(){const e=this._runtime.GetExportType();return'html5'===e||'scirra-arcade'===e||'preview'===e||'instant-games'===e},IsCordovaExport(){return this._runtime.IsCordova()},IsNWjsExport(){return'nwjs'===this._runtime.GetExportType()},IsWindowsUWPExport(){return'windows-uwp'===this._runtime.GetExportType()},OnNetworkChange(){return!0}},'use strict',C3.Plugins.PlatformInfo.Acts={},'use strict',C3.Plugins.PlatformInfo.Exps={Renderer(){const e=this._runtime.GetWebGLRenderer();let t='webgl'+e.GetWebGLVersionNumber();return e.HasMajorPerformanceCaveat()&&(t+='-software'),t},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(){return navigator.connection?navigator.connection.downlink||0:0},DownlinkMax(){return navigator.connection?navigator.connection.downlinkMax||0:0},ConnectionType(){return navigator.connection?navigator.connection.type||'unknown':'unknown'},ConnectionEffectiveType(){return navigator.connection?navigator.connection.effectiveType||'unknown':'unknown'},ConnectionRTT(){return navigator.connection?navigator.connection.rtt||0: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',C3.Plugins.Browser=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Plugins.Browser.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict',C3.Plugins.Browser.Instance=class extends C3.SDKInstanceBase{constructor(e){super(e,'browser'),this._initLocationStr='',this._isOnline=!1,this._referrer='',this._docTitle='',this._isCookieEnabled=!1,this._screenWidth=0,this._screenHeight=0,this._windowOuterWidth=0,this._windowOuterHeight=0,this._isScirraArcade=!1,this.AddDOMMessageHandler('online-state',e=>this._OnOnlineStateChanged(e)),this.AddDOMMessageHandler('backbutton',()=>this._OnBackButton()),this.AddDOMMessageHandler('sw-message',e=>this._OnSWMessage(e));const t=this.GetRuntime().Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(t,'afterfirstlayoutstart',()=>this._OnAfterFirstLayoutStart()),C3.Disposable.From(t,'window-resize',()=>this._OnWindowResize()),C3.Disposable.From(t,'suspend',()=>this._OnSuspend()),C3.Disposable.From(t,'resume',()=>this._OnResume())),this._runtime.AddLoadPromise(this.PostToDOMAsync('get-initial-state',{exportType:this._runtime.GetExportType()}).then(e=>{this._initLocationStr=e.location,this._isOnline=e.isOnline,this._referrer=e.referrer,this._docTitle=e.title,this._isCookieEnabled=e.isCookieEnabled,this._screenWidth=e.screenWidth,this._screenHeight=e.screenHeight,this._windowOuterWidth=e.windowOuterWidth,this._windowOuterHeight=e.windowOuterHeight,this._isScirraArcade=e.isScirraArcade}))}Release(){super.Release()}_OnAfterFirstLayoutStart(){this.PostToDOM('ready-for-sw-messages')}async _OnOnlineStateChanged(e){const t=!!e.isOnline;this._isOnline===t||(this._isOnline=t,this._isOnline?await this.TriggerAsync(C3.Plugins.Browser.Cnds.OnOnline):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 t=e.type;'downloading-update'===t?this.Trigger(C3.Plugins.Browser.Cnds.OnUpdateFound):'update-ready'===t||'update-pending'===t?this.Trigger(C3.Plugins.Browser.Cnds.OnUpdateReady):'offline-ready'===t&&this.Trigger(C3.Plugins.Browser.Cnds.OnOfflineReady)}GetDebuggerProperties(){return[{title:'plugins.browser.name',properties:[{name:'plugins.browser.debugger.user-agent',value:navigator.userAgent},{name:'plugins.browser.debugger.is-online',value:this._isOnline},{name:'plugins.browser.debugger.is-fullscreen',value:this._runtime.GetCanvasManager().IsDocumentFullscreen()}]}]}},'use strict',C3.Plugins.Browser.Cnds={IsOnline(){return this._isOnline},OnOnline(){return!0},OnOffline(){return!0},OnResize(){return!0},CookiesEnabled(){return this._isCookieEnabled},IsFullscreen(){return this._runtime.GetCanvasManager().IsDocumentFullscreen()},OnBackButton(){return!0},IsPortraitLandscape(e){const t=this._runtime.GetCanvasManager().GetLastWidth(),a=this._runtime.GetCanvasManager().GetLastHeight(),n=t<=a?0:1;return n===e},OnUpdateFound(){return!0},OnUpdateReady(){return!0},OnOfflineReady(){return!0},PageVisible(){return!this._runtime.IsSuspended()},OnPageHidden(){return!0},OnPageVisible(){return!0},HasJava(){return!1},IsDownloadingUpdate(){return!1},OnMenuButton(){return!1},OnSearchButton(){return!1},IsMetered(){return!1},IsCharging(){return!0},SupportsFullscreen(){return!0}},'use strict';{const ORIENTATIONS=['portrait','landscape','portrait-primary','portrait-secondary','landscape-primary','landscape-secondary'];C3.Plugins.Browser.Acts={Alert(e){this.PostToDOM('alert',{message:e.toString()})},Close(){this._isScirraArcade||(this._runtime.IsDebug()?C3Debugger.CloseWindow():this.PostToDOM('close'))},Focus(){this.PostToDOM('set-focus',{isFocus:!0})},Blur(){this.PostToDOM('set-focus',{isFocus:!1})},GoBack(){this._isScirraArcade||this.PostToDOM('navigate',{type:'back'})},GoForward(){this._isScirraArcade||this.PostToDOM('navigate',{type:'forward'})},GoHome(){this._isScirraArcade||this.PostToDOM('navigate',{type:'home'})},Reload(){this._isScirraArcade||this.PostToDOM('navigate',{type:'reload'})},GoToURL(e,t){this._PostToDOMMaybeSync('navigate',{type:'url',url:e,target:t,exportType:this._runtime.GetExportType()})},GoToURLWindow(e,t){this._PostToDOMMaybeSync('navigate',{type:'new-window',url:e,tag:t,exportType:this._runtime.GetExportType()})},RequestFullScreen(e,t){2<=e&&(e+=1),6===e&&(e=2),1===e&&(e=0);const n=C3.CanvasManager._FullscreenModeNumberToString(e);this._runtime.GetCanvasManager().SetDocumentFullscreenMode(n),this._PostToDOMMaybeSync('request-fullscreen',{navUI:t})},CancelFullScreen(){this._PostToDOMMaybeSync('exit-fullscreen')},Vibrate(e){const t=e.split(',');for(let a=0,n=t.length;ae||e>=ORIENTATIONS.length)){const t=ORIENTATIONS[e];this._PostToDOMMaybeSync('lock-orientation',{orientation:t})}},UnlockOrientation(){this._PostToDOMMaybeSync('unlock-orientation')},LoadStyleSheet(e){this._runtime.GetAssetManager().LoadStyleSheet(e)}}}'use strict',C3.Plugins.Browser.Exps={URL(){return this._runtime.IsInWorker()?this._initLocationStr:location.toString()},Protocol(){return this._runtime.IsInWorker()?new URL(this._initLocationStr).protocol:location.protocol},Domain(){return this._runtime.IsInWorker()?new URL(this._initLocationStr).hostname:location.hostname},PathName(){return this._runtime.IsInWorker()?new URL(this._initLocationStr).pathname:location.pathname},Hash(){return this._runtime.IsInWorker()?new URL(this._initLocationStr).hash:location.hash},QueryString(){return this._runtime.IsInWorker()?new URL(this._initLocationStr).search:location.search},QueryParam(e){const t=this._runtime.IsInWorker()?new URL(this._initLocationStr).search:location.search,a=RegExp('[?&]'+e+'=([^&]*)').exec(t);return a?decodeURIComponent(a[1].replace(/\+/g,' ')):''},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(e){console.error('Error executing JavaScript: ',e)}return'number'==typeof result||'string'==typeof result?result:'boolean'==typeof result?result?1:0:0},Name(){return navigator.appName},Version(){return navigator.appVersion},Product(){return navigator.product},Vendor(){return navigator.vendor},BatteryLevel(){return 1},BatteryTimeLeft(){return 1/0},Bandwidth(){const e=navigator.connection;return e?e.downlink||e.downlinkMax||e.bandwidth||1/0:1/0},ConnectionType(){const e=navigator.connection;return e?e.type||'unknown':'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',C3.Behaviors.scrollto=class extends C3.SDKBehaviorBase{constructor(e){super(e),this._shakeMag=0,this._shakeStart=0,this._shakeEnd=0,this._shakeMode=0}Release(){super.Release()}SetShakeMagnitude(e){this._shakeMag=e}GetShakeMagnitude(){return this._shakeMag}SetShakeStart(e){this._shakeStart=e}GetShakeStart(){return this._shakeStart}SetShakeEnd(e){this._shakeEnd=e}GetShakeEnd(){return this._shakeEnd}SetShakeMode(e){this._shakeMode=e}GetShakeMode(){return this._shakeMode}},'use strict',C3.Behaviors.scrollto.Type=class extends C3.SDKBehaviorTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict',C3.Behaviors.scrollto.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(e,t){super(e),this._isEnabled=!0,t&&(this._isEnabled=t[0]),this._isEnabled&&this._StartTicking2()}Release(){super.Release()}SaveToJson(){const e=this.GetBehavior();return{e:this._isEnabled,smg:e.GetShakeMagnitude(),ss:e.GetShakeStart(),se:e.GetShakeEnd(),smd:e.GetShakeMode()}}LoadFromJson(e){const t=this.GetBehavior();t.SetShakeMagnitude(e.smg),t.SetShakeStart(e.ss),t.SetShakeEnd(e.se),t.SetShakeMode(e.smd),this._isEnabled=e.e,this._isEnabled?this._StartTicking2():this._StopTicking2()}IsEnabled(){return this._isEnabled}Tick2(){if(!this.IsEnabled())return;const t=this._runtime.GetDt(this._inst),n=this.GetBehavior(),r=n.GetInstances();let s=0,l=0,_=0;for(const e of r){const t=e.GetBehaviorInstanceFromCtor(C3.Behaviors.scrollto);if(!t||!t.GetSdkInstance().IsEnabled())continue;const a=e.GetWorldInfo();s+=a.GetX(),l+=a.GetY(),++_}const a=this._inst.GetWorldInfo().GetLayout(),u=this._runtime.GetGameTime();let g=0,p=0;if(u>=n.GetShakeStart()&&uthis._OnAfterLoad(e),this.GetRuntime().Dispatcher().addEventListener('afterload',this._afterLoad)}Release(){this.GetRuntime().Dispatcher().removeEventListener('afterload',this._afterLoad),this._afterLoad=null,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,this._enabled?this._StartTicking2():this._StopTicking2()}GetEnabled(){return this._enabled}AddToDisabledList(e){this._disabledTweens.push(e)}IsInDisabledList(e){return this._disabledTweens.includes(e)}ClearDisabledList(){C3.clearArray(this._disabledTweens)}GetFinishingTween(){return this._finishingTween}IsInstanceValid(){const e=this.GetObjectInstance();return!!e&&!e.IsDestroyed()}GetTween(e,t,a=!1){const n=t?this.PropertyTweens(t,a):this.AllTweens(a);if(n&&n.length)for(const t of n)if(t.HasTags(e))return t}GetTweenIncludingWaitingForRelease(e,t){return this.GetTween(e,t,!0)}*GetTweens(e,t,a=!1){const n=t?this.PropertyTweens(t,a):this.AllTweens(a);if(n&&n.length)for(const t of n)t.HasTags(e)&&(yield t)}*GetTweensIncludingWaitingForRelease(e,t){yield*this.GetTweens(e,t,!0)}PropertyTweens(e,t){if(t){let t=this._activeTweens.get(e),a=this._waitingForReleaseTweens.get(e);return t||(t=[]),a||(a=[]),t.concat(a).filter(e=>e)}else{let t=this._activeTweens.get(e);return t||(t=[]),t.filter(e=>e)}}AllTweens(e){if(e){const e=[...this._activeTweens.values()].flat(),t=[...this._waitingForReleaseTweens.values()].flat();return e.concat(t).filter(e=>e)}else{const e=[...this._activeTweens.values()].flat();return e.filter(e=>e)}}AllTweensIncludingWaitingForRelease(){return this.AllTweens(!0)}SaveToJson(){return{s:!1,e:!!this._enabled,at:this._SaveActiveTweensToJson(),dt:this._SaveDisabledTweensToJson(),wt:this._SaveWaitingForReleaseTweensToJson(),ft:this._SaveFinishingTweenToJson()}}LoadFromJson(e){e&&(this._activeTweensJson=e.at,this._disabledTweensJson=e.dt,this._waitingForReleaseTweensJson=e.wt,this._finishingTweenName=e.ft,this._allowMultiple=!1,this._enabled=!!e.e)}_OnAfterLoad(){const e=this.GetRuntime().GetTimelineManager();if(this._PopulateTweenMap(this._activeTweensJson,this._activeTweens,e),this._disabledTweensJson){C3.clearArray(this._disabledTweens);for(const t of this._disabledTweensJson)this._PopulateTweenArray(this._disabledTweens,t,e)}this._PopulateTweenMap(this._waitingForReleaseTweensJson,this._waitingForReleaseTweens,e),this._finishingTween=this._GetTween(this._finishingTweenName,e),this._enabled?this._StartTicking2():this._StopTicking2()}_PopulateTweenMap(t,a,n){if(t)for(const r in t){let s=a.get(r);s?C3.clearArray(s):s=[];const e=t[r];for(const t of e){const e=this._PopulateTweenArray(s,t.name,n);if(!e){const e=C3.Tween.Build({runtime:this.GetRuntime(),json:t});e.AddCompletedCallback(e=>this._FinishTriggers(e)),n.AddScheduledTimeline(e),this._PopulateTweenArray(s,e,n)}else this._LoadTweenFromJson(t.name,t,n)}a.set(r,s)}}_GetTween(e,t){return t.GetScheduledOrPlayingTimelineByName(e)}_PopulateTweenArray(e,t,a){if('string'==typeof t){const n=this._GetTween(t,a);if(n)return!!e.push(n)}else return!!e.push(t);return!1}_LoadTweenFromJson(e,t,a){if('string'==typeof e){const n=this._GetTween(e,a);n&&n._LoadFromJson(t)}else e._LoadFromJson(t)}_SaveActiveTweensToJson(){const e={};for(const[t,a]of this._activeTweens)e[t]=a.map(e=>e._SaveToJson());return e}_SaveDisabledTweensToJson(){return this._disabledTweens.map(e=>e.GetName())}_SaveWaitingForReleaseTweensToJson(){const e={};for(const[t,a]of this._waitingForReleaseTweens)e[t]=a.map(e=>e._SaveToJson());return e}_SaveFinishingTweenToJson(){return this._finishingTween?this._finishingTween.GetName():''}Tick2(){this._ReleaseWaitingTweens()}CreateTween(a){const n=t.Config.GetPropertyTracksConfig(a.property,a.startValue,a.endValue,a.ease,a.resultMode,this.GetObjectInstance()),r=t.Maps.GetPropertyFromIndex(a.property);t.Maps.IsValueId(r)||this.ReleaseTweens(a.property);const s=C3.Tween.Build({runtime:this.GetRuntime(),id:r,tags:a.tags,time:a.time,instance:this.GetObjectInstance(),releaseOnComplete:!!a.releaseOnComplete,initialValueMode:a.initialValueMode,propertyTracksConfig:n});return s.AddCompletedCallback(e=>this._FinishTriggers(e)),this._AddTween(s,a.property),s}ReleaseTween(e,t=!1){const a=e.GetId();if(this._activeTweens.has(a)){const t=this._activeTweens.get(a);if(t){const a=t.indexOf(e);-1!==a&&t.splice(a,1)}}e.IsReleased()||this._IsInWaitingList(e)||(e.Stop(t),this._AddToWaitingList(e))}ReleaseTweens(a,n=!1){if(C3.IsFiniteNumber(a)){const r=t.Maps.GetPropertyFromIndex(a);if(!this._activeTweens.has(r))return;const s=this._activeTweens.get(r),e=this.GetFinishingTween();for(const t of s)t!==e&&(t.IsReleased()||this._IsInWaitingList(t)||(t.Stop(n),t.Release()));C3.clearArray(s)}else{const e=this.GetFinishingTween();for(const t of this.AllTweens())t!==e&&(t.IsReleased()||this._IsInWaitingList(t)||(t.Stop(n),t.Release()));for(const e of this._activeTweens.keys())C3.clearArray(this._activeTweens.get(e)),this._activeTweens.delete(e);this._activeTweens.clear()}}ReleaseAndCompleteTween(e){this.ReleaseTween(e,!0)}ReleaseAndCompleteTweens(){this.ReleaseTweens(NaN,!0)}GetPropertyValueByIndex(e){return 0===e?this._enabled:void 0}SetPropertyValueByIndex(e,t){0===e?this._enabled=!!t:void 0}_FinishTriggers(e){this.GetRuntime()&&(this._finishingTween=e,t.Cnds.SetFinishingTween(e),this.Trigger(t.Cnds.OnTweensFinished),this.Trigger(t.Cnds.OnAnyTweensFinished),t.Cnds.SetFinishingTween(null),this._finishingTween=null,this.ReleaseTween(e),e.GetDestroyInstanceOnComplete()&&this.GetRuntime().DestroyInstance(this.GetObjectInstance()))}_AddTween(a,n){const r=t.Maps.GetPropertyFromIndex(n);this._activeTweens.has(r)||this._activeTweens.set(r,[]);const s=this._activeTweens.get(r);s.push(a)}_AddToWaitingList(e){const t=e.GetId();this._waitingForReleaseTweens.has(t)||this._waitingForReleaseTweens.set(t,[]),this._waitingForReleaseTweens.get(t).push(e)}_IsInWaitingList(e){const t=e.GetId();return!!this._waitingForReleaseTweens.has(t)&&this._waitingForReleaseTweens.get(t).includes(e)}_ReleaseWaitingTweens(){if(this._waitingForReleaseTweens.size){for(const e of this._waitingForReleaseTweens.values()){for(const t of e)t.IsReleased()||t.Release();C3.clearArray(e)}this._waitingForReleaseTweens.clear()}}}}{let e=null;C3.Behaviors.Tween.Cnds={SetFinishingTween(t){e=t},OnTweensFinished(t){return e.HasTags(t)},OnAnyTweensFinished(){return!0},IsPlaying(e){const t=[...this.GetTweensIncludingWaitingForRelease(e)];return!!t&&!!t.length&&t.some(C3.Tween.IsPlaying)},IsAnyPlaying(){const e=[...this.AllTweensIncludingWaitingForRelease()];return!!e&&!!e.length&&e.some(C3.Tween.IsPlaying)}}}{const e=C3.Behaviors.Tween;e.Acts={SetEnabled(e){this.SetEnabled(!!e);for(const t of this.AllTweens())e?this.IsInDisabledList(t)&&t.Resume():((t.IsPlaying()||t.IsScheduled())&&this.AddToDisabledList(t),t.Stop());e&&this.ClearDisabledList()},async TweenOneProperty(...t){if(this.GetEnabled()&&this.IsInstanceValid()){const a=this.CreateTween(e.TweenArguments.OneProperty(this,...t));a.Play()&&(await a.GetPlayPromise())}},async TweenTwoProperties(...t){if(this.GetEnabled()&&this.IsInstanceValid()){const a=this.CreateTween(e.TweenArguments.TwoProperties(this,...t));a.Play()&&(await a.GetPlayPromise())}},async TweenValue(...t){if(this.GetEnabled()&&this.IsInstanceValid()){const a=this.CreateTween(e.TweenArguments.ValueProperty(this,...t));a.Play()&&(await a.GetPlayPromise())}},PauseTweens(e){if(this.GetEnabled()&&this.IsInstanceValid())for(const t of this.GetTweens(e))t.Stop()},PauseAllTweens(){if(this.GetEnabled()&&this.IsInstanceValid())for(const e of this.AllTweens())e.Stop()},ResumeTweens(e){if(this.GetEnabled()&&this.IsInstanceValid())for(const t of this.GetTweens(e))t.Resume()},ResumeAllTweens(){if(this.GetEnabled()&&this.IsInstanceValid())for(const e of this.AllTweens())e.Resume()},StopTweens(e){if(this.GetEnabled()&&this.IsInstanceValid())for(const t of this.GetTweens(e))this.ReleaseTween(t)},StopAllTweens(){if(this.GetEnabled()&&this.IsInstanceValid())for(const e of this.AllTweens())this.ReleaseTween(e)},SetOnePropertyTweensEndValue(e,t,a){if(this.GetEnabled()&&this.IsInstanceValid())for(const n of this.GetTweens(e))n.BeforeSetEndValues([t],[a]),n.SetEndValue(t,a)},SetTwoPropertiesTweensEndValue(t,a,n,r){if(this.GetEnabled()&&this.IsInstanceValid()){const s=C3.Behaviors.Tween.Maps.GetRealProperties(a);for(const e of this.GetTweens(t))e.BeforeSetEndValues([n,r],s),e.SetEndValue(n,s[0]),e.SetEndValue(r,s[1])}},SetValuePropertyTweensStartValue(e,t){if(this.GetEnabled()&&this.IsInstanceValid())for(const a of this.GetTweens(e,'value'))a.SetStartValue(t,'value')},SetValuePropertyTweensEndValue(e,t){if(this.GetEnabled()&&this.IsInstanceValid())for(const a of this.GetTweens(e,'value'))a.BeforeSetEndValue([t],[value]),a.SetEndValue(t,'value')},SetTweensEase(e,t){if(this.GetEnabled()&&this.IsInstanceValid()){const a=Ease.GetEaseFromIndex(t);for(const t of this.GetTweens(e))t.SetEase(a)}},SetAllTweensEase(e){if(this.GetEnabled()&&this.IsInstanceValid()){const t=Ease.GetEaseFromIndex(e);for(const e of this.AllTweens())e.SetEase(t)}},SetTweensTime(e,t){if(this.GetEnabled()&&this.IsInstanceValid())for(const a of this.GetTweens(e))a.SetTime(t)},SetAllTweensTime(e){if(this.GetEnabled()&&this.IsInstanceValid())for(const t of this.AllTweens())t.SetTime(e)},SetTweensPlaybackRate(e,t){if(this.GetEnabled()&&this.IsInstanceValid())for(const a of this.GetTweens(e))a.SetPlaybackRate(t)},SetAllTweensPlaybackRate(e){if(this.GetEnabled()&&this.IsInstanceValid())for(const t of this.AllTweens())t.SetPlaybackRate(e)},SetTweensDestroyOnComplete(e,t){if(this.GetEnabled()&&this.IsInstanceValid())for(const a of this.GetTweens(e))a.SetDestroyInstanceOnComplete(!!t)},SetAllTweensDestroyOnComplete(e){if(this.GetEnabled()&&this.IsInstanceValid())for(const t of this.AllTweens())t.SetDestroyInstanceOnComplete(!!e)}}}'use strict',C3.Behaviors.Tween.Exps={Time(e){const t=this.GetTweenIncludingWaitingForRelease(e);return t?t.GetTime():0},Progress(e){const t=this.GetTweenIncludingWaitingForRelease(e);return t?t.GetTime()/t.GetTotalTime():0},Value(e){const t=this.GetTweenIncludingWaitingForRelease(e,'value');return t?t.GetPropertyTrack('value').GetSourceAdapterValue():0},Tags(){return this.GetFinishingTween()?this.GetFinishingTween().GetStringTags():''}},'use strict';{const t=['position','size'],n=['offsetX','offsetY','offsetWidth','offsetHeight','offsetAngle','offsetOpacity','offsetColor','offsetZElevation'],r=['value'],s=[].concat(t).concat(n).concat(r),l={position:['offsetX','offsetY'],size:['offsetWidth','offsetHeight']},e=Object.assign({},s.reduce((e,t)=>Object.assign({},e,{[t]:[t]}),{}),l);C3.Behaviors.Tween.Maps=class{constructor(){}static GetEases(){return[...Ease.GetEaseNames()]}static GetEaseFromIndex(e){return[...Ease.GetEaseNames()][e]}static GetPropertyFromIndex(e){return s[e]}static GetPropertyIndexFromName(e){return s.indexOf(e)}static GetPairPropertyFromIndex(e){return t[e]}static GetSinglePropertyFromIndex(e){return n[e]}static GetValuePropertyFromIndex(e){return r[e]}static GetPairProperties(e){return l[e]}static GetRealProperties(t){return C3.IsString(t)?e[t]:e[s[t]]}static IsPairId(e){return!!l[e]}static IsColorId(e){return'offsetColor'===e}static IsAngleId(e){return'offsetAngle'===e}static IsOpacityId(e){return'offsetOpacity'===e}static IsValueId(e){return'value'===e}}}{const t=C3.Behaviors.Tween,n=new Map;t.Config=class{constructor(){}static GetPropertyTracksConfig(a,r,s,e,l,_){0===n.size&&this._CreateConfigObjects();const d=t.PropertyTypes.Pick(a);let u=n.get(d);return C3.IsFiniteNumber(a)&&(a=t.Maps.GetPropertyFromIndex(a)),this._GetConfig(u,a,r,s,e,l,_)}static TransformValue(e,t){const a=C3.Behaviors.Tween.GetPropertyTracksConfig(e);return a.valueGetter(t)}static _CreateConfigObjects(){const e=t.PropertyTypes,a=t.ValueGetters;this._AddConfigObject(e.PAIR,this._GetPairConfig,a._GetPropertyValue),this._AddConfigObject(e.COLOR,this._GetColorConfig,a._GetColorPropertyValue),this._AddConfigObject(e.ANGLE,this._GetAngleConfig,a._GetPropertyAngleValue),this._AddConfigObject(e.VALUE,this._GetValueConfig,a._GetPropertyValue),this._AddConfigObject(e.OTHER,this._GetCommonConfig,a._GetPropertyValue)}static _AddConfigObject(e,t,a){n.set(e,this._CreateConfigObject(e,t,a))}static _CreateConfigObject(e,t,a){return{name:e,configFunc:t,valueGetter:a}}static _GetConfig(t,a,n,r,s,e,l){return t.configFunc(a,t.valueGetter(n),t.valueGetter(r),s,e,l)}static _GetPairConfig(a,n,r,s,e){const l=t.Maps.GetPairProperties(a);return l.map((a,l)=>({sourceId:'world-instance',property:a,type:'float',valueType:'numeric',startValue:n[l],endValue:r[l],ease:t.Maps.GetEaseFromIndex(s),resultMode:e}))}static _GetColorConfig(a,n,r,s,e,l){return C3.Plugins.Text&&l.GetPlugin()instanceof C3.Plugins.Text?{sourceId:'plugin',sourceArgs:[7],property:'color',type:'color',valueType:'color',startValue:n,endValue:r,ease:t.Maps.GetEaseFromIndex(s),resultMode:e}:{sourceId:'world-instance',property:a,type:'color',valueType:'color',startValue:n,endValue:r,ease:t.Maps.GetEaseFromIndex(s),resultMode:e}}static _GetAngleConfig(a,n,r,s,e){return{sourceId:'world-instance',property:a,type:'angle',valueType:'angle',startValue:n,endValue:r,ease:t.Maps.GetEaseFromIndex(s),resultMode:e}}static _GetCommonConfig(a,n,r,s,e){return{sourceId:'world-instance',property:a,type:'float',valueType:'numeric',startValue:n,endValue:r,ease:t.Maps.GetEaseFromIndex(s),resultMode:e}}static _GetValueConfig(a,n,r,s,e){return{sourceId:'value',property:a,type:'float',valueType:'numeric',startValue:n,endValue:r,ease:t.Maps.GetEaseFromIndex(s),resultMode:e}}}}{const t=C3.Behaviors.Tween,a=Object.assign({},{resultMode:'absolute'},{tags:'',property:'',time:0,ease:0,releaseOnComplete:0}),n=Object.assign({},a,{initialValueMode:'current-state',startValue:0,endValue:0}),r=Object.assign({},a,{initialValueMode:'current-state',startValue:[0,0],endValue:[0,0]}),s=Object.assign({},a,{initialValueMode:'current-state',startValue:[0,0,0],endValue:[0,0,0]}),l=Object.assign({},n,{initialValueMode:'start-value'});t.TweenArguments=class{constructor(){}static _SetCommonProperties(t,a,n,r,s){t.tags=a,t.time=n,t.ease=r,t.releaseOnComplete=s}static OneProperty(e,a,r,_,d,u,c){const g=t.Maps.GetSinglePropertyFromIndex(r),p=t.Maps.IsColorId(g)?s:n;return this._SetCommonProperties(p,a,d,u,c),t.Maps.IsColorId(g)?(s.endValue[0]=C3.GetRValue(_),s.endValue[1]=C3.GetGValue(_),s.endValue[2]=C3.GetBValue(_),s.property=t.Maps.GetPropertyIndexFromName(g)):t.Maps.IsOpacityId(g)?n.endValue=_/100:n.endValue=_,p.property=t.Maps.GetPropertyIndexFromName(g),p}static TwoProperties(a,n,s,e,l,_,d,u){this._SetCommonProperties(r,n,_,d,u);const c=t.Maps.GetPairPropertyFromIndex(s);return r.endValue[0]=e,r.endValue[1]=l,r.property=t.Maps.GetPropertyIndexFromName(c),r}static ValueProperty(a,n,r,s,e,_,d){return this._SetCommonProperties(l,n,e,_,d),l.startValue=r,l.endValue=s,l.property=t.Maps.GetPropertyIndexFromName('value'),l}}}{const e=C3.Behaviors.Tween,t=[];e.PropertyTypes=class{constructor(){}static Pick(n){if(0===t.length){const a=t;a.push({checkFunc:e.Maps.IsPairId,result:this.PAIR}),a.push({checkFunc:e.Maps.IsColorId,result:this.COLOR}),a.push({checkFunc:e.Maps.IsAngleId,result:this.ANGLE}),a.push({checkFunc:e.Maps.IsValueId,result:this.VALUE}),a.push({checkFunc:()=>!0,result:this.OTHER})}C3.IsFiniteNumber(n)&&(n=C3.Behaviors.Tween.Maps.GetPropertyFromIndex(n));for(const e of t)if(e.checkFunc(n))return e.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'}}}{const e=C3.Behaviors.Tween;e.ValueGetters=class{constructor(){}static _GetPropertyAngleValue(e){const t=C3.toRadians(parseFloat(e));return C3.clampAngle(t)}static _GetColorPropertyValue(e){return e.slice(0)}static _GetPropertyValue(e){return e}}}{function t(t,a,n){const r=t.GetSavedDataMap(),s=a.GetSavedDataMap();if(n){const e=r.get(p);e&&e.delete(a.GetSID());const n=s.get(p);n&&n.delete(t.GetSID())}else{let e=r.get(p);e||(e=new Set,r.set(p,e));let n=s.get(p);n||(n=new Set,s.set(p,n)),e.add(a.GetSID()),n.add(t.GetSID())}}function n(e){if(!(e instanceof IObjectClass))throw new TypeError('expected IObjectClass');const t=u.GetRuntime()._UnwrapScriptInterface(e);if(!t||!(t instanceof C3.ObjectClass))throw new Error('invalid IObjectClass');return t}let r=null,s=null,l=[],_=null,u=null;const p='Physics_DisabledCollisions';C3.Behaviors.Physics=class extends C3.SDKBehaviorBase{constructor(e){e.scriptInterfaceClass=IPhysicsBehavior,super(e),this._world=null,this._worldG=10,this._worldScale=.02,this._lastUpdateTick=-1,this._steppingMode=0,this._velocityIterations=8,this._positionIterations=3,this._allCollisionsEnabled=!0,this._runtime.AddLoadPromise(this._LoadBox2DWasm())}async _LoadBox2DWasm(){const e=await this._runtime.GetAssetManager().GetProjectFileUrl('box2d.wasm');await new Promise(t=>{self.Box2DWasmModule({wasmBinaryFile:e}).then(e=>{_=e,this._InitBox2DWorld(),t()})})}_InitBox2DWorld(){const t=this._runtime.GetCollisionEngine();r=C3.Behaviors.Physics.GetVec2(0,0),s=C3.Behaviors.Physics.GetVec2(0,0),this._world=new _.b2World(C3.Behaviors.Physics.GetTempVec2A(0,this._worldG),!0);const a=new _.JSContactListener;a.BeginContact=a=>{const n=_.wrapPointer(a,_.b2Contact),r=C3.Behaviors.Physics.Instance.LookupBehInstFromBody(n.GetFixtureA().GetBody()),s=C3.Behaviors.Physics.Instance.LookupBehInstFromBody(n.GetFixtureB().GetBody());t.RegisterCollision(r.GetObjectInstance(),s.GetObjectInstance())},a.EndContact=()=>{},a.PreSolve=()=>{},a.PostSolve=()=>{},this._world.SetContactListener(a);const n=new _.JSContactFilter;n.ShouldCollide=(t,a)=>{if(this._allCollisionsEnabled)return!0;const r=_.wrapPointer(t,_.b2Fixture),s=_.wrapPointer(a,_.b2Fixture),d=C3.Behaviors.Physics.Instance.LookupBehInstFromBody(r.GetBody()),e=C3.Behaviors.Physics.Instance.LookupBehInstFromBody(s.GetBody()),u=d.GetObjectInstance().GetObjectClass(),c=e.GetObjectInstance().GetObjectClass(),g=u.GetSID(),h=c.GetSID(),l=u.GetSavedDataMap().get(p);if(l&&l.has(h))return!1;const m=c.GetSavedDataMap().get(p);return!(m&&m.has(g))},this._world.SetContactFilter(n)}Release(){super.Release()}GetBox2D(){return _}GetWorld(){return this._world}GetWorldScale(){return this._worldScale}GetSteppingMode(){return this._steppingMode}SetSteppingMode(e){this._steppingMode=e}SetLastUpdateTick(e){this._lastUpdateTick=e}GetLastUpdateTick(){return this._lastUpdateTick}SetVelocityIterations(e){this._velocityIterations=Math.max(e,1)}GetVelocityIterations(){return this._velocityIterations}SetPositionIterations(e){this._positionIterations=Math.max(e,1)}GetPositionIterations(){return this._positionIterations}SetIterations(e,t){this.SetVelocityIterations(e),this.SetPositionIterations(t)}GetGravity(){return this._worldG}SetGravity(e){e===this._worldG||(this._world.SetGravity(C3.Behaviors.Physics.GetTempVec2A(0,e)),this._worldG=e,this._WakeUpAllPhysicsBodies())}_WakeUpAllPhysicsBodies(){for(const e of this.GetInstances()){const t=C3.Behaviors.Physics.Instance.LookupBehInstFromInst(e);if(!t)continue;const a=t.GetBody();a&&a.SetAwake(!0)}}DisableShouldCollideFastPath(){this._allCollisionsEnabled=!1}SetCollisionsEnabled(a,n,r){if(r=!!r,a&&n){if(n.IsFamily())for(const s of n.GetFamilyMembers())t(a,s,r);else t(a,n,r);this.DisableShouldCollideFastPath()}}static GetPhysicsCollisionKey(){return p}static GetVec2(e,t){if(l.length){const a=l.pop();return a.set_x(e),a.set_y(t),a}else{const a=_.b2Vec2;return new a(e,t)}}static FreeVec2(e){l.push(e)}static GetTempVec2A(e,t){return r.set_x(e),r.set_y(t),r}static GetTempVec2B(e,t){return s.set_x(e),s.set_y(t),s}static CreatePolygonShape(t){const a=_.b2PolygonShape,n=new a,r=_._malloc(8*t.length);let s=0;for(let e=0;e>2]=t[e].get_x(),_.HEAPF32[r+(s+4)>>2]=t[e].get_y(),s+=8;const l=_.wrapPointer(r,_.b2Vec2);return n.Set(l,t.length),_._free(r),n}};const e=['fixed','variable'];self.IPhysicsBehavior=class extends IBehavior{constructor(e){super(e),u=e}set worldGravity(e){u.SetGravity(e)}get worldGravity(){return u.GetGravity()}set steppingMode(t){const a=e.indexOf(t);if(0>a)throw new Error('invalid stepping mode');u.SetSteppingMode(e[a])}get steppingMode(){return e[u.GetSteppingMode()]}set velocityIterations(e){u.SetVelocityIterations(e)}get velocityIterations(){return u.GetVelocityIterations()}set positionIterations(e){u.SetPositionIterations(e)}get positionIterations(){return u.GetPositionIterations()}setCollisionsEnabled(t,a,r){const s=n(t),e=n(a);r=!!r,u.SetCollisionsEnabled(s,e,r)}}}'use strict',C3.Behaviors.Physics.Type=class extends C3.SDKBehaviorTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict';{function t(e,t){if(!(t instanceof IWorldInstance))throw new TypeError('expected IWorldInstance');const a=p.get(e),n=a.GetRuntime()._UnwrapScriptInterface(t);if(!n||!(n instanceof C3.Instance))throw new Error('invalid IInstance');return n}const n=new WeakMap,r=new WeakMap,s=new WeakMap,_=C3.Behaviors.Physics.GetTempVec2A,u=C3.Behaviors.Physics.GetTempVec2B;C3.Behaviors.Physics.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(t,a){super(t);const n=this.GetBehavior(),s=this.GetWorldInfo();this._box2d=n.GetBox2D(),this._world=n.GetWorld(),this._worldScale=n.GetWorldScale(),this._isImmovable=!1,this._collisionMask=0,this._preventRotation=!1,this._density=1,this._friction=.5,this._restitution=.2,this._linearDamping=0,this._angularDamping=.01,this._isBullet=!1,this._isEnabled=!0,this._body=null,this._fixtures=[],this._myJoints=[],this._myCreatedJoints=[],this._joiningMe=new Set,this._lastKnownX=s.GetX(),this._lastKnownY=s.GetY(),this._lastKnownAngle=s.GetAngle(),this._lastWidth=0,this._lastHeight=0,this._lastTickOverride=!1,this._recreateBody=!1,this._lastImageInfo=null,a&&(this._isImmovable=!!a[0],this._collisionMask=a[1],this._preventRotation=!!a[2],this._density=a[3],this._friction=a[4],this._restitution=a[5],this._linearDamping=a[6],this._angularDamping=a[7],this._isBullet=!!a[8],this._isEnabled=!!a[9]);const e=this._runtime.Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(e,'instancedestroy',e=>this._OnInstanceDestroyed(e.instance)),C3.Disposable.From(e,'afterload',()=>this._OnAfterLoad())),r.set(this._inst,this),this._isEnabled&&this._StartTicking()}PostCreate(){this._CreateBody(),this._lastImageInfo=this._inst.GetCurrentImageInfo()}Release(){this._DestroyMyJoints(),C3.clearArray(this._myCreatedJoints),this._joiningMe.clear(),this._body&&(this._DestroyFixtures(),this._world.DestroyBody(this._body),this._body=null),super.Release()}_CreateFixture(e){if(this._body){const t=this._body.CreateFixture(e);return this._fixtures.push(t),t}}_DestroyFixtures(){if(this._body){for(const e of this._fixtures)this._body.DestroyFixture(e);C3.clearArray(this._fixtures)}}_Destroy(e){this._box2d.destroy(e)}_CreateBody(){var t=Math.max,a=Math.abs;if(!this._isEnabled)return;const r=this._box2d.b2FixtureDef,s=this._box2d.b2BodyDef,e=this.GetWorldInfo();if(!this._body){const t=new s;t.set_type(this._isImmovable?0:2);const a=e.GetBoundingQuad();t.set_position(u(a.midX()*this._worldScale,a.midY()*this._worldScale)),t.set_angle(e.GetAngle()),t.set_fixedRotation(this._preventRotation),t.set_linearDamping(this._linearDamping),t.set_angularDamping(this._angularDamping),t.set_bullet(this._isBullet),this._body=this._world.CreateBody(t),this._Destroy(t),n.set(this._body,this)}this._DestroyFixtures();const _=new r;_.set_density(this._density),_.set_friction(this._friction),_.set_restitution(this._restitution);const d=e.HasOwnCollisionPoly();let c=this._collisionMask;d||this._inst.HasTilemap()||0!==c||(c=1);const g=t(a(e.GetWidth()),1),l=t(a(e.GetHeight()),1);0===c?this._inst.HasTilemap()?this._CreateTilemapFixtures(_):this._CreatePolygonFixture(_,g,l):1===c?this._CreateBoundingBoxFixture(_,g,l):this._CreateCircleFixture(_,g,l),this._lastWidth=e.GetWidth(),this._lastHeight=e.GetHeight(),this._Destroy(_)}_CreateBoundingBoxFixture(t,a,n){const r=this._box2d.b2PolygonShape,s=new r;s.SetAsBox(.5*(a*this._worldScale),.5*(n*this._worldScale)),t.set_shape(s),this._CreateFixture(t),this._Destroy(s)}_CreateCircleFixture(t,a,n){const r=this._box2d.b2CircleShape,s=new r;s.set_m_radius(.5*(Math.min(a,n)*this._worldScale)),t.set_shape(s),this._CreateFixture(t),this._Destroy(s)}_CreatePolygonFixture(t,a,r){const s=this.GetWorldInfo(),_=0>s.GetWidth(),e=0>s.GetHeight(),d=this._worldScale,u=s.GetAngle();0!==u&&(s.SetAngle(0),s.SetBboxChanged());const c=s.GetBoundingQuad(),g=c.midX()-s.GetX(),h=c.midY()-s.GetY();0!==u&&(s.SetAngle(u),s.SetBboxChanged());const l=s.GetCustomTransformedCollisionPoly(_?-a:a,e?-r:r,0),m=l.pointsArr(),n=m.length/2,f=[];for(let e=0;e1/30&&(n=1/30));const r=e.GetTickCountNoSave();if(r>t.GetLastUpdateTick()&&0this._SetEnabled(e)},{name:'behaviors.physics.properties.immovable.name',value:this._IsImmovable(),onedit:e=>this._SetImmovable(e)},{name:'behaviors.physics.properties.density.name',value:this._GetDensity(),onedit:e=>this._SetDensity(e)},{name:'behaviors.physics.properties.friction.name',value:this._GetFriction(),onedit:e=>this._SetFriction(e)},{name:'behaviors.physics.properties.elasticity.name',value:this._GetElasticity(),onedit:e=>this._SetElasticity(e)},{name:'behaviors.physics.properties.linear-damping.name',value:this._GetLinearDamping(),onedit:e=>this._SetLinearDamping(e)},{name:'behaviors.physics.properties.angular-damping.name',value:this._GetAngularDamping(),onedit:e=>this._SetAngularDamping(e)}];return this._isEnabled&&(e.push({name:'behaviors.physics.debugger.is-sleeping',value:this._IsSleeping()}),e.push({name:'behaviors.physics.debugger.velocity-x',value:this._GetVelocityX(),onedit:e=>this._SetVelocity(e,this._GetVelocityY())}),e.push({name:'behaviors.physics.debugger.velocity-y',value:this._GetVelocityY(),onedit:e=>this._SetVelocity(this._GetVelocityX(),e)}),e.push({name:'behaviors.physics.debugger.angular-velocity',value:C3.toDegrees(this._GetAngularVelocity()),onedit:e=>this._SetAngularVelocity(C3.toRadians(e))}),e.push({name:'behaviors.physics.debugger.mass',value:this._GetMass()})),[{title:'$'+this.GetBehaviorType().GetName(),properties:e}]}_ApplyForce(t,a,n){const[r,s]=this._GetInstImagePoint(n);this._DoApplyForce(t,a,r,s)}_ApplyForceToward(t,a,n,r){const[e,s]=this._GetInstImagePoint(r),l=C3.angleTo(e,s,a,n);this._DoApplyForce(Math.cos(l)*t,Math.sin(l)*t,e,s)}_ApplyForceAtAngle(t,n,r){const[a,s]=this._GetInstImagePoint(r);this._DoApplyForce(Math.cos(n)*t,Math.sin(n)*t,a,s)}_DoApplyForce(e,t,a,n){if(this._isEnabled){const r=this._worldScale;this._body.ApplyForce(_(e,t),u(a*r,n*r),!0)}}_ApplyImpulse(t,a,n){const[r,s]=this._GetInstImagePoint(n);this._DoApplyImpulse(t,a,r,s)}_ApplyImpulseToward(t,a,n,r){const[e,s]=this._GetInstImagePoint(r),l=C3.angleTo(e,s,a,n);this._DoApplyImpulse(Math.cos(l)*t,Math.sin(l)*t,e,s)}_ApplyImpulseAtAngle(t,n,r){const[a,s]=this._GetInstImagePoint(r);this._DoApplyImpulse(Math.cos(n)*t,Math.sin(n)*t,a,s)}_DoApplyImpulse(e,t,a,n){if(this._isEnabled){const r=this._worldScale;this._body.ApplyLinearImpulse(_(e,t),u(a*r,n*r),!0);const s=this.GetWorldInfo();this._lastKnownX=s.GetX(),this._lastKnownY=s.GetY(),this._lastTickOverride=!1}}_ApplyTorque(e){this._isEnabled&&this._body.ApplyTorque(e,!0)}_ApplyTorqueToAngle(e,t){const n=C3.angleClockwise(this.GetWorldInfo().GetAngle(),t)?-1:1;this._ApplyTorque(e*n)}_ApplyTorqueToPosition(t,n,r){const s=this.GetWorldInfo(),e=C3.angleTo(s.GetX(),s.GetY(),n,r),l=C3.angleClockwise(s.GetAngle(),e)?-1:1;this._ApplyForce(t*l)}_SetAngularVelocity(e){this._isEnabled&&(this._body.SetAngularVelocity(e),this._body.SetAwake(!0))}_GetAngularVelocity(){return this._isEnabled?this._body.GetAngularVelocity():0}_SetVelocity(e,t){if(this._isEnabled){const a=this._worldScale;this._body.SetLinearVelocity(_(e*a,t*a)),this._body.SetAwake(!0);const n=this.GetWorldInfo();this._lastKnownX=n.GetX(),this._lastKnownY=n.GetY(),this._lastTickOverride=!1}}_GetVelocity(){if(!this._isEnabled)return[0,0];const e=this._worldScale,t=this._body.GetLinearVelocity();return[t.get_x()/e,t.get_y()/e]}_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(e){if(this._isEnabled&&this._density!==e){this._density=e;for(const t of this._fixtures)t.SetDensity(e);this._body.ResetMassData()}}_GetDensity(){return this._isEnabled?this._density:0}_SetFriction(e){if(this._isEnabled&&this._friction!==e){this._friction=e;for(const t of this._fixtures)t.SetFriction(e);for(let e=this._body.GetContactList();this._box2d.getPointer(e);e=e.get_next()){const t=e.get_contact();t&&t.ResetFriction()}}}_GetFriction(){return this._isEnabled?this._friction:0}_SetElasticity(e){if(this._isEnabled&&this._restitution!==e){this._restitution=e;for(const t of this._fixtures)t.SetRestitution(e)}}_GetElasticity(){return this._isEnabled?this._restitution:0}_SetLinearDamping(e){this._isEnabled&&this._linearDamping!==e&&(this._linearDamping=e,this._body.SetLinearDamping(e))}_GetLinearDamping(){return this._isEnabled?this._linearDamping:0}_SetAngularDamping(e){this._isEnabled&&this._angularDamping!==e&&(this._angularDamping=e,this._body.SetAngularDamping(e))}_GetAngularDamping(){return this._isEnabled?this._angularDamping:0}_SetImmovable(e){this._isEnabled&&(e=!!e,this._isImmovable===e||(this._isImmovable=e,this._body.SetType(this._isImmovable?0:2),this._body.SetAwake(!0)))}_IsImmovable(){return this._isImmovable}_SetPreventRotate(e){this._isEnabled&&(e=!!e,this._preventRotation===e||(this._preventRotation=e,this._body.SetFixedRotation(this._preventRotation),this._body.SetAngularVelocity(0),this._body.SetAwake(!0)))}_IsPreventRotate(){return this._preventRotation}_SetBullet(e){this._isEnabled&&(e=!!e,this._isBullet===e||(this._isBullet=e,this._body.SetBullet(this._isBullet),this._body.SetAwake(!0)))}_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 e=this._body.GetPosition(),t=this._body.GetLocalCenter(),a=this._worldScale;return[(e.get_x()+t.get_x())/a,(e.get_y()+t.get_y())/a]}_IsSleeping(){return!!this._isEnabled&&!this._body.IsAwake()}GetScriptInterfaceClass(){return IPhysicsBehaviorInstance}};const p=new WeakMap;self.IPhysicsBehaviorInstance=class extends IBehaviorInstance{constructor(){super(),p.set(this,IBehaviorInstance._GetInitInst().GetSdkInstance())}get isEnabled(){return p.get(this)._IsEnabled()}set isEnabled(e){p.get(this)._SetEnabled(e)}applyForce(e,t,a=0){p.get(this)._ApplyForce(e,t,a)}applyForceTowardPosition(e,t,a,n=0){p.get(this)._ApplyForceToward(e,t,a,n)}applyForceAtAngle(e,t,n=0){p.get(this)._ApplyForceAtAngle(e,t,n)}applyImpulse(e,t,a=0){p.get(this)._ApplyImpulse(e,t,a)}applyImpulseTowardPosition(e,t,a,n=0){p.get(this)._ApplyImpulseToward(e,t,a,n)}applyImpulseAtAngle(e,t,n=0){p.get(this)._ApplyImpulseAtAngle(e,t,n)}applyTorque(e){p.get(this)._ApplyTorque(e)}applyTorqueToAngle(e,t){p.get(this)._ApplyTorqueToAngle(e,t)}applyTorqueToPosition(e,t,a){p.get(this)._ApplyTorqueToPosition(e,t,a)}set angularVelocity(e){p.get(this)._SetAngularVelocity(e)}get angularVelocity(){return p.get(this)._GetAngularVelocity()}setVelocity(e,t){p.get(this)._SetVelocity(e,t)}getVelocityX(){return p.get(this)._GetVelocityX()}getVelocityY(){return p.get(this)._GetVelocityY()}getVelocity(){return p.get(this)._GetVelocity()}set density(e){p.get(this)._SetDensity(e)}get density(){return p.get(this)._GetDensity()}set friction(e){p.get(this)._SetFriction(e)}get friction(){return p.get(this)._GetFriction()}set elasticity(e){p.get(this)._SetElasticity(e)}get elasticity(){return p.get(this)._GetElasticity()}set linearDamping(e){p.get(this)._SetLinearDamping(e)}get linearDamping(){return p.get(this)._GetLinearDamping()}set angularDamping(e){p.get(this)._SetAngularDamping(e)}get angularDamping(){return p.get(this)._GetAngularDamping()}set isImmovable(e){p.get(this)._SetImmovable(e)}get isImmovable(){return p.get(this)._IsImmovable()}set isPreventRotation(e){p.get(this)._SetPreventRotate(e)}get isPreventRotation(){return p.get(this)._IsPreventRotate()}set isBullet(e){p.get(this)._SetBullet(i)}get isBullet(){return p.get(this)._IsBullet()}get mass(){return p.get(this)._GetMass()}getCenterOfMassX(){return p.get(this)._GetCenterOfMassX()}getCenterOfMassY(){return p.get(this)._GetCenterOfMassY()}getCenterOfMass(){return p.get(this)._GetCenterOfMass()}get isSleeping(){return p.get(this)._IsSleeping()}createDistanceJoint(a,n,r,s,e){const l=t(this,n);p.get(this)._CreateDistanceJoint(a,l,r,s,e)}createRevoluteJoint(e,a){const n=t(this,a);p.get(this)._CreateRevoluteJoint(e,n)}createLimitedRevoluteJoint(a,n,r,s){const e=t(this,n);p.get(this)._CreateLimitedRevoluteJoint(a,e,r,s)}createPrismaticJoint(a,n,r,s,e,_,d,u,c){const l=t(this,n);p.get(this)._CreatePrismaticJoint(a,l,r,s,e,_,d,u,c)}removeAllJoints(){p.get(this)._RemoveJoints()}}}'use strict',C3.Behaviors.Physics.Cnds={IsSleeping(){return this._IsSleeping()},CompareVelocity(e,t,a){if(!this._isEnabled)return!1;let n=0;if(0===e)n=this._GetVelocityX();else if(1===e)n=this._GetVelocityY();else{const[e,t]=this._GetVelocity();n=Math.hypot(e,t)}return C3.compare(n,t,a)},CompareAngularVelocity(e,t){if(!this._isEnabled)return!1;const a=C3.toDegrees(this._GetAngularVelocity());return C3.compare(a,e,t)},CompareMass(e,t){if(!this._isEnabled)return!1;const a=this._GetMass();return C3.compare(a,e,t)},IsEnabled(){return this._IsEnabled()}},'use strict',C3.Behaviors.Physics.Acts={ApplyForce(e,t,a){this._ApplyForce(e,t,a)},ApplyForceToward(e,t,a,n){this._ApplyForceToward(e,t,a,n)},ApplyForceAtAngle(e,t,n){this._ApplyForceAtAngle(e,C3.toRadians(t),n)},ApplyImpulse(e,t,a){this._ApplyImpulse(e,t,a)},ApplyImpulseToward(e,t,a,n){this._ApplyImpulseToward(e,t,a,n)},ApplyImpulseAtAngle(e,t,n){this._ApplyImpulseAtAngle(e,C3.toRadians(t),n)},ApplyTorque(e){this._ApplyTorque(C3.toRadians(e))},ApplyTorqueToAngle(e,t){this._ApplyTorqueToAngle(C3.toRadians(e),C3.toRadians(t))},ApplyTorqueToPosition(e,t,a){this._ApplyTorqueToPosition(C3.toRadians(e),t,a)},SetAngularVelocity(e){this._SetAngularVelocity(C3.toRadians(e))},CreateDistanceJoint(t,a,n,r,s){if(a){const e=a.GetFirstPicked(this._inst);this._CreateDistanceJoint(t,e,n,r,s)}},CreateRevoluteJoint(e,t){if(t){const a=t.GetFirstPicked(this._inst);this._CreateRevoluteJoint(e,a)}},CreateLimitedRevoluteJoint(t,a,n,r){if(a){const s=a.GetFirstPicked(this._inst);this._CreateLimitedRevoluteJoint(t,s,C3.toRadians(n),C3.toRadians(r))}},CreatePrismaticJoint(t,a,n,r,s,e,l,_,d){if(a){const u=a.GetFirstPicked(this._inst);this._CreatePrismaticJoint(t,u,C3.toRadians(n),r,s,e,l,C3.toRadians(_),d)}},RemoveJoints(){this._RemoveJoints()},SetWorldGravity(e){this.GetBehavior().SetGravity(e)},SetSteppingMode(e){this.GetBehavior().SetSteppingMode(e)},SetIterations(e,t){this.GetBehavior().SetIterations(e,t)},SetVelocity(e,t){this._SetVelocity(e,t)},SetDensity(e){this._SetDensity(e)},SetFriction(e){this._SetFriction(e)},SetElasticity(e){this._SetElasticity(e)},SetLinearDamping(e){this._SetLinearDamping(e)},SetAngularDamping(e){this._SetAngularDamping(e)},SetImmovable(e){this._SetImmovable(e)},EnableCollisions(e,t){this.GetBehavior().SetCollisionsEnabled(this.GetObjectClass(),e,0!==t)},SetPreventRotate(e){this._SetPreventRotate(0!==e)},SetBullet(e){this._SetBullet(0!==e)},SetEnabled(e){this._SetEnabled(0!==e)}},'use strict',C3.Behaviors.Physics.Exps={VelocityX(){return this._GetVelocityX()},VelocityY(){return this._GetVelocityY()},AngularVelocity(){return C3.toDegrees(this._GetAngularVelocity())},Mass(){return this._GetMass()},CenterOfMassX(){return this._GetCenterOfMassX()},CenterOfMassY(){return this._GetCenterOfMassY()},Density(){return this._GetDensity()},Friction(){return this._GetFriction()},Elasticity(){return this._GetElasticity()},LinearDamping(){return this._GetLinearDamping()},AngularDamping(){return this._GetAngularDamping()}},'use strict';{function t(e){return u(e.get_x(),e.get_y())}function n(e){const t=[];for(const a of e)8>=a.length?t.push(a):t.push.apply(t,r(a));return t}function r(a){const n=[a.splice(0,8)],r=n[0][0];for(let s=n[0][7];a.length;){const e=a.splice(0,Math.min(a.length,6));let l=e[e.length-1];e.push(t(r)),e.push(t(s)),n.push(e),s=l}return n}const _={};C3.Behaviors.Physics.Separator=_;const u=C3.Behaviors.Physics.GetVec2,e=C3.Behaviors.Physics.FreeVec2;_.det=function(t,a,n,r,s,e){return t*r+n*e+s*a-a*n-r*s-e*t},_.hitRay=function(e,t,d,c,g,h,f,y){const S=d-e,l=c-t,m=f-g,n=y-h,G=(m*(h-t)-n*(g-e))/(l*m-S*n),p=e+G*S,a=t+G*l,I=_.isOnSegment(d,c,e,t,p,a),r=_.isOnSegment(p,a,g,h,f,y);return I&&r?u(p,a):null},_.isOnSegment=function(e,t,a,n,r,s){return(a+.1>=e&&e>=r-.1||a-.1<=e&&e<=r+.1)&&(n+.1>=t&&t>=s-.1||n-.1<=t&&t<=s+.1)&&_.isOnLine(e,t,a,n,r,s)},_.isOnLine=function(t,a,n,r,s,e){var l=Math.abs;if(.1_}return .1>l(t-n)},_.pointsMatch=function(t,a,n,r){var s=Math.abs;return .1>s(n-t)&&.1>s(r-a)},_.Separate=function(t,r){const s=_.calcShapes(t);let l=[];for(let n=0,a=s.length;n=.001*r)l.push(_);else for(let t=0,a=_.length;tT){for(J=!1,O=1e9,I=0;IX||X>=G)return[];_.isOnSegment(ae.get_x(),ae.get_y(),a[X].get_x(),a[X].get_y(),Z.get_x(),Z.get_y())||Y.push(a[H]);break}X=H,0>H-1?H=G-1:H--}for(Y.reverse(),X=-1,H=W;;){if(H!=N)K.push(a[H]);else{if(0>X||X>=G)return[];H!=N||_.isOnSegment(te.get_x(),te.get_y(),a[X].get_x(),a[X].get_y(),$.get_x(),$.get_y())||K.push(a[H]);break}X=H,H+1>G-1?H=0:H++}D.push(Y,K),D.shift();break}J&&Q.push(D.shift())}return Q}}'use strict',C3.Behaviors.Timer=class extends C3.SDKBehaviorBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Behaviors.Timer.Type=class extends C3.SDKBehaviorTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict',C3.Behaviors.Timer.SingleTimer=class{constructor(e,t,a,n){this._current=C3.New(C3.KahanSum),this._current.Set(e||0),this._total=C3.New(C3.KahanSum),this._total.Set(t||0),this._duration=a||0,this._isRegular=!!n,this._isPaused=!1}GetCurrentTime(){return this._current.Get()}GetTotalTime(){return this._total.Get()}GetDuration(){return this._duration}SetPaused(e){this._isPaused=!!e}IsPaused(){return this._isPaused}Add(e){this._current.Add(e),this._total.Add(e)}HasFinished(){return this._current.Get()>=this._duration}Update(){if(this.HasFinished())if(this._isRegular)this._current.Subtract(this._duration);else return!0;return!1}SaveToJson(){return{c:this._current.Get(),t:this._total.Get(),d:this._duration,r:this._isRegular,p:this._isPaused}}LoadFromJson(e){this._current.Set(e.c),this._total.Set(e.t),this._duration=e.d,this._isRegular=!!e.r,this._isPaused=!!e.p}},C3.Behaviors.Timer.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(e){super(e),this._timers=new Map}Release(){this._timers.clear(),super.Release()}_UpdateTickState(){0({name:'$'+t[0],value:`${e(10*t[1].GetCurrentTime())/10} / ${e(10*t[1].GetDuration())/10}`}))}]}},'use strict',C3.Behaviors.Timer.Cnds={OnTimer(e){const t=this._timers.get(e.toLowerCase());return!!t&&t.HasFinished()},IsTimerRunning(e){return this._timers.has(e.toLowerCase())},IsTimerPaused(e){const t=this._timers.get(e.toLowerCase());return t&&t.IsPaused()}},'use strict',C3.Behaviors.Timer.Acts={StartTimer(e,t,a){const n=new C3.Behaviors.Timer.SingleTimer(0,0,e,1===t);this._timers.set(a.toLowerCase(),n),this._UpdateTickState()},StopTimer(e){this._timers.delete(e.toLowerCase()),this._UpdateTickState()},PauseResumeTimer(e,t){const a=this._timers.get(e.toLowerCase());a&&a.SetPaused(0===t)}},'use strict',C3.Behaviors.Timer.Exps={CurrentTime(e){const t=this._timers.get(e.toLowerCase());return t?t.GetCurrentTime():0},TotalTime(e){const t=this._timers.get(e.toLowerCase());return t?t.GetTotalTime():0},Duration(e){const t=this._timers.get(e.toLowerCase());return t?t.GetDuration():0}},'use strict',C3.Behaviors.Sin=class extends C3.SDKBehaviorBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Behaviors.Sin.Type=class extends C3.SDKBehaviorTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict';{const t=2*Math.PI,a=Math.PI/2,n=3*Math.PI/2,e=[0,1,8,3,4,2,5,6,9,7];C3.Behaviors.Sin.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(a,n){super(a),this._i=0,this._movement=0,this._wave=0,this._period=0,this._mag=0,this._isEnabled=!0,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,n&&(this._movement=e[n[0]],this._wave=n[1],this._periodRandom=this._runtime.Random()*n[3],this._basePeriod=n[2],this._period=n[2],this._period+=this._periodRandom,this._basePeriodOffset=n[4],0!==this._period&&(this._periodOffsetRandom=this._runtime.Random()*n[5],this._i=n[4]/this._period*t,this._i+=this._periodOffsetRandom/this._period*t),this._magnitudeRandom=this._runtime.Random()*n[7],this._baseMag=n[6],this._mag=n[6],this._mag+=this._magnitudeRandom,this._isEnabled=!!n[8]),5===this._movement&&(this._mag=C3.toRadians(this._mag)),this.Init(),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(e){this._i=e.i,this._SetEnabled(e.e),this._movement=e.mv,this._wave=e.w,this._period=e.p,this._mag=e.mag,this._initialValue=e.iv,this._initialValue2=e.iv2,this._ratio=e.r,this._lastKnownValue=e.lkv,this._lastKnownValue2=e.lkv2}Init(){const e=this._inst.GetWorldInfo();switch(this._movement){case 0:this._initialValue=e.GetX();break;case 1:this._initialValue=e.GetY();break;case 2:this._initialValue=e.GetWidth(),this._ratio=e.GetHeight()/e.GetWidth();break;case 3:this._initialValue=e.GetWidth();break;case 4:this._initialValue=e.GetHeight();break;case 5:this._initialValue=e.GetAngle();break;case 6:this._initialValue=e.GetOpacity();break;case 7:this._initialValue=0;break;case 8:this._initialValue=e.GetX(),this._initialValue2=e.GetY();break;case 9:this._initialValue=e.GetZElevation();break;default:;}this._lastKnownValue=this._initialValue,this._lastKnownValue2=this._initialValue2}WaveFunc(r){var s=Math.PI;switch(r%=t,this._wave){case 0:return Math.sin(r);case 1:return r<=a?r/a:r<=n?1-2*(r-a)/s:(r-n)/a-1;case 2:return 2*r/t-1;case 3:return-2*r/t+1;case 4:return rthis._SetEnabled(e)},{name:'behaviors.sin.properties.period.name',value:this._period,onedit:e=>this._period=e},{name:'behaviors.sin.properties.magnitude.name',value:this._mag,onedit:e=>this._mag=e},{name:'behaviors.sin.debugger.value',value:this.WaveFunc(this._i)*this._mag}]}]}}}'use strict',C3.Behaviors.Sin.Cnds={IsEnabled(){return this._isEnabled},CompareMovement(e){return this._movement===e},ComparePeriod(e,t){return C3.compare(this._period,e,t)},CompareMagnitude(e,t){return 5===this._movement?C3.compare(this._mag,e,C3.toRadians(t)):C3.compare(this._mag,e,t)},CompareWave(e){return this._wave===e}},'use strict',C3.Behaviors.Sin.Acts={SetEnabled(e){this._SetEnabled(0!==e)},SetPeriod(e){this._period=e},SetMagnitude(e){this._mag=e,5===this._movement&&(this._mag=C3.toRadians(this._mag))},SetMovement(e){5===this._movement&&5!==e&&(this._mag=C3.toDegrees(this._mag)),this._movement=e,this.Init()},SetWave(e){this._wave=e},SetPhase(e){const t=2*Math.PI;this._i=e*t%t,this._UpdateFromPhase()},UpdateInitialState(){this.Init()}},'use strict',C3.Behaviors.Sin.Exps={CyclePosition(){return this._i/(2*Math.PI)},Period(){return this._period},Magnitude(){return 5===this._movement?C3.toDegrees(this._mag):this._mag},Value(){return this.WaveFunc(this._i)*this._mag}},'use strict',C3.Behaviors.custom=class extends C3.SDKBehaviorBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Behaviors.custom.Type=class extends C3.SDKBehaviorTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict',C3.Behaviors.custom.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(e,t){super(e),this._dx=0,this._dy=0,this._cancelStep=0,this._stepMode=0,this._pxPerStep=5,this._isEnabled=!0,t&&(this._stepMode=t[0],this._pxPerStep=t[1],this._isEnabled=t[2]),this._isEnabled&&this._StartTicking()}Release(){super.Release()}SaveToJson(){return{dx:this._dx,dy:this._dy,cs:this._cancelStep,sm:this._stepMode,px:this._pxPerStep,e:this._isEnabled}}LoadFromJson(e){this._dx=e.dx,this._dy=e.dy,this._cancelStep=e.cs,this._stepMode=e.sm,this._pxPerStep=e.px,this._SetEnabled(e.e)}GetSpeed(){return Math.sqrt(this._dx*this._dx+this._dy*this._dy)}GetAngle(){return Math.atan2(this._dy,this._dx)}_Step(t,a,n){if(0===t&&0===a)return;const r=this.GetWorldInfo(),s=r.GetX(),e=r.GetY();let l=Math.round(Math.sqrt(t*t+a*a)/this._pxPerStep);0===l&&(l=1);for(let _=1,d;_<=l;++_){if(d=_/l,r.SetXY(s+t*d,e+a*d),r.SetBboxChanged(),this.Trigger(n),1===this._cancelStep)return _--,d=_/l,r.SetXY(s+t*d,e+a*d),void r.SetBboxChanged();if(2===this._cancelStep)return}}Tick(){if(this._isEnabled&&(0!==this._dx||0!==this._dy)){const e=this._inst.GetWorldInfo(),t=this._runtime.GetDt(this._inst),a=this._dx*t,n=this._dy*t;this._cancelStep=0,0===this._stepMode?(e.OffsetXY(a,n),e.SetBboxChanged()):1===this._stepMode?this._Step(a,n,C3.Behaviors.custom.Cnds.OnCMStep):2===this._stepMode?(this._Step(a,0,C3.Behaviors.custom.Cnds.OnCMHorizStep),this._cancelStep=0,this._Step(0,n,C3.Behaviors.custom.Cnds.OnCMVertStep)):3===this._stepMode&&(this._Step(0,n,C3.Behaviors.custom.Cnds.OnCMVertStep),this._cancelStep=0,this._Step(a,0,C3.Behaviors.custom.Cnds.OnCMHorizStep))}}GetPropertyValueByIndex(e){return 0===e?this._stepMode:1===e?this._pxPerStep:2===e?this._isEnabled:void 0}SetPropertyValueByIndex(e,t){0===e?this._stepMode=t:1===e?this._pxPerStep=t:2===e?this._SetEnabled(t):void 0}_SetEnabled(e){this._isEnabled=!!e,this._isEnabled?this._StartTicking():this._StopTicking()}GetDebuggerProperties(){return[{title:'$'+this.GetBehaviorType().GetName(),properties:[{name:'behaviors.custom.debugger.vector-x',value:this._dx,onedit:e=>this._dx=e},{name:'behaviors.custom.debugger.vector-y',value:this._dy,onedit:e=>this._dy=e},{name:'behaviors.custom.properties.pixels-per-step.name',value:this._pxPerStep,onedit:e=>this._pxPerStep=e},{name:'behaviors.custom.properties.enabled.name',value:this._isEnabled,onedit:e=>this._SetEnabled(e)}]}]}},'use strict',C3.Behaviors.custom.Cnds={IsMoving(){return 0!==this._dx||0!==this._dy},CompareSpeed(e,t,a){let n=0;return 0===e?n=this.GetSpeed():1===e?n=this._dx:2===e?n=this._dy:void 0,C3.compare(n,t,a)},OnCMStep(){return!0},OnCMHorizStep(){return!0},OnCMVertStep(){return!0},IsEnabled(){return this._isEnabled}},'use strict',C3.Behaviors.custom.Acts={Stop(){this._dx=0,this._dy=0},Reverse(e){0===e?(this._dx*=-1,this._dy*=-1):1===e?this._dx*=-1:2===e?this._dy*=-1:void 0},SetSpeed(e,t){let a=0;0===e?(a=this.GetAngle(),this._dx=Math.cos(a)*t,this._dy=Math.sin(a)*t):1===e?this._dx=t:2===e?this._dy=t:void 0},Accelerate(t,a){const n=this._runtime.GetDt(this._inst),r=a*n;let e;0===t?(e=this.GetAngle(),this._dx+=Math.cos(e)*r,this._dy+=Math.sin(e)*r):1===t?this._dx+=r:2===t?this._dy+=r:void 0},AccelerateAngle(e,t){t=C3.toRadians(t);const n=this._runtime.GetDt(this._inst),a=e*n;this._dx+=Math.cos(t)*a,this._dy+=Math.sin(t)*a},AcceleratePos(t,a,n){const r=this.GetWorldInfo(),e=this._runtime.GetDt(this._inst),s=t*e,l=Math.atan2(n-r.GetY(),a-r.GetX());this._dx+=Math.cos(l)*s,this._dy+=Math.sin(l)*s},SetAngleOfMotion(e){e=C3.toRadians(e);const t=this.GetSpeed();this._dx=Math.cos(e)*t,this._dy=Math.sin(e)*t},RotateAngleOfMotionClockwise(e){e=this.GetAngle()+C3.toRadians(e);const t=this.GetSpeed();this._dx=Math.cos(e)*t,this._dy=Math.sin(e)*t},RotateAngleOfMotionCounterClockwise(e){e=this.GetAngle()-C3.toRadians(e);const t=this.GetSpeed();this._dx=Math.cos(e)*t,this._dy=Math.sin(e)*t},StopStepping(e){this._cancelStep=e+1},PushOutSolid(t){var n=Math.abs,r=Math.max;let s,l,_;const d=this._inst,u=this.GetRuntime().GetCollisionEngine();0===t?(s=this.GetAngle(),l=Math.cos(s),_=Math.sin(s),u.PushOutSolid(d,-l,-_,r(3*this.GetSpeed(),100))):1===t?u.PushOutSolidNearest(d):2===t?u.PushOutSolid(d,0,-1,r(3*n(this._dy),100)):3===t?u.PushOutSolid(d,0,1,r(3*n(this._dy),100)):4===t?u.PushOutSolid(d,-1,0,r(3*n(this._dx),100)):5===t?u.PushOutSolid(d,1,0,r(3*n(this._dx),100)):void 0},PushOutSolidAngle(e){e=C3.toRadians(e);const t=Math.cos(e),a=Math.sin(e);this.GetRuntime().GetCollisionEngine().PushOutSolid(this._inst,t,a,Math.max(3*this.GetSpeed(),100))},SetEnabled(e){this._SetEnabled(e)}},'use strict',C3.Behaviors.custom.Exps={Speed(){return this.GetSpeed()},MovingAngle(){return C3.toDegrees(this.GetAngle())},dx(){return this._dx},dy(){return this._dy}},'use strict',C3.Behaviors.Pin=class extends C3.SDKBehaviorBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Behaviors.Pin.Type=class extends C3.SDKBehaviorTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict',C3.Behaviors.Pin.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(e,t){super(e),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=!1,t&&(this._destroy=t[0]);const a=this._runtime.Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(a,'instancedestroy',e=>this._OnInstanceDestroyed(e.instance)),C3.Disposable.From(a,'afterload',()=>this._OnAfterLoad()))}Release(){this._pinInst=null,super.Release()}_SetPinInst(e){e?(this._pinInst=e,this._StartTicking2()):(this._pinInst=null,this._StopTicking2())}_Pin(e,t,n){if(e){const r=e.GetFirstPicked(this._inst);if(r){this._mode=t,this._SetPinInst(r);const s=this._inst.GetWorldInfo(),a=r.GetWorldInfo();if('properties'===this._mode){const e=this._propSet;e.clear();for(const t of n)e.add(t);this._dx=s.GetX()-a.GetX(),this._dy=s.GetY()-a.GetY(),this._dAngle=s.GetAngle()-a.GetAngle(),this._lastKnownAngle=s.GetAngle(),this._dz=s.GetZElevation()-a.GetZElevation(),e.has('x')&&e.has('y')&&(this._pinAngle=C3.angleTo(a.GetX(),a.GetY(),s.GetX(),s.GetY())-a.GetAngle(),this._pinDist=C3.distanceTo(a.GetX(),a.GetY(),s.GetX(),s.GetY())),e.has('width-abs')?this._dWidth=s.GetWidth()-a.GetWidth():e.has('width-scale')&&(this._dWidth=s.GetWidth()/a.GetWidth()),e.has('height-abs')?this._dHeight=s.GetHeight()-a.GetHeight():e.has('height-scale')&&(this._dHeight=s.GetHeight()/a.GetHeight())}else this._pinDist=C3.distanceTo(a.GetX(),a.GetY(),s.GetX(),s.GetY())}}}SaveToJson(){const e=this._propSet,t=this._mode,a={uid:this._pinInst?this._pinInst.GetUID():-1,m:t};return'rope'===t||'bar'===t?a.pd=this._pinDist:'properties'===t&&(a.ps=[...this._propSet],e.has('imagepoint')?a.ip=this._pinImagePoint:e.has('x')&&e.has('y')?(a.pa=this._pinAngle,a.pd=this._pinDist):(e.has('x')&&(a.dx=this._dx),e.has('y')&&(a.dy=this._dy)),e.has('angle')&&(a.da=this._dAngle,a.lka=this._lastKnownAngle),(e.has('width-abs')||e.has('width-scale'))&&(a.dw=this._dWidth),(e.has('height-abs')||e.has('height-scale'))&&(a.dh=this._dHeight),e.has('z')&&(a.dz=this._dz)),a}LoadFromJson(e){const t=e.m,a=this._propSet;if(a.clear(),this._pinUid=e.uid,'number'==typeof t)return void this._LoadFromJson_Legacy(e);if(this._mode=t,'rope'===t||'bar'===t)this._pinDist=e.pd;else if('properties'===t){for(const t of e.ps)a.add(t);a.has('imagepoint')?this._pinImagePoint=e.ip:a.has('x')&&a.has('y')?(this._pinAngle=e.pa,this._pinDist=e.pd):(a.has('x')&&(this._dx=e.dx),a.has('y')&&(this._dy=e.dy)),a.has('angle')&&(this._dAngle=e.da,this._lastKnownAngle=e.lka||0),(a.has('width-abs')||a.has('width-scale'))&&(this._dWidth=e.dw),(a.has('height-abs')||a.has('height-scale'))&&(this._dHeight=e.dh),a.has('z')&&(this._dz=e.dz)}}_LoadFromJson_Legacy(t){const a=this._propSet,n=t.msa,r=t.tsa,s=t.pa,e=t.pd,l=t.m;0===l?(this._mode='properties',a.add('x').add('y').add('angle'),this._pinAngle=s,this._pinDist=e,this._dAngle=n-r,this._lastKnownAngle=t.lka):1===l?(this._mode='properties',a.add('x').add('y'),this._pinAngle=s,this._pinDist=e):2===l?(this._mode='properties',a.add('angle'),this._dAngle=n-r,this._lastKnownAngle=t.lka):3===l?(this._mode='rope',this._pinDist=t.pd):4===l?(this._mode='bar',this._pinDist=t.pd):void 0}_OnAfterLoad(){-1===this._pinUid?this._SetPinInst(null):(this._SetPinInst(this._runtime.GetInstanceByUID(this._pinUid)),this._pinUid=-1)}_OnInstanceDestroyed(e){this._pinInst===e&&(this._SetPinInst(null),this._destroy&&this._runtime.DestroyInstance(this._inst))}Tick2(){var t=Math.sin,n=Math.cos;const r=this._pinInst;if(!r)return;const s=r.GetWorldInfo(),a=this._inst,l=a.GetWorldInfo(),e=this._mode;let _=!1;if('rope'===e||'bar'===e){const r=C3.distanceTo(l.GetX(),l.GetY(),s.GetX(),s.GetY());if(r>this._pinDist||'bar'===e&&r=this._maxOpacity&&(t.SetOpacity(this._maxOpacity),this._stage=1,this._stageTime.Reset(),this.Trigger(C3.Behaviors.Fade.Cnds.OnFadeInEnd))),1===this._stage&&this._stageTime.Get()>=this._waitTime&&(this._stage=2,this._stageTime.Reset(),this.Trigger(C3.Behaviors.Fade.Cnds.OnWaitEnd)),2===this._stage&&0!==this._fadeOutTime&&(t.SetOpacity(this._maxOpacity-this._stageTime.Get()/this._fadeOutTime*this._maxOpacity),this._runtime.UpdateRender(),0>=t.GetOpacity()&&(this._stage=3,this._stageTime.Reset(),this.Trigger(C3.Behaviors.Fade.Cnds.OnFadeOutEnd),this._destroy&&this._runtime.DestroyInstance(this._inst)))}Start(){this._stage=0,this._stageTime.Reset(),0===this._fadeInTime?(this._stage=1,0===this._waitTime&&(this._stage=2)):(this._inst.GetWorldInfo().SetOpacity(0),this._runtime.UpdateRender())}GetPropertyValueByIndex(e){return 0===e?this._fadeInTime:1===e?this._waitTime:2===e?this._fadeOutTime:3===e?this._destroy:void 0}SetPropertyValueByIndex(e,t){0===e?this._fadeInTime=t:1===e?this._waitTime=t:2===e?this._fadeOutTime=t:3===e?this._destroy=!!t:void 0}GetDebuggerProperties(){return[{title:'$'+this.GetBehaviorType().GetName(),properties:[{name:'behaviors.fade.properties.fade-in-time.name',value:this._fadeInTime,onedit:e=>this._fadeInTime=e},{name:'behaviors.fade.properties.wait-time.name',value:this._waitTime,onedit:e=>this._waitTime=e},{name:'behaviors.fade.properties.fade-out-time.name',value:this._fadeOutTime,onedit:e=>this._fadeOutTime=e},{name:'behaviors.fade.debugger.stage',value:['behaviors.fade.debugger.'+['fade-in','wait','fade-out','done'][this._stage]]}]}]}},'use strict',C3.Behaviors.Fade.Cnds={OnFadeOutEnd(){return!0},OnFadeInEnd(){return!0},OnWaitEnd(){return!0}},'use strict',C3.Behaviors.Fade.Acts={StartFade(){this._activeAtStart||this._setMaxOpacity||(this._maxOpacity=this._inst.GetWorldInfo().GetOpacity()||1,this._setMaxOpacity=!0),3===this._stage&&this.Start()},RestartFade(){this.Start()},SetFadeInTime(e){0>e&&(e=0),this._fadeInTime=e},SetWaitTime(e){0>e&&(e=0),this._waitTime=e},SetFadeOutTime(e){0>e&&(e=0),this._fadeOutTime=e}},'use strict',C3.Behaviors.Fade.Exps={FadeInTime(){return this._fadeInTime},WaitTime(){return this._waitTime},FadeOutTime(){return this._fadeOutTime}},'use strict',self.C3_GetObjectRefTable=function(){return[C3.Plugins.Sprite,C3.Behaviors.scrollto,C3.Behaviors.Tween,C3.Behaviors.Physics,C3.Behaviors.Timer,C3.Behaviors.Sin,C3.Behaviors.custom,C3.Plugins.ValerypopoffTouchPlusPlugin,C3.Plugins.Touch,C3.Plugins.Spritefont2,C3.Behaviors.Pin,C3.Behaviors.Fade,C3.Plugins.Audio,C3.Plugins.LocalStorage,C3.Plugins.Keyboard,C3.Plugins.PlatformInfo,C3.Plugins.Browser,C3.Plugins.System.Cnds.OnLayoutStart,C3.Plugins.Sprite.Acts.Destroy,C3.Behaviors.Physics.Acts.SetWorldGravity,C3.Plugins.Sprite.Acts.SetY,C3.Plugins.Sprite.Acts.SetOpacity,C3.Plugins.Sprite.Acts.SetScale,C3.Behaviors.Pin.Acts.Pin,C3.Plugins.Spritefont2.Acts.SetOpacity,C3.Plugins.LocalStorage.Acts.CheckItemExists,C3.Behaviors.Tween.Acts.TweenOneProperty,C3.Plugins.System.Acts.Wait,C3.Behaviors.Tween.Acts.TweenTwoProperties,C3.Behaviors.Tween.Cnds.OnTweensFinished,C3.Behaviors.scrollto.Acts.Shake,C3.Plugins.System.Acts.SetBoolVar,C3.Behaviors.Sin.Acts.SetEnabled,C3.Plugins.System.Cnds.IsGroupActive,C3.Plugins.Touch.Cnds.IsInTouch,C3.Plugins.System.Cnds.TriggerOnce,C3.Plugins.System.Cnds.CompareBoolVar,C3.Plugins.System.Cnds.Compare,C3.Plugins.Touch.Exps.Y,C3.Plugins.Sprite.Exps.Y,C3.Plugins.Sprite.Cnds.CompareOpacity,C3.Plugins.Audio.Acts.Play,C3.Plugins.System.Cnds.Else,C3.Plugins.Browser.Acts.ExecJs,C3.Behaviors.Pin.Acts.Unpin,C3.Plugins.Sprite.Acts.SetAnimSpeed,C3.Behaviors.Timer.Acts.StartTimer,C3.Plugins.System.Acts.SetGroupActive,C3.Plugins.System.Acts.ResetGlobals,C3.Plugins.System.Acts.RestartLayout,C3.Behaviors.Timer.Cnds.OnTimer,C3.Plugins.Sprite.Cnds.IsBoolInstanceVarSet,C3.Plugins.Touch.Exps.X,C3.Plugins.Sprite.Exps.X,C3.Plugins.System.Cnds.ForEach,C3.Plugins.Sprite.Cnds.CompareX,C3.Plugins.System.Acts.StopLoop,C3.Plugins.Sprite.Cnds.PickDistance,C3.Plugins.Sprite.Acts.SetBoolInstanceVar,C3.Plugins.Sprite.Acts.SetAnim,C3.Plugins.System.Acts.SetVar,C3.Plugins.System.Acts.CreateObject,C3.Plugins.Sprite.Acts.SetAnimFrame,C3.Plugins.System.Exps.choose,C3.Plugins.Audio.Acts.PlayByName,C3.Plugins.Sprite.Exps.UID,C3.Plugins.Keyboard.Cnds.IsKeyDown,C3.Plugins.PlatformInfo.Cnds.IsOnMobile,C3.Plugins.Sprite.Cnds.CompareY,C3.Plugins.System.Exps.layoutheight,C3.Plugins.Sprite.Exps.Height,C3.Plugins.Sprite.Cnds.PickByUID,C3.Behaviors.custom.Acts.SetEnabled,C3.Behaviors.Physics.Acts.SetEnabled,C3.Behaviors.Physics.Acts.ApplyImpulse,C3.Plugins.System.Exps.random,C3.Behaviors.Physics.Acts.SetAngularVelocity,C3.Plugins.System.Acts.AddVar,C3.Plugins.Spritefont2.Acts.SetText,C3.Plugins.System.Exps.zeropad,C3.Plugins.Sprite.Cnds.IsAnimPlaying,C3.Plugins.System.Cnds.Every,C3.Plugins.Sprite.Acts.SetInstanceVar,C3.Plugins.System.Exps.layoutwidth,C3.Plugins.Sprite.Acts.SetMirrored,C3.Behaviors.custom.Acts.SetSpeed,C3.Plugins.System.Cnds.CompareBetween,C3.Plugins.Sprite.Cnds.OnCollision,C3.Plugins.System.Cnds.CompareVar,C3.Plugins.LocalStorage.Acts.SetItem,C3.Plugins.Sprite.Cnds.CompareInstanceVar,C3.Plugins.System.Acts.SubVar,C3.Plugins.Sprite.Acts.SetPos,C3.Plugins.Sprite.Acts.SetAngle,C3.Plugins.Touch.Cnds.OnTouchObject,C3.Plugins.Audio.Cnds.IsSilent,C3.Plugins.Audio.Acts.SetSilent,C3.Plugins.LocalStorage.Cnds.OnItemMissing,C3.Plugins.LocalStorage.Cnds.OnItemExists,C3.Plugins.LocalStorage.Exps.ItemValue,C3.Plugins.Audio.Cnds.IsTagPlaying,C3.Plugins.System.Acts.GoToLayout]},self.C3_JsPropNameTable=[{bg_cielo:0},{ScrollTo:0},{camera:0},{terreno:0},{laterali:0},{morto:0},{canShoot:0},{Tween:0},{Physics:0},{Timer:0},{albano_front_a:0},{Sine:0},{nuvoletta:0},{bg_vulcano:0},{bg_monti:0},{velocita:0},{animation:0},{killer:0},{Custom:0},{dino_trex_a:0},{ValerypopoffTouchPlus:0},{Touch:0},{Pin:0},{SCORE:0},{n:0},{entrataX:0},{uscitaX:0},{hud_vita:0},{Fade:0},{Nota:0},{txt_loading:0},{BlackTransition:0},{top_verde:0},{logo_ALBANO:0},{logo_VS:0},{logo_dinos:0},{al_bano_home_vert_titolo_home:0},{txt_taptostart:0},{credits:0},{btn_audio_on:0},{Audio:0},{txt_score:0},{txt_bestscore:0},{SCORE2:0},{LocalStorage:0},{gameover:0},{Keyboard:0},{PlatformInfo:0},{Browser:0},{platSini:0},{platDes:0},{TUTORIALSCREEN:0},{start:0},{canClickStart:0},{attacco:0},{score:0},{gameOver:0},{vita:0},{topScore:0},{tempoSpawnNemici:0},{velocitaNemici:0},{uidDino:0}],'use strict';{function e(e,t){var a=Math.round;if('string'==typeof e||'string'==typeof t){let n,r;return n='number'==typeof e?(a(1e10*e)/1e10).toString():e,r='number'==typeof t?(a(1e10*t)/1e10).toString():t,n+r}return e&&t?1:0}self.C3_ExpressionFuncs=[()=>25,()=>675,()=>0,()=>4,()=>'topScore',()=>'entrataInScena',()=>.3,()=>.6,()=>'entrataOpac',()=>100,()=>'sizeOn',()=>520,()=>260,()=>.5,()=>.2,()=>.1,()=>30,()=>.4,()=>'entrataY',()=>'opacIn',()=>'entrata',()=>'entrataSize',()=>88,()=>96,()=>'First Click',e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t()},e=>{const t=e._GetNode(0);return()=>t.ExpObject()-50},()=>10,()=>'restart',()=>'',()=>'gtag(\'event\', \'Click\', {\'event_category\': \'Partita\', \'event_label\': \'Play\'});',()=>'uscita',()=>'scaleOut',()=>649,()=>324,()=>'opacOut',()=>'spostamento',()=>399,()=>389,()=>'opacVia',e=>{const t=e._GetNode(0);return()=>t.ExpInstVar()},()=>'entrataStart',()=>535,()=>1,()=>'ENTRATA',()=>2.5,()=>'Attacco',e=>{const t=e._GetNode(0);return()=>t.ExpObject()},()=>'gtag(\'event\', \'Click\', {\'event_category\': \'Tocco\', \'event_label\': \'Note cantate\'});',e=>{const t=e._GetNode(0),a=e._GetNode(1),n=e._GetNode(2),r=e._GetNode(3);return()=>C3.distanceTo(t.ExpObject(),a.ExpObject(),n.ExpObject(),r.ExpObject())},()=>150,()=>'attackRight',()=>'right',()=>'ogg',e=>{const t=e._GetNode(0);return()=>t.ExpObject()+150},()=>1.5,e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(0,1,2)},()=>5,t=>{const a=t._GetNode(0).GetBoundMethod();return()=>e('Acuto-',a(1,2))},()=>'idle',()=>'attackRightNota',()=>'attackLeft',()=>'left',e=>{const t=e._GetNode(0);return()=>t.ExpObject()-150},()=>'attackLeftNota',e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1);return()=>t()+a.ExpObject()},()=>-300,()=>950,e=>{const t=e._GetNode(0).GetVar();return()=>t.GetValue()},()=>'gtag(\'event\', \'Click\', {\'event_category\': \'Tocco\', \'event_label\': \'Dinosauri Eliminati\'});',t=>{const a=t._GetNode(0);return()=>e('morte',a.ExpInstVar())},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(-50,-30)},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(-40,40)},()=>6,e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetVar();return()=>t(a.GetValue(),6)},()=>'Spawn Nemici',e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(-75,700)},()=>607,e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(1,2,3)},t=>{const a=t._GetNode(0);return()=>e('camminata',a.ExpInstVar())},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t()/2},e=>{const t=e._GetNode(0);return()=>-t.ExpInstVar()},()=>180,()=>200,()=>.9,()=>190,()=>400,()=>.8,()=>.7,()=>205,()=>'Morte',()=>'morte',()=>20,()=>-50,()=>-20,()=>2,()=>448,()=>220,()=>404,()=>244,()=>250,()=>676,()=>'Audio',()=>94,()=>103,()=>'menu',()=>-5,()=>'goToNext']}{self.C3.ScriptsInEvents={}} \ No newline at end of file diff --git a/shuttlestudio.it/giochi/albanovsdinos/scripts/dispatchworker.js b/shuttlestudio.it/giochi/albanovsdinos/scripts/dispatchworker.js new file mode 100644 index 0000000..8f92f7b --- /dev/null +++ b/shuttlestudio.it/giochi/albanovsdinos/scripts/dispatchworker.js @@ -0,0 +1 @@ +"use strict";self.inputPort=null,self.jobQueue=[],self.jobWorkers=[],self.sentBlobs=[],self.sentBuffers=[],self.importedScripts=[],self.lastBroadcasts=new Map;class JobWorker{constructor(a,b){this._port=a,this._number=b,this._isReady=!1,this._isBusy=!1,this._port.onmessage=(a)=>this._OnMessage(a.data)}ImportScripts(a){this._port.postMessage({"type":"_import_scripts","scripts":a})}SendBlob(a,b){this._port.postMessage({"type":"_send_blob","blob":a,"id":b})}SendBuffer(a,b){this._port.postMessage({"type":"_send_buffer","buffer":a,"id":b})}SendJob(a){if(this._isBusy||!this._isReady)throw new Error("cannot take job");this._isBusy=!0,this._port.postMessage(a,a["transferables"])}_InitBroadcast(a){this._port.postMessage(a,a["transferables"])}SendReady(){this._port.postMessage({"type":"_ready"})}IsReady(){return this._isReady}_OnReady(){this._isReady=!0,this.MaybeStartNextJob()}IsBusy(){return this._isBusy}GetNumber(){return this._number}_OnMessage(a){const b=a["type"];return"ready"===b?void this._OnReady():"done"===b?void this._OnJobDone():void console.error("unknown message from worker '"+b+"'")}_OnJobDone(){this._isBusy=!1,this.MaybeStartNextJob()}MaybeStartNextJob(){if(!this._isBusy&&this._isReady){const a=this._FindAvailableJob();if(-1!==a){const b=self.jobQueue[a],c=b["isBroadcast"];c?(b["doneFlags"][this._number]=!0,b["doneFlags"].every((a)=>a)&&self.jobQueue.splice(a,1)):self.jobQueue.splice(a,1),this.SendJob(b)}}}_FindAvailableJob(){for(let a=0,b=self.jobQueue.length;a{const b=a.data,c=b["type"];"_init"===c?(self.inputPort=b["in-port"],self.inputPort.onmessage=OnInputPortMessage):"_addJobWorker"===c&&AddJobWorker(b["port"])});function OnInputPortMessage(a){const b=a.data,c=b["type"];if("_cancel"===c)return void CancelJob(b.jobId);if("_import_scripts"===c){const a=b["scripts"];for(const b of self.jobWorkers)b.ImportScripts(a);return void self.importedScripts.push(a)}if("_send_blob"===c){const a=b["blob"],c=b["id"];for(const b of self.jobWorkers)b.SendBlob(a,c);return void self.sentBlobs.push([a,c])}if("_send_buffer"===c){const a=b["buffer"],c=b["id"];for(const b of self.jobWorkers)b.SendBuffer(a,c);return void self.sentBuffers.push([a,c])}if("_no_more_workers"===c)return self.sentBlobs.length=0,self.sentBuffers.length=0,self.importedScripts.length=0,void self.lastBroadcasts.clear();if("_testMessageChannel"===c)return void self.jobWorkers[0].TestMessageChannel();self.jobQueue.push(b),b["isBroadcast"]&&(b["doneFlags"]=Array(self.jobWorkers.length).fill(!1),b["transferables"]=[],self.lastBroadcasts.set(b["type"],b));for(const b of self.jobWorkers)b.MaybeStartNextJob()} \ No newline at end of file diff --git a/shuttlestudio.it/giochi/albanovsdinos/scripts/jobworker.js b/shuttlestudio.it/giochi/albanovsdinos/scripts/jobworker.js new file mode 100644 index 0000000..936a7ef --- /dev/null +++ b/shuttlestudio.it/giochi/albanovsdinos/scripts/jobworker.js @@ -0,0 +1 @@ +"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(a,b,c){const d=4*b,e=new Uint8Array(d),f=a.buffer;for(let g=0,h=Math.floor(c/2);g{const b=a.data,c=b["type"];return"init"===c?(self.workerNumber=b["number"],self.dispatchPort=b["dispatch-port"],self.dispatchPort.onmessage=OnDispatchWorkerMessage,void(self.outputPort=b["output-port"])):"terminate"===c?void self.close():void console.error("unknown message '"+c+"'")});function SendReady(){self.dispatchPort.postMessage({"type":"ready"}),self.outputPort.postMessage({"type":"ready"})}function SendError(a,b){a||self.outputPort.postMessage({"type":"error","jobId":self.activeJobId,"error":b.toString()}),SendDone()}function SendResult(a,b){if(!a){const a=b.transferables||[];self.outputPort.postMessage({"type":"result","jobId":self.activeJobId,"result":b.result},a)}SendDone()}function SendDone(){self.activeJobId=null,self.dispatchPort.postMessage({"type":"done"})}function SendProgress(a){self.outputPort.postMessage({"type":"progress","jobId":self.activeJobId,"progress":a})}function OnDispatchWorkerMessage(a){const b=a.data,c=b["type"];if("_import_scripts"===c)return void importScripts(...b["scripts"]);if("_send_blob"===c)return void self.sentBlobs.set(b["id"],b["blob"]);if("_send_buffer"===c)return void self.sentBuffers.set(b["id"],b["buffer"]);if("_testMessageChannel"===c)return void self.outputPort.postMessage({"type":"_testMessageChannelOk"});if("_ready"===c)return void SendReady();const d=b["jobId"],f=b["isBroadcast"],e=b["params"];let g;if(self.activeJobId=d,!self.JobHandlers.hasOwnProperty(c))return void console.error(`no handler for message type '${c}'`);try{g=self.JobHandlers[c](e)}catch(a){return void SendError(f,"Exception in job handler: "+a)}g&&g.then?g.then((a)=>SendResult(f,a)).catch((a)=>SendError(f,"Rejection in job handler: "+a)):SendResult(f,g)} \ No newline at end of file diff --git a/shuttlestudio.it/giochi/albanovsdinos/scripts/main.js b/shuttlestudio.it/giochi/albanovsdinos/scripts/main.js new file mode 100644 index 0000000..2fab82d --- /dev/null +++ b/shuttlestudio.it/giochi/albanovsdinos/scripts/main.js @@ -0,0 +1 @@ +"use strict";window.DOMHandler=class{constructor(e,t){this._iRuntime=e,this._componentId=t,this._hasTickCallback=!1,this._tickCallback=()=>this.Tick()}Attach(){}PostToRuntime(e,t,n,a){this._iRuntime.PostToRuntimeComponent(this._componentId,e,t,n,a)}PostToRuntimeAsync(e,t,n,a){return this._iRuntime.PostToRuntimeComponentAsync(this._componentId,e,t,n,a)}_PostToRuntimeMaybeSync(e,t,n){this._iRuntime.UsesWorker()?this.PostToRuntime(e,t,n):this._iRuntime._GetLocalRuntime()._OnMessageFromDOM({type:"event",component:this._componentId,handler:e,dispatchOpts:n||null,data:t,responseId:null})}AddRuntimeMessageHandler(e,t){this._iRuntime.AddRuntimeComponentMessageHandler(this._componentId,e,t)}AddRuntimeMessageHandlers(e){for(const[t,n]of e)this.AddRuntimeMessageHandler(t,n)}GetRuntimeInterface(){return this._iRuntime}GetComponentID(){return this._componentId}_StartTicking(){this._hasTickCallback||(this._iRuntime._AddRAFCallback(this._tickCallback),this._hasTickCallback=!0)}_StopTicking(){this._hasTickCallback&&(this._iRuntime._RemoveRAFCallback(this._tickCallback),this._hasTickCallback=!1)}Tick(){}},window.RateLimiter=class{constructor(e,t){this._callback=e,this._interval=t,this._timerId=-1,this._lastCallTime=-Infinity,this._timerCallFunc=()=>this._OnTimer(),this._ignoreReset=!1,this._canRunImmediate=!1}SetCanRunImmediate(e){this._canRunImmediate=!!e}Call(){if(-1===this._timerId){const e=Date.now(),t=e-this._lastCallTime,n=this._interval;t>=n&&this._canRunImmediate?(this._lastCallTime=e,this._RunCallback()):this._timerId=self.setTimeout(this._timerCallFunc,Math.max(n-t,4))}}_RunCallback(){this._ignoreReset=!0,this._callback(),this._ignoreReset=!1}Reset(){this._ignoreReset||(this._CancelTimer(),this._lastCallTime=Date.now())}_OnTimer(){this._timerId=-1,this._lastCallTime=Date.now(),this._RunCallback()}_CancelTimer(){-1!==this._timerId&&(self.clearTimeout(this._timerId),this._timerId=-1)}Release(){this._CancelTimer(),this._callback=null,this._timerCallFunc=null}},"use strict",window.DOMElementHandler=class extends DOMHandler{constructor(e,t){super(e,t),this._elementMap=new Map,this._autoAttach=!0,this.AddRuntimeMessageHandler("create",e=>this._OnCreate(e)),this.AddRuntimeMessageHandler("destroy",e=>this._OnDestroy(e)),this.AddRuntimeMessageHandler("set-visible",e=>this._OnSetVisible(e)),this.AddRuntimeMessageHandler("update-position",e=>this._OnUpdatePosition(e)),this.AddRuntimeMessageHandler("update-state",e=>this._OnUpdateState(e)),this.AddRuntimeMessageHandler("focus",e=>this._OnSetFocus(e)),this.AddRuntimeMessageHandler("set-css-style",e=>this._OnSetCssStyle(e))}SetAutoAttach(e){this._autoAttach=!!e}AddDOMElementMessageHandler(e,t){this.AddRuntimeMessageHandler(e,e=>{const n=e.elementId,a=this._elementMap.get(n);return t(a,e)})}_OnCreate(e){const t=e.elementId,n=this.CreateElement(t,e);this._elementMap.set(t,n),e.isVisible||(n.style.display="none"),this._autoAttach&&document.body.appendChild(n)}CreateElement(){throw new Error("required override")}DestroyElement(){}_OnDestroy(e){const t=e.elementId,n=this._elementMap.get(t);this.DestroyElement(n),this._autoAttach&&n.parentElement.removeChild(n),this._elementMap.delete(t)}PostToRuntimeElement(e,t,n){n||(n={}),n.elementId=t,this.PostToRuntime(e,n)}_PostToRuntimeElementMaybeSync(e,t,n){n||(n={}),n.elementId=t,this._PostToRuntimeMaybeSync(e,n)}_OnSetVisible(e){if(this._autoAttach){const t=this._elementMap.get(e.elementId);t.style.display=e.isVisible?"":"none"}}_OnUpdatePosition(e){if(this._autoAttach){const t=this._elementMap.get(e.elementId);t.style.left=e.left+"px",t.style.top=e.top+"px",t.style.width=e.width+"px",t.style.height=e.height+"px";const n=e.fontSize;null!==n&&(t.style.fontSize=n+"em")}}_OnUpdateState(e){const t=this._elementMap.get(e.elementId);this.UpdateState(t,e)}UpdateState(){throw new Error("required override")}_OnSetFocus(e){const t=this._elementMap.get(e.elementId);e.focus?t.focus():t.blur()}_OnSetCssStyle(e){const t=this._elementMap.get(e.elementId);t.style[e.prop]=e.val}GetElementById(e){return this._elementMap.get(e)}},"use strict";{function t(e){if(e.isStringSrc){const t=document.createElement("script");t.async=!1,t.textContent=e.str,document.head.appendChild(t)}else return new Promise((t,n)=>{const a=document.createElement("script");a.onload=t,a.onerror=n,a.async=!1,a.src=e,document.head.appendChild(a)})}async function r(e){const t=await s(e),n=new TextDecoder("utf-8");return n.decode(t)}function s(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=e=>t(e.target.result),a.onerror=e=>n(e),a.readAsArrayBuffer(e)})}function u(e){return n.has(e)}const a=/(iphone|ipod|ipad)/i.test(navigator.userAgent);let e=new Audio;const d={"audio/webm; codecs=opus":!!e.canPlayType("audio/webm; codecs=opus"),"audio/ogg; codecs=opus":!!e.canPlayType("audio/ogg; codecs=opus"),"audio/webm; codecs=vorbis":!!e.canPlayType("audio/webm; codecs=vorbis"),"audio/ogg; codecs=vorbis":!!e.canPlayType("audio/ogg; codecs=vorbis"),"audio/mp4":!!e.canPlayType("audio/mp4"),"audio/mpeg":!!e.canPlayType("audio/mpeg")};e=null;const _=[];let p=0;window.RealFile=window.File;const i=[],y=new Map,g=new Map;let l=0;const m=[];self.runOnStartup=function(e){if("function"!=typeof e)throw new Error("runOnStartup called without a function");m.push(e)};const n=new Set(["cordova","playable-ad","instant-games"]);window.RuntimeInterface=class e{constructor(e){this._useWorker=e.useWorker,this._messageChannelPort=null,this._baseUrl="",this._scriptFolder=e.scriptFolder,this._workerScriptBlobURLs={},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=e.exportType,u(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=!1),this._transferablesBroken=!1,this._localFileBlobs=null,this._localFileStrings=null,("html5"===this._exportType||"playable-ad"===this._exportType)&&"file"===location.protocol.substr(0,4)&&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)),"cordova"===this._exportType?document.addEventListener("deviceready",()=>this._Init(e)):this._Init(e)}Release(){this._CancelAnimationFrame(),this._messageChannelPort&&(this._messageChannelPort.onmessage=null,this._messageChannelPort=null),this._worker&&(this._worker.terminate(),this._worker=null),this._localRuntime&&(this._localRuntime.Release(),this._localRuntime=null),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}IsiOSCordova(){return a&&"cordova"===this._exportType}IsiOSWebView(){return a&&u(this._exportType)}async _Init(e){if("playable-ad"===this._exportType){this._localFileBlobs=self.c3_base64files,this._localFileStrings={},await this._ConvertDataUrisToBlobs();for(let t=0,n=e.engineScripts.length;tthis._OnMessageFromRuntime(e.data),window.c3_addPortMessageHandler&&window.c3_addPortMessageHandler(e=>this._OnMessageFromDebugger(e)),this._jobScheduler=new self.JobSchedulerDOM(this),await this._jobScheduler.Init(),this.MaybeForceBodySize(),"object"==typeof window.StatusBar&&window.StatusBar.hide(),"object"==typeof window.AndroidFullScreen&&window.AndroidFullScreen.immersiveMode(),await this._TestTransferablesWork(),this._useWorker?await this._InitWorker(e,t.port2):await this._InitDOM(e,t.port2)}_GetWorkerURL(e){return this._workerScriptBlobURLs.hasOwnProperty(e)?this._workerScriptBlobURLs[e]:e.endsWith("/workermain.js")&&this._workerScriptBlobURLs.hasOwnProperty("workermain.js")?this._workerScriptBlobURLs["workermain.js"]:"playable-ad"===this._exportType&&this._localFileBlobs.hasOwnProperty(e.toLowerCase())?URL.createObjectURL(this._localFileBlobs[e.toLowerCase()]):e}async CreateWorker(t,n,o){if(t.startsWith("blob:"))return new Worker(t,o);if(this.IsiOSCordova()){const e=await this.CordovaFetchLocalFileAsArrayBuffer(this._scriptFolder+t),n=new Blob([e],{type:"application/javascript"});return new Worker(URL.createObjectURL(n),o)}const i=new URL(t,n),a=location.origin!==i.origin;if(a){const e=await fetch(i);if(!e.ok)throw new Error("failed to fetch worker script");const t=await e.blob();return new Worker(URL.createObjectURL(t),o)}return new Worker(i,o)}MaybeForceBodySize(){if(this.IsiOSWebView()){const t=document.documentElement.style,n=document.body.style,a=window.innerWidthnew e(this)),this._FindRuntimeDOMHandler(),self.c3_callFunction=(e,t)=>this._runtimeDomHandler._InvokeFunctionFromJS(e,t),"preview"===this._exportType&&(self.goToLastErrorScript=()=>this.PostToRuntimeComponent("runtime","go-to-last-error-script"))}async _InitDOM(n,a){this._canvas=document.createElement("canvas"),this._canvas.style.display="none",document.body.appendChild(this._canvas),window.c3canvas=this._canvas,this._domHandlers=i.map(e=>new e(this)),this._FindRuntimeDOMHandler();const o=n.engineScripts.map(e=>"string"==typeof e?new URL(e,this._baseUrl).toString():e);if(Array.isArray(n.workerDependencyScripts)&&o.unshift(...n.workerDependencyScripts),await Promise.all(o.map(e=>t(e))),n.projectScripts&&0t(e[1]))),Object.values(e).some(e=>!e))return void self.setTimeout(()=>this._ReportProjectScriptError(e),100)}catch(t){return console.error("[Preview] Error loading project scripts: ",t),void self.setTimeout(()=>this._ReportProjectScriptError(e),100)}}if("preview"===this._exportType&&"object"!=typeof self.C3.ScriptsInEvents)return console.error("[C3 runtime] Failed to load JavaScript code used in events. Check all your JavaScript code has valid syntax."),void alert("Failed to load JavaScript code used in events. Check all your JavaScript code has valid syntax.");const r=Object.assign(this._GetCommonRuntimeOptions(n),{isInWorker:!1,messagePort:a,canvas:this._canvas,runOnStartupFunctions:m});this._localRuntime=self.C3_CreateRuntime(r),await self.C3_InitRuntime(this._localRuntime,r)}_ReportProjectScriptError(e){const t=Object.entries(e).filter(e=>!e[1]).map(e=>e[0]),n=`Failed to load project script '${t[0]}'. Check all your JavaScript code has valid syntax.`;console.error("[Preview] "+n),alert(n)}async _OnCreateJobWorker(){const e=await this._jobScheduler._CreateJobWorker();return{outputPort:e,transferables:[e]}}_GetLocalRuntime(){if(this._useWorker)throw new Error("not available in worker mode");return this._localRuntime}PostToRuntimeComponent(t,n,a,o,i){this._messageChannelPort.postMessage({type:"event",component:t,handler:n,dispatchOpts:o||null,data:a,responseId:null},this._transferablesBroken?void 0:i)}PostToRuntimeComponentAsync(t,n,a,o,i){const e=l++,r=new Promise((t,n)=>{g.set(e,{resolve:t,reject:n})});return this._messageChannelPort.postMessage({type:"event",component:t,handler:n,dispatchOpts:o||null,data:a,responseId:e},this._transferablesBroken?void 0:i),r}["_OnMessageFromRuntime"](e){const t=e.type;if("event"===t)this._OnEventFromRuntime(e);else if("result"===t)this._OnResultFromRuntime(e);else if("runtime-ready"===t)this._OnRuntimeReady();else if("alert"===t)alert(e.message);else throw new Error(`unknown message '${t}'`)}_OnEventFromRuntime(t){const n=t.component,o=t.handler,a=t.data,i=t.responseId,e=y.get(n);if(!e)return void console.warn(`[DOM] No event handlers for component '${n}'`);const r=e.get(o);if(!r)return void console.warn(`[DOM] No handler '${o}' for component '${n}'`);let d=null;try{d=r(a)}catch(e){return console.error(`Exception in '${n}' handler '${o}':`,e),void(null!==i&&this._PostResultToRuntime(i,!1,""+e))}null!==i&&(d&&d.then?d.then(e=>this._PostResultToRuntime(i,!0,e)).catch(e=>{console.error(`Rejection from '${n}' handler '${o}':`,e),this._PostResultToRuntime(i,!1,""+e)}):this._PostResultToRuntime(i,!0,d))}_PostResultToRuntime(e,t,n){let a;n&&n.transferables&&(a=n.transferables),this._messageChannelPort.postMessage({type:"result",responseId:e,isOk:t,result:n},a)}_OnResultFromRuntime(t){const n=t.responseId,a=t.isOk,o=t.result,i=g.get(n);a?i.resolve(o):i.reject(o),g.delete(n)}AddRuntimeComponentMessageHandler(e,t,n){let a=y.get(e);if(a||(a=new Map,y.set(e,a)),a.has(t))throw new Error(`[DOM] Component '${e}' already has handler '${t}'`);a.set(t,n)}static AddDOMHandlerClass(e){if(i.includes(e))throw new Error("DOM handler already added");i.push(e)}_FindRuntimeDOMHandler(){for(const e of this._domHandlers)if("runtime"===e.GetComponentID())return void(this._runtimeDomHandler=e);throw new Error("cannot find runtime DOM handler")}_OnMessageFromDebugger(e){this.PostToRuntimeComponent("debugger","message",e)}_OnRuntimeReady(){for(const e of this._domHandlers)e.Attach()}static IsDocumentFullscreen(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement)}async GetRemotePreviewStatusInfo(){return await this.PostToRuntimeComponentAsync("runtime","get-remote-preview-status-info")}_AddRAFCallback(e){this._rafCallbacks.push(e),this._RequestAnimationFrame()}_RemoveRAFCallback(e){const t=this._rafCallbacks.indexOf(e);if(-1===t)throw new Error("invalid callback");this._rafCallbacks.splice(t,1),this._rafCallbacks.length||this._CancelAnimationFrame()}_RequestAnimationFrame(){-1===this._rafId&&this._rafCallbacks.length&&(this._rafId=requestAnimationFrame(this._rafFunc))}_CancelAnimationFrame(){-1!==this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=-1)}_OnRAFCallback(){this._rafId=-1;for(const e of this._rafCallbacks)e();this._RequestAnimationFrame()}TryPlayMedia(e){this._runtimeDomHandler.TryPlayMedia(e)}RemovePendingPlay(e){this._runtimeDomHandler.RemovePendingPlay(e)}_PlayPendingMedia(){this._runtimeDomHandler._PlayPendingMedia()}SetSilent(e){this._runtimeDomHandler.SetSilent(e)}IsAudioFormatSupported(e){return!!d[e]}async _WasmDecodeWebMOpus(e){const t=await this.PostToRuntimeComponentAsync("runtime","opus-decode",{arrayBuffer:e},null,[e]);return new Float32Array(t)}IsAbsoluteURL(e){return /^(?:[a-z]+:)?\/\//.test(e)||"data:"===e.substr(0,5)||"blob:"===e.substr(0,5)}IsRelativeURL(e){return!this.IsAbsoluteURL(e)}async _OnCordovaFetchLocalFile(e){const t=e.filename;switch(e.as){case"text":return await this.CordovaFetchLocalFileAsText(t);case"buffer":return await this.CordovaFetchLocalFileAsArrayBuffer(t);default:throw new Error("unsupported type");}}_GetPermissionAPI(){const e=window.cordova&&window.cordova.plugins&&window.cordova.plugins.permissions;if("object"!=typeof e)throw new Error("Permission API is not loaded");return e}_MapPermissionID(e,t){const n=e[t];if("string"!=typeof n)throw new Error("Invalid permission name");return n}_HasPermission(e){const t=this._GetPermissionAPI();return new Promise((n,a)=>t.checkPermission(this._MapPermissionID(t,e),e=>n(!!e.hasPermission),a))}_RequestPermission(e){const t=this._GetPermissionAPI();return new Promise((n,a)=>t.requestPermission(this._MapPermissionID(t,e),e=>n(!!e.hasPermission),a))}async RequestPermissions(e){if("cordova"!==this.GetExportType())return!0;if(this.IsiOSCordova())return!0;for(const t of e){const e=await this._HasPermission(t);if(e)continue;const n=await this._RequestPermission(t);if(!1===n)return!1}return!0}async RequirePermissions(...e){if(!1===(await this.RequestPermissions(e)))throw new Error("Permission not granted")}CordovaFetchLocalFile(e){const t=window.cordova.file.applicationDirectory+"www/"+e.toLowerCase();return new Promise((e,n)=>{window.resolveLocalFileSystemURL(t,t=>{t.file(e,n)},n)})}async CordovaFetchLocalFileAsText(e){const t=await this.CordovaFetchLocalFile(e);return await r(t)}_CordovaMaybeStartNextArrayBufferRead(){if(_.length&&!(8<=p)){p++;const e=_.shift();this._CordovaDoFetchLocalFileAsAsArrayBuffer(e.filename,e.successCallback,e.errorCallback)}}CordovaFetchLocalFileAsArrayBuffer(e){return new Promise((t,n)=>{_.push({filename:e,successCallback:e=>{p--,this._CordovaMaybeStartNextArrayBufferRead(),t(e)},errorCallback:e=>{p--,this._CordovaMaybeStartNextArrayBufferRead(),n(e)}}),this._CordovaMaybeStartNextArrayBufferRead()})}async _CordovaDoFetchLocalFileAsAsArrayBuffer(t,n,e){try{const a=await this.CordovaFetchLocalFile(t),o=await s(a);n(o)}catch(t){e(t)}}async _ConvertDataUrisToBlobs(){const e=[];for(const[t,n]of Object.entries(this._localFileBlobs))e.push(this._ConvertDataUriToBlobs(t,n));await Promise.all(e)}async _ConvertDataUriToBlobs(e,t){if("object"==typeof t)this._localFileBlobs[e]=new Blob([t.str],{type:t.type}),this._localFileStrings[e]=t.str;else{let n=await this._FetchDataUri(t);n||(n=this._DataURIToBinaryBlobSync(t)),this._localFileBlobs[e]=n}}async _FetchDataUri(e){try{const t=await fetch(e);return await t.blob()}catch(e){return 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.",e),null}}_DataURIToBinaryBlobSync(e){const t=this._ParseDataURI(e);return this._BinaryStringToBlob(t.data,t.mime_type)}_ParseDataURI(t){const n=t.indexOf(",");if(0>n)throw new URIError("expected comma in data: uri");const a=t.substring(5,n),o=t.substring(n+1),r=a.split(";"),e=r[0]||"",d=r[1],s=r[2];let u;return u="base64"===d||"base64"===s?atob(o):decodeURIComponent(o),{mime_type:e,data:u}}_BinaryStringToBlob(t,n){let a,o,i=t.length,e=i>>2,r=new Uint8Array(i),s=new Uint32Array(r.buffer,0,e);for(a=0,o=0;ae=t),n=new ArrayBuffer(1),o=new MessageChannel;return o.port2.onmessage=t=>{t.data&&t.data.arrayBuffer||(this._transferablesBroken=!0,console.warn("MessageChannel transfers determined to be broken. Disabling transferables.")),e()},o.port1.postMessage({arrayBuffer:n},[n]),t}}}{function t(e){return e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents||e.originalEvent&&e.originalEvent.sourceCapabilities&&e.originalEvent.sourceCapabilities.firesTouchEvents}function s(e){return new Promise((t,n)=>{const a=document.createElement("link");a.onload=()=>t(a),a.onerror=e=>n(e),a.rel="stylesheet",a.href=e,document.head.appendChild(a)})}function a(e){return new Promise((t,n)=>{const a=new Image;a.onload=()=>t(a),a.onerror=e=>n(e),a.src=e})}async function u(e){const t=URL.createObjectURL(e);try{return await a(t)}finally{URL.revokeObjectURL(t)}}function d(e){return new Promise((t,n)=>{let a=new FileReader;a.onload=e=>t(e.target.result),a.onerror=e=>n(e),a.readAsText(e)})}async function _(e,t,n){if(!/firefox/i.test(navigator.userAgent))return await u(e);let o=await d(e);const r=new DOMParser,s=r.parseFromString(o,"image/svg+xml"),l=s.documentElement;if(l.hasAttribute("width")&&l.hasAttribute("height")){const t=l.getAttribute("width"),n=l.getAttribute("height");if(!t.includes("%")&&!n.includes("%"))return await u(e)}l.setAttribute("width",t+"px"),l.setAttribute("height",n+"px");const i=new XMLSerializer;return o=i.serializeToString(s),e=new Blob([o],{type:"image/svg+xml"}),await u(e)}function e(e){do{if(e.parentNode&&e.hasAttribute("contenteditable"))return!0;e=e.parentNode}while(e);return!1}function f(e){const t=e.target.tagName.toLowerCase();o.has(t)&&e.preventDefault()}function g(e){(e.metaKey||e.ctrlKey)&&e.preventDefault()}function i(){try{return window.parent&&window.parent.document.hasFocus()}catch(e){return!1}}function c(){const t=document.activeElement;if(!t)return!1;const n=t.tagName.toLowerCase(),a=new Set(["email","number","password","search","tel","text","url"]);return"textarea"===n||("input"===n?a.has(t.type.toLowerCase()||"text"):e(t))}const y=new Map([["OSLeft","MetaLeft"],["OSRight","MetaRight"]]),l={dispatchRuntimeEvent:!0,dispatchUserScriptEvent:!0},m={dispatchUserScriptEvent:!0},n={dispatchRuntimeEvent:!0},o=new Set(["canvas","body","html"]);self.C3_GetSvgImageSize=async function(e){const t=await u(e);if(0p=!0),document.addEventListener("resume",()=>p=!1);const b=class extends DOMHandler{constructor(t){super(t,"runtime"),this._isFirstSizeUpdate=!0,this._simulatedResizeTimerId=-1,this._targetOrientation="any",this._attachedDeviceOrientationEvent=!1,this._attachedDeviceMotionEvent=!1,this._debugHighlightElem=null,this._pointerRawUpdateRateLimiter=null,this._lastPointerRawUpdateEvent=null,t.AddRuntimeComponentMessageHandler("canvas","update-size",e=>this._OnUpdateCanvasSize(e)),t.AddRuntimeComponentMessageHandler("runtime","invoke-download",e=>this._OnInvokeDownload(e)),t.AddRuntimeComponentMessageHandler("runtime","raster-svg-image",e=>this._OnRasterSvgImage(e)),t.AddRuntimeComponentMessageHandler("runtime","get-svg-image-size",e=>this._OnGetSvgImageSize(e)),t.AddRuntimeComponentMessageHandler("runtime","set-target-orientation",e=>this._OnSetTargetOrientation(e)),t.AddRuntimeComponentMessageHandler("runtime","register-sw",()=>this._OnRegisterSW()),t.AddRuntimeComponentMessageHandler("runtime","post-to-debugger",e=>this._OnPostToDebugger(e)),t.AddRuntimeComponentMessageHandler("runtime","go-to-script",e=>this._OnPostToDebugger(e)),t.AddRuntimeComponentMessageHandler("runtime","before-start-ticking",()=>this._OnBeforeStartTicking()),t.AddRuntimeComponentMessageHandler("runtime","debug-highlight",e=>this._OnDebugHighlight(e)),t.AddRuntimeComponentMessageHandler("runtime","enable-device-orientation",()=>this._AttachDeviceOrientationEvent()),t.AddRuntimeComponentMessageHandler("runtime","enable-device-motion",()=>this._AttachDeviceMotionEvent()),t.AddRuntimeComponentMessageHandler("runtime","add-stylesheet",e=>this._OnAddStylesheet(e)),t.AddRuntimeComponentMessageHandler("runtime","alert",e=>this._OnAlert(e));const n=new Set(["input","textarea","datalist"]);window.addEventListener("contextmenu",t=>{const a=t.target,o=a.tagName.toLowerCase();n.has(o)||e(a)||t.preventDefault()});const a=t.GetCanvas();window.addEventListener("selectstart",f),window.addEventListener("gesturehold",f),a.addEventListener("selectstart",f),a.addEventListener("gesturehold",f),window.addEventListener("touchstart",f,{passive:!1}),"undefined"==typeof PointerEvent?a.addEventListener("touchstart",f):(window.addEventListener("pointerdown",f,{passive:!1}),a.addEventListener("pointerdown",f)),this._mousePointerLastButtons=0,window.addEventListener("mousedown",e=>{1===e.button&&e.preventDefault()}),window.addEventListener("mousewheel",g,{passive:!1}),window.addEventListener("wheel",g,{passive:!1}),window.addEventListener("resize",()=>this._OnWindowResize()),t.IsiOSWebView()&&window.addEventListener("focusout",()=>{c()||(document.scrollingElement.scrollTop=0)}),this._mediaPendingPlay=new Set,this._mediaRemovedPendingPlay=new WeakSet,this._isSilent=!1}_OnBeforeStartTicking(){return"cordova"===this._iRuntime.GetExportType()?(document.addEventListener("pause",()=>this._OnVisibilityChange(!0)),document.addEventListener("resume",()=>this._OnVisibilityChange(!1))):document.addEventListener("visibilitychange",()=>this._OnVisibilityChange(document.hidden)),{isSuspended:!!(document.hidden||p)}}Attach(){window.addEventListener("focus",()=>this._PostRuntimeEvent("window-focus")),window.addEventListener("blur",()=>{this._PostRuntimeEvent("window-blur",{parentHasFocus:i()}),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,l)),window.addEventListener("wheel",e=>this._OnMouseWheelEvent("wheel",e)),"undefined"==typeof PointerEvent?(window.addEventListener("mousedown",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._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))):(window.addEventListener("pointerdown",e=>this._OnPointerEvent("pointerdown",e)),this._iRuntime.UsesWorker()&&"undefined"!=typeof window.onpointerrawupdate&&self===self.top?(this._pointerRawUpdateRateLimiter=new RateLimiter(()=>this._DoSendPointerRawUpdate(),5),this._pointerRawUpdateRateLimiter.SetCanRunImmediate(!0),window.addEventListener("pointerrawupdate",e=>this._OnPointerRawUpdate(e))):window.addEventListener("pointermove",e=>this._OnPointerEvent("pointermove",e)),window.addEventListener("pointerup",e=>this._OnPointerEvent("pointerup",e)),window.addEventListener("pointercancel",e=>this._OnPointerEvent("pointercancel",e)));const e=()=>this._PlayPendingMedia();window.addEventListener("pointerup",e,!0),window.addEventListener("touchend",e,!0),window.addEventListener("click",e,!0),window.addEventListener("keydown",e,!0),window.addEventListener("gamepadconnected",e,!0)}_PostRuntimeEvent(e,t){this.PostToRuntime(e,t||null,n)}_GetWindowInnerWidth(){return Math.max(window.innerWidth,1)}_GetWindowInnerHeight(){return Math.max(window.innerHeight,1)}_OnWindowResize(){const e=this._GetWindowInnerWidth(),t=this._GetWindowInnerHeight();this._PostRuntimeEvent("window-resize",{innerWidth:e,innerHeight:t,devicePixelRatio:window.devicePixelRatio}),this._iRuntime.IsiOSWebView()&&(-1!==this._simulatedResizeTimerId&&clearTimeout(this._simulatedResizeTimerId),this._OnSimulatedResize(e,t,0))}_ScheduleSimulatedResize(e,t,n){-1!==this._simulatedResizeTimerId&&clearTimeout(this._simulatedResizeTimerId),this._simulatedResizeTimerId=setTimeout(()=>this._OnSimulatedResize(e,t,n),48)}_OnSimulatedResize(t,n,a){const o=this._GetWindowInnerWidth(),i=this._GetWindowInnerHeight();this._simulatedResizeTimerId=-1,o!=t||i!=n?this._PostRuntimeEvent("window-resize",{innerWidth:o,innerHeight:i,devicePixelRatio:window.devicePixelRatio}):10>a&&this._ScheduleSimulatedResize(o,i,a+1)}_OnSetTargetOrientation(e){this._targetOrientation=e.targetOrientation}_TrySetTargetOrientation(){const e=this._targetOrientation;if(screen.orientation&&screen.orientation.lock)screen.orientation.lock(e).catch(e=>console.warn("[Construct 3] Failed to lock orientation: ",e));else try{let t=!1;screen.lockOrientation?t=screen.lockOrientation(e):screen.webkitLockOrientation?t=screen.webkitLockOrientation(e):screen.mozLockOrientation?t=screen.mozLockOrientation(e):screen.msLockOrientation&&(t=screen.msLockOrientation(e)),t||console.warn("[Construct 3] Failed to lock orientation")}catch(e){console.warn("[Construct 3] Failed to lock orientation: ",e)}}_OnFullscreenChange(){const e=RuntimeInterface.IsDocumentFullscreen();e&&"any"!==this._targetOrientation&&this._TrySetTargetOrientation(),this.PostToRuntime("fullscreenchange",{isFullscreen:e,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(e){e?this._iRuntime._CancelAnimationFrame():this._iRuntime._RequestAnimationFrame(),this.PostToRuntime("visibilitychange",{hidden:e})}_OnKeyEvent(e,t){"Backspace"===t.key&&f(t);const n=y.get(t.code)||t.code;this._PostToRuntimeMaybeSync(e,{code:n,key:t.key,which:t.which,repeat:t.repeat,altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey,timeStamp:t.timeStamp},l)}_OnMouseWheelEvent(e,t){this.PostToRuntime(e,{clientX:t.clientX,clientY:t.clientY,deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode,timeStamp:t.timeStamp},l)}_OnMouseEvent(e,n,a){t(n)||("mousedown"===e&&window!==window.top&&window.focus(),this._PostToRuntimeMaybeSync(e,{button:n.button,buttons:n.buttons,clientX:n.clientX,clientY:n.clientY,timeStamp:n.timeStamp},a))}_OnMouseEventAsPointer(e,n){if(!t(n)){"pointerdown"===e&&window!==window.top&&window.focus();const t=this._mousePointerLastButtons;"pointerdown"===e&&0!==t?e="pointermove":"pointerup"==e&&0!==n.buttons&&(e="pointermove"),this._PostToRuntimeMaybeSync(e,{pointerId:1,pointerType:"mouse",button:n.button,buttons:n.buttons,lastButtons:t,clientX:n.clientX,clientY:n.clientY,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,timeStamp:n.timeStamp},l),this._mousePointerLastButtons=n.buttons,this._OnMouseEvent(n.type,n,m)}}_OnPointerEvent(e,t){"pointerdown"===e&&window!==window.top&&window.focus(),this._pointerRawUpdateRateLimiter&&"pointermove"!==e&&this._pointerRawUpdateRateLimiter.Reset();let n=0;if("mouse"===t.pointerType&&(n=this._mousePointerLastButtons),this._PostToRuntimeMaybeSync(e,{pointerId:t.pointerId,pointerType:t.pointerType,button:t.button,buttons:t.buttons,lastButtons:n,clientX:t.clientX,clientY:t.clientY,width:t.width||0,height:t.height||0,pressure:t.pressure||0,tangentialPressure:t.tangentialPressure||0,tiltX:t.tiltX||0,tiltY:t.tiltY||0,twist:t.twist||0,timeStamp:t.timeStamp},l),"mouse"===t.pointerType){let n="mousemove";"pointerdown"===e?n="mousedown":"pointerup"==e&&(n="pointerup"),this._OnMouseEvent(n,t,m),this._mousePointerLastButtons=t.buttons}}_OnPointerRawUpdate(e){this._lastPointerRawUpdateEvent=e,this._pointerRawUpdateRateLimiter.Call()}_DoSendPointerRawUpdate(){this._OnPointerEvent("pointermove",this._lastPointerRawUpdateEvent),this._lastPointerRawUpdateEvent=null}_OnTouchEvent(e,t){"pointerdown"===e&&window!==window.top&&window.focus();for(let n=0,a=t.changedTouches.length;nthis._OnDeviceOrientation(e)))}_AttachDeviceMotionEvent(){this._attachedDeviceMotionEvent||(this._attachedDeviceMotionEvent=!0,window.addEventListener("devicemotion",e=>this._OnDeviceMotion(e)))}_OnDeviceOrientation(e){this.PostToRuntime("deviceorientation",{alpha:e.alpha||0,beta:e.beta||0,gamma:e.gamma||0,timeStamp:e.timeStamp},l)}_OnDeviceMotion(t){let n=null;const a=t.acceleration;a&&(n={x:a.x||0,y:a.y||0,z:a.z||0});let o=null;const i=t.accelerationIncludingGravity;i&&(o={x:i.x||0,y:i.y||0,z:i.z||0});let e=null;const r=t.rotationRate;r&&(e={alpha:r.alpha||0,beta:r.beta||0,gamma:r.gamma||0}),this.PostToRuntime("devicemotion",{acceleration:n,accelerationIncludingGravity:o,rotationRate:e,interval:t.interval,timeStamp:t.timeStamp},l)}_OnUpdateCanvasSize(e){const t=this.GetRuntimeInterface(),n=t.GetCanvas();n.style.width=e.styleWidth+"px",n.style.height=e.styleHeight+"px",n.style.marginLeft=e.marginLeft+"px",n.style.marginTop=e.marginTop+"px",t.MaybeForceBodySize(),this._isFirstSizeUpdate&&(n.style.display="",this._isFirstSizeUpdate=!1)}_OnInvokeDownload(t){const n=t.url,o=t.filename,i=document.createElement("a"),e=document.body;i.textContent=o,i.href=n,i.download=o,e.appendChild(i),i.click(),e.removeChild(i)}async _OnRasterSvgImage(t){const n=t.blob,a=t.imageWidth,o=t.imageHeight,r=t.surfaceWidth,e=t.surfaceHeight,d=t.imageBitmapOpts,s=await self.C3_RasterSvgImageBlob(n,a,o,r,e);let u;return u=d?await createImageBitmap(s,d):await createImageBitmap(s),{imageBitmap:u,transferables:[u]}}async _OnGetSvgImageSize(e){return await self.C3_GetSvgImageSize(e.blob)}async _OnAddStylesheet(e){await s(e.url)}_PlayPendingMedia(){const e=[...this._mediaPendingPlay];if(this._mediaPendingPlay.clear(),!this._isSilent)for(const t of e){const e=t.play();e&&e.catch(()=>{this._mediaRemovedPendingPlay.has(t)||this._mediaPendingPlay.add(t)})}}TryPlayMedia(e){if("function"!=typeof e.play)throw new Error("missing play function");this._mediaRemovedPendingPlay.delete(e);let t;try{t=e.play()}catch(t){return void this._mediaPendingPlay.add(e)}t&&t.catch(()=>{this._mediaRemovedPendingPlay.has(e)||this._mediaPendingPlay.add(e)})}RemovePendingPlay(e){this._mediaPendingPlay.delete(e),this._mediaRemovedPendingPlay.add(e)}SetSilent(e){this._isSilent=!!e}_OnDebugHighlight(e){const t=e.show;if(!t)return void(this._debugHighlightElem&&(this._debugHighlightElem.style.display="none"));this._debugHighlightElem||(this._debugHighlightElem=document.createElement("div"),this._debugHighlightElem.id="inspectOutline",document.body.appendChild(this._debugHighlightElem));const n=this._debugHighlightElem;n.style.display="",n.style.left=e.left-1+"px",n.style.top=e.top-1+"px",n.style.width=e.width+2+"px",n.style.height=e.height+2+"px",n.textContent=e.name}_OnRegisterSW(){window.C3_RegisterSW&&window.C3_RegisterSW()}_OnPostToDebugger(e){window.c3_postToMessagePort&&(e.from="runtime",window.c3_postToMessagePort(e))}_InvokeFunctionFromJS(e,t){return this.PostToRuntimeAsync("js-invoke-function",{name:e,params:t})}_OnAlert(e){alert(e.message+" [via Web Worker]")}};RuntimeInterface.AddDOMHandlerClass(b)}{const e=document.currentScript.src;self.JobSchedulerDOM=class{constructor(t){this._runtimeInterface=t,this._baseUrl=e?e.substr(0,e.lastIndexOf("/")+1):t.GetBaseURL(),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=!0;const e=this._runtimeInterface._GetWorkerURL("dispatchworker.js");this._dispatchWorker=await this._runtimeInterface.CreateWorker(e,this._baseUrl,{name:"DispatchWorker"});const t=new MessageChannel;this._inputPort=t.port1,this._dispatchWorker.postMessage({type:"_init","in-port":t.port2},[t.port2]),this._outputPort=await this._CreateJobWorker()}async _CreateJobWorker(){const t=this._jobWorkers.length,n=this._runtimeInterface._GetWorkerURL("jobworker.js"),a=await this._runtimeInterface.CreateWorker(n,this._baseUrl,{name:"JobWorker"+t}),o=new MessageChannel,i=new MessageChannel;return this._dispatchWorker.postMessage({type:"_addJobWorker",port:o.port1},[o.port1]),a.postMessage({type:"init",number:t,"dispatch-port":o.port2,"output-port":i.port2},[o.port2,i.port2]),this._jobWorkers.push(a),i.port1}GetPortData(){return{inputPort:this._inputPort,outputPort:this._outputPort,maxNumWorkers:this._maxNumWorkers}}GetPortTransferables(){return[this._inputPort,this._outputPort]}}}if("use strict",window.C3_IsSupported){"undefined"!=typeof OffscreenCanvas;window.c3_runtimeInterface=new RuntimeInterface({useWorker:!1,workerMainUrl:"workermain.js",engineScripts:["scripts/c3runtime.js"],scriptFolder:"scripts/",workerDependencyScripts:[],exportType:"html5"})}{const e=class extends DOMHandler{constructor(e){super(e,"touch"),this.AddRuntimeMessageHandler("request-permission",e=>this._OnRequestPermission(e))}async _OnRequestPermission(e){const t=e.type;let n=!0;0===t?n=await this._RequestOrientationPermission():1===t&&(n=await this._RequestMotionPermission()),this.PostToRuntime("permission-result",{type:t,result:n})}async _RequestOrientationPermission(){if(!self.DeviceOrientationEvent||!self.DeviceOrientationEvent.requestPermission)return!0;try{const e=await self.DeviceOrientationEvent.requestPermission();return"granted"===e}catch(e){return console.warn("[Touch] Failed to request orientation permission: ",e),!1}}async _RequestMotionPermission(){if(!self.DeviceMotionEvent||!self.DeviceMotionEvent.requestPermission)return!0;try{const e=await self.DeviceMotionEvent.requestPermission();return"granted"===e}catch(e){return console.warn("[Touch] Failed to request motion permission: ",e),!1}}};RuntimeInterface.AddDOMHandlerClass(e)}{function e(e,t){return e.length===t.length&&(e===t||e.toLowerCase()===t.toLowerCase())}const t=class extends DOMHandler{constructor(e){super(e,"audio"),this._audioContext=null,this._destinationNode=null,this._hasUnblocked=!1,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=!1,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=!1,this._hasAnySoftwareDecodedMusic=!1,this._supportsWebMOpus=this._iRuntime.IsAudioFormatSupported("audio/webm; codecs=opus"),this._effects=new Map,this._analysers=new Set,this._isPendingPostFxState=!1,this._microphoneTag="",this._microphoneSource=null,self.C3Audio_OnMicrophoneStream=(e,t)=>this._OnMicrophoneStream(e,t),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){e.isiOSCordova&&(this._playMusicAsSound=!0),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 t={latencyHint:e.latencyHint};if("undefined"!=typeof AudioContext)this._audioContext=new AudioContext(t);else if("undefined"!=typeof webkitAudioContext)this._audioContext=new webkitAudioContext(t);else throw new Error("Web Audio API not supported");this._destinationNode=this._audioContext.createGain(),this._destinationNode.connect(this._audioContext.destination);const n=e.listenerPos;this._audioContext.listener.setPosition(n[0],n[1],n[2]),this._audioContext.listener.setOrientation(0,0,1,0,-1,0),window.addEventListener("pointerup",this._unblockFunc,!0),window.addEventListener("touchend",this._unblockFunc,!0),window.addEventListener("click",this._unblockFunc,!0),window.addEventListener("keydown",this._unblockFunc,!0),self.C3_GetAudioContextCurrentTime=()=>this.GetAudioCurrentTime();try{await Promise.all(e.preloadList.map(e=>this._GetAudioBuffer(e.originalUrl,e.url,e.type,!1)))}catch(e){console.error("[Construct 3] Preloading sounds failed: ",e)}return{sampleRate:this._audioContext.sampleRate}}_UnblockAudioContext(){if(!this._hasUnblocked){const e=this._audioContext;"suspended"===e.state&&e.resume&&e.resume();const t=e.createBuffer(1,220,22050),n=e.createBufferSource();n.buffer=t,n.connect(e.destination),n.start(0),"running"===e.state&&(this._hasUnblocked=!0,window.removeEventListener("pointerup",this._unblockFunc,!0),window.removeEventListener("touchend",this._unblockFunc,!0),window.removeEventListener("click",this._unblockFunc,!0),window.removeEventListener("keydown",this._unblockFunc,!0),this._unblockFunc=null)}}GetAudioContext(){return this._audioContext}GetAudioCurrentTime(){return this._audioContext.currentTime}GetDestinationNode(){return this._destinationNode}GetDestinationForTag(e){const t=this._effects.get(e.toLowerCase());return t?t[0].GetInputNode():this.GetDestinationNode()}AddEffectForTag(e,t){e=e.toLowerCase();let n=this._effects.get(e);n||(n=[],this._effects.set(e,n)),t._SetIndex(n.length),t._SetTag(e),n.push(t),this._ReconnectEffects(e)}_ReconnectEffects(e){let t=this.GetDestinationNode();const n=this._effects.get(e);if(n&&n.length){t=n[0].GetInputNode();for(let e=0,t=n.length;e{const t=this._audioContext.createBuffer(1,e.length,48e3),n=t.getChannelData(0);return n.set(e),t}):new Promise((t,n)=>{this._audioContext.decodeAudioData(e,t,n)})}TryPlayMedia(e){this._iRuntime.TryPlayMedia(e)}RemovePendingPlay(e){this._iRuntime.RemovePendingPlay(e)}ReleaseInstancesForBuffer(t){let n=0;for(let o=0,e=this._audioInstances.length;on=e);t={pendingCount:0,promise:a,resolve:n},this._pendingTags.set(e,t)}t.pendingCount++}_RemovePendingTag(e){const t=this._pendingTags.get(e);if(!t)throw new Error("expected pending tag");t.pendingCount--,0===t.pendingCount&&(t.resolve(),this._pendingTags.delete(e))}TagReady(e){e||(e=this._lastPlayedTag);const t=this._pendingTags.get(e);return t?t.promise:Promise.resolve()}_MaybeStartTicking(){if(0e.IsActive()).map(e=>e.GetState());this.PostToRuntime("state",{tickCount:this._lastTickCount,audioInstances:t,analysers:[...this._analysers].map(e=>e.GetData())}),0===t.length&&0===this._analysers.size&&this._StopTicking()}PostTrigger(e,t,n){this.PostToRuntime("trigger",{type:e,tag:t,aiid:n})}async _Play(t){const n=t.originalUrl,a=t.url,o=t.type,r=t.isMusic,e=t.tag,d=t.isLooping,s=t.vol,u=t.pos,i=t.panning;let l=t.off;if(0a||a>=d.length||(d[a].SetParam(o,i,e,r),this._PostUpdatedFxState())}_RemoveEffects(e){const t=e.tag.toLowerCase(),n=this._effects.get(t);if(n&&n.length){for(const e of n)e.Release();this._effects.delete(t),this._ReconnectEffects(t)}}_AddAnalyser(e){this._analysers.add(e),this._MaybeStartTicking()}_RemoveAnalyser(e){this._analysers.delete(e)}_PostUpdatedFxState(){this._isPendingPostFxState||(this._isPendingPostFxState=!0,Promise.resolve().then(()=>this._DoPostUpdatedFxState()))}_DoPostUpdatedFxState(){const e={};for(const[t,n]of this._effects)e[t]=n.map(e=>e.GetState());this.PostToRuntime("fxstate",{fxstate:e}),this._isPendingPostFxState=!1}async _OnLoadState(e){const t=e.saveLoadMode;if(3!==t)for(const e of this._audioInstances)e.IsMusic()&&1===t||!e.IsMusic()&&2===t||e.Stop();for(const t of this._effects.values())for(const e of t)e.Release();this._effects.clear(),this._timeScale=e.timeScale,this._gameTime=e.gameTime;const n=e.listenerPos;this._audioContext.listener.setPosition(n[0],n[1],n[2]),this._isSilent=e.isSilent,this._iRuntime.SetSilent(this._isSilent),this._masterVolume=e.masterVolume;const a=[];for(const t of Object.values(e.effects))a.push(Promise.all(t.map(e=>this._AddEffect(e))));await Promise.all(a),await Promise.all(e.playing.map(e=>this._LoadAudioInstance(e,t))),this._MaybeStartTicking()}async _LoadAudioInstance(t,n){if(3===n)return;const a=t.bufferOriginalUrl,o=t.bufferUrl,r=t.bufferType,e=t.isMusic,d=t.tag,s=t.isLooping,u=t.volume,i=t.playbackTime;if(e&&1===n)return;if(!e&&2===n)return;let l=null;try{l=await this._GetAudioInstance(a,o,r,d,e)}catch(e){return void console.error("[Construct 3] Audio: error loading audio state: ",e)}l.LoadPanState(t.pan),l.Play(s,u,i,0),t.isPlaying||l.Pause(),l._LoadAdditionalState(t)}_OnMicrophoneStream(e,t){this._microphoneSource&&this._microphoneSource.disconnect(),this._microphoneTag=t.toLowerCase(),this._microphoneSource=this._audioContext.createMediaStreamSource(e),this._microphoneSource.connect(this.GetDestinationForTag(this._microphoneTag))}_OnGetOutputStream(){return this._destMediaStreamNode||(this._destMediaStreamNode=this._audioContext.createMediaStreamDestination(),this._destinationNode.connect(this._destMediaStreamNode)),this._destMediaStreamNode.stream}};RuntimeInterface.AddDOMHandlerClass(t)}"use strict",self.C3AudioBuffer=class{constructor(t,n,a,o,i){this._audioDomHandler=t,this._originalUrl=n,this._url=a,this._type=o,this._isMusic=i,this._api="",this._loadState="not-loaded",this._loadPromise=null}Release(){this._loadState="not-loaded",this._audioDomHandler=null,this._loadPromise=null}static Create(t,n,a,o,i){const e="audio/webm; codecs=opus"===o&&!t.SupportsWebMOpus();return i&&e&&t._SetHasAnySoftwareDecodedMusic(),!i||t.IsPlayMusicAsSound()||e?new C3WebAudioBuffer(t,n,a,o,i,e):new C3Html5AudioBuffer(t,n,a,o,i)}CreateInstance(e){return"html5"===this._api?new C3Html5AudioInstance(this._audioDomHandler,this,e):new C3WebAudioInstance(this._audioDomHandler,this,e)}_Load(){}Load(){return this._loadPromise||(this._loadPromise=this._Load()),this._loadPromise}IsLoaded(){}IsLoadedAndDecoded(){}HasFailedToLoad(){return"failed"===this._loadState}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 extends C3AudioBuffer{constructor(t,n,a,o,i){super(t,n,a,o,i),this._api="html5",this._audioElem=new Audio,this._audioElem.crossOrigin="anonymous",this._audioElem.autoplay=!1,this._audioElem.preload="auto",this._loadResolve=null,this._loadReject=null,this._reachedCanPlayThrough=!1,this._audioElem.addEventListener("canplaythrough",()=>this._reachedCanPlayThrough=!0),this._outNode=this.GetAudioContext().createGain(),this._mediaSourceNode=null,this._audioElem.addEventListener("canplay",()=>{this._loadResolve&&(this._loadState="loaded",this._loadResolve(),this._loadResolve=null,this._loadReject=null),this._mediaSourceNode||!this._audioElem||(this._mediaSourceNode=this.GetAudioContext().createMediaElementSource(this._audioElem),this._mediaSourceNode.connect(this._outNode))}),this.onended=null,this._audioElem.addEventListener("ended",()=>{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,this._audioElem&&!this._audioElem.paused&&this._audioElem.pause(),this.onended=null,this._audioElem=null,super.Release()}_Load(){return this._loadState="loading",new Promise((e,t)=>{this._loadResolve=e,this._loadReject=t,this._audioElem.src=this._url})}_OnError(e){console.error(`[Construct 3] Audio '${this._url}' error: `,e),this._loadReject&&(this._loadState="failed",this._loadReject(e),this._loadResolve=null,this._loadReject=null)}IsLoaded(){const e=4<=this._audioElem.readyState;return e&&(this._reachedCanPlayThrough=!0),e||this._reachedCanPlayThrough}IsLoadedAndDecoded(){return this.IsLoaded()}GetAudioElement(){return this._audioElem}GetOutputNode(){return this._outNode}GetDuration(){return this._audioElem.duration}},"use strict",self.C3WebAudioBuffer=class extends C3AudioBuffer{constructor(t,n,a,o,i,e){super(t,n,a,o,i),this._api="webaudio",this._audioData=null,this._audioBuffer=null,this._needsSoftwareDecode=!!e}Release(){this._audioDomHandler.ReleaseInstancesForBuffer(this),this._audioData=null,this._audioBuffer=null,super.Release()}async _Fetch(){if(this._audioData)return this._audioData;const e=this._audioDomHandler.GetRuntimeInterface();if("cordova"===e.GetExportType()&&e.IsRelativeURL(this._url))this._audioData=await e.CordovaFetchLocalFileAsArrayBuffer(this._url);else{const e=await fetch(this._url);if(!e.ok)throw new Error(`error fetching audio data: ${e.status} ${e.statusText}`);this._audioData=await e.arrayBuffer()}}async _Decode(){return this._audioBuffer?this._audioBuffer:void(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(e){this._loadState="failed",console.error(`[Construct 3] Failed to load audio '${this._url}': `,e)}}IsLoaded(){return!!(this._audioData||this._audioBuffer)}IsLoadedAndDecoded(){return!!this._audioBuffer}GetAudioBuffer(){return this._audioBuffer}GetDuration(){return this._audioBuffer?this._audioBuffer.duration:0}},"use strict";{function t(t){return t*e}const e=180/Math.PI;let n=0;self.C3AudioInstance=class{constructor(t,a,o){this._audioDomHandler=t,this._buffer=a,this._tag=o,this._aiId=n++,this._gainNode=this.GetAudioContext().createGain(),this._gainNode.connect(this.GetDestinationNode()),this._pannerNode=null,this._isPannerEnabled=!1,this._isStopped=!0,this._isPaused=!1,this._resumeMe=!1,this._isLooping=!1,this._volume=1,this._isMuted=!1,this._playbackRate=1;const i=this._audioDomHandler.GetTimeScaleMode();this._isTimescaled=1===i&&!this.IsMusic()||2===i,this._instUid=-1,this._fadeEndTime=-1,this._stopOnFadeEnd=!1}Release(){this._audioDomHandler=null,this._buffer=null,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(){return this._isTimescaled?this._audioDomHandler.GetGameTime():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(e){this._tag=e}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(){}GetDuration(e){let t=this._buffer.GetDuration();return e&&(t/=this._playbackRate||.001),t}Play(){}Stop(){}Pause(){}IsPaused(){return this._isPaused}Resume(){}SetVolume(e){this._volume=e,this._gainNode.gain.cancelScheduledValues(0),this._fadeEndTime=-1,this._gainNode.gain.value=this.GetOverallVolume()}FadeVolume(t,n,o){if(!this.IsMuted()){t*=this.GetMasterVolume();const a=this._gainNode.gain;a.cancelScheduledValues(0);const i=this._audioDomHandler.GetAudioCurrentTime(),e=i+n;a.setValueAtTime(a.value,i),a.linearRampToValueAtTime(t,e),this._volume=t,this._fadeEndTime=e,this._stopOnFadeEnd=o}}_UpdateVolume(){this.SetVolume(this._volume)}Tick(e){-1!==this._fadeEndTime&&e>=this._fadeEndTime&&(this._fadeEndTime=-1,this._stopOnFadeEnd&&this.Stop(),this._audioDomHandler.PostTrigger("fade-ended",this._tag,this._aiId))}GetOverallVolume(){const e=this._volume*this.GetMasterVolume();return isFinite(e)?e:0}SetMuted(e){e=!!e,this._isMuted===e||(this._isMuted=e,this._UpdateMuted())}IsMuted(){return this._isMuted}IsSilent(){return this._audioDomHandler.IsSilent()}_UpdateMuted(){}SetLooping(){}IsLooping(){return this._isLooping}SetPlaybackRate(e){this._playbackRate===e||(this._playbackRate=e,this._UpdatePlaybackRate())}_UpdatePlaybackRate(){}GetPlaybackRate(){return this._playbackRate}Seek(){}SetSuspended(){}SetPannerEnabled(e){e=!!e,this._isPannerEnabled===e||(this._isPannerEnabled=e,this._isPannerEnabled?(!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())):(this._pannerNode.disconnect(),this._gainNode.disconnect(),this._gainNode.connect(this.GetDestinationNode())))}SetPan(n,a,o,i,e,r){this._isPannerEnabled&&(this.SetPanXYA(n,a,o),this._pannerNode.coneInnerAngle=t(i),this._pannerNode.coneOuterAngle=t(e),this._pannerNode.coneOuterGain=r)}SetPanXYA(e,t,n){this._isPannerEnabled&&(this._pannerNode.setPosition(e,t,0),this._pannerNode.setOrientation(Math.cos(n),Math.sin(n),0))}SetUID(e){this._instUid=e}GetUID(){return this._instUid}GetResumePosition(){}Reconnect(e){const t=this._pannerNode||this._gainNode;t.disconnect(),t.connect(e)}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(e){this.SetPlaybackRate(e.playbackRate),this.SetMuted(e.isMuted)}GetPanState(){if(!this._pannerNode)return null;const e=this._pannerNode;return{pos:[e.positionX.value,e.positionY.value,e.positionZ.value],orient:[e.orientationX.value,e.orientationY.value,e.orientationZ.value],cia:e.coneInnerAngle,coa:e.coneOuterAngle,cog:e.coneOuterGain,uid:this._instUid}}LoadPanState(e){if(!e)return void this.SetPannerEnabled(!1);this.SetPannerEnabled(!0);const t=this._pannerNode;t.setPosition(...t.pos),t.setOrientation(...t.orient),t.coneInnerAngle=t.cia,t.coneOuterAngle=t.coa,t.coneOuterGain=t.cog,this._instUid=t.uid}}}"use strict",self.C3Html5AudioInstance=class extends C3AudioInstance{constructor(e,t,n){super(e,t,n),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=!0,this._instUid=-1,this._audioDomHandler.PostTrigger("ended",this._tag,this._aiId)}HasEnded(){return this.GetAudioElement().ended}CanBeRecycled(){return!!this._isStopped||this.HasEnded()}GetPlaybackTime(e){let t=this.GetAudioElement().currentTime;return e&&(t*=this._playbackRate),this._isLooping||(t=Math.min(t,this.GetDuration())),t}Play(e,t,n){const a=this.GetAudioElement();if(1!==a.playbackRate&&(a.playbackRate=1),a.loop!==e&&(a.loop=e),this.SetVolume(t),a.muted&&(a.muted=!1),a.currentTime!==n)try{a.currentTime=n}catch(e){console.warn(`[Construct 3] Exception seeking audio '${this._buffer.GetUrl()}' to position '${n}': `,e)}this._audioDomHandler.TryPlayMedia(a),this._isStopped=!1,this._isPaused=!1,this._isLooping=e,this._playbackRate=1}Stop(){const e=this.GetAudioElement();e.paused||e.pause(),this._audioDomHandler.RemovePendingPlay(e),this._isStopped=!0,this._isPaused=!1,this._instUid=-1}Pause(){if(!(this._isPaused||this._isStopped||this.HasEnded())){const e=this.GetAudioElement();e.paused||e.pause(),this._audioDomHandler.RemovePendingPlay(e),this._isPaused=!0}}Resume(){!this._isPaused||this._isStopped||this.HasEnded()||(this._audioDomHandler.TryPlayMedia(this.GetAudioElement()),this._isPaused=!1)}_UpdateMuted(){this.GetAudioElement().muted=this._isMuted||this.IsSilent()}SetLooping(e){e=!!e,this._isLooping===e||(this._isLooping=e,this.GetAudioElement().loop=e)}_UpdatePlaybackRate(){let e=this._playbackRate;this._isTimescaled&&(e*=this._audioDomHandler.GetTimeScale());try{this.GetAudioElement().playbackRate=e}catch(t){console.warn(`[Construct 3] Unable to set playback rate '${e}':`,t)}}Seek(e){if(!(this._isStopped||this.HasEnded()))try{this.GetAudioElement().currentTime=e}catch(t){console.warn(`[Construct 3] Error seeking audio to '${e}': `,t)}}GetResumePosition(){return this.GetPlaybackTime()}SetSuspended(e){e?this.IsPlaying()?(this.GetAudioElement().pause(),this._resumeMe=!0):this._resumeMe=!1:this._resumeMe&&(this._audioDomHandler.TryPlayMedia(this.GetAudioElement()),this._resumeMe=!1)}},"use strict",self.C3WebAudioInstance=class extends C3AudioInstance{constructor(e,t,n){super(e,t,n),this._bufferSource=null,this._onended_handler=e=>this._OnEnded(e),this._hasPlaybackEnded=!0,this._activeSource=null,this._startTime=0,this._resumePosition=0,this._muteVol=1}Release(){this.Stop(),this._ReleaseBufferSource(),this._onended_handler=null,super.Release()}_ReleaseBufferSource(){this._bufferSource&&this._bufferSource.disconnect(),this._bufferSource=null,this._activeSource=null}_OnEnded(e){this._isPaused||this._resumeMe||e.target!==this._activeSource||(this._hasPlaybackEnded=!0,this._isStopped=!0,this._instUid=-1,this._ReleaseBufferSource(),this._audioDomHandler.PostTrigger("ended",this._tag,this._aiId))}HasEnded(){return!(!this._isStopped&&this._bufferSource&&this._bufferSource.loop)&&!this._isPaused&&this._hasPlaybackEnded}CanBeRecycled(){return!this._bufferSource||this._isStopped||this.HasEnded()}GetPlaybackTime(e){let t=0;return t=this._isPaused?this._resumePosition:this.GetCurrentTime()-this._startTime,e&&(t*=this._playbackRate),this._isLooping||(t=Math.min(t,this.GetDuration())),t}Play(e,t,n,a){this._muteVol=1,this.SetVolume(t),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=e,this._bufferSource.start(a,n),this._hasPlaybackEnded=!1,this._isStopped=!1,this._isPaused=!1,this._isLooping=e,this._playbackRate=1,this._startTime=this.GetCurrentTime()-n}Stop(){this._bufferSource&&this._bufferSource.stop(0),this._isStopped=!0,this._isPaused=!1,this._instUid=-1}Pause(){this._isPaused||this._isStopped||this.HasEnded()||(this._resumePosition=this.GetPlaybackTime(!0),this._isLooping&&(this._resumePosition%=this.GetDuration()),this._isPaused=!0,this._bufferSource.stop(0))}Resume(){!this._isPaused||this._isStopped||this.HasEnded()||(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=!1)}GetOverallVolume(){return super.GetOverallVolume()*this._muteVol}_UpdateMuted(){this._muteVol=this._isMuted||this.IsSilent()?0:1,this._UpdateVolume()}SetLooping(e){e=!!e,this._isLooping===e||(this._isLooping=e,this._bufferSource&&(this._bufferSource.loop=e))}_UpdatePlaybackRate(){let e=this._playbackRate;this._isTimescaled&&(e*=this._audioDomHandler.GetTimeScale()),this._bufferSource&&(this._bufferSource.playbackRate.value=e)}Seek(e){this._isStopped||this.HasEnded()||(this._isPaused?this._resumePosition=e:(this.Pause(),this._resumePosition=e,this.Resume()))}GetResumePosition(){return this._resumePosition}SetSuspended(e){e?this.IsPlaying()?(this._resumeMe=!0,this._resumePosition=this.GetPlaybackTime(!0),this._isLooping&&(this._resumePosition%=this.GetDuration()),this._bufferSource.stop(0)):this._resumeMe=!1: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=!1)}_LoadAdditionalState(e){super._LoadAdditionalState(e),this._resumePosition=e.resumePosition}},"use strict";{function t(e){return Math.pow(10,e/20)}function n(e){return Math.max(Math.min(t(e),1),0)}function o(e){return 20*(Math.log(e)/2.302585092994046)}function i(e){return o(Math.max(Math.min(e,1),0))}function r(e,t){return 1-Math.exp(-t*e)}class e{constructor(e){this._audioDomHandler=e,this._audioContext=e.GetAudioContext(),this._index=-1,this._tag="",this._type="",this._params=null}Release(){this._audioContext=null}_SetIndex(e){this._index=e}GetIndex(){return this._index}_SetTag(e){this._tag=e}GetTag(){return this._tag}CreateGain(){return this._audioContext.createGain()}GetInputNode(){}ConnectTo(){}SetAudioParam(t,n,a,o){if(t.cancelScheduledValues(0),0===o)return void(t.value=n);const i=this._audioContext.currentTime;o+=i,0===a?t.setValueAtTime(n,o):1===a?(t.setValueAtTime(t.value,i),t.linearRampToValueAtTime(n,o)):2===a?(t.setValueAtTime(t.value,i),t.exponentialRampToValueAtTime(n,o)):void 0}GetState(){return{type:this._type,tag:this._tag,params:this._params}}}self.C3AudioFilterFX=class extends e{constructor(t,n,a,o,i,e,r){super(t),this._type="filter",this._params=[n,a,o,i,e,r],this._inputNode=this.CreateGain(),this._wetNode=this.CreateGain(),this._wetNode.gain.value=r,this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-r,this._filterNode=this._audioContext.createBiquadFilter(),this._filterNode.type=n,this._filterNode.frequency.value=a,this._filterNode.detune.value=o,this._filterNode.Q.value=i,this._filterNode.gain.vlaue=e,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(e){this._wetNode.disconnect(),this._wetNode.connect(e),this._dryNode.disconnect(),this._dryNode.connect(e)}GetInputNode(){return this._inputNode}SetParam(e,t,n,a){0===e?(t=Math.max(Math.min(t/100,1),0),this._params[5]=t,this.SetAudioParam(this._wetNode.gain,t,n,a),this.SetAudioParam(this._dryNode.gain,1-t,n,a)):1===e?(this._params[1]=t,this.SetAudioParam(this._filterNode.frequency,t,n,a)):2===e?(this._params[2]=t,this.SetAudioParam(this._filterNode.detune,t,n,a)):3===e?(this._params[3]=t,this.SetAudioParam(this._filterNode.Q,t,n,a)):4===e?(this._params[4]=t,this.SetAudioParam(this._filterNode.gain,t,n,a)):void 0}},self.C3AudioDelayFX=class extends e{constructor(e,t,n,a){super(e),this._type="delay",this._params=[t,n,a],this._inputNode=this.CreateGain(),this._wetNode=this.CreateGain(),this._wetNode.gain.value=a,this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-a,this._mainNode=this.CreateGain(),this._delayNode=this._audioContext.createDelay(t),this._delayNode.delayTime.value=t,this._delayGainNode=this.CreateGain(),this._delayGainNode.gain.value=n,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(e){this._wetNode.disconnect(),this._wetNode.connect(e),this._dryNode.disconnect(),this._dryNode.connect(e)}GetInputNode(){return this._inputNode}SetParam(t,a,o,i){0===t?(a=Math.max(Math.min(a/100,1),0),this._params[2]=a,this.SetAudioParam(this._wetNode.gain,a,o,i),this.SetAudioParam(this._dryNode.gain,1-a,o,i)):4===t?(this._params[1]=n(a),this.SetAudioParam(this._delayGainNode.gain,n(a),o,i)):5===t?(this._params[0]=a,this.SetAudioParam(this._delayNode.delayTime,a,o,i)):void 0}},self.C3AudioConvolveFX=class extends e{constructor(e,t,n,a){super(e),this._type="convolution",this._params=[n,a],this._bufferOriginalUrl="",this._bufferUrl="",this._bufferType="",this._inputNode=this.CreateGain(),this._wetNode=this.CreateGain(),this._wetNode.gain.value=a,this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-a,this._convolveNode=this._audioContext.createConvolver(),this._convolveNode.normalize=n,this._convolveNode.buffer=t,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(e){this._wetNode.disconnect(),this._wetNode.connect(e),this._dryNode.disconnect(),this._dryNode.connect(e)}GetInputNode(){return this._inputNode}SetParam(e,t,n,a){0===e?(t=Math.max(Math.min(t/100,1),0),this._params[1]=t,this.SetAudioParam(this._wetNode.gain,t,n,a),this.SetAudioParam(this._dryNode.gain,1-t,n,a)):void 0}_SetBufferInfo(e,t,n){this._bufferOriginalUrl=e,this._bufferUrl=t,this._bufferType=n}GetState(){const e=super.GetState();return e.bufferOriginalUrl=this._bufferOriginalUrl,e.bufferUrl="",e.bufferType=this._bufferType,e}},self.C3AudioFlangerFX=class extends e{constructor(t,n,a,o,i,e){super(t),this._type="flanger",this._params=[n,a,o,i,e],this._inputNode=this.CreateGain(),this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-e/2,this._wetNode=this.CreateGain(),this._wetNode.gain.value=e/2,this._feedbackNode=this.CreateGain(),this._feedbackNode.gain.value=i,this._delayNode=this._audioContext.createDelay(n+a),this._delayNode.delayTime.value=n,this._oscNode=this._audioContext.createOscillator(),this._oscNode.frequency.value=o,this._oscGainNode=this.CreateGain(),this._oscGainNode.gain.value=a,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(e){this._wetNode.disconnect(),this._wetNode.connect(e),this._dryNode.disconnect(),this._dryNode.connect(e)}GetInputNode(){return this._inputNode}SetParam(e,t,n,a){0===e?(t=Math.max(Math.min(t/100,1),0),this._params[4]=t,this.SetAudioParam(this._wetNode.gain,t/2,n,a),this.SetAudioParam(this._dryNode.gain,1-t/2,n,a)):6===e?(this._params[1]=t/1e3,this.SetAudioParam(this._oscGainNode.gain,t/1e3,n,a)):7===e?(this._params[2]=t,this.SetAudioParam(this._oscNode.frequency,t,n,a)):8===e?(this._params[3]=t/100,this.SetAudioParam(this._feedbackNode.gain,t/100,n,a)):void 0}},self.C3AudioPhaserFX=class extends e{constructor(t,n,a,o,i,e,r){super(t),this._type="phaser",this._params=[n,a,o,i,e,r],this._inputNode=this.CreateGain(),this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-r/2,this._wetNode=this.CreateGain(),this._wetNode.gain.value=r/2,this._filterNode=this._audioContext.createBiquadFilter(),this._filterNode.type="allpass",this._filterNode.frequency.value=n,this._filterNode.detune.value=a,this._filterNode.Q.value=o,this._oscNode=this._audioContext.createOscillator(),this._oscNode.frequency.value=e,this._oscGainNode=this.CreateGain(),this._oscGainNode.gain.value=i,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(e){this._wetNode.disconnect(),this._wetNode.connect(e),this._dryNode.disconnect(),this._dryNode.connect(e)}GetInputNode(){return this._inputNode}SetParam(e,t,n,a){0===e?(t=Math.max(Math.min(t/100,1),0),this._params[5]=t,this.SetAudioParam(this._wetNode.gain,t/2,n,a),this.SetAudioParam(this._dryNode.gain,1-t/2,n,a)):1===e?(this._params[0]=t,this.SetAudioParam(this._filterNode.frequency,t,n,a)):2===e?(this._params[1]=t,this.SetAudioParam(this._filterNode.detune,t,n,a)):3===e?(this._params[2]=t,this.SetAudioParam(this._filterNode.Q,t,n,a)):6===e?(this._params[3]=t,this.SetAudioParam(this._oscGainNode.gain,t,n,a)):7===e?(this._params[4]=t,this.SetAudioParam(this._oscNode.frequency,t,n,a)):void 0}},self.C3AudioGainFX=class extends e{constructor(e,t){super(e),this._type="gain",this._params=[t],this._node=this.CreateGain(),this._node.gain.value=t}Release(){this._node.disconnect(),super.Release()}ConnectTo(e){this._node.disconnect(),this._node.connect(e)}GetInputNode(){return this._node}SetParam(t,a,o,i){4===t?(this._params[0]=n(a),this.SetAudioParam(this._node.gain,n(a),o,i)):void 0}},self.C3AudioTremoloFX=class extends e{constructor(e,t,n){super(e),this._type="tremolo",this._params=[t,n],this._node=this.CreateGain(),this._node.gain.value=1-n/2,this._oscNode=this._audioContext.createOscillator(),this._oscNode.frequency.value=t,this._oscGainNode=this.CreateGain(),this._oscGainNode.gain.value=n/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(e){this._node.disconnect(),this._node.connect(e)}GetInputNode(){return this._node}SetParam(e,t,n,a){0===e?(t=Math.max(Math.min(t/100,1),0),this._params[1]=t,this.SetAudioParam(this._node.gain.value,1-t/2,n,a),this.SetAudioParam(this._oscGainNode.gain.value,t/2,n,a)):7===e?(this._params[0]=t,this.SetAudioParam(this._oscNode.frequency,t,n,a)):void 0}},self.C3AudioRingModFX=class extends e{constructor(e,t,n){super(e),this._type="ringmod",this._params=[t,n],this._inputNode=this.CreateGain(),this._wetNode=this.CreateGain(),this._wetNode.gain.value=n,this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-n,this._ringNode=this.CreateGain(),this._ringNode.gain.value=0,this._oscNode=this._audioContext.createOscillator(),this._oscNode.frequency.value=t,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(e){this._wetNode.disconnect(),this._wetNode.connect(e),this._dryNode.disconnect(),this._dryNode.connect(e)}GetInputNode(){return this._inputNode}SetParam(e,t,n,a){0===e?(t=Math.max(Math.min(t/100,1),0),this._params[1]=t,this.SetAudioParam(this._wetNode.gain,t,n,a),this.SetAudioParam(this._dryNode.gain,1-t,n,a)):7===e?(this._params[0]=t,this.SetAudioParam(this._oscNode.frequency,t,n,a)):void 0}},self.C3AudioDistortionFX=class extends e{constructor(t,n,a,o,i,e){super(t),this._type="distortion",this._params=[n,a,o,i,e],this._inputNode=this.CreateGain(),this._preGain=this.CreateGain(),this._postGain=this.CreateGain(),this._SetDrive(o,i),this._wetNode=this.CreateGain(),this._wetNode.gain.value=e,this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-e,this._waveShaper=this._audioContext.createWaveShaper(),this._curve=new Float32Array(65536),this._GenerateColortouchCurve(n,a),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(e,t){.01>e&&(e=.01),this._preGain.gain.value=e,this._postGain.gain.value=Math.pow(1/e,.6)*t}_GenerateColortouchCurve(e,t){for(let n,a=0;32768>a;++a)n=a/32768,n=this._Shape(n,e,t),this._curve[32768+a]=n,this._curve[32768-a-1]=-n}_Shape(e,t,n){const a=1.05*n*t-t,o=0>e?-1:1,i=0>e?-e:e;let d=in&&(n=-n),this._peakthis._OnGetInitialState()),window.addEventListener("resize",()=>this._OnResize())}_OnGetInitialState(){return{screenWidth:screen.width,screenHeight:screen.height,windowOuterWidth:window.outerWidth,windowOuterHeight:window.outerHeight,safeAreaInset:this._GetSafeAreaInset()}}_GetSafeAreaInset(){const e=document.body,t=e.style;t.setProperty("--temp-sai-top","env(safe-area-inset-top)"),t.setProperty("--temp-sai-right","env(safe-area-inset-right)"),t.setProperty("--temp-sai-bottom","env(safe-area-inset-bottom)"),t.setProperty("--temp-sai-left","env(safe-area-inset-left)");const n=getComputedStyle(e),a=[n.getPropertyValue("--temp-sai-top"),n.getPropertyValue("--temp-sai-right"),n.getPropertyValue("--temp-sai-bottom"),n.getPropertyValue("--temp-sai-left")].map(e=>{const t=parseInt(e,10);return isFinite(t)?t:0});return t.removeProperty("--temp-sai-top"),t.removeProperty("--temp-sai-right"),t.removeProperty("--temp-sai-bottom"),t.removeProperty("--temp-sai-left"),a}_OnResize(){this.PostToRuntime("window-resize",{windowOuterWidth:window.outerWidth,windowOuterHeight:window.outerHeight,safeAreaInset:this._GetSafeAreaInset()})}};RuntimeInterface.AddDOMHandlerClass(e)}{const e=class extends DOMHandler{constructor(e){super(e,"browser"),this._exportType="",this.AddRuntimeMessageHandler("get-initial-state",e=>this._OnGetInitialState(e)),this.AddRuntimeMessageHandler("ready-for-sw-messages",()=>this._OnReadyForSWMessages()),this.AddRuntimeMessageHandler("alert",e=>this._OnAlert(e)),this.AddRuntimeMessageHandler("close",()=>this._OnClose()),this.AddRuntimeMessageHandler("set-focus",e=>this._OnSetFocus(e)),this.AddRuntimeMessageHandler("vibrate",e=>this._OnVibrate(e)),this.AddRuntimeMessageHandler("lock-orientation",e=>this._OnLockOrientation(e)),this.AddRuntimeMessageHandler("unlock-orientation",()=>this._OnUnlockOrientation()),this.AddRuntimeMessageHandler("navigate",e=>this._OnNavigate(e)),this.AddRuntimeMessageHandler("request-fullscreen",e=>this._OnRequestFullscreen(e)),this.AddRuntimeMessageHandler("exit-fullscreen",()=>this._OnExitFullscreen()),window.addEventListener("online",()=>this._OnOnlineStateChanged(!0)),window.addEventListener("offline",()=>this._OnOnlineStateChanged(!1)),document.addEventListener("backbutton",()=>this._OnCordovaBackButton()),"undefined"!=typeof Windows&&Windows.UI.Core.SystemNavigationManager.getForCurrentView().addEventListener("backrequested",e=>this._OnWin10BackRequested(e))}_OnGetInitialState(e){return this._exportType=e.exportType,{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:"undefined"!=typeof window.is_scirra_arcade}}_OnReadyForSWMessages(){window.C3_RegisterSW&&window.OfflineClientInfo&&window.OfflineClientInfo.SetMessageCallback(e=>this.PostToRuntime("sw-message",e.data))}_OnOnlineStateChanged(e){this.PostToRuntime("online-state",{isOnline:e})}_OnCordovaBackButton(){this.PostToRuntime("backbutton")}_OnWin10BackRequested(e){e.handled=!0,this.PostToRuntime("backbutton")}GetNWjsWindow(){return"nwjs"===this._exportType?nw.Window.get():null}_OnAlert(e){alert(e.message)}_OnClose(){navigator.app&&navigator.app.exitApp?navigator.app.exitApp():navigator.device&&navigator.device.exitApp?navigator.device.exitApp():window.close()}_OnSetFocus(e){const t=e.isFocus;if("nwjs"===this._exportType){const e=this.GetNWjsWindow();t?e.focus():e.blur()}else t?window.focus():window.blur()}_OnVibrate(e){navigator.vibrate&&navigator.vibrate(e.pattern)}_OnLockOrientation(e){const t=e.orientation;if(screen.orientation&&screen.orientation.lock)screen.orientation.lock(t).catch(e=>console.warn("[Construct 3] Failed to lock orientation: ",e));else try{let e=!1;screen.lockOrientation?e=screen.lockOrientation(t):screen.webkitLockOrientation?e=screen.webkitLockOrientation(t):screen.mozLockOrientation?e=screen.mozLockOrientation(t):screen.msLockOrientation&&(e=screen.msLockOrientation(t)),e||console.warn("[Construct 3] Failed to lock orientation")}catch(e){console.warn("[Construct 3] Failed to lock orientation: ",e)}}_OnUnlockOrientation(){try{screen.orientation&&screen.orientation.unlock?screen.orientation.unlock():screen.unlockOrientation?screen.unlockOrientation():screen.webkitUnlockOrientation?screen.webkitUnlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()}catch(e){}}_OnNavigate(e){const t=e.type;if("back"===t)navigator.app&&navigator.app.backHistory?navigator.app.backHistory():window.back();else if("forward"===t)window.forward();else if("home"===t)window.home();else if("reload"===t)location.reload();else if("url"===t){const t=e.url,n=e.target,a=e.exportType;"windows-uwp"===a&&"undefined"!=typeof Windows?Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(t)):"cordova"===a?window.open(t,"_system"):"preview"===a?window.open(t,"_blank"):!this._isScirraArcade&&(2===n?window.top.location=t:1===n?window.parent.location=t:window.location=t)}else if("new-window"===t){const t=e.url,n=e.tag,a=e.exportType;"windows-uwp"===a&&"undefined"!=typeof Windows?Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(t)):"cordova"===a?window.open(t,"_system"):window.open(t,n)}}_OnRequestFullscreen(e){const t={navigationUI:"auto"},n=e.navUI;1===n?t.navigationUI="hide":2===n&&(t.navigationUI="show");const a=document.documentElement;a.requestFullscreen?a.requestFullscreen(t):a.mozRequestFullScreen?a.mozRequestFullScreen(t):a.msRequestFullscreen?a.msRequestFullscreen(t):a.webkitRequestFullScreen&&("undefined"==typeof Element.ALLOW_KEYBOARD_INPUT?a.webkitRequestFullScreen():a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT))}_OnExitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}};RuntimeInterface.AddDOMHandlerClass(e)} \ No newline at end of file diff --git a/shuttlestudio.it/giochi/albanovsdinos/scripts/offlineclient.js b/shuttlestudio.it/giochi/albanovsdinos/scripts/offlineclient.js new file mode 100644 index 0000000..d8c3274 --- /dev/null +++ b/shuttlestudio.it/giochi/albanovsdinos/scripts/offlineclient.js @@ -0,0 +1 @@ +"use strict";{window.OfflineClientInfo=new class{constructor(){if(this._broadcastChannel="undefined"==typeof BroadcastChannel?null:new BroadcastChannel("offline"),this._queuedMessages=[],this._onMessageCallback=null,this._broadcastChannel){var a=this;this._broadcastChannel.onmessage=function(b){a._OnBroadcastChannelMessage(b)}}}_OnBroadcastChannelMessage(a){return this._onMessageCallback?void this._onMessageCallback(a):void this._queuedMessages.push(a)}SetMessageCallback(a){this._onMessageCallback=a;for(let b of this._queuedMessages)this._onMessageCallback(b);this._queuedMessages.length=0}}} \ No newline at end of file diff --git a/shuttlestudio.it/giochi/albanovsdinos/scripts/register-sw.js b/shuttlestudio.it/giochi/albanovsdinos/scripts/register-sw.js new file mode 100644 index 0000000..aeb70f5 --- /dev/null +++ b/shuttlestudio.it/giochi/albanovsdinos/scripts/register-sw.js @@ -0,0 +1 @@ +"use strict";window.C3_RegisterSW=async function(){if(navigator.serviceWorker)try{const a=await navigator.serviceWorker.register("sw.js",{scope:"./"});console.info("Registered service worker on "+a.scope)}catch(a){console.warn("Failed to register service worker: ",a)}}; \ No newline at end of file diff --git a/shuttlestudio.it/giochi/albanovsdinos/scripts/supportcheck.js b/shuttlestudio.it/giochi/albanovsdinos/scripts/supportcheck.js new file mode 100644 index 0000000..a17ff0a --- /dev/null +++ b/shuttlestudio.it/giochi/albanovsdinos/scripts/supportcheck.js @@ -0,0 +1 @@ +"use strict";(function(){var a=!!document.querySelector("script[src*=\"kaspersky\"]"),b=document.createElement("canvas"),c=!!(b.getContext("webgl")||b.getContext("experimental-webgl")),d=[];if(c||d.push("WebGL"),"undefined"==typeof WebAssembly&&d.push("WebAssembly"),0===d.length&&!a)window["C3_IsSupported"]=!0;else{var e=document.createElement("div");e.id="notSupportedWrap",document.body.appendChild(e);var f=document.createElement("h2");f.id="notSupportedTitle",f.textContent=a?"Kaspersky Internet Security broke this export":"Software update needed",e.appendChild(f);var g=document.createElement("p");g.className="notSupportedMessage";var h="This content is not supported because your device's software is out-of-date. ",i=navigator.userAgent;/android/i.test(i)?h+="

On Android, fix this by making sure the
Android System Webview app has updates enabled and is up-to-date.":/iphone|ipad|ipod/i.test(i)?h+="

Note: the iOS simulator is not currently supported due to an Apple bug. If you are using the simulator, try testing on a real device instead.":(/msie/i.test(i)||/trident/i.test(i))&&!/edge\//i.test(i)?h+="

Note: Internet Explorer is not supported. Try using Chrome or Firefox instead.":a?h="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.":h+="Try installing any available software updates. Alternatively try on a different device.",h+="

Missing features: "+d.join(", ")+"
User agent: "+navigator.userAgent+"
",g.innerHTML=h,e.appendChild(g)}})(); \ No newline at end of file diff --git a/shuttlestudio.it/giochi/albanovsdinos/style.css b/shuttlestudio.it/giochi/albanovsdinos/style.css new file mode 100644 index 0000000..cddc94c --- /dev/null +++ b/shuttlestudio.it/giochi/albanovsdinos/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/shuttlestudio.it/giochi/albanovsdinos/sw.js b/shuttlestudio.it/giochi/albanovsdinos/sw.js new file mode 100644 index 0000000..4366997 --- /dev/null +++ b/shuttlestudio.it/giochi/albanovsdinos/sw.js @@ -0,0 +1 @@ +"use strict";const OFFLINE_DATA_FILE="offline.json",CACHE_NAME_PREFIX="c3offline",BROADCASTCHANNEL_NAME="offline",CONSOLE_PREFIX="[SW] ",LAZYLOAD_KEYNAME="",broadcastChannel="undefined"==typeof BroadcastChannel?null:new BroadcastChannel("offline");function PostBroadcastMessage(a){broadcastChannel&&setTimeout(()=>broadcastChannel.postMessage(a),3e3)}function Broadcast(a){PostBroadcastMessage({"type":a})}function BroadcastDownloadingUpdate(a){PostBroadcastMessage({"type":"downloading-update","version":a})}function BroadcastUpdateReady(a){PostBroadcastMessage({"type":"update-ready","version":a})}function IsUrlInLazyLoadList(a,b){if(!b)return!1;try{for(const c of b)if(new RegExp(c).test(a))return!0}catch(a){console.error("[SW] Error matching in lazy-load list: ",a)}return!1}function WriteLazyLoadListToStorage(a){return"undefined"==typeof localforage?Promise.resolve():localforage.setItem(LAZYLOAD_KEYNAME,a)}function ReadLazyLoadListFromStorage(){return"undefined"==typeof localforage?Promise.resolve([]):localforage.getItem(LAZYLOAD_KEYNAME)}function GetCacheBaseName(){return"c3offline-"+self.registration.scope}function GetCacheVersionName(a){return GetCacheBaseName()+"-v"+a}async function GetAvailableCacheNames(){const a=await caches.keys(),b=GetCacheBaseName();return a.filter((a)=>a.startsWith(b))}async function IsUpdatePending(){const a=await GetAvailableCacheNames();return 2<=a.length}async function GetMainPageUrl(){const a=await clients.matchAll({includeUncontrolled:!0,type:"window"});for(const b of a){let a=b.url;if(a.startsWith(self.registration.scope)&&(a=a.substring(self.registration.scope.length)),a&&"/"!==a)return a.startsWith("?")&&(a="/"+a),a}return""}function fetchWithBypass(a,b){return"string"==typeof a&&(a=new Request(a)),b?fetch(a.url,{headers:a.headers,mode:a.mode,credentials:a.credentials,redirect:a.redirect,cache:"no-store"}):fetch(a)}async function CreateCacheFromFileList(a,b,c){const d=await Promise.all(b.map((a)=>fetchWithBypass(a,c)));let e=!0;for(const f of d)f.ok||(e=!1,console.error("[SW] Error fetching '"+f.url+"' ("+f.status+" "+f.statusText+")"));if(!e)throw new Error("not all resources were fetched successfully");const f=await caches.open(a);try{return await Promise.all(d.map((a,c)=>f.put(b[c],a)))}catch(b){throw console.error("[SW] Error writing cache entries: ",b),caches.delete(a),b}}async function UpdateCheck(a){try{const b=await fetchWithBypass(OFFLINE_DATA_FILE,!0);if(!b.ok)throw new Error("offline.json responded with "+b.status+" "+b.statusText);const c=await b.json(),d=c.version,e=c.fileList,f=c.lazyLoad,g=GetCacheVersionName(d),h=await caches.has(g);if(h){const a=await IsUpdatePending();return void(a?(console.log("[SW] Update pending"),Broadcast("update-pending")):(console.log("[SW] Up to date"),Broadcast("up-to-date")))}const i=await GetMainPageUrl();e.unshift("./"),i&&-1===e.indexOf(i)&&e.unshift(i),console.log("[SW] Caching "+e.length+" files for offline use"),a?Broadcast("downloading"):BroadcastDownloadingUpdate(d),f&&(await WriteLazyLoadListToStorage(f)),await CreateCacheFromFileList(g,e,!a);const j=await IsUpdatePending();j?(console.log("[SW] All resources saved, update ready"),BroadcastUpdateReady(d)):(console.log("[SW] All resources saved, offline support ready"),Broadcast("offline-ready"))}catch(a){console.warn("[SW] Update check failed: ",a)}}self.addEventListener("install",(a)=>{a.waitUntil(UpdateCheck(!0).catch(()=>null))});async function GetCacheNameToUse(a,b){if(1===a.length||!b)return a[0];const c=await clients.matchAll();if(1caches.delete(a))),d}async function HandleFetch(a,b){const c=await GetAvailableCacheNames();if(!c.length)return fetch(a.request);const d=await GetCacheNameToUse(c,b),e=await caches.open(d),f=await e.match(a.request);if(f)return f;const g=await Promise.all([fetch(a.request),ReadLazyLoadListFromStorage()]),h=g[0],i=g[1];if(IsUrlInLazyLoadList(a.request.url,i))try{await e.put(a.request,h.clone())}catch(b){console.warn("[SW] Error caching '"+a.request.url+"': ",b)}return h}self.addEventListener("fetch",(a)=>{if(new URL(a.request.url).origin===location.origin){const b="navigate"===a.request.mode,c=HandleFetch(a,b);b&&a.waitUntil(c.then(()=>UpdateCheck(!1))),a.respondWith(c)}}); \ No newline at end of file