diff --git a/public/Roll-a-ball/Build/Builds.asm.code.unityweb b/public/Roll-a-ball/Build/Builds.asm.code.unityweb new file mode 100644 index 0000000000000000000000000000000000000000..d734c39b84ee38fc2a917f0d8a76cc26aaf1c1fa Binary files /dev/null and b/public/Roll-a-ball/Build/Builds.asm.code.unityweb differ diff --git a/public/Roll-a-ball/Build/Builds.asm.framework.unityweb b/public/Roll-a-ball/Build/Builds.asm.framework.unityweb new file mode 100644 index 0000000000000000000000000000000000000000..85d10ff22e3582125de78adacefc67439bd9f57e Binary files /dev/null and b/public/Roll-a-ball/Build/Builds.asm.framework.unityweb differ diff --git a/public/Roll-a-ball/Build/Builds.asm.memory.unityweb b/public/Roll-a-ball/Build/Builds.asm.memory.unityweb new file mode 100644 index 0000000000000000000000000000000000000000..e414d2a4976e79414c12d63e2a375ceae75709c7 Binary files /dev/null and b/public/Roll-a-ball/Build/Builds.asm.memory.unityweb differ diff --git a/public/Roll-a-ball/Build/Builds.data.unityweb b/public/Roll-a-ball/Build/Builds.data.unityweb new file mode 100644 index 0000000000000000000000000000000000000000..39766d5a28d051fa591c3e6cd60140fa92c93123 Binary files /dev/null and b/public/Roll-a-ball/Build/Builds.data.unityweb differ diff --git a/public/Roll-a-ball/Build/Builds.json b/public/Roll-a-ball/Build/Builds.json new file mode 100644 index 0000000000000000000000000000000000000000..231968ab96aaf3df2b6a939a6035af449e5793f4 --- /dev/null +++ b/public/Roll-a-ball/Build/Builds.json @@ -0,0 +1,13 @@ +{ +"companyName": "DefaultCompany", +"productName": "Roll-a-ball", +"dataUrl": "Builds.data.unityweb", +"asmCodeUrl": "Builds.asm.code.unityweb", +"asmMemoryUrl": "Builds.asm.memory.unityweb", +"asmFrameworkUrl": "Builds.asm.framework.unityweb", +"TOTAL_MEMORY": 268435456, +"graphicsAPI": ["WebGL 2.0", "WebGL 1.0"], +"webglContextAttributes": {"preserveDrawingBuffer": false}, +"splashScreenStyle": "Dark", +"backgroundColor": "#231F20" +} \ No newline at end of file diff --git a/public/Roll-a-ball/Build/UnityLoader.js b/public/Roll-a-ball/Build/UnityLoader.js new file mode 100644 index 0000000000000000000000000000000000000000..5c290fb26335be2d35f809f0716bc79213337927 --- /dev/null +++ b/public/Roll-a-ball/Build/UnityLoader.js @@ -0,0 +1,4 @@ +var UnityLoader=UnityLoader||{compatibilityCheck:function(e,t,r){UnityLoader.SystemInfo.hasWebGL?UnityLoader.SystemInfo.mobile?e.popup("Please note that Unity WebGL is not currently supported on mobiles. Press OK if you wish to continue anyway.",[{text:"OK",callback:t}]):["Firefox","Chrome","Safari"].indexOf(UnityLoader.SystemInfo.browser)==-1?e.popup("Please note that your browser is not currently supported for this Unity WebGL content. Press OK if you wish to continue anyway.",[{text:"OK",callback:t}]):t():e.popup("Your browser does not support WebGL",[{text:"OK",callback:r}])},Blobs:{},loadCode:function(e,t,r){var n=[].slice.call(UnityLoader.Cryptography.md5(e)).map(function(e){return("0"+e.toString(16)).substr(-2)}).join(""),o=document.createElement("script"),a=URL.createObjectURL(new Blob(['UnityLoader["'+n+'"]=',e],{type:"text/javascript"}));UnityLoader.Blobs[a]=r,o.src=a,o.onload=function(){URL.revokeObjectURL(a),t(n)},document.body.appendChild(o)},allocateHeapJob:function(e,t){for(var r=e.TOTAL_STACK||5242880,n=e.TOTAL_MEMORY||(e.buffer?e.buffer.byteLength:268435456),o=65536,a=16777216,i=o;i<n||i<2*r;)i+=i<a?i:a;i!=n&&e.printErr("increasing TOTAL_MEMORY to "+i+" to be compliant with the asm.js spec (and given that TOTAL_STACK="+r+")"),n=i,t.parameters.useWasm?(e.wasmMemory=new WebAssembly.Memory({initial:n/o,maximum:n/o}),e.buffer=e.wasmMemory.buffer):e.buffer?e.buffer.byteLength!=n&&(e.printErr("provided buffer should be "+n+" bytes, but it is "+e.buffer.byteLength+", reallocating the buffer"),e.buffer=new ArrayBuffer(n)):e.buffer=new ArrayBuffer(n),e.TOTAL_MEMORY=e.buffer.byteLength,t.complete()},setupIndexedDBJob:function(e,t){function r(n){r.called||(r.called=!0,e.indexedDB=n,t.complete())}try{var n=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,o=n.open("/idbfs-test");o.onerror=function(e){e.preventDefault(),r()},o.onsuccess=function(){o.result.close(),r(n)},setTimeout(r,1e3)}catch(e){r()}},processWasmCodeJob:function(e,t){e.wasmBinary=UnityLoader.Job.result(e,"downloadWasmCode"),t.complete()},processWasmFrameworkJob:function(e,t){UnityLoader.loadCode(UnityLoader.Job.result(e,"downloadWasmFramework"),function(r){UnityLoader[r](e),t.complete()},{Module:e,url:e.wasmFrameworkUrl})},processAsmCodeJob:function(e,t){var r=UnityLoader.Job.result(e,"downloadAsmCode");UnityLoader.loadCode(Math.fround?r:UnityLoader.Utils.optimizeMathFround(r),function(r){e.asm=UnityLoader[r],t.complete()},{Module:e,url:e.asmCodeUrl})},processAsmFrameworkJob:function(e,t){UnityLoader.loadCode(UnityLoader.Job.result(e,"downloadAsmFramework"),function(r){UnityLoader[r](e),t.complete()},{Module:e,url:e.asmFrameworkUrl})},processAsmMemoryJob:function(e,t){e.memoryInitializerRequest.status=200,e.memoryInitializerRequest.response=UnityLoader.Job.result(e,"downloadAsmMemory"),e.memoryInitializerRequest.callback&&e.memoryInitializerRequest.callback(),t.complete()},processDataJob:function(e,t){var r=UnityLoader.Job.result(e,"downloadData"),n=new DataView(r.buffer,r.byteOffset,r.byteLength),o=0,a="UnityWebData1.0\0";if(!String.fromCharCode.apply(null,r.subarray(o,o+a.length))==a)throw"unknown data format";o+=a.length;var i=n.getUint32(o,!0);for(o+=4;o<i;){var s=n.getUint32(o,!0);o+=4;var d=n.getUint32(o,!0);o+=4;var l=n.getUint32(o,!0);o+=4;var u=String.fromCharCode.apply(null,r.subarray(o,o+l));o+=l;for(var f=0,c=u.indexOf("/",f)+1;c>0;f=c,c=u.indexOf("/",f)+1)e.FS_createPath(u.substring(0,f),u.substring(f,c-1),!0,!0);e.FS_createDataFile(u,null,r.subarray(s,s+d),!0,!0,!0)}e.removeRunDependency("processDataJob"),t.complete()},downloadJob:function(e,t){var r=t.parameters.objParameters?new UnityLoader.XMLHttpRequest(t.parameters.objParameters):new XMLHttpRequest;r.open("GET",t.parameters.url),r.responseType="arraybuffer",r.onload=function(){UnityLoader.Compression.decompress(new Uint8Array(r.response),function(e){t.complete(e)})},t.parameters.onprogress&&r.addEventListener("progress",t.parameters.onprogress),t.parameters.onload&&r.addEventListener("load",t.parameters.onload),r.send()},scheduleBuildDownloadJob:function(e,t,r){UnityLoader.Progress.update(e,t),UnityLoader.Job.schedule(e,t,[],UnityLoader.downloadJob,{url:e.resolveBuildUrl(e[r]),onprogress:function(r){UnityLoader.Progress.update(e,t,r)},onload:function(r){UnityLoader.Progress.update(e,t,r)},objParameters:e.companyName&&e.productName&&e.cacheControl&&e.cacheControl[r]?{companyName:e.companyName,productName:e.productName,cacheControl:e.cacheControl[r]}:null})},loadModule:function(e){if(e.useWasm=e.wasmCodeUrl&&UnityLoader.SystemInfo.hasWasm,e.useWasm)UnityLoader.scheduleBuildDownloadJob(e,"downloadWasmCode","wasmCodeUrl"),UnityLoader.Job.schedule(e,"processWasmCode",["downloadWasmCode"],UnityLoader.processWasmCodeJob),UnityLoader.scheduleBuildDownloadJob(e,"downloadWasmFramework","wasmFrameworkUrl"),UnityLoader.Job.schedule(e,"processWasmFramework",["downloadWasmFramework","processWasmCode","setupIndexedDB"],UnityLoader.processWasmFrameworkJob);else{if(!e.asmCodeUrl)throw"WebAssembly support is not detected in this browser.";UnityLoader.scheduleBuildDownloadJob(e,"downloadAsmCode","asmCodeUrl"),UnityLoader.Job.schedule(e,"processAsmCode",["downloadAsmCode"],UnityLoader.processAsmCodeJob),UnityLoader.scheduleBuildDownloadJob(e,"downloadAsmMemory","asmMemoryUrl"),UnityLoader.Job.schedule(e,"processAsmMemory",["downloadAsmMemory"],UnityLoader.processAsmMemoryJob),e.memoryInitializerRequest={addEventListener:function(t,r){e.memoryInitializerRequest.callback=r}},e.asmLibraryUrl&&(e.dynamicLibraries=[e.asmLibraryUrl].map(e.resolveBuildUrl)),UnityLoader.scheduleBuildDownloadJob(e,"downloadAsmFramework","asmFrameworkUrl"),UnityLoader.Job.schedule(e,"processAsmFramework",["downloadAsmFramework","processAsmCode","setupIndexedDB"],UnityLoader.processAsmFrameworkJob)}UnityLoader.scheduleBuildDownloadJob(e,"downloadData","dataUrl"),UnityLoader.Job.schedule(e,"setupIndexedDB",[],UnityLoader.setupIndexedDBJob),e.preRun.push(function(){e.addRunDependency("processDataJob"),UnityLoader.Job.schedule(e,"processData",["downloadData"],UnityLoader.processDataJob)})},instantiate:function(e,t,r){function n(e,r){if("string"==typeof e&&!(e=document.getElementById(e)))return!1;e.innerHTML="",e.style.border=e.style.margin=e.style.padding=0,"static"==getComputedStyle(e).getPropertyValue("position")&&(e.style.position="relative"),e.style.width=r.width||e.style.width,e.style.height=r.height||e.style.height,r.container=e;var n=r.Module;return n.canvas=document.createElement("canvas"),n.canvas.style.width="100%",n.canvas.style.height="100%",n.canvas.addEventListener("contextmenu",function(e){e.preventDefault()}),n.canvas.id="#canvas",e.appendChild(n.canvas),r.compatibilityCheck(r,function(){var t=new XMLHttpRequest;t.open("GET",r.url,!0),t.responseType="text",t.onerror=function(){n.print("Could not download "+r.url),0==document.URL.indexOf("file:")&&alert("It seems your browser does not support running Unity WebGL content from file:// urls. Please upload it to an http server, or try a different browser.")},t.onload=function(){var o=JSON.parse(t.responseText);for(var a in o)"undefined"==typeof n[a]&&(n[a]=o[a]);for(var i=!1,s=0;s<n.graphicsAPI.length;s++){var d=n.graphicsAPI[s];"WebGL 2.0"==d&&2==UnityLoader.SystemInfo.hasWebGL?i=!0:"WebGL 1.0"==d&&UnityLoader.SystemInfo.hasWebGL>=1?i=!0:n.print("Warning: Unsupported graphics API "+d)}return i?(e.style.background=n.backgroundUrl?"center/cover url('"+n.resolveBuildUrl(n.backgroundUrl)+"')":n.backgroundColor?" "+n.backgroundColor:"",r.onProgress(r,0),void UnityLoader.loadModule(n)):void r.popup("Your browser does not support any of the required graphics API for this content: "+n.graphicsAPI,[{text:"OK"}])},t.send()},function(){n.print("Instantiation of the '"+t+"' terminated due to the failed compatibility check.")}),!0}var o={url:t,onProgress:UnityLoader.Progress.handler,compatibilityCheck:UnityLoader.compatibilityCheck,Module:{preRun:[],postRun:[],print:function(e){console.log(e)},printErr:function(e){console.error(e)},Jobs:{},buildDownloadProgress:{},resolveBuildUrl:function(e){return e.match(/(http|https|ftp|file):\/\//)?e:t.substring(0,t.lastIndexOf("/")+1)+e}},SetFullscreen:function(){if(o.Module.SetFullscreen)return o.Module.SetFullscreen.apply(o.Module,arguments)},SendMessage:function(){if(o.Module.SendMessage)return o.Module.SendMessage.apply(o.Module,arguments)}};o.Module.gameInstance=o,o.popup=function(e,t){return UnityLoader.Error.popup(o,e,t)},o.Module.postRun.push(function(){o.onProgress(o,1)});for(var a in r)if("Module"==a)for(var i in r[a])o.Module[i]=r[a][i];else o[a]=r[a];return n(e,o)||document.addEventListener("DOMContentLoaded",function(){n(e,o)}),o},SystemInfo:function(){var e,t,r,n="-",o=navigator.appVersion,a=navigator.userAgent,i=navigator.appName,s=navigator.appVersion,d=parseInt(navigator.appVersion,10);(t=a.indexOf("Opera"))!=-1?(i="Opera",s=a.substring(t+6),(t=a.indexOf("Version"))!=-1&&(s=a.substring(t+8))):(t=a.indexOf("MSIE"))!=-1?(i="Microsoft Internet Explorer",s=a.substring(t+5)):(t=a.indexOf("Chrome"))!=-1?(i="Chrome",s=a.substring(t+7)):(t=a.indexOf("Safari"))!=-1?(i="Safari",s=a.substring(t+7),(t=a.indexOf("Version"))!=-1&&(s=a.substring(t+8))):(t=a.indexOf("Firefox"))!=-1?(i="Firefox",s=a.substring(t+8)):a.indexOf("Trident/")!=-1?(i="Microsoft Internet Explorer",s=a.substring(a.indexOf("rv:")+3)):(e=a.lastIndexOf(" ")+1)<(t=a.lastIndexOf("/"))&&(i=a.substring(e,t),s=a.substring(t+1),i.toLowerCase()==i.toUpperCase()&&(i=navigator.appName)),(r=s.indexOf(";"))!=-1&&(s=s.substring(0,r)),(r=s.indexOf(" "))!=-1&&(s=s.substring(0,r)),(r=s.indexOf(")"))!=-1&&(s=s.substring(0,r)),d=parseInt(""+s,10),isNaN(d)?(s=""+parseFloat(navigator.appVersion),d=parseInt(navigator.appVersion,10)):s=""+parseFloat(s);var l=/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(o),u=n,f=[{s:"Windows 3.11",r:/Win16/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 10",r:/(Windows 10|Windows NT 10.0)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows ME",r:/Windows ME/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(var c in f){var h=f[c];if(h.r.test(a)){u=h.s;break}}var p=n;switch(/Windows/.test(u)&&(p=/Windows (.*)/.exec(u)[1],u="Windows"),u){case"Mac OS X":p=/Mac OS X (10[\.\_\d]+)/.exec(a)[1];break;case"Android":p=/Android ([\.\_\d]+)/.exec(a)[1];break;case"iOS":p=/OS (\d+)_(\d+)_?(\d+)?/.exec(o),p=p[1]+"."+p[2]+"."+(0|p[3])}return{width:screen.width?screen.width:0,height:screen.height?screen.height:0,browser:i,browserVersion:s,mobile:l,os:u,osVersion:p,gpu:function(){var e=document.createElement("canvas"),t=e.getContext("experimental-webgl");if(t){var r=t.getExtension("WEBGL_debug_renderer_info");if(r)return t.getParameter(r.UNMASKED_RENDERER_WEBGL)}return n}(),language:window.navigator.userLanguage||window.navigator.language,hasWebGL:function(){if(!window.WebGLRenderingContext)return 0;var e=document.createElement("canvas"),t=e.getContext("webgl2");return t?2:(t=e.getContext("experimental-webgl2"),t?2:(t=e.getContext("webgl"),t||(t=e.getContext("experimental-webgl"))?1:0))}(),hasCursorLock:function(){var e=document.createElement("canvas");return e.requestPointerLock||e.mozRequestPointerLock||e.webkitRequestPointerLock||e.msRequestPointerLock?1:0}(),hasFullscreen:function(){var e=document.createElement("canvas");return(e.requestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen||e.webkitRequestFullScreen)&&(i.indexOf("Safari")==-1||s>=10.1)?1:0}(),hasWasm:"object"==typeof WebAssembly&&"function"==typeof WebAssembly.validate&&"function"==typeof WebAssembly.compile}}(),Error:{init:function(){return Error.stackTraceLimit=50,window.addEventListener("error",function(e){var t=UnityLoader.Error.getModule(e);if(!t)return UnityLoader.Error.handler(e);var r=t.useWasm?t.wasmSymbolsUrl:t.asmSymbolsUrl;if(!r)return UnityLoader.Error.handler(e,t);var n=new XMLHttpRequest;n.open("GET",t.resolveBuildUrl(r)),n.responseType="arraybuffer",n.onload=function(){UnityLoader.loadCode(UnityLoader.Compression.decompress(new Uint8Array(n.response)),function(r){t.demangleSymbol=UnityLoader[r](),UnityLoader.Error.handler(e,t)})},n.send()}),!0}(),stackTraceFormat:navigator.userAgent.indexOf("Chrome")!=-1?"(\\s+at\\s+)(([\\w\\d_\\.]*?)([\\w\\d_$]+)(/[\\w\\d_\\./]+|))(\\s+\\[.*\\]|)\\s*\\((blob:.*)\\)":"(\\s*)(([\\w\\d_\\.]*?)([\\w\\d_$]+)(/[\\w\\d_\\./]+|))(\\s+\\[.*\\]|)\\s*@(blob:.*)",stackTraceFormatWasm:navigator.userAgent.indexOf("Chrome")!=-1?"((\\s+at\\s*)\\s\\(<WASM>\\[(\\d+)\\]\\+\\d+\\))()":"((\\s*)wasm-function\\[(\\d+)\\])@(blob:.*)",blobParseRegExp:new RegExp("^(blob:.*)(:\\d+:\\d+)$"),getModule:function(e){var t=e.message.match(new RegExp(this.stackTraceFormat,"g"));for(var r in t){var n=t[r].match(new RegExp("^"+this.stackTraceFormat+"$")),o=n[7].match(this.blobParseRegExp);if(o&&UnityLoader.Blobs[o[1]]&&UnityLoader.Blobs[o[1]].Module)return UnityLoader.Blobs[o[1]].Module}},demangle:function(e,t){var r=e.message;return t?(r=r.replace(new RegExp(this.stackTraceFormat,"g"),function(e){var r=e.match(new RegExp("^"+this.stackTraceFormat+"$")),n=r[7].match(this.blobParseRegExp),o=t.demangleSymbol?t.demangleSymbol(r[4]):r[4],a=n&&UnityLoader.Blobs[n[1]]&&UnityLoader.Blobs[n[1]].url?UnityLoader.Blobs[n[1]].url:"blob";return r[1]+o+(r[2]!=o?" ["+r[2]+"]":"")+" ("+(n?a.substr(a.lastIndexOf("/")+1)+n[2]:r[7])+")"}.bind(this)),t.useWasm&&(r=r.replace(new RegExp(this.stackTraceFormatWasm,"g"),function(e){var r=e.match(new RegExp("^"+this.stackTraceFormatWasm+"$")),n=t.demangleSymbol?t.demangleSymbol(r[3]):r[3],o=r[4].match(this.blobParseRegExp),a=o&&UnityLoader.Blobs[o[1]]&&UnityLoader.Blobs[o[1]].url?UnityLoader.Blobs[o[1]].url:"blob";return(n==r[3]?r[1]:r[2]+n+" [wasm:"+r[3]+"]")+(r[4]?" ("+(o?a.substr(a.lastIndexOf("/")+1)+o[2]:r[4])+")":"")}.bind(this))),r):r},handler:function(e,t){var r=t?this.demangle(e,t):e.message;if(!(t&&t.errorhandler&&t.errorhandler(r,e.filename,e.lineno)||(console.log("Invoking error handler due to\n"+r),"function"==typeof dump&&dump("Invoking error handler due to\n"+r),r.indexOf("UnknownError")!=-1||r.indexOf("Program terminated with exit(0)")!=-1||this.didShowErrorMessage))){var r="An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:\n"+r;r.indexOf("DISABLE_EXCEPTION_CATCHING")!=-1?r="An exception has occurred, but exception handling has been disabled in this build. If you are the developer of this content, enable exceptions in your project WebGL player settings to be able to catch the exception or see the stack trace.":r.indexOf("Cannot enlarge memory arrays")!=-1?r="Out of memory. If you are the developer of this content, try allocating more memory to your WebGL build in the WebGL player settings.":r.indexOf("Invalid array buffer length")==-1&&r.indexOf("Invalid typed array length")==-1&&r.indexOf("out of memory")==-1||(r="The browser could not allocate enough memory for the WebGL content. If you are the developer of this content, try allocating less memory to your WebGL build in the WebGL player settings."),alert(r),this.didShowErrorMessage=!0}},popup:function(e,t,r){r=r||[{text:"OK"}];var n=document.createElement("div");n.style.cssText="position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); text-align: center; border: 1px solid black; padding: 5px; background: #E8E8E8";var o=document.createElement("span");o.textContent=t,n.appendChild(o),n.appendChild(document.createElement("br"));for(var a=0;a<r.length;a++){var i=document.createElement("button");r[a].text&&(i.textContent=r[a].text),r[a].callback&&(i.onclick=r[a].callback),i.style.margin="5px",i.addEventListener("click",function(){e.container.removeChild(n)}),n.appendChild(i)}e.container.appendChild(n)}},Job:{schedule:function(e,t,r,n,o){o=o||{};var a=e.Jobs[t];if(a||(a=e.Jobs[t]={dependencies:{},dependants:{}}),a.callback)throw"[UnityLoader.Job.schedule] job '"+t+"' has been already scheduled";if("function"!=typeof n)throw"[UnityLoader.Job.schedule] job '"+t+"' has invalid callback";if("object"!=typeof o)throw"[UnityLoader.Job.schedule] job '"+t+"' has invalid parameters";a.callback=function(e,t){a.starttime=performance.now(),n(e,t)},a.parameters=o,a.complete=function(r){a.endtime=performance.now(),a.result={value:r};for(var n in a.dependants){var o=e.Jobs[n];o.dependencies[t]=a.dependants[n]=!1;var i="function"!=typeof o.callback;for(var s in o.dependencies)i=i||o.dependencies[s];if(!i){if(o.executed)throw"[UnityLoader.Job.schedule] job '"+t+"' has already been executed";o.executed=!0,setTimeout(o.callback.bind(null,e,o),0)}}};var i=!1;r.forEach(function(r){var n=e.Jobs[r];n||(n=e.Jobs[r]={dependencies:{},dependants:{}}),(a.dependencies[r]=n.dependants[t]=!n.result)&&(i=!0)}),i||(a.executed=!0,setTimeout(a.callback.bind(null,e,a),0))},result:function(e,t){var r=e.Jobs[t];if(!r)throw"[UnityLoader.Job.result] job '"+t+"' does not exist";if("object"!=typeof r.result)throw"[UnityLoader.Job.result] job '"+t+"' has invalid result";return r.result.value}},XMLHttpRequest:function(){function e(e){console.log("[UnityCache] "+e)}function t(e){return t.link=t.link||document.createElement("a"),t.link.href=e,t.link.href}function r(e){var t=window.location.href.match(/^[a-z]+:\/\/[^\/]+/);return!t||e.lastIndexOf(t[0],0)}function n(){function t(t){if("undefined"==typeof r.database)for(r.database=t,r.database||e("indexedDB database could not be opened");r.queue.length;){var n=r.queue.shift();r.database?r.execute.apply(r,n):"function"==typeof n.onerror&&n.onerror(new Error("operation cancelled"))}}var r=this;r.queue=[];try{var n=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,o=n.open(i);o.onupgradeneeded=function(e){var t=e.target.result.createObjectStore(s,{keyPath:"url"});["version","company","product","updated","revalidated","accessed"].forEach(function(e){t.createIndex(e,e)})},o.onsuccess=function(e){t(e.target.result)},o.onerror=function(){t(null)},setTimeout(o.onerror,1e3)}catch(e){t(null)}}function o(e,t,r,n,o){var a={url:e,version:d,company:t,product:r,updated:n,revalidated:n,accessed:n,responseHeaders:{},xhr:{}};return o&&(["Last-Modified","ETag"].forEach(function(e){a.responseHeaders[e]=o.getResponseHeader(e)}),["responseURL","status","statusText","response"].forEach(function(e){a.xhr[e]=o[e]})),a}function a(t){this.cache={enabled:!1},t&&(this.cache.control=t.cacheControl,this.cache.company=t.companyName,this.cache.product=t.productName),this.xhr=new XMLHttpRequest(t),this.xhr.addEventListener("load",function(){var t=this.xhr,r=this.cache;r.enabled&&!r.revalidated&&(304==t.status?(r.result.revalidated=r.result.accessed,r.revalidated=!0,l.execute("put",[r.result]),e("'"+r.result.url+"' successfully revalidated and served from the indexedDB cache")):200==t.status?(r.result=o(r.result.url,r.company,r.product,r.result.accessed,t),r.revalidated=!0,l.execute("put",[r.result],function(t){e("'"+r.result.url+"' successfully downloaded and stored in the indexedDB cache")},function(t){e("'"+r.result.url+"' successfully downloaded but not stored in the indexedDB cache due to the error: "+t)})):e("'"+r.result.url+"' request failed with status: "+t.status+" "+t.statusText))}.bind(this))}var i="UnityCache",s="XMLHttpRequest",d=1;n.prototype.execute=function(e,t,r,n){if(this.database)try{var o=this.database.transaction([s],["put","delete","clear"].indexOf(e)!=-1?"readwrite":"readonly").objectStore(s);"openKeyCursor"==e&&(o=o.index(t[0]),t=t.slice(1));var a=o[e].apply(o,t);"function"==typeof r&&(a.onsuccess=function(e){r(e.target.result)}),a.onerror=n}catch(e){"function"==typeof n&&n(e)}else"undefined"==typeof this.database?this.queue.push(arguments):"function"==typeof n&&n(new Error("indexedDB access denied"))};var l=new n;a.prototype.send=function(t){var n=this.xhr,o=this.cache,a=arguments;return o.enabled=o.enabled&&"arraybuffer"==n.responseType&&!t,o.enabled?void l.execute("get",[o.result.url],function(t){if(!t||t.version!=d)return void n.send.apply(n,a);if(o.result=t,o.result.accessed=Date.now(),"immutable"==o.control)o.revalidated=!0,l.execute("put",[o.result]),n.dispatchEvent(new Event("load")),e("'"+o.result.url+"' served from the indexedDB cache without revalidation");else if(r(o.result.url)&&(o.result.responseHeaders["Last-Modified"]||o.result.responseHeaders.ETag)){var i=new XMLHttpRequest;i.open("HEAD",o.result.url),i.onload=function(){o.revalidated=["Last-Modified","ETag"].every(function(e){return!o.result.responseHeaders[e]||o.result.responseHeaders[e]==i.getResponseHeader(e)}),o.revalidated?(o.result.revalidated=o.result.accessed,l.execute("put",[o.result]),n.dispatchEvent(new Event("load")),e("'"+o.result.url+"' successfully revalidated and served from the indexedDB cache")):n.send.apply(n,a)},i.send()}else o.result.responseHeaders["Last-Modified"]?(n.setRequestHeader("If-Modified-Since",o.result.responseHeaders["Last-Modified"]),n.setRequestHeader("Cache-Control","no-cache")):o.result.responseHeaders.ETag&&(n.setRequestHeader("If-None-Match",o.result.responseHeaders.ETag),n.setRequestHeader("Cache-Control","no-cache")),n.send.apply(n,a)},function(e){n.send.apply(n,a)}):n.send.apply(n,a)},a.prototype.open=function(e,r,n,a,i){return this.cache.result=o(t(r),this.cache.company,this.cache.product,Date.now()),this.cache.enabled=["must-revalidate","immutable"].indexOf(this.cache.control)!=-1&&"GET"==e&&this.cache.result.url.match("^https?://")&&("undefined"==typeof n||n)&&"undefined"==typeof a&&"undefined"==typeof i,this.cache.revalidated=!1,this.xhr.open.apply(this.xhr,arguments)},a.prototype.setRequestHeader=function(e,t){return this.cache.enabled=!1,this.xhr.setRequestHeader.apply(this.xhr,arguments)};var u=new XMLHttpRequest;for(var f in u)a.prototype.hasOwnProperty(f)||!function(e){Object.defineProperty(a.prototype,e,"function"==typeof u[e]?{value:function(){return this.xhr[e].apply(this.xhr,arguments)}}:{get:function(){return this.cache.revalidated&&this.cache.result.xhr.hasOwnProperty(e)?this.cache.result.xhr[e]:this.xhr[e]},set:function(t){this.xhr[e]=t}})}(f);return a}(),Utils:{assert:function(e,t){e||abort("Assertion failed: "+t)},optimizeMathFround:function(e,t){console.log("optimizing out Math.fround calls");for(var r={LOOKING_FOR_MODULE:0,SCANNING_MODULE_VARIABLES:1,SCANNING_MODULE_FUNCTIONS:2},n=["EMSCRIPTEN_START_ASM","EMSCRIPTEN_START_FUNCS","EMSCRIPTEN_END_FUNCS"],o="var",a="global.Math.fround;",i=0,s=t?r.LOOKING_FOR_MODULE:r.SCANNING_MODULE_VARIABLES,d=0,l=0;s<=r.SCANNING_MODULE_FUNCTIONS&&i<e.length;i++)if(47==e[i]&&47==e[i+1]&&32==e[i+2]&&String.fromCharCode.apply(null,e.subarray(i+3,i+3+n[s].length))===n[s])s++;else if(s!=r.SCANNING_MODULE_VARIABLES||l||61!=e[i]||String.fromCharCode.apply(null,e.subarray(i+1,i+1+a.length))!==a){if(l&&40==e[i]){for(var u=0;u<l&&e[i-1-u]==e[d-u];)u++;if(u==l){var f=e[i-1-u];if(f<36||36<f&&f<48||57<f&&f<65||90<f&&f<95||95<f&&f<97||122<f)for(;u;u--)e[i-u]=32}}}else{for(d=i-1;32!=e[d-l];)l++;l&&String.fromCharCode.apply(null,e.subarray(d-l-o.length,d-l))===o||(d=l=0)}return e}},Cryptography:{crc32:function(e){var t=UnityLoader.Cryptography.crc32.module;if(!t){var r=new ArrayBuffer(16777216),n=function(e,t,r){"use asm";var n=new e.Uint8Array(r);var o=new e.Uint32Array(r);function a(e,t){e=e|0;t=t|0;var r=0;for(r=o[1024>>2]|0;t;e=e+1|0,t=t-1|0)r=o[(r&255^n[e])<<2>>2]^r>>>8^4278190080;o[1024>>2]=r}return{process:a}}({Uint8Array:Uint8Array,Uint32Array:Uint32Array},null,r);t=UnityLoader.Cryptography.crc32.module={buffer:r,HEAPU8:new Uint8Array(r),HEAPU32:new Uint32Array(r),process:n.process,crc32:1024,data:1028};for(var o=0;o<256;o++){for(var a=255^o,i=0;i<8;i++)a=a>>>1^(1&a?3988292384:0);t.HEAPU32[o]=a}}t.HEAPU32[t.crc32>>2]=0;for(var s=0;s<e.length;){var d=Math.min(t.HEAPU8.length-t.data,e.length-s);t.HEAPU8.set(e.subarray(s,s+d),t.data),crc=t.process(t.data,d),s+=d}var l=t.HEAPU32[t.crc32>>2];return new Uint8Array([l>>24,l>>16,l>>8,l])},md5:function(e){var t=UnityLoader.Cryptography.md5.module;if(!t){var r=new ArrayBuffer(16777216),n=function(e,t,r){"use asm";var n=new e.Uint32Array(r);function o(e,t){e=e|0;t=t|0;var r=0,o=0,a=0,i=0,s=0,d=0,l=0,u=0,f=0,c=0,h=0,p=0;r=n[128]|0,o=n[129]|0,a=n[130]|0,i=n[131]|0;for(;t;e=e+64|0,t=t-1|0){s=r;d=o;l=a;u=i;for(c=0;(c|0)<512;c=c+8|0){p=n[c>>2]|0;r=r+(n[c+4>>2]|0)+(n[e+(p>>>14)>>2]|0)+((c|0)<128?i^o&(a^i):(c|0)<256?a^i&(o^a):(c|0)<384?o^a^i:a^(o|~i))|0;h=(r<<(p&31)|r>>>32-(p&31))+o|0;r=i;i=a;a=o;o=h}r=r+s|0;o=o+d|0;a=a+l|0;i=i+u|0}n[128]=r;n[129]=o;n[130]=a;n[131]=i}return{process:o}}({Uint32Array:Uint32Array},null,r);t=UnityLoader.Cryptography.md5.module={buffer:r,HEAPU8:new Uint8Array(r),HEAPU32:new Uint32Array(r),process:n.process,md5:512,data:576},t.HEAPU32.set(new Uint32Array([7,3614090360,65548,3905402710,131089,606105819,196630,3250441966,262151,4118548399,327692,1200080426,393233,2821735955,458774,4249261313,524295,1770035416,589836,2336552879,655377,4294925233,720918,2304563134,786439,1804603682,851980,4254626195,917521,2792965006,983062,1236535329,65541,4129170786,393225,3225465664,720910,643717713,20,3921069994,327685,3593408605,655369,38016083,983054,3634488961,262164,3889429448,589829,568446438,917513,3275163606,196622,4107603335,524308,1163531501,851973,2850285829,131081,4243563512,458766,1735328473,786452,2368359562,327684,4294588738,524299,2272392833,720912,1839030562,917527,4259657740,65540,2763975236,262155,1272893353,458768,4139469664,655383,3200236656,851972,681279174,11,3936430074,196624,3572445317,393239,76029189,589828,3654602809,786443,3873151461,983056,530742520,131095,3299628645,6,4096336452,458762,1126891415,917519,2878612391,327701,4237533241,786438,1700485571,196618,2399980690,655375,4293915773,65557,2240044497,524294,1873313359,983050,4264355552,393231,2734768916,851989,1309151649,262150,4149444226,720906,3174756917,131087,718787259,589845,3951481745]))}t.HEAPU32.set(new Uint32Array([1732584193,4023233417,2562383102,271733878]),t.md5>>2);for(var o=0;o<e.length;){var a=Math.min(t.HEAPU8.length-t.data,e.length-o)&-64;if(t.HEAPU8.set(e.subarray(o,o+a),t.data),o+=a,t.process(t.data,a>>6),e.length-o<64){if(a=e.length-o,t.HEAPU8.set(e.subarray(e.length-a,e.length),t.data),o+=a,t.HEAPU8[t.data+a++]=128,a>56){for(var i=a;i<64;i++)t.HEAPU8[t.data+i]=0;t.process(t.data,1),a=0}for(var i=a;i<64;i++)t.HEAPU8[t.data+i]=0;for(var s=e.length,d=0,i=56;i<64;i++,d=(224&s)>>5,s/=256)t.HEAPU8[t.data+i]=((31&s)<<3)+d;t.process(t.data,1)}}return new Uint8Array(t.HEAPU8.subarray(t.md5,t.md5+16))},sha1:function(e){var t=UnityLoader.Cryptography.sha1.module;if(!t){var r=new ArrayBuffer(16777216),n=function(e,t,r){"use asm";var n=new e.Uint32Array(r);function o(e,t){e=e|0;t=t|0;var r=0,o=0,a=0,i=0,s=0,d=0,l=0,u=0,f=0,c=0,h=0,p=0;r=n[80]|0,o=n[81]|0,a=n[82]|0,i=n[83]|0,s=n[84]|0;for(;t;e=e+64|0,t=t-1|0){d=r;l=o;u=a;f=i;c=s;for(p=0;(p|0)<320;p=p+4|0,s=i,i=a,a=o<<30|o>>>2,o=r,r=h){if((p|0)<64){h=n[e+p>>2]|0;h=h<<24&4278190080|h<<8&16711680|h>>>8&65280|h>>>24&255}else{h=n[p-12>>2]^n[p-32>>2]^n[p-56>>2]^n[p-64>>2];h=h<<1|h>>>31}n[p>>2]=h;h=h+((r<<5|r>>>27)+s)+((p|0)<80?(o&a|~o&i|0)+1518500249|0:(p|0)<160?(o^a^i)+1859775393|0:(p|0)<240?(o&a|o&i|a&i)+2400959708|0:(o^a^i)+3395469782|0)|0}r=r+d|0;o=o+l|0;a=a+u|0;i=i+f|0;s=s+c|0}n[80]=r;n[81]=o;n[82]=a;n[83]=i;n[84]=s}return{process:o}}({Uint32Array:Uint32Array},null,r);t=UnityLoader.Cryptography.sha1.module={buffer:r,HEAPU8:new Uint8Array(r),HEAPU32:new Uint32Array(r),process:n.process,sha1:320,data:384}}t.HEAPU32.set(new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),t.sha1>>2);for(var o=0;o<e.length;){var a=Math.min(t.HEAPU8.length-t.data,e.length-o)&-64;if(t.HEAPU8.set(e.subarray(o,o+a),t.data),o+=a,t.process(t.data,a>>6),e.length-o<64){if(a=e.length-o,t.HEAPU8.set(e.subarray(e.length-a,e.length),t.data),o+=a,t.HEAPU8[t.data+a++]=128,a>56){for(var i=a;i<64;i++)t.HEAPU8[t.data+i]=0;t.process(t.data,1),a=0}for(var i=a;i<64;i++)t.HEAPU8[t.data+i]=0;for(var s=e.length,d=0,i=63;i>=56;i--,d=(224&s)>>5,s/=256)t.HEAPU8[t.data+i]=((31&s)<<3)+d;t.process(t.data,1)}}for(var l=new Uint8Array(20),i=0;i<l.length;i++)l[i]=t.HEAPU8[t.sha1+(i&-4)+3-(3&i)];return l}},Progress:{Styles:{Dark:{progressLogoUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJoAAACCCAYAAAC+etHhAAAACXBIWXMAAAsSAAALEgHS3X78AAAI2UlEQVR42u2d7VXjSgyGpZwtwHRgOjAVYCrAVLDZCjZUsKGCsBWEDhIqiKkg6SB0QDqY+yOTe3J9iePRfMkz0jkcfkDsGfuJpHk1H6iUAjEx3zaRRyAWxJRS//6IjeJ9VUqpmVJqpY42s33vIX7wHDBElDfJD6wSAGoAuNe/y86/tIj4QAEtpAlo/MAqOmBVV18i4cWFBu2HvFoe4RAAmjO4TD9fI2LLuY8CWrxweA5WYXnJRwAQ0AQsVXTAKh3foub+DCRH8wdXrT3NoDzLgd0g4kFytDzyrHO4QlsDAG8SOtOVHR4d5Vm2di+gpSc7NB7yrKTzNMnRrudZJ69VjaDJt4j4KTnaePKsk9camzUA8CoejW+e5Ut2CG1rRHzi6NGyBU0ptRqp1+qzAyLecAQty2lCSqkmQcgAAAod/tnZJEPICgBYJNzFRkDjYbMEcrE+u5fBAI/kfwvxxVXfdrUcJTmaX/vDBLKD5+vXEjrjebMaAKYRwVoDwDMA3OnfWYXPnATbP4HBagHgA45TrXedwcgmN4+WBWhKqWmAh38Ca30O1oXBiO/wXSmlyqHlKBkMuIGs0AOA0hNY7dBp1Howsg/U9V+I+MZlMJCDR3MlZxiD9Y2F1O9YTRtK2qNZyhk7Dde7i4UfejCyCdj93nKUeDS3tjCAbNfxWgcPbaHYGo5TlEy9cqGUqq7kiwLaWRL/0+ThwvB5Y77B6vaDWoN81iPmKXH0uePyMlluiaCUmiq3tldKLZRSjR4gBBuMKKW+iG2e62s0xM+vhrz3ED8sQXMI2Ze+VhmxLwuLL0ZxBivJBLQwnqyK3JfSou3TzrW2xOvUHECbcAuXALB0qCPFzk+ofWm/0cDeideqJUfz58mmDJ5rbdH+2uH1thI6E4VM92lPbP+y55rUQUWRPWiJQjazGLwUPdddEa/bZJ2jecjJ3hhAVgB9psjfK3oeNU97zDZHS9GT2coZHkex+yxDZ8KQ2cgZzcB7UHO/MqvQmWK4dCRnrAf+75p4jzr2tzCYR0vVkzmQM0qD+zgpRyUbOlOGzDKkLQj3Io1okwfNMWRLhpB5kTN67rexLckll6M5zsneEPEXM8hs5IwX4vQkqszRxHxQ3jxa6p5M93HpsjQ08J4V8Z6b5EJnJpBVFn2qLe9NygmTCp2ph8szI0/PdrAOoSW+myjhcyKQkfvZELWpA7hZqf5B/Nx9rAfmLHTmEC4dyBlzV4MQm9xwtDlaZpDNbadnO2oHddZtMcocLaOc7CRn/A4sZzjN02LIHBOBjDQAoHil1kNdlqqnlaPK0RyHyy1zwGzljMpTmyizbsvRhE7HnmwHAA/A36hyxpvHhTKm4fMlyi5DFI/m2pOFXNBrI2eErGcatGtGGYywH3VmClkRW87oaZvJZMvpdw6GHWg5QmYrZzDS9DaXIhkr0DKGrLRY5lYHauPCdDASGrQfQ8Olw8T/ZCvFbGOZHimAKme0gdr4AccNBy/Za+xV+1c34vMEWQ52G2p0p6PD14U/H3RbDl2PxkawFcjI9hpSQtAQtT1yxiH2A5kIZM7tAAAvEe773WyOHSKyOL9zIpA5t+dIHuS7ZXjPXB7K/3I0gczKdoh4F3GE/HU2cOmtG0fN0fT6QoGMbn8j3/88T3vn9GAmnaTyEwB+CS9k+x35/iWjtvTnaHoqi8BGsyrW4mYdjc5F2ZrTQuvJheGywEa3RaSqR82oLcNAE9isrIB+ld6XPV5oyx8OD0UqA/7sNqRo2xlxdu2uW4IKPeocdBaUB9h24P8UXpcJdkkZASLiQyDIKjieeTW4LcHrzDJ743qSHWs1ukEb5yZz0brvXeaj8YFtwXw+2pDdhf4z0ze3GbarkYBmc57TLEDbjGf7jmIBcU6LhR302feaAdO1DOVoQMsYNurK8IXHNplum7UZFWg5wma5T62vdZ2URTPNqLZEcCzqTrnDpqdmU3fFXniAjCq9VDG+pdabvGS2wYv3swQM2kLdO7eW3YQS303IcTsoZ0N9jS5HyxU2LguKbSSl0e9hmxFsUeUOi4HJLAnQMoNtE6tPFtWKMhnQcoEtptxB1PT2o6oMRIJtzhS2JbE/mwgj32WSoHmAbZpYHXQa+Jk2yYKWCWxBN0+28KJF0qBlAlswuYPoQbeXhHqV2gnEKu3zOm12hCwN7lO5AFqlfAKx49rokhNs+gThlvBR0wUk1DJWG/ubKGequ+uX90PIiNrdV997Ty50ZgIbVUjdDLg29VieVbagpQqbT7nDIg+cZQ1awrB5OfratuyUNWgJw+Zc7iBec38tN88GNA+w1QxAs6mDlj7KTtnIGwGlj5WvOfoG/WktJIWFQ1mDxz5pXDyaB8/2FRs25XCVO3E2rbqU82UbOj3C1kTuC7UOunVddhLQ/OdsSgud89D5mwu5wyLfm3MBbdBuQjFhA4CfxI8X0L+srIXjluneTzhR9N2YDgBwq0tUlK0VHi71TXHctmqsptX2oR7MK3g6jFFyxlfdB9PPHhDxps+jCWgOJQYAoM5kdQqeZVsotkbEJy6gsc3RHPZvySXHc9gWUtlJcjTPEgMA+NinzNjj6bZsgXZanqn1bm0qHo2XxODc4wVqy97kvYtHcygxaK8WcofJbz2ebssWaJuzDLXe43lkMMBTYnAOnobMZ1ue9IxfAS0SbFSJYWx2c+2EPcXpYNgE7TmDPu44HASbNWiWMyrGYu8cG5WbRwNI/9ihVkDj4dU+4VjWSdEOvuu2ApqZvcB4jggavTfLFjREPBWc7zR0qeRtH2yfeU7yxjXTkyTvgTZbgoMNPlFPdDQ+0BVwnKd/Aq9k3uRPRLw16J+AxhS8sgMetwPTrpadBLRxgldr4E7gxbarZScBLY0wW0fO725MKgICWjphtg6Y3+0Q8c6wjQJaguBVHfBc53cviDgX0MR853cPphUBAU3yO6ernQQ0MVf5Xe9qJy6gZbFmYOz5nd5vbXVhxfvM9r3LmgGxvvzuUYfZwWUnNqFTTMyXTeQRiAloYsnYP6b+7B7jJdwAAAAAAElFTkSuQmCC", +progressEmptyUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI0AAAASCAYAAABmbl0zAAAACXBIWXMAAAsSAAALEgHS3X78AAAATUlEQVRo3u3aIQ4AIAwEQUr4/5cPiyMVBDOj0M2mCKgkGdAwjYCudZzLOLiITYPrCdEgGkSDaEA0iAbRIBpEA6JBNHx1vnL7V4NNwxsbCNMGI3YImu0AAAAASUVORK5CYII=",progressFullUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI0AAAASCAYAAABmbl0zAAAACXBIWXMAAAsSAAALEgHS3X78AAAAO0lEQVRo3u3SQREAAAjDMMC/56EB3omEXjtJCg5GAkyDaTANpsE0YBpMg2kwDaYB02AaTINpMA2Yhr8FO18EIBpZMeQAAAAASUVORK5CYII="},Light:{progressLogoUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJoAAACCCAYAAAC+etHhAAAACXBIWXMAAAsSAAALEgHS3X78AAAIhUlEQVR42u2dzW3bSBTH/yFcgNIBg5wDMKccPa5ATAVxKkhUga0KbFdgdmCpglDHnFZAzsGyBHWgPYjcMIQlkm++3sy8P7AInI3tGfKnN+9rZt4cj0eIRLaVySMQudBV/4v3Hz7JE+GvAoACcA2gBLAC8Dj3h/z+9dMfaCKWyntgqfbrvpYU0LxaNBELLQZgFSP/XgW3dIq8LodlD665UgBqAU302nLYB2uh+fOWApqoWw7LC36WrtgvnwKaPanW0kzxs0wsvQsABwEtnbTD0pOFKQFUAlq8aYelIT9LV9cCWnxph9KCnxW1nyagjb+8zmoVzMeat/81Alo4flZntUJTCaZVgtRBy3G5vBOargU0fnoJ1GoF6ael2iZURghZF7AUAhqfl/EQ+YdIQGOg7xH4YmN+moDGwPn/FvkcFfwnj5MH7Y7JSzg4gE1A8/hJv/UI1gantuuP7Z9JLZ8ppTfuHINVA9i1f+4HwciP1CxaKqDdOnj4HVibAVivBSO2l+8CzMpRKYC2sGTN+harnhGMuLKsCoy6OVIAzVQ6gwLWUC7zd9cCmjvloKcz9i1QW5jpx1dwm0wtAXwV0NzoYYY/tB9YrYOFsVC06flcc12GYsRfFNB6TvwXwsPlANZwHtQa5Kr1626JVlRAm/Byng3+vKa1Di7AGsJPtWbrdtxbImhs2oauIofs0FqE2mOoT61GND1IqD4imwJ7FjFkAHDTRl6+IMvbqJdqzQ69Dwx1CVQCml3IvjLwT6hzqV9JTWwFNJ6QVZ7nozRe8voMfBQtBbR4IdOxZtUZqKgBTAEGHSuZQGZF1GpEF7xcWlKDXD4zgcxKOoNaz3wasVpUP22ZMmgxQgbopTPuJwQJYtEEMq10xmoijA1xXHlqoMUKmU4AUONUtZiiDfF3qJRAixkypfEy53RZ7EL00zKBzLs1e5y5HIpFcwRZxRAynXTGmrjUUqLhImbQTEP2lRlkOumMfj1zjqhpjjJW0GKHDJjXXNnXHvQWnpr4fdcxgpYCZAXoe0V19nbuQUtzqNhASwGyzppRtIH+PgTq95exgJYKZCXRQozVM6eKmua4jgG0VCDTsWZPMNOIGVSaIxPISLoHLZ3RwFwPP7Xr1kvbUCaQzdYC9L2i1HRG8H5aJpCRlswFEYrK8Fio+bQ8NNBMQrYPADJf6YxL8B6IH+hgQDMN2Q34ixoAVLC3UWbu8rmGh11hGSPIDswh853OOKc5aQ6TwYh10FKETGe3+ZPl+c1Jc6x9PetMIJskandGg/H2bF01E5dCG8GIFdBShSzXSGe4Cm6mWLWVz4d45QGyTi8IQ7lGOqN2NMYdLu9VeITnXftXniArEL9cpmrqkWBk7fthZB4gS0Fz27N1dbgAm7cAYCpoAhn9pfuwILszvjCL89Eygcy4Vp4syIZbADAGmkCmF01XHn93H/DKYTAyG7RcINPSk+ff3wdry+nBDEFrwL+wzVm+b87LGY1ldOmsBDaydLo7TEDWTxspj2OZHAwIbHRR+9V0pRiNZTJoAhtdC9BPFNLR8sxY7riDJrDRdQf3XazqzN9/B4NKzJQSVBeum4xGh6E4Z+VEaJ7hrplzbMPJAzw3lk4tqtuA7TPC6d74l2hhFNzkssoJY7lFIG1CJpfRAqdbeBcBgNaAXsZxlZOcsinYa2Awt/HRNGyhJIephencQWCwwLQWc19BCgk007CVgcCm0/dPPTxZNwjgEqSQQTMN220gsFWgNQ/aTjHMPTL0OSTQUoWNatVsphgU4d8Ht1M9Ndhq0A9XsXGfek5cCovQQEsRNqpVs2FJSo0PTHCgpQZbA3oHrWmrRjnr7BAyaKnBRt0TkMPsPk+KRat9PDDTB/GlApvOvoBvMJPuUMTv28UAWkqwVaCf929iCaXehLKJBbSUYFtrzEk38qNYtAae7pfPLH/iTcJ2zxC0GvRCtY5Vy4mg1r4elO0LLUzCdgdGrck9UbfXKY35UP2zbaygmYbtmSFsB9B3P1HroNQj3OuYQUsBtnvQ0x2UjgpKWsNrs6nLaxRjh41aMfiGeWUk6vHtXvd5ur4YNmbYqNfuzO3uCKbs5BO02GGjWrXbGQ5+MGUn36DFDJvO6T1TrNoCtIiz9v1gMo+/O1bYqG3fasIcFHFMu5RBixU2nTro2AYSalpjkzposcJG7e4Y20BCCQQaeCo7cQPNBmyKwZyo8zm3gSQHrZu25vCCuYBmGrYX+D8GoNZ4yQ+GrBnA5Jw0TqCZhG2B0wZl37BR5/LadUDBlZ04g2YDttLjXBqYa/umuANszjjhCJpp2F4AHFvo7j34b4/El90/1E8hwLJTX1fgq6r984sGZMMTEBX+JEZrnPJLOr7U1HTHCrTmzYc2NUHtpq25vMw3x+Px/y/ef/iEyPRjhgWzDd4/RJ/xsZ1DQQD87bn/+fvXTwHNoFQLG9UamARPZywUbXA6GowFaBniVg16q3W3zP4w5OPpjIWiHacXEbtFA+gH6dmweHm7hLo4p+wdLlQExKLxSjGYtngN3Fx60YBB2Sk10HRSDDbAc3HzXc3tBaQCms5BeqbBK2D/9rsttxeQgo9mIsUQmt6OWXDx0exqlcAcWR6tnxpocyLEULXlOKjUQAPivwmmFtB4qAGT658tBT0CGiOxuNA+FWuWMmhdwfljC10sftuO68CukLb2+PvugBKnTlaFMNMgGwEtnBfVvazFALw8AN+zEdDCXF4r/Om4yAfgcbswjfXynwlPs6PVz61/d8PMv9tyfnhi0fQsSN1bZpVn/64W0NJYZvv+XT4Az7Z/x/5GZwHN3jLb9++KAXim/bst9wcioLlRl0bpKhJqAF7Uy6aAFod/dxDQRC78uzqESQpo4ft3OwFNZNO/W7YQbkKYxF+t3CKRLUllQCSgieLRf80sS5fCDVbiAAAAAElFTkSuQmCC",progressEmptyUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI0AAAASCAYAAABmbl0zAAAACXBIWXMAAAsSAAALEgHS3X78AAAAUUlEQVRo3u3aMQ4AEAxAUcRJzGb3v1mt3cQglvcmc/NTA3XMFQUuNCPgVk/nahwchE2D6wnRIBpEg2hANIgG0SAaRAOiQTR8lV+5/avBpuGNDcz6A6oq1CgNAAAAAElFTkSuQmCC",progressFullUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI0AAAASCAYAAABmbl0zAAAACXBIWXMAAAsSAAALEgHS3X78AAAAQElEQVRo3u3SMREAMAgAsVIpnTvj3xlogDmR8PfxftaBgSsBpsE0mAbTYBowDabBNJgG04BpMA2mwTSYBkzDXgP/hgGnr4PpeAAAAABJRU5ErkJggg=="}},handler:function(e,t){if(e.Module){var r=UnityLoader.Progress.Styles[e.Module.splashScreenStyle],n=e.Module.progressLogoUrl?e.Module.resolveBuildUrl(e.Module.progressLogoUrl):r.progressLogoUrl,o=e.Module.progressEmptyUrl?e.Module.resolveBuildUrl(e.Module.progressEmptyUrl):r.progressEmptyUrl,a=e.Module.progressFullUrl?e.Module.resolveBuildUrl(e.Module.progressFullUrl):r.progressFullUrl,i="position: absolute; left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);";e.logo||(e.logo=document.createElement("div"),e.logo.style.cssText=i+"background: url('"+n+"') no-repeat center / contain; width: 154px; height: 130px;",e.container.appendChild(e.logo)),e.progress||(e.progress=document.createElement("div"),e.progress.style.cssText=i+" height: 18px; width: 141px; margin-top: 90px;",e.progress.empty=document.createElement("div"),e.progress.empty.style.cssText="background: url('"+o+"') no-repeat right / cover; float: right; width: 100%; height: 100%; display: inline-block;",e.progress.appendChild(e.progress.empty),e.progress.full=document.createElement("div"),e.progress.full.style.cssText="background: url('"+a+"') no-repeat left / cover; float: left; width: 0%; height: 100%; display: inline-block;",e.progress.appendChild(e.progress.full),e.container.appendChild(e.progress)),e.progress.full.style.width=100*t+"%",e.progress.empty.style.width=100*(1-t)+"%",1==t&&(e.logo.style.display=e.progress.style.display="none")}},update:function(e,t,r){var n=e.buildDownloadProgress[t];n||(n=e.buildDownloadProgress[t]={started:!1,finished:!1,lengthComputable:!1,total:0,loaded:0}),"object"!=typeof r||"progress"!=r.type&&"load"!=r.type||(n.started||(n.started=!0,n.lengthComputable=r.lengthComputable,n.total=r.total),n.loaded=r.loaded,"load"==r.type&&(n.finished=!0));var o=0,a=0,i=0,s=0,d=0;for(var t in e.buildDownloadProgress){var n=e.buildDownloadProgress[t];if(!n.started)return 0;i++,n.lengthComputable?(o+=n.loaded,a+=n.total,s++):n.finished||d++}var l=i?(i-d-(a?s*(a-o)/a:0))/i:0;e.gameInstance.onProgress(e.gameInstance,.9*l)}},Compression:{identity:{require:function(){return{}},decompress:function(e){return e}},gzip:{require:function(e){var t={"inflate.js":function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0===(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var r=i.inflateInit2(this.strm,t.windowBits);if(r!==l.Z_OK)throw new Error(u[r]);this.header=new c,i.inflateGetHeader(this.strm,this.header)}function o(e,t){var r=new n(t);if(r.push(e,!0),r.err)throw r.msg||u[r.err];return r.result}function a(e,t){return t=t||{},t.raw=!0,o(e,t)}var i=e("./zlib/inflate"),s=e("./utils/common"),d=e("./utils/strings"),l=e("./zlib/constants"),u=e("./zlib/messages"),f=e("./zlib/zstream"),c=e("./zlib/gzheader"),h=Object.prototype.toString;n.prototype.push=function(e,t){var r,n,o,a,u,f,c=this.strm,p=this.options.chunkSize,w=this.options.dictionary,m=!1;if(this.ended)return!1;n=t===~~t?t:t===!0?l.Z_FINISH:l.Z_NO_FLUSH,"string"==typeof e?c.input=d.binstring2buf(e):"[object ArrayBuffer]"===h.call(e)?c.input=new Uint8Array(e):c.input=e,c.next_in=0,c.avail_in=c.input.length;do{if(0===c.avail_out&&(c.output=new s.Buf8(p),c.next_out=0,c.avail_out=p),r=i.inflate(c,l.Z_NO_FLUSH),r===l.Z_NEED_DICT&&w&&(f="string"==typeof w?d.string2buf(w):"[object ArrayBuffer]"===h.call(w)?new Uint8Array(w):w,r=i.inflateSetDictionary(this.strm,f)),r===l.Z_BUF_ERROR&&m===!0&&(r=l.Z_OK,m=!1),r!==l.Z_STREAM_END&&r!==l.Z_OK)return this.onEnd(r),this.ended=!0,!1;c.next_out&&(0!==c.avail_out&&r!==l.Z_STREAM_END&&(0!==c.avail_in||n!==l.Z_FINISH&&n!==l.Z_SYNC_FLUSH)||("string"===this.options.to?(o=d.utf8border(c.output,c.next_out),a=c.next_out-o,u=d.buf2string(c.output,o),c.next_out=a,c.avail_out=p-a,a&&s.arraySet(c.output,c.output,o,a,0),this.onData(u)):this.onData(s.shrinkBuf(c.output,c.next_out)))),0===c.avail_in&&0===c.avail_out&&(m=!0)}while((c.avail_in>0||0===c.avail_out)&&r!==l.Z_STREAM_END);return r===l.Z_STREAM_END&&(n=l.Z_FINISH),n===l.Z_FINISH?(r=i.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===l.Z_OK):n!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),c.avail_out=0,!0)},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===l.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=n,r.inflate=o,r.inflateRaw=a,r.ungzip=o},"utils/common.js":function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,r,n,o){if(t.subarray&&e.subarray)return void e.set(t.subarray(r,r+n),o);for(var a=0;a<n;a++)e[o+a]=t[r+a]},flattenChunks:function(e){var t,r,n,o,a,i;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(i=new Uint8Array(n),o=0,t=0,r=e.length;t<r;t++)a=e[t],i.set(a,o),o+=a.length;return i}},a={arraySet:function(e,t,r,n,o){for(var a=0;a<n;a++)e[o+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,o)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,a))},r.setTyped(n)},"utils/strings.js":function(e,t,r){"use strict";function n(e,t){if(t<65537&&(e.subarray&&i||!e.subarray&&a))return String.fromCharCode.apply(null,o.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}var o=e("./common"),a=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var s=new o.Buf8(256),d=0;d<256;d++)s[d]=d>=252?6:d>=248?5:d>=240?4:d>=224?3:d>=192?2:1;s[254]=s[254]=1,r.string2buf=function(e){var t,r,n,a,i,s=e.length,d=0;for(a=0;a<s;a++)r=e.charCodeAt(a),55296===(64512&r)&&a+1<s&&(n=e.charCodeAt(a+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),d+=r<128?1:r<2048?2:r<65536?3:4;for(t=new o.Buf8(d),i=0,a=0;i<d;a++)r=e.charCodeAt(a),55296===(64512&r)&&a+1<s&&(n=e.charCodeAt(a+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?t[i++]=r:r<2048?(t[i++]=192|r>>>6,t[i++]=128|63&r):r<65536?(t[i++]=224|r>>>12,t[i++]=128|r>>>6&63,t[i++]=128|63&r):(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63,t[i++]=128|r>>>6&63,t[i++]=128|63&r);return t},r.buf2binstring=function(e){return n(e,e.length)},r.binstring2buf=function(e){for(var t=new o.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,o,a,i,d=t||e.length,l=new Array(2*d);for(o=0,r=0;r<d;)if(a=e[r++],a<128)l[o++]=a;else if(i=s[a],i>4)l[o++]=65533,r+=i-1;else{for(a&=2===i?31:3===i?15:7;i>1&&r<d;)a=a<<6|63&e[r++],i--;i>1?l[o++]=65533:a<65536?l[o++]=a:(a-=65536,l[o++]=55296|a>>10&1023,l[o++]=56320|1023&a)}return n(l,o)},r.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&128===(192&e[r]);)r--;return r<0?t:0===r?t:r+s[e[r]]>t?r:t}},"zlib/inflate.js":function(e,t,r){"use strict";function n(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function o(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new y.Buf16(320),this.work=new y.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=I,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new y.Buf32(we),t.distcode=t.distdyn=new y.Buf32(me),t.sane=1,t.back=-1,O):R}function i(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,a(e)):R}function s(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?R:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,i(e))):R}function d(e,t){var r,n;return e?(n=new o,e.state=n,n.window=null,r=s(e,t),r!==O&&(e.state=null),r):R}function l(e){return d(e,ye)}function u(e){if(ge){var t;for(m=new y.Buf32(512),b=new y.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(U(E,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;U(k,e.lens,0,32,b,0,e.work,{bits:5}),ge=!1}e.lencode=m,e.lenbits=9,e.distcode=b,e.distbits=5}function f(e,t,r,n){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new y.Buf8(a.wsize)),n>=a.wsize?(y.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(o=a.wsize-a.wnext,o>n&&(o=n),y.arraySet(a.window,t,r-n,o,a.wnext),n-=o,n?(y.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}function c(e,t){var r,o,a,i,s,d,l,c,h,p,w,m,b,we,me,be,ye,ge,ve,Ae,Ue,xe,Ee,ke,Be=0,Le=new y.Buf8(4),We=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return R;r=e.state,r.mode===j&&(r.mode=X),s=e.next_out,a=e.output,l=e.avail_out,i=e.next_in,o=e.input,d=e.avail_in,c=r.hold,h=r.bits,p=d,w=l,xe=O;e:for(;;)switch(r.mode){case I:if(0===r.wrap){r.mode=X;break}for(;h<16;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}if(2&r.wrap&&35615===c){r.check=0,Le[0]=255&c,Le[1]=c>>>8&255,r.check=v(r.check,Le,2,0),c=0,h=0,r.mode=P;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=ce;break}if((15&c)!==T){e.msg="unknown compression method",r.mode=ce;break}if(c>>>=4,h-=4,Ue=(15&c)+8,0===r.wbits)r.wbits=Ue;else if(Ue>r.wbits){e.msg="invalid window size",r.mode=ce;break}r.dmax=1<<Ue,e.adler=r.check=1,r.mode=512&c?G:j,c=0,h=0;break;case P:for(;h<16;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}if(r.flags=c,(255&r.flags)!==T){e.msg="unknown compression method",r.mode=ce;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=ce;break}r.head&&(r.head.text=c>>8&1),512&r.flags&&(Le[0]=255&c,Le[1]=c>>>8&255,r.check=v(r.check,Le,2,0)),c=0,h=0,r.mode=D;case D:for(;h<32;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}r.head&&(r.head.time=c),512&r.flags&&(Le[0]=255&c,Le[1]=c>>>8&255,Le[2]=c>>>16&255,Le[3]=c>>>24&255,r.check=v(r.check,Le,4,0)),c=0,h=0,r.mode=F;case F:for(;h<16;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}r.head&&(r.head.xflags=255&c,r.head.os=c>>8),512&r.flags&&(Le[0]=255&c,Le[1]=c>>>8&255,r.check=v(r.check,Le,2,0)),c=0,h=0,r.mode=q;case q:if(1024&r.flags){for(;h<16;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}r.length=c,r.head&&(r.head.extra_len=c),512&r.flags&&(Le[0]=255&c,Le[1]=c>>>8&255,r.check=v(r.check,Le,2,0)),c=0,h=0}else r.head&&(r.head.extra=null);r.mode=V;case V:if(1024&r.flags&&(m=r.length,m>d&&(m=d),m&&(r.head&&(Ue=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),y.arraySet(r.head.extra,o,i,m,Ue)),512&r.flags&&(r.check=v(r.check,o,m,i)),d-=m,i+=m,r.length-=m),r.length))break e;r.length=0,r.mode=Z;case Z:if(2048&r.flags){if(0===d)break e;m=0;do Ue=o[i+m++],r.head&&Ue&&r.length<65536&&(r.head.name+=String.fromCharCode(Ue));while(Ue&&m<d);if(512&r.flags&&(r.check=v(r.check,o,m,i)),d-=m,i+=m,Ue)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Y;case Y:if(4096&r.flags){if(0===d)break e;m=0;do Ue=o[i+m++],r.head&&Ue&&r.length<65536&&(r.head.comment+=String.fromCharCode(Ue));while(Ue&&m<d);if(512&r.flags&&(r.check=v(r.check,o,m,i)),d-=m,i+=m,Ue)break e}else r.head&&(r.head.comment=null);r.mode=z;case z:if(512&r.flags){for(;h<16;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}if(c!==(65535&r.check)){e.msg="header crc mismatch",r.mode=ce;break}c=0,h=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=j;break;case G:for(;h<32;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}e.adler=r.check=n(c),c=0,h=0,r.mode=J;case J:if(0===r.havedict)return e.next_out=s,e.avail_out=l,e.next_in=i,e.avail_in=d,r.hold=c,r.bits=h,N;e.adler=r.check=1,r.mode=j;case j:if(t===L||t===W)break e;case X:if(r.last){c>>>=7&h,h-=7&h,r.mode=le;break}for(;h<3;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}switch(r.last=1&c,c>>>=1,h-=1,3&c){case 0:r.mode=K;break;case 1:if(u(r),r.mode=re,t===W){c>>>=2,h-=2;break e}break;case 2:r.mode=$;break;case 3:e.msg="invalid block type",r.mode=ce}c>>>=2,h-=2;break;case K:for(c>>>=7&h,h-=7&h;h<32;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}if((65535&c)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=ce;break}if(r.length=65535&c,c=0,h=0,r.mode=Q,t===W)break e;case Q:r.mode=_;case _:if(m=r.length){if(m>d&&(m=d),m>l&&(m=l),0===m)break e;y.arraySet(a,o,i,m,s),d-=m,i+=m,l-=m,s+=m,r.length-=m;break}r.mode=j;break;case $:for(;h<14;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}if(r.nlen=(31&c)+257,c>>>=5,h-=5,r.ndist=(31&c)+1,c>>>=5,h-=5,r.ncode=(15&c)+4,c>>>=4,h-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=ce;break}r.have=0,r.mode=ee;case ee:for(;r.have<r.ncode;){for(;h<3;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}r.lens[We[r.have++]]=7&c,c>>>=3,h-=3}for(;r.have<19;)r.lens[We[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ee={bits:r.lenbits},xe=U(x,r.lens,0,19,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,xe){e.msg="invalid code lengths set",r.mode=ce;break}r.have=0,r.mode=te;case te:for(;r.have<r.nlen+r.ndist;){for(;Be=r.lencode[c&(1<<r.lenbits)-1],me=Be>>>24,be=Be>>>16&255,ye=65535&Be,!(me<=h);){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}if(ye<16)c>>>=me,h-=me,r.lens[r.have++]=ye;else{if(16===ye){for(ke=me+2;h<ke;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}if(c>>>=me,h-=me,0===r.have){e.msg="invalid bit length repeat",r.mode=ce;break}Ue=r.lens[r.have-1],m=3+(3&c),c>>>=2,h-=2}else if(17===ye){for(ke=me+3;h<ke;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}c>>>=me,h-=me,Ue=0,m=3+(7&c),c>>>=3,h-=3}else{for(ke=me+7;h<ke;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}c>>>=me,h-=me,Ue=0,m=11+(127&c),c>>>=7,h-=7}if(r.have+m>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=ce;break}for(;m--;)r.lens[r.have++]=Ue}}if(r.mode===ce)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=ce;break}if(r.lenbits=9,Ee={bits:r.lenbits},xe=U(E,r.lens,0,r.nlen,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,xe){e.msg="invalid literal/lengths set",r.mode=ce;break}if(r.distbits=6,r.distcode=r.distdyn,Ee={bits:r.distbits},xe=U(k,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ee),r.distbits=Ee.bits,xe){e.msg="invalid distances set",r.mode=ce;break}if(r.mode=re,t===W)break e;case re:r.mode=ne;case ne:if(d>=6&&l>=258){e.next_out=s,e.avail_out=l,e.next_in=i,e.avail_in=d,r.hold=c,r.bits=h,A(e,w),s=e.next_out,a=e.output,l=e.avail_out,i=e.next_in,o=e.input,d=e.avail_in,c=r.hold,h=r.bits,r.mode===j&&(r.back=-1);break}for(r.back=0;Be=r.lencode[c&(1<<r.lenbits)-1],me=Be>>>24,be=Be>>>16&255,ye=65535&Be,!(me<=h);){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}if(be&&0===(240&be)){for(ge=me,ve=be,Ae=ye;Be=r.lencode[Ae+((c&(1<<ge+ve)-1)>>ge)],me=Be>>>24,be=Be>>>16&255,ye=65535&Be,!(ge+me<=h);){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}c>>>=ge,h-=ge,r.back+=ge}if(c>>>=me,h-=me,r.back+=me,r.length=ye,0===be){r.mode=de;break}if(32&be){r.back=-1,r.mode=j;break}if(64&be){e.msg="invalid literal/length code",r.mode=ce;break}r.extra=15&be,r.mode=oe;case oe:if(r.extra){for(ke=r.extra;h<ke;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ae;case ae:for(;Be=r.distcode[c&(1<<r.distbits)-1],me=Be>>>24,be=Be>>>16&255,ye=65535&Be,!(me<=h);){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}if(0===(240&be)){for(ge=me,ve=be,Ae=ye;Be=r.distcode[Ae+((c&(1<<ge+ve)-1)>>ge)],me=Be>>>24,be=Be>>>16&255,ye=65535&Be,!(ge+me<=h);){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}c>>>=ge,h-=ge,r.back+=ge}if(c>>>=me,h-=me,r.back+=me,64&be){e.msg="invalid distance code",r.mode=ce;break}r.offset=ye,r.extra=15&be,r.mode=ie;case ie:if(r.extra){for(ke=r.extra;h<ke;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=ce;break}r.mode=se;case se:if(0===l)break e;if(m=w-l,r.offset>m){if(m=r.offset-m,m>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=ce;break}m>r.wnext?(m-=r.wnext,b=r.wsize-m):b=r.wnext-m,m>r.length&&(m=r.length),we=r.window}else we=a,b=s-r.offset,m=r.length;m>l&&(m=l),l-=m,r.length-=m;do a[s++]=we[b++];while(--m);0===r.length&&(r.mode=ne);break;case de:if(0===l)break e;a[s++]=r.length,l--,r.mode=ne;break;case le:if(r.wrap){for(;h<32;){if(0===d)break e;d--,c|=o[i++]<<h,h+=8}if(w-=l,e.total_out+=w,r.total+=w,w&&(e.adler=r.check=r.flags?v(r.check,a,w,s-w):g(r.check,a,w,s-w)),w=l,(r.flags?c:n(c))!==r.check){e.msg="incorrect data check",r.mode=ce;break}c=0,h=0}r.mode=ue;case ue:if(r.wrap&&r.flags){for(;h<32;){if(0===d)break e;d--,c+=o[i++]<<h,h+=8}if(c!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=ce;break}c=0,h=0}r.mode=fe;case fe:xe=M;break e;case ce:xe=C;break e;case he:return H;case pe:default:return R}return e.next_out=s,e.avail_out=l,e.next_in=i,e.avail_in=d,r.hold=c,r.bits=h,(r.wsize||w!==e.avail_out&&r.mode<ce&&(r.mode<le||t!==B))&&f(e,e.output,e.next_out,w-e.avail_out)?(r.mode=he,H):(p-=e.avail_in,w-=e.avail_out,e.total_in+=p,e.total_out+=w,r.total+=w,r.wrap&&w&&(e.adler=r.check=r.flags?v(r.check,a,w,e.next_out-w):g(r.check,a,w,e.next_out-w)),e.data_type=r.bits+(r.last?64:0)+(r.mode===j?128:0)+(r.mode===re||r.mode===Q?256:0),(0===p&&0===w||t===B)&&xe===O&&(xe=S),xe)}function h(e){if(!e||!e.state)return R;var t=e.state;return t.window&&(t.window=null),e.state=null,O}function p(e,t){var r;return e&&e.state?(r=e.state,0===(2&r.wrap)?R:(r.head=t,t.done=!1,O)):R}function w(e,t){var r,n,o,a=t.length;return e&&e.state?(r=e.state,0!==r.wrap&&r.mode!==J?R:r.mode===J&&(n=1,n=g(n,t,a,0),n!==r.check)?C:(o=f(e,t,a,a))?(r.mode=he,H):(r.havedict=1,O)):R}var m,b,y=e("../utils/common"),g=e("./adler32"),v=e("./crc32"),A=e("./inffast"),U=e("./inftrees"),x=0,E=1,k=2,B=4,L=5,W=6,O=0,M=1,N=2,R=-2,C=-3,H=-4,S=-5,T=8,I=1,P=2,D=3,F=4,q=5,V=6,Z=7,Y=8,z=9,G=10,J=11,j=12,X=13,K=14,Q=15,_=16,$=17,ee=18,te=19,re=20,ne=21,oe=22,ae=23,ie=24,se=25,de=26,le=27,ue=28,fe=29,ce=30,he=31,pe=32,we=852,me=592,be=15,ye=be,ge=!0;r.inflateReset=i,r.inflateReset2=s,r.inflateResetKeep=a,r.inflateInit=l,r.inflateInit2=d,r.inflate=c,r.inflateEnd=h,r.inflateGetHeader=p,r.inflateSetDictionary=w,r.inflateInfo="pako inflate (from Nodeca project)"},"zlib/constants.js":function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},"zlib/messages.js":function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},"zlib/zstream.js":function(e,t,r){"use strict";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}t.exports=n},"zlib/gzheader.js":function(e,t,r){"use strict";function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}t.exports=n},"zlib/adler32.js":function(e,t,r){"use strict";function n(e,t,r,n){for(var o=65535&e|0,a=e>>>16&65535|0,i=0;0!==r;){i=r>2e3?2e3:r,r-=i;do o=o+t[n++]|0,a=a+o|0;while(--i);o%=65521,a%=65521}return o|a<<16|0}t.exports=n},"zlib/crc32.js":function(e,t,r){"use strict";function n(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}function o(e,t,r,n){var o=a,i=n+r;e^=-1;for(var s=n;s<i;s++)e=e>>>8^o[255&(e^t[s])];return e^-1}var a=n();t.exports=o},"zlib/inffast.js":function(e,t,r){"use strict";var n=30,o=12;t.exports=function(e,t){var r,a,i,s,d,l,u,f,c,h,p,w,m,b,y,g,v,A,U,x,E,k,B,L,W;r=e.state,a=e.next_in,L=e.input,i=a+(e.avail_in-5),s=e.next_out,W=e.output,d=s-(t-e.avail_out),l=s+(e.avail_out-257),u=r.dmax,f=r.wsize,c=r.whave,h=r.wnext,p=r.window,w=r.hold,m=r.bits,b=r.lencode,y=r.distcode,g=(1<<r.lenbits)-1,v=(1<<r.distbits)-1;e:do{m<15&&(w+=L[a++]<<m,m+=8,w+=L[a++]<<m,m+=8),A=b[w&g];t:for(;;){if(U=A>>>24,w>>>=U,m-=U,U=A>>>16&255,0===U)W[s++]=65535&A;else{if(!(16&U)){if(0===(64&U)){A=b[(65535&A)+(w&(1<<U)-1)];continue t}if(32&U){r.mode=o;break e}e.msg="invalid literal/length code",r.mode=n;break e}x=65535&A,U&=15,U&&(m<U&&(w+=L[a++]<<m,m+=8),x+=w&(1<<U)-1,w>>>=U,m-=U),m<15&&(w+=L[a++]<<m,m+=8,w+=L[a++]<<m,m+=8),A=y[w&v];r:for(;;){if(U=A>>>24,w>>>=U,m-=U,U=A>>>16&255,!(16&U)){if(0===(64&U)){A=y[(65535&A)+(w&(1<<U)-1)];continue r}e.msg="invalid distance code",r.mode=n;break e}if(E=65535&A,U&=15,m<U&&(w+=L[a++]<<m,m+=8,m<U&&(w+=L[a++]<<m,m+=8)),E+=w&(1<<U)-1,E>u){e.msg="invalid distance too far back",r.mode=n;break e}if(w>>>=U,m-=U,U=s-d,E>U){if(U=E-U,U>c&&r.sane){e.msg="invalid distance too far back",r.mode=n;break e}if(k=0,B=p,0===h){if(k+=f-U,U<x){x-=U;do W[s++]=p[k++];while(--U);k=s-E,B=W}}else if(h<U){if(k+=f+h-U,U-=h,U<x){x-=U;do W[s++]=p[k++];while(--U);if(k=0,h<x){U=h,x-=U;do W[s++]=p[k++];while(--U);k=s-E,B=W}}}else if(k+=h-U,U<x){x-=U;do W[s++]=p[k++];while(--U);k=s-E,B=W}for(;x>2;)W[s++]=B[k++],W[s++]=B[k++],W[s++]=B[k++],x-=3;x&&(W[s++]=B[k++],x>1&&(W[s++]=B[k++]))}else{k=s-E;do W[s++]=W[k++],W[s++]=W[k++],W[s++]=W[k++],x-=3;while(x>2);x&&(W[s++]=W[k++],x>1&&(W[s++]=W[k++]))}break}}break}}while(a<i&&s<l);x=m>>3,a-=x,m-=x<<3,w&=(1<<m)-1,e.next_in=a,e.next_out=s,e.avail_in=a<i?5+(i-a):5-(a-i),e.avail_out=s<l?257+(l-s):257-(s-l),r.hold=w,r.bits=m}},"zlib/inftrees.js":function(e,t,r){"use strict";var n=e("../utils/common"),o=15,a=852,i=592,s=0,d=1,l=2,u=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],h=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,p,w,m,b,y){var g,v,A,U,x,E,k,B,L,W=y.bits,O=0,M=0,N=0,R=0,C=0,H=0,S=0,T=0,I=0,P=0,D=null,F=0,q=new n.Buf16(o+1),V=new n.Buf16(o+1),Z=null,Y=0;for(O=0;O<=o;O++)q[O]=0;for(M=0;M<p;M++)q[t[r+M]]++;for(C=W,R=o;R>=1&&0===q[R];R--);if(C>R&&(C=R),0===R)return w[m++]=20971520,w[m++]=20971520,y.bits=1,0;for(N=1;N<R&&0===q[N];N++);for(C<N&&(C=N),T=1,O=1;O<=o;O++)if(T<<=1,T-=q[O],T<0)return-1;if(T>0&&(e===s||1!==R))return-1;for(V[1]=0,O=1;O<o;O++)V[O+1]=V[O]+q[O];for(M=0;M<p;M++)0!==t[r+M]&&(b[V[t[r+M]]++]=M);if(e===s?(D=Z=b,E=19):e===d?(D=u,F-=257,Z=f,Y-=257,E=256):(D=c,Z=h,E=-1),P=0,M=0,O=N,x=m,H=C,S=0,A=-1,I=1<<C,U=I-1,e===d&&I>a||e===l&&I>i)return 1;for(;;){k=O-S,b[M]<E?(B=0,L=b[M]):b[M]>E?(B=Z[Y+b[M]],L=D[F+b[M]]):(B=96,L=0),g=1<<O-S,v=1<<H,N=v;do v-=g,w[x+(P>>S)+v]=k<<24|B<<16|L|0;while(0!==v);for(g=1<<O-1;P&g;)g>>=1;if(0!==g?(P&=g-1,P+=g):P=0,M++,0===--q[O]){if(O===R)break;O=t[r+b[M]]}if(O>C&&(P&U)!==A){for(0===S&&(S=C),x+=N,H=O-S,T=1<<H;H+S<R&&(T-=q[H+S],!(T<=0));)H++,T<<=1;if(I+=1<<H,e===d&&I>a||e===l&&I>i)return 1;A=P&U,w[A]=C<<24|H<<16|x-m|0}}return 0!==P&&(w[x+P]=O-S<<24|64<<16|0),y.bits=C,0}}};for(var r in t)t[r].folder=r.substring(0,r.lastIndexOf("/")+1);var n=function(e){var r=[];return e=e.split("/").every(function(e){return".."==e?r.pop():"."==e||""==e||r.push(e)})?r.join("/"):null,e?t[e]||t[e+".js"]||t[e+"/index.js"]:null},o=function(e,t){return e?n(e.folder+"node_modules/"+t)||o(e.parent,t):null},a=function(e,t){var r=t.match(/^\//)?null:e?t.match(/^\.\.?\//)?n(e.folder+t):o(e,t):n(t);if(!r)throw"module not found: "+t;return r.exports||(r.parent=e,r(a.bind(null,r),r,r.exports={})),r.exports};return a(null,e)},decompress:function(e){this.exports||(this.exports=this.require("inflate.js"));try{return this.exports.inflate(e)}catch(e){}},hasUnityMarker:function(e){var t=10,r="UnityWeb Compressed Content (gzip)";if(t>e.length||31!=e[0]||139!=e[1])return!1;var n=e[3];if(4&n){if(t+2>e.length)return!1;if(t+=2+e[t]+(e[t+1]<<8),t>e.length)return!1}if(8&n){for(;t<e.length&&e[t];)t++;if(t+1>e.length)return!1;t++}return 16&n&&String.fromCharCode.apply(null,e.subarray(t,t+r.length+1))==r+"\0"}},brotli:{require:function(e){var t={"decompress.js":function(e,t,r){t.exports=e("./dec/decode").BrotliDecompressBuffer},"dec/bit_reader.js":function(e,t,r){function n(e){this.buf_=new Uint8Array(a),this.input_=e,this.reset()}const o=4096,a=8224,i=8191,s=new Uint32Array([0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215]);n.READ_SIZE=o,n.IBUF_MASK=i,n.prototype.reset=function(){this.buf_ptr_=0,this.val_=0,this.pos_=0,this.bit_pos_=0,this.bit_end_pos_=0,this.eos_=0,this.readMoreInput();for(var e=0;e<4;e++)this.val_|=this.buf_[this.pos_]<<8*e,++this.pos_;return this.bit_end_pos_>0},n.prototype.readMoreInput=function(){if(!(this.bit_end_pos_>256))if(this.eos_){if(this.bit_pos_>this.bit_end_pos_)throw new Error("Unexpected end of input "+this.bit_pos_+" "+this.bit_end_pos_)}else{var e=this.buf_ptr_,t=this.input_.read(this.buf_,e,o);if(t<0)throw new Error("Unexpected end of input");if(t<o){this.eos_=1;for(var r=0;r<32;r++)this.buf_[e+t+r]=0}if(0===e){for(var r=0;r<32;r++)this.buf_[8192+r]=this.buf_[r];this.buf_ptr_=o}else this.buf_ptr_=0;this.bit_end_pos_+=t<<3}},n.prototype.fillBitWindow=function(){for(;this.bit_pos_>=8;)this.val_>>>=8,this.val_|=this.buf_[this.pos_&i]<<24,++this.pos_,this.bit_pos_=this.bit_pos_-8>>>0,this.bit_end_pos_=this.bit_end_pos_-8>>>0},n.prototype.readBits=function(e){32-this.bit_pos_<e&&this.fillBitWindow();var t=this.val_>>>this.bit_pos_&s[e];return this.bit_pos_+=e,t},t.exports=n},"dec/context.js":function(e,t,r){r.lookup=new Uint8Array([0,0,0,0,0,0,0,0,0,4,4,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,12,16,12,12,20,12,16,24,28,12,12,32,12,36,12,44,44,44,44,44,44,44,44,44,44,32,32,24,40,28,12,12,48,52,52,52,48,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,24,12,28,12,12,12,56,60,60,60,56,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,24,12,28,12,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,56,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,36,37,37,37,37,38,38,38,38,39,39,39,39,40,40,40,40,41,41,41,41,42,42,42,42,43,43,43,43,44,44,44,44,45,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,57,57,57,57,58,58,58,58,59,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]), +r.lookupOffsets=new Uint16Array([1024,1536,1280,1536,0,256,768,512])},"dec/decode.js":function(e,t,r){function n(e){var t;return 0===e.readBits(1)?16:(t=e.readBits(3),t>0?17+t:(t=e.readBits(3),t>0?8+t:17))}function o(e){if(e.readBits(1)){var t=e.readBits(3);return 0===t?1:e.readBits(t)+(1<<t)}return 0}function a(){this.meta_block_length=0,this.input_end=0,this.is_uncompressed=0,this.is_metadata=!1}function i(e){var t,r,n,o=new a;if(o.input_end=e.readBits(1),o.input_end&&e.readBits(1))return o;if(t=e.readBits(2)+4,7===t){if(o.is_metadata=!0,0!==e.readBits(1))throw new Error("Invalid reserved bit");if(r=e.readBits(2),0===r)return o;for(n=0;n<r;n++){var i=e.readBits(8);if(n+1===r&&r>1&&0===i)throw new Error("Invalid size byte");o.meta_block_length|=i<<8*n}}else for(n=0;n<t;++n){var s=e.readBits(4);if(n+1===t&&t>4&&0===s)throw new Error("Invalid size nibble");o.meta_block_length|=s<<4*n}return++o.meta_block_length,o.input_end||o.is_metadata||(o.is_uncompressed=e.readBits(1)),o}function s(e,t,r){var n;return r.fillBitWindow(),t+=r.val_>>>r.bit_pos_&D,n=e[t].bits-P,n>0&&(r.bit_pos_+=P,t+=e[t].value,t+=r.val_>>>r.bit_pos_&(1<<n)-1),r.bit_pos_+=e[t].bits,e[t].value}function d(e,t,r,n){for(var o=0,a=N,i=0,s=0,d=32768,l=[],u=0;u<32;u++)l.push(new B(0,0));for(L(l,0,5,e,q);o<t&&d>0;){var f,c=0;if(n.readMoreInput(),n.fillBitWindow(),c+=n.val_>>>n.bit_pos_&31,n.bit_pos_+=l[c].bits,f=255&l[c].value,f<R)i=0,r[o++]=f,0!==f&&(a=f,d-=32768>>f);else{var h,p,w=f-14,m=0;if(f===R&&(m=a),s!==m&&(i=0,s=m),h=i,i>0&&(i-=2,i<<=w),i+=n.readBits(w)+3,p=i-h,o+p>t)throw new Error("[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols");for(var b=0;b<p;b++)r[o+b]=s;o+=p,0!==s&&(d-=p<<15-s)}}if(0!==d)throw new Error("[ReadHuffmanCodeLengths] space = "+d);for(;o<t;o++)r[o]=0}function l(e,t,r,n){var o,a=0,i=new Uint8Array(e);if(n.readMoreInput(),o=n.readBits(2),1===o){for(var s,l=e-1,u=0,f=new Int32Array(4),c=n.readBits(2)+1;l;)l>>=1,++u;for(s=0;s<c;++s)f[s]=n.readBits(u)%e,i[f[s]]=2;switch(i[f[0]]=1,c){case 1:break;case 3:if(f[0]===f[1]||f[0]===f[2]||f[1]===f[2])throw new Error("[ReadHuffmanCode] invalid symbols");break;case 2:if(f[0]===f[1])throw new Error("[ReadHuffmanCode] invalid symbols");i[f[1]]=1;break;case 4:if(f[0]===f[1]||f[0]===f[2]||f[0]===f[3]||f[1]===f[2]||f[1]===f[3]||f[2]===f[3])throw new Error("[ReadHuffmanCode] invalid symbols");n.readBits(1)?(i[f[2]]=3,i[f[3]]=3):i[f[0]]=2}}else{var s,h=new Uint8Array(q),p=32,w=0,m=[new B(2,0),new B(2,4),new B(2,3),new B(3,2),new B(2,0),new B(2,4),new B(2,3),new B(4,1),new B(2,0),new B(2,4),new B(2,3),new B(3,2),new B(2,0),new B(2,4),new B(2,3),new B(4,5)];for(s=o;s<q&&p>0;++s){var b,y=V[s],g=0;n.fillBitWindow(),g+=n.val_>>>n.bit_pos_&15,n.bit_pos_+=m[g].bits,b=m[g].value,h[y]=b,0!==b&&(p-=32>>b,++w)}if(1!==w&&0!==p)throw new Error("[ReadHuffmanCode] invalid num_codes or space");d(h,e,i,n)}if(a=L(t,r,P,i,e),0===a)throw new Error("[ReadHuffmanCode] BuildHuffmanTable failed: ");return a}function u(e,t,r){var n,o;return n=s(e,t,r),o=O.kBlockLengthPrefixCode[n].nbits,O.kBlockLengthPrefixCode[n].offset+r.readBits(o)}function f(e,t,r){var n;return e<Z?(r+=Y[e],r&=3,n=t[r]+z[e]):n=e-Z+1,n}function c(e,t){for(var r=e[t],n=t;n;--n)e[n]=e[n-1];e[0]=r}function h(e,t){var r,n=new Uint8Array(256);for(r=0;r<256;++r)n[r]=r;for(r=0;r<t;++r){var o=e[r];e[r]=n[o],o&&c(n,o)}}function p(e,t){this.alphabet_size=e,this.num_htrees=t,this.codes=new Array(t+t*G[e+31>>>5]),this.htrees=new Uint32Array(t)}function w(e,t){var r,n,a,i={num_htrees:null,context_map:null},d=0;t.readMoreInput();var u=i.num_htrees=o(t)+1,f=i.context_map=new Uint8Array(e);if(u<=1)return i;for(r=t.readBits(1),r&&(d=t.readBits(4)+1),n=[],a=0;a<F;a++)n[a]=new B(0,0);for(l(u+d,n,0,t),a=0;a<e;){var c;if(t.readMoreInput(),c=s(n,0,t),0===c)f[a]=0,++a;else if(c<=d)for(var p=1+(1<<c)+t.readBits(c);--p;){if(a>=e)throw new Error("[DecodeContextMap] i >= context_map_size");f[a]=0,++a}else f[a]=c-d,++a}return t.readBits(1)&&h(f,e),i}function m(e,t,r,n,o,a,i){var d,l=2*r,u=r,f=s(t,r*F,i);d=0===f?o[l+(1&a[u])]:1===f?o[l+(a[u]-1&1)]+1:f-2,d>=e&&(d-=e),n[r]=d,o[l+(1&a[u])]=d,++a[u]}function b(e,t,r,n,o,a){var i,s=o+1,d=r&o,l=a.pos_&E.IBUF_MASK;if(t<8||a.bit_pos_+(t<<3)<a.bit_end_pos_)for(;t-- >0;)a.readMoreInput(),n[d++]=a.readBits(8),d===s&&(e.write(n,s),d=0);else{if(a.bit_end_pos_<32)throw new Error("[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32");for(;a.bit_pos_<32;)n[d]=a.val_>>>a.bit_pos_,a.bit_pos_+=8,++d,--t;if(i=a.bit_end_pos_-a.bit_pos_>>3,l+i>E.IBUF_MASK){for(var u=E.IBUF_MASK+1-l,f=0;f<u;f++)n[d+f]=a.buf_[l+f];i-=u,d+=u,t-=u,l=0}for(var f=0;f<i;f++)n[d+f]=a.buf_[l+f];if(d+=i,t-=i,d>=s){e.write(n,s),d-=s;for(var f=0;f<d;f++)n[f]=n[s+f]}for(;d+t>=s;){if(i=s-d,a.input_.read(n,d,i)<i)throw new Error("[CopyUncompressedBlockToOutput] not enough bytes");e.write(n,s),t-=i,d=0}if(a.input_.read(n,d,t)<t)throw new Error("[CopyUncompressedBlockToOutput] not enough bytes");a.reset()}}function y(e){var t=e.bit_pos_+7&-8,r=e.readBits(t-e.bit_pos_);return 0==r}function g(e){var t=new U(e),r=new E(t);n(r);var o=i(r);return o.meta_block_length}function v(e,t){var r=new U(e);null==t&&(t=g(e));var n=new Uint8Array(t),o=new x(n);return A(r,o),o.pos<o.buffer.length&&(o.buffer=o.buffer.subarray(0,o.pos)),o.buffer}function A(e,t){var r,a,d,c,h,g,v,A,U,x=0,L=0,N=0,R=0,P=[16,15,11,4],D=0,q=0,V=0,Y=[new p(0,0),new p(0,0),new p(0,0)];const z=128+E.READ_SIZE;U=new E(e),N=n(U),a=(1<<N)-16,d=1<<N,c=d-1,h=new Uint8Array(d+z+k.maxDictionaryWordLength),g=d,v=[],A=[];for(var G=0;G<3240;G++)v[G]=new B(0,0),A[G]=new B(0,0);for(;!L;){var J,j,X,K,Q,_,$,ee,te,re=0,ne=[1<<28,1<<28,1<<28],oe=[0],ae=[1,1,1],ie=[0,1,0,1,0,1],se=[0],de=null,le=null,ue=null,fe=0,ce=null,he=0,pe=0,we=null,me=0,be=0,ye=0;for(r=0;r<3;++r)Y[r].codes=null,Y[r].htrees=null;U.readMoreInput();var ge=i(U);if(re=ge.meta_block_length,x+re>t.buffer.length){var ve=new Uint8Array(x+re);ve.set(t.buffer),t.buffer=ve}if(L=ge.input_end,J=ge.is_uncompressed,ge.is_metadata)for(y(U);re>0;--re)U.readMoreInput(),U.readBits(8);else if(0!==re)if(J)U.bit_pos_=U.bit_pos_+7&-8,b(t,re,x,h,c,U),x+=re;else{for(r=0;r<3;++r)ae[r]=o(U)+1,ae[r]>=2&&(l(ae[r]+2,v,r*F,U),l(S,A,r*F,U),ne[r]=u(A,r*F,U),se[r]=1);for(U.readMoreInput(),j=U.readBits(2),X=Z+(U.readBits(4)<<j),K=(1<<j)-1,Q=X+(48<<j),le=new Uint8Array(ae[0]),r=0;r<ae[0];++r)U.readMoreInput(),le[r]=U.readBits(2)<<1;var Ae=w(ae[0]<<T,U);_=Ae.num_htrees,de=Ae.context_map;var Ue=w(ae[2]<<I,U);for($=Ue.num_htrees,ue=Ue.context_map,Y[0]=new p(C,_),Y[1]=new p(H,ae[1]),Y[2]=new p(Q,$),r=0;r<3;++r)Y[r].decode(U);for(ce=0,we=0,ee=le[oe[0]],be=W.lookupOffsets[ee],ye=W.lookupOffsets[ee+1],te=Y[1].htrees[0];re>0;){var xe,Ee,ke,Be,Le,We,Oe,Me,Ne,Re,Ce;for(U.readMoreInput(),0===ne[1]&&(m(ae[1],v,1,oe,ie,se,U),ne[1]=u(A,F,U),te=Y[1].htrees[oe[1]]),--ne[1],xe=s(Y[1].codes,te,U),Ee=xe>>6,Ee>=2?(Ee-=2,Oe=-1):Oe=0,ke=O.kInsertRangeLut[Ee]+(xe>>3&7),Be=O.kCopyRangeLut[Ee]+(7&xe),Le=O.kInsertLengthPrefixCode[ke].offset+U.readBits(O.kInsertLengthPrefixCode[ke].nbits),We=O.kCopyLengthPrefixCode[Be].offset+U.readBits(O.kCopyLengthPrefixCode[Be].nbits),q=h[x-1&c],V=h[x-2&c],Re=0;Re<Le;++Re)U.readMoreInput(),0===ne[0]&&(m(ae[0],v,0,oe,ie,se,U),ne[0]=u(A,0,U),fe=oe[0]<<T,ce=fe,ee=le[oe[0]],be=W.lookupOffsets[ee],ye=W.lookupOffsets[ee+1]),Ne=W.lookup[be+q]|W.lookup[ye+V],he=de[ce+Ne],--ne[0],V=q,q=s(Y[0].codes,Y[0].htrees[he],U),h[x&c]=q,(x&c)===c&&t.write(h,d),++x;if(re-=Le,re<=0)break;if(Oe<0){var Ne;if(U.readMoreInput(),0===ne[2]&&(m(ae[2],v,2,oe,ie,se,U),ne[2]=u(A,2160,U),pe=oe[2]<<I,we=pe),--ne[2],Ne=255&(We>4?3:We-2),me=ue[we+Ne],Oe=s(Y[2].codes,Y[2].htrees[me],U),Oe>=X){var He,Se,Te;Oe-=X,Se=Oe&K,Oe>>=j,He=(Oe>>1)+1,Te=(2+(1&Oe)<<He)-4,Oe=X+(Te+U.readBits(He)<<j)+Se}}if(Me=f(Oe,P,D),Me<0)throw new Error("[BrotliDecompress] invalid distance");if(R=x<a&&R!==a?x:a,Ce=x&c,Me>R){if(!(We>=k.minDictionaryWordLength&&We<=k.maxDictionaryWordLength))throw new Error("Invalid backward reference. pos: "+x+" distance: "+Me+" len: "+We+" bytes left: "+re);var Te=k.offsetsByLength[We],Ie=Me-R-1,Pe=k.sizeBitsByLength[We],De=(1<<Pe)-1,Fe=Ie&De,qe=Ie>>Pe;if(Te+=Fe*We,!(qe<M.kNumTransforms))throw new Error("Invalid backward reference. pos: "+x+" distance: "+Me+" len: "+We+" bytes left: "+re);var Ve=M.transformDictionaryWord(h,Ce,Te,We,qe);if(Ce+=Ve,x+=Ve,re-=Ve,Ce>=g){t.write(h,d);for(var Ze=0;Ze<Ce-g;Ze++)h[Ze]=h[g+Ze]}}else{if(Oe>0&&(P[3&D]=Me,++D),We>re)throw new Error("Invalid backward reference. pos: "+x+" distance: "+Me+" len: "+We+" bytes left: "+re);for(Re=0;Re<We;++Re)h[x&c]=h[x-Me&c],(x&c)===c&&t.write(h,d),++x,--re}q=h[x-1&c],V=h[x-2&c]}x&=1073741823}}t.write(h,x&c)}var U=e("./streams").BrotliInput,x=e("./streams").BrotliOutput,E=e("./bit_reader"),k=e("./dictionary"),B=e("./huffman").HuffmanCode,L=e("./huffman").BrotliBuildHuffmanTable,W=e("./context"),O=e("./prefix"),M=e("./transform");const N=8,R=16,C=256,H=704,S=26,T=6,I=2,P=8,D=255,F=1080,q=18,V=new Uint8Array([1,2,3,4,0,5,17,6,16,7,8,9,10,11,12,13,14,15]),Z=16,Y=new Uint8Array([3,2,1,0,3,3,3,3,3,3,2,2,2,2,2,2]),z=new Int8Array([0,0,0,0,-1,1,-2,2,-3,3,-1,1,-2,2,-3,3]),G=new Uint16Array([256,402,436,468,500,534,566,598,630,662,694,726,758,790,822,854,886,920,952,984,1016,1048,1080]);p.prototype.decode=function(e){var t,r,n=0;for(t=0;t<this.num_htrees;++t)this.htrees[t]=n,r=l(this.alphabet_size,this.codes,n,e),n+=r},r.BrotliDecompressedSize=g,r.BrotliDecompressBuffer=v,r.BrotliDecompress=A,k.init()},"dec/dictionary.js":function(e,t,r){var n=e("./dictionary-browser");r.init=function(){r.dictionary=n.init()},r.offsetsByLength=new Uint32Array([0,0,0,0,0,4096,9216,21504,35840,44032,53248,63488,74752,87040,93696,100864,104704,106752,108928,113536,115968,118528,119872,121280,122016]),r.sizeBitsByLength=new Uint8Array([0,0,0,0,10,10,11,11,10,10,10,10,10,9,9,8,7,7,8,7,7,6,6,5,5]),r.minDictionaryWordLength=4,r.maxDictionaryWordLength=24},"dec/dictionary.bin.js":function(e,t,r){t.exports="W5/fcQLn5gKf2XUbAiQ1XULX+TZz6ADToDsgqk6qVfeC0e4m6OO2wcQ1J76ZBVRV1fRkEsdu//62zQsFEZWSTCnMhcsQKlS2qOhuVYYMGCkV0fXWEoMFbESXrKEZ9wdUEsyw9g4bJlEt1Y6oVMxMRTEVbCIwZzJzboK5j8m4YH02qgXYhv1V+PM435sLVxyHJihaJREEhZGqL03txGFQLm76caGO/ovxKvzCby/3vMTtX/459f0igi7WutnKiMQ6wODSoRh/8Lx1V3Q99MvKtwB6bHdERYRY0hStJoMjNeTsNX7bn+Y7e4EQ3bf8xBc7L0BsyfFPK43dGSXpL6clYC/I328h54/VYrQ5i0648FgbGtl837svJ35L3Mot/+nPlNpWgKx1gGXQYqX6n+bbZ7wuyCHKcUok12Xjqub7NXZGzqBx0SD+uziNf87t7ve42jxSKQoW3nyxVrWIGlFShhCKxjpZZ5MeGna0+lBkk+kaN8F9qFBAFgEogyMBdcX/T1W/WnMOi/7ycWUQloEBKGeC48MkiwqJkJO+12eQiOFHMmck6q/IjWW3RZlany23TBm+cNr/84/oi5GGmGBZWrZ6j+zykVozz5fT/QH/Da6WTbZYYPynVNO7kxzuNN2kxKKWche5WveitPKAecB8YcAHz/+zXLjcLzkdDSktNIDwZE9J9X+tto43oJy65wApM3mDzYtCwX9lM+N5VR3kXYo0Z3t0TtXfgBFg7gU8oN0Dgl7fZlUbhNll+0uuohRVKjrEd8egrSndy5/Tgd2gqjA4CAVuC7ESUmL3DZoGnfhQV8uwnpi8EGvAVVsowNRxPudck7+oqAUDkwZopWqFnW1riss0t1z6iCISVKreYGNvQcXv+1L9+jbP8cd/dPUiqBso2q+7ZyFBvENCkkVr44iyPbtOoOoCecWsiuqMSML5lv+vN5MzUr+Dnh73G7Q1YnRYJVYXHRJaNAOByiaK6CusgFdBPE40r0rvqXV7tksKO2DrHYXBTv8P5ysqxEx8VDXUDDqkPH6NNOV/a2WH8zlkXRELSa8P+heNyJBBP7PgsG1EtWtNef6/i+lcayzQwQCsduidpbKfhWUDgAEmyhGu/zVTacI6RS0zTABrOYueemnVa19u9fT23N/Ta6RvTpof5DWygqreCqrDAgM4LID1+1T/taU6yTFVLqXOv+/MuQOFnaF8vLMKD7tKWDoBdALgxF33zQccCcdHx8fKIVdW69O7qHtXpeGr9jbbpFA+qRMWr5hp0s67FPc7HAiLV0g0/peZlW7hJPYEhZyhpSwahnf93/tZgfqZWXFdmdXBzqxGHLrQKxoAY6fRoBhgCRPmmGueYZ5JexTVDKUIXzkG/fqp/0U3hAgQdJ9zumutK6nqWbaqvm1pgu03IYR+G+8s0jDBBz8cApZFSBeuWasyqo2OMDKAZCozS+GWSvL/HsE9rHxooe17U3s/lTE+VZAk4j3dp6uIGaC0JMiqR5CUsabPyM0dOYDR7Ea7ip4USZlya38YfPtvrX/tBlhHilj55nZ1nfN24AOAi9BVtz/Mbn8AEDJCqJgsVUa6nQnSxv2Fs7l/NlCzpfYEjmPrNyib/+t0ei2eEMjvNhLkHCZlci4WhBe7ePZTmzYqlY9+1pxtS4GB+5lM1BHT9tS270EWUDYFq1I0yY/fNiAk4bk9yBgmef/f2k6AlYQZHsNFnW8wBQxCd68iWv7/35bXfz3JZmfGligWAKRjIs3IpzxQ27vAglHSiOzCYzJ9L9A1CdiyFvyR66ucA4jKifu5ehwER26yV7HjKqn5Mfozo7Coxxt8LWWPT47BeMxX8p0Pjb7hZn+6bw7z3Lw+7653j5sI8CLu5kThpMlj1m4c2ch3jGcP1FsT13vuK3qjecKTZk2kHcOZY40UX+qdaxstZqsqQqgXz+QGF99ZJLqr3VYu4aecl1Ab5GmqS8k/GV5b95zxQ5d4EfXUJ6kTS/CXF/aiqKDOT1T7Jz5z0PwDUcwr9clLN1OJGCiKfqvah+h3XzrBOiLOW8wvn8gW6qE8vPxi+Efv+UH55T7PQFVMh6cZ1pZQlzJpKZ7P7uWvwPGJ6DTlR6wbyj3Iv2HyefnRo/dv7dNx+qaa0N38iBsR++Uil7Wd4afwDNsrzDAK4fXZwvEY/jdKuIKXlfrQd2C39dW7ntnRbIp9OtGy9pPBn/V2ASoi/2UJZfS+xuGLH8bnLuPlzdTNS6zdyk8Dt/h6sfOW5myxh1f+zf3zZ3MX/mO9cQPp5pOx967ZA6/pqHvclNfnUFF+rq+Vd7alKr6KWPcIDhpn6v2K6NlUu6LrKo8b/pYpU/Gazfvtwhn7tEOUuXht5rUJdSf6sLjYf0VTYDgwJ81yaqKTUYej/tbHckSRb/HZicwGJqh1mAHB/IuNs9dc9yuvF3D5Xocm3elWFdq5oEy70dYFit79yaLiNjPj5UUcVmZUVhQEhW5V2Z6Cm4HVH/R8qlamRYwBileuh07CbEce3TXa2JmXWBf+ozt319psboobeZhVnwhMZzOeQJzhpTDbP71Tv8HuZxxUI/+ma3XW6DFDDs4+qmpERwHGBd2edxwUKlODRdUWZ/g0GOezrbzOZauFMai4QU6GVHV6aPNBiBndHSsV4IzpvUiiYyg6OyyrL4Dj5q/Lw3N5kAwftEVl9rNd7Jk5PDij2hTH6wIXnsyXkKePxbmHYgC8A6an5Fob/KH5GtC0l4eFso+VpxedtJHdHpNm+Bvy4C79yVOkrZsLrQ3OHCeB0Ra+kBIRldUGlDCEmq2RwXnfyh6Dz+alk6eftI2n6sastRrGwbwszBeDRS/Fa/KwRJkCzTsLr/JCs5hOPE/MPLYdZ1F1fv7D+VmysX6NpOC8aU9F4Qs6HvDyUy9PvFGDKZ/P5101TYHFl8pjj6wm/qyS75etZhhfg0UEL4OYmHk6m6dO192AzoIyPSV9QedDA4Ml23rRbqxMPMxf7FJnDc5FTElVS/PyqgePzmwVZ26NWhRDQ+oaT7ly7ell4s3DypS1s0g+tOr7XHrrkZj9+x/mJBttrLx98lFIaRZzHz4aC7r52/JQ4VjHahY2/YVXZn/QC2ztQb/sY3uRlyc5vQS8nLPGT/n27495i8HPA152z7Fh5aFpyn1GPJKHuPL8Iw94DuW3KjkURAWZXn4EQy89xiKEHN1mk/tkM4gYDBxwNoYvRfE6LFqsxWJtPrDGbsnLMap3Ka3MUoytW0cvieozOmdERmhcqzG+3HmZv2yZeiIeQTKGdRT4HHNxekm1tY+/n06rGmFleqLscSERzctTKM6G9P0Pc1RmVvrascIxaO1CQCiYPE15bD7c3xSeW7gXxYjgxcrUlcbIvO0r+Yplhx0kTt3qafDOmFyMjgGxXu73rddMHpV1wMubyAGcf/v5dLr5P72Ta9lBF+fzMJrMycwv+9vnU3ANIl1cH9tfW7af8u0/HG0vV47jNFXzFTtaha1xvze/s8KMtCYucXc1nzfd/MQydUXn/b72RBt5wO/3jRcMH9BdhC/yctKBIveRYPrNpDWqBsO8VMmP+WvRaOcA4zRMR1PvSoO92rS7pYEv+fZfEfTMzEdM+6X5tLlyxExhqLRkms5EuLovLfx66de5fL2/yX02H52FPVwahrPqmN/E0oVXnsCKhbi/yRxX83nRbUKWhzYceXOntfuXn51NszJ6MO73pQf5Pl4in3ec4JU8hF7ppV34+mm9r1LY0ee/i1O1wpd8+zfLztE0cqBxggiBi5Bu95v9l3r9r/U5hweLn+TbfxowrWDqdJauKd8+q/dH8sbPkc9ttuyO94f7/XK/nHX46MPFLEb5qQlNPvhJ50/59t9ft3LXu7uVaWaO2bDrDCnRSzZyWvFKxO1+vT8MwwunR3bX0CkfPjqb4K9O19tn5X50PvmYpEwHtiW9WtzuV/s76B1zvLLNkViNd8ySxIl/3orfqP90TyTGaf7/rx8jQzeHJXdmh/N6YDvbvmTBwCdxfEQ1NcL6wNMdSIXNq7b1EUzRy1/Axsyk5p22GMG1b+GxFgbHErZh92wuvco0AuOLXct9hvw2nw/LqIcDRRmJmmZzcgUa7JpM/WV/S9IUfbF56TL2orzqwebdRD8nIYNJ41D/hz37Fo11p2Y21wzPcn713qVGhqtevStYfGH4n69OEJtPvbbLYWvscDqc3Hgnu166+tAyLnxrX0Y5zoYjV++1sI7t5kMr02KT/+uwtkc+rZLOf/qn/s3nYCf13Dg8/sB2diJgjGqjQ+TLhxbzyue2Ob7X6/9lUwW7a+lbznHzOYy8LKW1C/uRPbQY3KW/0gO9LXunHLvPL97afba9bFtc9hmz7GAttjVYlCvQAiOwAk/gC5+hkLEs6tr3AZKxLJtOEwk2dLxTYWsIB/j/ToWtIWzo906FrSG8iaqqqqqqiIiIiAgzMzMzNz+AyK+01/zi8n8S+Y1MjoRaQ80WU/G8MBlO+53VPXANrWm4wzGUVZUjjBJZVdhpcfkjsmcWaO+UEldXi1e+zq+HOsCpknYshuh8pOLISJun7TN0EIGW2xTnlOImeecnoGW4raxe2G1T3HEvfYUYMhG+gAFOAwh5nK8mZhwJMmN7r224QVsNFvZ87Z0qatvknklyPDK3Hy45PgVKXji52Wen4d4PlFVVYGnNap+fSpFbK90rYnhUc6n91Q3AY9E0tJOFrcfZtm/491XbcG/jsViUPPX76qmeuiz+qY1Hk7/1VPM405zWVuoheLUimpWYdVzCmUdKHebMdzgrYrb8mL2eeLSnRWHdonfZa8RsOU9F37w+591l5FLYHiOqWeHtE/lWrBHcRKp3uhtr8yXm8LU/5ms+NM6ZKsqu90cFZ4o58+k4rdrtB97NADFbwmEG7lXqvirhOTOqU14xuUF2myIjURcPHrPOQ4lmM3PeMg7bUuk0nnZi67bXsU6H8lhqIo8TaOrEafCO1ARK9PjC0QOoq2BxmMdgYB9G/lIb9++fqNJ2s7BHGFyBNmZAR8J3KCo012ikaSP8BCrf6VI0X5xdnbhHIO+B5rbOyB54zXkzfObyJ4ecwxfqBJMLFc7m59rNcw7hoHnFZ0b00zee+gTqvjm61Pb4xn0kcDX4jvHM0rBXZypG3DCKnD/Waa/ZtHmtFPgO5eETx+k7RrVg3aSwm2YoNXnCs3XPQDhNn+Fia6IlOOuIG6VJH7TP6ava26ehKHQa2T4N0tcZ9dPCGo3ZdnNltsHQbeYt5vPnJezV/cAeNypdml1vCHI8M81nSRP5Qi2+mI8v/sxiZru9187nRtp3f/42NemcONa+4eVC3PCZzc88aZh851CqSsshe70uPxeN/dmYwlwb3trwMrN1Gq8jbnApcVDx/yDPeYs5/7r62tsQ6lLg+DiFXTEhzR9dHqv0iT4tgj825W+H3XiRUNUZT2kR9Ri0+lp+UM3iQtS8uOE23Ly4KYtvqH13jghUntJRAewuzNLDXp8RxdcaA3cMY6TO2IeSFRXezeWIjCqyhsUdMYuCgYTZSKpBype1zRfq8FshvfBPc6BAQWl7/QxIDp3VGo1J3vn42OEs3qznws+YLRXbymyB19a9XBx6n/owcyxlEYyFWCi+kG9F+EyD/4yn80+agaZ9P7ay2Dny99aK2o91FkfEOY8hBwyfi5uwx2y5SaHmG+oq/zl1FX/8irOf8Y3vAcX/6uLP6A6nvMO24edSGPjQc827Rw2atX+z2bKq0CmW9mOtYnr5/AfDa1ZfPaXnKtlWborup7QYx+Or2uWb+N3N//2+yDcXMqIJdf55xl7/vsj4WoPPlxLxtVrkJ4w/tTe3mLdATOOYwxcq52w5Wxz5MbPdVs5O8/lhfE7dPj0bIiPQ3QV0iqm4m3YX8hRfc6jQ3fWepevMqUDJd86Z4vwM40CWHnn+WphsGHfieF02D3tmZvpWD+kBpNCFcLnZhcmmrhpGzzbdA+sQ1ar18OJD87IOKOFoRNznaHPNHUfUNhvY1iU+uhvEvpKHaUn3qK3exVVyX4joipp3um7FmYJWmA+WbIDshRpbVRx5/nqstCgy87FGbfVB8yDGCqS+2qCsnRwnSAN6zgzxfdB2nBT/vZ4/6uxb6oH8b4VBRxiIB93wLa47hG3w2SL/2Z27yOXJFwZpSJaBYyvajA7vRRYNKqljXKpt/CFD/tSMr18DKKbwB0xggBePatl1nki0yvqW5zchlyZmJ0OTxJ3D+fsYJs/mxYN5+Le5oagtcl+YsVvy8kSjI2YGvGjvmpkRS9W2dtXqWnVuxUhURm1lKtou/hdEq19VBp9OjGvHEQSmrpuf2R24mXGheil8KeiANY8fW1VERUfBImb64j12caBZmRViZHbeVMjCrPDg9A90IXrtnsYCuZtRQ0PyrKDjBNOsPfKsg1pA02gHlVr0OXiFhtp6nJqXVzcbfM0KnzC3ggOENPE9VBdmHKN6LYaijb4wXxJn5A0FSDF5j+h1ooZx885Jt3ZKzO5n7Z5WfNEOtyyPqQEnn7WLv5Fis3PdgMshjF1FRydbNyeBbyKI1oN1TRVrVK7kgsb/zjX4NDPIRMctVeaxVB38Vh1x5KbeJbU138AM5KzmZu3uny0ErygxiJF7GVXUrPzFxrlx1uFdAaZFDN9cvIb74qD9tzBMo7L7WIEYK+sla1DVMHpF0F7b3+Y6S+zjvLeDMCpapmJo1weBWuxKF3rOocih1gun4BoJh1kWnV/Jmiq6uOhK3VfKxEHEkafjLgK3oujaPzY6SXg8phhL4TNR1xvJd1Wa0aYFfPUMLrNBDCh4AuGRTbtKMc6Z1Udj8evY/ZpCuMAUefdo69DZUngoqE1P9A3PJfOf7WixCEj+Y6t7fYeHbbxUAoFV3M89cCKfma3fc1+jKRe7MFWEbQqEfyzO2x/wrO2VYH7iYdQ9BkPyI8/3kXBpLaCpU7eC0Yv/am/tEDu7HZpqg0EvHo0nf/R/gRzUWy33/HXMJQeu1GylKmOkXzlCfGFruAcPPhaGqZOtu19zsJ1SO2Jz4Ztth5cBX6mRQwWmDwryG9FUMlZzNckMdK+IoMJv1rOWnBamS2w2KHiaPMPLC15hCZm4KTpoZyj4E2TqC/P6r7/EhnDMhKicZZ1ZwxuC7DPzDGs53q8gXaI9kFTK+2LTq7bhwsTbrMV8Rsfua5lMS0FwbTitUVnVa1yTb5IX51mmYnUcP9wPr8Ji1tiYJeJV9GZTrQhF7vvdU2OTU42ogJ9FDwhmycI2LIg++03C6scYhUyUuMV5tkw6kGUoL+mjNC38+wMdWNljn6tGPpRES7veqrSn5TRuv+dh6JVL/iDHU1db4c9WK3++OrH3PqziF916UMUKn8G67nN60GfWiHrXYhUG3yVWmyYak59NHj8t1smG4UDiWz2rPHNrKnN4Zo1LBbr2/eF9YZ0n0blx2nG4X+EKFxvS3W28JESD+FWk61VCD3z/URGHiJl++7TdBwkCj6tGOH3qDb0QqcOF9Kzpj0HUb/KyFW3Yhj2VMKJqGZleFBH7vqvf7WqLC3XMuHV8q8a4sTFuxUtkD/6JIBvKaVjv96ndgruKZ1k/BHzqf2K9fLk7HGXANyLDd1vxkK/i055pnzl+zw6zLnwXlVYVtfmacJgEpRP1hbGgrYPVN6v2lG+idQNGmwcKXu/8xEj/P6qe/sB2WmwNp6pp8jaISMkwdleFXYK55NHWLTTbutSUqjBfDGWo/Yg918qQ+8BRZSAHZbfuNZz2O0sov1Ue4CWlVg3rFhM3Kljj9ksGd/NUhk4nH+a5UN2+1i8+NM3vRNp7uQ6sqexSCukEVlVZriHNqFi5rLm9TMWa4qm3idJqppQACol2l4VSuvWLfta4JcXy3bROPNbXOgdOhG47LC0CwW/dMlSx4Jf17aEU3yA1x9p+Yc0jupXgcMuYNku64iYOkGToVDuJvlbEKlJqsmiHbvNrIVZEH+yFdF8DbleZ6iNiWwMqvtMp/mSpwx5KxRrT9p3MAPTHGtMbfvdFhyj9vhaKcn3At8Lc16Ai+vBcSp1ztXi7rCJZx/ql7TXcclq6Q76UeKWDy9boS0WHIjUuWhPG8LBmW5y2rhuTpM5vsLt+HOLh1Yf0DqXa9tsfC+kaKt2htA0ai/L2i7RKoNjEwztkmRU0GfgW1TxUvPFhg0V7DdfWJk5gfrccpYv+MA9M0dkGTLECeYwUixRzjRFdmjG7zdZIl3XKB9YliNKI31lfa7i2JG5C8Ss+rHe0D7Z696/V3DEAOWHnQ9yNahMUl5kENWS6pHKKp2D1BaSrrHdE1w2qNxIztpXgUIrF0bm15YML4b6V1k+GpNysTahKMVrrS85lTVo9OGJ96I47eAy5rYWpRf/mIzeoYU1DKaQCTUVwrhHeyNoDqHel+lLxr9WKzhSYw7vrR6+V5q0pfi2k3L1zqkubY6rrd9ZLvSuWNf0uqnkY+FpTvFzSW9Fp0b9l8JA7THV9eCi/PY/SCZIUYx3BU2alj7Cm3VV6eYpios4b6WuNOJdYXUK3zTqj5CVG2FqYM4Z7CuIU0qO05XR0d71FHM0YhZmJmTRfLlXEumN82BGtzdX0S19t1e+bUieK8zRmqpa4Qc5TSjifmaQsY2ETLjhI36gMR1+7qpjdXXHiceUekfBaucHShAOiFXmv3sNmGQyU5iVgnoocuonQXEPTFwslHtS8R+A47StI9wj0iSrtbi5rMysczFiImsQ+bdFClnFjjpXXwMy6O7qfjOr8Fb0a7ODItisjnn3EQO16+ypd1cwyaAW5Yzxz5QknfMO7643fXW/I9y3U2xH27Oapqr56Z/tEzglj6IbT6HEHjopiXqeRbe5mQQvxtcbDOVverN0ZgMdzqRYRjaXtMRd56Q4cZSmdPvZJdSrhJ1D9zNXPqAEqPIavPdfubt5oke2kmv0dztIszSv2VYuoyf1UuopbsYb+uX9h6WpwjpgtZ6fNNawNJ4q8O3CFoSbioAaOSZMx2GYaPYB+rEb6qjQiNRFQ76TvwNFVKD+BhH9VhcKGsXzmMI7BptU/CNWolM7YzROvpFAntsiWJp6eR2d3GarcYShVYSUqhmYOWj5E96NK2WvmYNTeY7Zs4RUEdv9h9QT4EseKt6LzLrqEOs3hxAY1MaNWpSa6zZx8F3YOVeCYMS88W+CYHDuWe4yoc6YK+djDuEOrBR5lvh0r+Q9uM88lrjx9x9AtgpQVNE8r+3O6Gvw59D+kBF/UMXyhliYUtPjmvXGY6Dk3x+kEOW+GtdMVC4EZTqoS/jmR0P0LS75DOc/w2vnri97M4SdbZ8qeU7gg8DVbERkU5geaMQO3mYrSYyAngeUQqrN0C0/vsFmcgWNXNeidsTAj7/4MncJR0caaBUpbLK1yBCBNRjEv6KvuVSdpPnEMJdsRRtqJ+U8tN1gXA4ePHc6ZT0eviI73UOJF0fEZ8YaneAQqQdGphNvwM4nIqPnXxV0xA0fnCT+oAhJuyw/q8jO0y8CjSteZExwBpIN6SvNp6A5G/abi6egeND/1GTguhuNjaUbbnSbGd4L8937Ezm34Eyi6n1maeOBxh3PI0jzJDf5mh/BsLD7F2GOKvlA/5gtvxI3/eV4sLfKW5Wy+oio+es/u6T8UU+nsofy57Icb/JlZHPFtCgd/x+bwt3ZT+xXTtTtTrGAb4QehC6X9G+8YT+ozcLxDsdCjsuOqwPFnrdLYaFc92Ui0m4fr39lYmlCaqTit7G6O/3kWDkgtXjNH4BiEm/+jegQnihOtfffn33WxsFjhfMd48HT+f6o6X65j7XR8WLSHMFkxbvOYsrRsF1bowDuSQ18Mkxk4qz2zoGPL5fu9h2Hqmt1asl3Q3Yu3szOc+spiCmX4AETBM3pLoTYSp3sVxahyhL8eC4mPN9k2x3o0xkiixIzM3CZFzf5oR4mecQ5+ax2wCah3/crmnHoqR0+KMaOPxRif1oEFRFOO/kTPPmtww+NfMXxEK6gn6iU32U6fFruIz8Q4WgljtnaCVTBgWx7diUdshC9ZEa5yKpRBBeW12r/iNc/+EgNqmhswNB8SBoihHXeDF7rrWDLcmt3V8GYYN7pXRy4DZjj4DJuUBL5iC3DQAaoo4vkftqVTYRGLS3mHZ7gdmdTTqbgNN/PTdTCOTgXolc88MhXAEUMdX0iy1JMuk5wLsgeu0QUYlz2S4skTWwJz6pOm/8ihrmgGfFgri+ZWUK2gAPHgbWa8jaocdSuM4FJYoKicYX/ZSENkg9Q1ZzJfwScfVnR2DegOGwCvmogaWJCLQepv9WNlU6QgsmOwICquU28Mlk3d9W5E81lU/5Ez0LcX6lwKMWDNluNKfBDUy/phJgBcMnfkh9iRxrdOzgs08JdPB85Lwo+GUSb4t3nC+0byqMZtO2fQJ4U2zGIr49t/28qmmGv2RanDD7a3FEcdtutkW8twwwlUSpb8QalodddbBfNHKDQ828BdE7OBgFdiKYohLawFYqpybQoxATZrheLhdI7+0Zlu9Q1myRcd15r9UIm8K2LGJxqTegntqNVMKnf1a8zQiyUR1rxoqjiFxeHxqFcYUTHfDu7rhbWng6qOxOsI+5A1p9mRyEPdVkTlE24vY54W7bWc6jMgZvNXdfC9/9q7408KDsbdL7Utz7QFSDetz2picArzrdpL8OaCHC9V26RroemtDZ5yNM/KGkWMyTmfnInEvwtSD23UcFcjhaE3VKzkoaEMKGBft4XbIO6forTY1lmGQwVmKicBCiArDzE+1oIxE08fWeviIOD5TznqH+OoHadvoOP20drMPe5Irg3XBQziW2XDuHYzjqQQ4wySssjXUs5H+t3FWYMHppUnBHMx/nYIT5d7OmjDbgD9F6na3m4l7KdkeSO3kTEPXafiWinogag7b52taiZhL1TSvBFmEZafFq2H8khQaZXuitCewT5FBgVtPK0j4xUHPfUz3Q28eac1Z139DAP23dgki94EC8vbDPTQC97HPPSWjUNG5tWKMsaxAEMKC0665Xvo1Ntd07wCLNf8Q56mrEPVpCxlIMVlQlWRxM3oAfpgIc+8KC3rEXUog5g06vt7zgXY8grH7hhwVSaeuvC06YYRAwpbyk/Unzj9hLEZNs2oxPQB9yc+GnL6zTgq7rI++KDJwX2SP8Sd6YzTuw5lV/kU6eQxRD12omfQAW6caTR4LikYkBB1CMOrvgRr/VY75+NSB40Cni6bADAtaK+vyxVWpf9NeKJxN2KYQ8Q2xPB3K1s7fuhvWbr2XpgW044VD6DRs0qXoqKf1NFsaGvKJc47leUV3pppP/5VTKFhaGuol4Esfjf5zyCyUHmHthChcYh4hYLQF+AFWsuq4t0wJyWgdwQVOZiV0efRHPoK5+E1vjz9wTJmVkITC9oEstAsyZSgE/dbicwKr89YUxKZI+owD205Tm5lnnmDRuP/JnzxX3gMtlrcX0UesZdxyQqYQuEW4R51vmQ5xOZteUd8SJruMlTUzhtVw/Nq7eUBcqN2/HVotgfngif60yKEtoUx3WYOZlVJuJOh8u59fzSDPFYtQgqDUAGyGhQOAvKroXMcOYY0qjnStJR/G3aP+Jt1sLVlGV8POwr/6OGsqetnyF3TmTqZjENfnXh51oxe9qVUw2M78EzAJ+IM8lZ1MBPQ9ZWSVc4J3mWSrLKrMHReA5qdGoz0ODRsaA+vwxXA2cAM4qlfzBJA6581m4hzxItQw5dxrrBL3Y6kCbUcFxo1S8jyV44q//+7ASNNudZ6xeaNOSIUffqMn4A9lIjFctYn2gpEPAb3f7p3iIBN8H14FUGQ9ct2hPsL+cEsTgUrR47uJVN4n4wt/wgfwwHuOnLd4yobkofy8JvxSQTA7rMpDIc608SlZFJfZYcmbT0tAHpPE8MrtQ42siTUNWxqvWZOmvu9f0JPoQmg+6l7sZWwyfi6PXkxJnwBraUG0MYG4zYHQz3igy/XsFkx5tNQxw43qvI9dU3f0DdhOUlHKjmi1VAr2Kiy0HZwD8VeEbhh0OiDdMYspolQsYdSwjCcjeowIXNZVUPmL2wwIkYhmXKhGozdCJ4lRKbsf4NBh/XnQoS92NJEWOVOFs2YhN8c5QZFeK0pRdAG40hqvLbmoSA8xQmzOOEc7wLcme9JOsjPCEgpCwUs9E2DohMHRhUeyGIN6TFvrbny8nDuilsDpzrH5mS76APoIEJmItS67sQJ+nfwddzmjPxcBEBBCw0kWDwd0EZCkNeOD7NNQhtBm7KHL9mRxj6U1yWU2puzlIDtpYxdH4ZPeXBJkTGAJfUr/oTCz/iypY6uXaR2V1doPxJYlrw2ghH0D5gbrhFcIxzYwi4a/4hqVdf2DdxBp6vGYDjavxMAAoy+1+3aiO6S3W/QAKNVXagDtvsNtx7Ks+HKgo6U21B+QSZgIogV5Bt+BnXisdVfy9VyXV+2P5fMuvdpAjM1o/K9Z+XnE4EOCrue+kcdYHqAQ0/Y/OmNlQ6OI33jH/uD1RalPaHpJAm2av0/xtpqdXVKNDrc9F2izo23Wu7firgbURFDNX9eGGeYBhiypyXZft2j3hTvzE6PMWKsod//rEILDkzBXfi7xh0eFkfb3/1zzPK/PI5Nk3FbZyTl4mq5BfBoVoqiPHO4Q4QKZAlrQ3MdNfi3oxIjvsM3kAFv3fdufurqYR3PSwX/mpGy/GFI/B2MNPiNdOppWVbs/gjF3YH+QA9jMhlAbhvasAHstB0IJew09iAkmXHl1/TEj+jvHOpOGrPRQXbPADM+Ig2/OEcUcpgPTItMtW4DdqgfYVI/+4hAFWYjUGpOP/UwNuB7+BbKOcALbjobdgzeBQfjgNSp2GOpxzGLj70Vvq5cw2AoYENwKLUtJUX8sGRox4dVa/TN4xKwaKcl9XawQR/uNus700Hf17pyNnezrUgaY9e4MADhEDBpsJT6y1gDJs1q6wlwGhuUzGR7C8kgpjPyHWwsvrf3yn1zJEIRa5eSxoLAZOCR9xbuztxFRJW9ZmMYfCFJ0evm9F2fVnuje92Rc4Pl6A8bluN8MZyyJGZ0+sNSb//DvAFxC2BqlEsFwccWeAl6CyBcQV1bx4mQMBP1Jxqk1EUADNLeieS2dUFbQ/c/kvwItbZ7tx0st16viqd53WsRmPTKv2AD8CUnhtPWg5aUegNpsYgasaw2+EVooeNKmrW3MFtj76bYHJm5K9gpAXZXsE5U8DM8XmVOSJ1F1WnLy6nQup+jx52bAb+rCq6y9WXl2B2oZDhfDkW7H3oYfT/4xx5VncBuxMXP2lNfhUVQjSSzSRbuZFE4vFawlzveXxaYKVs8LpvAb8IRYF3ZHiRnm0ADeNPWocwxSzNseG7NrSEVZoHdKWqaGEBz1N8Pt7kFbqh3LYmAbm9i1IChIpLpM5AS6mr6OAPHMwwznVy61YpBYX8xZDN/a+lt7n+x5j4bNOVteZ8lj3hpAHSx1VR8vZHec4AHO9XFCdjZ9eRkSV65ljMmZVzaej2qFn/qt1lvWzNZEfHxK3qOJrHL6crr0CRzMox5f2e8ALBB4UGFZKA3tN6F6IXd32GTJXGQ7DTi9j/dNcLF9jCbDcWGKxoKTYblIwbLDReL00LRcDPMcQuXLMh5YzgtfjkFK1DP1iDzzYYVZz5M/kWYRlRpig1htVRjVCknm+h1M5LiEDXOyHREhvzCGpFZjHS0RsK27o2avgdilrJkalWqPW3D9gmwV37HKmfM3F8YZj2ar+vHFvf3B8CRoH4kDHIK9mrAg+owiEwNjjd9V+FsQKYR8czJrUkf7Qoi2YaW6EVDZp5zYlqiYtuXOTHk4fAcZ7qBbdLDiJq0WNV1l2+Hntk1mMWvxrYmc8kIx8G3rW36J6Ra4lLrTOCgiOihmow+YnzUT19jbV2B3RWqSHyxkhmgsBqMYWvOcUom1jDQ436+fcbu3xf2bbeqU/ca+C4DOKE+e3qvmeMqW3AxejfzBRFVcwVYPq4L0APSWWoJu+5UYX4qg5U6YTioqQGPG9XrnuZ/BkxuYpe6Li87+18EskyQW/uA+uk2rpHpr6hut2TlVbKgWkFpx+AZffweiw2+VittkEyf/ifinS/0ItRL2Jq3tQOcxPaWO2xrG68GdFoUpZgFXaP2wYVtRc6xYCfI1CaBqyWpg4bx8OHBQwsV4XWMibZZ0LYjWEy2IxQ1mZrf1/UNbYCJplWu3nZ4WpodIGVA05d+RWSS+ET9tH3RfGGmNI1cIY7evZZq7o+a0bjjygpmR3mVfalkT/SZGT27Q8QGalwGlDOS9VHCyFAIL0a1Q7JiW3saz9gqY8lqKynFrPCzxkU4SIfLc9VfCI5edgRhDXs0edO992nhTKHriREP1NJC6SROMgQ0xO5kNNZOhMOIT99AUElbxqeZF8A3xrfDJsWtDnUenAHdYWSwAbYjFqQZ+D5gi3hNK8CSxU9i6f6ClL9IGlj1OPMQAsr84YG6ijsJpCaGWj75c3yOZKBB9mNpQNPUKkK0D6wgLH8MGoyRxTX6Y05Q4AnYNXMZwXM4eij/9WpsM/9CoRnFQXGR6MEaY+FXvXEO3RO0JaStk6OXuHVATHJE+1W+TU3bSZ2ksMtqjO0zfSJCdBv7y2d8DMx6TfVme3q0ZpTKMMu4YL/t7ciTNtdDkwPogh3Cnjx7qk08SHwf+dksZ7M2vCOlfsF0hQ6J4ehPCaHTNrM/zBSOqD83dBEBCW/F/LEmeh0nOHd7oVl3/Qo/9GUDkkbj7yz+9cvvu+dDAtx8NzCDTP4iKdZvk9MWiizvtILLepysflSvTLFBZ37RLwiriqyRxYv/zrgFd/9XVHh/OmzBvDX4mitMR/lUavs2Vx6cR94lzAkplm3IRNy4TFfu47tuYs9EQPIPVta4P64tV+sZ7n3ued3cgEx2YK+QL5+xms6osk8qQbTyuKVGdaX9FQqk6qfDnT5ykxk0VK7KZ62b6DNDUfQlqGHxSMKv1P0XN5BqMeKG1P4Wp5QfZDUCEldppoX0U6ss2jIko2XpURKCIhfaOqLPfShdtS37ZrT+jFRSH2xYVV1rmT/MBtRQhxiO4MQ3iAGlaZi+9PWBEIXOVnu9jN1f921lWLZky9bqbM3J2MAAI9jmuAx3gyoEUa6P2ivs0EeNv/OR+AX6q5SW6l5HaoFuS6jr6yg9limu+P0KYKzfMXWcQSfTXzpOzKEKpwI3YGXZpSSy2LTlMgfmFA3CF6R5c9xWEtRuCg2ZPUQ2Nb6dRFTNd4TfGHrnEWSKHPuRyiJSDAZ+KX0VxmSHjGPbQTLVpqixia2uyhQ394gBMt7C3ZAmxn/DJS+l1fBsAo2Eir/C0jG9csd4+/tp12pPc/BVJGaK9mfvr7M/CeztrmCO5qY06Edi4xAGtiEhnWAbzLy2VEyazE1J5nPmgU4RpW4Sa0TnOT6w5lgt3/tMpROigHHmexBGAMY0mdcDbDxWIz41NgdD6oxgHsJRgr5RnT6wZAkTOcStU4NMOQNemSO7gxGahdEsC+NRVGxMUhQmmM0llWRbbmFGHzEqLM4Iw0H7577Kyo+Zf+2cUFIOw93gEY171vQaM0HLwpjpdRR6Jz7V0ckE7XzYJ0TmY9znLdzkva0vNrAGGT5SUZ5uaHDkcGvI0ySpwkasEgZPMseYcu85w8HPdSNi+4T6A83iAwDbxgeFcB1ZM2iGXzFcEOUlYVrEckaOyodfvaYSQ7GuB4ISE0nYJc15X/1ciDTPbPCgYJK55VkEor4LvzL9S2WDy4xj+6FOqVyTAC2ZNowheeeSI5hA/02l8UYkv4nk9iaVn+kCVEUstgk5Hyq+gJm6R9vG3rhuM904he/hFmNQaUIATB1y3vw+OmxP4X5Yi6A5I5jJufHCjF9+AGNwnEllZjUco6XhsO5T5+R3yxz5yLVOnAn0zuS+6zdj0nTJbEZCbXJdtpfYZfCeCOqJHoE2vPPFS6eRLjIJlG69X93nfR0mxSFXzp1Zc0lt/VafDaImhUMtbnqWVb9M4nGNQLN68BHP7AR8Il9dkcxzmBv8PCZlw9guY0lurbBsmNYlwJZsA/B15/HfkbjbwPddaVecls/elmDHNW2r4crAx43feNkfRwsaNq/yyJ0d/p5hZ6AZajz7DBfUok0ZU62gCzz7x8eVfJTKA8IWn45vINLSM1q+HF9CV9qF3zP6Ml21kPPL3CXzkuYUlnSqT+Ij4tI/od5KwIs+tDajDs64owN7tOAd6eucGz+KfO26iNcBFpbWA5732bBNWO4kHNpr9D955L61bvHCF/mwSrz6eQaDjfDEANqGMkFc+NGxpKZzCD2sj/JrHd+zlPQ8Iz7Q+2JVIiVCuCKoK/hlAEHzvk/Piq3mRL1rT/fEh9hoT5GJmeYswg1otiKydizJ/fS2SeKHVu6Z3JEHjiW8NaTQgP5xdBli8nC57XiN9hrquBu99hn9zqwo92+PM2JXtpeVZS0PdqR5mDyDreMMtEws+CpwaRyyzoYtfcvt9PJIW0fJVNNi/FFyRsea7peLvJrL+5b4GOXJ8tAr+ATk9f8KmiIsRhqRy0vFzwRV3Z5dZ3QqIU8JQ/uQpkJbjMUMFj2F9sCFeaBjI4+fL/oN3+LQgjI4zuAfQ+3IPIPFQBccf0clJpsfpnBxD84atwtupkGqKvrH7cGNl/QcWcSi6wcVDML6ljOgYbo+2BOAWNNjlUBPiyitUAwbnhFvLbnqw42kR3Yp2kv2dMeDdcGOX5kT4S6M44KHEB/SpCfl7xgsUvs+JNY9G3O2X/6FEt9FyAn57lrbiu+tl83sCymSvq9eZbe9mchL7MTf/Ta78e80zSf0hYY5eUU7+ff14jv7Xy8qjzfzzzvaJnrIdvFb5BLWKcWGy5/w7+vV2cvIfwHqdTB+RuJK5oj9mbt0Hy94AmjMjjwYNZlNS6uiyxNnwNyt3gdreLb64p/3+08nXkb92LTkkRgFOwk1oGEVllcOj5lv1hfAZywDows0944U8vUFw+A/nuVq/UCygsrmWIBnHyU01d0XJPwriEOvx/ISK6Pk4y2w0gmojZs7lU8TtakBAdne4v/aNxmMpK4VcGMp7si0yqsiolXRuOi1Z1P7SqD3Zmp0CWcyK4Ubmp2SXiXuI5nGLCieFHKHNRIlcY3Pys2dwMTYCaqlyWSITwr2oGXvyU3h1Pf8eQ3w1bnD7ilocVjYDkcXR3Oo1BXgMLTUjNw2xMVwjtp99NhSVc5aIWrDQT5DHPKtCtheBP4zHcw4dz2eRdTMamhlHhtfgqJJHI7NGDUw1XL8vsSeSHyKqDtqoAmrQqsYwvwi7HW3ojWyhIa5oz5xJTaq14NAzFLjVLR12rRNUQ6xohDnrWFb5bG9yf8aCD8d5phoackcNJp+Dw3Due3RM+5Rid7EuIgsnwgpX0rUWh/nqPtByMhMZZ69NpgvRTKZ62ViZ+Q7Dp5r4K0d7EfJuiy06KuIYauRh5Ecrhdt2QpTS1k1AscEHvapNbU3HL1F2TFyR33Wxb5MvH5iZsrn3SDcsxlnnshO8PLwmdGN+paWnQuORtZGX37uhFT64SeuPsx8UOokY6ON85WdQ1dki5zErsJGazcBOddWJEKqNPiJpsMD1GrVLrVY+AOdPWQneTyyP1hRX/lMM4ZogGGOhYuAdr7F/DOiAoc++cn5vlf0zkMUJ40Z1rlgv9BelPqVOpxKeOpzKdF8maK+1Vv23MO9k/8+qpLoxrIGH2EDQlnGmH8CD31G8QqlyQIcpmR5bwmSVw9/Ns6IHgulCRehvZ/+VrM60Cu/r3AontFfrljew74skYe2uyn7JKQtFQBQRJ9ryGic/zQOsbS4scUBctA8cPToQ3x6ZBQu6DPu5m1bnCtP8TllLYA0UTQNVqza5nfew3Mopy1GPUwG5jsl0OVXniPmAcmLqO5HG8Hv3nSLecE9oOjPDXcsTxoCBxYyzBdj4wmnyEV4kvFDunipS8SSkvdaMnTBN9brHUR8xdmmEAp/Pdqk9uextp1t+JrtXwpN/MG2w/qhRMpSNxQ1uhg/kKO30eQ/FyHUDkWHT8V6gGRU4DhDMxZu7xXij9Ui6jlpWmQCqJg3FkOTq3WKneCRYZxBXMNAVLQgHXSCGSqNdjebY94oyIpVjMYehAiFx/tqzBXFHZaL5PeeD74rW5OysFoUXY8sebUZleFTUa/+zBKVTFDopTReXNuZq47QjkWnxjirCommO4L/GrFtVV21EpMyw8wyThL5Y59d88xtlx1g1ttSICDwnof6lt/6zliPzgVUL8jWBjC0o2D6Kg+jNuThkAlaDJsq/AG2aKA//A76avw2KNqtv223P+Wq3StRDDNKFFgtsFukYt1GFDWooFVXitaNhb3RCyJi4cMeNjROiPEDb4k+G3+hD8tsg+5hhmSc/8t2JTSwYoCzAI75doq8QTHe+E/Tw0RQSUDlU+6uBeNN3h6jJGX/mH8oj0i3caCNsjvTnoh73BtyZpsflHLq6AfwJNCDX4S98h4+pCOhGKDhV3rtkKHMa3EG4J9y8zFWI4UsfNzC/Rl5midNn7gwoN9j23HGCQQ+OAZpTTPMdiVow740gIyuEtd0qVxMyNXhHcnuXRKdw5wDUSL358ktjMXmAkvIB73BLa1vfF9BAUZInPYJiwxqFWQQBVk7gQH4ojfUQ/KEjn+A/WR6EEe4CtbpoLe1mzHkajgTIoE0SLDHVauKhrq12zrAXBGbPPWKCt4DGedq3JyGRbmPFW32bE7T20+73BatV/qQhhBWfWBFHfhYWXjALts38FemnoT+9bn1jDBMcUMmYgSc0e7GQjv2MUBwLU8ionCpgV+Qrhg7iUIfUY6JFxR0Y+ZTCPM+rVuq0GNLyJXX6nrUTt8HzFBRY1E/FIm2EeVA9NcXrj7S6YYIChVQCWr/m2fYUjC4j0XLkzZ8GCSLfmkW3PB/xq+nlXsKVBOj7vTvqKCOMq7Ztqr3cQ+N8gBnPaAps+oGwWOkbuxnRYj/x/WjiDclVrs22xMK4qArE1Ztk1456kiJriw6abkNeRHogaPRBgbgF9Z8i/tbzWELN4CvbqtrqV9TtGSnmPS2F9kqOIBaazHYaJ9bi3AoDBvlZasMluxt0BDXfhp02Jn411aVt6S4TUB8ZgFDkI6TP6gwPY85w+oUQSsjIeXVminrwIdK2ZAawb8Se6XOJbOaliQxHSrnAeONDLuCnFejIbp4YDtBcQCwMsYiRZfHefuEJqJcwKTTJ8sx5hjHmJI1sPFHOr6W9AhZ2NAod38mnLQk1gOz2LCAohoQbgMbUK9RMEA3LkiF7Sr9tLZp6lkciIGhE2V546w3Mam53VtVkGbB9w0Yk2XiRnCmbpxmHr2k4eSC0RuNbjNsUfDIfc8DZvRvgUDe1IlKdZTzcT4ZGEb53dp8VtsoZlyXzLHOdAbsp1LPTVaHvLA0GYDFMbAW/WUBfUAdHwqLFAV+3uHvYWrCfhUOR2i89qvCBoOb48usAGdcF2M4aKn79k/43WzBZ+xR1L0uZfia70XP9soQReeuhZiUnXFDG1T8/OXNmssTSnYO+3kVLAgeiY719uDwL9FQycgLPessNihMZbAKG7qwPZyG11G1+ZA3jAX2yddpYfmaKBlmfcK/V0mwIRUDC0nJSOPUl2KB8h13F4dlVZiRhdGY5farwN+f9hEb1cRi41ZcGDn6Xe9MMSTOY81ULJyXIHSWFIQHstVYLiJEiUjktlHiGjntN5/btB8Fu+vp28zl2fZXN+dJDyN6EXhS+0yzqpl/LSJNEUVxmu7BsNdjAY0jVsAhkNuuY0E1G48ej25mSt+00yPbQ4SRCVkIwb6ISvYtmJRPz9Zt5dk76blf+lJwAPH5KDF+vHAmACLoCdG2Adii6dOHnNJnTmZtoOGO8Q1jy1veMw6gbLFToQmfJa7nT7Al89mRbRkZZQxJTKgK5Kc9INzmTJFp0tpAPzNmyL/F08bX3nhCumM/cR/2RPn9emZ3VljokttZD1zVWXlUIqEU7SLk5I0lFRU0AcENXBYazNaVzsVHA/sD3o9hm42wbHIRb/BBQTKzAi8s3+bMtpOOZgLdQzCYPfX3UUxKd1WYVkGH7lh/RBBgMZZwXzU9+GYxdBqlGs0LP+DZ5g2BWNh6FAcR944B+K/JTWI3t9YyVyRhlP4CCoUk/mmF7+r2pilVBjxXBHFaBfBtr9hbVn2zDuI0kEOG3kBx8CGdPOjX1ph1POOZJUO1JEGG0jzUy2tK4X0CgVNYhmkqqQysRNtKuPdCJqK3WW57kaV17vXgiyPrl4KEEWgiGF1euI4QkSFHFf0TDroQiLNKJiLbdhH0YBhriRNCHPxSqJmNNoketaioohqMglh6wLtEGWSM1EZbQg72h0UJAIPVFCAJOThpQGGdKfFovcwEeiBuZHN2Ob4uVM7+gwZLz1D9E7ta4RmMZ24OBBAg7Eh6dLXGofZ4U2TFOCQMKjwhVckjrydRS+YaqCw1kYt6UexuzbNEDyYLTZnrY1PzsHZJT4U+awO2xlqTSYu6n/U29O2wPXgGOEKDMSq+zTUtyc8+6iLp0ivav4FKx+xxVy4FxhIF/pucVDqpsVe2jFOfdZhTzLz2QjtzvsTCvDPU7bzDH2eXVKUV9TZ+qFtaSSxnYgYdXKwVreIgvWhT9eGDB2OvnWyPLfIIIfNnfIxU8nW7MbcH05nhlsYtaW9EZRsxWcKdEqInq1DiZPKCz7iGmAU9/ccnnQud2pNgIGFYOTAWjhIrd63aPDgfj8/sdlD4l+UTlcxTI9jbaMqqN0gQxSHs60IAcW3cH4p3V1aSciTKB29L1tz2eUQhRiTgTvmqc+sGtBNh4ky0mQJGsdycBREP+fAaSs1EREDVo5gvgi5+aCN7NECw30owbCc1mSpjiahyNVwJd1jiGgzSwfTpzf2c5XJvG/g1n0fH88KHNnf+u7ZiRMlXueSIsloJBUtW9ezvsx9grfsX/FNxnbxU1Lvg0hLxixypHKGFAaPu0xCD8oDTeFSyfRT6s8109GMUZL8m2xXp8X2dpPCWWdX84iga4BrTlOfqox4shqEgh/Ht4qRst52cA1xOIUuOxgfUivp6v5f8IVyaryEdpVk72ERAwdT4aoY1usBgmP+0m06Q216H/nubtNYxHaOIYjcach3A8Ez/zc0KcShhel0HCYjFsA0FjYqyJ5ZUH1aZw3+zWC0hLpM6GDfcAdn9fq2orPmZbW6XXrf+Krc9RtvII5jeD3dFoT1KwZJwxfUMvc5KLfn8rROW23Jw89sJ2a5dpB3qWDUBWF2iX8OCuKprHosJ2mflBR+Wqs86VvgI/XMnsqb97+VlKdPVysczPj8Jhzf+WCvGBHijAqYlavbF60soMWlHbvKT+ScvhprgeTln51xX0sF+Eadc/l2s2a5BgkVbHYyz0E85p0LstqH+gEGiR84nBRRFIn8hLSZrGwqjZ3E29cuGi+5Z5bp7EM8MWFa9ssS/vy4VrDfECSv7DSU84DaP0sXI3Ap4lWznQ65nQoTKRWU30gd7Nn8ZowUvGIx4aqyXGwmA/PB4qN8msJUODezUHEl0VP9uo+cZ8vPFodSIB4C7lQYjEFj8yu49C2KIV3qxMFYTevG8KqAr0TPlkbzHHnTpDpvpzziAiNFh8xiT7C/TiyH0EguUw4vxAgpnE27WIypV+uFN2zW7xniF/n75trs9IJ5amB1zXXZ1LFkJ6GbS/dFokzl4cc2mamVwhL4XU0Av5gDWAl+aEWhAP7t2VIwU+EpvfOPDcLASX7H7lZpXA2XQfbSlD4qU18NffNPoAKMNSccBfO9YVVgmlW4RydBqfHAV7+hrZ84WJGho6bNT0YMhxxLdOx/dwGj0oyak9aAkNJ8lRJzUuA8sR+fPyiyTgUHio5+Pp+YaKlHrhR41jY5NESPS3x+zTMe0S2HnLOKCOQPpdxKyviBvdHrCDRqO+l96HhhNBLXWv4yEMuEUYo8kXnYJM8oIgVM4XJ+xXOev4YbWeqsvgq0lmw4/PiYr9sYLt+W5EAuYSFnJEan8CwJwbtASBfLBBpJZiRPor/aCJBZsM+MhvS7ZepyHvU8m5WSmaZnxuLts8ojl6KkS8oSAHkq5GWlCB/NgJ5W3rO2Cj1MK7ahxsCrbTT3a0V/QQH+sErxV4XUWDHx0kkFy25bPmBMBQ6BU3HoHhhYcJB9JhP6NXUWKxnE0raXHB6U9KHpWdQCQI72qevp5fMzcm+AvC85rsynVQhruDA9fp9COe7N56cg1UKGSas89vrN+WlGLYTwi5W+0xYdKEGtGCeNJwXKDU0XqU5uQYnWsMwTENLGtbQMvoGjIFIEMzCRal4rnBAg7D/CSn8MsCvS+FDJJAzoiioJEhZJgAp9n2+1Yznr7H+6eT4YkJ9Mpj60ImcW4i4iHDLn9RydB8dx3QYm3rsX6n4VRrZDsYK6DCGwkwd5n3/INFEpk16fYpP6JtMQpqEMzcOfQGAHXBTEGzuLJ03GYQL9bmV2/7ExDlRf+Uvf1sM2frRtCWmal12pMgtonvSCtR4n1CLUZRdTHDHP1Otwqd+rcdlavnKjUB/OYXQHUJzpNyFoKpQK+2OgrEKpGyIgIBgn2y9QHnTJihZOpEvOKIoHAMGAXHmj21Lym39Mbiow4IF+77xNuewziNVBxr6KD5e+9HzZSBIlUa/AmsDFJFXeyrQakR3FwowTGcADJHcEfhGkXYNGSYo4dh4bxwLM+28xjiqkdn0/3R4UEkvcBrBfn/SzBc1XhKM2VPlJgKSorjDac96V2UnQYXl1/yZPT4DVelgO+soMjexXwYO58VLl5xInQUZI8jc3H2CPnCNb9X05nOxIy4MlecasTqGK6s2az4RjpF2cQP2G28R+7wDPsZDZC/kWtjdoHC7SpdPmqQrUAhMwKVuxCmYTiD9q/O7GHtZvPSN0CAUQN/rymXZNniYLlJDE70bsk6Xxsh4kDOdxe7A2wo7P9F5YvqqRDI6brf79yPCSp4I0jVoO4YnLYtX5nzspR5WB4AKOYtR1ujXbOQpPyYDvfRE3FN5zw0i7reehdi7yV0YDRKRllGCGRk5Yz+Uv1fYl2ZwrnGsqsjgAVo0xEUba8ohjaNMJNwTwZA/wBDWFSCpg1eUH8MYL2zdioxRTqgGQrDZxQyNzyBJPXZF0+oxITJAbj7oNC5JwgDMUJaM5GqlGCWc//KCIrI+aclEe4IA0uzv7cuj6GCdaJONpi13O544vbtIHBF+A+JeDFUQNy61Gki3rtyQ4aUywn6ru314/dkGiP8Iwjo0J/2Txs49ZkwEl4mx+iYUUO55I6pJzU4P+7RRs+DXZkyKUYZqVWrPF4I94m4Wx1tXeE74o9GuX977yvJ/jkdak8+AmoHVjI15V+WwBdARFV2IPirJgVMdsg1Pez2VNHqa7EHWdTkl3XTcyjG9BiueWFvQfXI8aWSkuuRmqi/HUuzqyvLJfNfs0txMqldYYflWB1BS31WkuPJGGwXUCpjiQSktkuBMWwHjSkQxeehqw1Kgz0Trzm7QbtgxiEPDVmWCNCAeCfROTphd1ZNOhzLy6XfJyG6Xgd5MCAZw4xie0Sj5AnY1/akDgNS9YFl3Y06vd6FAsg2gVQJtzG7LVq1OH2frbXNHWH/NY89NNZ4QUSJqL2yEcGADbT38X0bGdukqYlSoliKOcsSTuqhcaemUeYLLoI8+MZor2RxXTRThF1LrHfqf/5LcLAjdl4EERgUysYS2geE+yFdasU91UgUDsc2cSQ1ZoT9+uLOwdgAmifwQqF028INc2IQEDfTmUw3eZxvz7Ud1z3xc1PQfeCvfKsB9jOhRj7rFyb9XcDWLcYj0bByosychMezMLVkFiYcdBBQtvI6K0KRuOZQH2kBsYHJaXTkup8F0eIhO1/GcIwWKpr2mouB7g5TUDJNvORXPXa/mU8bh27TAZYBe2sKx4NSv5OjnHIWD2RuysCzBlUfeNXhDd2jxnHoUlheJ3jBApzURy0fwm2FwwsSU0caQGl0Kv8hopRQE211NnvtLRsmCNrhhpEDoNiZEzD2QdJWKbRRWnaFedXHAELSN0t0bfsCsMf0ktfBoXBoNA+nZN9+pSlmuzspFevmsqqcMllzzvkyXrzoA+Ryo1ePXpdGOoJvhyru+EBRsmOp7MXZ0vNUMUqHLUoKglg1p73sWeZmPc+KAw0pE2zIsFFE5H4192KwDvDxdxEYoDBDNZjbg2bmADTeUKK57IPD4fTYF4c6EnXx/teYMORBDtIhPJneiZny7Nv/zG+YmekIKCoxr6kauE2bZtBLufetNG0BtBY7f+/ImUypMBvdWu/Q7vTMRzw5aQGZWuc1V0HEsItFYMIBnoKGZ0xcarba/TYZq50kCaflFysYjA4EDKHqGdpYWdKYmm+a7TADmW35yfnOYpZYrkpVEtiqF0EujI00aeplNs2k+qyFZNeE3CDPL9P6b4PQ/kataHkVpLSEVGK7EX6rAa7IVNrvZtFvOA6okKvBgMtFDAGZOx88MeBcJ8AR3AgUUeIznAN6tjCUipGDZONm1FjWJp4A3QIzSaIOmZ7DvF/ysYYbM/fFDOV0jntAjRdapxJxL0eThpEhKOjCDDq2ks+3GrwxqIFKLe1WdOzII8XIOPGnwy6LKXVfpSDOTEfaRsGujhpS4hBIsMOqHbl16PJxc4EkaVu9wpEYlF/84NSv5Zum4drMfp9yXbzzAOJqqS4YkI4cBrFrC7bMPiCfgI3nNZAqkk3QOZqR+yyqx+nDQKBBBZ7QKrfGMCL+XpqFaBJU0wpkBdAhbR4hJsmT5aynlvkouoxm/NjD5oe6BzVIO9uktM+/5dEC5P7vZvarmuO/lKXz4sBabVPIATuKTrwbJP8XUkdM6uEctHKXICUJGjaZIWRbZp8czquQYfY6ynBUCfIU+gG6wqSIBmYIm9pZpXdaL121V7q0VjDjmQnXvMe7ysoEZnZL15B0SpxS1jjd83uNIOKZwu5MPzg2NhOx3xMOPYwEn2CUzbSrwAs5OAtrz3GAaUkJOU74XwjaYUmGJdZBS1NJVkGYrToINLKDjxcuIlyfVsKQSG/G4DyiO2SlQvJ0d0Ot1uOG5IFSAkq+PRVMgVMDvOIJMdqjeCFKUGRWBW9wigYvcbU7CQL/7meF2KZAaWl+4y9uhowAX7elogAvItAAxo2+SFxGRsHGEW9BnhlTuWigYxRcnVUBRQHV41LV+Fr5CJYV7sHfeywswx4XMtUx6EkBhR+q8AXXUA8uPJ73Pb49i9KG9fOljvXeyFj9ixgbo6CcbAJ7WHWqKHy/h+YjBwp6VcN7M89FGzQ04qbrQtgrOFybg3gQRTYG5xn73ArkfQWjCJROwy3J38Dx/D7jOa6BBNsitEw1wGq780EEioOeD+ZGp2J66ADiVGMayiHYucMk8nTK2zzT9CnEraAk95kQjy4k0GRElLL5YAKLQErJ5rp1eay9O4Fb6yJGm9U4FaMwPGxtKD6odIIHKoWnhKo1U8KIpFC+MVn59ZXmc7ZTBZfsg6FQ8W10YfTr4u0nYrpHZbZ1jXiLmooF0cOm0+mPnJBXQtepc7n0BqOipNCqI6yyloTeRShNKH04FIo0gcMk0H/xThyN4pPAWjDDkEp3lNNPRNVfpMI44CWRlRgViP64eK0JSRp0WUvCWYumlW/c58Vcz/yMwVcW5oYb9+26TEhwvbxiNg48hl1VI1UXTU//Eta+BMKnGUivctfL5wINDD0giQL1ipt6U7C9cd4+lgqY2lMUZ02Uv6Prs+ZEZer7ZfWBXVghlfOOrClwsoOFKzWEfz6RZu1eCs+K8fLvkts5+BX0gyrFYve0C3qHrn5U/Oh6D/CihmWIrY7HUZRhJaxde+tldu6adYJ+LeXupQw0XExC36RETdNFxcq9glMu4cNQSX9cqR/GQYp+IxUkIcNGWVU7ZtGa6P3XAyodRt0XeS3Tp01AnCh0ZbUh4VrSZeV9RWfSoWyxnY3hzcZ30G/InDq4wxRrEejreBxnhIQbkxenxkaxl+k7eLUQkUR6vKJ2iDFNGX3WmVA1yaOH+mvhBd+sE6vacQzFobwY5BqEAFmejwW5ne7HtVNolOUgJc8CsUxmc/LBi8N5mu9VsIA5HyErnS6zeCz7VLI9+n/hbT6hTokMXTVyXJRKSG2hd2labXTbtmK4fNH3IZBPreSA4FMeVouVN3zG5x9CiGpLw/3pceo4qGqp+rVp+z+7yQ98oEf+nyH4F3+J9IheDBa94Wi63zJbLBCIZm7P0asHGpIJt3PzE3m0S4YIWyXBCVXGikj8MudDPB/6Nm2v4IxJ5gU0ii0guy5SUHqGUYzTP0jIJU5E82RHUXtX4lDdrihBLdP1YaG1AGUC12rQKuIaGvCpMjZC9bWSCYnjDlvpWbkdXMTNeBHLKiuoozMGIvkczmP0aRJSJ8PYnLCVNhKHXBNckH79e8Z8Kc2wUej4sQZoH8qDRGkg86maW/ZQWGNnLcXmq3FlXM6ssR/3P6E/bHMvm6HLrv1yRixit25JsH3/IOr2UV4BWJhxXW5BJ6Xdr07n9kF3ZNAk6/Xpc5MSFmYJ2R7bdL8Kk7q1OU9Elg/tCxJ8giT27wSTySF0GOxg4PbYJdi/Nyia9Nn89CGDulfJemm1aiEr/eleGSN+5MRrVJ4K6lgyTTIW3i9cQ0dAi6FHt0YMbH3wDSAtGLSAccezzxHitt1QdhW36CQgPcA8vIIBh3/JNjf/Obmc2yzpk8edSlS4lVdwgW5vzbYEyFoF4GCBBby1keVNueHAH+evi+H7oOVfS3XuPQSNTXOONAbzJeSb5stwdQHl1ZjrGoE49I8+A9j3t+ahhQj74FCSWpZrj7wRSFJJnnwi1T9HL5qrCFW/JZq6P62XkMWTb+u4lGpKfmmwiJWx178GOG7KbrZGqyWwmuyKWPkNswkZ1q8uptUlviIi+AXh2bOOTOLsrtNkfqbQJeh24reebkINLkjut5r4d9GR/r8CBa9SU0UQhsnZp5cP+RqWCixRm7i4YRFbtZ4EAkhtNa6jHb6gPYQv7MKqkPLRmX3dFsK8XsRLVZ6IEVrCbmNDc8o5mqsogjAQfoC9Bc7R6gfw03m+lQpv6kTfhxscDIX6s0w+fBxtkhjXAXr10UouWCx3C/p/FYwJRS/AXRKkjOb5CLmK4XRe0+xeDDwVkJPZau52bzLEDHCqV0f44pPgKOkYKgTZJ33fmk3Tu8SdxJ02SHM8Fem5SMsWqRyi2F1ynfRJszcFKykdWlNqgDA/L9lKYBmc7Zu/q9ii1FPF47VJkqhirUob53zoiJtVVRVwMR34gV9iqcBaHbRu9kkvqk3yMpfRFG49pKKjIiq7h/VpRwPGTHoY4cg05X5028iHsLvUW/uz+kjPyIEhhcKUwCkJAwbR9pIEGOn8z6svAO8i89sJ3dL5qDWFYbS+HGPRMxYwJItFQN86YESeJQhn2urGiLRffQeLptDl8dAgb+Tp47UQPxWOw17OeChLN1WnzlkPL1T5O+O3Menpn4C3IY5LEepHpnPeZHbvuWfeVtPlkH4LZjPbBrkJT3NoRJzBt86CO0Xq59oQ+8dsm0ymRcmQyn8w71mhmcuEI5byuF+C88VPYly2sEzjlzAQ3vdn/1+Hzguw6qFNNbqenhZGbdiG6RwZaTG7jTA2X9RdXjDN9yj1uQpyO4Lx8KRAcZcbZMafp4wPOd5MdXoFY52V1A8M9hi3sso93+uprE0qYNMjkE22CvK4HuUxqN7oIz5pWuETq1lQAjqlSlqdD2Rnr/ggp/TVkQYjn9lMfYelk2sH5HPdopYo7MHwlV1or9Bxf+QCyLzm92vzG2wjiIjC/ZHEJzeroJl6bdFPTpZho5MV2U86fLQqxNlGIMqCGy+9WYhJ8ob1r0+Whxde9L2PdysETv97O+xVw+VNN1TZSQN5I6l9m5Ip6pLIqLm4a1B1ffH6gHyqT9p82NOjntRWGIofO3bJz5GhkvSWbsXueTAMaJDou99kGLqDlhwBZNEQ4mKPuDvVwSK4WmLluHyhA97pZiVe8g+JxmnJF8IkV/tCs4Jq/HgOoAEGR9tCDsDbDmi3OviUQpG5D8XmKcSAUaFLRXb2lmJTNYdhtYyfjBYZQmN5qT5CNuaD3BVnlkCk7bsMW3AtXkNMMTuW4HjUERSJnVQ0vsBGa1wo3Qh7115XGeTF3NTz8w0440AgU7c3bSXO/KMINaIWXd0oLpoq/0/QJxCQSJ9XnYy1W7TYLBJpHsVWD1ahsA7FjNvRd6mxCiHsm8g6Z0pnzqIpF1dHUtP2ITU5Z1hZHbu+L3BEEStBbL9XYvGfEakv1bmf+bOZGnoiuHEdlBnaChxYKNzB23b8sw8YyT7Ajxfk49eJIAvdbVkdFCe2J0gMefhQ0bIZxhx3fzMIysQNiN8PgOUKxOMur10LduigREDRMZyP4oGWrP1GFY4t6groASsZ421os48wAdnrbovNhLt7ScNULkwZ5AIZJTrbaKYTLjA1oJ3sIuN/aYocm/9uoQHEIlacF1s/TM1fLcPTL38O9fOsjMEIwoPKfvt7opuI9G2Hf/PR4aCLDQ7wNmIdEuXJ/QNL72k5q4NejAldPfe3UVVqzkys8YZ/jYOGOp6c+YzRCrCuq0M11y7TiN6qk7YXRMn/gukxrEimbMQjr3jwRM6dKVZ4RUfWQr8noPXLJq6yh5R3EH1IVOHESst/LItbG2D2vRsZRkAObzvQAAD3mb3/G4NzopI0FAiHfbpq0X72adg6SRj+8OHMShtFxxLZlf/nLgRLbClwl5WmaYSs+yEjkq48tY7Z2bE0N91mJwt+ua0NlRJIDh0HikF4UvSVorFj2YVu9YeS5tfvlVjPSoNu/Zu6dEUfBOT555hahBdN3Sa5Xuj2Rvau1lQNIaC944y0RWj9UiNDskAK1WoL+EfXcC6IbBXFRyVfX/WKXxPAwUyIAGW8ggZ08hcijKTt1YKnUO6QPvcrmDVAb0FCLIXn5id4fD/Jx4tw/gbXs7WF9b2RgXtPhLBG9vF5FEkdHAKrQHZAJC/HWvk7nvzzDzIXZlfFTJoC3JpGgLPBY7SQTjGlUvG577yNutZ1hTfs9/1nkSXK9zzKLRZ3VODeKUovJe0WCq1zVMYxCJMenmNzPIU2S8TA4E7wWmbNkxq9rI2dd6v0VpcAPVMxnDsvWTWFayyqvKZO7Z08a62i/oH2/jxf8rpmfO64in3FLiL1GX8IGtVE9M23yGsIqJbxDTy+LtaMWDaPqkymb5VrQdzOvqldeU0SUi6IirG8UZ3jcpRbwHa1C0Dww9G/SFX3gPvTJQE+kyz+g1BeMILKKO+olcHzctOWgzxYHnOD7dpCRtuZEXACjgqesZMasoPgnuDC4nUviAAxDc5pngjoAITIkvhKwg5d608pdrZcA+qn5TMT6Uo/QzBaOxBCLTJX3Mgk85rMfsnWx86oLxf7p2PX5ONqieTa/qM3tPw4ZXvlAp83NSD8F7+ZgctK1TpoYwtiU2h02HCGioH5tkVCqNVTMH5p00sRy2JU1qyDBP2CII/Dg4WDsIl+zgeX7589srx6YORRQMBfKbodbB743Tl4WLKOEnwWUVBsm94SOlCracU72MSyj068wdpYjyz1FwC2bjQnxnB6Mp/pZ+yyZXtguEaYB+kqhjQ6UUmwSFazOb+rhYjLaoiM+aN9/8KKn0zaCTFpN9eKwWy7/u4EHzO46TdFSNjMfn2iPSJwDPCFHc0I1+vjdAZw5ZjqR/uzi9Zn20oAa5JnLEk/EA3VRWE7J/XrupfFJPtCUuqHPpnlL7ISJtRpSVcB8qsZCm2QEkWoROtCKKxUh3yEcMbWYJwk6DlEBG0bZP6eg06FL3v6RPb7odGuwm7FN8fG4woqtB8e7M5klPpo97GoObNwt+ludTAmxyC5hmcFx+dIvEZKI6igFKHqLH01iY1o7903VzG9QGetyVx5RNmBYUU+zIuSva/yIcECUi4pRmE3VkF2avqulQEUY4yZ/wmNboBzPmAPey3+dSYtBZUjeWWT0pPwCz4Vozxp9xeClIU60qvEFMQCaPvPaA70WlOP9f/ey39macvpGCVa+zfa8gO44wbxpJUlC8GN/pRMTQtzY8Z8/hiNrU+Zq64ZfFGIkdj7m7abcK1EBtws1X4J/hnqvasPvvDSDYWN+QcQVGMqXalkDtTad5rYY0TIR1Eqox3czwPMjKPvF5sFv17Thujr1IZ1Ytl4VX1J0vjXKmLY4lmXipRAro0qVGEcXxEVMMEl54jQMd4J7RjgomU0j1ptjyxY+cLiSyXPfiEcIS2lWDK3ISAy6UZ3Hb5vnPncA94411jcy75ay6B6DSTzK6UTCZR9uDANtPBrvIDgjsfarMiwoax2OlLxaSoYn4iRgkpEGqEkwox5tyI8aKkLlfZ12lO11TxsqRMY89j5JaO55XfPJPDL1LGSnC88Re9Ai+Nu5bZjtwRrvFITUFHPR4ZmxGslQMecgbZO7nHk32qHxYkdvWpup07ojcMCaVrpFAyFZJJbNvBpZfdf39Hdo2kPtT7v0/f8R/B5Nz4f1t9/3zNM/7n6SUHfcWk5dfQFJvcJMgPolGCpOFb/WC0FGWU2asuQyT+rm88ZKZ78Cei/CAh939CH0JYbpZIPtxc2ufXqjS3pHH9lnWK4iJ7OjR/EESpCo2R3MYKyE7rHfhTvWho4cL1QdN4jFTyR6syMwFm124TVDDRXMNveI1Dp/ntwdz8k8kxw7iFSx6+Yx6O+1LzMVrN0BBzziZi9kneZSzgollBnVwBh6oSOPHXrglrOj+QmR/AESrhDpKrWT+8/AiMDxS/5wwRNuGQPLlJ9ovomhJWn8sMLVItQ8N/7IXvtD8kdOoHaw+vBSbFImQsv/OCAIui99E+YSIOMlMvBXkAt+NAZK8wB9Jf8CPtB+TOUOR+z71d/AFXpPBT6+A5FLjxMjLIEoJzrQfquvxEIi+WoUzGR1IzQFNvbYOnxb2PyQ0kGdyXKzW2axQL8lNAXPk6NEjqrRD1oZtKLlFoofrXw0dCNWASHzy+7PSzOUJ3XtaPZsxLDjr+o41fKuKWNmjiZtfkOzItvlV2MDGSheGF0ma04qE3TUEfqJMrXFm7DpK+27DSvCUVf7rbNoljPhha5W7KBqVq0ShUSTbRmuqPtQreVWH4JET5yMhuqMoSd4r/N8sDmeQiQQvi1tcZv7Moc7dT5X5AtCD6kNEGZOzVcNYlpX4AbTsLgSYYliiPyVoniuYYySxsBy5cgb3pD+EK0Gpb0wJg031dPgaL8JZt6sIvzNPEHfVPOjXmaXj4bd4voXzpZ5GApMhILgMbCEWZ2zwgdeQgjNHLbPIt+KqxRwWPLTN6HwZ0Ouijj4UF+Sg0Au8XuIKW0WxlexdrFrDcZJ8Shauat3X0XmHygqgL1nAu2hrJFb4wZXkcS+i36KMyU1yFvYv23bQUJi/3yQpqr/naUOoiEWOxckyq/gq43dFou1DVDaYMZK9tho7+IXXokBCs5GRfOcBK7g3A+jXQ39K4YA8PBRW4m5+yR0ZAxWJncjRVbITvIAPHYRt1EJ3YLiUbqIvoKHtzHKtUy1ddRUQ0AUO41vonZDUOW+mrszw+SW/6Q/IUgNpcXFjkM7F4CSSQ2ExZg85otsMs7kqsQD4OxYeBNDcSpifjMoLb7GEbGWTwasVObmB/bfPcUlq0wYhXCYEDWRW02TP5bBrYsKTGWjnWDDJ1F7zWai0zW/2XsCuvBQjPFcTYaQX3tSXRSm8hsAoDdjArK/OFp6vcWYOE7lizP0Yc+8p16i7/NiXIiiQTp7c7Xus925VEtlKAjUdFhyaiLT7VxDagprMFwix4wZ05u0qj7cDWFd0W9OYHIu3JbJKMXRJ1aYNovugg+QqRN7fNHSi26VSgBpn+JfMuPo3aeqPWik/wI5Rz3BWarPQX4i5+dM0npwVOsX+KsOhC7vDg+OJsz4Q5zlnIeflUWL6QYMbf9WDfLmosLF4Qev3mJiOuHjoor/dMeBpA9iKDkMjYBNbRo414HCxjsHrB4EXNbHzNMDHCLuNBG6Sf+J4MZ/ElVsDSLxjIiGsTPhw8BPjxbfQtskj+dyNMKOOcUYIRBEIqbazz3lmjlRQhplxq673VklMMY6597vu+d89ec/zq7Mi4gQvh87ehYbpOuZEXj5g/Q7S7BFDAAB9DzG35SC853xtWVcnZQoH54jeOqYLR9NDuwxsVthTV7V99n/B7HSbAytbEyVTz/5NhJ8gGIjG0E5j3griULUd5Rg7tQR+90hJgNQKQH2btbSfPcaTOfIexc1db1BxUOhM1vWCpLaYuKr3FdNTt/T3PWCpEUWDKEtzYrjpzlL/wri3MITKsFvtF8QVV/NhVo97aKIBgdliNc10dWdXVDpVtsNn+2UIolrgqdWA4EY8so0YvB4a+aLzMXiMAuOHQrXY0tr+CL10JbvZzgjJJuB1cRkdT7DUqTvnswVUp5kkUSFVtIIFYK05+tQxT6992HHNWVhWxUsD1PkceIrlXuUVRogwmfdhyrf6zzaL8+c0L7GXMZOteAhAVQVwdJh+7nrX7x4LaIIfz2F2v7Dg/uDfz2Fa+4gFm2zHAor8UqimJG3VTJtZEoFXhnDYXvxMJFc6ku2bhbCxzij2z5UNuK0jmp1mnvkVNUfR+SEmj1Lr94Lym75PO7Fs0MIr3GdsWXRXSfgLTVY0FLqba97u1In8NAcY7IC6TjWLigwKEIm43NxTdaVTv9mcKkzuzBkKd8x/xt1p/9BbP7Wyb4bpo1K1gnOpbLvKz58pWl3B55RJ/Z5mRDLPtNQg14jdOEs9+h/V5UVpwrAI8kGbX8KPVPDIMfIqKDjJD9UyDOPhjZ3vFAyecwyq4akUE9mDOtJEK1hpDyi6Ae87sWAClXGTiwPwN7PXWwjxaR79ArHRIPeYKTunVW24sPr/3HPz2IwH8oKH4OlWEmt4BLM6W5g4kMcYbLwj2usodD1088stZA7VOsUSpEVl4w7NMb1EUHMRxAxLF0CIV+0L3iZb+ekB1vSDSFjAZ3hfLJf7gFaXrOKn+mhR+rWw/eTXIcAgl4HvFuBg1LOmOAwJH3eoVEjjwheKA4icbrQCmvAtpQ0mXG0agYp5mj4Rb6mdQ+RV4QBPbxMqh9C7o8nP0Wko2ocnCHeRGhN1XVyT2b9ACsL+6ylUy+yC3QEnaKRIJK91YtaoSrcWZMMwxuM0E9J68Z+YyjA0g8p1PfHAAIROy6Sa04VXOuT6A351FOWhKfTGsFJ3RTJGWYPoLk5FVK4OaYR9hkJvezwF9vQN1126r6isMGXWTqFW+3HL3I/jurlIdDWIVvYY+s6yq7lrFSPAGRdnU7PVwY/SvWbZGpXzy3BQ2LmAJlrONUsZs4oGkly0V267xbD5KMY8woNNsmWG1VVgLCra8aQBBcI4DP2BlNwxhiCtHlaz6OWFoCW0vMR3ErrG7JyMjTSCnvRcsEHgmPnwA6iNpJ2DrFb4gLlhKJyZGaWkA97H6FFdwEcLT6DRQQL++fOkVC4cYGW1TG/3iK5dShRSuiBulmihqgjR45Vi03o2RbQbP3sxt90VxQ6vzdlGfkXmmKmjOi080JSHkLntjvsBJnv7gKscOaTOkEaRQqAnCA4HWtB4XnMtOhpRmH2FH8tTXrIjAGNWEmudQLCkcVlGTQ965Kh0H6ixXbgImQP6b42B49sO5C8pc7iRlgyvSYvcnH9FgQ3azLbQG2cUW96SDojTQStxkOJyOuDGTHAnnWkz29aEwN9FT8EJ4yhXOg+jLTrCPKeEoJ9a7lDXOjEr8AgX4BmnMQ668oW0zYPyQiVMPxKRHtpfnEEyaKhdzNVThlxxDQNdrHeZiUFb6NoY2KwvSb7BnRcpJy+/g/zAYx3fYSN5QEaVD2Y1VsNWxB0BSO12MRsRY8JLfAezRMz5lURuLUnG1ToKk6Q30FughqWN6gBNcFxP/nY/iv+iaUQOa+2Nuym46wtI/DvSfzSp1jEi4SdYBE7YhTiVV5cX9gwboVDMVgZp5YBQlHOQvaDNfcCoCJuYhf5kz5kwiIKPjzgpcRJHPbOhJajeoeRL53cuMahhV8Z7IRr6M4hW0JzT7mzaMUzQpm866zwM7Cs07fJYXuWvjAMkbe5O6V4bu71sOG6JQ4oL8zIeXHheFVavzxmlIyBkgc9IZlEDplMPr8xlcyss4pVUdwK1e7CK2kTsSdq7g5SHRAl3pYUB9Ko4fsh4qleOyJv1z3KFSTSvwEcRO/Ew8ozEDYZSqpfoVW9uhJfYrNAXR0Z3VmeoAD+rVWtwP/13sE/3ICX3HhDG3CMc476dEEC0K3umSAD4j+ZQLVdFOsWL2C1TH5+4KiSWH+lMibo+B55hR3Gq40G1n25sGcN0mEcoU2wN9FCVyQLBhYOu9aHVLWjEKx2JIUZi5ySoHUAI9b8hGzaLMxCZDMLhv8MkcpTqEwz9KFDpCpqQhVmsGQN8m24wyB82FAKNmjgfKRsXRmsSESovAwXjBIoMKSG51p6Um8b3i7GISs7kjTq/PZoioCfJzfKdJTN0Q45kQEQuh9H88M3yEs3DbtRTKALraM0YC8laiMiOOe6ADmTcCiREeAWZelBaEXRaSuj2lx0xHaRYqF65O0Lo5OCFU18A8cMDE4MLYm9w2QSr9NgQAIcRxZsNpA7UJR0e71JL+VU+ISWFk5I97lra8uGg7GlQYhGd4Gc6rxsLFRiIeGO4abP4S4ekQ1fiqDCy87GZHd52fn5aaDGuvOmIofrzpVwMvtbreZ/855OaXTRcNiNE0wzGZSxbjg26v8ko8L537v/XCCWP2MFaArJpvnkep0pA+O86MWjRAZPQRfznZiSIaTppy6m3p6HrNSsY7fDtz7Cl4V/DJAjQDoyiL2uwf1UHVd2AIrzBUSlJaTj4k6NL97a/GqhWKU9RUmjnYKpm2r+JYUcrkCuZKvcYvrg8pDoUKQywY9GDWg03DUFSirlUXBS5SWn/KAntnf0IdHGL/7mwXqDG+LZYjbEdQmqUqq4y54TNmWUP7IgcAw5816YBzwiNIJiE9M4lPCzeI/FGBeYy3p6IAmH4AjXXmvQ4Iy0Y82NTobcAggT2Cdqz6Mx4TdGoq9fn2etrWKUNFyatAHydQTVUQ2S5OWVUlugcNvoUrlA8cJJz9MqOa/W3iVno4zDHfE7zhoY5f5lRTVZDhrQbR8LS4eRLz8iPMyBL6o4PiLlp89FjdokQLaSBmKHUwWp0na5fE3v9zny2YcDXG/jfI9sctulHRbdkI5a4GOPJx4oAJQzVZ/yYAado8KNZUdEFs9ZPiBsausotXMNebEgr0dyopuqfScFJ3ODNPHgclACPdccwv0YJGQdsN2lhoV4HVGBxcEUeUX/alr4nqpcc1CCR3vR7g40zteQg/JvWmFlUE4mAiTpHlYGrB7w+U2KdSwQz2QJKBe/5eiixWipmfP15AFWrK8Sh1GBBYLgzki1wTMhGQmagXqJ2+FuqJ8f0XzXCVJFHQdMAw8xco11HhM347alrAu+wmX3pDFABOvkC+WPX0Uhg1Z5MVHKNROxaR84YV3s12UcM+70cJ460SzEaKLyh472vOMD3XnaK7zxZcXlWqenEvcjmgGNR2OKbI1s8U+iwiW+HotHalp3e1MGDy6BMVIvajnAzkFHbeVsgjmJUkrP9OAwnEHYXVBqYx3q7LvXjoVR0mY8h+ZaOnh053pdsGkmbqhyryN01eVHySr+CkDYkSMeZ1xjPNVM+gVLTDKu2VGsMUJqWO4TwPDP0VOg2/8ITbAUaMGb4LjL7L+Pi11lEVMXTYIlAZ/QHmTENjyx3kDkBdfcvvQt6tKk6jYFM4EG5UXDTaF5+1ZjRz6W7MdJPC+wTkbDUim4p5QQH3b9kGk2Bkilyeur8Bc20wm5uJSBO95GfYDI1EZipoRaH7uVveneqz43tlTZGRQ4a7CNmMHgXyOQQOL6WQkgMUTQDT8vh21aSdz7ERiZT1jK9F+v6wgFvuEmGngSvIUR2CJkc5tx1QygfZnAruONobB1idCLB1FCfO7N1ZdRocT8/Wye+EnDiO9pzqIpnLDl4bkaRKW+ekBVwHn46Shw1X0tclt/0ROijuUB4kIInrVJU4buWf4YITJtjOJ6iKdr1u+flgQeFH70GxKjhdgt/MrwfB4K/sXczQ+9zYcrD4dhY6qZhZ010rrxggWA8JaZyg2pYij8ieYEg1aZJkZK9O1Re7sB0iouf60rK0Gd+AYlp7soqCBCDGwfKeUQhCBn0E0o0GS6PdmjLi0TtCYZeqazqwN+yNINIA8Lk3iPDnWUiIPLGNcHmZDxfeK0iAdxm/T7LnN+gemRL61hHIc0NCAZaiYJR+OHnLWSe8sLrK905B5eEJHNlWq4RmEXIaFTmo49f8w61+NwfEUyuJAwVqZCLFcyHBKAcIVj3sNzfEOXzVKIndxHw+AR93owhbCxUZf6Gs8cz6/1VdrFEPrv330+9s6BtMVPJ3zl/Uf9rUi0Z/opexfdL3ykF76e999GPfVv8fJv/Y/+/5hEMon1tqNFyVRevV9y9/uIvsG3dbB8GRRrgaEXfhx+2xeOFt+cEn3RZanNxdEe2+B6MHpNbrRE53PlDifPvFcp4kO78ILR0T4xyW/WGPyBsqGdoA7zJJCu1TKbGfhnqgnRbxbB2B3UZoeQ2bz2sTVnUwokTcTU21RxN1PYPS3Sar7T0eRIsyCNowr9amwoMU/od9s2APtiKNL6ENOlyKADstAEWKA+sdKDhrJ6BOhRJmZ+QJbAaZ3/5Fq0/lumCgEzGEbu3yi0Y4I4EgVAjqxh4HbuQn0GrRhOWyAfsglQJAVL1y/6yezS2k8RE2MstJLh92NOB3GCYgFXznF4d25qiP4ZCyI4RYGesut6FXK6GwPpKK8WHEkhYui0AyEmr5Ml3uBFtPFdnioI8RiCooa7Z1G1WuyIi3nSNglutc+xY8BkeW3JJXPK6jd2VIMpaSxpVtFq+R+ySK9J6WG5Qvt+C+QH1hyYUOVK7857nFmyDBYgZ/o+AnibzNVqyYCJQvyDXDTK+iXdkA71bY7TL3bvuLxLBQ8kbTvTEY9aqkQ3+MiLWbEgjLzOH+lXgco1ERgzd80rDCymlpaRQbOYnKG/ODoFl46lzT0cjM5FYVvv0qLUbD5lyJtMUaC1pFlTkNONx6lliaX9o0i/1vws5bNKn5OuENQEKmLlcP4o2ZmJjD4zzd3Fk32uQ4uRWkPSUqb4LBe3EXHdORNB2BWsws5daRnMfNVX7isPSb1hMQdAJi1/qmDMfRUlCU74pmnzjbXfL8PVG8NsW6IQM2Ne23iCPIpryJjYbVnm5hCvKpMa7HLViNiNc+xTfDIaKm3jctViD8A1M9YPJNk003VVr4Zo2MuGW8vil8SLaGpPXqG7I4DLdtl8a4Rbx1Lt4w5Huqaa1XzZBtj208EJVGcmKYEuaeN27zT9EE6a09JerXdEbpaNgNqYJdhP1NdqiPKsbDRUi86XvvNC7rME5mrSQtrzAZVndtSjCMqd8BmaeGR4l4YFULGRBeXIV9Y4yxLFdyoUNpiy2IhePSWzBofYPP0eIa2q5JP4j9G8at/AqoSsLAUuRXtvgsqX/zYwsE+of6oSDbUOo4RMJw+DOUTJq+hnqwKim9Yy/napyZNTc2rCq6V9jHtJbxGPDwlzWj/Sk3zF/BHOlT/fSjSq7FqlPI1q6J+ru8Aku008SFINXZfOfnZNOvGPMtEmn2gLPt+H4QLA+/SYe4j398auzhKIp2Pok3mPC5q1IN1HgR+mnEfc4NeeHYwd2/kpszR3cBn7ni9NbIqhtSWFW8xbUJuUPVOeeXu3j0IGZmFNiwaNZ6rH4/zQ2ODz6tFxRLsUYZu1bfd1uIvfQDt4YD/efKYv8VF8bHGDgK22w2Wqwpi43vNCOXFJZCGMqWiPbL8mil6tsmOTXAWCyMCw73e2rADZj2IK6rqksM3EXF2cbLb4vjB14wa/yXK5vwU+05MzERJ5nXsXsW21o7M+gO0js2OyKciP5uF2iXyb2DiptwQeHeqygkrNsqVCSlldxBMpwHi1vfc8RKpP/4L3Lmpq6DZcvhDDfxTCE3splacTcOtXdK2g303dIWBVe2wD/Gvja1cClFQ67gw0t1ZUttsUgQ1Veky8oOpS6ksYEc4bqseCbZy766SvL3FodmnahlWJRgVCNjPxhL/fk2wyvlKhITH/VQCipOI0dNcRa5B1M5HmOBjTLeZQJy237e2mobwmDyJNHePhdDmiknvLKaDbShL+Is1XTCJuLQd2wmdJL7+mKvs294whXQD+vtd88KKk0DXP8B1Xu9J+xo69VOuFgexgTrcvI6SyltuLix9OPuE6/iRJYoBMEXxU4shQMf4Fjqwf1PtnJ/wWSZd29rhZjRmTGgiGTAUQqRz+nCdjeMfYhsBD5Lv60KILWEvNEHfmsDs2L0A252351eUoYxAysVaCJVLdH9QFWAmqJDCODUcdoo12+gd6bW2boY0pBVHWL6LQDK5bYWh1V8vFvi0cRpfwv7cJiMX3AZNJuTddHehTIdU0YQ/sQ1dLoF2xQPcCuHKiuCWOY30DHe1OwcClLAhqAKyqlnIbH/8u9ScJpcS4kgp6HKDUdiOgRaRGSiUCRBjzI5gSksMZKqy7Sd51aeg0tgJ+x0TH9YH2Mgsap9N7ENZdEB0bey2DMTrBA1hn56SErNHf3tKtqyL9b6yXEP97/rc+jgD2N1LNUH6RM9AzP3kSipr06RkKOolR7HO768jjWiH1X92jA7dkg7gcNcjqsZCgfqWw0tPXdLg20cF6vnQypg7gLtkazrHAodyYfENPQZsdfnjMZiNu4nJO97D1/sQE+3vNFzrSDOKw+keLECYf7RJwVHeP/j79833oZ0egonYB2FlFE5qj02B/LVOMJQlsB8uNg3Leg4qtZwntsOSNidR0abbZmAK4sCzvt8Yiuz2yrNCJoH5O8XvX/vLeR/BBYTWj0sOPYM/jyxRd5+/JziKAABaPcw/34UA3aj/gLZxZgRCWN6m4m3demanNgsx0P237/Q+Ew5VYnJPkyCY0cIVHoFn2Ay/e7U4P19APbPFXEHX94N6KhEMPG7iwB3+I+O1jd5n6VSgHegxgaSawO6iQCYFgDsPSMsNOcUj4q3sF6KzGaH/0u5PQoAj/8zq6Uc9MoNrGqhYeb2jQo0WlGlXjxtanZLS24/OIN5Gx/2g684BPDQpwlqnkFcxpmP/osnOXrFuu4PqifouQH0eF5qCkvITQbJw/Zvy5mAHWC9oU+cTiYhJmSfKsCyt1cGVxisKu+NymEQIAyaCgud/V09qT3nk/9s/SWsYtha7yNpzBIMM40rCSGaJ9u6lEkl00vXBiEt7p9P5IBCiavynEOv7FgLqPdeqxRiCwuFVMolSIUBcoyfUC2e2FJSAUgYdVGFf0b0Kn2EZlK97yyxrT2MVgvtRikfdaAW8RwEEfN+B7/eK8bBdp7URpbqn1xcrC6d2UjdsKbzCjBFqkKkoZt7Mrhg6YagE7spkqj0jOrWM+UGQ0MUlG2evP1uE1p2xSv4dMK0dna6ENcNUF+xkaJ7B764NdxLCpuvhblltVRAf7vK5qPttJ/9RYFUUSGcLdibnz6mf7WkPO3MkUUhR2mAOuGv8IWw5XG1ZvoVMnjSAZe6T7WYA99GENxoHkMiKxHlCuK5Gd0INrISImHQrQmv6F4mqU/TTQ8nHMDzCRivKySQ8dqkpQgnUMnwIkaAuc6/FGq1hw3b2Sba398BhUwUZSAIO8XZvnuLdY2n6hOXws+gq9BHUKcKFA6kz6FDnpxLPICa3qGhnc97bo1FT/XJk48LrkHJ2CAtBv0RtN97N21plfpXHvZ8gMJb7Zc4cfI6MbPwsW7AilCSXMFIEUEmir8XLEklA0ztYbGpTTGqttp5hpFTTIqUyaAIqvMT9A/x+Ji5ejA4Bhxb/cl1pUdOD6epd3yilIdO6j297xInoiBPuEDW2/UfslDyhGkQs7Wy253bVnlT+SWg89zYIK/9KXFl5fe+jow2rd5FXv8zDPrmfMXiUPt9QBO/iK4QGbX5j/7Rx1c1vzsY8ONbP3lVIaPrhL4+1QrECTN3nyKavGG0gBBtHvTKhGoBHgMXHStFowN+HKrPriYu+OZ05Frn8okQrPaaxoKP1ULCS/cmKFN3gcH7HQlVjraCeQmtjg1pSQxeuqXiSKgLpxc/1OiZsU4+n4lz4hpahGyWBURLi4642n1gn9qz9bIsaCeEPJ0uJmenMWp2tJmIwLQ6VSgDYErOeBCfSj9P4G/vI7oIF+l/n5fp956QgxGvur77ynawAu3G9MdFbJbu49NZnWnnFcQHjxRuhUYvg1U/e84N4JTecciDAKb/KYIFXzloyuE1eYXf54MmhjTq7B/yBToDzzpx3tJCTo3HCmVPYfmtBRe3mPYEE/6RlTIxbf4fSOcaKFGk4gbaUWe44hVk9SZzhW80yfW5QWBHxmtUzvMhfVQli4gZTktIOZd9mjJ5hsbmzttaHQB29Am3dZkmx3g/qvYocyhZ2PXAWsNQiIaf+Q8W/MWPIK7/TjvCx5q2XRp4lVWydMc2wIQkhadDB0xsnw/kSEyGjLKjI4coVIwtubTF3E7MJ6LS6UOsJKj82XVAVPJJcepfewbzE91ivXZvOvYfsmMevwtPpfMzGmC7WJlyW2j0jh7AF1JLmwEJSKYwIvu6DHc3YnyLH9ZdIBnQ+nOVDRiP+REpqv++typYHIvoJyICGA40d8bR7HR2k7do6UQTHF4oriYeIQbxKe4Th6+/l1BjUtS9hqORh3MbgvYrStXTfSwaBOmAVQZzpYNqsAmQyjY56MUqty3c/xH6GuhNvNaG9vGbG6cPtBM8UA3e8r51D0AR9kozKuGGSMgLz3nAHxDNnc7GTwpLj7/6HeWp1iksDeTjwCLpxejuMtpMnGJgsiku1sOACwQ9ukzESiDRN77YNESxR5LphOlcASXA5uIts1LnBIcn1J7BLWs49DMALSnuz95gdOrTZr0u1SeYHinno/pE58xYoXbVO/S+FEMMs5qyWkMnp8Q3ClyTlZP52Y9nq7b8fITPuVXUk9ohG5EFHw4gAEcjFxfKb3xuAsEjx2z1wxNbSZMcgS9GKyW3R6KwJONgtA64LTyxWm8Bvudp0M1FdJPEGopM4Fvg7G/hsptkhCfHFegv4ENwxPeXmYhxwZy7js+BeM27t9ODBMynVCLJ7RWcBMteZJtvjOYHb5lOnCLYWNEMKC59BA7covu1cANa2PXL05iGdufOzkgFqqHBOrgQVUmLEc+Mkz4Rq8O6WkNr7atNkH4M8d+SD1t/tSzt3oFql+neVs+AwEI5JaBJaxARtY2Z4mKoUqxds4UpZ0sv3zIbNoo0J4fihldQTX3XNcuNcZmcrB5LTWMdzeRuAtBk3cZHYQF6gTi3PNuDJ0nmR+4LPLoHvxQIxRgJ9iNNXqf2SYJhcvCtJiVWo85TsyFOuq7EyBPJrAdhEgE0cTq16FQXhYPJFqSfiVn0IQnPOy0LbU4BeG94QjdYNB0CiQ3QaxQqD2ebSMiNjaVaw8WaM4Z5WnzcVDsr4eGweSLa2DE3BWViaxhZFIcSTjgxNCAfelg+hznVOYoe5VqTYs1g7WtfTm3e4/WduC6p+qqAM8H4ZyrJCGpewThTDPe6H7CzX/zQ8Tm+r65HeZn+MsmxUciEWPlAVaK/VBaQBWfoG/aRL/jSZIQfep/89GjasWmbaWzeEZ2R1FOjvyJT37O9B8046SRSKVEnXWlBqbkb5XCS3qFeuE9xb9+frEknxWB5h1D/hruz2iVDEAS7+qkEz5Ot5agHJc7WCdY94Ws61sURcX5nG8UELGBAHZ3i+3VulAyT0nKNNz4K2LBHBWJcTBX1wzf+//u/j/9+//v87+9/l9Lbh/L/uyNYiTsWV2LwsjaA6MxTuzFMqmxW8Jw/+IppdX8t/Clgi1rI1SN0UC/r6tX/4lUc2VV1OQReSeCsjUpKZchw4XUcjHfw6ryCV3R8s6VXm67vp4n+lcPV9gJwmbKQEsmrJi9c2vkwrm8HFbVYNTaRGq8D91t9n5+U+aD/hNtN3HjC/nC/vUoGFSCkXP+NlRcmLUqLbiUBl4LYf1U/CCvwtd3ryCH8gUmGITAxiH1O5rnGTz7y1LuFjmnFGQ1UWuM7HwfXtWl2fPFKklYwNUpF2IL/TmaRETjQiM5SJacI+3Gv5MBU8lP5Io6gWkawpyzNEVGqOdx4YlO1dCvjbWFZWbCmeiFKPSlMKtKcMFLs/KQxtgAHi7NZNCQ32bBAW2mbHflVZ8wXKi1JKVHkW20bnYnl3dKWJeWJOiX3oKPBD6Zbi0ZvSIuWktUHB8qDR8DMMh1ZfkBL9FS9x5r0hBGLJ8pUCJv3NYH+Ae8p40mZWd5m5fhobFjQeQvqTT4VKWIYfRL0tfaXKiVl75hHReuTJEcqVlug+eOIIc4bdIydtn2K0iNZPsYWQvQio2qbO3OqAlPHDDOB7DfjGEfVF51FqqNacd6QmgFKJpMfLp5DHTv4wXlONKVXF9zTJpDV4m1sYZqJPhotcsliZM8yksKkCkzpiXt+EcRQvSQqmBS9WdWkxMTJXPSw94jqI3varCjQxTazjlMH8jTS8ilaW8014/vwA/LNa+YiFoyyx3s/KswP3O8QW1jtq45yTM/DX9a8M4voTVaO2ebvw1EooDw/yg6Y1faY+WwrdVs5Yt0hQ5EwRfYXSFxray1YvSM+kYmlpLG2/9mm1MfmbKHXr44Ih8nVKb1M537ZANUkCtdsPZ80JVKVKabVHCadaLXg+IV8i5GSwpZti0h6diTaKs9sdpUKEpd7jDUpYmHtiX33SKiO3tuydkaxA7pEc9XIQEOfWJlszj5YpL5bKeQyT7aZSBOamvSHl8xsWvgo26IP/bqk+0EJUz+gkkcvlUlyPp2kdKFtt7y5aCdks9ZJJcFp5ZWeaWKgtnXMN3ORwGLBE0PtkEIek5FY2aVssUZHtsWIvnljMVJtuVIjpZup/5VL1yPOHWWHkOMc6YySWMckczD5jUj2mlLVquFaMU8leGVaqeXis+aRRL8zm4WuBk6cyWfGMxgtr8useQEx7k/PvRoZyd9nde1GUCV84gMX8Ogu/BWezYPSR27llzQnA97oo0pYyxobYUJfsj+ysTm9zJ+S4pk0TGo9VTG0KjqYhTmALfoDZVKla2b5yhv241PxFaLJs3i05K0AAIdcGxCJZmT3ZdT7CliR7q+kur7WdQjygYtOWRL9B8E4s4LI8KpAj7bE0dg7DLOaX+MGeAi0hMMSSWZEz+RudXbZCsGYS0QqiXjH9XQbd8sCB+nIVTq7/T/FDS+zWY9q7Z2fdq1tdLb6v3hKKVDAw5gjj6o9r1wHFROdHc18MJp4SJ2Ucvu+iQ9EgkekW8VCM+psM6y+/2SBy8tNN4a3L1MzP+OLsyvESo5gS7IQOnIqMmviJBVc6zbVG1n8eXiA3j46kmvvtJlewwNDrxk4SbJOtP/TV/lIVK9ueShNbbMHfwnLTLLhbZuO79ec5XvfgRwLFK+w1r5ZWW15rVFZrE+wKqNRv5KqsLNfpGgnoUU6Y71NxEmN7MyqwqAQqoIULOw/LbuUB2+uE75gJt+kq1qY4LoxV+qR/zalupea3D5+WMeaRIn0sAI6DDWDh158fqUb4YhAxhREbUN0qyyJYkBU4V2KARXDT65gW3gRsiv7xSPYEKLwzgriWcWgPr0sbZnv7m1XHNFW6xPdGNZUdxFiUYlmXNjDVWuu7LCkX/nVkrXaJhiYktBISC2xgBXQnNEP+cptWl1eG62a7CPXrnrkTQ5BQASbEqUZWMDiZUisKyHDeLFOaJILUo5f6iDt4ZO8MlqaKLto0AmTHVVbkGuyPa1R/ywZsWRoRDoRdNMMHwYTsklMVnlAd2S0282bgMI8fiJpDh69OSL6K3qbo20KfpNMurnYGQSr/stFqZ7hYsxKlLnKAKhsmB8AIpEQ4bd/NrTLTXefsE6ChRmKWjXKVgpGoPs8GAicgKVw4K0qgDgy1A6hFq1WRat3fHF+FkU+b6H4NWpOU3KXTxrIb2qSHAb+qhm8hiSROi/9ofapjxhyKxxntPpge6KL5Z4+WBMYkAcE6+0Hd3Yh2zBsK2MV3iW0Y6cvOCroXlRb2MMJtdWx+3dkFzGh2Pe3DZ9QpSqpaR/rE1ImOrHqYYyccpiLC22amJIjRWVAherTfpQLmo6/K2pna85GrDuQPlH1Tsar8isAJbXLafSwOof4gg9RkAGm/oYpBQQiPUoyDk2BCQ1k+KILq48ErFo4WSRhHLq/y7mgw3+L85PpP6xWr6cgp9sOjYjKagOrxF148uhuaWtjet953fh1IQiEzgC+d2IgBCcUZqgTAICm2bR8oCjDLBsmg+ThyhfD+zBalsKBY1Ce54Y/t9cwfbLu9SFwEgphfopNA3yNxgyDafUM3mYTovZNgPGdd4ZFFOj1vtfFW3u7N+iHEN1HkeesDMXKPyoCDCGVMo4GCCD6PBhQ3dRZIHy0Y/3MaE5zU9mTCrwwnZojtE+qNpMSkJSpmGe0EzLyFelMJqhfFQ7a50uXxZ8pCc2wxtAKWgHoeamR2O7R+bq7IbPYItO0esdRgoTaY38hZLJ5y02oIVwoPokGIzxAMDuanQ1vn2WDQ00Rh6o5QOaCRu99fwDbQcN0XAuqkFpxT/cfz3slGRVokrNU0iqiMAJFEbKScZdmSkTUznC0U+MfwFOGdLgsewRyPKwBZYSmy6U325iUhBQNxbAC3FLKDV9VSOuQpOOukJ/GAmu/tyEbX9DgEp6dv1zoU0IqzpG6gssSjIYRVPGgU1QAQYRgIT8gEV0EXr1sqeh2I6rXjtmoCYyEDCe/PkFEi/Q48FuT29p557iN+LCwk5CK/CZ2WdAdfQZh2Z9QGrzPLSNRj5igUWzl9Vi0rCqH8G1Kp4QMLkuwMCAypdviDXyOIk0AHTM8HBYKh3b0/F+DxoNj4ZdoZfCpQVdnZarqoMaHWnMLNVcyevytGsrXQEoIbubqWYNo7NRHzdc0zvT21fWVirj7g36iy6pxogfvgHp1xH1Turbz8QyyHnXeBJicpYUctbzApwzZ1HT+FPEXMAgUZetgeGMwt4G+DHiDT2Lu+PT21fjJCAfV16a/Wu1PqOkUHSTKYhWW6PhhHUlNtWzFnA7MbY+r64vkwdpfNB2JfWgWXAvkzd42K4lN9x7Wrg4kIKgXCb4mcW595MCPJ/cTfPAMQMFWwnqwde4w8HZYJFpQwcSMhjVz4B8p6ncSCN1X4klxoIH4BN2J6taBMj6lHkAOs8JJAmXq5xsQtrPIPIIp/HG6i21xMGcFgqDXSRF0xQg14d2uy6HgKE13LSvQe52oShF5Jx1R6avyL4thhXQZHfC94oZzuPUBKFYf1VvDaxIrtV6dNGSx7DO0i1p6CzBkuAmEqyWceQY7F9+U0ObYDzoa1iKao/cOD/v6Q9gHrrr1uCeOk8fST9MG23Ul0KmM3r+Wn6Hi6WAcL7gEeaykicvgjzkjSwFsAXIR81Zx4QJ6oosVyJkCcT+4xAldCcihqvTf94HHUPXYp3REIaR4dhpQF6+FK1H0i9i7Pvh8owu3lO4PT1iuqu+DkL2Bj9+kdfGAg2TXw03iNHyobxofLE2ibjsYDPgeEQlRMR7afXbSGQcnPjI2D+sdtmuQ771dbASUsDndU7t58jrrNGRzISvwioAlHs5FA+cBE5Ccznkd8NMV6BR6ksnKLPZnMUawRDU1MZ/ib3xCdkTblHKu4blNiylH5n213yM0zubEie0o4JhzcfAy3H5qh2l17uLooBNLaO+gzonTH2uF8PQu9EyH+pjGsACTMy4cHzsPdymUSXYJOMP3yTkXqvO/lpvt0cX5ekDEu9PUfBeZODkFuAjXCaGdi6ew4qxJ8PmFfwmPpkgQjQlWqomFY6UkjmcnAtJG75EVR+NpzGpP1Ef5qUUbfowrC3zcSLX3BxgWEgEx/v9cP8H8u1Mvt9/rMDYf6sjwU1xSOPBgzFEeJLMRVFtKo5QHsUYT8ZRLCah27599EuqoC9PYjYO6aoAMHB8X1OHwEAYouHfHB3nyb2B+SnZxM/vw/bCtORjLMSy5aZoEpvgdGvlJfNPFUu/p7Z4VVK1hiI0/UTuB3ZPq4ohEbm7Mntgc1evEtknaosgZSwnDC2BdMmibpeg48X8Ixl+/8+xXdbshQXUPPvx8jT3fkELivHSmqbhblfNFShWAyQnJ3WBU6SMYSIpTDmHjdLVAdlADdz9gCplZw6mTiHqDwIsxbm9ErGusiVpg2w8Q3khKV/R9Oj8PFeF43hmW/nSd99nZzhyjCX3QOZkkB6BsH4H866WGyv9E0hVAzPYah2tkRfQZMmP2rinfOeQalge0ovhduBjJs9a1GBwReerceify49ctOh5/65ATYuMsAkVltmvTLBk4oHpdl6i+p8DoNj4Fb2vhdFYer2JSEilEwPd5n5zNoGBXEjreg/wh2NFnNRaIUHSOXa4eJRwygZoX6vnWnqVdCRT1ARxeFrNBJ+tsdooMwqnYhE7zIxnD8pZH+P0Nu1wWxCPTADfNWmqx626IBJJq6NeapcGeOmbtXvl0TeWG0Y7OGGV4+EHTtNBIT5Wd0Bujl7inXgZgfXTM5efD3qDTJ54O9v3Bkv+tdIRlq1kXcVD0BEMirmFxglNPt5pedb1AnxuCYMChUykwsTIWqT23XDpvTiKEru1cTcEMeniB+HQDehxPXNmkotFdwUPnilB/u4Nx5Xc6l8J9jH1EgKZUUt8t8cyoZleDBEt8oibDmJRAoMKJ5Oe9CSWS5ZMEJvacsGVdXDWjp/Ype5x0p9PXB2PAwt2LRD3d+ftNgpuyvxlP8pB84oB1i73vAVpwyrmXW72hfW6Dzn9Jkj4++0VQ4d0KSx1AsDA4OtXXDo63/w+GD+zC7w5SJaxsmnlYRQ4dgdjA7tTl2KNLnpJ+mvkoDxtt1a4oPaX3EVqj96o9sRKBQqU7ZOiupeAIyLMD+Y3YwHx30XWHB5CQiw7q3mj1EDlP2eBsZbz79ayUMbyHQ7s8gu4Lgip1LiGJj7NQj905/+rgUYKAA5qdrlHKIknWmqfuR+PB8RdBkDg/NgnlT89G72h2NvySnj7UyBwD+mi/IWs1xWbxuVwUIVXun5cMqBtFbrccI+DILjsVQg6eeq0itiRfedn89CvyFtpkxaauEvSANuZmB1p8FGPbU94J9medwsZ9HkUYjmI7OH5HuxendLbxTaYrPuIfE2ffXFKhoNBUp33HsFAXmCV/Vxpq5AYgFoRr5Ay93ZLRlgaIPjhZjXZZChT+aE5iWAXMX0oSFQEtwjiuhQQItTQX5IYrKfKB+queTNplR1Hoflo5/I6aPPmACwQCE2jTOYo5Dz1cs7Sod0KTG/3kEDGk3kUaUCON19xSJCab3kNpWZhSWkO8l+SpW70Wn3g0ciOIJO5JXma6dbos6jyisuxXwUUhj2+1uGhcvuliKtWwsUTw4gi1c/diEEpZHoKoxTBeMDmhPhKTx7TXWRakV8imJR355DcIHkR9IREHxohP4TbyR5LtFU24umRPRmEYHbpe1LghyxPx7YgUHjNbbQFRQhh4KeU1EabXx8FS3JAxp2rwRDoeWkJgWRUSKw6gGP5U2PuO9V4ZuiKXGGzFQuRuf+tkSSsbBtRJKhCi3ENuLlXhPbjTKD4djXVnfXFds6Zb+1XiUrRfyayGxJq1+SYBEfbKlgjiSmk0orgTqzSS+DZ5rTqsJbttiNtp+KMqGE2AHGFw6jQqM5vD6vMptmXV9OAjq49Uf/Lx9Opam+Hn5O9p8qoBBAQixzQZ4eNVkO9sPzJAMyR1y4/RCQQ1s0pV5KAU5sKLw3tkcFbI/JqrjCsK4Mw+W8aod4lioYuawUiCyVWBE/qPaFi5bnkgpfu/ae47174rI1fqQoTbW0HrU6FAejq7ByM0V4zkZTg02/YJK2N7hUQRCeZ4BIgSEqgD8XsjzG6LIsSbuHoIdz/LhFzbNn1clci1NHWJ0/6/O8HJMdIpEZbqi1RrrFfoo/rI/7ufm2MPG5lUI0IYJ4MAiHRTSOFJ2oTverFHYXThkYFIoyFx6rMYFgaOKM4xNWdlOnIcKb/suptptgTOTdVIf4YgdaAjJnIAm4qNNHNQqqAzvi53GkyRCEoseUBrHohZsjUbkR8gfKtc/+Oa72lwxJ8Mq6HDfDATbfbJhzeIuFQJSiw1uZprHlzUf90WgqG76zO0eCB1WdPv1IT6sNxxh91GEL2YpgC97ikFHyoaH92ndwduqZ6IYjkg20DX33MWdoZk7QkcKUCgisIYslOaaLyvIIqRKWQj16jE1DlQWJJaPopWTJjXfixEjRJJo8g4++wuQjbq+WVYjsqCuNIQW3YjnxKe2M5ZKEqq+cX7ZVgnkbsU3RWIyXA1rxv4kGersYJjD//auldXGmcEbcfTeF16Y1708FB1HIfmWv6dSFi6oD4E+RIjCsEZ+kY7dKnwReJJw3xCjKvi3kGN42rvyhUlIz0Bp+fNSV5xwFiuBzG296e5s/oHoFtUyUplmPulIPl+e1CQIQVtjlzLzzzbV+D/OVQtYzo5ixtMi5BmHuG4N/uKfJk5UIREp7+12oZlKtPBomXSzAY0KgtbPzzZoHQxujnREUgBU+O/jKKhgxVhRPtbqyHiUaRwRpHv7pgRPyUrnE7fYkVblGmfTY28tFCvlILC04Tz3ivkNWVazA+OsYrxvRM/hiNn8Fc4bQBeUZABGx5S/xFf9Lbbmk298X7iFg2yeimvsQqqJ+hYbt6uq+Zf9jC+Jcwiccd61NKQtFvGWrgJiHB5lwi6fR8KzYS7EaEHf/ka9EC7H8D+WEa3TEACHBkNSj/cXxFeq4RllC+fUFm2xtstYLL2nos1DfzsC9vqDDdRVcPA3Ho95aEQHvExVThXPqym65llkKlfRXbPTRiDepdylHjmV9YTWAEjlD9DdQnCem7Aj/ml58On366392214B5zrmQz/9ySG2mFqEwjq5sFl5tYJPw5hNz8lyZPUTsr5E0F2C9VMPnZckWP7+mbwp/BiN7f4kf7vtGnZF2JGvjK/sDX1RtcFY5oPQnE4lIAYV49U3C9SP0LCY/9i/WIFK9ORjzM9kG/KGrAuwFmgdEpdLaiqQNpCTGZVuAO65afkY1h33hrqyLjZy92JK3/twdj9pafFcwfXONmPQWldPlMe7jlP24Js0v9m8bIJ9TgS2IuRvE9ZVRaCwSJYOtAfL5H/YS4FfzKWKbek+GFulheyKtDNlBtrdmr+KU+ibHTdalzFUmMfxw3f36x+3cQbJLItSilW9cuvZEMjKw987jykZRlsH/UI+HlKfo2tLwemBEeBFtmxF2xmItA/dAIfQ+rXnm88dqvXa+GapOYVt/2waFimXFx3TC2MUiOi5/Ml+3rj/YU6Ihx2hXgiDXFsUeQkRAD6wF3SCPi2flk7XwKAA4zboqynuELD312EJ88lmDEVOMa1W/K/a8tGylZRMrMoILyoMQzzbDJHNZrhH77L9qSC42HVmKiZ5S0016UTp83gOhCwz9XItK9fgXfK3F5d7nZCBUekoLxrutQaPHa16Rjsa0gTrzyjqTnmcIcrxg6X6dkKiucudc0DD5W4pJPf0vuDW8r5/uw24YfMuxFRpD2ovT2mFX79xH6Jf+MVdv2TYqR6/955QgVPe3JCD/WjAYcLA9tpXgFiEjge2J5ljeI/iUzg91KQuHkII4mmHZxC3XQORLAC6G7uFn5LOmlnXkjFdoO976moNTxElS8HdxWoPAkjjocDR136m2l+f5t6xaaNgdodOvTu0rievnhNAB79WNrVs6EsPgkgfahF9gSFzzAd+rJSraw5Mllit7vUP5YxA843lUpu6/5jAR0RvH4rRXkSg3nE+O5GFyfe+L0s5r3k05FyghSFnKo4TTgs07qj4nTLqOYj6qaW9knJTDkF5OFMYbmCP+8H16Ty482OjvERV6OFyw043L9w3hoJi408sR+SGo1WviXUu8d7qS+ehKjpKwxeCthsm2LBFSFeetx0x4AaKPxtp3CxdWqCsLrB1s/j5TAhc1jNZsXWl6tjo/WDoewxzg8T8NnhZ1niUwL/nhfygLanCnRwaFGDyLw+sfZhyZ1UtYTp8TYB6dE7R3VsKKH95CUxJ8u8N+9u2/9HUNKHW3x3w5GQrfOPafk2w5qZq8MaHT0ebeY3wIsp3rN9lrpIsW9c1ws3VNV+JwNz0Lo9+V7zZr6GD56We6gWVIvtmam5GPPkVAbr74r6SwhuL+TRXtW/0pgyX16VNl4/EAD50TnUPuwrW6OcUO2VlWXS0inq872kk7GUlW6o/ozFKq+Sip6LcTtSDfDrPTcCHhx75H8BeRon+KG2wRwzfDgWhALmiWOMO6h3pm1UCZEPEjScyk7tdLx6WrdA2N1QTPENvNnhCQjW6kl057/qv7IwRryHrZBCwVSbLLnFRiHdTwk8mlYixFt1slEcPD7FVht13HyqVeyD55HOXrh2ElAxJyinGeoFzwKA91zfrdLvDxJSjzmImfvTisreI25EDcVfGsmxLVbfU8PGe/7NmWWKjXcdTJ11jAlVIY/Bv/mcxg/Q10vCHwKG1GW/XbJq5nxDhyLqiorn7Wd7VEVL8UgVzpHMjQ+Z8DUgSukiVwWAKkeTlVVeZ7t1DGnCgJVIdBPZAEK5f8CDyDNo7tK4/5DBjdD5MPV86TaEhGsLVFPQSI68KlBYy84FievdU9gWh6XZrugvtCZmi9vfd6db6V7FmoEcRHnG36VZH8N4aZaldq9zZawt1uBFgxYYx+Gs/qW1jwANeFy+LCoymyM6zgG7j8bGzUyLhvrbJkTYAEdICEb4kMKusKT9V3eIwMLsjdUdgijMc+7iKrr+TxrVWG0U+W95SGrxnxGrE4eaJFfgvAjUM4SAy8UaRwE9j6ZQH5qYAWGtXByvDiLSDfOD0yFA3UCMKSyQ30fyy1mIRg4ZcgZHLNHWl+c9SeijOvbOJxoQy7lTN2r3Y8p6ovxvUY74aOYbuVezryqXA6U+fcp6wSV9X5/OZKP18tB56Ua0gMyxJI7XyNT7IrqN8GsB9rL/kP5KMrjXxgqKLDa+V5OCH6a5hmOWemMUsea9vQl9t5Oce76PrTyTv50ExOqngE3PHPfSL//AItPdB7kGnyTRhVUUFNdJJ2z7RtktZwgmQzhBG/G7QsjZmJfCE7k75EmdIKH7xlnmDrNM/XbTT6FzldcH/rcRGxlPrv4qDScqE7JSmQABJWqRT/TUcJSwoQM+1jvDigvrjjH8oeK2in1S+/yO1j8xAws/T5u0VnIvAPqaE1atNuN0cuRliLcH2j0nTL4JpcR7w9Qya0JoaHgsOiALLCCzRkl1UUESz+ze/gIXHGtDwgYrK6pCFKJ1webSDog4zTlPkgXZqxlQDiYMjhDpwTtBW2WxthWbov9dt2X9XFLFmcF+eEc1UaQ74gqZiZsdj63pH1qcv3Vy8JYciogIVKsJ8Yy3J9w/GhjWVSQAmrS0BPOWK+RKV+0lWqXgYMnIFwpcZVD7zPSp547i9HlflB8gVnSTGmmq1ClO081OW/UH11pEQMfkEdDFzjLC1Cdo/BdL3s7cXb8J++Hzz1rhOUVZFIPehRiZ8VYu6+7Er7j5PSZu9g/GBdmNzJmyCD9wiswj9BZw+T3iBrg81re36ihMLjoVLoWc+62a1U/7qVX5CpvTVF7rocSAKwv4cBVqZm7lLDS/qoXs4fMs/VQi6BtVbNA3uSzKpQfjH1o3x4LrvkOn40zhm6hjduDglzJUwA0POabgdXIndp9fzhOo23Pe+Rk9GSLX0d71Poqry8NQDTzNlsa+JTNG9+UrEf+ngxCjGEsDCc0bz+udVRyHQI1jmEO3S+IOQycEq7XwB6z3wfMfa73m8PVRp+iOgtZfeSBl01xn03vMaQJkyj7vnhGCklsCWVRUl4y+5oNUzQ63B2dbjDF3vikd/3RUMifPYnX5Glfuk2FsV/7RqjI9yKTbE8wJY+74p7qXO8+dIYgjtLD/N8TJtRh04N9tXJA4H59IkMmLElgvr0Q5OCeVfdAt+5hkh4pQgfRMHpL74XatLQpPiOyHRs/OdmHtBf8nOZcxVKzdGclIN16lE7kJ+pVMjspOI+5+TqLRO6m0ZpNXJoZRv9MPDRcAfJUtNZHyig/s2wwReakFgPPJwCQmu1I30/tcBbji+Na53i1W1N+BqoY7Zxo+U/M9XyJ4Ok2SSkBtoOrwuhAY3a03Eu6l8wFdIG1cN+e8hopTkiKF093KuH/BcB39rMiGDLn6XVhGKEaaT/vqb/lufuAdpGExevF1+J9itkFhCfymWr9vGb3BTK4j598zRH7+e+MU9maruZqb0pkGxRDRE1CD4Z8LV4vhgPidk5w2Bq816g3nHw1//j3JStz7NR9HIWELO8TMn3QrP/zZp//+Dv9p429/ogv+GATR+n/UdF+ns9xNkXZQJXY4t9jMkJNUFygAtzndXwjss+yWH9HAnLQQfhAskdZS2l01HLWv7L7us5uTH409pqitvfSOQg/c+Zt7k879P3K9+WV68n7+3cZfuRd/dDPP/03rn+d+/nBvWfgDlt8+LzjqJ/vx3CnNOwiXhho778C96iD+1TBvRZYeP+EH81LE0vVwOOrmCLB3iKzI1x+vJEsrPH4uF0UB4TJ4X3uDfOCo3PYpYe0MF4bouh0DQ/l43fxUF7Y+dpWuvTSffB0yO2UQUETI/LwCZE3BvnevJ7c9zUlY3H58xzke6DNFDQG8n0WtDN4LAYN4nogKav1ezOfK/z+t6tsCTp+dhx4ymjWuCJk1dEUifDP+HyS4iP/Vg9B2jTo9L4NbiBuDS4nuuHW6H+JDQn2JtqRKGkEQPEYE7uzazXIkcxIAqUq1esasZBETlEZY7y7Jo+RoV/IsjY9eIMkUvr42Hc0xqtsavZvhz1OLwSxMOTuqzlhb0WbdOwBH9EYiyBjatz40bUxTHbiWxqJ0uma19qhPruvcWJlbiSSH48OLDDpaHPszvyct41ZfTu10+vjox6kOqK6v0K/gEPphEvMl/vwSv+A4Hhm36JSP9IXTyCZDm4kKsqD5ay8b1Sad/vaiyO5N/sDfEV6Z4q95E+yfjxpqBoBETW2C7xl4pIO2bDODDFurUPwE7EWC2Uplq+AHmBHvir2PSgkR12/Ry65O0aZtQPeXi9mTlF/Wj5GQ+vFkYyhXsLTjrBSP9hwk4GPqDP5rBn5/l8b0mLRAvRSzXHc293bs3s8EsdE3m2exxidWVB4joHR+S+dz5/W+v00K3TqN14CDBth8eWcsTbiwXPsygHdGid0PEdy6HHm2v/IUuV5RVapYmzGsX90mpnIdNGcOOq64Dbc5GUbYpD9M7S+6cLY//QmjxFLP5cuTFRm3vA5rkFZroFnO3bjHF35uU3s8mvL7Tp9nyTc4mymTJ5sLIp7umSnGkO23faehtz3mmTS7fbVx5rP7x3HXIjRNeq/A3xCs9JNB08c9S9BF2O3bOur0ItslFxXgRPdaapBIi4dRpKGxVz7ir69t/bc9qTxjvtOyGOfiLGDhR4fYywHv1WdOplxIV87TpLBy3Wc0QP0P9s4G7FBNOdITS/tep3o3h1TEa5XDDii7fWtqRzUEReP2fbxz7bHWWJdbIOxOUJZtItNZpTFRfj6vm9sYjRxQVO+WTdiOhdPeTJ+8YirPvoeL88l5iLYOHd3b/Imkq+1ZN1El3UikhftuteEYxf1Wujof8Pr4ICTu5ezZyZ4tHQMxlzUHLYO2VMOoNMGL/20S5i2o2obfk+8qqdR7xzbRDbgU0lnuIgz4LelQ5XS7xbLuSQtNS95v3ZUOdaUx/Qd8qxCt6xf2E62yb/HukLO6RyorV8KgYl5YNc75y+KvefrxY+lc/64y9kvWP0a0bDz/rojq+RWjO06WeruWqNFU7r3HPIcLWRql8ICZsz2Ls/qOm/CLn6++X+Qf7mGspYCrZod/lpl6Rw4xN/yuq8gqV4B6aHk1hVE1SfILxWu5gvXqbfARYQpspcxKp1F/c8XOPzkZvmoSw+vEqBLdrq1fr3wAPv5NnM9i8F+jdAuxkP5Z71c6uhK3enlnGymr7UsWZKC12qgUiG8XXGQ9mxnqz4GSIlybF9eXmbqj2sHX+a1jf0gRoONHRdRSrIq03Ty89eQ1GbV/Bk+du4+V15zls+vvERvZ4E7ZbnxWTVjDjb4o/k8jlw44pTIrUGxxuJvBeO+heuhOjpFsO6lVJ/aXnJDa/bM0Ql1cLbXE/Pbv3EZ3vj3iVrB5irjupZTzlnv677NrI9UNYNqbPgp/HZXS+lJmk87wec+7YOxTDo2aw2l3NfDr34VNlvqWJBknuK7oSlZ6/T10zuOoPZOeoIk81N+sL843WJ2Q4Z0fZ3scsqC/JV2fuhWi1jGURSKZV637lf53Xnnx16/vKEXY89aVJ0fv91jGdfG+G4+sniwHes4hS+udOr4RfhFhG/F5gUG35QaU+McuLmclb5ZWmR+sG5V6nf+PxYzlrnFGxpZaK8eqqVo0NfmAWoGfXDiT/FnUbWvzGDOTr8aktOZWg4BYvz5YH12ZbfCcGtNk+dDAZNGWvHov+PIOnY9Prjg8h/wLRrT69suaMVZ5bNuK00lSVpnqSX1NON/81FoP92rYndionwgOiA8WMf4vc8l15KqEEG4yAm2+WAN5Brfu1sq9suWYqgoajgOYt/JCk1gC8wPkK+XKCtRX6TAtgvrnuBgNRmn6I8lVDipOVB9kX6Oxkp4ZKyd1M6Gj8/v2U7k+YQBL95Kb9PQENucJb0JlW3b5tObN7m/Z1j1ev388d7o15zgXsI9CikAGAViR6lkJv7nb4Ak40M2G8TJ447kN+pvfHiOFjSUSP6PM+QfbAywKJCBaxSVxpizHseZUyUBhq59vFwrkyGoRiHbo0apweEZeSLuNiQ+HAekOnarFg00dZNXaPeoHPTRR0FmEyqYExOVaaaO8c0uFUh7U4e/UxdBmthlBDgg257Q33j1hA7HTxSeTTSuVnPZbgW1nodwmG16aKBDKxEetv7D9OjO0JhrbJTnoe+kcGoDJazFSO8/fUN9Jy/g4XK5PUkw2dgPDGpJqBfhe7GA+cjzfE/EGsMM+FV9nj9IAhrSfT/J3QE5TEIYyk5UjsI6ZZcCPr6A8FZUF4g9nnpVmjX90MLSQysIPD0nFzqwCcSJmIb5mYv2Cmk+C1MDFkZQyCBq4c/Yai9LJ6xYkGS/x2s5/frIW2vmG2Wrv0APpCdgCA9snFvfpe8uc0OwdRs4G9973PGEBnQB5qKrCQ6m6X/H7NInZ7y/1674/ZXOVp7OeuCRk8JFS516VHrnH1HkIUIlTIljjHaQtEtkJtosYul77cVwjk3gW1Ajaa6zWeyHGLlpk3VHE2VFzT2yI/EvlGUSz2H9zYE1s4nsKMtMqNyKNtL/59CpFJki5Fou6VXGm8vWATEPwrUVOLvoA8jLuwOzVBCgHB2Cr5V6OwEWtJEKokJkfc87h+sNHTvMb0KVTp5284QTPupoWvQVUwUeogZR3kBMESYo0mfukewRVPKh5+rzLQb7HKjFFIgWhj1w3yN/qCNoPI8XFiUgBNT1hCHBsAz8L7Oyt8wQWUFj92ONn/APyJFg8hzueqoJdNj57ROrFbffuS/XxrSXLTRgj5uxZjpgQYceeMc2wJrahReSKpm3QjHfqExTLAB2ipVumE8pqcZv8LYXQiPHHsgb5BMW8zM5pvQit+mQx8XGaVDcfVbLyMTlY8xcfmm/RSAT/H09UQol5gIz7rESDmnrQ4bURIB4iRXMDQwxgex1GgtDxKp2HayIkR+E/aDmCttNm2C6lytWdfOVzD6X2SpDWjQDlMRvAp1symWv4my1bPCD+E1EmGnMGWhNwmycJnDV2WrQNxO45ukEb08AAffizYKVULp15I4vbNK5DzWwCSUADfmKhfGSUqii1L2UsE8rB7mLuHuUJZOx4+WiizHBJ/hwboaBzhpNOVvgFTf5cJsHef7L1HCI9dOUUbb+YxUJWn6dYOLz+THi91kzY5dtO5c+grX7v0jEbsuoOGnoIreDIg/sFMyG+TyCLIcAWd1IZ1UNFxE8Uie13ucm40U2fcxC0u3WLvLOxwu+F7MWUsHsdtFQZ7W+nlfCASiAKyh8rnP3EyDByvtJb6Kax6/HkLzT9SyEyTMVM1zPtM0MJY14DmsWh4MgD15Ea9Hd00AdkTZ0EiG5NAGuIBzQJJ0JR0na+OB7lQA6UKxMfihIQ7GCCnVz694QvykWXTxpS2soDu+smru1UdIxSvAszBFD1c8c6ZOobA8bJiJIvuycgIXBQIXWwhyTgZDQxJTRXgEwRNAawGSXO0a1DKjdihLVNp/taE/xYhsgwe+VpKEEB4LlraQyE84gEihxCnbfoyOuJIEXy2FIYw+JjRusybKlU2g/vhTSGTydvCvXhYBdtAXtS2v7LkHtmXh/8fly1do8FI/D0f8UbzVb5h+KRhMGSAmR2mhi0YG/uj7wgxcfzCrMvdjitUIpXDX8ae2JcF/36qUWIMwN6JsjaRGNj+jEteGDcFyTUb8X/NHSucKMJp7pduxtD6KuxVlyxxwaeiC1FbGBESO84lbyrAugYxdl+2N8/6AgWpo/IeoAOcsG35IA/b3AuSyoa55L7llBLlaWlEWvuCFd8f8NfcTUgzJv6CbB+6ohWwodlk9nGWFpBAOaz5uEW5xBvmjnHFeDsb0mXwayj3mdYq5gxxNf3H3/tnCgHwjSrpSgVxLmiTtuszdRUFIsn6LiMPjL808vL1uQhDbM7aA43mISXReqjSskynIRcHCJ9qeFopJfx9tqyUoGbSwJex/0aDE3plBPGtNBYgWbdLom3+Q/bjdizR2/AS/c/dH/d3G7pyl1qDXgtOFtEqidwLqxPYtrNEveasWq3vPUUtqTeu8gpov4bdOQRI2kneFvRNMrShyVeEupK1PoLDPMSfWMIJcs267mGB8X9CehQCF0gIyhpP10mbyM7lwW1e6TGvHBV1sg/UyTghHPGRqMyaebC6pbB1WKNCQtlai1GGvmq9zUKaUzLaXsXEBYtHxmFbEZ2kJhR164LhWW2Tlp1dhsGE7ZgIWRBOx3Zcu2DxgH+G83WTPceKG0TgQKKiiNNOlWgvqNEbnrk6fVD+AqRam2OguZb0YWSTX88N+i/ELSxbaUUpPx4vJUzYg/WonSeA8xUK6u7DPHgpqWpEe6D4cXg5uK9FIYVba47V/nb+wyOtk+zG8RrS4EA0ouwa04iByRLSvoJA2FzaobbZtXnq8GdbfqEp5I2dpfpj59TCVif6+E75p665faiX8gS213RqBxTZqfHP46nF6NSenOneuT+vgbLUbdTH2/t0REFXZJOEB6DHvx6N6g9956CYrY/AYcm9gELJXYkrSi+0F0geKDZgOCIYkLU/+GOW5aGj8mvLFgtFH5+XC8hvAE3CvHRfl4ofM/Qwk4x2A+R+nyc9gNu/9Tem7XW4XRnyRymf52z09cTOdr+PG6+P/Vb4QiXlwauc5WB1z3o+IJjlbxI8MyWtSzT+k4sKVbhF3xa+vDts3NxXa87iiu+xRH9cAprnOL2h6vV54iQRXuOAj1s8nLFK8gZ70ThIQcWdF19/2xaJmT0efrkNDkWbpAQPdo92Z8+Hn/aLjbOzB9AI/k12fPs9HhUNDJ1u6ax2VxD3R6PywN7BrLJ26z6s3QoMp76qzzwetrDABKSGkfW5PwS1GvYNUbK6uRqxfyVGNyFB0E+OugMM8kKwmJmupuRWO8XkXXXQECyRVw9UyIrtCtcc4oNqXqr7AURBmKn6Khz3eBN96LwIJrAGP9mr/59uTOSx631suyT+QujDd4beUFpZ0kJEEnjlP+X/Kr2kCKhnENTg4BsMTOmMqlj2WMFLRUlVG0fzdCBgUta9odrJfpVdFomTi6ak0tFjXTcdqqvWBAzjY6hVrH9sbt3Z9gn+AVDpTcQImefbB4edirjzrsNievve4ZT4EUZWV3TxEsIW+9MT/RJoKfZZYSRGfC1CwPG/9rdMOM8qR/LUYvw5f/emUSoD7YSFuOoqchdUg2UePd1eCtFSKgxLSZ764oy4lvRCIH6bowPxZWwxNFctksLeil47pfevcBipkkBIc4ngZG+kxGZ71a72KQ7VaZ6MZOZkQJZXM6kb/Ac0/XkJx8dvyfJcWbI3zONEaEPIW8GbkYjsZcwy+eMoKrYjDmvEEixHzkCSCRPRzhOfJZuLdcbx19EL23MA8rnjTZZ787FGMnkqnpuzB5/90w1gtUSRaWcb0eta8198VEeZMUSfIhyuc4/nywFQ9uqn7jdqXh+5wwv+RK9XouNPbYdoEelNGo34KyySwigsrfCe0v/PlWPvQvQg8R0KgHO18mTVThhQrlbEQ0Kp/JxPdjHyR7E1QPw/ut0r+HDDG7BwZFm9IqEUZRpv2WpzlMkOemeLcAt5CsrzskLGaVOAxyySzZV/D2EY7ydNZMf8e8VhHcKGHAWNszf1EOq8fNstijMY4JXyATwTdncFFqcNDfDo+mWFvxJJpc4sEZtjXyBdoFcxbUmniCoKq5jydUHNjYJxMqN1KzYV62MugcELVhS3Bnd+TLLOh7dws/zSXWzxEb4Nj4aFun5x4kDWLK5TUF/yCXB/cZYvI9kPgVsG2jShtXkxfgT+xzjJofXqPEnIXIQ1lnIdmVzBOM90EXvJUW6a0nZ/7XjJGl8ToO3H/fdxnxmTNKBZxnkpXLVgLXCZywGT3YyS75w/PAH5I/jMuRspej8xZObU9kREbRA+kqjmKRFaKGWAmFQspC+QLbKPf0RaK3OXvBSWqo46p70ws/eZpu6jCtZUgQy6r4tHMPUdAgWGGUYNbuv/1a6K+MVFsd3T183+T8capSo6m0+Sh57fEeG/95dykGJBQMj09DSW2bY0mUonDy9a8trLnnL5B5LW3Nl8rJZNysO8Zb+80zXxqUGFpud3Qzwb7bf+8mq6x0TAnJU9pDQR9YQmZhlna2xuxJt0aCO/f1SU8gblOrbIyMsxTlVUW69VJPzYU2HlRXcqE2lLLxnObZuz2tT9CivfTAUYfmzJlt/lOPgsR6VN64/xQd4Jlk/RV7UKVv2Gx/AWsmTAuCWKhdwC+4HmKEKYZh2Xis4KsUR1BeObs1c13wqFRnocdmuheaTV30gvVXZcouzHKK5zwrN52jXJEuX6dGx3BCpV/++4f3hyaW/cQJLFKqasjsMuO3B3WlMq2gyYfdK1e7L2pO/tRye2mwzwZPfdUMrl5wdLqdd2Kv/wVtnpyWYhd49L6rsOV+8HXPrWH2Kup89l2tz6bf80iYSd+V4LROSOHeamvexR524q4r43rTmtFzQvArpvWfLYFZrbFspBsXNUqqenjxNNsFXatZvlIhk7teUPfK+YL32F8McTnjv0BZNppb+vshoCrtLXjIWq3EJXpVXIlG6ZNL0dh6qEm2WMwDjD3LfOfkGh1/czYc/0qhiD2ozNnH4882MVVt3JbVFkbwowNCO3KL5IoYW5wlVeGCViOuv1svZx7FbzxKzA4zGqBlRRaRWCobXaVq4yYCWbZf8eiJwt3OY+MFiSJengcFP2t0JMfzOiJ7cECvpx7neg1Rc5x+7myPJOXt2FohVRyXtD+/rDoTOyGYInJelZMjolecVHUhUNqvdZWg2J2t0jPmiLFeRD/8fOT4o+NGILb+TufCo9ceBBm3JLVn+MO2675n7qiEX/6W+188cYg3Zn5NSTjgOKfWFSAANa6raCxSoVU851oJLY11WIoYK0du0ec5E4tCnAPoKh71riTsjVIp3gKvBbEYQiNYrmH22oLQWA2AdwMnID6PX9b58dR2QKo4qag1D1Z+L/FwEKTR7osOZPWECPJIHQqPUsM5i/CH5YupVPfFA5pHUBcsesh8eO5YhyWnaVRPZn/BmdXVumZWPxMP5e28zm2uqHgFoT9CymHYNNrzrrjlXZM06HnzDxYNlI5b/QosxLmmrqDFqmogQdqk0WLkUceoAvQxHgkIyvWU69BPFr24VB6+lx75Rna6dGtrmOxDnvBojvi1/4dHjVeg8owofPe1cOnxU1ioh016s/Vudv9mhV9f35At+Sh28h1bpp8xhr09+vf47Elx3Ms6hyp6QvB3t0vnLbOhwo660cp7K0vvepabK7YJfxEWWfrC2YzJfYOjygPwfwd/1amTqa0hZ5ueebhWYVMubRTwIjj+0Oq0ohU3zfRfuL8gt59XsHdwKtxTQQ4Y2qz6gisxnm2UdlmpEkgOsZz7iEk6QOt8BuPwr+NR01LTqXmJo1C76o1N274twJvl+I069TiLpenK/miRxhyY8jvYV6W1WuSwhH9q7kuwnJMtm7IWcqs7HsnyHSqWXLSpYtZGaR1V3t0gauninFPZGtWskF65rtti48UV9uV9KM8kfDYs0pgB00S+TlzTXV6P8mxq15b9En8sz3jWSszcifZa/NuufPNnNTb031pptt0+sRSH/7UG8pzbsgtt3OG3ut7B9JzDMt2mTZuyRNIV8D54TuTrpNcHtgmMlYJeiY9XS83NYJicjRjtJSf9BZLsQv629QdDsKQhTK5CnXhpk7vMNkHzPhm0ExW/VCGApHfPyBagtZQTQmPHx7g5IXXsrQDPzIVhv2LB6Ih138iSDww1JNHrDvzUxvp73MsQBVhW8EbrReaVUcLB1R3PUXyaYG4HpJUcLVxMgDxcPkVRQpL7VTAGabDzbKcvg12t5P8TSGQkrj/gOrpnbiDHwluA73xbXts/L7u468cRWSWRtgTwlQnA47EKg0OiZDgFxAKQQUcsbGomITgeXUAAyKe03eA7Mp4gnyKQmm0LXJtEk6ddksMJCuxDmmHzmVhO+XaN2A54MIh3niw5CF7PwiXFZrnA8wOdeHLvvhdoqIDG9PDI7UnWWHq526T8y6ixJPhkuVKZnoUruOpUgOOp3iIKBjk+yi1vHo5cItHXb1PIKzGaZlRS0g5d3MV2pD8FQdGYLZ73aae/eEIUePMc4NFz8pIUfLCrrF4jVWH5gQneN3S8vANBmUXrEcKGn6hIUN95y1vpsvLwbGpzV9L0ZKTan6TDXM05236uLJcIEMKVAxKNT0K8WljuwNny3BNQRfzovA85beI9zr1AGNYnYCVkR1aGngWURUrgqR+gRrQhxW81l3CHevjvGEPzPMTxdsIfB9dfGRbZU0cg/1mcubtECX4tvaedmNAvTxCJtc2QaoUalGfENCGK7IS/O8CRpdOVca8EWCRwv2sSWE8CJPW5PCugjCXPd3h6U60cPD+bdhtXZuYB6stcoveE7Sm5MM2yvfUHXFSW7KzLmi7/EeEWL0wqcOH9MOSKjhCHHmw+JGLcYE/7SBZQCRggox0ZZTAxrlzNNXYXL5fNIjkdT4YMqVUz6p8YDt049v4OXGdg3qTrtLBUXOZf7ahPlZAY/O+7Sp0bvGSHdyQ8B1LOsplqMb9Se8VAE7gIdSZvxbRSrfl+Lk5Qaqi5QJceqjitdErcHXg/3MryljPSIAMaaloFm1cVwBJ8DNmkDqoGROSHFetrgjQ5CahuKkdH5pRPigMrgTtlFI8ufJPJSUlGgTjbBSvpRc0zypiUn6U5KZqcRoyrtzhmJ7/caeZkmVRwJQeLOG8LY6vP5ChpKhc8Js0El+n6FXqbx9ItdtLtYP92kKfaTLtCi8StLZdENJa9Ex1nOoz1kQ7qxoiZFKRyLf4O4CHRT0T/0W9F8epNKVoeyxUXhy3sQMMsJjQJEyMOjmOhMFgOmmlscV4eFi1CldU92yjwleirEKPW3bPAuEhRZV7JsKV3Lr5cETAiFuX5Nw5UlF7d2HZ96Bh0sgFIL5KGaKSoVYVlvdKpZJVP5+NZ7xDEkQhmDgsDKciazJCXJ6ZN2B3FY2f6VZyGl/t4aunGIAk/BHaS+i+SpdRfnB/OktOvyjinWNfM9Ksr6WwtCa1hCmeRI6icpFM4o8quCLsikU0tMoZI/9EqXRMpKGaWzofl4nQuVQm17d5fU5qXCQeCDqVaL9XJ9qJ08n3G3EFZS28SHEb3cdRBdtO0YcTzil3QknNKEe/smQ1fTb0XbpyNB5xAeuIlf+5KWlEY0DqJbsnzJlQxJPOVyHiKMx5Xu9FcEv1Fbg6Fhm4t+Jyy5JC1W3YO8dYLsO0PXPbxodBgttTbH3rt9Cp1lJIk2r3O1Zqu94eRbnIz2f50lWolYzuKsj4PMok4abHLO8NAC884hiXx5Fy5pWKO0bWL7uEGXaJCtznhP67SlQ4xjWIfgq6EpZ28QMtuZK7JC0RGbl9nA4XtFLug/NLMoH1pGt9IonAJqcEDLyH6TDROcbsmGPaGIxMo41IUAnQVPMPGByp4mOmh9ZQMkBAcksUK55LsZj7E5z5XuZoyWCKu6nHmDq22xI/9Z8YdxJy4kWpD16jLVrpwGLWfyOD0Wd+cBzFBxVaGv7S5k9qwh/5t/LQEXsRqI3Q9Rm3QIoaZW9GlsDaKOUyykyWuhNOprSEi0s1G4rgoiX1V743EELti+pJu5og6X0g6oTynUqlhH9k6ezyRi05NGZHz0nvp3HOJr7ebrAUFrDjbkFBObEvdQWkkUbL0pEvMU46X58vF9j9F3j6kpyetNUBItrEubW9ZvMPM4qNqLlsSBJqOH3XbNwv/cXDXNxN8iFLzUhteisYY+RlHYOuP29/Cb+L+xv+35Rv7xudnZ6ohK4cMPfCG8KI7dNmjNk/H4e84pOxn/sZHK9psfvj8ncA8qJz7O8xqbxESDivGJOZzF7o5PJLQ7g34qAWoyuA+x3btU98LT6ZyGyceIXjrqob2CAVql4VOTQPUQYvHV/g4zAuCZGvYQBtf0wmd5lilrvuEn1BXLny01B4h4SMDlYsnNpm9d7m9h578ufpef9Z4WplqWQvqo52fyUA7J24eZD5av6SyGIV9kpmHNqyvdfzcpEMw97BvknV2fq+MFHun9BT3Lsf8pbzvisWiIQvYkng+8Vxk1V+dli1u56kY50LRjaPdotvT5BwqtwyF+emo/z9J3yVUVGfKrxQtJMOAQWoQii/4dp9wgybSa5mkucmRLtEQZ/pz0tL/NVcgWAd95nEQ3Tg6tNbuyn3Iepz65L3huMUUBntllWuu4DbtOFSMSbpILV4fy6wlM0SOvi6CpLh81c1LreIvKd61uEWBcDw1lUBUW1I0Z+m/PaRlX+PQ/oxg0Ye6KUiIiTF4ADNk59Ydpt5/rkxmq9tV5Kcp/eQLUVVmBzQNVuytQCP6Ezd0G8eLxWyHpmZWJ3bAzkWTtg4lZlw42SQezEmiUPaJUuR/qklVA/87S4ArFCpALdY3QRdUw3G3XbWUp6aq9z0zUizcPa7351p9JXOZyfdZBFnqt90VzQndXB/mwf8LC9STj5kenVpNuqOQQP3mIRJj7eV21FxG8VAxKrEn3c+XfmZ800EPb9/5lIlijscUbB6da0RQaMook0zug1G0tKi/JBC4rw7/D3m4ARzAkzMcVrDcT2SyFtUdWAsFlsPDFqV3N+EjyXaoEePwroaZCiLqEzb8MW+PNE9TmTC01EzWli51PzZvUqkmyuROU+V6ik+Le/9qT6nwzUzf9tP68tYei0YaDGx6kAd7jn1cKqOCuYbiELH9zYqcc4MnRJjkeGiqaGwLImhyeKs+xKJMBlOJ05ow9gGCKZ1VpnMKoSCTbMS+X+23y042zOb5MtcY/6oBeAo1Vy89OTyhpavFP78jXCcFH0t7Gx24hMEOm2gsEfGabVpQgvFqbQKMsknFRRmuPHcZu0Su/WMFphZvB2r/EGbG72rpGGho3h+Msz0uGzJ7hNK2uqQiE1qmn0zgacKYYZBCqsxV+sjbpoVdSilW/b94n2xNb648VmNIoizqEWhBnsen+d0kbCPmRItfWqSBeOd9Wne3c6bcd6uvXOJ6WdiSsuXq0ndhqrQ4QoWUjCjYtZ0EAhnSOP1m44xkf0O7jXghrzSJWxP4a/t72jU29Vu2rvu4n7HfHkkmQOMGSS+NPeLGO5I73mC2B7+lMiBQQZRM9/9liLIfowupUFAbPBbR+lxDM6M8Ptgh1paJq5Rvs7yEuLQv/7d1oU2woFSb3FMPWQOKMuCuJ7pDDjpIclus5TeEoMBy2YdVB4fxmesaCeMNsEgTHKS5WDSGyNUOoEpcC2OFWtIRf0w27ck34/DjxRTVIcc9+kqZE6iMSiVDsiKdP/Xz5XfEhm/sBhO50p1rvJDlkyyxuJ9SPgs7YeUJBjXdeAkE+P9OQJm6SZnn1svcduI78dYmbkE2mtziPrcjVisXG78spLvbZaSFx/Rks9zP4LKn0Cdz/3JsetkT06A8f/yCgMO6Mb1Hme0JJ7b2wZz1qleqTuKBGokhPVUZ0dVu+tnQYNEY1fmkZSz6+EGZ5EzL7657mreZGR3jUfaEk458PDniBzsSmBKhDRzfXameryJv9/D5m6HIqZ0R+ouCE54Dzp4IJuuD1e4Dc5i+PpSORJfG23uVgqixAMDvchMR0nZdH5brclYwRoJRWv/rlxGRI5ffD5NPGmIDt7vDE1434pYdVZIFh89Bs94HGGJbTwrN8T6lh1HZFTOB4lWzWj6EVqxSMvC0/ljWBQ3F2kc/mO2b6tWonT2JEqEwFts8rz2h+oWNds9ceR2cb7zZvJTDppHaEhK5avWqsseWa2Dt5BBhabdWSktS80oMQrL4TvAM9b5HMmyDnO+OkkbMXfUJG7eXqTIG6lqSOEbqVR+qYdP7uWb57WEJqzyh411GAVsDinPs7KvUeXItlcMdOUWzXBH6zscymV1LLVCtc8IePojzXHF9m5b5zGwBRdzcyUJkiu938ApmAayRdJrX1PmVguWUvt2ThQ62czItTyWJMW2An/hdDfMK7SiFQlGIdAbltHz3ycoh7j9V7GxNWBpbtcSdqm4XxRwTawc3cbZ+xfSv9qQfEkDKfZTwCkqWGI/ur250ItXlMlh6vUNWEYIg9A3GzbgmbqvTN8js2YMo87CU5y6nZ4dbJLDQJj9fc7yM7tZzJDZFtqOcU8+mZjYlq4VmifI23iHb1ZoT9E+kT2dolnP1AfiOkt7PQCSykBiXy5mv637IegWSKj9IKrYZf4Lu9+I7ub+mkRdlvYzehh/jaJ9n7HUH5b2IbgeNdkY7wx1yVzxS7pbvky6+nmVUtRllEFfweUQ0/nG017WoUYSxs+j2B4FV/F62EtHlMWZXYrjGHpthnNb1x66LKZ0Qe92INWHdfR/vqp02wMS8r1G4dJqHok8KmQ7947G13a4YXbsGgHcBvRuVu1eAi4/A5+ZixmdSXM73LupB/LH7O9yxLTVXJTyBbI1S49TIROrfVCOb/czZ9pM4JsZx8kUz8dQGv7gUWKxXvTH7QM/3J2OuXXgciUhqY+cgtaOliQQVOYthBLV3xpESZT3rmfEYNZxmpBbb24CRao86prn+i9TNOh8VxRJGXJfXHATJHs1T5txgc/opYrY8XjlGQQbRcoxIBcnVsMjmU1ymmIUL4dviJXndMAJ0Yet+c7O52/p98ytlmAsGBaTAmMhimAnvp1TWNGM9BpuitGj+t810CU2UhorrjPKGtThVC8WaXw04WFnT5fTjqmPyrQ0tN3CkLsctVy2xr0ZWgiWVZ1OrlFjjxJYsOiZv2cAoOvE+7sY0I/TwWcZqMoyIKNOftwP7w++Rfg67ljfovKYa50if3fzE/8aPYVey/Nq35+nH2sLPh/fP5TsylSKGOZ4k69d2PnH43+kq++sRXHQqGArWdwhx+hpwQC6JgT2uxehYU4Zbw7oNb6/HLikPyJROGK2ouyr+vzseESp9G50T4AyFrSqOQ0rroCYP4sMDFBrHn342EyZTMlSyk47rHSq89Y9/nI3zG5lX16Z5lxphguLOcZUndL8wNcrkyjH82jqg8Bo8OYkynrxZvbFno5lUS3OPr8Ko3mX9NoRPdYOKKjD07bvgFgpZ/RF+YzkWvJ/Hs/tUbfeGzGWLxNAjfDzHHMVSDwB5SabQLsIZHiBp43FjGkaienYoDd18hu2BGwOK7U3o70K/WY/kuuKdmdrykIBUdG2mvE91L1JtTbh20mOLbk1vCAamu7utlXeGU2ooVikbU/actcgmsC1FKk2qmj3GWeIWbj4tGIxE7BLcBWUvvcnd/lYxsMV4F917fWeFB/XbINN3qGvIyTpCalz1lVewdIGqeAS/gB8Mi+sA+BqDiX3VGD2eUunTRbSY+AuDy4E3Qx3hAhwnSXX+B0zuj3eQ1miS8Vux2z/l6/BkWtjKGU72aJkOCWhGcSf3+kFkkB15vGOsQrSdFr6qTj0gBYiOlnBO41170gOWHSUoBVRU2JjwppYdhIFDfu7tIRHccSNM5KZOFDPz0TGMAjzzEpeLwTWp+kn201kU6NjbiMQJx83+LX1e1tZ10kuChJZ/XBUQ1dwaBHjTDJDqOympEk8X2M3VtVw21JksChA8w1tTefO3RJ1FMbqZ01bHHkudDB/OhLfe7P5GOHaI28ZXKTMuqo0hLWQ4HabBsGG7NbP1RiXtETz074er6w/OerJWEqjmkq2y51q1BVI+JUudnVa3ogBpzdhFE7fC7kybrAt2Z6RqDjATAUEYeYK45WMupBKQRtQlU+uNsjnzj6ZmGrezA+ASrWxQ6LMkHRXqXwNq7ftv28dUx/ZSJciDXP2SWJsWaN0FjPX9Yko6LobZ7aYW/IdUktI9apTLyHS8DyWPyuoZyxN1TK/vtfxk3HwWh6JczZC8Ftn0bIJay2g+n5wd7lm9rEsKO+svqVmi+c1j88hSCxbzrg4+HEP0Nt1/B6YW1XVm09T1CpAKjc9n18hjqsaFGdfyva1ZG0Xu3ip6N6JGpyTSqY5h4BOlpLPaOnyw45PdXTN+DtAKg7DLrLFTnWusoSBHk3s0d7YouJHq85/R09Tfc37ENXZF48eAYLnq9GLioNcwDZrC6FW6godB8JnqYUPvn0pWLfQz0lM0Yy8Mybgn84Ds3Q9bDP10bLyOV+qzxa4Rd9Dhu7cju8mMaONXK3UqmBQ9qIg7etIwEqM/kECk/Dzja4Bs1xR+Q/tCbc8IKrSGsTdJJ0vge7IG20W687uVmK6icWQ6cD3lwFzgNMGtFvO5qyJeKflGLAAcQZOrkxVwy3cWvqlGpvjmf9Qe6Ap20MPbV92DPV0OhFM4kz8Yr0ffC2zLWSQ1kqY6QdQrttR3kh1YLtQd1kCEv5hVoPIRWl5ERcUTttBIrWp6Xs5Ehh5OUUwI5aEBvuiDmUoENmnVw1FohCrbRp1A1E+XSlWVOTi7ADW+5Ohb9z1vK4qx5R5lPdGCPBJZ00mC+Ssp8VUbgpGAvXWMuWQQRbCqI6Rr2jtxZxtfP7W/8onz+yz0Gs76LaT5HX9ecyiZCB/ZR/gFtMxPsDwohoeCRtiuLxE1GM1vUEUgBv86+eehL58/P56QFGQ/MqOe/vC76L63jzmeax4exd/OKTUvkXg+fOJUHych9xt/9goJMrapSgvXrj8+8vk/N80f22Sewj6cyGqt1B6mztoeklVHHraouhvHJaG/OuBz6DHKMpFmQULU1bRWlyYE0RPXYYkUycIemN7TLtgNCJX6BqdyxDKkegO7nJK5xQ7OVYDZTMf9bVHidtk6DQX9Et+V9M7esgbsYBdEeUpsB0Xvw2kd9+rI7V+m47u+O/tq7mw7262HU1WlS9uFzsV6JxIHNmUCy0QS9e077JGRFbG65z3/dOKB/Zk+yDdKpUmdXjn/aS3N5nv4fK7bMHHmPlHd4E2+iTbV5rpzScRnxk6KARuDTJ8Q1LpK2mP8gj1EbuJ9RIyY+EWK4hCiIDBAS1Tm2IEXAFfgKPgdL9O6mAa06wjCcUAL6EsxPQWO9VNegBPm/0GgkZbDxCynxujX/92vmGcjZRMAY45puak2sFLCLSwXpEsyy5fnF0jGJBhm+fNSHKKUUfy+276A7/feLOFxxUuHRNJI2Osenxyvf8DAGObT60pfTTlhEg9u/KKkhJqm5U1/+BEcSkpFDA5XeCqxwXmPac1jcuZ3JWQ+p0NdWzb/5v1ZvF8GtMTFFEdQjpLO0bwPb0BHNWnip3liDXI2fXf05jjvfJ0NpjLCUgfTh9CMFYVFKEd4Z/OG/2C+N435mnK+9t1gvCiVcaaH7rK4+PjCvpVNiz+t2QyqH1O8x3JKZVl6Q+Lp/XK8wMjVMslOq9FdSw5FtUs/CptXH9PW+wbWHgrV17R5jTVOtGtKFu3nb80T+E0tv9QkzW3J2dbaw/8ddAKZ0pxIaEqLjlPrji3VgJ3GvdFvlqD8075woxh4fVt0JZE0KVFsAvqhe0dqN9b35jtSpnYMXkU+vZq+IAHad3IHc2s/LYrnD1anfG46IFiMIr9oNbZDWvwthqYNqOigaKd/XlLU4XHfk/PXIjPsLy/9/kAtQ+/wKH+hI/IROWj5FPvTZAT9f7j4ZXQyG4M0TujMAFXYkKvEHv1xhySekgXGGqNxWeWKlf8dDAlLuB1cb/qOD+rk7cmwt+1yKpk9cudqBanTi6zTbXRtV8qylNtjyOVKy1HTz0GW9rjt6sSjAZcT5R+KdtyYb0zyqG9pSLuCw5WBwAn7fjBjKLLoxLXMI+52L9cLwIR2B6OllJZLHJ8vDxmWdtF+QJnmt1rsHPIWY20lftk8fYePkAIg6Hgn532QoIpegMxiWgAOfe5/U44APR8Ac0NeZrVh3gEhs12W+tVSiWiUQekf/YBECUy5fdYbA08dd7VzPAP9aiVcIB9k6tY7WdJ1wNV+bHeydNtmC6G5ICtFC1ZwmJU/j8hf0I8TRVKSiz5oYIa93EpUI78X8GYIAZabx47/n8LDAAJ0nNtP1rpROprqKMBRecShca6qXuTSI3jZBLOB3Vp381B5rCGhjSvh/NSVkYp2qIdP/Bg="; +},"dec/dictionary-browser.js":function(e,t,r){var n=e("base64-js");r.init=function(){var t=e("./decode").BrotliDecompressBuffer,r=n.toByteArray(e("./dictionary.bin.js"));return t(r)}},"dec/huffman.js":function(e,t,r){function n(e,t){this.bits=e,this.value=t}function o(e,t){for(var r=1<<t-1;e&r;)r>>=1;return(e&r-1)+r}function a(e,t,r,o,a){do o-=r,e[t+o]=new n(a.bits,a.value);while(o>0)}function i(e,t,r){for(var n=1<<t-r;t<s&&(n-=e[t],!(n<=0));)++t,n<<=1;return t-r}r.HuffmanCode=n;const s=15;r.BrotliBuildHuffmanTable=function(e,t,r,d,l){var u,f,c,h,p,w,m,b,y,g,v,A=t,U=new Int32Array(16),x=new Int32Array(16);for(v=new Int32Array(l),c=0;c<l;c++)U[d[c]]++;for(x[1]=0,f=1;f<s;f++)x[f+1]=x[f]+U[f];for(c=0;c<l;c++)0!==d[c]&&(v[x[d[c]]++]=c);if(b=r,y=1<<b,g=y,1===x[s]){for(h=0;h<g;++h)e[t+h]=new n(0,65535&v[0]);return g}for(h=0,c=0,f=1,p=2;f<=r;++f,p<<=1)for(;U[f]>0;--U[f])u=new n(255&f,65535&v[c++]),a(e,t+h,p,y,u),h=o(h,f);for(m=g-1,w=-1,f=r+1,p=2;f<=s;++f,p<<=1)for(;U[f]>0;--U[f])(h&m)!==w&&(t+=y,b=i(U,f,r),y=1<<b,g+=y,w=h&m,e[A+w]=new n(b+r&255,t-A-w&65535)),u=new n(f-r&255,65535&v[c++]),a(e,t+(h>>r),p,y,u),h=o(h,f);return g}},"dec/prefix.js":function(e,t,r){function n(e,t){this.offset=e,this.nbits=t}r.kBlockLengthPrefixCode=[new n(1,2),new n(5,2),new n(9,2),new n(13,2),new n(17,3),new n(25,3),new n(33,3),new n(41,3),new n(49,4),new n(65,4),new n(81,4),new n(97,4),new n(113,5),new n(145,5),new n(177,5),new n(209,5),new n(241,6),new n(305,6),new n(369,7),new n(497,8),new n(753,9),new n(1265,10),new n(2289,11),new n(4337,12),new n(8433,13),new n(16625,24)],r.kInsertLengthPrefixCode=[new n(0,0),new n(1,0),new n(2,0),new n(3,0),new n(4,0),new n(5,0),new n(6,1),new n(8,1),new n(10,2),new n(14,2),new n(18,3),new n(26,3),new n(34,4),new n(50,4),new n(66,5),new n(98,5),new n(130,6),new n(194,7),new n(322,8),new n(578,9),new n(1090,10),new n(2114,12),new n(6210,14),new n(22594,24)],r.kCopyLengthPrefixCode=[new n(2,0),new n(3,0),new n(4,0),new n(5,0),new n(6,0),new n(7,0),new n(8,0),new n(9,0),new n(10,1),new n(12,1),new n(14,2),new n(18,2),new n(22,3),new n(30,3),new n(38,4),new n(54,4),new n(70,5),new n(102,5),new n(134,6),new n(198,7),new n(326,8),new n(582,9),new n(1094,10),new n(2118,24)],r.kInsertRangeLut=[0,0,8,8,0,16,8,16,16],r.kCopyRangeLut=[0,8,0,8,16,0,16,8,16]},"dec/streams.js":function(e,t,r){function n(e){this.buffer=e,this.pos=0}function o(e){this.buffer=e,this.pos=0}n.prototype.read=function(e,t,r){this.pos+r>this.buffer.length&&(r=this.buffer.length-this.pos);for(var n=0;n<r;n++)e[t+n]=this.buffer[this.pos+n];return this.pos+=r,r},r.BrotliInput=n,o.prototype.write=function(e,t){if(this.pos+t>this.buffer.length)throw new Error("Output buffer is not large enough");return this.buffer.set(e.subarray(0,t),this.pos),this.pos+=t,t},r.BrotliOutput=o},"dec/transform.js":function(e,t,r){function n(e,t,r){this.prefix=new Uint8Array(e.length),this.transform=t,this.suffix=new Uint8Array(r.length);for(var n=0;n<e.length;n++)this.prefix[n]=e.charCodeAt(n);for(var n=0;n<r.length;n++)this.suffix[n]=r.charCodeAt(n)}function o(e,t){return e[t]<192?(e[t]>=97&&e[t]<=122&&(e[t]^=32),1):e[t]<224?(e[t+1]^=32,2):(e[t+2]^=5,3)}var a=e("./dictionary");const i=0,s=1,d=2,l=3,u=4,f=5,c=6,h=7,p=8,w=9,m=10,b=11,y=12,g=13,v=14,A=15,U=16,x=17,E=18,k=20;var B=[new n("",i,""),new n("",i," "),new n(" ",i," "),new n("",y,""),new n("",m," "),new n("",i," the "),new n(" ",i,""),new n("s ",i," "),new n("",i," of "),new n("",m,""),new n("",i," and "),new n("",g,""),new n("",s,""),new n(", ",i," "),new n("",i,", "),new n(" ",m," "),new n("",i," in "),new n("",i," to "),new n("e ",i," "),new n("",i,'"'),new n("",i,"."),new n("",i,'">'),new n("",i,"\n"),new n("",l,""),new n("",i,"]"),new n("",i," for "),new n("",v,""),new n("",d,""),new n("",i," a "),new n("",i," that "),new n(" ",m,""),new n("",i,". "),new n(".",i,""),new n(" ",i,", "),new n("",A,""),new n("",i," with "),new n("",i,"'"),new n("",i," from "),new n("",i," by "),new n("",U,""),new n("",x,""),new n(" the ",i,""),new n("",u,""),new n("",i,". The "),new n("",b,""),new n("",i," on "),new n("",i," as "),new n("",i," is "),new n("",h,""),new n("",s,"ing "),new n("",i,"\n\t"),new n("",i,":"),new n(" ",i,". "),new n("",i,"ed "),new n("",k,""),new n("",E,""),new n("",c,""),new n("",i,"("),new n("",m,", "),new n("",p,""),new n("",i," at "),new n("",i,"ly "),new n(" the ",i," of "),new n("",f,""),new n("",w,""),new n(" ",m,", "),new n("",m,'"'),new n(".",i,"("),new n("",b," "),new n("",m,'">'),new n("",i,'="'),new n(" ",i,"."),new n(".com/",i,""),new n(" the ",i," of the "),new n("",m,"'"),new n("",i,". This "),new n("",i,","),new n(".",i," "),new n("",m,"("),new n("",m,"."),new n("",i," not "),new n(" ",i,'="'),new n("",i,"er "),new n(" ",b," "),new n("",i,"al "),new n(" ",b,""),new n("",i,"='"),new n("",b,'"'),new n("",m,". "),new n(" ",i,"("),new n("",i,"ful "),new n(" ",m,". "),new n("",i,"ive "),new n("",i,"less "),new n("",b,"'"),new n("",i,"est "),new n(" ",m,"."),new n("",b,'">'),new n(" ",i,"='"),new n("",m,","),new n("",i,"ize "),new n("",b,"."),new n("\xc2\xa0",i,""),new n(" ",i,","),new n("",m,'="'),new n("",b,'="'),new n("",i,"ous "),new n("",b,", "),new n("",m,"='"),new n(" ",m,","),new n(" ",b,'="'),new n(" ",b,", "),new n("",b,","),new n("",b,"("),new n("",b,". "),new n(" ",b,"."),new n("",b,"='"),new n(" ",b,". "),new n(" ",m,'="'),new n(" ",b,"='"),new n(" ",m,"='")];r.kTransforms=B,r.kNumTransforms=B.length,r.transformDictionaryWord=function(e,t,r,n,i){var s,d=B[i].prefix,l=B[i].suffix,u=B[i].transform,f=u<y?0:u-11,c=0,h=t;f>n&&(f=n);for(var p=0;p<d.length;)e[t++]=d[p++];for(r+=f,n-=f,u<=w&&(n-=u),c=0;c<n;c++)e[t++]=a.dictionary[r+c];if(s=t-n,u===m)o(e,s);else if(u===b)for(;n>0;){var g=o(e,s);s+=g,n-=g}for(var v=0;v<l.length;)e[t++]=l[v++];return t-h}},"node_modules/base64-js/index.js":function(e,t,r){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function o(e){return 3*e.length/4-n(e)}function a(e){var t,r,o,a,i,s,d=e.length;i=n(e),s=new f(3*d/4-i),o=i>0?d-4:d;var l=0;for(t=0,r=0;t<o;t+=4,r+=3)a=u[e.charCodeAt(t)]<<18|u[e.charCodeAt(t+1)]<<12|u[e.charCodeAt(t+2)]<<6|u[e.charCodeAt(t+3)],s[l++]=a>>16&255,s[l++]=a>>8&255,s[l++]=255&a;return 2===i?(a=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,s[l++]=255&a):1===i&&(a=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,s[l++]=a>>8&255,s[l++]=255&a),s}function i(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}function s(e,t,r){for(var n,o=[],a=t;a<r;a+=3)n=(e[a]<<16)+(e[a+1]<<8)+e[a+2],o.push(i(n));return o.join("")}function d(e){for(var t,r=e.length,n=r%3,o="",a=[],i=16383,d=0,u=r-n;d<u;d+=i)a.push(s(e,d,d+i>u?u:d+i));return 1===n?(t=e[r-1],o+=l[t>>2],o+=l[t<<4&63],o+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],o+=l[t>>10],o+=l[t>>4&63],o+=l[t<<2&63],o+="="),a.push(o),a.join("")}r.byteLength=o,r.toByteArray=a,r.fromByteArray=d;for(var l=[],u=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,p=c.length;h<p;++h)l[h]=c[h],u[c.charCodeAt(h)]=h;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63}};for(var r in t)t[r].folder=r.substring(0,r.lastIndexOf("/")+1);var n=function(e){var r=[];return e=e.split("/").every(function(e){return".."==e?r.pop():"."==e||""==e||r.push(e)})?r.join("/"):null,e?t[e]||t[e+".js"]||t[e+"/index.js"]:null},o=function(e,t){return e?n(e.folder+"node_modules/"+t)||o(e.parent,t):null},a=function(e,t){var r=t.match(/^\//)?null:e?t.match(/^\.\.?\//)?n(e.folder+t):o(e,t):n(t);if(!r)throw"module not found: "+t;return r.exports||(r.parent=e,r(a.bind(null,r),r,r.exports={})),r.exports};return a(null,e)},decompress:function(e){this.exports||(this.exports=this.require("decompress.js"));try{return this.exports(e)}catch(e){}},hasUnityMarker:function(e){var t="UnityWeb Compressed Content (brotli)";if(!e.length)return!1;var r=1&e[0]?14&e[0]?4:7:1,n=e[0]&(1<<r)-1,o=1+(Math.log(t.length-1)/Math.log(2)>>3);if(commentOffset=r+1+2+1+2+(o<<3)+7>>3,17==n||commentOffset>e.length)return!1;for(var a=n+(6+(o<<4)+(t.length-1<<6)<<r),i=0;i<commentOffset;i++,a>>>=8)if(e[i]!=(255&a))return!1;return String.fromCharCode.apply(null,e.subarray(commentOffset,commentOffset+t.length))==t}},decompress:function(e,t){var r=this.gzip.hasUnityMarker(e)?this.gzip:this.brotli.hasUnityMarker(e)?this.brotli:this.identity;if(this.serverSetupWarningEnabled&&r!=this.identity&&(console.log("You can reduce your startup time if you configure your web server to host .unityweb files using "+(r==this.gzip?"gzip":"brotli")+" compression."),this.serverSetupWarningEnabled=!1),"function"!=typeof t)return r.decompress(e);if(!r.worker){var n=URL.createObjectURL(new Blob(["this.require = ",r.require.toString(),"; this.decompress = ",r.decompress.toString(),"; this.onmessage = ",function(e){var t={id:e.data.id,decompressed:this.decompress(e.data.compressed)};postMessage(t,t.decompressed?[t.decompressed.buffer]:[])}.toString(),"; postMessage({ ready: true });"],{type:"text/javascript"}));r.worker=new Worker(n),r.worker.onmessage=function(e){return e.data.ready?void URL.revokeObjectURL(n):(this.callbacks[e.data.id](e.data.decompressed),void delete this.callbacks[e.data.id])},r.worker.callbacks={},r.worker.nextCallbackId=0}var o=r.worker.nextCallbackId++;r.worker.callbacks[o]=t,r.worker.postMessage({id:o,compressed:e},[e.buffer])},serverSetupWarningEnabled:!0}}; \ No newline at end of file diff --git a/public/Roll-a-ball/TemplateData/UnityProgress.js b/public/Roll-a-ball/TemplateData/UnityProgress.js new file mode 100644 index 0000000000000000000000000000000000000000..1ed4372addbb098d3184e95c569cfaba209016c2 --- /dev/null +++ b/public/Roll-a-ball/TemplateData/UnityProgress.js @@ -0,0 +1,24 @@ +function UnityProgress(gameInstance, progress) { + if (!gameInstance.Module) + return; + if (!gameInstance.logo) { + gameInstance.logo = document.createElement("div"); + gameInstance.logo.className = "logo " + gameInstance.Module.splashScreenStyle; + gameInstance.container.appendChild(gameInstance.logo); + } + if (!gameInstance.progress) { + gameInstance.progress = document.createElement("div"); + gameInstance.progress.className = "progress " + gameInstance.Module.splashScreenStyle; + gameInstance.progress.empty = document.createElement("div"); + gameInstance.progress.empty.className = "empty"; + gameInstance.progress.appendChild(gameInstance.progress.empty); + gameInstance.progress.full = document.createElement("div"); + gameInstance.progress.full.className = "full"; + gameInstance.progress.appendChild(gameInstance.progress.full); + gameInstance.container.appendChild(gameInstance.progress); + } + gameInstance.progress.full.style.width = (100 * progress) + "%"; + gameInstance.progress.empty.style.width = (100 * (1 - progress)) + "%"; + if (progress == 1) + gameInstance.logo.style.display = gameInstance.progress.style.display = "none"; +} \ No newline at end of file diff --git a/public/Roll-a-ball/TemplateData/favicon.ico b/public/Roll-a-ball/TemplateData/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..dd6bf7e9cec4d87389fad00e34cd385321d748e1 Binary files /dev/null and b/public/Roll-a-ball/TemplateData/favicon.ico differ diff --git a/public/Roll-a-ball/TemplateData/fullscreen.png b/public/Roll-a-ball/TemplateData/fullscreen.png new file mode 100644 index 0000000000000000000000000000000000000000..22cfc35fdb3c4986288d1f66366504ea81247a68 Binary files /dev/null and b/public/Roll-a-ball/TemplateData/fullscreen.png differ diff --git a/public/Roll-a-ball/TemplateData/progressEmpty.Dark.png b/public/Roll-a-ball/TemplateData/progressEmpty.Dark.png new file mode 100644 index 0000000000000000000000000000000000000000..eff47305a245c043af40c2dc4354b9a29691acd9 Binary files /dev/null and b/public/Roll-a-ball/TemplateData/progressEmpty.Dark.png differ diff --git a/public/Roll-a-ball/TemplateData/progressEmpty.Light.png b/public/Roll-a-ball/TemplateData/progressEmpty.Light.png new file mode 100644 index 0000000000000000000000000000000000000000..b428ec4cd00b0049dac1621949565190e5b6de72 Binary files /dev/null and b/public/Roll-a-ball/TemplateData/progressEmpty.Light.png differ diff --git a/public/Roll-a-ball/TemplateData/progressFull.Dark.png b/public/Roll-a-ball/TemplateData/progressFull.Dark.png new file mode 100644 index 0000000000000000000000000000000000000000..3e5c8a0bd68cfcfb93e2530e71a40610fddcda8c Binary files /dev/null and b/public/Roll-a-ball/TemplateData/progressFull.Dark.png differ diff --git a/public/Roll-a-ball/TemplateData/progressFull.Light.png b/public/Roll-a-ball/TemplateData/progressFull.Light.png new file mode 100644 index 0000000000000000000000000000000000000000..0064427ceed881c7fc798002113f1eed863f8d8e Binary files /dev/null and b/public/Roll-a-ball/TemplateData/progressFull.Light.png differ diff --git a/public/Roll-a-ball/TemplateData/progressLogo.Dark.png b/public/Roll-a-ball/TemplateData/progressLogo.Dark.png new file mode 100644 index 0000000000000000000000000000000000000000..c15fb23d284d5c0434e69b8c69844e17a2e73421 Binary files /dev/null and b/public/Roll-a-ball/TemplateData/progressLogo.Dark.png differ diff --git a/public/Roll-a-ball/TemplateData/progressLogo.Light.png b/public/Roll-a-ball/TemplateData/progressLogo.Light.png new file mode 100644 index 0000000000000000000000000000000000000000..cdd4f742d6eb7a3a89816e297848b8e99c5dbf5b Binary files /dev/null and b/public/Roll-a-ball/TemplateData/progressLogo.Light.png differ diff --git a/public/Roll-a-ball/TemplateData/style.css b/public/Roll-a-ball/TemplateData/style.css new file mode 100644 index 0000000000000000000000000000000000000000..04ef4a1a0002372db51a6b88d8a28e302f4607b6 --- /dev/null +++ b/public/Roll-a-ball/TemplateData/style.css @@ -0,0 +1,18 @@ +.webgl-content * {border: 0; margin: 0; padding: 0} +.webgl-content {position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);} + +.webgl-content .logo, .progress {position: absolute; left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);} +.webgl-content .logo {background: url('progressLogo.Light.png') no-repeat center / contain; width: 154px; height: 130px;} +.webgl-content .progress {height: 18px; width: 141px; margin-top: 90px;} +.webgl-content .progress .empty {background: url('progressEmpty.Light.png') no-repeat right / cover; float: right; width: 100%; height: 100%; display: inline-block;} +.webgl-content .progress .full {background: url('progressFull.Light.png') no-repeat left / cover; float: left; width: 0%; height: 100%; display: inline-block;} + +.webgl-content .logo.Dark {background-image: url('progressLogo.Dark.png');} +.webgl-content .progress.Dark .empty {background-image: url('progressEmpty.Dark.png');} +.webgl-content .progress.Dark .full {background-image: url('progressFull.Dark.png');} + +.webgl-content .footer {margin-top: 5px; height: 38px; line-height: 38px; font-family: Helvetica, Verdana, Arial, sans-serif; font-size: 18px;} +.webgl-content .footer .webgl-logo, .title, .fullscreen {height: 100%; display: inline-block; background: transparent center no-repeat;} +.webgl-content .footer .webgl-logo {background-image: url('webgl-logo.png'); width: 204px; float: left;} +.webgl-content .footer .title {margin-right: 10px; float: right;} +.webgl-content .footer .fullscreen {background-image: url('fullscreen.png'); width: 38px; float: right;} \ No newline at end of file diff --git a/public/Roll-a-ball/TemplateData/webgl-logo.png b/public/Roll-a-ball/TemplateData/webgl-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..8af9ba61d8b8f28d19839c70de91f50716f3eb75 Binary files /dev/null and b/public/Roll-a-ball/TemplateData/webgl-logo.png differ diff --git a/public/Roll-a-ball/index.html b/public/Roll-a-ball/index.html new file mode 100644 index 0000000000000000000000000000000000000000..36c98c267b37e11e975cfa32ab370677fd88f319 --- /dev/null +++ b/public/Roll-a-ball/index.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html lang="en-us"> + <head> + <meta charset="utf-8"> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <title>Unity WebGL Player | Roll-a-ball</title> + <link rel="shortcut icon" href="TemplateData/favicon.ico"> + <link rel="stylesheet" href="TemplateData/style.css"> + <script src="TemplateData/UnityProgress.js"></script> + <script src="Build/UnityLoader.js"></script> + <script> + var gameInstance = UnityLoader.instantiate("gameContainer", "Build/Builds.json", {onProgress: UnityProgress}); + </script> + </head> + <body> + <div class="webgl-content"> + <div id="gameContainer" style="width: 960px; height: 600px"></div> + <div class="footer"> + <div class="webgl-logo"></div> + <div class="fullscreen" onclick="gameInstance.SetFullscreen(1)"></div> + <div class="title">Roll-a-ball</div> + </div> + </div> + </body> +</html> \ No newline at end of file diff --git a/public/Survival-shooter/Builds/index.html b/public/Survival-shooter/Builds/index.html new file mode 100644 index 0000000000000000000000000000000000000000..e6679bc3e7ef79b805b6d41921b229eaf109f0a7 --- /dev/null +++ b/public/Survival-shooter/Builds/index.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html lang="en-us"> + <head> + <meta charset="utf-8"> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <title>Unity WebGL Player | New Unity Project</title> + <link rel="shortcut icon" href="TemplateData/favicon.ico"> + <link rel="stylesheet" href="TemplateData/style.css"> + <script src="TemplateData/UnityProgress.js"></script> + <script src="Build/UnityLoader.js"></script> + <script> + var gameInstance = UnityLoader.instantiate("gameContainer", "Build/Builds.json", {onProgress: UnityProgress}); + </script> + </head> + <body> + <div class="webgl-content"> + <div id="gameContainer" style="width: 960px; height: 600px"></div> + <div class="footer"> + <div class="webgl-logo"></div> + <div class="fullscreen" onclick="gameInstance.SetFullscreen(1)"></div> + <div class="title">New Unity Project</div> + </div> + </div> + </body> +</html> \ No newline at end of file diff --git a/public/phaser-harkat/.gitkeep b/public/phaser-harkat/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/public/phaser-harkat/phaser-tutoriaali/assets/bomb.png b/public/phaser-harkat/phaser-tutoriaali/assets/bomb.png new file mode 100644 index 0000000000000000000000000000000000000000..28a0fbbddc37fd0a6872bbd170cbebdc81e7f597 Binary files /dev/null and b/public/phaser-harkat/phaser-tutoriaali/assets/bomb.png differ diff --git a/public/phaser-harkat/phaser-tutoriaali/assets/dude.png b/public/phaser-harkat/phaser-tutoriaali/assets/dude.png new file mode 100644 index 0000000000000000000000000000000000000000..6b35f4b4b1b00e757700e0852b8527200e82c538 Binary files /dev/null and b/public/phaser-harkat/phaser-tutoriaali/assets/dude.png differ diff --git a/public/phaser-harkat/phaser-tutoriaali/assets/platform.png b/public/phaser-harkat/phaser-tutoriaali/assets/platform.png new file mode 100644 index 0000000000000000000000000000000000000000..1e4a3f86d7311592c4fdd257daaf21db4176dd21 Binary files /dev/null and b/public/phaser-harkat/phaser-tutoriaali/assets/platform.png differ diff --git a/public/phaser-harkat/phaser-tutoriaali/assets/sky.png b/public/phaser-harkat/phaser-tutoriaali/assets/sky.png new file mode 100644 index 0000000000000000000000000000000000000000..5972639f229c7362edac856b42b86b93811ef3f2 Binary files /dev/null and b/public/phaser-harkat/phaser-tutoriaali/assets/sky.png differ diff --git a/public/phaser-harkat/phaser-tutoriaali/assets/star.png b/public/phaser-harkat/phaser-tutoriaali/assets/star.png new file mode 100644 index 0000000000000000000000000000000000000000..bfc2d298426648f2a31e48db711b84a9962af703 Binary files /dev/null and b/public/phaser-harkat/phaser-tutoriaali/assets/star.png differ diff --git a/public/phaser-harkat/phaser-tutoriaali/index.html b/public/phaser-harkat/phaser-tutoriaali/index.html new file mode 100644 index 0000000000000000000000000000000000000000..1ce3c2c567ccf12d4250989091d99be32754c944 --- /dev/null +++ b/public/phaser-harkat/phaser-tutoriaali/index.html @@ -0,0 +1,197 @@ +<!doctype html> +<html lang="en"> +<head> + <meta charset="UTF-8" /> + <title>Making your first Phaser 3 Game - Part 1</title> + <script src="//cdn.jsdelivr.net/npm/phaser@3.11.0/dist/phaser.js"></script> + <style type="text/css"> + body { + margin: 0; + } + </style> +</head> +<body> + +<script type="text/javascript"> + + var config = { + type: Phaser.AUTO, + width: 800, + height: 600, + physics: { + default: 'arcade', + arcade: { + gravity: { y: 300 }, + debug: false + } + }, + scene: { + preload: preload, + create: create, + update: update + } + }; + var score = 0; + var scoreText; + var game = new Phaser.Game(config); + + function preload () + { + //ladataan alussa, ei vielä näytetä mitään + this.load.image('sky', 'assets/sky.png'); + this.load.image('ground', 'assets/platform.png'); + this.load.image('star', 'assets/star.png'); + this.load.image('bomb', 'assets/bomb.png'); + this.load.spritesheet('dude', + 'assets/dude.png', + { frameWidth: 32, frameHeight: 48 } + ); + } + + function create () + { + //lisätään grafiikka peliin + this.add.image(400, 300, 'sky'); + + // + platforms = this.physics.add.staticGroup(); + + platforms.create(400, 568, 'ground').setScale(2).refreshBody(); + + platforms.create(600, 400, 'ground'); + platforms.create(50, 250, 'ground'); + platforms.create(750, 220, 'ground'); + + //luodaan pelaaja + player = this.physics.add.sprite(100, 450, 'dude'); + + //määritellään fysiikat + player.setBounce(0.2); //pelaaja pomppii kun osuu maahan + player.setCollideWorldBounds(true); //estetään pääsy pelimaailman ulkopuolelle + player.body.setGravityY(500); //simuloidaan painovoimaa + + //määritetään animaatiot + //pelihahmo ladattu spritesheettinä, joten määritetään mitä frameja käytetään + this.anims.create({ + key: 'left', + frames: this.anims.generateFrameNumbers('dude', { start: 0, end: 3 }), + frameRate: 10, + repeat: -1 + }); + + this.anims.create({ + key: 'turn', + frames: [ { key: 'dude', frame: 4 } ], + frameRate: 20 + }); + + this.anims.create({ + key: 'right', + frames: this.anims.generateFrameNumbers('dude', { start: 5, end: 8 }), + frameRate: 10, + repeat: -1 + }); + + //collision-testi + this.physics.add.collider(player, platforms); + + //input + cursors = this.input.keyboard.createCursorKeys(); + + stars = this.physics.add.group({ + key: 'star', + repeat: 11, + setXY: { x: 12, y: 0, stepX: 70 } + }); + + stars.children.iterate(function (child) { + + child.setBounceY(Phaser.Math.FloatBetween(0.4, 0.8)); + + }); + + //tähtien collisionit + this.physics.add.collider(stars, platforms); + this.physics.add.overlap(player, stars, collectStar, null, this); + + //score + scoreText = this.add.text(16, 16, 'score: 0', { fontSize: '32px', fill: '#000', fontFamily: 'arial' }); + + //viholliset + bombs = this.physics.add.group(); + + this.physics.add.collider(bombs, platforms); + + this.physics.add.collider(player, bombs, hitBomb, null, this); + + } + + function update () + { + //perusliikkuminen, + if (cursors.left.isDown) + { + player.setVelocityX(-300); + + player.anims.play('left', true); + } + else if (cursors.right.isDown) + { + player.setVelocityX(300); + + player.anims.play('right', true); + } + else + { + player.setVelocityX(0); + + player.anims.play('turn'); + } + + if (cursors.up.isDown && player.body.touching.down) + { + player.setVelocityY(-630); + } + } + + //pelaajan ja tähden collision => poistetaan tähti ja annetaan pisteitä + function collectStar (player, star) + { + star.disableBody(true, true); + + score += 10; + scoreText.setText('Score: ' + score); + + //mikäli tähtiä ei jäljellä, spawnataan pommit ja päästetään helvetti irti + if (stars.countActive(true) === 0) + { + stars.children.iterate(function (child) { + + child.enableBody(true, child.x, 0, true, true); + + }); + + var x = (player.x < 400) ? Phaser.Math.Between(400, 800) : Phaser.Math.Between(0, 400); + + var bomb = bombs.create(x, 16, 'bomb'); + bomb.setBounce(1); + bomb.setCollideWorldBounds(true); + bomb.setVelocity(Phaser.Math.Between(-200, 200), 20); + } + } + + //pelaajan ja pommin collision + function hitBomb (player, bomb) + { + this.physics.pause(); + + player.setTint(0xff0000); + + player.anims.play('turn'); + + gameOver = true; + } +</script> + +</body> +</html> \ No newline at end of file diff --git a/public/phaser-harkat/phaser-udemy/assets/backgrounds/sunset.png b/public/phaser-harkat/phaser-udemy/assets/backgrounds/sunset.png new file mode 100644 index 0000000000000000000000000000000000000000..292057294294bb945238ff6c67b1c9595a21e913 Binary files /dev/null and b/public/phaser-harkat/phaser-udemy/assets/backgrounds/sunset.png differ diff --git a/public/phaser-harkat/phaser-udemy/assets/sounds/audio.mp3 b/public/phaser-harkat/phaser-udemy/assets/sounds/audio.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..554006c32cd35394418f5606eb21b6ab0024b40f Binary files /dev/null and b/public/phaser-harkat/phaser-udemy/assets/sounds/audio.mp3 differ diff --git a/public/phaser-harkat/phaser-udemy/assets/sounds/audio.wav b/public/phaser-harkat/phaser-udemy/assets/sounds/audio.wav new file mode 100644 index 0000000000000000000000000000000000000000..032641a52e347ff43efef297a59ac0f26acd57af Binary files /dev/null and b/public/phaser-harkat/phaser-udemy/assets/sounds/audio.wav differ diff --git a/public/phaser-harkat/phaser-udemy/assets/sprites/New Bitmap Image.bmp b/public/phaser-harkat/phaser-udemy/assets/sprites/New Bitmap Image.bmp new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/public/phaser-harkat/phaser-udemy/assets/sprites/armeija_apustus.png b/public/phaser-harkat/phaser-udemy/assets/sprites/armeija_apustus.png new file mode 100644 index 0000000000000000000000000000000000000000..d8f3f66459c9c2719119d34a50734701d1fe110d Binary files /dev/null and b/public/phaser-harkat/phaser-udemy/assets/sprites/armeija_apustus.png differ diff --git a/public/phaser-harkat/phaser-udemy/assets/sprites/arrow.png b/public/phaser-harkat/phaser-udemy/assets/sprites/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..62ba58949c44591f9749ed68cb9764d50feb60db Binary files /dev/null and b/public/phaser-harkat/phaser-udemy/assets/sprites/arrow.png differ diff --git a/public/phaser-harkat/phaser-udemy/assets/sprites/rakenus_apustus.jpg b/public/phaser-harkat/phaser-udemy/assets/sprites/rakenus_apustus.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a900f10cc1d1ae86d0ddd21c9fc1acb504ddd98d Binary files /dev/null and b/public/phaser-harkat/phaser-udemy/assets/sprites/rakenus_apustus.jpg differ diff --git a/public/phaser-harkat/phaser-udemy/assets/sprites/saber.png b/public/phaser-harkat/phaser-udemy/assets/sprites/saber.png new file mode 100644 index 0000000000000000000000000000000000000000..2b0388009f95c39916828391ee7b98b521b81dd8 Binary files /dev/null and b/public/phaser-harkat/phaser-udemy/assets/sprites/saber.png differ diff --git "a/public/phaser-harkat/phaser-udemy/assets/sprites/t\303\244r\303\244nt\303\244nk\303\266.jpg" "b/public/phaser-harkat/phaser-udemy/assets/sprites/t\303\244r\303\244nt\303\244nk\303\266.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..999552c9c2a88ad8d6cddb61728dea6a7563e42c Binary files /dev/null and "b/public/phaser-harkat/phaser-udemy/assets/sprites/t\303\244r\303\244nt\303\244nk\303\266.jpg" differ diff --git a/public/phaser-harkat/phaser-udemy/assets/spritesheets/saberSheet.png b/public/phaser-harkat/phaser-udemy/assets/spritesheets/saberSheet.png new file mode 100644 index 0000000000000000000000000000000000000000..52fff7aca1338f414f558e559e0d9fc90387d7bc Binary files /dev/null and b/public/phaser-harkat/phaser-udemy/assets/spritesheets/saberSheet.png differ diff --git a/public/phaser-harkat/phaser-udemy/assets/tilemaps/grass.png b/public/phaser-harkat/phaser-udemy/assets/tilemaps/grass.png new file mode 100644 index 0000000000000000000000000000000000000000..fa4d554aeb4a7721adc64f35eb8d427491ad15fd Binary files /dev/null and b/public/phaser-harkat/phaser-udemy/assets/tilemaps/grass.png differ diff --git a/public/phaser-harkat/phaser-udemy/assets/tilemaps/ground.png b/public/phaser-harkat/phaser-udemy/assets/tilemaps/ground.png new file mode 100644 index 0000000000000000000000000000000000000000..b34d357d4adfac69f1d4a5ba27c6f50d6869ad78 Binary files /dev/null and b/public/phaser-harkat/phaser-udemy/assets/tilemaps/ground.png differ diff --git a/public/phaser-harkat/phaser-udemy/assets/tilemaps/lava.png b/public/phaser-harkat/phaser-udemy/assets/tilemaps/lava.png new file mode 100644 index 0000000000000000000000000000000000000000..7375508ac477218996853fb42efa189005bf0968 Binary files /dev/null and b/public/phaser-harkat/phaser-udemy/assets/tilemaps/lava.png differ diff --git a/public/phaser-harkat/phaser-udemy/assets/tilemaps/lavarock.png b/public/phaser-harkat/phaser-udemy/assets/tilemaps/lavarock.png new file mode 100644 index 0000000000000000000000000000000000000000..516b67ca6bfbfcc30ab1d0615b205c47787cf598 Binary files /dev/null and b/public/phaser-harkat/phaser-udemy/assets/tilemaps/lavarock.png differ diff --git a/public/phaser-harkat/phaser-udemy/assets/tilemaps/state1Tilemap.json b/public/phaser-harkat/phaser-udemy/assets/tilemaps/state1Tilemap.json new file mode 100644 index 0000000000000000000000000000000000000000..1f7f0e2fb938bf897741b85776932750c68db614 --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/assets/tilemaps/state1Tilemap.json @@ -0,0 +1,91 @@ +{ "height":31, + "infinite":false, + "layers":[ + { + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 3, 3, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 3, 2, 3, 1, 1, 1, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 2, 2, 1, 1, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 2, 2, 3, 3, 3, 2, 2, 2, 2, 2, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 3, 3, 2, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 3, 3, 3, 5, 5, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 3, 3, 3, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 2, 2, 3, 3, 3, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 2, 2, 2, 1, 1, 3, 1, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 5, 5, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 2, 2, 2, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 5, 0, 0, 0, 5, 0, 0, 0, 0, 0, 5, 5, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 2, 2, 2, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 3, 5, 5, 5, 5, 5, 2, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 3, 3, 3, 3, 1, 1, 2, 3, 3, 3, 2, 3, 3, 3, 2, 1, 1, 1, 2, 2, 2, 2, 2, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 1, 1, 1, 2, 2, 3, 3, 3, 2, 3, 3, 1, 1, 1, 2, 2, 2, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 2, 2, 5, 5, 3, 2, 2, 3, 3, 2, 2, 2, 2, 2, 3, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 2, 2, 3, 3, 2, 2, 2, 2, 2, 3, 5, 5, 5, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 2, 3, 2, 2, 3, 3, 3, 5, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 2, 3, 5, 3, 5, 5, 5, 0, 0, 0, 0, 5, 5, 5, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 3, 3, 2, 5, 5, 5, 0, 0, 0, 5, 5, 2, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 3, 2, 3, 5, 5, 5, 5, 5, 5, 2, 2, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 5, 5, 5, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 5, 0, 0, 0, 0, 5, 0, 0, 0, 5, 0, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 0, 5, 5, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 1, 1, 5, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 5, 3, 3, 3, 3, 5, 5, 3, 3, 3, 3, 3, 2, 2, 3, 2, 2, 2, 1, 1, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 5, 0, 5, 0, 0, 0, 0, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 3, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":31, + "id":1, + "name":"groundLayer", + "opacity":0.81, + "type":"tilelayer", + "visible":true, + "width":42, + "x":0, + "y":0 + }, + { + "data":[4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 4, 4, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 0, 4, 4, 4, 0, 4, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 4, 0, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], + "height":31, + "id":2, + "name":"lavaLayer", + "opacity":0.39, + "type":"tilelayer", + "visible":true, + "width":42, + "x":0, + "y":0 + }], + "nextlayerid":3, + "nextobjectid":1, + "orientation":"orthogonal", + "renderorder":"right-down", + "tiledversion":"1.2.2", + "tileheight":32, + "tilesets":[ + { + "columns":1, + "firstgid":1, + "image":"grass.png", + "imageheight":32, + "imagewidth":32, + "margin":0, + "name":"grass", + "spacing":0, + "tilecount":1, + "tileheight":32, + "tilewidth":32 + }, + { + "columns":1, + "firstgid":2, + "image":"ground.png", + "imageheight":64, + "imagewidth":32, + "margin":0, + "name":"ground", + "spacing":0, + "tilecount":2, + "tileheight":32, + "tilewidth":32 + }, + { + "columns":1, + "firstgid":4, + "image":"lava.png", + "imageheight":32, + "imagewidth":32, + "margin":0, + "name":"lava", + "spacing":0, + "tilecount":1, + "tileheight":32, + "tilewidth":32 + }, + { + "columns":1, + "firstgid":5, + "image":"lavarock.png", + "imageheight":32, + "imagewidth":32, + "margin":0, + "name":"lavarock", + "spacing":0, + "tilecount":1, + "tileheight":32, + "tilewidth":32 + }], + "tilewidth":32, + "type":"map", + "version":1.2, + "width":42 +} \ No newline at end of file diff --git a/public/phaser-harkat/phaser-udemy/assets/tilemaps/state1Tilemap.tmx b/public/phaser-harkat/phaser-udemy/assets/tilemaps/state1Tilemap.tmx new file mode 100644 index 0000000000000000000000000000000000000000..75c3201d037bb81046035d2ae0ce22185f503266 --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/assets/tilemaps/state1Tilemap.tmx @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<map version="1.2" tiledversion="1.2.2" orientation="orthogonal" renderorder="right-down" width="42" height="31" tilewidth="32" tileheight="32" infinite="0" nextlayerid="3" nextobjectid="1"> + <tileset firstgid="1" name="grass" tilewidth="32" tileheight="32" tilecount="1" columns="1"> + <image source="grass.png" width="32" height="32"/> + </tileset> + <tileset firstgid="2" name="ground" tilewidth="32" tileheight="32" tilecount="2" columns="1"> + <image source="ground.png" width="32" height="64"/> + </tileset> + <tileset firstgid="4" name="lava" tilewidth="32" tileheight="32" tilecount="1" columns="1"> + <image source="lava.png" width="32" height="32"/> + </tileset> + <tileset firstgid="5" name="lavarock" tilewidth="32" tileheight="32" tilecount="1" columns="1"> + <image source="lavarock.png" width="32" height="32"/> + </tileset> + <layer id="1" name="groundLayer" width="42" height="31" opacity="0.81"> + <data encoding="csv"> +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,3,3,5,5,5,0, +0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,3,3,3,3,3,3,3,0,5,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,3,3,2,3,1,1,1,3,3,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,2,2,1,1,3,3,3,3,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,5,5,2,2,3,3,3,2,2,2,2,2,5,5,5,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,3,3,2,5,5,5,3,5,5,5,5,5,5,5,5,0, +0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,3,3,3,5,5,0,0,5,5,5,5,5,5,5,5,5,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,3,3,3,3,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,5,5,5,2,2,3,3,3,5,5,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,2,2,2,1,1,3,1,5,5,5,0,0,0,0,0,0,0,0,5,5,5,5,5,5,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,2,2,2,1,1,1,1,1,1,2,2,5,5,0,0,0,0,0,0,5,5,5,5,5,5,5,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,5,2,2,1,1,1,1,1,1,2,2,2,2,2,5,5,5,5,5,5,5,5,5,2,2,2,2,5,0, +0,0,0,0,0,0,0,0,0,0,0,0,5,2,2,1,1,1,1,1,1,1,1,1,1,1,2,3,3,3,3,3,3,3,3,3,3,2,2,3,5,0, +0,0,0,0,0,0,0,0,0,5,5,5,5,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,2,2,3,5,0, +0,0,5,0,0,0,0,0,5,5,3,3,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,3,3,3,3,2,2,2,5,0, +0,0,0,0,0,0,0,0,5,5,3,3,3,3,1,1,1,1,2,2,2,2,2,2,2,1,1,1,1,1,1,2,2,3,5,5,5,5,5,2,5,0, +0,0,0,0,0,0,0,0,5,5,5,5,3,3,3,3,1,1,2,3,3,3,2,3,3,3,2,1,1,1,2,2,2,2,2,5,5,5,5,5,5,0, +0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,1,1,1,2,2,3,3,3,2,3,3,1,1,1,2,2,2,5,5,5,5,5,5,5,5,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,2,2,5,5,3,2,2,3,3,2,2,2,2,2,3,5,5,5,5,5,5,5,5,0, +0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,2,2,3,3,2,2,2,2,2,3,5,5,5,0,0,0,5,5,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,2,3,2,2,3,3,3,5,0,0,0,0,0,5,5,0, +0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,2,3,5,3,5,5,5,0,0,0,0,5,5,5,0, +0,0,5,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,5,5,3,3,2,5,5,5,0,0,0,5,5,2,5,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,3,2,3,5,5,5,5,5,5,2,2,5,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,0,0,0,0,5,5,5,3,3,3,3,3,3,2,2,2,2,5,0, +0,0,0,5,0,0,0,5,0,5,5,5,0,0,0,0,0,0,0,0,5,5,5,5,5,0,5,5,3,3,3,3,2,2,2,2,2,2,1,1,5,0, +0,0,0,5,0,0,0,0,0,2,2,2,3,0,0,0,0,0,0,5,3,3,3,3,5,5,3,3,3,3,3,2,2,3,2,2,2,1,1,1,5,0, +0,0,0,0,0,0,0,0,0,2,2,2,5,0,5,0,0,0,0,5,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,1,1,1,1,1,5,0, +0,0,0,0,0,0,0,0,0,5,3,3,0,0,0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +</data> + </layer> + <layer id="2" name="lavaLayer" width="42" height="31" opacity="0.39"> + <data encoding="csv"> +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, +4,4,4,4,4,4,4,4,4,4,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,4,4,4,4,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,4,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,4,0,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,4,4,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,4,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,4,4,0,0,0,0,0,0,0,0,0,4,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, +4,4,4,4,4,4,4,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,0,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,0,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,0,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,0,0,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,0,0,4, +4,4,4,4,4,4,4,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,4,4,4,4,0,0,0,4, +4,4,0,4,4,4,4,4,4,4,4,4,4,0,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,0,4,4,4,0,4,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,0,4,4,4,4,4,0,0,0,0,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,0,0,0,0,4,0,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,0,0,0,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 +</data> + </layer> +</map> diff --git a/public/phaser-harkat/phaser-udemy/index.html b/public/phaser-harkat/phaser-udemy/index.html new file mode 100644 index 0000000000000000000000000000000000000000..fdc528a2f6a521b944c490c2331b6c0b639a07e5 --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/index.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> + <head> + <script src="../phaser/phaser2.min.js"></script> + <script src="state0.js"></script> + <script src="state1.js"></script> + <script src="state2.js"></script> + <script src="state3.js"></script> + <script src="state4.js"></script> + <script src="state5.js"></script> + <script src="state6.js"></script> + <script src="state7.js"></script> + <script src="state8.js"></script> + <script src="state9.js"></script> + <link rel="stylesheet" href="style.css"> + </head> + <body> + <script src="main.js"></script> + </body> +</html> \ No newline at end of file diff --git a/public/phaser-harkat/phaser-udemy/main.js b/public/phaser-harkat/phaser-udemy/main.js new file mode 100644 index 0000000000000000000000000000000000000000..882b534595f2a6bf270e79a0663f094f24e75010 --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/main.js @@ -0,0 +1,48 @@ +var game = new Phaser.Game(1500, 1000, Phaser.AUTO); +game.state.add('state0', demo.state0); +game.state.add('state1', demo.state1); +game.state.add('state2', demo.state2); +game.state.add('state3', demo.state3); +game.state.add('state4', demo.state4); +game.state.add('state5', demo.state5); +game.state.add('state6', demo.state6); +game.state.add('state7', demo.state7); +game.state.add('state8', demo.state8); +game.state.add('state9', demo.state9); +game.state.start('state0'); + +document.addEventListener('keydown', function(evt){ + console.log(evt.key); + switch(evt.key){ + case '0': + game.state.start('state' + evt.key); + break; + case '1': + game.state.start('state' + evt.key); + break; + case '2': + game.state.start('state' + evt.key); + break; + case '3': + game.state.start('state' + evt.key); + break; + case '4': + game.state.start('state' + evt.key); + break; + case '5': + game.state.start('state' + evt.key); + break; + case '6': + game.state.start('state' + evt.key); + break; + case '7': + game.state.start('state' + evt.key); + break; + case '8': + game.state.start('state' + evt.key); + break; + case '9': + game.state.start('state' + evt.key); + break; + } +}); diff --git a/public/phaser-harkat/phaser-udemy/state0.js b/public/phaser-harkat/phaser-udemy/state0.js new file mode 100644 index 0000000000000000000000000000000000000000..628f4c47461cf0de502324c9d1d947a90632b37f --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/state0.js @@ -0,0 +1,65 @@ +var demo = {}; +var centerX = 1500/2; +var centerY = 1000/2; +var saber; +var speed = 10; +demo.state0 = function(){}; +demo.state0.prototype = { + preload: function(){ + game.load.spritesheet('saber', 'assets/spritesheets/saberSheet.png', 302,302); + game.load.image('sunset', 'assets/backgrounds/sunset.png'); + }, + create: function(){ + game.physics.startSystem(Phaser.Physics.ARCADE); + game.stage.backgroundColor = '#DDDDDD'; + console.log('state0'); + + //game.input.Keyboard.addKey(Phaser.Keyboard.ONE).onDown.add(changeState,null,null,1); + game.world.setBounds(0,0,2500,1000); + var sunset = game.add.sprite(0, 0, 'sunset'); + game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; + saber = game.add.sprite(centerX, centerY+200, 'saber'); + saber.anchor.setTo(0.5, 0.5); + saber.scale.setTo(0.9, 0.9); + game.physics.enable(saber); + saber.body.collideWorldBounds = true; + saber.animations.add('walk', [0,1,2,3,4]); + + + game.camera.follow(saber); + game.camera.deadzone = new Phaser.Rectangle(centerX-300, 0, 600, 1000); + }, + update: function(){ + if(game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)){ + saber.x += speed; + saber.scale.setTo(0.9, 0.9); + saber.animations.play('walk', 12, true); + } + else if(game.input.keyboard.isDown(Phaser.Keyboard.LEFT)){ + saber.x -= speed; + saber.scale.setTo(-0.9, 0.9); + saber.animations.play('walk', 12, true); + } + else{ + saber.animations.stop('walk'); + saber.frame = 0; + } + if(game.input.keyboard.isDown(Phaser.Keyboard.UP)){ + saber.y -= speed; + saber.animations.play('walk', 12, true); + if(saber.y<600){ + saber.y = 600; + } + } + if(game.input.keyboard.isDown(Phaser.Keyboard.DOWN)){ + saber.y += speed; + saber.animations.play('walk', 12, true); + } + } +}; +/* +function changeState(i, stateNum){ + console.log(i); + game.state.start('state' + stateNum); +} +*/ \ No newline at end of file diff --git a/public/phaser-harkat/phaser-udemy/state1.js b/public/phaser-harkat/phaser-udemy/state1.js new file mode 100644 index 0000000000000000000000000000000000000000..c010d4d1c5417847c7e0b771d21433502761374a --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/state1.js @@ -0,0 +1,72 @@ +demo.state1 = function(){}; + +var cursors; + +var vel = 500; + +var lava; + +demo.state1.prototype = { + preload: function(){ + game.load.tilemap('map', 'assets/tilemaps/state1Tilemap.json', null, Phaser.Tilemap.TILED_JSON); + game.load.image('grass', 'assets/tilemaps/grass.png'); + game.load.image('ground', 'assets/tilemaps/ground.png'); + game.load.image('lava', 'assets/tilemaps/lava.png'); + game.load.image('lavarock', 'assets/tilemaps/lavarock.png'); + + game.load.spritesheet('saber', 'assets/spritesheets/saberSheet.png', 302,302); + }, + create: function(){ + game.stage.backgroundColor = '#DDDDDD'; + console.log('state1'); + + var map = game.add.tilemap('map'); + map.addTilesetImage('grass'); + map.addTilesetImage('ground'); + map.addTilesetImage('lava'); + map.addTilesetImage('lavarock'); + + var ground = map.createLayer('groundLayer'); + lava = map.createLayer('lavaLayer'); + + + //map.setCollisionBetween(4, 4, true, 'lavaLayer'); + map.setCollision(4, true, 'lavaLayer'); + + saber = game.add.sprite(centerX, centerY+200, 'saber'); + saber.scale.setTo(0.2); + game.physics.enable(saber); + saber.animations.add('walk', [0,1,2,3,4]); + + cursors = game.input.keyboard.createCursorKeys(); + }, + update: function(){ + + //velocity == annetaan nopeutta, jolloin collision mahdollinen + game.physics.arcade.collide(saber, lava, function(){console.log('collision')}); + if(cursors.up.isDown){ + saber.body.velocity.y = -vel; + saber.animations.play('walk', 12, false); + } + else if(cursors.down.isDown){ + saber.body.velocity.y = vel; + saber.animations.play('walk', 12, false); + } + else { + saber.body.velocity.y = 0; + } + if(cursors.left.isDown){ + saber.body.velocity.x = -vel; + saber.scale.setTo(-0.2, 0.2); + saber.animations.play('walk', 12, false); + } + else if(cursors.right.isDown){ + saber.body.velocity.x = vel; + saber.scale.setTo(0.2, 0.2); + saber.animations.play('walk', 12, false); + } + else { + saber.body.velocity.x = 0; + } + } +}; \ No newline at end of file diff --git a/public/phaser-harkat/phaser-udemy/state2.js b/public/phaser-harkat/phaser-udemy/state2.js new file mode 100644 index 0000000000000000000000000000000000000000..ae4cf9089c6aafff4b64695a554b30f9b4adea90 --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/state2.js @@ -0,0 +1,87 @@ +demo.state2 = function(){}; + +var barrel; +var base; +var bullets; +var velocity = 1500; +var nextfire = 0; +var firerate = 200; +var enemy; +var bullet; +var enemyGroup; +demo.state2.prototype = { + preload: function(){ + game.load.spritesheet('saber', 'assets/spritesheets/saberSheet.png', 302,302); + }, + create: function(){ + game.stage.backgroundColor = '#DDDDDD'; + console.log('state2'); + + base = game.add.sprite(centerX, centerY, 'saber'); + base.anchor.setTo(0.5); + base.scale.setTo(0.5); + base.tint = 0xaaaaaa; + + + bullets = game.add.group(); + bullets.enableBody = true; + bullets.physicsBodyType = Phaser.Physics.ARCADE; + bullets.createMultiple(50, 'saber'); + bullets.setAll('checkWorldBounds', true); + bullets.setAll('outOfBoundsKill', true) + bullets.setAll('anchor.y', 0.5); + bullets.setAll('scale.y', 0.3); + + barrel = game.add.sprite(centerX, centerY, 'saber'); + barrel.anchor.setTo(0.5, 0.1); + barrel.scale.setTo(-0.5); + + enemy = game.add.sprite(100, 200, 'saber'); + game.physics.enable(enemy); + + enemyGroup = game.add.group(); + enemyGroup.enableBody = true; + enemyGroup.physicsBodyType = Phaser.Physics.ARCADE; + + for(let i = 0; i<3; i++){ + enemyGroup.create(1300,350*i+100, 'saber'); + } + + enemyGroup.setAll('anchor.y', 0.5); + enemyGroup.setAll('anchor.x', 0.5); + enemyGroup.setAll('scale.y', 0.5); + enemyGroup.setAll('scale.x', 0.5); + }, + update: function(){ + barrel.rotation = game.physics.arcade.angleToPointer(barrel)-80; + if(game.input.activePointer.isDown){ + this.fire(); + } + + game.physics.arcade.overlap(bullets, enemy, this.hitEnemy); + game.physics.arcade.overlap(bullets, enemyGroup, this.hitGroup); + }, + fire: function(){ + if(game.time.now > nextfire){ + nextfire = game.time.now + firerate; + console.log('firing'); + bullet = bullets.getFirstDead(); + bullet.reset(barrel.x, barrel.y); + + bullet.tint = Math.random() * 0xffffff; + game.physics.arcade.moveToPointer(bullet, velocity); + bullet.rotation = game.physics.arcade.angleToPointer(bullet); + } + }, + hitEnemy: function(){ + console.log("hit"); + enemy.kill(); + bullet.kill(); + }, + + hitGroup: function(b, e){ + console.log("hit"); + b.kill(); + e.kill(); + } +}; \ No newline at end of file diff --git a/public/phaser-harkat/phaser-udemy/state3.js b/public/phaser-harkat/phaser-udemy/state3.js new file mode 100644 index 0000000000000000000000000000000000000000..8f21d791de9aaff6a63635234327962e5a857be1 --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/state3.js @@ -0,0 +1,43 @@ +demo.state3 = function(){}; +demo.state3.prototype = { + preload: function(){ + game.load.image('button1', 'assets/sprites/armeija_apustus.png'); + game.load.image('button2', 'assets/sprites/rakenus_apustus.jpg'); + game.load.image('button3', 'assets/sprites/täräntänkö.jpg'); + + game.load.audio('pops', 'assets/sounds/audio.mp3'); + }, + create: function(){ + game.stage.backgroundColor = '#32f532'; + console.log('state3'); + + sound = game.add.audio('pops'); + sound.addMarker('boom', 0,1); + sound.addMarker('slap', 4.5, 1); + + var b1 = game.add.button(100,100,'button1', function(){ + game.state.start('state1'); + }); + var b2 = game.add.button(400,400,'button2', function(){ + game.state.start('state2'); + }); + var b3 = game.add.button(700,700,'button3', function(){ + }); + + b1.onInputDown.add(this.tint, b1); + b2.onInputDown.add(this.tint, b2); + b3.onInputDown.add(this.tint, b3); + + b1.onInputUp.add(this.unTint, b1); + b2.onInputUp.add(this.unTint, b2); + b3.onInputUp.add(this.unTint, b3); + }, + tint: function(){ + this.tint = 0xbbbbbb; + sound.play('boom'); + }, + unTint: function(){ + this.tint = 0xffffff; + sound.play('slap'); + } +}; \ No newline at end of file diff --git a/public/phaser-harkat/phaser-udemy/state4.js b/public/phaser-harkat/phaser-udemy/state4.js new file mode 100644 index 0000000000000000000000000000000000000000..cfce3607ac93d3c6c0921d3b3c1828d2c583698c --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/state4.js @@ -0,0 +1,24 @@ +var i = 0; +var u = {val: 0}; + +demo.state4 = function(){}; +demo.state4.prototype = { + preload: function(){}, + create: function(){ + game.stage.backgroundColor = '#DDDDDD'; + console.log('state4'); + + a1 = game.add.sprite(50,100,'saber'); + a2 = game.add.sprite(350,100,'saber'); + a3 = game.add.sprite(650,100,'saber'); + a4 = game.add.sprite(950,100,'saber'); + a5 = game.add.sprite(1250,100,'saber'); + + game.add.tween(a1).to({y: '+400'}, 2000, 'Linear', true); + i = game.add.tween(a2).to({x: 100, y: 0}, 1000, 'Elastic.easeOut'); + game.add.tween(a3).from({y: 1000}, 1500, 'Circ.easeOut', true); + game.add.tween(a4.anchor).to({x: 1}, 1000, 'Linear', true,1000, false, true).loop(true); + game.add.tween(a5).to({alpha: 0}, 1000, 'Bounce', true); + }, + update: function(){} +}; \ No newline at end of file diff --git a/public/phaser-harkat/phaser-udemy/state5.js b/public/phaser-harkat/phaser-udemy/state5.js new file mode 100644 index 0000000000000000000000000000000000000000..a5a9a2addb7d8b2449130d9cd7caf814697e3f37 --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/state5.js @@ -0,0 +1,44 @@ +var accel = 500; +var platformGroup; +demo.state5 = function(){}; +demo.state5.prototype = { + preload: function(){ + game.load.image('platform', 'assets/sprites/rakenus_apustus.jpg'); + }, + create: function(){ + game.stage.backgroundColor = '#DDDDDD'; + console.log('state5'); + + saber = game.add.sprite(centerX, 500, 'saber'); + platform = game.add.sprite(0, 800, 'platform'); + + platformGroup = game.add.group(); + platformGroup.create(650, 400, 'platform'); + platformGroup.create(1300, 400, 'platform'); + + game.physics.enable([saber, platform, platformGroup]); + + saber.body.gravity.y = 500; + saber.body.bounce.y = 0.3; + saber.body.collideWorldBounds = true; + + platform.body.immovable = true; + + platformGroup.setAll('body.immovable', true); + }, + update: function(){ + game.physics.arcade.collide(saber, [platform, platformGroup]); + if(game.input.keyboard.isDown(Phaser.Keyboard.LEFT)){ + saber.body.acceleration.x = -accel; + } + else if(game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)){ + saber.body.acceleration.x = accel; + } + else { + saber.body.acceleration.x = 0; + } + if(game.input.keyboard.isDown(Phaser.Keyboard.UP)){ + saber.body.velocity.y = -300; + } + } +}; \ No newline at end of file diff --git a/public/phaser-harkat/phaser-udemy/state6.js b/public/phaser-harkat/phaser-udemy/state6.js new file mode 100644 index 0000000000000000000000000000000000000000..74eecfc9ed8cf1f6e170ca1a3542e2e806dadade --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/state6.js @@ -0,0 +1,39 @@ +var volcano; +demo.state6 = function(){}; +demo.state6.prototype = { + preload: function(){ + game.load.image('button2', 'assets/sprites/rakenus_apustus.jpg'); + game.load.image('button1', 'assets/sprites/armeija_apustus.png'); + game.load.image('button3', 'assets/sprites/täräntänkö.jpg'); + }, + create: function(){ + game.stage.backgroundColor = '#DDDDDD'; + console.log('state6'); + + volcano = game.add.sprite(centerX, 1000, 'button2'); + volcano.anchor.setTo(0.5,1); + volcano.scale.setTo(4); + + var emitter = game.add.emitter(centerX+600, centerY+500, 500); + emitter.scale.setTo(0.5); + + emitter.makeParticles(['button1', 'button3'], 0, 5000, false, true); + emitter.maxParticleSpeed.set(300, -300); + emitter.minParticleSpeed.set(-300, -100); + emitter.gravity = 300; + + game.time.events.add(2000, function(){ + emitter.start(false,5000, 20); + game.time.events.loop(500, function(){ + if(emitter.on){ + emitter.on = false; + } + else{ + emitter.on = true; + } + }); + }); + + }, + update: function(){} +}; \ No newline at end of file diff --git a/public/phaser-harkat/phaser-udemy/state7.js b/public/phaser-harkat/phaser-udemy/state7.js new file mode 100644 index 0000000000000000000000000000000000000000..d097ca7a1da839c84f175e0dcde126f705202f71 --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/state7.js @@ -0,0 +1,58 @@ +var arrow; +var startPointX; +var startPointY; +var endPointX; +var endPointY; +var swipeDirection; +var leeway = 10; + +demo.state7 = function(){}; +demo.state7.prototype = { + preload: function(){ + game.load.image('arrow', 'assets/sprites/arrow.png'); + }, + create: function(){ + game.stage.backgroundColor = '#DDDDDD'; + console.log('state7'); + + arrow = game.add.sprite(centerX,centerY, 'arrow'); + arrow.anchor.setTo(0.5); + + game.input.onDown.add(this.startSwipe); + game.input.onUp.add(this.getSwipeDirection); + }, + update: function(){}, + + startSwipe: function(){ + startPointX = game.input.x; + startPointY = game.input.y; + }, + getSwipeDirection: function(){ + endPointX = game.input.x; + endPointY = game.input.y; + + if(Math.abs(endPointY-startPointY) < leeway && Math.abs(endPointX - endPointY) < leeway){ + return false; + } + if(Math.abs(endPointY-startPointY) < Math.abs(endPointX - startPointX)){ + console.log("horizontal"); + if(endPointX > startPointX){ + swipeDirection = 90; + } + else{ + swipeDirection = 270; + } + } + else{ + console.log('vertical'); + if(endPointY > startPointY){ + swipeDirection = 180; + } + else{ + swipeDirection = 0; + } + } + + arrow.angle = swipeDirection; + } +}; \ No newline at end of file diff --git a/public/phaser-harkat/phaser-udemy/state8.js b/public/phaser-harkat/phaser-udemy/state8.js new file mode 100644 index 0000000000000000000000000000000000000000..8ada28eadb99616c93da5ba6e85a369198179270 --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/state8.js @@ -0,0 +1,46 @@ +var text; + +WebFontConfig = { + google: {families: ['Coiny', 'Taprom'] } +}; + +demo.state8 = function(){}; +demo.state8.prototype = { + preload: function(){ + game.load.script('webfont', '//ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js'); + }, + create: function(){ + game.stage.backgroundColor = '#DDDDDD'; + console.log('state8'); + + text = 'poae nrbnöe rbnöain tbisntö binsöi tbnösi ntböisntöbinsöitbösi ntbsekntlknt ebntbj kstbn sötnbösntbs nrtbnsrtbnstnbösntä ban4ä ioä4ihnga3h4gaigörfk nbözfnbitbs örtkbnstnbsn tböisntböi nsrtö ibnstinb sintbösnrtöbn srtbsötnböis nrtböinstöib knrstiobnsöitbs'; + + //game.add.text(100, 400, 'Hello World', {fontSize: '100px', fill: '#fff'}); + + this.spellOutText(100, 100, 1000, text, 40, 40, '#fff', 'Coiny'); + this.spellOutText(100, 600, 1000, text, 40, 20, '#000', 'Taprom'); + }, + spellOutText: function(x, y, width, text, fontSize, speed, fill, font){ + var sentence = game.add.text(x,y,'', {fontSize: fontSize + 'px', fill: fill, font: font}); + var currentLine = game.add.text(10,10,'', {fontSize: fontSize + 'px', font: font}); + currentLine.alpha = 0; + var loop = game.time.events.loop(speed, addChar); + + var index = 0; + + function addChar(){ + sentence.text += text[index]; + currentLine.text += text[index]; + + if(currentLine.width > width && text[index] == ' '){ + sentence.text += '\n'; + currentLine.text = ''; + } + if( index >= text.length-1){ + game.time.events.remove(loop); + console.log('stop'); + } + index++; + } + } +}; \ No newline at end of file diff --git a/public/phaser-harkat/phaser-udemy/state9.js b/public/phaser-harkat/phaser-udemy/state9.js new file mode 100644 index 0000000000000000000000000000000000000000..a6f5c098fefb1537be5026d53852fd43610f192a --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/state9.js @@ -0,0 +1,20 @@ +var hsText = []; +var hs = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]; + +demo.state9 = function(){}; +demo.state9.prototype = { + preload: function(){}, + create: function(){ + game.stage.backgroundColor = '#DDDDDD'; + console.log('state9'); + + for (let i = 1; i < 11; i++ ){ + game.add.text(500, 20+(i*90), i + '. ', {fontSize: '40px'}).anchor.setTo(1,0); + } + + for(let i = 0; i<10; i++){ + hsText[i] = game.add.text(500, 20+((i+1)*90), hs[i], {fontSize: '40px'}); + } + }, + update: function(){} +}; \ No newline at end of file diff --git a/public/phaser-harkat/phaser-udemy/style.css b/public/phaser-harkat/phaser-udemy/style.css new file mode 100644 index 0000000000000000000000000000000000000000..4e41b69a8af91daa39519a62daa3bf9b8e7a8eff --- /dev/null +++ b/public/phaser-harkat/phaser-udemy/style.css @@ -0,0 +1,3 @@ +body { + margin: 0; +} \ No newline at end of file diff --git a/public/phaser-harkat/phaser/phaser.min.js b/public/phaser-harkat/phaser/phaser.min.js new file mode 100644 index 0000000000000000000000000000000000000000..e6b5575092b0a74b67da7b8a02011d7598a5ab04 --- /dev/null +++ b/public/phaser-harkat/phaser/phaser.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(window,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1127)}([function(t,e){function i(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function n(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,e,s,r){for(var a in e)if(e.hasOwnProperty(a)){var h=i(e,a,s);if(!1!==h){if(n((r||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)s(t,e[i].prototype||e[i])}}function o(t){var e,i;if(t||(t={}),t.initialize){if("function"!=typeof t.initialize)throw new Error("initialize must be a function");e=t.initialize,delete t.initialize}else if(t.Extends){var n=t.Extends;e=function(){n.apply(this,arguments)}}else e=function(){};t.Extends?(e.prototype=Object.create(t.Extends.prototype),e.prototype.constructor=e,i=t.Extends,delete t.Extends):e.prototype.constructor=e;var o=null;return t.Mixins&&(o=t.Mixins,delete t.Mixins),r(e,o),s(e,t,!0,i),e}o.extend=s,o.mixin=r,o.ignoreFinals=!1,t.exports=o},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e,i){var n=typeof t;return t&&"number"!==n&&"string"!==n&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new n(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this}});n.ZERO=new n,t.exports=n},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o<n.length;o++){if(!s.hasOwnProperty(n[o])){r=i;break}r=s[n[o]],s=s[n[o]]}return r}return i}return i}},function(t,e,i){var n=i(0),s=i(15),r=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once("destroy",this.destroy,this)},start:function(){this.systems.events.once("shutdown",this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});r.register=function(t,e){r.prototype.hasOwnProperty(t)||(r.prototype[t]=e)},s.register("GameObjectFactory",r,"add"),t.exports=r},function(t,e,i){var n=new(i(0))({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=n},function(t,e){var i={},n={install:function(t){for(var e in i)t[e]=i[e]},register:function(t,e){i[t]=e},destroy:function(){i={}}};t.exports=n},function(t,e){t.exports=function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},function(t,e,i){var n=i(0),s=i(39),r=i(190),o=i(398),a=i(54),h=i(187),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new a),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new a),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new a),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new a),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports={getTintFromFloats:function(t,e,i,n){return((255&(255*n|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;n<t.length;++n){var s=t[n];s.type===e.FLOAT?i+=s.size:i+=1}return i}}},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,s="~";function r(){}function o(t,e,i,n,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new function(t,e,i){this.fn=t,this.context=e,this.once=i||!1}(i,n||t,r),a=s?s+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],o]:t._events[a].push(o):(t._events[a]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function h(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(s=!1)),h.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(s?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},h.prototype.listeners=function(t){var e=s?s+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,r=i.length,o=new Array(r);n<r;n++)o[n]=i[n].fn;return o},h.prototype.listenerCount=function(t){var e=s?s+t:t,i=this._events[e];return i?i.fn?1:i.length:0},h.prototype.emit=function(t,e,i,n,r,o){var a=s?s+t:t;if(!this._events[a])return!1;var h,l,u=this._events[a],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,n),!0;case 5:return u.fn.call(u.context,e,i,n,r),!0;case 6:return u.fn.call(u.context,e,i,n,r,o),!0}for(l=1,h=new Array(c-1);l<c;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var d,f=u.length;for(l=0;l<f;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,i);break;case 4:u[l].fn.call(u[l].context,e,i,n);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];u[l].fn.apply(u[l].context,h)}}return!0},h.prototype.on=function(t,e,i){return o(this,t,e,i,!1)},h.prototype.once=function(t,e,i){return o(this,t,e,i,!0)},h.prototype.removeListener=function(t,e,i,n){var r=s?s+t:t;if(!this._events[r])return this;if(!e)return a(this,r),this;var o=this._events[r];if(o.fn)o.fn!==e||n&&!o.once||i&&o.context!==i||a(this,r);else{for(var h=0,l=[],u=o.length;h<u;h++)(o[h].fn!==e||n&&!o[h].once||i&&o[h].context!==i)&&l.push(o[h]);l.length?this._events[r]=1===l.length?l[0]:l:a(this,r)}return this},h.prototype.removeAllListeners=function(t){var e;return t?(e=s?s+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},h.prototype.off=h.prototype.removeListener,h.prototype.addListener=h.prototype.on,h.prefixed=s,h.EventEmitter=h,t.exports=h},function(t,e,i){var n=i(16),s=i(4);t.exports=function(t,e,i){var r=s(t,e,null);if(null===r)return i;if(Array.isArray(r))return n.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return n.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return n.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},function(t,e,i){var n=i(0),s=i(15),r=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once("destroy",this.destroy,this)},start:function(){this.systems.events.once("shutdown",this.shutdown,this)},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});r.register=function(t,e){r.prototype.hasOwnProperty(t)||(r.prototype[t]=e)},s.register("GameObjectCreator",r,"make"),t.exports=r},function(t,e,i){t.exports={Alpha:i(401),Animation:i(427),BlendMode:i(400),ComputedSize:i(1045),Crop:i(1044),Depth:i(399),Flip:i(1043),GetBounds:i(1042),Mask:i(395),Origin:i(1041),Pipeline:i(186),ScaleMode:i(1040),ScrollFactor:i(392),Size:i(1039),Texture:i(1038),TextureCrop:i(1037),Tint:i(1036),ToJSON:i(391),Transform:i(390),TransformMatrix:i(38),Visible:i(389)}},function(t,e){var i={},n={},s={register:function(t,e,n,s){void 0===s&&(s=!1),i[t]={plugin:e,mapping:n,custom:s}},registerCustom:function(t,e,i,s){n[t]={plugin:e,mapping:i,data:s}},hasCore:function(t){return i.hasOwnProperty(t)},hasCustom:function(t){return n.hasOwnProperty(t)},getCore:function(t){return i[t]},getCustom:function(t){return n[t]},getCustomClass:function(t){return n.hasOwnProperty(t)?n[t].plugin:null},remove:function(t){i.hasOwnProperty(t)&&delete i[t]},removeCustom:function(t){n.hasOwnProperty(t)&&delete n[t]},destroyCorePlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]},destroyCustomPlugins:function(){for(var t in n)n.hasOwnProperty(t)&&delete n[t]}};t.exports=s},function(t,e,i){var n=i(404),s={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:new n};t.exports=s},function(t,e,i){var n=i(2);t.exports=function(t,e,i,s,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===s&&(s=o.height);var a=n(r,"isNotEmpty",!1),h=n(r,"isColliding",!1),l=n(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(s+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c<e+s;c++)for(var d=t;d<t+i;d++){var f=o.data[c][d];if(null!==f){if(a&&-1===f.index)continue;if(h&&!f.collides)continue;if(l&&!f.hasInterestingFace)continue;u.push(f)}}return u}},function(t,e){t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19}},function(t,e,i){var n=i(0),s=i(391),r=i(123),o=i(11),a=new n({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.type=e,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return s(this)},willRender:function(t){return!(a.RENDER_MASK!==this.renderFlags||this.cameraFilter>0&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit("destroy",this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});a.RENDER_MASK=15,t.exports=a},function(t,e,i){var n=i(8),s=function(){var t,e,i,r,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l<u;l++)if(null!=(t=arguments[l]))for(e in t)i=h[e],h!==(r=t[e])&&(c&&r&&(n(r)||(o=Array.isArray(r)))?(o?(o=!1,a=i&&Array.isArray(i)?i:[]):a=i&&n(i)?i:{},h[e]=s(c,a,r)):void 0!==r&&(h[e]=r));return h};t.exports=s},function(t,e,i){var n=i(0),s=i(18),r=i(2),o=i(141),a=i(140),h=i(254),l=i(105),u=new n({initialize:function(t,e){this.loader=t,this.cache=r(e,"cache",!1),this.type=r(e,"type",!1),this.key=r(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.type||!this.key)throw new Error("Error calling 'Loader."+this.type+"' invalid key provided.");this.url=r(e,"url"),void 0===this.url?this.url=t.path+i+"."+r(e,"extension",""):"function"!=typeof this.url&&(this.url=t.path+this.url),this.src="",this.xhrSettings=l(r(e,"responseType",void 0)),r(e,"xhrSettings",!1)&&(this.xhrSettings=a(this.xhrSettings,r(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?s.FILE_POPULATED:s.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=r(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===s.FILE_POPULATED?this.loader.nextFile(this,!0):(this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=h(this,this.loader.xhr))},onLoad:function(t,e){var i=!(e.target&&200!==e.target.status);4===t.readyState&&t.status>=400&&t.status<=599&&(i=!1),this.resetXHR(),this.loader.nextFile(this,i)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit("fileprogress",this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit("filecomplete",e,i,t),this.loader.emit("filecomplete-"+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e){t.exports=function(t,e,i,n,s){var r=n.alpha*i.alpha;if(r<=0)return!1;var o=t._tempMatrix1.copyFromArray(n.matrix.matrix),a=t._tempMatrix2.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY),h=t._tempMatrix3;return s?(o.multiplyWithOffset(s,-n.scrollX*i.scrollFactorX,-n.scrollY*i.scrollFactorY),a.e=i.x,a.f=i.y,o.multiply(a,h)):(a.e-=n.scrollX*i.scrollFactorX,a.f-=n.scrollY*i.scrollFactorY,o.multiply(a,h)),e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=r,e.save(),h.setToContext(e),!0}},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){var n,s,r,o=i(26),a=i(120),h=[],l=!1;t.exports={create2D:function(t,e,i){return n(t,e,i,o.CANVAS)},create:n=function(t,e,i,n,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=o.CANVAS),void 0===r&&(r=!1);var c=s(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===o.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&n===o.CANVAS&&a.disable(u.getContext("2d")),u},createWebGL:function(t,e,i){return n(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:s=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e<h.length;e++){var i=h[e];if(!i.parent&&i.type===t)return i}return null},free:function(){return h.length-r()},pool:h,remove:function(t){var e=t instanceof HTMLCanvasElement;h.forEach(function(i){(e&&i.canvas===t||!e&&i.parent===t)&&(i.parent=null,i.canvas.width=1,i.canvas.height=1)})},total:r=function(){var t=0;return h.forEach(function(e){e.parent&&t++}),t}}},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o<h;o++)t[o][e]=i+a*n,a++;else for(o=s;o>=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n={VERSION:"3.15.1",BlendModes:i(66),ScaleModes:i(94),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(54),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e,i){var n=i(66),s=i(12),r=i(94);t.exports=function(t,e,i){e.x=s(i,"x",0),e.y=s(i,"y",0),e.depth=s(i,"depth",0),e.flipX=s(i,"flipX",!1),e.flipY=s(i,"flipY",!1);var o=s(i,"scale",null);"number"==typeof o?e.setScale(o):null!==o&&(e.scaleX=s(o,"x",1),e.scaleY=s(o,"y",1));var a=s(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=s(a,"x",1),e.scrollFactorY=s(a,"y",1)),e.rotation=s(i,"rotation",0);var h=s(i,"angle",null);null!==h&&(e.angle=h),e.alpha=s(i,"alpha",1);var l=s(i,"origin",null);if("number"==typeof l)e.setOrigin(l);else if(null!==l){var u=s(l,"x",.5),c=s(l,"y",.5);e.setOrigin(u,c)}return e.scaleMode=s(i,"scaleMode",r.DEFAULT),e.blendMode=s(i,"blendMode",n.NORMAL),e.visible=s(i,"visible",!0),s(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e){t.exports=function(t,e,i){var n=i||e.fillColor,s=e.fillAlpha,r=(16711680&n)>>>16,o=(65280&n)>>>8,a=255&n;t.fillStyle="rgba("+r+","+o+","+a+","+s+")"}},function(t,e,i){var n=i(16);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o<h;o++)t[o][e]+=i+a*n,a++;else for(o=s;o>=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){(function(e){var i={};t.exports=i,function(){i._nextId=0,i._seed=0,i._nowStartTime=+new Date,i.extend=function(t,e){var n,s;"boolean"==typeof e?(n=2,s=e):(n=1,s=!0);for(var r=n;r<arguments.length;r++){var o=arguments[r];if(o)for(var a in o)s&&o[a]&&o[a].constructor===Object?t[a]&&t[a].constructor!==Object?t[a]=o[a]:(t[a]=t[a]||{},i.extend(t[a],s,o[a])):t[a]=o[a]}return t},i.clone=function(t,e){return i.extend({},e,t)},i.keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var i in t)e.push(i);return e},i.values=function(t){var e=[];if(Object.keys){for(var i=Object.keys(t),n=0;n<i.length;n++)e.push(t[i[n]]);return e}for(var s in t)e.push(t[s]);return e},i.get=function(t,e,i,n){e=e.split(".").slice(i,n);for(var s=0;s<e.length;s+=1)t=t[e[s]];return t},i.set=function(t,e,n,s,r){var o=e.split(".").slice(s,r);return i.get(t,e,0,-1)[o[o.length-1]]=n,n},i.shuffle=function(t){for(var e=t.length-1;e>0;e--){var n=Math.floor(i.random()*(e+1)),s=t[e];t[e]=t[n],t[n]=s}return t},i.choose=function(t){return t[Math.floor(i.random()*t.length)]},i.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},i.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isFunction=function(t){return"function"==typeof t},i.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},i.isString=function(t){return"[object String]"===toString.call(t)},i.clamp=function(t,e,i){return t<e?e:t>i?i:t},i.sign=function(t){return t<0?-1:1},i.now=function(){if(window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-i._nowStartTime},i.random=function(e,i){return e=void 0!==e?e:0,i=void 0!==i?i:1,e+t()*(i-e)};var t=function(){return i._seed=(9301*i._seed+49297)%233280,i._seed/233280};i.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},i.logLevel=1,i.log=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.info=function(){console&&i.logLevel>0&&i.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warn=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.nextId=function(){return i._nextId++},i.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1},i.map=function(t,e){if(t.map)return t.map(e);for(var i=[],n=0;n<t.length;n+=1)i.push(e(t[n]));return i},i.topologicalSort=function(t){var e=[],n=[],s=[];for(var r in t)n[r]||s[r]||i._topologicalSort(r,n,s,t,e);return e},i._topologicalSort=function(t,e,n,s,r){var o=s[t]||[];n[t]=!0;for(var a=0;a<o.length;a+=1){var h=o[a];n[h]||(e[h]||i._topologicalSort(h,e,n,s,r))}n[t]=!1,e[t]=!0,r.push(t)},i.chain=function(){for(var t=[],e=0;e<arguments.length;e+=1){var i=arguments[e];i._chained?t.push.apply(t,i._chained):t.push(i)}var n=function(){for(var e,i=new Array(arguments.length),n=0,s=arguments.length;n<s;n++)i[n]=arguments[n];for(n=0;n<t.length;n+=1){var r=t[n].apply(e,i);void 0!==r&&(e=r)}return e};return n._chained=t,n},i.chainPathBefore=function(t,e,n){return i.set(t,e,i.chain(n,i.get(t,e)))},i.chainPathAfter=function(t,e,n){return i.set(t,e,i.chain(i.get(t,e),n))},i._requireGlobal=function(t,i){return"undefined"!=typeof window?window[t]:void 0!==e?e[t]:null}}()}).call(this,i(200))},function(t,e,i){var n=i(102),s=i(17);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=s(t,e,i,r,null,o),d=0;d<c.length;d++){var f=c[d];f&&(f.collides?(a=n(f.x,f.y-1,!0,o),h=n(f.x,f.y+1,!0,o),l=n(f.x-1,f.y,!0,o),u=n(f.x+1,f.y,!0,o),f.faceTop=!a||!a.collides,f.faceBottom=!h||!h.collides,f.faceLeft=!l||!l.collides,f.faceRight=!u||!u.collides):f.resetFaces())}}},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e){t.exports=function(t,e){var i=e.strokeColor,n=e.strokeAlpha,s=(16711680&i)>>>16,r=(65280&i)>>>8,o=255&i;t.strokeStyle="rgba("+s+","+r+","+o+","+n+")",t.lineWidth=e.lineWidth}},function(t,e,i){var n=i(0),s=i(177),r=i(376),o=i(176),a=i(375),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t,e,i,n,s,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===s&&(s=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,n,s,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},scaleY:{get:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],g=n[5],v=void 0===e?this:e;return v.a=u*s+c*o,v.b=u*r+c*a,v.c=d*s+f*o,v.d=d*r+f*a,v.e=p*s+g*o+h,v.f=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=e*r+i*a+n[4],u=e*o+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],g=s[4],v=s[5];return n[0]=c*r+d*a,n[1]=c*o+d*h,n[2]=f*r+p*a,n[3]=f*o+p*h,n[4]=g*r+v*a+l,n[5]=g*o+v*h+u,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[5]=s*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,s,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*i,a=n*n,h=s*s,l=r*r,u=Math.sqrt(o+h),c=Math.sqrt(a+l);return t.translateX=e[4],t.translateY=e[5],t.scaleX=u,t.scaleY=c,t.rotation=Math.acos(i/u)*(Math.atan(-s/i)<0?-1:1),t},applyITRS:function(t,e,i,n,s){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=r*c*e+-o*c*t+(-u*r+l*o)*c,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=r},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},function(t,e){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileHeight,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),s*=r.scaleY),e?Math.floor(t/s):t/s}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileWidth,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),s*=r.scaleX),e?Math.floor(t/s):t/s}},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(4),l=i(8),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new u(this,t[s]));else this.addFile(new u(this,t,e,n,i));return this}),t.exports=u},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return Math.sqrt(s*s+r*r)}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},function(t,e,i){var n=i(0),s=i(397),r=i(189),o=i(188),a=i(3),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new a),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new a),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=h},function(t,e,i){var n=i(0),s=i(14),r=i(265),o=new n({Mixins:[s.Alpha,s.Flip,s.Visible],initialize:function(t,e,i,n,s,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=n,this.width=s,this.height=r,this.baseWidth=void 0!==o?o:s,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=null,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(t<this.pixelX||e<this.pixelY||t>this.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return this.getLeft(t)+this.width/2},getCenterY:function(t){return this.getTop(t)+this.height/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight-(this.height-this.baseHeight),this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.tilemapLayer;return t?t.tileset:null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.loader=t,this.type=e,this.key=i,this.files=n,this.complete=!1,this.pending=n.length,this.failed=0,this.config={};for(var s=0;s<n.length;s++)n[s].multiFile=this},isReadyToProcess:function(){return 0===this.pending&&0===this.failed&&!this.complete},addToMultiFile:function(t){return this.files.push(t),t.multiFile=this,this.pending++,this.complete=!1,this},onFileComplete:function(t){-1!==this.files.indexOf(t)&&this.pending--},onFileFailed:function(t){-1!==this.files.indexOf(t)&&this.failed++}});t.exports=n},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function t(e,i,n,s,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),n=a(c,"url"),l=a(c,"normalMap"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"frameConfig")}Array.isArray(n)&&(l=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:n,xhrSettings:s,config:o};if(r.call(this,e,d),l){var f=new t(e,this.key,l,s,o);f.type="normalMap",this.setLink(f),e.addFile(f)}},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},addToCache:function(){var t,e=this.linkFile;e&&e.state===s.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});o.register("image",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this}),t.exports=l},function(t,e,i){var n=i(0),s=i(69),r=i(278),o=i(277),a=i(54),h=i(184),l=new n({initialize:function(t,e,i,n,s,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this.x3=s,this.y3=r},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this.x3=s,this.y3=r,this},getLineA:function(t){return void 0===t&&(t=new a),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new a),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new a),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=l},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;p<l;p+=2){var g=h[p]-s,v=h[p+1]-r;t.setTexture2D(),t.batchLine(d,f,g,v,c,c,u,p-2,!!e.closePath&&p===l-1),d=g,f=v}}},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(829),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,o){r.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s.Animation(this),this.setTexture(n,o),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e,i){return this.anims.play(t,e,i),this},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=a},function(t,e){t.exports=function(t,e,i,n){var s=t.length;if(e<0||e>s||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,a,h,l,u,f,g,v=e&&e.length,y=v?e[0]*i:t.length,m=s(t,0,y,i,!0),x=[];if(!m)return x;if(v&&(m=function(t,e,i,n){var o,a,h,l,u,f=[];for(o=0,a=e.length;o<a;o++)h=e[o]*n,l=o<a-1?e[o+1]*n:t.length,(u=s(t,h,l,n,!1))===u.next&&(u.steiner=!0),f.push(p(u));for(f.sort(c),o=0;o<f.length;o++)d(f[o],i),i=r(i,i.next);return i}(t,e,m,i)),t.length>80*i){n=h=t[0],a=l=t[1];for(var w=i;w<y;w+=i)u=t[w],f=t[w+1],u<n&&(n=u),f<a&&(a=f),u>h&&(h=u),f>l&&(l=f);g=Math.max(h-n,l-a)}return o(m,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===A(t,e,i,n)>0)for(r=e;r<i;r+=n)o=T(r,t[r],t[r+1],o);else for(r=i-n;r>=e;r-=n)o=T(r,t[r],t[r+1],o);return o&&m(o,o.next)&&(S(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!m(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(S(n),(n=e=n.prev)===n.next)return null;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e<l&&(a++,n=n.nextZ);e++);for(h=l;a>0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),S(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(y(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&y(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(y(s,r,o)>=0)return!1;for(var a=s.x<r.x?s.x<o.x?s.x:o.x:r.x<o.x?r.x:o.x,h=s.y<r.y?s.y<o.y?s.y:o.y:r.y<o.y?r.y:o.y,l=s.x>r.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!m(s,r)&&x(s,n,n.next,r)&&w(s,r)&&w(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),S(n),S(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=b(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(s===o)return i.prev;var h,l=i,u=i.x,c=i.y,d=1/0;n=i.next;for(;n!==l;)s>=n.x&&n.x>=u&&s!==n.x&&g(r<c?s:o,r,u,c,r<c?o:s,r,n.x,n.y)&&((h=Math.abs(r-n.y)/(s-n.x))<d||h===d&&n.x>i.x)&&w(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=b(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x<i.x&&(i=e),e=e.next}while(e!==t);return i}function g(t,e,i,n,s,r,o,a){return(s-o)*(e-a)-(t-o)*(r-a)>=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&w(t,e)&&w(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(m(t,e)&&m(i,n)||m(t,n)&&m(i,e))||y(t,e,i)>0!=y(t,e,n)>0&&y(i,n,t)>0!=y(i,n,e)>0}function w(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function b(t,e){var i=new _(t.i,t.x,t.y),n=new _(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function T(t,e,i,n){var s=new _(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function _(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,n){for(var s=0,r=e,o=i-n;r<i;r+=n)s+=(t[o]-t[r])*(t[r+1]+t[o+1]),o=r;return s}t.exports=n,n.deviation=function(t,e,i,n){var s=e&&e.length,r=s?e[0]*i:t.length,o=Math.abs(A(t,0,r,i));if(s)for(var a=0,h=e.length;a<h;a++){var l=e[a]*i,u=a<h-1?e[a+1]*i:t.length;o-=Math.abs(A(t,l,u,i))}var c=0;for(a=0;a<n.length;a+=3){var d=n[a]*i,f=n[a+1]*i,p=n[a+2]*i;c+=Math.abs((t[d]-t[p])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[p+1]-t[d+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)},n.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,s=0;s<t.length;s++){for(var r=0;r<t[s].length;r++)for(var o=0;o<e;o++)i.vertices.push(t[s][r][o]);s>0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16}},function(t,e,i){var n={};t.exports=n;var s=i(76),r=i(81),o=i(222),a=i(33),h=i(80),l=i(505);!function(){n._inertiaScale=4,n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,n.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",gameObject:null,parts:[],plugin:{},angle:0,vertices:s.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,ignoreGravity:!1,ignorePointer:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0},lineWidth:0},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,_original:null},n=a.extend(i,e);return t(n,e),n},n.nextGroup=function(t){return t?n._nextNonCollidingGroupId--:n._nextCollidingGroupId++},n.nextCategory=function(){return n._nextCategory=n._nextCategory<<1,n._nextCategory};var t=function(t,e){e=e||{},n.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),s.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(t.bounds,t.vertices,t.velocity),n.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia});var i=t.isStatic?"#2e2b44":a.choose(["#006BA6","#0496FF","#FFBC42","#D81159","#8F2D56"]);t.render.fillStyle=t.render.fillStyle||i,t.render.strokeStyle=t.render.strokeStyle||"#000",t.render.sprite.xOffset+=-(t.bounds.min.x-t.position.x)/(t.bounds.max.x-t.bounds.min.x),t.render.sprite.yOffset+=-(t.bounds.min.y-t.position.y)/(t.bounds.max.y-t.bounds.min.y)};n.set=function(t,e,i){var s;for(s in"string"==typeof e&&(s=e,(e={})[s]=i),e)if(e.hasOwnProperty(s))switch(i=e[s],s){case"isStatic":n.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":n.setMass(t,i);break;case"density":n.setDensity(t,i);break;case"inertia":n.setInertia(t,i);break;case"vertices":n.setVertices(t,i);break;case"position":n.setPosition(t,i);break;case"angle":n.setAngle(t,i);break;case"velocity":n.setVelocity(t,i);break;case"angularVelocity":n.setAngularVelocity(t,i);break;case"parts":n.setParts(t,i);break;default:t[s]=i}},n.setStatic=function(t,e){for(var i=0;i<t.parts.length;i++){var n=t.parts[i];n.isStatic=e,e?(n._original={restitution:n.restitution,friction:n.friction,mass:n.mass,inertia:n.inertia,density:n.density,inverseMass:n.inverseMass,inverseInertia:n.inverseInertia},n.restitution=0,n.friction=1,n.mass=n.inertia=n.density=1/0,n.inverseMass=n.inverseInertia=0,n.positionPrev.x=n.position.x,n.positionPrev.y=n.position.y,n.anglePrev=n.angle,n.angularVelocity=0,n.speed=0,n.angularSpeed=0,n.motion=0):n._original&&(n.restitution=n._original.restitution,n.friction=n._original.friction,n.mass=n._original.mass,n.inertia=n._original.inertia,n.density=n._original.density,n.inverseMass=n._original.inverseMass,n.inverseInertia=n._original.inverseInertia,n._original=null)}},n.setMass=function(t,e){var i=t.inertia/(t.mass/6);t.inertia=i*(e/6),t.inverseInertia=1/t.inertia,t.mass=e,t.inverseMass=1/t.mass,t.density=t.mass/t.area},n.setDensity=function(t,e){n.setMass(t,e*t.area),t.density=e},n.setInertia=function(t,e){t.inertia=e,t.inverseInertia=1/t.inertia},n.setVertices=function(t,e){e[0].body===t?t.vertices=e:t.vertices=s.create(e,t),t.axes=l.fromVertices(t.vertices),t.area=s.area(t.vertices),n.setMass(t,t.density*t.area);var i=s.centre(t.vertices);s.translate(t.vertices,i,-1),n.setInertia(t,n._inertiaScale*s.inertia(t.vertices,t.mass)),s.translate(t.vertices,t.position),h.update(t.bounds,t.vertices,t.velocity)},n.setParts=function(t,e,i){var r;for(e=e.slice(0),t.parts.length=0,t.parts.push(t),t.parent=t,r=0;r<e.length;r++){var o=e[r];o!==t&&(o.parent=t,t.parts.push(o))}if(1!==t.parts.length){if(i=void 0===i||i){var a=[];for(r=0;r<e.length;r++)a=a.concat(e[r].vertices);s.clockwiseSort(a);var h=s.hull(a),l=s.centre(h);n.setVertices(t,h),s.translate(t.vertices,l)}var u=n._totalProperties(t);t.area=u.area,t.parent=t,t.position.x=u.centre.x,t.position.y=u.centre.y,t.positionPrev.x=u.centre.x,t.positionPrev.y=u.centre.y,n.setMass(t,u.mass),n.setInertia(t,u.inertia),n.setPosition(t,u.centre)}},n.setPosition=function(t,e){var i=r.sub(e,t.position);t.positionPrev.x+=i.x,t.positionPrev.y+=i.y;for(var n=0;n<t.parts.length;n++){var o=t.parts[n];o.position.x+=i.x,o.position.y+=i.y,s.translate(o.vertices,i),h.update(o.bounds,o.vertices,t.velocity)}},n.setAngle=function(t,e){var i=e-t.angle;t.anglePrev+=i;for(var n=0;n<t.parts.length;n++){var o=t.parts[n];o.angle+=i,s.rotate(o.vertices,i,t.position),l.rotate(o.axes,i),h.update(o.bounds,o.vertices,t.velocity),n>0&&r.rotateAbout(o.position,i,t.position,o.position)}},n.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},n.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},n.translate=function(t,e){n.setPosition(t,r.add(t.position,e))},n.rotate=function(t,e,i){if(i){var s=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;n.setPosition(t,{x:i.x+(o*s-a*r),y:i.y+(o*r+a*s)}),n.setAngle(t,t.angle+e)}else n.setAngle(t,t.angle+e)},n.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u<t.parts.length;u++){var c=t.parts[u];s.scale(c.vertices,e,i,r),c.axes=l.fromVertices(c.vertices),c.area=s.area(c.vertices),n.setMass(c,t.density*c.area),s.translate(c.vertices,{x:-c.position.x,y:-c.position.y}),n.setInertia(c,n._inertiaScale*s.inertia(c.vertices,c.mass)),s.translate(c.vertices,{x:c.position.x,y:c.position.y}),u>0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(n.setMass(t,t.density*o),n.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},n.update=function(t,e,i,n){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*n+t.force.x/t.mass*o,t.velocity.y=c*a*n+t.force.y/t.mass*o,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*a*n+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d<t.parts.length;d++){var f=t.parts[d];s.translate(f.vertices,t.velocity),d>0&&(f.position.x+=t.velocity.x,f.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(f.vertices,t.angularVelocity,t.position),l.rotate(f.axes,t.angularVelocity),d>0&&r.rotateAbout(f.position,t.angularVelocity,t.position,f.position)),h.update(f.bounds,f.vertices,t.velocity)}},n.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,s=e.y-t.position.y;t.torque+=n*i.y-s*i.x},n._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i<t.parts.length;i++){var n=t.parts[i],s=n.mass!==1/0?n.mass:1;e.mass+=s,e.area+=n.area,e.inertia+=n.inertia,e.centre=r.add(e.centre,r.mult(n.position,s))}return e.centre=r.div(e.centre,e.mass),e}}()},function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+s*s,u=n*r+s*o,c=n*a+s*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,y=(l*f-u*c)*g;return v>=0&&y>=0&&v+y<1}},function(t,e,i){var n=i(0),s=i(173),r=i(9),o=i(3),a=new n({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){var n=i(0),s=i(40),r=i(405),o=i(403),a=i(191),h=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=h},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e,i){var n={};t.exports=n;var s=i(81),r=i(33);n.create=function(t,e){for(var i=[],n=0;n<t.length;n++){var s=t[n],r={x:s.x,y:s.y,index:n,body:e,isInternal:!1,contact:null};r.contact={vertex:r,normalImpulse:0,tangentImpulse:0},i.push(r)}return i},n.fromPath=function(t,e){var i=[];return t.replace(/L?\s*([\-\d\.e]+)[\s,]*([\-\d\.e]+)*/gi,function(t,e,n){i.push({x:parseFloat(e),y:parseFloat(n)})}),n.create(i,e)},n.centre=function(t){for(var e,i,r,o=n.area(t,!0),a={x:0,y:0},h=0;h<t.length;h++)r=(h+1)%t.length,e=s.cross(t[h],t[r]),i=s.mult(s.add(t[h],t[r]),e),a=s.add(a,i);return s.div(a,6*o)},n.mean=function(t){for(var e={x:0,y:0},i=0;i<t.length;i++)e.x+=t[i].x,e.y+=t[i].y;return s.div(e,t.length)},n.area=function(t,e){for(var i=0,n=t.length-1,s=0;s<t.length;s++)i+=(t[n].x-t[s].x)*(t[n].y+t[s].y),n=s;return e?i/2:Math.abs(i)/2},n.inertia=function(t,e){for(var i,n,r=0,o=0,a=t,h=0;h<a.length;h++)n=(h+1)%a.length,r+=(i=Math.abs(s.cross(a[n],a[h])))*(s.dot(a[n],a[n])+s.dot(a[n],a[h])+s.dot(a[h],a[h])),o+=i;return e/6*(r/o)},n.translate=function(t,e,i){var n;if(i)for(n=0;n<t.length;n++)t[n].x+=e.x*i,t[n].y+=e.y*i;else for(n=0;n<t.length;n++)t[n].x+=e.x,t[n].y+=e.y;return t},n.rotate=function(t,e,i){if(0!==e){for(var n=Math.cos(e),s=Math.sin(e),r=0;r<t.length;r++){var o=t[r],a=o.x-i.x,h=o.y-i.y;o.x=i.x+(a*n-h*s),o.y=i.y+(a*s+h*n)}return t}},n.contains=function(t,e){for(var i=0;i<t.length;i++){var n=t[i],s=t[(i+1)%t.length];if((e.x-n.x)*(s.y-n.y)+(e.y-n.y)*(n.x-s.x)>0)return!1}return!0},n.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||n.centre(t);for(var h=0;h<t.length;h++)o=t[h],a=s.sub(o,r),t[h].x=r.x+a.x*e,t[h].y=r.y+a.y*i;return t},n.chamfer=function(t,e,i,n,o){e="number"==typeof e?[e]:e||[8],i=void 0!==i?i:-1,n=n||2,o=o||14;for(var a=[],h=0;h<t.length;h++){var l=t[h-1>=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h<e.length?h:e.length-1];if(0!==d){var f=s.normalise({x:u.y-l.y,y:l.x-u.x}),p=s.normalise({x:c.y-u.y,y:u.x-c.x}),g=Math.sqrt(2*Math.pow(d,2)),v=s.mult(r.clone(f),d),y=s.normalise(s.mult(s.add(f,p),.5)),m=s.sub(u,s.mult(y,g)),x=i;-1===i&&(x=1.75*Math.pow(d,.32)),(x=r.clamp(x,n,o))%2==1&&(x+=1);for(var w=Math.acos(s.dot(f,p))/x,b=0;b<x;b++)a.push(s.add(s.rotate(v,w*b),m))}else a.push(u)}return a},n.clockwiseSort=function(t){var e=n.mean(t);return t.sort(function(t,i){return s.angle(e,t)-s.angle(e,i)}),t},n.isConvex=function(t){var e,i,n,s,r=0,o=t.length;if(o<3)return null;for(e=0;e<o;e++)if(n=(e+2)%o,s=(t[i=(e+1)%o].x-t[e].x)*(t[n].y-t[i].y),(s-=(t[i].y-t[e].y)*(t[n].x-t[i].x))<0?r|=1:s>0&&(r|=2),3===r)return!1;return 0!==r||null},n.hull=function(t){var e,i,n=[],r=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i<t.length;i+=1){for(e=t[i];r.length>=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];n.length>=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),r.pop(),n.concat(r)}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","map"),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.widthInPixels=s(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.tileHeight),this.format=s(t,"format",null),this.orientation=s(t,"orientation","orthogonal"),this.renderOrder=s(t,"renderOrder","right-down"),this.version=s(t,"version","1"),this.properties=s(t,"properties",{}),this.layers=s(t,"layers",[]),this.images=s(t,"images",[]),this.objects=s(t,"objects",{}),this.collision=s(t,"collision",{}),this.tilesets=s(t,"tilesets",[]),this.imageCollections=s(t,"imageCollections",[]),this.tiles=s(t,"tiles",[])}});t.exports=r},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","layer"),this.x=s(t,"x",0),this.y=s(t,"y",0),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.baseTileWidth=s(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=s(t,"baseTileHeight",this.tileHeight),this.widthInPixels=s(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=s(t,"alpha",1),this.visible=s(t,"visible",!0),this.properties=s(t,"properties",{}),this.indexes=s(t,"indexes",[]),this.collideIndexes=s(t,"collideIndexes",[]),this.callbacks=s(t,"callbacks",[]),this.bodies=s(t,"bodies",[]),this.data=s(t,"data",[]),this.tilemapLayer=s(t,"tilemapLayer",null)}});t.exports=r},function(t,e){t.exports=function(t,e,i){return t>=0&&t<i.width&&e>=0&&e<i.height}},function(t,e){var i={};t.exports=i,i.create=function(t){var e={min:{x:0,y:0},max:{x:0,y:0}};return t&&i.update(e,t),e},i.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var n=0;n<e.length;n++){var s=e[n];s.x>t.max.x&&(t.max.x=s.x),s.x<t.min.x&&(t.min.x=s.x),s.y>t.max.y&&(t.max.y=s.y),s.y<t.min.y&&(t.min.y=s.y)}i&&(i.x>0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){var i={};t.exports=i,i.create=function(t,e){return{x:t||0,y:e||0}},i.clone=function(t){return{x:t.x,y:t.y}},i.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},i.rotate=function(t,e,i){var n=Math.cos(e),s=Math.sin(e);i||(i={});var r=t.x*n-t.y*s;return i.y=t.x*s+t.y*n,i.x=r,i},i.rotateAbout=function(t,e,i,n){var s=Math.cos(e),r=Math.sin(e);n||(n={});var o=i.x+((t.x-i.x)*s-(t.y-i.y)*r);return n.y=i.y+((t.x-i.x)*r+(t.y-i.y)*s),n.x=o,n},i.normalise=function(t){var e=i.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},i.dot=function(t,e){return t.x*e.x+t.y*e.y},i.cross=function(t,e){return t.x*e.y-t.y*e.x},i.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},i.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},i.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},i.mult=function(t,e){return{x:t.x*e,y:t.y*e}},i.div=function(t,e){return{x:t.x/e,y:t.y/e}},i.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},i.neg=function(t){return{x:-t.x,y:-t.y}},i.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},i._temp=[i.create(),i.create(),i.create(),i.create(),i.create(),i.create()]},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r,o){for(var a=n.getTintAppendFloatAlphaAndSwap(i.fillColor,i.fillAlpha*s),h=i.pathData,l=i.pathIndexes,u=0;u<l.length;u+=3){var c=2*l[u],d=2*l[u+1],f=2*l[u+2],p=h[c+0]-r,g=h[c+1]-o,v=h[d+0]-r,y=h[d+1]-o,m=h[f+0]-r,x=h[f+1]-o,w=e.getX(p,g),b=e.getY(p,g),T=e.getX(v,y),S=e.getY(v,y),_=e.getX(m,x),A=e.getY(m,x);t.setTexture2D(),t.batchTri(w,b,T,S,_,A,0,0,1,1,a,a,a,t.tintEffect)}}},function(t,e){t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e,i){var n=i(174);t.exports=function(t,e){if("string"==typeof t&&n.hasOwnProperty(t)){if(e){var i=e.slice(0);return i.unshift(0),function(e){return i[0]=e,n[t].apply(this,i)}}return n[t]}return"function"==typeof t?t:(Array.isArray(t)&&t.length,n.Power0)}},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(826),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,s){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(n,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=a},function(t,e,i){var n=i(417),s=i(0),r=i(2),o=i(4),a=i(8),h=i(312),l=i(95),u=i(61),c=new s({initialize:function(t,e,i){i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?a(e[0])&&(i=e,e=null):a(e)&&(i=e,e=null),this.scene=t,this.children=new l(e),this.isParent=!0,this.classType=r(i,"classType",u),this.active=r(i,"active",!0),this.maxSize=r(i,"maxSize",-1),this.defaultKey=r(i,"defaultKey",null),this.defaultFrame=r(i,"defaultFrame",null),this.runChildUpdate=r(i,"runChildUpdate",!1),this.createCallback=r(i,"createCallback",null),this.removeCallback=r(i,"removeCallback",null),this.createMultipleCallback=r(i,"createMultipleCallback",null),i&&this.createMultiple(i)},create:function(t,e,i,n,s,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===s&&(s=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=s,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i<t.length;i++){var n=this.createFromConfig(t[i]);e=e.concat(n)}return e},createFromConfig:function(t){if(this.isFull())return[];this.classType=r(t,"classType",this.classType);var e=r(t,"key",void 0),i=r(t,"frame",null),s=r(t,"visible",!0),a=r(t,"active",!0),l=[];if(void 0===e)return l;Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);for(var u=r(t,"repeat",0),c=r(t,"randomKey",!1),d=r(t,"randomFrame",!1),f=r(t,"yoyo",!1),p=r(t,"frameQuantity",1),g=r(t,"max",0),v=h(e,i,{max:g,qty:p,random:c,randomB:d,repeat:u,yoyo:f}),y=0;y<v.length;y++){var m=this.create(0,0,v[y].a,v[y].b,s,a);if(!m)break;l.push(m)}var x=o(t,"setXY.x",0),w=o(t,"setXY.y",0),b=o(t,"setXY.stepX",0),T=o(t,"setXY.stepY",0);n.SetXY(l,x,w,b,T);var S=o(t,"setRotation.value",0),_=o(t,"setRotation.step",0);n.SetRotation(l,S,_);var A=o(t,"setScale.x",1),C=o(t,"setScale.y",A),M=o(t,"setScale.stepX",0),P=o(t,"setScale.stepY",0);n.SetScale(l,A,C,M,P);var E=o(t,"setAlpha.value",1),k=o(t,"setAlpha.step",0);n.SetAlpha(l,E,k);var L=r(t,"hitArea",null),F=r(t,"hitAreaCallback",null);L&&n.SetHitArea(l,L,F);var R=r(t,"gridAlign",!1);return R&&n.GridAlign(l,R),this.createMultipleCallback&&this.createMultipleCallback.call(this,l),l},preUpdate:function(t,e){if(this.runChildUpdate&&0!==this.children.size)for(var i=this.children.entries.slice(),n=0;n<i.length;n++){var s=i[n];s.active&&s.update(t,e)}},add:function(t,e){return void 0===e&&(e=!1),this.isFull()?this:(this.children.set(t),this.createCallback&&this.createCallback.call(this,t),e&&(this.scene.sys.displayList.add(t),t.preUpdate&&this.scene.sys.updateList.add(t)),t.on("destroy",this.remove,this),this)},addMultiple:function(t,e){if(void 0===e&&(e=!1),Array.isArray(t))for(var i=0;i<t.length;i++)this.add(t[i],e);return this},remove:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),this.children.contains(t)?(this.children.delete(t),this.removeCallback&&this.removeCallback.call(this,t),t.off("destroy",this.remove,this),i?t.destroy():e&&(t.scene.sys.displayList.remove(t),t.preUpdate&&t.scene.sys.updateList.remove(t)),this):this},clear:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.children,n=0;n<i.size;n++){var s=i.entries[n];s.off("destroy",this.remove,this),e?s.destroy():t&&(s.scene.sys.displayList.remove(s),s.preUpdate&&s.scene.sys.updateList.remove(s))}return this.children.clear(),this},contains:function(t){return this.children.contains(t)},getChildren:function(){return this.children.entries},getLength:function(){return this.children.size},getFirst:function(t,e,i,n,s,r,o){return this.getHandler(!0,1,t,e,i,n,s,r,o)},getFirstNth:function(t,e,i,n,s,r,o,a){return this.getHandler(!0,t,e,i,n,s,r,o,a)},getLast:function(t,e,i,n,s,r,o){return this.getHandler(!1,1,t,e,i,n,s,r,o)},getLastNth:function(t,e,i,n,s,r,o,a){return this.getHandler(!1,t,e,i,n,s,r,o,a)},getHandler:function(t,e,i,n,s,r,o,a,h){var l,u;void 0===i&&(i=!1),void 0===n&&(n=!1);var c=0,d=this.children.entries;if(t)for(u=0;u<d.length;u++)if((l=d[u]).active===i){if(++c===e)break}else l=null;else for(u=d.length-1;u>=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i<this.children.size;i++)this.children.entries[i].active===t&&e++;return e},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var t=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-t},setDepth:function(t,e){return n.SetDepth(this.children.entries,t,e),this},kill:function(t){this.children.contains(t)&&t.setActive(!1)},killAndHide:function(t){this.children.contains(t)&&(t.setActive(!1),t.setVisible(!1))},toggleVisible:function(){return n.ToggleVisible(this.children.entries),this},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){if(t)for(var e=this.children,i=0;i<e.size;i++){var n=e.entries[i];n.off("destroy",this.remove,this),n.destroy()}this.children.clear(),this.scene=void 0,this.children=void 0}}});t.exports=c},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,s=(i-t.y)/t.height;return(n*=n)+(s*=s)<.25}},function(t,e,i){var n=i(0),s=i(89),r=i(308),o=i(307),a=i(185),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=h},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],s=e;s<i;s++)t[s]=t[s+1];return t.length=i,n}}},function(t,e,i){(function(e){var i={android:!1,chromeOS:!1,cocoonJS:!1,cocoonJSApp:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){var t=navigator.userAgent;/Windows/.test(t)?i.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?i.macOS=!0:/Android/.test(t)?i.android=!0:/Linux/.test(t)?i.linux=!0:/iP[ao]d|iPhone/i.test(t)?(i.iOS=!0,navigator.appVersion.match(/OS (\d+)/),i.iOSVersion=parseInt(RegExp.$1,10),i.iPhone=-1!==t.toLowerCase().indexOf("iphone"),i.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?i.kindle=!0:/CrOS/.test(t)&&(i.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(i.android=!1,i.iOS=!1,i.macOS=!1,i.windows=!0,i.windowsPhone=!0);var n=/Silk/.test(t);if((i.windows||i.macOS||i.linux&&!n||i.chromeOS)&&(i.desktop=!0),(i.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(i.desktop=!1),navigator.standalone&&(i.webApp=!0),void 0!==window.cordova&&(i.cordova=!0),void 0!==e&&e.versions&&e.versions.node&&(i.node=!0),i.node&&"object"==typeof e.versions&&(i.nodeWebkit=!!e.versions["node-webkit"],i.electron=!!e.versions.electron),navigator.isCocoonJS){i.cocoonJS=!0;try{i.cocoonJSApp="undefined"!=typeof CocoonJS}catch(t){i.cocoonJSApp=!1}}return void 0!==window.ejecta&&(i.ejecta=!0),/Crosswalk/.test(t)&&(i.crosswalk=!0),i.pixelRatio=window.devicePixelRatio||1,i}()}).call(this,i(907))},function(t,e,i){var n=i(23);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e])},set:function(t){return-1===this.entries.indexOf(t)&&this.entries.push(t),this},get:function(t,e){for(var i=0;i<this.entries.length;i++){var n=this.entries[i];if(n[t]===e)return n}},getArray:function(){return this.entries.slice(0)},delete:function(t){var e=this.entries.indexOf(t);return e>-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t<this.entries.length;t++){var e=this.entries[t];console.log(e)}console.groupEnd()},each:function(t,e){var i,n=this.entries.slice(),s=n.length;if(e)for(i=0;i<s&&!1!==t.call(e,n[i],i);i++);else for(i=0;i<s&&!1!==t(n[i],i);i++);return this},iterate:function(t,e){var i,n=this.entries.length;if(e)for(i=0;i<n&&!1!==t.call(e,this.entries[i],i);i++);else for(i=0;i<n&&!1!==t(this.entries[i],i);i++);return this},iterateLocal:function(t){var e,i=[];for(e=1;e<arguments.length;e++)i.push(arguments[e]);var n=this.entries.length;for(e=0;e<n;e++){var s=this.entries[e];s[t].apply(s,i)}return this},clear:function(){return this.entries.length=0,this},contains:function(t){return this.entries.indexOf(t)>-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return t<this.entries.length?this.entries.length=t:this.entries.length}}});t.exports=n},function(t,e,i){var n=i(63);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i}},function(t,e,i){var n=i(129),s=i(12),r=i(84),o=i(86),a=i(98),h=i(205),l=i(131),u=i(4),c=i(130),d=i(128),f=i(127);t.exports=function(t,e,i){void 0===i&&(i=n);for(var p=i.targets?i.targets:l(e),g=h(e),v=a(e,"delay",i.delay),y=a(e,"duration",i.duration),m=u(e,"easeParams",i.easeParams),x=o(u(e,"ease",i.ease),m),w=a(e,"hold",i.hold),b=a(e,"repeat",i.repeat),T=a(e,"repeatDelay",i.repeatDelay),S=r(e,"yoyo",i.yoyo),_=r(e,"flipX",i.flipX),A=r(e,"flipY",i.flipY),C=[],M=0;M<g.length;M++)for(var P=g[M].key,E=g[M].value,k=0;k<p.length;k++){var L=c(P,E),F=f(p[k],P,L.getEnd,L.getStart,o(u(E,"ease",x),m),a(E,"delay",v),a(E,"duration",y),r(E,"yoyo",S),a(E,"hold",w),a(E,"repeat",b),a(E,"repeatDelay",T),r(E,"flipX",_),r(E,"flipY",A));C.push(F)}var R=new d(t,C,p);R.offset=s(e,"offset",null),R.completeDelay=s(e,"completeDelay",0),R.loop=Math.round(s(e,"loop",0)),R.loopDelay=Math.round(s(e,"loopDelay",0)),R.paused=r(e,"paused",!1),R.useFrames=r(e,"useFrames",!1);for(var O=u(e,"callbackScope",R),D=[R,null],B=d.TYPES,I=0;I<B.length;I++){var Y=B[I],X=u(e,Y,!1);if(X){var z=u(e,Y+"Scope",O),N=u(e,Y+"Params",[]);R.setCallback(Y,X,D.concat(N),z)}}return R}},function(t,e){t.exports=function(t,e,i){var n;n=t.hasOwnProperty(e)?"function"==typeof t[e]?function(i,n,s){return t[e](i,n,s)}:function(){return t[e]}:"function"==typeof i?i:function(){return i};return n}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o,a){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o={}),void 0===a&&(a={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=n,this.tileMargin=s,this.tileSpacing=r,this.tileProperties=o,this.tileData=a,this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},getTileTextureCoordinates:function(t){return this.containsTileIndex(t)?this.texCoordinates[t-this.firstgid]:null},setImage:function(t){return this.image=t,this.glTexture=t.get().source.glTexture,this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e){var i=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),n=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);i%1==0&&n%1==0||console.warn("Image tile area not tile size multiple in: "+this.name),i=Math.floor(i),n=Math.floor(n),this.rows=i,this.columns=n,this.total=i*n,this.texCoordinates.length=0;for(var s=this.tileMargin,r=this.tileMargin,o=0;o<this.rows;o++){for(var a=0;a<this.columns;a++)this.texCoordinates.push({x:s,y:r}),s+=this.tileWidth+this.tileSpacing;s=this.tileMargin,r+=this.tileHeight+this.tileSpacing}return this}});t.exports=n},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.y+e.scrollY*(1-s.scrollFactorY),n*=s.scaleY),r+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileWidth,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.x+e.scrollX*(1-s.scrollFactorX),n*=s.scaleX),r+t*n}},function(t,e,i){var n=i(79);t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),n(t,e,s)){var r=s.data[e][t];return null===r?null:-1===r.index?i?r:null:r}return null}},function(t,e,i){t.exports={CalculateFacesAt:i(136),CalculateFacesWithin:i(34),Copy:i(489),CreateFromTiles:i(488),CullTiles:i(487),Fill:i(486),FilterTiles:i(485),FindByIndex:i(484),FindTile:i(483),ForEachTile:i(482),GetTileAt:i(102),GetTileAtWorldXY:i(481),GetTilesWithin:i(17),GetTilesWithinShape:i(480),GetTilesWithinWorldXY:i(479),HasTileAt:i(219),HasTileAtWorldXY:i(478),IsInLayerBounds:i(79),PutTileAt:i(135),PutTileAtWorldXY:i(477),PutTilesAt:i(476),Randomize:i(475),RemoveTileAt:i(218),RemoveTileAtWorldXY:i(474),RenderDebug:i(473),ReplaceByIndex:i(220),SetCollision:i(472),SetCollisionBetween:i(471),SetCollisionByExclusion:i(470),SetCollisionByProperty:i(469),SetCollisionFromCollisionGroup:i(468),SetTileIndexCallback:i(467),SetTileLocationCallback:i(466),Shuffle:i(465),SwapByIndex:i(464),TileToWorldX:i(101),TileToWorldXY:i(463),TileToWorldY:i(100),WeightedRandomize:i(462),WorldToTileX:i(50),WorldToTileXY:i(461),WorldToTileY:i(49)}},function(t,e,i){var n=i(0),s=i(236),r=i(61),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},function(t,e){t.exports=function(t,e,i,n,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),{responseType:t,async:e,user:i,password:n,timeout:s,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e,i){var n=i(4),s={},r={register:function(t,e,i,n,r){s[t]={plugin:e,mapping:i,settingsKey:n,configKey:r}},getPlugin:function(t){return s[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in s){var a=s[o].plugin,h=s[o].mapping,l=s[o].settingsKey,u=s[o].configKey;n(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){s.hasOwnProperty(t)&&delete s[t]}};t.exports=r},function(t,e,i){var n=i(6);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(u-h)*(r-l)-(c-l)*(s-h),f=(o-s)*(r-l)-(a-r)*(s-h),p=(c-l)*(o-s)-(u-h)*(a-r);if(0===p)return!1;var g=d/p,v=f/p;return g>=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(731),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.Size,s.Texture,s.Transform,s.Visible,s.ScrollFactor,o],initialize:function(t,e,i,n,s,o,a,h,l){if(r.call(this,t,"Mesh"),n.length!==s.length)throw new Error("Mesh Vertex count must match UV count");var u,c=n.length/2|0;if(o.length>0&&o.length<c)throw new Error("Mesh Color count must match Vertex count");if(a.length>0&&a.length<c)throw new Error("Mesh Alpha count must match Vertex count");if(0===o.length)for(u=0;u<c;++u)o[u]=16777215;if(0===a.length)for(u=0;u<c;++u)a[u]=1;this.vertices=new Float32Array(n),this.uv=new Float32Array(s),this.colors=new Uint32Array(o),this.alphas=new Float32Array(a),this.tintFill=!1,this.setTexture(h,l),this.setPosition(e,i),this.setSizeToFrame(),this.setOrigin(),this.initPipeline()}});t.exports=a},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(846),a=i(845),h=i(844),l=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Texture,s.Tint,s.Transform,s.Visible,h],initialize:function(t,e,i,n,s,a,h){void 0===s&&(s=""),void 0===h&&(h=0),r.call(this,t,"BitmapText"),this.font=n;var l=this.scene.sys.cache.bitmapFont.get(n);this.fontData=l.data,this._text="",this._fontSize=a||this.fontData.size,this._letterSpacing=0,this._align=h,this._bounds=o(this,!1,this._bounds),this._dirty=!1,this.setTexture(l.texture,l.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.setText(s)},setLeftAlign:function(){return this._align=l.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=l.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=l.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},getTextBounds:function(t){return this._dirty&&o(this,t,this._bounds),this._bounds},setFont:function(t,e,i){if(void 0===e&&(e=this._fontSize),void 0===i&&(i=this._align),t!==this.font){var n=this.scene.sys.cache.bitmapFont.get(t);n&&(this.font=t,this.fontData=n.data,this._fontSize=e,this._align=i,this.setTexture(n.texture,n.frame),o(this,!1,this._bounds))}return this},align:{set:function(t){this._align=t,this._dirty=!0},get:function(){return this._align}},text:{set:function(t){this.setText(t)},get:function(){return this._text}},fontSize:{set:function(t){this._fontSize=t,this._dirty=!0},get:function(){return this._fontSize}},letterSpacing:{set:function(t){this._letterSpacing=t,this._dirty=!0},get:function(){return this._letterSpacing}},width:{get:function(){return this.getTextBounds(!1),this._bounds.global.width}},height:{get:function(){return this.getTextBounds(!1),this._bounds.global.height}},toJSON:function(){var t=s.ToJSON(this),e={font:this.font,text:this.text,fontSize:this.fontSize,letterSpacing:this.letterSpacing,align:this.align};return t.data=e,t}});l.ALIGN_LEFT=0,l.ALIGN_CENTER=1,l.ALIGN_RIGHT=2,l.ParseFromAtlas=a,t.exports=l},function(t,e,i){!function(){var e=function(t,e){return i(t.slice(),e)};function i(t,e){"function"!=typeof e&&(e=function(t,e){return String(t).localeCompare(e)});var i=t.length;if(i<=1)return t;for(var s=new Array(i),r=1;r<i;r*=2){n(t,e,r,s);var o=t;t=s,s=o}return t}e.inplace=function(t,e){var s=i(t,e);return s!==t&&n(s,null,t.length,t),t};var n=function(t,e,i,n){var s,r,o,a,h,l=t.length,u=0,c=2*i;for(s=0;s<l;s+=c)for(o=(r=s+i)+i,r>l&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a<r&&h<o)e(t[a],t[h])<=0?n[u++]=t[a++]:n[u++]=t[h++];else if(a<r)n[u++]=t[a++];else{if(!(h<o))break;n[u++]=t[h++]}};t.exports=e}()},function(t,e,i){var n=i(163),s=i(315);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=s(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=s(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i<t.length;i++)t[i].reverse();t.reverse()}return t}},function(t,e,i){var n=i(164),s=i(0),r=i(1),o=i(110),a=new s({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?n.Add(this.list,t):n.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?n.AddAt(this.list,t,e):n.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t){return t&&(this._sortKey=t,o.inplace(this.list,this.sortHandler)),this},sortHandler:function(t,e){return t[this._sortKey]-e[this._sortKey]},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,s){return n.GetFirstElement(this.list,t,e,i,s)},getAll:function(t,e,i,s){return n.GetAll(this.list,t,e,i,s)},count:function(t,e){return n.CountAllMatching(this.list,t,e)},swap:function(t,e){n.Swap(this.list,t,e)},moveTo:function(t,e){return n.MoveTo(this.list,t,e)},remove:function(t,e){return e?n.Remove(this.list,t):n.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?n.RemoveAt(this.list,t):n.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?n.RemoveBetween(this.list,t,e):n.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return n.BringToTop(this.list,t)},sendToBack:function(t){return n.SendToBack(this.list,t)},moveUp:function(t){return n.MoveUp(this.list,t),t},moveDown:function(t){return n.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e){return n.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n<arguments.length;n++)i.push(arguments[n]);for(n=0;n<this.list.length;n++)i[0]=this.list[n],t.apply(e,i)},shutdown:function(){this.removeAll(),this.list=[]},destroy:function(){this.removeAll(),this.parent=null,this.addCallback=null,this.removeCallback=null},length:{get:function(){return this.list.length}},first:{get:function(){return this.position=0,this.list.length>0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return this.position>0?(this.position--,this.list[this.position]):null}}});t.exports=a},function(t,e,i){var n=i(0),s=i(23),r=i(20),o=new n({initialize:function(t,e,i,n,s,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,o,n,s)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var s=this.data,r=s.cut;r.x=i,r.y=n,r.w=t,r.h=e,r.r=i+t,r.b=n+e,s.sourceSize.w=t,s.sourceSize.h=e,s.spriteSourceSize.w=t,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(t*t+e*e);var o=s.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,a.r=i+s,a.b=n+r,this.x=i,this.y=n,this.width=s,this.height=r,this.halfWidth=.5*s,this.halfHeight=.5*r,this.centerX=Math.floor(s/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,n,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=s(e,0,d)),g=l+(i=s(i,0,f)),v=n=s(n,0,d-e),y=r=s(r,0,f-i),m=this.data;if(m.trim){var x=m.spriteSourceSize,w=e+(n=s(n,0,u-e)),b=i+(r=s(r,0,c-i));if(!(x.r<e||x.b<i||x.x>w||x.y>b)){var T=Math.max(x.x,e),S=Math.max(x.y,i),_=Math.min(x.r,w)-T,A=Math.min(x.b,b)-S;v=_,y=A,p=o?h+(u-(T-x.x)-_):h+(T-x.x),g=a?l+(c-(S-x.y)-A):l+(S-x.y),e=T,i=S,n=_,r=A}else p=0,g=0,v=0,y=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var C=this.source.width,M=this.source.height;return t.u0=Math.max(0,p/C),t.v0=Math.max(0,g/M),t.u1=Math.min(1,(p+v)/C),t.v1=Math.min(1,(g+y)/M),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=y,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},function(t,e,i){var n=i(0),s=i(11),r=i(20),o=i(1),a=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=r(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=r(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=r(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=r(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit("destroy",this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=a},function(t,e,i){var n=i(0),s=i(63),r=i(11),o=i(1),a=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on("blur",function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on("focus",function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on("prestep",this.update,this),t.events.once("destroy",this.destroy,this)},add:o,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once("ended",i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once("ended",n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit("pauseall",this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit("resumeall",this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit("stopall",this)},unlock:o,onBlur:o,onFocus:o,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit("unlocked",this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n.pendingRemove||t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("rate",this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("detune",this,t)}}});t.exports=a},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){var n,s=i(92),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(n=navigator.userAgent,/Edge\/\d+/.test(n)?r.edge=!0:/Chrome\/(\d+)/.test(n)&&!s.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(n)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(n)&&s.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(n)?r.opera=!0:/Safari/.test(n)&&!s.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(r.silk=!0),r)},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e){var i,n="";t.exports={disable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!1),t},enable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!0),t},getPrefix:i=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i<e.length;i++){var n=e[i]+"mageSmoothingEnabled";if(n in t)return n}return null},isEnabled:function(t){return null!==n?t[n]:null}}},function(t,e,i){var n=i(0),s=i(14),r=i(31),o=i(11),a=i(9),h=i(38),l=i(178),u=i(3),c=new n({Extends:o,Mixins:[s.Alpha,s.Visible],initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),o.call(this),this.scene,this.sceneManager,this.config,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new a,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new a,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new h,this.transparent=!0,this.backgroundColor=l("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new u(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new u);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOn:function(t,e){var i=.5*this.width,n=.5*this.height;return this.midPoint.set(t,e),this.scrollX=t-i,this.scrollY=e-n,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;g<p;++g){var v=t[g];if(v.hasOwnProperty("width")&&!v.parentContainer){var y=v.width,m=v.height,x=v.x-l*v.scrollFactorX-y*v.originX,w=v.y-u*v.scrollFactorY-m*v.originY,b=x*i+w*s+a,T=x*n+w*r+h,S=(x+y)*i+(w+m)*s+a,_=(x+y)*n+(w+m)*r+h,A=c+y,C=d+m;b>-y&&T>-m&&b<A&&T<C&&S>-y&&_>-m&&S<A&&_<C&&f.push(v)}else f.push(v)}return f},getWorldPoint:function(t,e,i){void 0===i&&(i=new u);var n=this.matrix.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5],c=s*a-r*o;if(!c)return i.x=t,i.y=e,i;var d=a*(c=1/c),f=-r*c,p=-o*c,g=s*c,v=(o*l-a*h)*c,y=(r*h-s*l)*c,m=Math.cos(this.rotation),x=Math.sin(this.rotation),w=this.zoom,b=this.resolution,T=this.scrollX,S=this.scrollY,_=t+(T*m-S*x)*w,A=e+(T*x+S*m)*w;return i.x=(_*d+A*p)*b+v,i.y=(_*f+A*g)*b+y,i},ignore:function(t){var e=this.id;Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];Array.isArray(n)?this.ignore(n):n.isParent?this.ignore(n.getChildren()):n.cameraFilter|=e}return this},preRender:function(t,e){var i=this.width,n=this.height,s=.5*i,r=.5*n,o=this.zoom*t,a=this.matrix,h=i*this.originX,l=n*this.originY,u=this.scrollX,c=this.scrollY;this.useBounds&&(u=this.clampX(u),c=this.clampY(c)),this.roundPixels&&(h=Math.round(h),l=Math.round(l)),this.scrollX=u,this.scrollY=c;var d=u+s,f=c+r;this.midPoint.set(d,f);var p=i/o,g=n/o;this.worldView.setTo(d-p/2,f-g/2,p,g),a.loadIdentity(),a.scale(e,e),a.translate(this.x+h,this.y+l),a.rotate(this.rotation),a.scale(o,o),a.translate(-h,-l)},clampX:function(t){var e=this._bounds,i=this.displayWidth,n=e.x+(i-this.width)/2,s=Math.max(n,n+e.width-i);return t<n?t=n:t>s&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return t<n?t=n:t>s&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=l(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.config=t.sys.game.config,this.sceneManager=t.sys.game.scene;var e=this.config.resolution;return this.resolution=e,this._cx=this._x*e,this._cy=this._y*e,this._cw=this._width*e,this._ch=this._height*e,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.config){var t=0!==this._x||0!==this._y||this.config.width!==this._width||this.config.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit("cameradestroy",this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.config=null,this.sceneManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=c},function(t,e){t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n<t.length;n++)i.push(e[t[n]]);return i}return e[t]},getAll:function(){var t={};for(var e in this.list)this.list.hasOwnProperty(e)&&(t[e]=this.list[e]);return t},query:function(t){var e={};for(var i in this.list)this.list.hasOwnProperty(i)&&i.match(t)&&(e[i]=this.list[i]);return e},set:function(t,e){if(this._frozen)return this;if("string"==typeof t)return this.setValue(t,e);for(var i in t)this.setValue(i,t[i]);return this},setValue:function(t,e){if(this._frozen)return this;if(this.has(t))this.values[t]=e;else{var i=this,n=this.list,s=this.events,r=this.parent;Object.defineProperty(this.values,t,{enumerable:!0,configurable:!0,get:function(){return n[t]},set:function(e){if(!i._frozen){var o=n[t];n[t]=e,s.emit("changedata",r,t,e,o),s.emit("changedata_"+t,r,e,o)}}}),n[t]=e,s.emit("setdata",r,t,e)}return this},each:function(t,e){for(var i=[this.parent,null,void 0],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var s in this.list)i[1]=s,i[2]=this.list[s],t.apply(e,i);return this},merge:function(t,e){for(var i in void 0===e&&(e=!0),t)t.hasOwnProperty(i)&&(e||!e&&!this.has(i))&&this.setValue(i,t[i]);return this},remove:function(t){if(this._frozen)return this;if(!Array.isArray(t))return this.removeValue(t);for(var e=0;e<t.length;e++)this.removeValue(t[e]);return this},removeValue:function(t){if(this.has(t)){var e=this.list[t];delete this.list[t],delete this.values[t],this.events.emit("removedata",this.parent,t,e)}return this},pop:function(t){var e=void 0;return!this._frozen&&this.has(t)&&(e=this.list[t],delete this.list[t],delete this.values[t],this.events.emit("removedata",this,t,e)),e},has:function(t){return this.list.hasOwnProperty(t)},setFreeze:function(t){return this._frozen=t,this},reset:function(){for(var t in this.list)delete this.list[t],delete this.values[t];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off("changedata"),this.events.off("setdata"),this.events.off("removedata"),this.parent=null},freeze:{get:function(){return this._frozen},set:function(t){this._frozen=!!t}},count:{get:function(){var t=0;for(var e in this.list)void 0!==this.list[e]&&t++;return t}}});t.exports=n},function(t,e){t.exports=function(t){return 2*(t.width+t.height)}},function(t,e,i){var n=i(66),s=i(71),r=i(40),o=i(0),a=i(14),h=i(19),l=i(9),u=i(39),c=new o({Extends:h,Mixins:[a.Depth,a.GetBounds,a.Origin,a.ScaleMode,a.Transform,a.ScrollFactor,a.Visible],initialize:function(t,e,i,s,r){void 0===s&&(s=1),void 0===r&&(r=s),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=s,this.height=r,this.blendMode=n.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){return void 0===i&&(i=!0),this.width=t,this.height=e,i&&this.input&&this.input.hitArea instanceof l&&(this.input.hitArea.width=t,this.input.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new s(0,0,t),r)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return void 0===t?this.setRectangleDropZone(this.width,this.height):this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},renderCanvas:function(){},renderWebGL:function(){}});t.exports=c},function(t,e,i){var n={};t.exports=n;var s=i(76),r=i(33),o=i(67),a=i(80),h=i(81),l=i(1069);n.rectangle=function(t,e,i,n,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:s.fromPath("L 0 0 L "+i+" 0 L "+i+" "+n+" L 0 "+n)};if(a.chamfer){var l=a.chamfer;h.vertices=s.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},n.trapezoid=function(t,e,i,n,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-n+" L "+c+" "+-n+" L "+d+" 0":"L 0 0 L "+c+" "+-n+" L "+d+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:s.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=s.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return o.create(r.extend({},f,h))},n.circle=function(t,e,i,s,o){s=s||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),n.polygon(t,e,h,i,r.extend({},a,s))},n.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return n.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d<i;d+=1){var f=c+d*l,p=Math.cos(f)*a,g=Math.sin(f)*a;u+="L "+p.toFixed(3)+" "+g.toFixed(3)+" "}var v={label:"Polygon Body",position:{x:t,y:e},vertices:s.fromPath(u)};if(h.chamfer){var y=h.chamfer;v.vertices=s.chamfer(v.vertices,y.radius,y.quality,y.qualityMin,y.qualityMax),delete h.chamfer}return o.create(r.extend({},v,h))},n.fromVertices=function(t,e,i,n,u,c,d){var f,p,g,v,y,m,x,w,b;for(n=n||{},p=[],u=void 0!==u&&u,c=void 0!==c?c:.01,d=void 0!==d?d:10,l||r.warn("Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull."),r.isArray(i[0])||(i=[i]),w=0;w<i.length;w+=1)if(v=i[w],(g=s.isConvex(v))||!l)v=g?s.clockwiseSort(v):s.hull(v),p.push({position:{x:t,y:e},vertices:v});else{var T=v.map(function(t){return[t.x,t.y]});l.makeCCW(T),!1!==c&&l.removeCollinearPoints(T,c);var S=l.quickDecomp(T);for(y=0;y<S.length;y++){var _=S[y].map(function(t){return{x:t[0],y:t[1]}});d>0&&s.area(_)<d||p.push({position:s.centre(_),vertices:_})}}for(y=0;y<p.length;y++)p[y]=o.create(r.extend(p[y],n));if(u)for(y=0;y<p.length;y++){var A=p[y];for(m=y+1;m<p.length;m++){var C=p[m];if(a.overlaps(A.bounds,C.bounds)){var M=A.vertices,P=C.vertices;for(x=0;x<A.vertices.length;x++)for(b=0;b<C.vertices.length;b++){var E=h.magnitudeSquared(h.sub(M[(x+1)%M.length],P[b])),k=h.magnitudeSquared(h.sub(M[x],P[(b+1)%P.length]));E<5&&k<5&&(M[x].isInternal=!0,P[b].isInternal=!0)}}}}return p.length>1?(f=o.create(r.extend({parts:p.slice(0)},n)),o.setPosition(f,{x:t,y:e}),f):p[0]}},function(t,e){t.exports=function(t,e,i,n,s,r,o,a,h,l,u,c,d){return{target:t,key:e,getEndValue:i,getStartValue:n,ease:s,duration:0,totalDuration:0,delay:0,yoyo:a,hold:0,repeat:0,repeatDelay:0,flipX:c,flipY:d,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:r,duration:o,hold:h,repeat:l,repeatDelay:u},state:0}}},function(t,e,i){var n=i(0),s=i(13),r=i(5),o=i(83),a=new n({initialize:function(t,e,i){this.parent=t,this.parentIsTimeline=t.hasOwnProperty("isTimeline"),this.data=e,this.totalData=e.length,this.targets=i,this.totalTargets=i.length,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onRepeat:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(){return this.data[0].current},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},isPaused:function(){return this.state===o.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){for(var n=0;n<this.totalData;n++){var s=this.data[n];if(s.key===t){s.end=e,i&&(s.start=s.current);break}}return this},restart:function(){this.state===o.REMOVED?(this.seek(0),this.parent.makeActive(this)):(this.stop(),this.play())},calcDuration:function(){for(var t=0,e=this.data,i=0;i<this.totalData;i++){var n=e[i];n.t1=n.duration+n.hold,n.yoyo&&(n.t1+=n.duration),n.t2=n.t1+n.repeatDelay,n.totalDuration=n.delay+n.t1,-1===n.repeat?n.totalDuration+=999999999999*n.t2:n.repeat>0&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration)}this.duration=t,this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){for(var t=this.data,e=this.totalTargets,i=0;i<this.totalData;i++){var n=t[i],s=n.target,r=n.gen;n.delay=r.delay(i,e,s),n.duration=r.duration(i,e,s),n.hold=r.hold(i,e,s),n.repeat=r.repeat(i,e,s),n.repeatDelay=r.repeatDelay(i,e,s)}return this.calcDuration(),this.progress=0,this.totalProgress=0,this.elapsed=0,this.totalElapsed=0,this.paused&&!this.parentIsTimeline?(this.state=o.PENDING_ADD,this._pausedState=o.INIT,!1):(this.state=o.INIT,!0)},nextState:function(){if(this.loopCounter>0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&(t.params[1]=this.targets,t.func.apply(t.scope,t.params)),this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},pause:function(){if(this.state!==o.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=o.PAUSED,this},play:function(t){if(this.state!==o.ACTIVE){this.state!==o.PENDING_REMOVE&&this.state!==o.REMOVED||(this.init(),this.parent.makeActive(this),t=!0);var e=this.callbacks.onStart;this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?(e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.ACTIVE):(this.countdown=this.calculatedOffset,this.state=o.OFFSET_DELAY)):this.paused?(this.paused=!1,this.parent.makeActive(this)):(this.resetTweenData(t),this.state=o.ACTIVE,e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.parent.makeActive(this))}},resetTweenData:function(t){for(var e=this.data,i=0;i<this.totalData;i++){var n=e[i];n.progress=0,n.elapsed=0,n.repeatCounter=-1===n.repeat?999999999999:n.repeat,t?(n.start=n.getStartValue(n.target,n.key,n.start),n.end=n.getEndValue(n.target,n.key,n.end),n.current=n.start,n.state=o.PLAYING_FORWARD):n.delay>0?(n.elapsed=n.delay,n.state=o.DELAY):n.state=o.PENDING_RENDER}},resume:function(){return this.state===o.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t){for(var e=this.data,i=0;i<this.totalData;i++){var n=this.totalDuration*t,s=e[i],r=0,o=0;n<=s.delay?(r=0,o=0):n>=s.totalDuration?(r=1,o=s.duration):n>s.delay&&n<=s.t1?(r=(n=Math.max(0,n-s.delay))/s.t1,o=s.duration*r):n>s.t1&&n<s.totalDuration&&(n-=s.delay,(n=(n-=s.t1)/s.t2%1*s.t2)>s.repeatDelay&&(r=n/s.t1,o=s.duration*r)),s.progress=r,s.elapsed=o;var a=s.ease(s.progress);s.current=s.start+(s.end-s.start)*a,s.target[s.key]=s.current}},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){if(void 0===t&&(t=0),t)this.countdown=t,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},stop:function(t){this.state===o.ACTIVE&&void 0!==t&&this.seek(t),this.state!==o.REMOVED&&(this.state!==o.PAUSED&&this.state!==o.PENDING_ADD||(this.parent._destroy.push(this),this.parent._toProcess++),this.state=o.PENDING_REMOVE)},update:function(t,e){if(this.state===o.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var i=!1,n=0;n<this.totalData;n++)this.updateTweenData(this,this.data[n],e)&&(i=!0);i||this.nextState();break;case o.LOOP_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=o.ACTIVE);break;case o.OFFSET_DELAY:if(this.countdown-=e,this.countdown<=0){var s=this.callbacks.onStart;s&&(s.params[1]=this.targets,s.func.apply(s.scope,s.params)),this.state=o.ACTIVE}break;case o.COMPLETE_DELAY:if(this.countdown-=e,this.countdown<=0){var r=this.callbacks.onComplete;r&&r.func.apply(r.scope,r.params),this.state=o.PENDING_REMOVE}}return this.state===o.PENDING_REMOVE},setStateFromEnd:function(t,e,i){if(e.yoyo){e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onYoyo;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.start=e.getStartValue(e.target,e.key,e.start),o.PLAYING_BACKWARD}if(e.repeatCounter>0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var s=t.callbacks.onRepeat;return s&&(s.params[1]=e.target,s.func.apply(s.scope,s.params)),e.start=e.getStartValue(e.target,e.key,e.start),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},setStateFromStart:function(t,e,i){if(e.repeatCounter>0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onRepeat;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},updateTweenData:function(t,e,i){switch(e.state){case o.PLAYING_FORWARD:case o.PLAYING_BACKWARD:if(!e.target){e.state=o.COMPLETE;break}var n=e.elapsed,s=e.duration,r=0;(n+=i)>s&&(r=n-s,n=s);var a,h=e.state===o.PLAYING_FORWARD,l=n/s;a=h?e.ease(l):e.ease(1-l),e.current=e.start+(e.end-e.start)*a,e.target[e.key]=e.current,e.elapsed=n,e.progress=l;var u=t.callbacks.onUpdate;u&&(u.params[1]=e.target,u.func.apply(u.scope,u.params)),1===l&&(h?e.hold>0?(e.elapsed=e.hold-r,e.state=o.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,r):e.state=this.setStateFromStart(t,e,r));break;case o.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PENDING_RENDER);break;case o.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PLAYING_FORWARD);break;case o.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case o.PENDING_RENDER:e.target?(e.start=e.getStartValue(e.target,e.key,e.target[e.key]),e.end=e.getEndValue(e.target,e.key,e.start),e.current=e.start,e.target[e.key]=e.start,e.state=o.PLAYING_FORWARD):e.state=o.COMPLETE}return e.state!==o.COMPLETE}});a.TYPES=["onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],r.register("tween",function(t){return this.scene.sys.tweens.add(t)}),s.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=a},function(t,e){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},function(t,e){function i(t){return!!t.getStart&&"function"==typeof t.getStart}function n(t){return!!t.getEnd&&"function"==typeof t.getEnd}var s=function(t,e){var r,o,a=function(t,e,i){return i},h=function(t,e,i){return i},l=typeof e;if("number"===l)a=function(){return e};else if("string"===l){var u=e[0],c=parseFloat(e.substr(2));switch(u){case"+":a=function(t,e,i){return i+c};break;case"-":a=function(t,e,i){return i-c};break;case"*":a=function(t,e,i){return i*c};break;case"/":a=function(t,e,i){return i/c};break;default:a=function(){return parseFloat(e)}}}else"function"===l?a=e:"object"===l&&(i(o=e)||n(o))?(n(e)&&(a=e.getEnd),i(e)&&(h=e.getStart)):e.hasOwnProperty("value")&&(r=s(t,e.value));return r||(r={getEnd:a,getStart:h}),r};t.exports=s},function(t,e,i){var n=i(4);t.exports=function(t){var e=n(t,"targets",null);return null===e?e:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(29),s=i(77),r=i(217),o=i(209);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",n.ARRAY_2D,u,i,a,c);else if(void 0!==e){var f=t.cache.tilemap.get(e);f?d=r(e,f.format,f.data,i,a,c):console.warn("No map data found for key "+e)}return null===d&&(d=new s({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},function(t,e,i){var n=i(29),s=i(78),r=i(77),o=i(55);t.exports=function(t,e,i,a,h){for(var l=new s({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:n.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;p<e.length;p++){c[p]=[];for(var g=e[p],v=0;v<g.length;v++){var y=parseInt(g[v],10);isNaN(y)||-1===y?c[p][v]=h?null:new o(l,-1,v,p,i,a):c[p][v]=new o(l,y,v,p,i,a)}0===f&&(f=g.length)}return u.width=l.width=f,u.height=l.height=d,u.widthInPixels=l.widthInPixels=f*i,u.heightInPixels=l.heightInPixels=d*a,l.data=c,u}},function(t,e){t.exports=function(t,e,i){var n=i.collideIndexes.indexOf(t);e&&-1===n?i.collideIndexes.push(t):e||-1===n||i.collideIndexes.splice(n,1)}},function(t,e,i){var n=i(55),s=i(79),r=i(136),o=i(56);t.exports=function(t,e,i,a,h){if(!s(e,i,h))return null;void 0===a&&(a=!0);var l=h.data[i][e],u=l&&l.collides;if(t instanceof n)null===h.data[i][e]&&(h.data[i][e]=new n(h,t.index,e,i,t.width,t.height)),h.data[i][e].copy(t);else{var c=t;null===h.data[i][e]?h.data[i][e]=new n(h,c,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=c}var d=h.data[i][e],f=-1!==h.collideIndexes.indexOf(d.index);return o(d,f),a&&u!==d.collides&&r(e,i,h),d}},function(t,e,i){var n=i(102);t.exports=function(t,e,i){var s=n(t,e,!0,i),r=n(t,e-1,!0,i),o=n(t,e+1,!0,i),a=n(t-1,e,!0,i),h=n(t+1,e,!0,i),l=s&&s.collides;return l&&(s.faceTop=!0,s.faceBottom=!0,s.faceLeft=!0,s.faceRight=!0),r&&r.collides&&(l&&(s.faceTop=!1),r.faceBottom=!l),o&&o.collides&&(l&&(s.faceBottom=!1),o.faceTop=!l),a&&a.collides&&(l&&(s.faceLeft=!1),a.faceRight=!l),h&&h.collides&&(l&&(s.faceRight=!1),h.faceLeft=!l),s&&!s.collides&&s.resetFaces(),s}},function(t,e,i){var n={};t.exports=n;var s=i(195),r=i(33),o=i(80),a=i(67);n.create=function(t){return r.extend({id:r.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{}},t)},n.setModified=function(t,e,i,s){if(t.isModified=e,i&&t.parent&&n.setModified(t.parent,e,i,s),s)for(var r=0;r<t.composites.length;r++){var o=t.composites[r];n.setModified(o,e,i,s)}},n.add=function(t,e){var i=[].concat(e);s.trigger(t,"beforeAdd",{object:e});for(var o=0;o<i.length;o++){var a=i[o];switch(a.type){case"body":if(a.parent!==a){r.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}n.addBody(t,a);break;case"constraint":n.addConstraint(t,a);break;case"composite":n.addComposite(t,a);break;case"mouseConstraint":n.addConstraint(t,a.constraint)}}return s.trigger(t,"afterAdd",{object:e}),t},n.remove=function(t,e,i){var r=[].concat(e);s.trigger(t,"beforeRemove",{object:e});for(var o=0;o<r.length;o++){var a=r[o];switch(a.type){case"body":n.removeBody(t,a,i);break;case"constraint":n.removeConstraint(t,a,i);break;case"composite":n.removeComposite(t,a,i);break;case"mouseConstraint":n.removeConstraint(t,a.constraint)}}return s.trigger(t,"afterRemove",{object:e}),t},n.addComposite=function(t,e){return t.composites.push(e),e.parent=t,n.setModified(t,!0,!0,!1),t},n.removeComposite=function(t,e,i){var s=t.composites.indexOf(e);if(-1!==s&&(n.removeCompositeAt(t,s),n.setModified(t,!0,!0,!1)),i)for(var r=0;r<t.composites.length;r++)n.removeComposite(t.composites[r],e,!0);return t},n.removeCompositeAt=function(t,e){return t.composites.splice(e,1),n.setModified(t,!0,!0,!1),t},n.addBody=function(t,e){return t.bodies.push(e),n.setModified(t,!0,!0,!1),t},n.removeBody=function(t,e,i){var s=t.bodies.indexOf(e);if(-1!==s&&(n.removeBodyAt(t,s),n.setModified(t,!0,!0,!1)),i)for(var r=0;r<t.composites.length;r++)n.removeBody(t.composites[r],e,!0);return t},n.removeBodyAt=function(t,e){return t.bodies.splice(e,1),n.setModified(t,!0,!0,!1),t},n.addConstraint=function(t,e){return t.constraints.push(e),n.setModified(t,!0,!0,!1),t},n.removeConstraint=function(t,e,i){var s=t.constraints.indexOf(e);if(-1!==s&&n.removeConstraintAt(t,s),i)for(var r=0;r<t.composites.length;r++)n.removeConstraint(t.composites[r],e,!0);return t},n.removeConstraintAt=function(t,e){return t.constraints.splice(e,1),n.setModified(t,!0,!0,!1),t},n.clear=function(t,e,i){if(i)for(var s=0;s<t.composites.length;s++)n.clear(t.composites[s],e,!0);return e?t.bodies=t.bodies.filter(function(t){return t.isStatic}):t.bodies.length=0,t.constraints.length=0,t.composites.length=0,n.setModified(t,!0,!0,!1),t},n.allBodies=function(t){for(var e=[].concat(t.bodies),i=0;i<t.composites.length;i++)e=e.concat(n.allBodies(t.composites[i]));return e},n.allConstraints=function(t){for(var e=[].concat(t.constraints),i=0;i<t.composites.length;i++)e=e.concat(n.allConstraints(t.composites[i]));return e},n.allComposites=function(t){for(var e=[].concat(t.composites),i=0;i<t.composites.length;i++)e=e.concat(n.allComposites(t.composites[i]));return e},n.get=function(t,e,i){var s,r;switch(i){case"body":s=n.allBodies(t);break;case"constraint":s=n.allConstraints(t);break;case"composite":s=n.allComposites(t).concat(t)}return s?0===(r=s.filter(function(t){return t.id.toString()===e.toString()})).length?null:r[0]:null},n.move=function(t,e,i){return n.remove(t,e),n.add(i,e),t},n.rebase=function(t){for(var e=n.allBodies(t).concat(n.allConstraints(t)).concat(n.allComposites(t)),i=0;i<e.length;i++)e[i].id=r.nextId();return n.setModified(t,!0,!0,!1),t},n.translate=function(t,e,i){for(var s=i?n.allBodies(t):t.bodies,r=0;r<s.length;r++)a.translate(s[r],e);return n.setModified(t,!0,!0,!1),t},n.rotate=function(t,e,i,s){for(var r=Math.cos(e),o=Math.sin(e),h=s?n.allBodies(t):t.bodies,l=0;l<h.length;l++){var u=h[l],c=u.position.x-i.x,d=u.position.y-i.y;a.setPosition(u,{x:i.x+(c*r-d*o),y:i.y+(c*o+d*r)}),a.rotate(u,e)}return n.setModified(t,!0,!0,!1),t},n.scale=function(t,e,i,s,r){for(var o=r?n.allBodies(t):t.bodies,h=0;h<o.length;h++){var l=o[h],u=l.position.x-s.x,c=l.position.y-s.y;a.setPosition(l,{x:s.x+u*e,y:s.y+c*i}),a.scale(l,e,i)}return n.setModified(t,!0,!0,!1),t},n.bounds=function(t){for(var e=n.allBodies(t),i=[],s=0;s<e.length;s+=1){var r=e[s];i.push(r.bounds.min,r.bounds.max)}return o.create(i)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},clone:function(){return new n(this.x,this.y,this.z)},crossVectors:function(t,e){var i=t.x,n=t.y,s=t.z,r=e.x,o=e.y,a=e.z;return this.x=n*a-s*o,this.y=s*r-i*a,this.z=i*o-n*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,this.z=e*r-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+n*s[6],this.y=e*s[1]+i*s[4]+n*s[7],this.z=e*s[2]+i*s[5]+n*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12],this.y=s[1]*e+s[5]*i+s[9]*n+s[13],this.z=s[2]*e+s[6]*i+s[10]*n+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=e*s[0]+i*s[4]+n*s[8]+s[12],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=e*s[2]+i*s[6]+n*s[10]+s[14],h=e*s[3]+i*s[7]+n*s[11]+s[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],y=s[12],m=s[13],x=s[14],w=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+y)*w,this.y=(e*o+i*u+n*p+m)*w,this.z=(e*a+i*c+n*g+x)*w,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});t.exports=n},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=i(343),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new u(this,t[n]));else this.addFile(new u(this,t,e,i));return this}),t.exports=u},function(t,e,i){var n=i(20),s=i(105);t.exports=function(t,e){var i=void 0===t?s():n({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,o=t.x3-e,a=t.y3-i,t.x3=o*s-a*r+e,t.y3=o*r+a*s+i,t}},function(t,e){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,t}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=[]);for(var s,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,g=u*d+c*f,v=d*d+f*f,y=p*v-g*g,m=0===y?0:1/y,x=t.x1,w=t.y1,b=0;b<e.length&&(r=(p*(l=d*(o=e[b].x-x)+f*(a=e[b].y-w))-g*(h=u*o+c*a))*m,!((s=(v*h-g*l)*m)>=0&&r>=0&&s+r<1&&(n.push({x:e[b].x,y:e[b].y}),i)));b++);return n}},function(t,e){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.right<e.x||t.bottom<e.y||t.x>e.right||t.y>e.bottom)}},function(t,e,i){var n=i(0),s=i(108),r=new n({Extends:s,initialize:function(t,e,i,n,r){s.call(this,t,e,i,[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,1,1,0,0,1,1,1,0],[16777215,16777215,16777215,16777215,16777215,16777215],[1,1,1,1,1,1],n,r),this.resetPosition()},setFrame:function(t){return this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,t=this.frame,this.uv[0]=t.u0,this.uv[1]=t.v0,this.uv[2]=t.u0,this.uv[3]=t.v1,this.uv[4]=t.u1,this.uv[5]=t.v1,this.uv[6]=t.u0,this.uv[7]=t.v0,this.uv[8]=t.u1,this.uv[9]=t.v1,this.uv[10]=t.u1,this.uv[11]=t.v0,this},topLeftX:{get:function(){return this.x+this.vertices[0]},set:function(t){this.vertices[0]=t-this.x,this.vertices[6]=t-this.x}},topLeftY:{get:function(){return this.y+this.vertices[1]},set:function(t){this.vertices[1]=t-this.y,this.vertices[7]=t-this.y}},topRightX:{get:function(){return this.x+this.vertices[10]},set:function(t){this.vertices[10]=t-this.x}},topRightY:{get:function(){return this.y+this.vertices[11]},set:function(t){this.vertices[11]=t-this.y}},bottomLeftX:{get:function(){return this.x+this.vertices[2]},set:function(t){this.vertices[2]=t-this.x}},bottomLeftY:{get:function(){return this.y+this.vertices[3]},set:function(t){this.vertices[3]=t-this.y}},bottomRightX:{get:function(){return this.x+this.vertices[4]},set:function(t){this.vertices[4]=t-this.x,this.vertices[8]=t-this.x}},bottomRightY:{get:function(){return this.y+this.vertices[5]},set:function(t){this.vertices[5]=t-this.y,this.vertices[9]=t-this.y}},topLeftAlpha:{get:function(){return this.alphas[0]},set:function(t){this.alphas[0]=t,this.alphas[3]=t}},topRightAlpha:{get:function(){return this.alphas[5]},set:function(t){this.alphas[5]=t}},bottomLeftAlpha:{get:function(){return this.alphas[1]},set:function(t){this.alphas[1]=t}},bottomRightAlpha:{get:function(){return this.alphas[2]},set:function(t){this.alphas[2]=t,this.alphas[4]=t}},topLeftColor:{get:function(){return this.colors[0]},set:function(t){this.colors[0]=t,this.colors[3]=t}},topRightColor:{get:function(){return this.colors[5]},set:function(t){this.colors[5]=t}},bottomLeftColor:{get:function(){return this.colors[1]},set:function(t){this.colors[1]=t}},bottomRightColor:{get:function(){return this.colors[2]},set:function(t){this.colors[2]=t,this.colors[4]=t}},setTopLeft:function(t,e){return this.topLeftX=t,this.topLeftY=e,this},setTopRight:function(t,e){return this.topRightX=t,this.topRightY=e,this},setBottomLeft:function(t,e){return this.bottomLeftX=t,this.bottomLeftY=e,this},setBottomRight:function(t,e){return this.bottomRightX=t,this.bottomRightY=e,this},resetPosition:function(){var t=this.x,e=this.y,i=Math.floor(this.width/2),n=Math.floor(this.height/2);return this.setTopLeft(t-i,e-n),this.setTopRight(t+i,e-n),this.setBottomLeft(t-i,e+n),this.setBottomRight(t+i,e+n),this},resetAlpha:function(){var t=this.alphas;return t[0]=1,t[1]=1,t[2]=1,t[3]=1,t[4]=1,t[5]=1,this},resetColors:function(){var t=this.colors;return t[0]=16777215,t[1]=16777215,t[2]=16777215,t[3]=16777215,t[4]=16777215,t[5]=16777215,this},reset:function(){return this.resetPosition(),this.resetAlpha(),this.resetColors()}});t.exports=r},function(t,e){t.exports=function(t,e,i){for(var n=!1,s=-1,r=t.points.length-1;++s<t.points.length;r=s){var o=t.points[s].x,a=t.points[s].y,h=t.points[r].x,l=t.points[r].y;(a<=i&&i<l||l<=i&&i<a)&&e<(h-o)*(i-a)/(l-a)+o&&(n=!n)}return n}},function(t,e,i){var n=i(0),s=i(150),r=i(284),o=new n({initialize:function(t){this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return s(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,n=0;n<t.length;n++)e={x:0,y:0},"number"==typeof t[n]||"string"==typeof t[n]?(e.x=parseFloat(t[n]),e.y=parseFloat(t[n+1]),n++):Array.isArray(t[n])?(e.x=t[n][0],e.y=t[n][1]):(e.x=t[n].x,e.y=t[n].y),this.points.push(e),e.y<i&&(i=e.y);return this.calculateArea(i),this},calculateArea:function(){if(this.points.length<3)return this.area=0,this.area;for(var t,e,i=0,n=0;n<this.points.length-1;n++)t=this.points[n],i+=((e=this.points[n+1]).x-t.x)*(t.y+e.y);return t=this.points[0],e=this.points[this.points.length-1],i+=(t.x-e.x)*(e.y+t.y),this.area=.5*-i,this.area},getPoints:function(t,e,i){return r(this,t,e,i)}});t.exports=o},function(t,e,i){var n=i(24),s=i(0),r=i(14),o=i(26),a=i(19),h=i(294),l=i(120),u=i(805),c=i(3),d=new s({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScaleMode,r.ScrollFactor,r.Tint,r.Transform,r.Visible,u],initialize:function(t,e,i,s,r,l,u){var d=t.sys.game.renderer;a.call(this,t,"TileSprite");var f=t.sys.textures.get(l),p=f.get(u);s&&r?(s=Math.floor(s),r=Math.floor(r)):(s=p.width,r=p.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=n.create(this,s,r),this.context=this.canvas.getContext("2d"),this.displayTexture=f,this.displayFrame=p,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(p.width),this.potHeight=h(p.height),this.fillCanvas=n.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(s,r),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.config.renderType===o.WEBGL&&t.sys.game.renderer.onContextRestored(function(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)},this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){return this.displayFrame=this.displayTexture.get(t),this.displayFrame.cutWidth&&this.displayFrame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0!==t&&(this.tileScaleX=t),void 0!==e&&(this.tileScaleY=e),this},updateTileTexture:function(){if(this.dirty){var t=this.displayFrame,e=this.fillContext,i=this.fillCanvas,n=this.potWidth,s=this.potHeight;this.renderer.gl||(n=t.cutWidth,s=t.cutHeight),e.clearRect(0,0,n,s),i.width=n,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,n,s),this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height)),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,n=this._tileScale.y,s=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,n),e.translate(-s,-r),e.fillStyle=this.fillPattern,e.fillRect(s,r,this.width/i,this.height/n),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),n.remove(this.canvas),n.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},function(t,e,i){var n=i(169),s=i(24),r=i(0),o=i(14),a=i(26),h=i(19),l=i(811),u=i(4),c=i(342),d=i(810),f=i(807),p=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Tint,o.Transform,o.Visible,d],initialize:function(t,e,i,n,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Text"),this.renderer=t.sys.game.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.canvas=s.create(this),this.context=this.canvas.getContext("2d"),this.style=new f(this,r),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text="",this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.dirty=!1,0===this.style.resolution&&(this.style.resolution=t.sys.game.config.resolution),this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),r&&r.padding&&this.setPadding(r.padding),r&&r.lineSpacing&&(this.lineSpacing=r.lineSpacing),this.setText(n),t.sys.game.config.renderType===a.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.dirty=!0},this)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",n(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var n="",s=t.replace(/ +/gi," ").split(this.splitRegExp),r=s.length,o=0;o<r;o++){var a=s[o],h="";if(a=a.replace(/^ *|\s*$/gi,""),e.measureText(a).width<i)n+=a+"\n";else{for(var l=i,u=a.split(" "),c=0;c<u.length;c++){var d=u[c],f=d+" ",p=e.measureText(f).width;if(p>l){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var y=u[c].length?c:c+1,m=u.slice(y).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=m+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;r<s.length;r++){for(var o=i,a=s[r].split(" "),h=0;h<a.length;h++){var l=e.measureText(a[h]).width,u=l+e.measureText(" ").width;u>o?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=u,n+=a[h],h<a.length-1&&(n+=" "))}r<s.length-1&&(n+="\n")}return n},getWrappedText:function(t){return void 0===t&&(t=this._text),this.style.syncFont(this.canvas,this.context),this.runWordWrap(t).split(this.splitRegExp)},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this._text&&(this._text=t.toString(),this.updateText()),this},setStyle:function(t){return this.style.setStyle(t)},setFont:function(t){return this.style.setFont(t)},setFontFamily:function(t){return this.style.setFontFamily(t)},setFontSize:function(t){return this.style.setFontSize(t)},setFontStyle:function(t){return this.style.setFontStyle(t)},setFixedSize:function(t,e){return this.style.setFixedSize(t,e)},setBackgroundColor:function(t){return this.style.setBackgroundColor(t)},setFill:function(t){return this.style.setFill(t)},setColor:function(t){return this.style.setColor(t)},setStroke:function(t,e){return this.style.setStroke(t,e)},setShadow:function(t,e,i,n,s,r){return this.style.setShadow(t,e,i,n,s,r)},setShadowOffset:function(t,e){return this.style.setShadowOffset(t,e)},setShadowColor:function(t){return this.style.setShadowColor(t)},setShadowBlur:function(t){return this.style.setShadowBlur(t)},setShadowStroke:function(t){return this.style.setShadowStroke(t)},setShadowFill:function(t){return this.style.setShadowFill(t)},setWordWrapWidth:function(t,e){return this.style.setWordWrapWidth(t,e)},setWordWrapCallback:function(t,e){return this.style.setWordWrapCallback(t,e)},setAlign:function(t){return this.style.setAlign(t)},setResolution:function(t){return this.style.setResolution(t)},setLineSpacing:function(t){return this.lineSpacing=t,this.updateText()},setPadding:function(t,e,i,n){if("object"==typeof t){var s=t,r=u(s,"x",null);null!==r?(t=r,i=r):(t=u(s,"left",0),i=u(s,"right",t));var o=u(s,"y",null);null!==o?(e=o,n=o):(e=u(s,"top",0),n=u(s,"bottom",e))}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=e);return this.padding.left=t,this.padding.top=e,this.padding.right=i,this.padding.bottom=n,this.updateText()},setMaxLines:function(t){return this.style.setMaxLines(t)},updateText:function(){var t=this.canvas,e=this.context,i=this.style,n=i.resolution,s=i.metrics;i.syncFont(t,e);var r=this._text;(i.wordWrapWidth||i.wordWrapCallback)&&(r=this.runWordWrap(this._text));var o,a,h=r.split(this.splitRegExp),u=l(this,s,h),c=this.padding,d=u.width+c.left+c.right,f=u.height+c.top+c.bottom;0===i.fixedWidth&&(this.width=d),0===i.fixedHeight&&(this.height=f),this.updateDisplayOrigin(),d*=n,f*=n,d=Math.max(d,1),f=Math.max(f,1),t.width!==d||t.height!==f?(t.width=d,t.height=f,this.frame.setSize(d,f),i.syncFont(t,e)):e.clearRect(0,0,d,f),e.save(),e.scale(n,n),i.backgroundColor&&(e.fillStyle=i.backgroundColor,e.fillRect(0,0,d,f)),i.syncStyle(t,e),e.textBaseline="alphabetic",e.translate(c.left,c.top);for(var p=0;p<u.lines;p++)o=i.strokeThickness/2,a=i.strokeThickness/2+p*u.lineHeight+s.ascent,p>0&&(a+=u.lineSpacing*p),i.rtl?o=d-o:"right"===i.align?o+=u.width-u.lineWidths[p]:"center"===i.align&&(o+=(u.width-u.lineWidths[p])/2),this.autoRound&&(o=Math.round(o),a=Math.round(a)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(h[p],o,a)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(h[p],o,a));return e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0,this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(121),s=i(24),r=i(0),o=i(14),a=i(26),h=i(113),l=i(19),u=i(817),c=i(295),d=new r({Extends:l,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,r,o){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=32),void 0===o&&(o=32),l.call(this,t,"RenderTexture"),this.renderer=t.sys.game.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=s.create2D(this,r,o),this.context=this.canvas.getContext("2d"),this.framebuffer=null,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(c(),this.canvas),this.frame=this.texture.get(),this._saved=!1,this.camera=new n(0,0,r,o),this.dirty=!1,this.gl=null;var h=this.renderer;if(h.type===a.WEBGL){var u=h.gl;this.gl=u,this.drawGameObject=this.batchGameObjectWebGL,this.framebuffer=h.createFramebuffer(r,o,this.frame.source.glTexture,!1)}else h.type===a.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas);this.camera.setScene(t),this.setPosition(e,i),this.setSize(r,o),this.setOrigin(0,0),this.initPipeline()},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){if(void 0===e&&(e=t),t!==this.width||e!==this.height){if(this.canvas.width=t,this.canvas.height=e,this.gl){var i=this.gl;this.renderer.deleteTexture(this.frame.source.glTexture),this.renderer.deleteFramebuffer(this.framebuffer),this.frame.source.glTexture=this.renderer.createTexture2D(0,i.NEAREST,i.NEAREST,i.CLAMP_TO_EDGE,i.CLAMP_TO_EDGE,i.RGBA,null,t,e,!1),this.framebuffer=this.renderer.createFramebuffer(t,e,this.frame.source.glTexture,!1),this.frame.glTexture=this.frame.source.glTexture}this.frame.source.width=t,this.frame.source.height=e,this.camera.setSize(t,e),this.frame.setSize(t,e),this.width=t,this.height=e}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e){void 0===e&&(e=1);var i=255&(t>>16|0),n=255&(t>>8|0),s=255&(0|t);if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var r=this.gl;r.clearColor(i/255,n/255,s/255,e),r.clear(r.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else this.context.fillStyle="rgb("+i+","+n+","+s+")",this.context.fillRect(0,0,this.canvas.width,this.canvas.height);return this},clear:function(){if(this.dirty){if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,this.canvas.width,this.canvas.height),e.restore()}this.dirty=!1}return this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1,1),r){this.renderer.setFramebuffer(this.framebuffer);var o=this.pipeline;o.projOrtho(0,this.width,0,this.height,-1e3,1e3),this.batchList(t,e,i,n,s),o.flush(),this.renderer.setFramebuffer(null),o.projOrtho(0,o.width,o.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1,1),o){this.renderer.setFramebuffer(this.framebuffer);var h=this.pipeline;h.projOrtho(0,this.width,0,this.height,-1e3,1e3),h.batchTextureFrame(a,i,n,r,s,this.camera.matrix,null),h.flush(),this.renderer.setFramebuffer(null),h.projOrtho(0,h.width,h.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i,n,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;r<t.length;r++){var o=t[r];o&&o!==this&&(o.renderWebGL||o.renderCanvas?this.drawGameObject(o,e,i):o.isParent||o.list?this.batchGroup(o.getChildren(),e,i):"string"==typeof o?this.batchTextureFrameKey(o,null,e,i,n,s):o instanceof h?this.batchTextureFrame(o,e,i,n,s):Array.isArray(o)&&this.batchList(o,e,i,n,s))}},batchGroup:function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);for(var n=0;n<t.length;n++){var s=t[n];if(s.willRender()){var r=s.x+e,o=s.y+i;this.drawGameObject(s,r,o)}}},batchGameObjectWebGL:function(t,e,i){void 0===e&&(e=t.x),void 0===i&&(i=t.y);var n=t.x,s=t.y;this.renderer.setBlendMode(t.blendMode),t.setPosition(e,i),t.renderWebGL(this.renderer,t,0,this.camera,null),t.setPosition(n,s)},batchGameObjectCanvas:function(t,e,i){void 0===e&&(e=t.x),void 0===i&&(i=t.y);var n=t.x,s=t.y;t.setPosition(e,i),t.renderCanvas(this.renderer,t,0,this.camera,null),t.setPosition(n,s)},batchTextureFrameKey:function(t,e,i,n,s,r){var o=this.textureManager.getFrame(t,e);o&&this.batchTextureFrame(o,i,n,s,r)},batchTextureFrame:function(t,e,i,n,s){if(void 0===e&&(e=0),void 0===i&&(i=0),this.gl)this.pipeline.batchTextureFrame(t,e,i,s,n,this.camera.matrix,null);else{var r=this.context,o=t.canvasData,a=t.source.image,h=this.camera.matrix;r.globalAlpha=this.globalAlpha,r.setTransform(h[0],h[1],h[2],h[3],h[4],h[5]),r.drawImage(a,o.x,o.y,o.width,o.height,e,i,o.width,o.height)}},preDestroy:function(){this._saved||(s.remove(this.canvas),this.gl&&this.renderer.deleteFramebuffer(this.framebuffer),this.texture.destroy())}});t.exports=d},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(304),a=i(112),h=i(302),l=i(821),u=new n({Extends:r,Mixins:[s.Depth,s.Pipeline,s.Transform,s.Visible,l],initialize:function(t,e,i,n){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(n=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),n){Array.isArray(n)||(n=[n]);for(var s=0;s<n.length;s++)this.createEmitter(n[s])}},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){this.frame=this.texture.get(t);var e=[];return this.texture.getFramesFromTextureSource(this.frame.sourceIndex).forEach(function(t){e.push(t.name)}),this.frameNames=e,this.defaultFrame=this.frame,this},setEmitterFrames:function(t,e){Array.isArray(t)||(t=[t]);var i=e.frames;i.length=0;for(var n=0;n<t.length;n++){var s=t[n];-1!==this.frameNames.indexOf(s)&&i.push(this.texture.get(s))}return i.length>0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;s<n.length;s++){var r=n[s];r.active&&r.emitParticle(t,e,i)}return this},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},getProcessors:function(){return this.wells.getAll("active",!0)},preUpdate:function(t,e){e*=this.timeScale;for(var i=this.emitters.list,n=0;n<i.length;n++){var s=i[n];s.active&&s.preUpdate(t,e)}},setAlpha:function(){},setScrollFactor:function(){},setBlendMode:function(){}});t.exports=u},function(t,e,i){var n=i(6);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.width/2,r=t.height/2;return i.x=t.x+s*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},function(t,e){t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,LINE_FX_TO:12,MOVE_FX_TO:13,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,SET_TEXTURE:19,CLEAR_TEXTURE:20,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},function(t,e,i){var n=i(121),s=i(0),r=i(157),o=i(401),a=i(400),h=i(399),l=i(395),u=i(186),c=i(390),d=i(389),f=i(392),p=i(90),g=i(19),v=i(2),y=i(4),m=i(16),x=i(831),w=new s({Extends:g,Mixins:[o,a,h,l,u,c,d,f,x],initialize:function(t,e){var i=y(e,"x",0),n=y(e,"y",0);g.call(this,t,"Graphics"),this.setPosition(i,n),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.setDefaultStyles(e)},setDefaultStyles:function(t){return y(t,"lineStyle",null)&&(this.defaultStrokeWidth=y(t,"lineStyle.width",1),this.defaultStrokeColor=y(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=y(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),y(t,"fillStyle",null)&&(this.defaultFillColor=y(t,"fillStyle.color",16777215),this.defaultFillAlpha=y(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,n,s){return void 0===s&&(s=1),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,s,t,e,i,n),this},lineGradientStyle:function(t,e,i,n,s,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,n,s),this},setTexture:function(t,e,i){if(void 0===i&&(i=0),void 0===t)this.commandBuffer.push(r.CLEAR_TEXTURE);else{var n=this.scene.sys.textures.getFrame(t,e);n&&(2===i&&(i=3),this.commandBuffer.push(r.SET_TEXTURE,n,i))}return this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,m.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,m.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,n){return this.commandBuffer.push(r.FILL_RECT,t,e,i,n),this},strokeRect:function(t,e,i,n){var s=this._lineWidth/2,r=t-s,o=t+s;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+n),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+n),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+n),this.lineTo(o+i,e+n),this.strokePath(),this},fillRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=v(s,"tl",20),o=v(s,"tr",20),a=v(s,"bl",20),h=v(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-m.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,m.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,m.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-m.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=v(s,"tl",20),o=v(s,"tr",20),a=v(s,"bl",20),h=v(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-m.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,m.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,m.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-m.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,n,s,o),this},strokeTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,n,s,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,n){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,n),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},lineFxTo:function(t,e,i,n){return this.commandBuffer.push(r.LINE_FX_TO,t,e,i,n,1),this},moveFxTo:function(t,e,i,n){return this.commandBuffer.push(r.MOVE_FX_TO,t,e,i,n,1),this},strokePoints:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var n=1;n<i;n++)this.lineTo(t[n].x,t[n].y);return e&&this.lineTo(t[0].x,t[0].y),this.strokePath(),this},fillPoints:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var n=1;n<i;n++)this.lineTo(t[n].x,t[n].y);return e&&this.lineTo(t[0].x,t[0].y),this.fillPath(),this},strokeEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.strokePoints(i,!0)},strokeEllipse:function(t,e,i,n,s){void 0===s&&(s=32);var r=new p(t,e,i,n).getPoints(s);return this.strokePoints(r,!0)},fillEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.fillPoints(i,!0)},fillEllipse:function(t,e,i,n,s){void 0===s&&(s=32);var r=new p(t,e,i,n).getPoints(s);return this.fillPoints(r,!0)},arc:function(t,e,i,n,s,o,a){return void 0===o&&(o=!1),void 0===a&&(a=0),this.commandBuffer.push(r.ARC,t,e,i,n,s,o,a),this},slice:function(t,e,i,n,s,o,a){return void 0===o&&(o=!1),void 0===a&&(a=0),this.commandBuffer.push(r.BEGIN_PATH),this.commandBuffer.push(r.MOVE_TO,t,e),this.commandBuffer.push(r.ARC,t,e,i,n,s,o,a),this.commandBuffer.push(r.CLOSE_PATH),this},save:function(){return this.commandBuffer.push(r.SAVE),this},restore:function(){return this.commandBuffer.push(r.RESTORE),this},translate:function(t,e){return this.commandBuffer.push(r.TRANSLATE,t,e),this},scale:function(t,e){return this.commandBuffer.push(r.SCALE,t,e),this},rotate:function(t){return this.commandBuffer.push(r.ROTATE,t),this},clear:function(){return this.commandBuffer.length=0,this.defaultFillColor>-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.game.config.width),void 0===i&&(i=r.game.config.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e,i){var n=i(109),s=i(0),r=i(834),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(164),s=i(66),r=i(0),o=i(14),a=i(19),h=i(9),l=i(837),u=i(309),c=i(3),d=new r({Extends:a,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.ScrollFactor,o.Transform,o.Visible,l],initialize:function(t,e,i,n){a.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new h),t.setTo(this.x,this.y,0,0),this.list.length>0)for(var e=this.list,i=new h,n=0;n<e.length;n++){var s=e[n];s.getBounds&&(s.getBounds(i),u(i,t,t))}return t},addHandler:function(t){t.once("destroy",this.remove,this),this.exclusive&&(this._displayList.remove(t),t.parentContainer&&t.parentContainer.remove(t),t.parentContainer=this)},removeHandler:function(t){t.off("destroy",this.remove),this.exclusive&&(t.parentContainer=null)},pointToContainer:function(t,e){if(void 0===e&&(e=new c),this.parentContainer)return this.parentContainer.pointToContainer(t,e);var i=this.tempTransformMatrix;return i.applyITRS(this.x,this.y,this.rotation,this.scaleX,this.scaleY),i.invert(),i.transformPoint(t.x,t.y,e),e},getBoundsTransformMatrix:function(){return this.getWorldTransformMatrix(this.tempTransformMatrix,this.localTransform)},add:function(t){return n.Add(this.list,t,this.maxSize,this.addHandler,this),this},addAt:function(t,e){return n.AddAt(this.list,t,e,this.maxSize,this.addHandler,this),this},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t){return t&&(this._sortKey=t,n.StableSort.inplace(this.list,this.sortHandler)),this},sortHandler:function(t,e){return t[this._sortKey]-e[this._sortKey]},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,s){return n.GetFirstElement(this.list,t,e,i,s)},getAll:function(t,e,i,s){return n.GetAll(this.list,t,e,i,s)},count:function(t,e,i,s){return n.CountAllMatching(this.list,t,e,i,s)},swap:function(t,e){return n.Swap(this.list,t,e),this},moveTo:function(t,e){return n.MoveTo(this.list,t,e),this},remove:function(t,e){var i=n.Remove(this.list,t,this.removeHandler,this);if(e&&i){Array.isArray(i)||(i=[i]);for(var s=0;s<i.length;s++)i[s].destroy()}return this},removeAt:function(t,e){var i=n.RemoveAt(this.list,t,this.removeHandler,this);return e&&i&&i.destroy(),this},removeBetween:function(t,e,i){var s=n.RemoveBetween(this.list,t,e,this.removeHandler,this);if(i)for(var r=0;r<s.length;r++)s[r].destroy();return this},removeAll:function(t){var e=n.RemoveBetween(this.list,0,this.list.length,this.removeHandler,this);if(t)for(var i=0;i<e.length;i++)e[i].destroy();return this},bringToTop:function(t){return n.BringToTop(this.list,t),this},sendToBack:function(t){return n.SendToBack(this.list,t),this},moveUp:function(t){return n.MoveUp(this.list,t),this},moveDown:function(t){return n.MoveDown(this.list,t),this},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e,i){return n.Replace(this.list,t,e)&&(this.addHandler(e),this.removeHandler(t),i&&t.destroy()),this},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,n=[null],s=this.list.slice(),r=s.length;for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<r;i++)n[0]=s[i],t.apply(e,n);return this},iterate:function(t,e){var i,n=[null];for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<this.list.length;i++)n[0]=this.list[i],t.apply(e,n);return this},length:{get:function(){return this.list.length}},first:{get:function(){return this.position=0,this.list.length>0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return this.position>0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null}});t.exports=d},function(t,e,i){var n=i(841),s=i(838),r=i(0),o=i(14),a=i(113),h=i(19),l=i(112),u=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,n],initialize:function(t,e,i,n,s){h.call(this,t,"Blitter"),this.setTexture(n,s),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,n,r){void 0===n&&(n=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new s(this,t,e,i,n);return this.children.addAt(o,r,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,n){for(var s=this.createMultiple(e,i,n),r=0;r<s.length;r++){var o=s[r];t.call(this,o,r)}return s},createMultiple:function(t,e,i){void 0===e&&(e=this.frame.name),void 0===i&&(i=!0),Array.isArray(e)||(e=[e]);var n=[],s=this;return e.forEach(function(e){for(var r=0;r<t;r++)n.push(s.create(0,0,e,i))}),n},childCanRender:function(t){return t.visible&&t.alpha>0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},function(t,e){t.exports=function(t){if(!Array.isArray(t)||t.length<2||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i<t.length;i++)if(t[i].length!==e)return!1;return!0}},function(t,e,i){t.exports={Matrix:i(874),Add:i(867),AddAt:i(866),BringToTop:i(865),CountAllMatching:i(864),Each:i(863),EachInRange:i(862),FindClosestInSorted:i(383),GetAll:i(861),GetFirst:i(860),GetRandom:i(162),MoveDown:i(859),MoveTo:i(858),MoveUp:i(857),NumberArray:i(856),NumberArrayStep:i(855),QuickSelect:i(313),Range:i(312),Remove:i(330),RemoveAt:i(854),RemoveBetween:i(853),RemoveRandomElement:i(852),Replace:i(851),RotateLeft:i(387),RotateRight:i(386),SafeRange:i(62),SendToBack:i(850),SetAll:i(849),Shuffle:i(122),SpliceOne:i(91),StableSort:i(110),Swap:i(848)}},function(t,e,i){var n=i(0),s=i(113),r=i(317),o=new n({initialize:function(t,e,i,n,s){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var o=0;o<i.length;o++)this.source.push(new r(this,i[o],n,s))},add:function(t,e,i,n,r,o){var a=new s(this,t,e,i,n,r,o);return this.frames[t]=a,1===this.frameTotal&&(this.firstFrame=t),this.frameTotal++,a},has:function(t){return this.frames[t]},get:function(t){t||(t=this.firstFrame);var e=this.frames[t];return e||(console.warn("Texture.frame missing: "+t),e=this.frames[this.firstFrame]),e},getTextureSourceIndex:function(t){for(var e=0;e<this.source.length;e++)if(this.source[e]===t)return e;return-1},getFramesFromTextureSource:function(t,e){void 0===e&&(e=!1);var i=[];for(var n in this.frames)if("__BASE"!==n||e){var s=this.frames[n];s.sourceIndex===t&&i.push(s)}return i},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){void 0!==t&&null!==t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn("Texture.frame missing: "+t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){void 0!==t&&null!==t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return i?e=i.sourceIndex:(console.warn("Texture.frame missing: "+t),e=this.frames.__BASE.sourceIndex),this.dataSource[e].image},setDataSource:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=this.source[e];this.dataSource.push(new r(this,t[e],i.width,i.height))}},setFilter:function(t){var e;for(e=0;e<this.source.length;e++)this.source[e].setFilter(t);for(e=0;e<this.dataSource.length;e++)this.dataSource[e].setFilter(t)},destroy:function(){var t;for(t=0;t<this.source.length;t++)this.source[t].destroy();for(t=0;t<this.dataSource.length;t++)this.dataSource[t].destroy();for(var e in this.frames){this.frames[e].destroy()}this.source=[],this.dataSource=[],this.frames={},this.manager=null}});t.exports=o},function(t,e,i){var n=i(0),s=i(116),r=i(167),o=i(890),a=i(889),h=i(1),l=i(326),u=new n({initialize:function(t,e){this.scene=t,this.game,this.config=e,this.settings=l.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=h},init:function(t){this.settings.status=s.INIT,this.sceneUpdate=h,this.game=t,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,r.Global,[r.CoreScene,a(this),o(this)]),this.events.emit("boot",this),this.settings.isBooted=!0},install:function(t){Array.isArray(t)||(t=[t]),this.plugins.installLocal(this,t)},step:function(t,e){this.events.emit("preupdate",t,e),this.events.emit("update",t,e),this.sceneUpdate.call(this.scene,t,e),this.events.emit("postupdate",t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.cameras.render(t,e),this.events.emit("render",t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){return this.settings.active&&(this.settings.status=s.PAUSED,this.settings.active=!1,this.events.emit("pause",this,t)),this},resume:function(t){return this.settings.active||(this.settings.status=s.RUNNING,this.settings.active=!0,this.events.emit("resume",this,t)),this},sleep:function(t){return this.settings.status=s.SLEEPING,this.settings.active=!1,this.settings.visible=!1,this.events.emit("sleep",this,t),this},wake:function(t){var e=this.settings;return e.status=s.RUNNING,e.active=!0,e.visible=!0,this.events.emit("wake",this,t),e.isTransition&&this.events.emit("transitionwake",e.transitionFrom,e.transitionDuration),this},isSleeping:function(){return this.settings.status===s.SLEEPING},isActive:function(){return this.settings.status===s.RUNNING},isPaused:function(){return this.settings.status===s.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit("start",this),this.events.emit("ready",this,t)},resize:function(t,e){this.events.emit("resize",t,e)},shutdown:function(t){this.events.off("transitioninit"),this.events.off("transitionstart"),this.events.off("transitioncomplete"),this.events.off("transitionout"),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit("shutdown",this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit("destroy",this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e<t.length;e++)this[t[e]]=null}});t.exports=u},function(t,e,i){t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},function(t,e,i){var n=i(92),s=i(118),r=i(24),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){o.canvas=!!window.CanvasRenderingContext2D||n.cocoonJS;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this);n.cocoonJS&&(t.screencanvas=!1);var e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d").createImageData(1,1);return a=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(o.getUserMedia=!1),!n.iOS&&(s.ie||s.firefox||s.chrome)&&(o.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},function(t,e){t.exports=function(t,e,i){var n;if(void 0===i&&(i=!0),e)"string"==typeof e?n=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(n=e);else if(t.parentElement)return t;return n||(n=document.body),i&&n.style&&(n.style.overflow="hidden"),n.appendChild(t),t}},function(t,e){t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},function(t,e){t.exports=function(t,e,i,n,s){var r=.5*(n-e),o=.5*(s-i),a=t*t;return(2*i-2*n+r+o)*(t*a)+(-3*i+3*n-2*r-o)*a+r*t+i}},function(t,e,i){var n=i(16);t.exports=function(t){return t*n.RAD_TO_DEG}},function(t,e,i){var n=i(9);t.exports=function(t,e){if(void 0===e&&(e=new n),0===t.length)return e;for(var i,s,r,o=Number.MAX_VALUE,a=Number.MAX_VALUE,h=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,u=0;u<t.length;u++)i=t[u],Array.isArray(i)?(s=i[0],r=i[1]):(s=i.x,r=i.y),o=Math.min(o,s),a=Math.min(a,r),h=Math.max(h,s),l=Math.max(l,r);return e.x=o,e.y=a,e.width=h-o,e.height=l-a,e}},function(t,e,i){var n=i(369),s=i(368),r=i(367),o=i(366),a=i(365),h=i(364),l=i(363),u=i(362),c=i(361),d=i(360),f=i(359),p=i(358);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:n.Out,Bounce:s.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":n.In,"Bounce.easeIn":s.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":n.Out,"Bounce.easeOut":s.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":n.InOut,"Bounce.easeInOut":s.InOut}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){var n=i(177);t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1);var r=Math.floor(6*t),o=6*t-r,a=Math.floor(i*(1-e)*255),h=Math.floor(i*(1-o*e)*255),l=Math.floor(i*(1-(1-o)*e)*255),u=i=Math.floor(i*=255),c=i,d=i,f=r%6;return 0===f?(c=l,d=a):1===f?(u=h,d=a):2===f?(u=a,d=l):3===f?(u=a,c=h):4===f?(u=l,c=a):5===f&&(c=a,d=h),s?s.setTo?s.setTo(u,c,d,s.alpha,!1):(s.r=u,s.g=c,s.b=d,s.color=n(u,c,d),s):{r:u,g:c,b:d,color:n(u,c,d)}}},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){var n=i(377),s=i(374),r=i(372),o=i(371);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):n(t);case"number":return s(t);case"object":return r(t)}}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===n&&(n=3);var s=0;if(e+1>=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(s-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e][0],t[e][1])},set:function(t,e){return this.has(t)||(this.entries[t]=e,this.size++),this},get:function(t){if(this.has(t))return this.entries[t]},getArray:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},has:function(t){return this.entries.hasOwnProperty(t)},delete:function(t){return this.has(t)&&(delete this.entries[t],this.size--),this},clear:function(){return Object.keys(this.entries).forEach(function(t){delete this.entries[t]},this),this.size=0,this},keys:function(){return Object.keys(this.entries)},values:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},dump:function(){var t=this.entries;for(var e in console.group("Map"),t)console.log(e,t[e]);console.groupEnd()},each:function(t){var e=this.entries;for(var i in e)if(!1===t(i,e[i]))break;return this},contains:function(t){var e=this.entries;for(var i in e)if(e[i]===t)return!0;return!1},merge:function(t,e){void 0===e&&(e=!1);var i=this.entries,n=t.entries;for(var s in n)i.hasOwnProperty(s)&&e?i[s]=n[s]:this.set(s,n[s]);return this}});t.exports=n},function(t,e){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i,n,s){var r=n+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x2-t.x1,s=t.y2-t.y1,r=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random()*Math.PI*2,s=Math.sqrt(Math.random());return e.x=t.x+s*Math.cos(i)*t.width/2,e.y=t.y+s*Math.sin(i)*t.height/2,e}},function(t,e){var i={defaultPipeline:null,pipeline:null,initPipeline:function(t){void 0===t&&(t="TextureTintPipeline");var e=this.scene.sys.game.renderer;return!!(e&&e.gl&&e.hasPipeline(t))&&(this.defaultPipeline=e.getPipeline(t),this.pipeline=this.defaultPipeline,!0)},setPipeline:function(t){var e=this.scene.sys.game.renderer;return e&&e.gl&&e.hasPipeline(t)&&(this.pipeline=e.getPipeline(t)),this},resetPipeline:function(){return this.pipeline=this.defaultPipeline,null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=i},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){var n=i(65),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u<e;u++){var c=u/e,d=o+(h-o)*c,f=a+(l-a)*c;r.push(new s(d,f))}return r}},function(t,e,i){var n=i(124),s=i(6);t.exports=function(t,e,i){if(void 0===i&&(i=new s),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=n(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=2*Math.PI*Math.random(),s=Math.random()+Math.random(),r=s>1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e){t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},function(t,e,i){var n={};t.exports=n;var s=i(76),r=i(81),o=i(222),a=i(80),h=i(505),l=i(33);n._warming=.4,n._torqueDampen=1,n._minLength=1e-6,n.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?r.add(e.bodyA.position,e.pointA):e.pointA,n=e.bodyB?r.add(e.bodyB.position,e.pointB):e.pointB,s=r.magnitude(r.sub(i,n));e.length=void 0!==e.length?e.length:s,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},n.preSolveAll=function(t){for(var e=0;e<t.length;e+=1){var i=t[e],n=i.constraintImpulse;i.isStatic||0===n.x&&0===n.y&&0===n.angle||(i.position.x+=n.x,i.position.y+=n.y,i.angle+=n.angle)}},n.solveAll=function(t,e){for(var i=0;i<t.length;i+=1){var s=t[i],r=!s.bodyA||s.bodyA&&s.bodyA.isStatic,o=!s.bodyB||s.bodyB&&s.bodyB.isStatic;(r||o)&&n.solve(t[i],e)}for(i=0;i<t.length;i+=1)r=!(s=t[i]).bodyA||s.bodyA&&s.bodyA.isStatic,o=!s.bodyB||s.bodyB&&s.bodyB.isStatic,r||o||n.solve(t[i],e)},n.solve=function(t,e){var i=t.bodyA,s=t.bodyB,o=t.pointA,a=t.pointB;if(i||s){i&&!i.isStatic&&(r.rotate(o,i.angle-t.angleA,o),t.angleA=i.angle),s&&!s.isStatic&&(r.rotate(a,s.angle-t.angleB,a),t.angleB=s.angle);var h=o,l=a;if(i&&(h=r.add(i.position,o)),s&&(l=r.add(s.position,a)),h&&l){var u=r.sub(h,l),c=r.magnitude(u);c<n._minLength&&(c=n._minLength);var d,f,p,g,v,y=(c-t.length)/c,m=t.stiffness<1?t.stiffness*e:t.stiffness,x=r.mult(u,y*m),w=(i?i.inverseMass:0)+(s?s.inverseMass:0),b=w+((i?i.inverseInertia:0)+(s?s.inverseInertia:0));if(t.damping){var T=r.create();p=r.div(u,c),v=r.sub(s&&r.sub(s.position,s.positionPrev)||T,i&&r.sub(i.position,i.positionPrev)||T),g=r.dot(p,v)}i&&!i.isStatic&&(f=i.inverseMass/w,i.constraintImpulse.x-=x.x*f,i.constraintImpulse.y-=x.y*f,i.position.x-=x.x*f,i.position.y-=x.y*f,t.damping&&(i.positionPrev.x-=t.damping*p.x*g*f,i.positionPrev.y-=t.damping*p.y*g*f),d=r.cross(o,x)/b*n._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=d,i.angle-=d),s&&!s.isStatic&&(f=s.inverseMass/w,s.constraintImpulse.x+=x.x*f,s.constraintImpulse.y+=x.y*f,s.position.x+=x.x*f,s.position.y+=x.y*f,t.damping&&(s.positionPrev.x+=t.damping*p.x*g*f,s.positionPrev.y+=t.damping*p.y*g*f),d=r.cross(a,x)/b*n._torqueDampen*s.inverseInertia*(1-t.angularStiffness),s.constraintImpulse.angle+=d,s.angle+=d)}}},n.postSolveAll=function(t){for(var e=0;e<t.length;e++){var i=t[e],l=i.constraintImpulse;if(!(i.isStatic||0===l.x&&0===l.y&&0===l.angle)){o.set(i,!1);for(var u=0;u<i.parts.length;u++){var c=i.parts[u];s.translate(c.vertices,l),u>0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(s.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=n._warming,l.x*=n._warming,l.y*=n._warming}}}},function(t,e,i){var n={};t.exports=n;var s=i(33);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r<s.length;r++)n=s[r],t.events=t.events||{},t.events[n]=t.events[n]||[],t.events[n].push(i);return i},n.off=function(t,e,i){if(e){"function"==typeof e&&(i=e,e=s.keys(t.events).join(" "));for(var n=e.split(" "),r=0;r<n.length;r++){var o=t.events[n[r]],a=[];if(i&&o)for(var h=0;h<o.length;h++)o[h]!==i&&a.push(o[h]);t.events[n[r]]=a}}else t.events={}},n.trigger=function(t,e,i){var n,r,o,a,h=t.events;if(h&&s.keys(h).length>0){i||(i={}),n=e.split(" ");for(var l=0;l<n.length;l++)if(o=h[r=n[l]]){(a=s.clone(i,!1)).name=r,a.source=t;for(var u=0;u<o.length;u++)o[u].apply(t,[a])}}}},function(t,e,i){var n=i(0),s=i(64),r=i(2),o=i(894),a=i(893),h=i(892),l=i(38),u=i(10),c=i(197),d=new n({Extends:c,Mixins:[o],initialize:function(t){var e=t.renderer.config;c.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:r(t,"topology",t.renderer.gl.TRIANGLES),vertShader:r(t,"vertShader",h),fragShader:r(t,"fragShader",a),vertexCapacity:r(t,"vertexCapacity",6*e.batchSize),vertexSize:r(t,"vertexSize",5*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT),attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTexCoord",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:2*Float32Array.BYTES_PER_ELEMENT},{name:"inTintEffect",size:1,type:t.renderer.gl.FLOAT,normalized:!1,offset:4*Float32Array.BYTES_PER_ELEMENT},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:5*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=e.batchSize,this.batches=[],this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this._tempMatrix4=new l,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.tintEffect=2,this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[],this.mvpInit()},onBind:function(){return c.prototype.onBind.call(this),this.mvpUpdate(),0===this.batches.length&&this.pushBatch(),this},resize:function(t,e,i){return c.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},setTexture2D:function(t,e){t||(t=this.renderer.blankTexture.glTexture,e=0);var i=this.batches;0===i.length&&this.pushBatch();var n=i[i.length-1];return e>0?(n.textures[e-1]&&n.textures[e-1]!==t&&this.pushBatch(),i[i.length-1].textures[e-1]=t):(null!==n.texture&&n.texture!==t&&this.pushBatch(),i[i.length-1].texture=t),this},pushBatch:function(){var t={first:this.vertexCount,texture:null,textures:[]};this.batches.push(t)},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t,e,i,n=this.gl,s=this.vertexCount,r=this.topology,o=this.vertexSize,a=this.renderer,h=this.batches,l=0,u=null;if(0===h.length||0===s)return this.flushLocked=!1,this;n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,s*o));for(var c=0;c<h.length-1;c++){if(u=h[c],t=h[c+1],u.textures.length>0){for(e=0;e<u.textures.length;++e)(i=u.textures[e])&&a.setTexture2D(i,1+e);n.activeTexture(n.TEXTURE0)}l=t.first-u.first,null===u.texture||l<=0||(a.setTexture2D(u.texture,0),n.drawArrays(r,u.first,l))}if((u=h[h.length-1]).textures.length>0){for(e=0;e<u.textures.length;++e)(i=u.textures[e])&&a.setTexture2D(i,1+e);n.activeTexture(n.TEXTURE0)}return l=s-u.first,u.texture&&l>0&&(a.setTexture2D(u.texture,0),n.drawArrays(r,u.first,l)),this.vertexCount=0,h.length=0,this.pushBatch(),this.flushLocked=!1,this},batchSprite:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix1,s=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,l=o.v0,c=o.u1,d=o.v1,f=o.x,p=o.y,g=o.cutWidth,v=o.cutHeight,y=-t.displayOriginX+f,m=-t.displayOriginY+p;if(t.isCropped){var x=t._crop;x.flipX===t.flipX&&x.flipY===t.flipY||o.updateCropUVs(x,t.flipX,t.flipY),h=x.u0,l=x.v0,c=x.u1,d=x.v1,g=x.width,v=x.height,f=x.x,p=x.y,y=-t.displayOriginX+f,m=-t.displayOriginY+p}t.flipX&&(y+=g,g*=-1),t.flipY&&(m+=v,v*=-1);var w=y+g,b=m+v;s.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),s.e=t.x,s.f=t.y,n.multiply(s,r)):(s.e-=e.scrollX*t.scrollFactorX,s.f-=e.scrollY*t.scrollFactorY,n.multiply(s,r));var T=r.getX(y,m),S=r.getY(y,m),_=r.getX(y,b),A=r.getY(y,b),C=r.getX(w,b),M=r.getY(w,b),P=r.getX(w,m),E=r.getY(w,m),k=u.getTintAppendFloatAlpha(t._tintTL,e.alpha*t._alphaTL),L=u.getTintAppendFloatAlpha(t._tintTR,e.alpha*t._alphaTR),F=u.getTintAppendFloatAlpha(t._tintBL,e.alpha*t._alphaBL),R=u.getTintAppendFloatAlpha(t._tintBR,e.alpha*t._alphaBR);e.roundPixels&&(T|=0,S|=0,_|=0,A|=0,C|=0,M|=0,P|=0,E|=0),this.setTexture2D(a,0);var O=t._isTinted&&t.tintFill;this.batchQuad(T,S,_,A,C,M,P,E,h,l,c,d,k,L,F,R,O)},batchQuad:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v){var y=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),y=!0);var m=this.vertexViewF32,x=this.vertexViewU32,w=this.vertexCount*this.vertexComponentCount-1;return m[++w]=t,m[++w]=e,m[++w]=h,m[++w]=l,m[++w]=v,x[++w]=d,m[++w]=i,m[++w]=n,m[++w]=h,m[++w]=c,m[++w]=v,x[++w]=p,m[++w]=s,m[++w]=r,m[++w]=u,m[++w]=c,m[++w]=v,x[++w]=g,m[++w]=t,m[++w]=e,m[++w]=h,m[++w]=l,m[++w]=v,x[++w]=d,m[++w]=s,m[++w]=r,m[++w]=u,m[++w]=c,m[++w]=v,x[++w]=g,m[++w]=o,m[++w]=a,m[++w]=u,m[++w]=l,m[++w]=v,x[++w]=f,this.vertexCount+=6,y},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f){var p=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),p=!0);var g=this.vertexViewF32,v=this.vertexViewU32,y=this.vertexCount*this.vertexComponentCount-1;return g[++y]=t,g[++y]=e,g[++y]=o,g[++y]=a,g[++y]=f,v[++y]=u,g[++y]=i,g[++y]=n,g[++y]=o,g[++y]=l,g[++y]=f,v[++y]=c,g[++y]=s,g[++y]=r,g[++y]=h,g[++y]=l,g[++y]=f,v[++y]=d,this.vertexCount+=3,p},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w,b,T,S,_,A,C,M,P,E,k){this.renderer.setPipeline(this,t);var L=this._tempMatrix1,F=this._tempMatrix2,R=this._tempMatrix3,O=y/i+C,D=m/n+M,B=(y+x)/i+C,I=(m+w)/n+M,Y=o,X=a,z=-g,N=-v;if(t.isCropped){var U=t._crop;Y=U.width,X=U.height,o=U.width,a=U.height;var V=y=U.x,G=m=U.y;c&&(V=x-U.x-U.width),d&&!e.isRenderTexture&&(G=w-U.y-U.height),O=V/i+C,D=G/n+M,B=(V+U.width)/i+C,I=(G+U.height)/n+M,z=-g+y,N=-v+m}d^=!k&&e.isRenderTexture?1:0,c&&(Y*=-1,z+=o),d&&(X*=-1,N+=a);var W=z+Y,H=N+X;F.applyITRS(s,r,u,h,l),L.copyFrom(P.matrix),E?(L.multiplyWithOffset(E,-P.scrollX*f,-P.scrollY*p),F.e=s,F.f=r,L.multiply(F,R)):(F.e-=P.scrollX*f,F.f-=P.scrollY*p,L.multiply(F,R));var j=R.getX(z,N),q=R.getY(z,N),K=R.getX(z,H),J=R.getY(z,H),Z=R.getX(W,H),Q=R.getY(W,H),$=R.getX(W,N),tt=R.getY(W,N);P.roundPixels&&(j|=0,q|=0,K|=0,J|=0,Z|=0,Q|=0,$|=0,tt|=0),this.setTexture2D(e,0),this.batchQuad(j,q,K,J,Z,Q,$,tt,O,D,B,I,b,T,S,_,A)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),y=h.getY(l,c),m=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,y,m,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n,h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),y=this.currentFrame,m=y.u0,x=y.v0,w=y.u1,b=y.v1;this.batchQuad(l,u,c,d,f,p,g,v,m,x,w,b,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,y=g.v0,m=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,y,m,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f<a;++f)o=t[f],h.push(o.x,o.y);a=(r=s(h)).length;for(var p=this.currentFrame,g=0;g<a;g+=3){var v=2*r[g+0],y=2*r[g+1],m=2*r[g+2],x=h[v+0],w=h[v+1],b=h[y+0],T=h[y+1],S=h[m+0],_=h[m+1],A=n.getX(x,w),C=n.getY(x,w),M=n.getX(b,T),P=n.getY(b,T),E=n.getX(S,_),k=n.getY(S,_),L=p.u0,F=p.v0,R=p.u1,O=p.v1;this.batchTri(A,C,M,P,E,k,L,F,R,O,l,u,c,d)}h.length=0},batchStrokePath:function(t,e,i,n,s){this.renderer.setPipeline(this),this.prevQuad[4]=0,this.firstQuad[4]=0;for(var r=t.length-1,o=0;o<r;o++){var a=t[o],h=t[o+1];this.batchLine(a.x,a.y,h.x,h.y,a.width/2,h.width/2,e,o,!i&&o===r-1,n,s)}},batchLine:function(t,e,i,n,s,r,o,a,h,l,u){this.renderer.setPipeline(this);var c=this._tempMatrix3;u&&u.multiply(l,c);var d=i-t,f=n-e,p=Math.sqrt(d*d+f*f),g=s*(n-e)/p,v=s*(t-i)/p,y=r*(n-e)/p,m=r*(t-i)/p,x=i-y,w=n-m,b=t-g,T=e-v,S=i+y,_=n+m,A=t+g,C=e+v,M=c.getX(x,w),P=c.getY(x,w),E=c.getX(b,T),k=c.getY(b,T),L=c.getX(S,_),F=c.getY(S,_),R=c.getX(A,C),O=c.getY(A,C),D=this.strokeTint,B=this.tintEffect,I=D.TL,Y=D.TR,X=D.BL,z=D.BR,N=this.currentFrame,U=N.u0,V=N.v0,G=N.u1,W=N.v1;if(this.batchQuad(R,O,E,k,M,P,L,F,U,V,G,W,I,Y,X,z,B),!(o<=2)){var H=this.prevQuad,j=this.firstQuad;a>0&&H[4]?this.batchQuad(R,O,E,k,H[0],H[1],H[2],H[3],U,V,G,W,I,Y,X,z,B):(j[0]=R,j[1]=O,j[2]=E,j[3]=k,j[4]=1),h&&j[4]?this.batchQuad(M,P,L,F,j[0],j[1],j[2],j[3],U,V,G,W,I,Y,X,z,B):(H[0]=M,H[1]=P,H[2]=L,H[3]=F,H[4]=1)}}});t.exports=d},function(t,e,i){var n=i(0),s=i(10),r=new n({initialize:function(t){this.name="WebGLPipeline",this.game=t.game,this.view=t.game.canvas,this.resolution=t.game.config.resolution,this.width=t.game.config.width*this.resolution,this.height=t.game.config.height*this.resolution,this.gl=t.gl,this.vertexCount=0,this.vertexCapacity=t.vertexCapacity,this.renderer=t.renderer,this.vertexData=t.vertices?t.vertices:new ArrayBuffer(t.vertexCapacity*t.vertexSize),this.vertexBuffer=this.renderer.createVertexBuffer(t.vertices?t.vertices:this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=this.renderer.createProgram(t.vertShader,t.fragShader),this.attributes=t.attributes,this.vertexSize=t.vertexSize,this.topology=t.topology,this.bytes=new Uint8Array(this.vertexData),this.vertexComponentCount=s.getComponentCount(t.attributes,this.gl),this.flushLocked=!1,this.active=!1},boot:function(){},addAttribute:function(t,e,i,n,s){return this.attributes.push({name:t,size:e,type:this.renderer.glFormats[i],normalized:n,offset:s}),this},shouldFlush:function(){return this.vertexCount>=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o<i.length;++o){var a=i[o],h=t.getAttribLocation(n,a.name);h>=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(53);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(53);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n=i(0),s=i(11),r=i(97),o=i(83),a=new n({Extends:s,initialize:function(t){s.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},add:function(t){return this.queue(r(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"===typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],n=parseFloat(t.substr(2)),s=e;switch(i){case"+":s+=n;break;case"-":s-=n}return Math.max(0,s)},calcDuration:function(){for(var t=0,e=0,i=0,n=0;n<this.totalData;n++){var s=this.data[n];s.init(),this.hasOffset(s)?this.isOffsetAbsolute(s.offset)?(s.calculatedOffset=s.offset,0===s.offset&&(i=0)):this.isOffsetRelative(s.offset)&&(s.calculatedOffset=this.getRelativeOffset(s.offset,t)):s.calculatedOffset=i,t=s.totalDuration+s.calculatedOffset,e+=s.totalDuration,i+=s.totalDuration}this.duration=e,this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=o.PAUSED,!1)},resetTweens:function(t){for(var e=0;e<this.totalData;e++){this.data[e].play(t)}},setCallback:function(t,e,i,n){return-1!==a.TYPES.indexOf(t)&&(this.callbacks[t]={func:e,scope:n,params:i}),this},makeActive:function(t){return this.manager.makeActive(t)},play:function(){if(this.state!==o.ACTIVE){if(this.paused)return this.paused=!1,void this.manager.makeActive(this);this.resetTweens(!1),this.state=o.ACTIVE;var t=this.callbacks.onStart;t&&t.func.apply(t.scope,t.params),this.emit("start",this)}},nextState:function(){if(this.loopCounter>0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&t.func.apply(t.scope,t.params),this.emit("loop",this,this.loopCounter),this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&e.func.apply(e.scope,e.params),this.emit("complete",this),this.state=o.PENDING_REMOVE}},update:function(t,e){if(this.state!==o.PAUSED){var i=e;switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var n=this.totalData,s=0;s<this.totalData;s++){this.data[s].update(t,i)&&n--}var r=this.callbacks.onUpdate;r&&r.func.apply(r.scope,r.params),this.emit("update",this),0===n&&this.nextState();break;case o.LOOP_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=o.ACTIVE);break;case o.COMPLETE_DELAY:if(this.countdown-=e,this.countdown<=0){var a=this.callbacks.onComplete;a&&a.func.apply(a.scope,a.params),this.emit("complete",this),this.state=o.PENDING_REMOVE}}return this.state===o.PENDING_REMOVE}},stop:function(){this.state=o.PENDING_REMOVE},pause:function(){if(this.state!==o.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=o.PAUSED,this.emit("pause",this),this},resume:function(){return this.state===o.PAUSED&&(this.paused=!1,this.state=this._pausedState),this.emit("resume",this),this},hasTarget:function(t){for(var e=0;e<this.data.length;e++)if(this.data[e].hasTarget(t))return!0;return!1},destroy:function(){for(var t=0;t<this.data.length;t++)this.data[t].stop()}});a.TYPES=["onStart","onUpdate","onLoop","onComplete","onYoyo"],t.exports=a},function(t,e,i){var n=i(63),s=i(129),r=i(12),o=i(84),a=i(86),h=i(98),l=i(131),u=i(204),c=i(4),d=i(201),f=i(97);t.exports=function(t,e){var i=new d(t),p=u(e);if(0===p.length)return i.paused=!0,i;var g=n(s);g.targets=l(e);var v=r(e,"totalDuration",0);g.duration=v>0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var y=0;y<p.length;y++)i.queue(f(i,p[y],g));i.completeDelay=r(e,"completeDelay",0),i.loop=Math.round(r(e,"loop",0)),i.loopDelay=Math.round(r(e,"loopDelay",0)),i.paused=o(e,"paused",!1),i.useFrames=o(e,"useFrames",!1);var m=c(e,"callbackScope",i),x=[i],w=c(e,"onStart",!1);if(w){var b=c(e,"onStartScope",m),T=c(e,"onStartParams",[]);i.setCallback("onStart",w,x.concat(T),b)}var S=c(e,"onUpdate",!1);if(S){var _=c(e,"onUpdateScope",m),A=c(e,"onUpdateParams",[]);i.setCallback("onUpdate",S,x.concat(A),_)}var C=c(e,"onLoop",!1);if(C){var M=c(e,"onLoopScope",m),P=c(e,"onLoopParams",[]);i.setCallback("onLoop",C,x.concat(P),M)}var E=c(e,"onYoyo",!1);if(E){var k=c(e,"onYoyoScope",m),L=c(e,"onYoyoParams",[]);i.setCallback("onYoyo",E,x.concat(null,L),k)}var F=c(e,"onComplete",!1);if(F){var R=c(e,"onCompleteScope",m),O=c(e,"onCompleteParams",[]);i.setCallback("onComplete",F,x.concat(O),R)}return i}},function(t,e,i){var n=i(129),s=i(12),r=i(84),o=i(86),a=i(98),h=i(4),l=i(130),u=i(128),c=i(127);t.exports=function(t,e,i){void 0===i&&(i=n);var d=h(e,"from",0),f=h(e,"to",1),p=[{value:d}],g=a(e,"delay",i.delay),v=a(e,"duration",i.duration),y=h(e,"easeParams",i.easeParams),m=o(h(e,"ease",i.ease),y),x=a(e,"hold",i.hold),w=a(e,"repeat",i.repeat),b=a(e,"repeatDelay",i.repeatDelay),T=r(e,"yoyo",i.yoyo),S=[],_=l("value",f),A=c(p[0],"value",_.getEnd,_.getStart,m,g,v,T,x,w,b,!1,!1);A.start=d,A.current=d,A.to=f,S.push(A);var C=new u(t,S,p);C.offset=s(e,"offset",null),C.completeDelay=s(e,"completeDelay",0),C.loop=Math.round(s(e,"loop",0)),C.loopDelay=Math.round(s(e,"loopDelay",0)),C.paused=r(e,"paused",!1),C.useFrames=r(e,"useFrames",!1);for(var M=h(e,"callbackScope",C),P=[C,null],E=u.TYPES,k=0;k<E.length;k++){var L=E[k],F=h(e,L,!1);if(F){var R=h(e,L+"Scope",M),O=h(e,L+"Params",[]);C.setCallback(L,F,P.concat(O),R)}}return C}},function(t,e,i){var n=i(4);t.exports=function(t){var e=n(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(437);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===n.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){return this.delay=s(t,"delay",0),this.repeat=s(t,"repeat",0),this.loop=s(t,"loop",!1),this.callback=s(t,"callback",void 0),this.callbackScope=s(t,"callbackScope",this.callback),this.args=s(t,"args",[]),this.timeScale=s(t,"timeScale",1),this.startAt=s(t,"startAt",0),this.paused=s(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(0),s=i(14),r=i(26),o=i(19),a=i(446),h=i(103),l=i(38),u=i(10),c=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.renderer=t.sys.game.renderer,this.vertexBuffer=[],this.bufferData=[],this.vertexViewF32=[],this.vertexViewU32=[],this.dirty=[],this.vertexCount=[],this._renderOrder=0,this._tempMatrix=new l,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.updateVBOData(),this.initPipeline("TextureTintPipeline"),t.sys.game.config.renderType===r.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.updateVBOData()},this)},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;s<t.length;s++){var r=t[s];if("string"==typeof r&&(r=n.getTileset(r)),r){i.push(r);for(var o=r.firstgid,a=0;a<r.total;a++)e[o+a]=r}}this.gidMap=e,this.tileset=i},updateVBOData:function(){for(var t=0;t<this.tileset.length;t++)this.dirty[t]=!0,this.vertexCount[t]=0,this.vertexBuffer[t]=null,this.bufferData[t]=null,this.vertexViewF32[t]=null,this.vertexViewU32[t]=null;return this},upload:function(t,e){var i=this.renderer,n=i.gl,s=i.pipelines.TextureTintPipeline;if(this.dirty[e]){var r,o,a,h=this.tileset[e],l=this.layer.width,u=this.layer.height,c=h.image.source[0].width,d=h.image.source[0].height,f=this.layer.data,p=this._renderOrder,g=h.firstgid,v=h.firstgid+h.total,y=this.vertexBuffer[e],m=this.bufferData[e],x=-1,w=l*u*s.vertexSize*6;if(this.vertexCount[e]=0,null===m&&(m=new ArrayBuffer(w),this.bufferData[e]=m,this.vertexViewF32[e]=new Float32Array(m),this.vertexViewU32[e]=new Uint32Array(m)),0===p)for(o=0;o<u;o++)for(a=0;a<l;a++)!(r=f[o][a])||r.index<g||r.index>v||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(1===p)for(o=0;o<u;o++)for(a=l-1;a>=0;a--)!(r=f[o][a])||r.index<g||r.index>v||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(2===p)for(o=u-1;o>=0;o--)for(a=0;a<l;a++)!(r=f[o][a])||r.index<g||r.index>v||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(3===p)for(o=u-1;o>=0;o--)for(a=l-1;a>=0;a--)!(r=f[o][a])||r.index<g||r.index>v||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));this.dirty[e]=!1,null===y?(y=i.createVertexBuffer(m,n.STATIC_DRAW),this.vertexBuffer[e]=y):(i.setVertexBuffer(y),n.bufferSubData(n.ARRAY_BUFFER,0,m))}return this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=a.x/n,l=a.y/s,c=(a.x+e.width)/n,d=(a.y+e.height)/s,f=this._tempMatrix,p=e.width,g=e.height,v=p/2,y=g/2,m=-v,x=-y;e.flipX&&(p*=-1,m+=e.width),e.flipY&&(g*=-1,x+=e.height);var w=m+p,b=x+g;f.applyITRS(v+e.pixelX,y+e.pixelY,e.rotation,1,1);var T=u.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),S=f.getX(m,x),_=f.getY(m,x),A=f.getX(m,b),C=f.getY(m,b),M=f.getX(w,b),P=f.getY(w,b),E=f.getX(w,x),k=f.getY(w,x);r.roundPixels&&(S|=0,_|=0,A|=0,C|=0,M|=0,P|=0,E|=0,k|=0);var L=this.vertexViewF32[o],F=this.vertexViewU32[o];return L[++t]=S,L[++t]=_,L[++t]=h,L[++t]=l,L[++t]=0,F[++t]=T,L[++t]=A,L[++t]=C,L[++t]=h,L[++t]=d,L[++t]=0,F[++t]=T,L[++t]=M,L[++t]=P,L[++t]=c,L[++t]=d,L[++t]=0,F[++t]=T,L[++t]=S,L[++t]=_,L[++t]=h,L[++t]=l,L[++t]=0,F[++t]=T,L[++t]=M,L[++t]=P,L[++t]=c,L[++t]=d,L[++t]=0,F[++t]=T,L[++t]=E,L[++t]=k,L[++t]=c,L[++t]=l,L[++t]=0,F[++t]=T,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4){this._renderOrder=t;for(var e=0;e<this.tileset.length;e++)this.dirty[e]=!0}return this},calculateFacesAt:function(t,e){return h.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return h.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return h.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles)},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},findByIndex:function(t,e,i){return h.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return h.FindTile(t,e,i,n,s,r,o,this.layer)},filterTiles:function(t,e,i,n,s,r,o){return h.FilterTiles(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return h.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return h.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return h.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return h.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return h.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},getTilesWithinShape:function(t,e,i){return h.GetTilesWithinShape(t,e,i,this.layer)},hasTileAt:function(t,e){return h.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return h.HasTileAtWorldXY(t,e,i,this.layer)},renderDebug:function(t,e){return h.RenderDebug(t,e,this.layer),this},setCollision:function(t,e,i){return h.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return h.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return h.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return h.SetCollisionByExclusion(t,e,i,this.layer),this},setTileIndexCallback:function(t,e,i){return h.SetTileIndexCallback(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return h.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return h.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return h.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return h.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return h.TileToWorldXY(t,e,i,n,this.layer)},worldToTileX:function(t,e,i){return h.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return h.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return h.WorldToTileXY(t,e,i,n,s,this.layer)},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null;for(var t=0;t<this.tileset.length;t++)this.dirty[t]=!0,this.vertexCount[t]=0,this.vertexBuffer[t]=null,this.bufferData[t]=null,this.vertexViewF32[t]=null,this.vertexViewU32[t]=null;this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this)}});t.exports=c},function(t,e,i){var n=i(0),s=i(14),r=i(449),o=i(19),a=i(103),h=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,r],initialize:function(t,e,i,n,s,r){o.call(this,t,"DynamicTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=a.CullTiles,this._renderOrder=0,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,r),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.initPipeline("TextureTintPipeline")},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;s<t.length;s++){var r=t[s];if("string"==typeof r&&(r=n.getTileset(r)),r){i.push(r);for(var o=r.firstgid,a=0;a<r.total;a++)e[o+a]=r}}this.gidMap=e,this.tileset=i},setRenderOrder:function(t){return"string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this)},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(31),r=i(208),o=i(20),a=i(29),h=i(78),l=i(242),u=i(207),c=i(55),d=i(103),f=i(99),p=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,n),u.setSpacing(s,r),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),(u=new f(t,o,i,n,s,r)).setImage(h),this.tilesets.push(u),u)},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new u(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:(null!==a&&d.Copy(t,e,i,n,s,r,o,a),this)},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===a&&(a=e.tileWidth),void 0===l&&(l=e.tileHeight),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===i&&(i=0),void 0===n&&(n=0),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var u,d=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;f<o;f++){u=[];for(var p=0;p<s;p++)u.push(new c(d,-1,p,f,a,l,this.tileWidth,this.tileHeight));d.data.push(u)}this.layers.push(d),this.currentLayerIndex=this.layers.length-1;var g=new r(this.scene,this,this.currentLayerIndex,e,i,n);return g.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(g),g},createDynamicLayer:function(t,e,i,n){var s=this.getLayerIndex(t);if(null===s)return console.warn("Invalid Tilemap Layer ID: "+t),null;if(this.layers[s].tilemapLayer)return console.warn("Tilemap Layer ID already exists:"+t),null;this.currentLayerIndex=s,void 0===i&&this.layers[s].x&&(i=this.layers[s].x),void 0===n&&this.layers[s].y&&(n=this.layers[s].y);var o=new r(this.scene,this,s,e,i,n);return o.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(o),o},createFromObjects:function(t,e,i,n){void 0===i&&(i={}),void 0===n&&(n=this.scene);var r=this.getObjectLayer(t);if(r){for(var a=r.objects,h=[],u=0;u<a.length;u++){var c=!1,d=a[u];if((void 0!==d.gid&&"number"==typeof e&&d.gid===e||void 0!==d.id&&"number"==typeof e&&d.id===e||void 0!==d.name&&"string"==typeof e&&d.name===e)&&(c=!0),c){var f=o({},i,d.properties);f.x=d.x,f.y=d.y;var p=this.scene.make.sprite(f);p.name=d.name,d.width&&(p.displayWidth=d.width),d.height&&(p.displayHeight=d.height);var g={x:p.originX*p.displayWidth,y:(p.originY-1)*p.displayHeight};if(d.rotation){var v=s(d.rotation);l(g,v),p.rotation=v}for(var y in p.x+=g.x,p.y+=g.y,void 0===d.flippedHorizontal&&void 0===d.flippedVertical||p.setFlip(d.flippedHorizontal,d.flippedVertical),d.visible||(p.visible=!1),d.properties)p.hasOwnProperty(y)||p.setData(y,d.properties[y]);h.push(p)}}return h}console.warn("Cannot create from object. Invalid objectgroup name given: "+t)},createFromTiles:function(t,e,i,n,s,r){return null===(r=this.getLayer(r))?null:d.CreateFromTiles(t,e,i,n,s,r)},createStaticLayer:function(t,e,i,n){var s=this.getLayerIndex(t);if(null===s)return console.warn("Invalid Tilemap Layer ID: "+t),null;if(this.layers[s].tilemapLayer)return console.warn("Tilemap Layer ID already exists:"+t),null;this.currentLayerIndex=s,void 0===i&&this.layers[s].x&&(i=this.layers[s].x),void 0===n&&this.layers[s].y&&(n=this.layers[s].y);var r=new u(this.scene,this,s,e,i,n);return r.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(r),r},destroy:function(){this.removeAllLayers(),this.tilesets.length=0,this.objects.length=0,this.scene=void 0},fill:function(t,e,i,n,s,r,o){return o=this.getLayer(o),this._isStaticCall(o,"fill")?this:(null!==o&&d.Fill(t,e,i,n,s,r,o),this)},filterObjects:function(t,e,i){if("string"==typeof t){var n=t;if(!(t=this.getObjectLayer(t)))return console.warn("No object layer found with the name: "+n),null}return t.objects.filter(e,i)},filterTiles:function(t,e,i,n,s,r,o,a){return null===(a=this.getLayer(a))?null:d.FilterTiles(t,e,i,n,s,r,o,a)},findByIndex:function(t,e,i,n){return null===(n=this.getLayer(n))?null:d.FindByIndex(t,e,i,n)},findObject:function(t,e,i){if("string"==typeof t){var n=t;if(!(t=this.getObjectLayer(t)))return console.warn("No object layer found with the name: "+n),null}return t.objects.find(e,i)||null},findTile:function(t,e,i,n,s,r,o,a){return null===(a=this.getLayer(a))?null:d.FindTile(t,e,i,n,s,r,o,a)},forEachTile:function(t,e,i,n,s,r,o,a){return null!==(a=this.getLayer(a))&&d.ForEachTile(t,e,i,n,s,r,o,a),this},getImageIndex:function(t){return this.getIndex(this.images,t)},getIndex:function(t,e){for(var i=0;i<t.length;i++)if(t[i].name===e)return i;return null},getLayer:function(t){var e=this.getLayerIndex(t);return null!==e?this.layers[e]:null},getObjectLayer:function(t){var e=this.getIndex(this.objects,t);return null!==e?this.objects[e]:null},getLayerIndex:function(t){return void 0===t?this.currentLayerIndex:"string"==typeof t?this.getLayerIndexByName(t):"number"==typeof t&&t<this.layers.length?t:t instanceof u||t instanceof r?t.layerIndex:null},getLayerIndexByName:function(t){return this.getIndex(this.layers,t)},getTileAt:function(t,e,i,n){return null===(n=this.getLayer(n))?null:d.GetTileAt(t,e,i,n)},getTileAtWorldXY:function(t,e,i,n,s){return null===(s=this.getLayer(s))?null:d.GetTileAtWorldXY(t,e,i,n,s)},getTilesWithin:function(t,e,i,n,s,r){return null===(r=this.getLayer(r))?null:d.GetTilesWithin(t,e,i,n,s,r)},getTilesWithinShape:function(t,e,i,n){return null===(n=this.getLayer(n))?null:d.GetTilesWithinShape(t,e,i,n)},getTilesWithinWorldXY:function(t,e,i,n,s,r,o){return null===(o=this.getLayer(o))?null:d.GetTilesWithinWorldXY(t,e,i,n,s,r,o)},getTileset:function(t){var e=this.getIndex(this.tilesets,t);return null!==e?this.tilesets[e]:null},getTilesetIndex:function(t){return this.getIndex(this.tilesets,t)},hasTileAt:function(t,e,i){return null===(i=this.getLayer(i))?null:d.HasTileAt(t,e,i)},hasTileAtWorldXY:function(t,e,i,n){return null===(n=this.getLayer(n))?null:d.HasTileAtWorldXY(t,e,i,n)},layer:{get:function(){return this.layers[this.currentLayerIndex]},set:function(t){this.setLayer(t)}},putTileAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"putTileAt")?null:null===s?null:d.PutTileAt(t,e,i,n,s)},putTileAtWorldXY:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"putTileAtWorldXY")?null:null===r?null:d.PutTileAtWorldXY(t,e,i,n,s,r)},putTilesAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"putTilesAt")?this:(null!==s&&d.PutTilesAt(t,e,i,n,s),this)},randomize:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"randomize")?this:(null!==r&&d.Randomize(t,e,i,n,s,r),this)},calculateFacesAt:function(t,e,i){return null===(i=this.getLayer(i))?this:(d.CalculateFacesAt(t,e,i),this)},calculateFacesWithin:function(t,e,i,n,s){return null===(s=this.getLayer(s))?this:(d.CalculateFacesWithin(t,e,i,n,s),this)},removeAllLayers:function(){for(var t=0;t<this.layers.length;t++)this.layers[t].tilemapLayer&&this.layers[t].tilemapLayer.destroy();return this.layers.length=0,this.currentLayerIndex=0,this},removeTileAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"removeTileAt")?null:null===s?null:d.RemoveTileAt(t,e,i,n,s)},removeTileAtWorldXY:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"removeTileAtWorldXY")?null:null===r?null:d.RemoveTileAtWorldXY(t,e,i,n,s,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?this:(d.RenderDebug(t,e,i),this)},replaceByIndex:function(t,e,i,n,s,r,o){return o=this.getLayer(o),this._isStaticCall(o,"replaceByIndex")?this:(null!==o&&d.ReplaceByIndex(t,e,i,n,s,r,o),this)},setCollision:function(t,e,i,n){return null===(n=this.getLayer(n))?this:(d.SetCollision(t,e,i,n),this)},setCollisionBetween:function(t,e,i,n,s){return null===(s=this.getLayer(s))?this:(d.SetCollisionBetween(t,e,i,n,s),this)},setCollisionByProperty:function(t,e,i,n){return null===(n=this.getLayer(n))?this:(d.SetCollisionByProperty(t,e,i,n),this)},setCollisionByExclusion:function(t,e,i,n){return null===(n=this.getLayer(n))?this:(d.SetCollisionByExclusion(t,e,i,n),this)},setCollisionFromCollisionGroup:function(t,e,i){return null===(i=this.getLayer(i))?this:(d.SetCollisionFromCollisionGroup(t,e,i),this)},setTileIndexCallback:function(t,e,i,n){return null===(n=this.getLayer(n))?this:(d.SetTileIndexCallback(t,e,i,n),this)},setTileLocationCallback:function(t,e,i,n,s,r,o){return null===(o=this.getLayer(o))?this:(d.SetTileLocationCallback(t,e,i,n,s,r,o),this)},setLayer:function(t){var e=this.getLayerIndex(t);return null!==e&&(this.currentLayerIndex=e),this},setBaseTileSize:function(t,e){this.tileWidth=t,this.tileHeight=e,this.widthInPixels=this.width*t,this.heightInPixels=this.height*e;for(var i=0;i<this.layers.length;i++){this.layers[i].baseTileWidth=t,this.layers[i].baseTileHeight=e;for(var n=this.layers[i].data,s=this.layers[i].width,r=this.layers[i].height,o=0;o<r;++o)for(var a=0;a<s;++a){var h=n[o][a];null!==h&&h.setSize(void 0,void 0,t,e)}}return this},setLayerTileSize:function(t,e,i){if(null===(i=this.getLayer(i)))return this;i.tileWidth=t,i.tileHeight=e;for(var n=i.data,s=i.width,r=i.height,o=0;o<r;++o)for(var a=0;a<s;++a){var h=n[o][a];null!==h&&h.setSize(t,e)}return this},shuffle:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"shuffle")?this:(null!==s&&d.Shuffle(t,e,i,n,s),this)},swapByIndex:function(t,e,i,n,s,r,o){return o=this.getLayer(o),this._isStaticCall(o,"swapByIndex")?this:(null!==o&&d.SwapByIndex(t,e,i,n,s,r,o),this)},tileToWorldX:function(t,e,i){return null===(i=this.getLayer(i))?null:d.TileToWorldX(t,e,i)},tileToWorldY:function(t,e,i){return null===(i=this.getLayer(i))?null:d.TileToWorldY(t,e,i)},tileToWorldXY:function(t,e,i,n,s){return null===(s=this.getLayer(s))?null:d.TileToWorldXY(t,e,i,n,s)},weightedRandomize:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"weightedRandomize")?this:(null!==r&&d.WeightedRandomize(t,e,i,n,s,r),this)},worldToTileX:function(t,e,i,n){return null===(n=this.getLayer(n))?null:d.WorldToTileX(t,e,i,n)},worldToTileY:function(t,e,i,n){return null===(n=this.getLayer(n))?null:d.WorldToTileY(t,e,i,n)},worldToTileXY:function(t,e,i,n,s,r){return null===(r=this.getLayer(r))?null:d.WorldToTileXY(t,e,i,n,s,r)},_isStaticCall:function(t,e){return t.tilemapLayer instanceof u&&(console.warn(e+": You cannot change the tiles in a static tilemap layer"),!0)}});t.exports=p},function(t,e,i){var n=i(29),s=i(77),r=i(451),o=i(450);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var a=0,h=0,l=0;l<e.layer.length;l++)e.layer[l].width>a&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","object layer"),this.opacity=s(t,"opacity",1),this.properties=s(t,"properties",{}),this.propertyTypes=s(t,"propertytypes",{}),this.type=s(t,"type","objectgroup"),this.visible=s(t,"visible",!0),this.objects=s(t,"objects",[])}});t.exports=r},function(t,e,i){var n=i(455),s=i(214),r=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=n(t,o);if(a.x+=e,a.y+=i,t.gid){var h=s(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(r):t.polygon?a.polygon=t.polygon.map(r):t.ellipse?(a.ellipse=t.ellipse,a.width=t.width,a.height=t.height):t.text?(a.width=t.width,a.height=t.height,a.text=t.text):(a.rectangle=!0,a.width=t.width,a.height=t.height);return a}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|n,this.imageMargin=0|s,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},addImage:function(t,e){return this.images.push({gid:t,image:e}),this.total++,this}});t.exports=n},function(t,e){t.exports=function(t){var e=Boolean(2147483648&t),i=Boolean(1073741824&t),n=Boolean(536870912&t);t&=536870911;var s=0,r=!1;return e&&i&&n?(s=Math.PI/2,r=!0):e&&i&&!n?(s=Math.PI,r=!1):e&&!i&&n?(s=Math.PI/2,r=!1):!e||i||n?!e&&i&&n?(s=3*Math.PI/2,r=!1):e||!i||n?e||i||!n?e||i||n||(s=0,r=!1):(s=3*Math.PI/2,r=!0):(s=Math.PI,r=!0):(s=0,r=!0),{gid:t,flippedHorizontal:e,flippedVertical:i,flippedAntiDiagonal:n,rotation:s,flipped:r}}},function(t,e,i){var n=i(29),s=i(77),r=i(459),o=i(457),a=i(456),h=i(454),l=i(453),u=i(452);t.exports=function(t,e,i){if("orthogonal"!==e.orientation)return console.warn("Only orthogonal map types are supported in this version of Phaser"),null;var c=new s({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:e.orientation,format:n.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder});c.layers=r(e,i),c.images=o(e);var d=a(e);return c.tilesets=d.tilesets,c.imageCollections=d.imageCollections,c.objects=h(e),c.tiles=l(c),u(c),c}},function(t,e,i){var n=i(29),s=i(133);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map(function(t){return t.split(",")}),h=s(t,a,i,r,o);return h.format=n.CSV,h}},function(t,e,i){var n=i(29),s=i(133),r=i(216),o=i(215),a=i(210);t.exports=function(t,e,i,h,l,u){var c;switch(e){case n.ARRAY_2D:c=s(t,i,h,l,u);break;case n.CSV:c=r(t,i,h,l,u);break;case n.TILED_JSON:c=o(t,i,u);break;case n.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},function(t,e,i){var n=i(55),s=i(79),r=i(136);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!1),void 0===o&&(o=!0),!s(t,e,a))return null;var h=a.data[e][t];return null===h?null:(a.data[e][t]=i?null:new n(a,-1,t,e,h.width,h.height),o&&h&&h.collides&&r(t,e,a),h)}},function(t,e,i){var n=i(79);t.exports=function(t,e,i){if(n(t,e,i)){var s=i.data[e][t];return null!==s&&s.index>-1}return!1}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l<h.length;l++)h[l]&&h[l].index===t&&(h[l].index=e)}},function(t,e,i){var n=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game,this.scene,this.systems},init:function(){},start:function(){},stop:function(){},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},function(t,e,i){var n={};t.exports=n;var s=i(195);n._motionWakeThreshold=.18,n._motionSleepThreshold=.08,n._minBias=.9,n.update=function(t,e){for(var i=e*e*e,s=0;s<t.length;s++){var r=t[s],o=r.speed*r.speed+r.angularSpeed*r.angularSpeed;if(0===r.force.x&&0===r.force.y){var a=Math.min(r.motion,o),h=Math.max(r.motion,o);r.motion=n._minBias*a+(1-n._minBias)*h,r.sleepThreshold>0&&r.motion<n._motionSleepThreshold*i?(r.sleepCounter+=1,r.sleepCounter>=r.sleepThreshold&&n.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else n.set(r,!1)}},n.afterCollisions=function(t,e){for(var i=e*e*e,s=0;s<t.length;s++){var r=t[s];if(r.isActive){var o=r.collision,a=o.bodyA.parent,h=o.bodyB.parent;if(!(a.isSleeping&&h.isSleeping||a.isStatic||h.isStatic)&&(a.isSleeping||h.isSleeping)){var l=a.isSleeping&&!a.isStatic?a:h,u=l===a?h:a;!l.isStatic&&u.motion>n._motionWakeThreshold*i&&n.set(l,!1)}}}},n.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||s.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&s.trigger(t,"sleepEnd"))}},function(t,e){t.exports={NONE:0,A:1,B:2,BOTH:3}},function(t,e){t.exports={NEVER:0,LITE:1,PASSIVE:2,ACTIVE:4,FIXED:8}},function(t,e,i){var n=i(40),s=i(0),r=i(35),o=i(39),a=i(3),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i,n){void 0===i&&(i=this.offset.x),void 0===n&&(n=this.offset.y);var s=this.gameObject;return!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),this.offset.set(i,n),this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(313);function s(t){if(!(this instanceof s))return new s(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function o(t,e){a(t,0,t.children.length,e,t)}function a(t,e,i,n,s){s||(s=g(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var r,o=e;o<i;o++)r=t.children[o],h(s,t.leaf?n(r):r);return s}function h(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function p(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s<r;s++)o=e.children[s],p(t,a=e.leaf?n(o):o)&&(e.leaf?i.push(o):f(t,a)?this._all(o,i):h.push(o));e=h.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!p(t,e))return!1;for(var n,s,r,o,a=[];e;){for(n=0,s=e.children.length;n<s;n++)if(r=e.children[n],p(t,o=e.leaf?i(r):r)){if(e.leaf||f(t,o))return!0;a.push(r)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var s=this.data;this.data=n,n=s}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=g([]),this},remove:function(t,e){if(!t)return this;for(var i,n,s,o,a=this.data,h=this.toBBox(t),l=[],u=[];a||l.length;){if(a||(a=l.pop(),n=l[l.length-1],i=u.pop(),o=!0),a.leaf&&-1!==(s=r(t,a.children,e)))return a.children.splice(s,1),l.push(a),this._condense(l),this;o||a.leaf||!f(a,h)?n?(i++,a=n.children[i],o=!1):a=null:(l.push(a),u.push(i),i=0,n=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:l,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,n){var s,r=i-e+1,a=this._maxEntries;if(r<=a)return o(s=g(t.slice(e,i+1)),this.toBBox),s;n||(n=Math.ceil(Math.log(r)/Math.log(a)),a=Math.ceil(r/Math.pow(a,n-1))),(s=g([])).leaf=!1,s.height=n;var h,l,u,c,d=Math.ceil(r/a),f=d*Math.ceil(Math.sqrt(a));for(v(t,e,i,f,this.compareMinX),h=e;h<=i;h+=f)for(v(t,h,u=Math.min(h+f-1,i),d,this.compareMinY),l=h;l<=u;l+=d)c=Math.min(l+d-1,u),s.children.push(this._build(t,l,c,n-1));return o(s,this.toBBox),s},_chooseSubtree:function(t,e,i,n){for(var s,r,o,a,h,l,u,d,f,p;n.push(e),!e.leaf&&n.length-1!==i;){for(u=d=1/0,s=0,r=e.children.length;s<r;s++)h=c(o=e.children[s]),f=t,p=o,(l=(Math.max(p.maxX,f.maxX)-Math.min(p.minX,f.minX))*(Math.max(p.maxY,f.maxY)-Math.min(p.minY,f.minY))-h)<d?(d=l,u=h<u?h:u,a=o):l===d&&h<u&&(u=h,a=o);e=a||e.children[0]}return e},_insert:function(t,e,i){var n=this.toBBox,s=i?t:n(t),r=[],o=this._chooseSubtree(s,this.data,e,r);for(o.children.push(t),h(o,s);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,y,m;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),y=Math.min(f.maxX,p.maxX),m=Math.min(f.maxY,p.maxY),o=Math.max(0,y-g)*Math.max(0,m-v),h=c(s)+c(r),o<l?(l=o,d=n,u=h<u?h:u):o===l&&h<u&&(u=h,d=n);return d},_chooseSplitAxis:function(t,e,i){var n=t.leaf?this.compareMinX:l,s=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,s)&&t.children.sort(n)},_allDistMargin:function(t,e,i,n){t.children.sort(n);var s,r,o=this.toBBox,l=a(t,0,e,o),u=a(t,i-e,i,o),c=d(l)+d(u);for(s=e;s<i-e;s++)r=t.children[s],h(l,t.leaf?o(r):r),c+=d(l);for(s=i-e-1;s>=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;t<i.length;t++){e=i[t];var s=n.indexOf(e);-1!==s&&n.splice(s,1)}for(i.length=0,i=this._pending,t=0;t<i.length;t++)e=i[t],this._active.push(e);return i.length=0,this._toProcess=0,this._active},getActive:function(){return this._active},destroy:function(){this._pending=[],this._active=[],this._destroy=[]}});t.exports=n},function(t,e,i){var n=i(35);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+s;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dy<e._dy&&(-(r=t.y-e.bottom)>o&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=i(35);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dx<e._dx&&(-(r=t.x-e.width-e.x)>o&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(40),s=i(0),r=i(35),o=i(172),a=i(9),h=i(39),l=i(3),u=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x,e.y),this.prev=new l(e.x,e.y),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=n,this.sourceWidth=i,this.sourceHeight=n,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(n/2),this.center=new l(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.isMoving=!1,this.stopVelocityOnCollide=!0,this.physicsType=r.DYNAMIC_BODY,this._reset=!0,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._bounds=new a},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var n=!1;if(this.syncBounds){var s=t.getBounds(this._bounds);this.width=s.width,this.height=s.height,n=!0}else{var r=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===r&&this._sy===a||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*a,this._sx=r,this._sy=a,n=!0)}n&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},update:function(t){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.none=!0,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.updateBounds();var e=this.transform;if(this.position.x=e.x+e.scaleX*(this.offset.x-e.displayOriginX),this.position.y=e.y+e.scaleY*(this.offset.y-e.displayOriginY),this.updateCenter(),this.rotation=e.rotation,this.preRotation=this.rotation,this._reset&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves){this.world.updateMotion(this,t);var i=this.velocity.x,n=this.velocity.y;this.newVelocity.set(i*t,n*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(n,i),this.speed=Math.sqrt(i*i+n*n),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit("worldbounds",this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y,this.moves&&(0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.gameObject.x+=this._dx,this.gameObject.y+=this._dy,this._reset=!0),this._dx<0?this.facing=r.FACING_LEFT:this._dx>0&&(this.facing=r.FACING_RIGHT),this._dy<0?this.facing=r.FACING_UP:this._dy>0&&(this.facing=r.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.x<e.x&&i.left?(t.x=e.x,this.velocity.x*=n,this.blocked.left=!0,this.blocked.none=!1):this.right>e.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.y<e.y&&i.up?(t.y=e.y,this.velocity.y*=s,this.blocked.up=!0,this.blocked.none=!1):this.bottom>e.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft(this.position),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height)),this.debugShowVelocity&&(t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t){return void 0===t&&(t=!0),this.collideWorldBounds=t,this},setVelocity:function(t,e){return this.velocity.set(t,e),this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},function(t,e,i){var n=i(232),s=i(23),r=i(0),o=i(231),a=i(35),h=i(52),l=i(11),u=i(248),c=i(247),d=i(246),f=i(230),p=i(229),g=i(4),v=i(228),y=i(514),m=i(9),x=i(227),w=i(513),b=i(508),T=i(507),S=i(95),_=i(225),A=i(226),C=i(38),M=i(3),P=i(53),E=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.bodies=new S,this.staticBodies=new S,this.pendingDestroy=new S,this.colliders=new v,this.gravity=new M(g(e,"gravity.x",0),g(e,"gravity.y",0)),this.bounds=new m(g(e,"x",0),g(e,"y",0),g(e,"width",t.sys.game.config.width),g(e,"height",t.sys.game.config.height)),this.checkCollision={up:g(e,"checkCollision.up",!0),down:g(e,"checkCollision.down",!0),left:g(e,"checkCollision.left",!0),right:g(e,"checkCollision.right",!0)},this.fps=g(e,"fps",60),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=g(e,"timeScale",1),this.OVERLAP_BIAS=g(e,"overlapBias",4),this.TILE_BIAS=g(e,"tileBias",16),this.forceX=g(e,"forceX",!1),this.isPaused=g(e,"isPaused",!1),this._total=0,this.drawDebug=g(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:g(e,"debugShowBody",!0),debugShowStaticBody:g(e,"debugShowStaticBody",!0),debugShowVelocity:g(e,"debugShowVelocity",!0),bodyDebugColor:g(e,"debugBodyColor",16711935),staticBodyDebugColor:g(e,"debugStaticBodyColor",255),velocityDebugColor:g(e,"debugVelocityColor",65280)},this.maxEntries=g(e,"maxEntries",16),this.useTree=g(e,"useTree",!0),this.tree=new x(this.maxEntries),this.staticTree=new x(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new C,this._tempMatrix2=new C,this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=a.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];if(n.isParent)for(var s=n.getChildren(),r=0;r<s.length;r++){var o=s[r];o.isParent?this.enable(o,e):this.enableBody(o,e)}else this.enableBody(n,e)}},enableBody:function(t,e){return void 0===e&&(e=a.DYNAMIC_BODY),t.body||(e===a.DYNAMIC_BODY?t.body=new n(this,t):e===a.STATIC_BODY&&(t.body=new _(this,t))),this.add(t.body),t},add:function(t){return t.physicsType===a.DYNAMIC_BODY?this.bodies.set(t):t.physicsType===a.STATIC_BODY&&(this.staticBodies.set(t),this.staticTree.insert(t)),t.enable=!0,t},disable:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];if(i.isParent)for(var n=i.getChildren(),s=0;s<n.length;s++){var r=n[s];r.isParent?this.disable(r):this.disableBody(r.body)}else this.disableBody(i.body)}},disableBody:function(t){this.remove(t),t.enable=!1},remove:function(t){t.physicsType===a.DYNAMIC_BODY?(this.tree.remove(t),this.bodies.delete(t)):t.physicsType===a.STATIC_BODY&&(this.staticBodies.delete(t),this.staticTree.remove(t))},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},setBounds:function(t,e,i,n,s,r,o,a){return this.bounds.setTo(t,e,i,n),void 0!==s&&this.setBoundsCollision(s,r,o,a),this},setBoundsCollision:function(t,e,i,n){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===n&&(n=!0),this.checkCollision.left=t,this.checkCollision.right=e,this.checkCollision.up=i,this.checkCollision.down=n,this},pause:function(){return this.isPaused=!0,this.emit("pause"),this},resume:function(){return this.isPaused=!1,this.emit("resume"),this},addCollider:function(t,e,i,n,s){void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i);var r=new o(this,!1,t,e,i,n,s);return this.colliders.add(r),r},addOverlap:function(t,e,i,n,s){void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i);var r=new o(this,!0,t,e,i,n,s);return this.colliders.add(r),r},removeCollider:function(t){return this.colliders.remove(t),this},setFPS:function(t){return this.fps=t,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this},update:function(t,e){if(!this.isPaused&&0!==this.bodies.size){var i=0,n=this._frameTime,s=this._frameTimeMS*this.timeScale;for(this._elapsed+=e;this._elapsed>=s;)this._elapsed-=s,i++,this.step(n);this.stepsLastFrame=i}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e<s;e++)(i=n[e]).enable&&i.update(t);this.useTree&&(this.tree.clear(),this.tree.load(n));var r=this.colliders.update();for(e=0;e<r.length;e++){var o=r[e];o.active&&o.update()}for(s=n.length,e=0;e<s;e++)(i=n[e]).enable&&i.postUpdate()},postUpdate:function(){var t,e,i=this.bodies,n=this.staticBodies,s=this.pendingDestroy,r=i.entries,o=r.length;if(this.drawDebug){var h=this.debugGraphic;for(h.clear(),t=0;t<o;t++)(e=r[t]).willDrawDebug()&&e.drawDebug(h);for(o=(r=n.entries).length,t=0;t<o;t++)(e=r[t]).willDrawDebug()&&e.drawDebug(h)}if(s.size>0){var l=this.tree,u=this.staticTree;for(o=(r=s.entries).length,t=0;t<o;t++)(e=r[t]).physicsType===a.DYNAMIC_BODY?(l.remove(e),i.delete(e)):e.physicsType===a.STATIC_BODY&&(u.remove(e),n.delete(e)),e.world=void 0,e.gameObject=void 0;s.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,n=t.angularAcceleration,r=t.angularDrag,o=t.maxAngular;n?i+=n*e:t.allowDrag&&r&&(c(i-(r*=e),0,.1)?i-=r:d(i+r,0,.1)?i+=r:i=0);var a=(i=s(i,-o,o))-t.angularVelocity;t.angularVelocity+=a,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,n=t.acceleration.x,r=t.drag.x,o=t.maxVelocity.x,a=t.velocity.y,h=t.acceleration.y,l=t.drag.y,f=t.maxVelocity.y,p=t.speed,g=t.allowDrag,v=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,a+=(this.gravity.y+t.gravity.y)*e),n?i+=n*e:g&&r&&(v?(i*=r,u(p,0,.001)&&(i=0)):c(i-(r*=e),0,.01)?i-=r:d(i+r,0,.01)?i+=r:i=0),h?a+=h*e:g&&l&&(v?(a*=l,u(p,0,.001)&&(a=0)):c(a-(l*=e),0,.01)?a-=l:d(a+l,0,.01)?a+=l:a=0),i=s(i,-o,o),a=s(a,-f,f),t.velocity.set(i,a)},separate:function(t,e,i,n,s){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(n,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,s);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,o=t.isCircle?t:e,a={x:r.x,y:r.y,right:r.right,bottom:r.bottom},h=o.center;if((h.y<a.y||h.y>a.bottom)&&(h.x<a.x||h.x>a.right))return this.separateCircle(t,e,s)}var l=!1,u=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)<Math.abs(this.gravity.x+t.gravity.x)?(l=b(t,e,s,this.OVERLAP_BIAS),this.intersects(t,e)&&(u=T(t,e,s,this.OVERLAP_BIAS))):(u=T(t,e,s,this.OVERLAP_BIAS),this.intersects(t,e)&&(l=b(t,e,s,this.OVERLAP_BIAS)));var c=l||u;return c&&(s&&(t.onOverlap||e.onOverlap)?this.emit("overlap",t.gameObject,e.gameObject,t,e):(t.postUpdate(),e.postUpdate(),(t.onCollide||e.onCollide)&&this.emit("collide",t.gameObject,e.gameObject,t,e))),c},separateCircle:function(t,e,i,n){f(t,e,!1,n),p(t,e,!1,n);var s=e.center.x-t.center.x,r=e.center.y-t.center.y,o=Math.atan2(r,s),a=0;if(t.isCircle!==e.isCircle){var l={x:e.isCircle?t.position.x:e.position.x,y:e.isCircle?t.position.y:e.position.y,right:e.isCircle?t.right:e.right,bottom:e.isCircle?t.bottom:e.bottom},u={x:t.isCircle?t.center.x:e.center.x,y:t.isCircle?t.center.y:e.center.y,radius:t.isCircle?t.halfWidth:e.halfWidth};u.y<l.y?u.x<l.x?a=h(u.x,u.y,l.x,l.y)-u.radius:u.x>l.right&&(a=h(u.x,u.y,l.right,l.y)-u.radius):u.y>l.bottom&&(u.x<l.x?a=h(u.x,u.y,l.x,l.bottom)-u.radius:u.x>l.right&&(a=h(u.x,u.y,l.right,l.bottom)-u.radius)),a*=-1}else a=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===a||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==a&&(t.onOverlap||e.onOverlap)&&this.emit("overlap",t.gameObject,e.gameObject,t,e),0!==a;var c=t.velocity.x,d=t.velocity.y,g=t.mass,v=e.velocity.x,y=e.velocity.y,m=e.mass,x=c*Math.cos(o)+d*Math.sin(o),w=c*Math.sin(o)-d*Math.cos(o),b=v*Math.cos(o)+y*Math.sin(o),T=v*Math.sin(o)-y*Math.cos(o),S=((g-m)*x+2*m*b)/(g+m),_=(2*g*x+(m-g)*b)/(g+m);t.immovable||(t.velocity.x=(S*Math.cos(o)-w*Math.sin(o))*t.bounce.x,t.velocity.y=(w*Math.cos(o)+S*Math.sin(o))*t.bounce.y,c=t.velocity.x,d=t.velocity.y),e.immovable||(e.velocity.x=(_*Math.cos(o)-T*Math.sin(o))*e.bounce.x,e.velocity.y=(T*Math.cos(o)+_*Math.sin(o))*e.bounce.y,v=e.velocity.x,y=e.velocity.y),Math.abs(o)<Math.PI/2?c>0&&!t.immovable&&v>c?t.velocity.x*=-1:v<0&&!e.immovable&&c<v?e.velocity.x*=-1:d>0&&!t.immovable&&y>d?t.velocity.y*=-1:y<0&&!e.immovable&&d<y&&(e.velocity.y*=-1):Math.abs(o)>Math.PI/2&&(c<0&&!t.immovable&&v<c?t.velocity.x*=-1:v>0&&!e.immovable&&c>v?e.velocity.x*=-1:d<0&&!t.immovable&&y<d?t.velocity.y*=-1:y>0&&!e.immovable&&c>y&&(e.velocity.y*=-1));var A=this._frameTime;return t.immovable||(t.x+=t.velocity.x*A-a*Math.cos(o),t.y+=t.velocity.y*A-a*Math.sin(o)),e.immovable||(e.x+=e.velocity.x*A+a*Math.cos(o),e.y+=e.velocity.y*A+a*Math.sin(o)),(t.onCollide||e.onCollide)&&this.emit("collide",t.gameObject,e.gameObject,t,e),t.postUpdate(),e.postUpdate(),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var a=Array.isArray(t),h=Array.isArray(e);if(this._total=0,a||h)if(!a&&h)for(o=0;o<e.length;o++)this.collideHandler(t,e[o],i,n,s,r);else if(a&&!h)for(o=0;o<t.length;o++)this.collideHandler(t[o],e,i,n,s,r);else for(o=0;o<t.length;o++)for(var l=0;l<e.length;l++)this.collideHandler(t[o],e[l],i,n,s,r);else this.collideHandler(t,e,i,n,s,r);return this._total>0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;o<h;o++)u!==(l=d[o])&&e.contains(l.gameObject)&&this.separate(u,l,n,s,r)&&(i&&i.call(s,u.gameObject,l.gameObject),this._total++)}else{var f=e.getChildren(),p=e.children.entries.indexOf(t);for(h=f.length,o=0;o<h;o++)(l=f[o].body)&&o!==p&&l.enable&&this.separate(u,l,n,s,r)&&(i&&i.call(s,u.gameObject,l.gameObject),this._total++)}},collideGroupVsTilemapLayer:function(t,e,i,n,s,r){var o=t.getChildren();if(0===o.length)return!1;for(var a=!1,h=0;h<o.length;h++)o[h].body&&this.collideSpriteVsTilemapLayer(o[h],e,i,n,s,r)&&(a=!0);return a},collideSpriteVsTilemapLayer:function(t,e,i,n,s,r){var o=t.body;if(!o.enable)return!1;var a=o.position.x,h=o.position.y,l=o.width,u=o.height,c=e.layer;if(c.tileWidth>c.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f,p=e.getTilesWithinWorldXY(a,h,l,u);if(0===p.length)return!1;for(var g={left:0,right:0,top:0,bottom:0},v=0;v<p.length;v++)f=p[v],g.left=e.tileToWorldX(f.x),g.top=e.tileToWorldY(f.y),f.baseHeight!==f.height&&(g.top-=(f.height-f.baseHeight)*e.scaleY),g.right=g.left+f.width*e.scaleX,g.bottom=g.top+f.height*e.scaleY,A(g,o)&&(!n||n.call(s,t,f))&&y(f,t)&&(r||w(v,o,f,g,e,this.TILE_BIAS))&&(this._total++,i&&i.call(s,t,f),r&&o.onOverlap?t.emit("overlap",o.gameObject,f,o,null):o.onCollide&&t.emit("collide",o.gameObject,f,o,null),o.postUpdate())},collideGroupVsGroup:function(t,e,i,n,s,r){if(0!==t.length&&0!==e.length)for(var o=t.getChildren(),a=0;a<o.length;a++)this.collideSpriteVsGroup(o[a],e,i,n,s,r)},wrap:function(t,e){t.body?this.wrapObject(t,e):t.getChildren?this.wrapArray(t.getChildren(),e):Array.isArray(t)?this.wrapArray(t,e):this.wrapObject(t,e)},wrapArray:function(t,e){for(var i=0;i<t.length;i++)this.wrapObject(t[i],e)},wrapObject:function(t,e){void 0===e&&(e=0),t.x=P(t.x,this.bounds.left-e,this.bounds.right+e),t.y=P(t.y,this.bounds.top-e,this.bounds.bottom+e)},shutdown:function(){this.tree.clear(),this.staticTree.clear(),this.bodies.clear(),this.staticBodies.clear(),this.colliders.destroy(),this.removeAllListeners()},destroy:function(){this.shutdown(),this.scene=null}});t.exports=E},function(t,e,i){var n=i(104),s=i(0),r=i(35),o=i(88),a=i(8),h=new s({Extends:o,initialize:function(t,e,i,s){i||s?a(i)?(s=i,i=null,s.createCallback=this.createCallbackHandler,s.removeCallback=this.removeCallbackHandler,s.createMultipleCallback=this.createMultipleCallbackHandler,s.classType=n):Array.isArray(i)&&a(i[0])&&(s=i,i=null,s.forEach(function(t){t.createCallback=this.createCallbackHandler,t.removeCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=n})):s={createCallback:this.createCallbackHandler,removeCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:n},this.world=t,this.physicsType=r.STATIC_BODY,o.call(this,e,i,s)},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e<t.length;e++)t[e].body.reset();return this}});t.exports=h},function(t,e,i){var n=i(104),s=i(0),r=i(35),o=i(2),a=i(88),h=i(8),l=new s({Extends:a,initialize:function(t,e,i,s){i||s?h(i)?(s=i,i=null,s.createCallback=this.createCallbackHandler,s.removeCallback=this.removeCallbackHandler):Array.isArray(i)&&h(i[0])&&(s=i,i=null,s.forEach(function(t){t.createCallback=this.createCallbackHandler,t.removeCallback=this.removeCallbackHandler})):s={createCallback:this.createCallbackHandler,removeCallback:this.removeCallbackHandler},this.world=t,s.classType=o(s,"classType",n),this.physicsType=r.DYNAMIC_BODY,this.defaults={setCollideWorldBounds:o(s,"collideWorldBounds",!1),setAccelerationX:o(s,"accelerationX",0),setAccelerationY:o(s,"accelerationY",0),setAllowDrag:o(s,"allowDrag",!0),setAllowGravity:o(s,"allowGravity",!0),setAllowRotation:o(s,"allowRotation",!0),setBounceX:o(s,"bounceX",0),setBounceY:o(s,"bounceY",0),setDragX:o(s,"dragX",0),setDragY:o(s,"dragY",0),setEnable:o(s,"enable",!0),setGravityX:o(s,"gravityX",0),setGravityY:o(s,"gravityY",0),setFrictionX:o(s,"frictionX",0),setFrictionY:o(s,"frictionY",0),setVelocityX:o(s,"velocityX",0),setVelocityY:o(s,"velocityY",0),setAngularVelocity:o(s,"angularVelocity",0),setAngularAcceleration:o(s,"angularAcceleration",0),setAngularDrag:o(s,"angularDrag",0),setMass:o(s,"mass",1),setImmovable:o(s,"immovable",!1)},a.call(this,e,i,s)},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var n=this.getChildren(),s=0;s<n.length;s++)n[s].body.velocity.set(t+s*i,e+s*i);return this},setVelocityX:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),n=0;n<i.length;n++)i[n].body.velocity.x=t+n*e;return this},setVelocityY:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),n=0;n<i.length;n++)i[n].body.velocity.y=t+n*e;return this}});t.exports=l},function(t,e,i){t.exports={Acceleration:i(526),Angular:i(525),Bounce:i(524),Debug:i(523),Drag:i(522),Enable:i(521),Friction:i(520),Gravity:i(519),Immovable:i(518),Mass:i(517),Size:i(516),Velocity:i(515)}},function(t,e,i){var n=i(0),s=i(236),r=i(87),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},function(t,e,i){var n=i(237),s=i(104),r=i(0),o=i(35),a=i(235),h=i(234),l=new r({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,n,s){return this.world.addCollider(t,e,i,n,s)},overlap:function(t,e,i,n,s){return this.world.addOverlap(t,e,i,n,s)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.world.enableBody(r,o.STATIC_BODY),r},image:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.world.enableBody(r,o.DYNAMIC_BODY),r},staticSprite:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,o.STATIC_BODY),r},sprite:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,o.DYNAMIC_BODY),r},staticGroup:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new a(this.world,this.world.scene,t,e))},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=l},function(t,e,i){var n=i(0),s=i(138),r=i(241),o=new Int8Array([1,2,0]),a=new Float32Array([0,0,0]),h=new s(1,0,0),l=new s(0,1,0),u=new s,c=new r,d=new n({initialize:function(t,e,i,n){"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+i,this.normalize())},setAxes:function(t,e,i){var n=c.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,d=e;if(1-u>1e-6){var f=Math.acos(u),p=Math.sin(f);c=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n,r=s?1/s:0;return this.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this.x=(i[7]-i[5])*e,this.y=(i[2]-i[6])*e,this.z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var r=o[s],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=n,t[13]=r,t[14]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],y=e*o-i*r,m=e*a-n*r,x=e*h-s*r,w=i*a-n*o,b=i*h-s*o,T=n*h-s*a,S=l*p-u*f,_=l*g-c*f,A=l*v-d*f,C=u*g-c*p,M=u*v-d*p,P=c*v-d*g,E=y*P-m*M+x*C+w*A-b*_+T*S;return E?(E=1/E,t[0]=(o*P-a*M+h*C)*E,t[1]=(n*M-i*P-s*C)*E,t[2]=(p*T-g*b+v*w)*E,t[3]=(c*b-u*T-d*w)*E,t[4]=(a*A-r*P-h*_)*E,t[5]=(e*P-n*A+s*_)*E,t[6]=(g*x-f*T-v*m)*E,t[7]=(l*T-c*x+d*m)*E,t[8]=(r*M-o*A+h*S)*E,t[9]=(i*A-e*M-s*S)*E,t[10]=(f*b-p*x+v*y)*E,t[11]=(u*x-l*b-d*y)*E,t[12]=(o*_-r*C-a*S)*E,t[13]=(e*C-i*_+n*S)*E,t[14]=(p*m-f*w-g*y)*E,t[15]=(l*w-u*m+c*y)*E,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return t[0]=o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),t[1]=-(i*(c*v-d*g)-u*(n*v-s*g)+p*(n*d-s*c)),t[2]=i*(a*v-h*g)-o*(n*v-s*g)+p*(n*h-s*a),t[3]=-(i*(a*d-h*c)-o*(n*d-s*c)+u*(n*h-s*a)),t[4]=-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),t[5]=e*(c*v-d*g)-l*(n*v-s*g)+f*(n*d-s*c),t[6]=-(e*(a*v-h*g)-r*(n*v-s*g)+f*(n*h-s*a)),t[7]=e*(a*d-h*c)-r*(n*d-s*c)+l*(n*h-s*a),t[8]=r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),t[9]=-(e*(u*v-d*p)-l*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=t.val,x=m[0],w=m[1],b=m[2],T=m[3];return e[0]=x*i+w*o+b*u+T*p,e[1]=x*n+w*a+b*c+T*g,e[2]=x*s+w*h+b*d+T*v,e[3]=x*r+w*l+b*f+T*y,x=m[4],w=m[5],b=m[6],T=m[7],e[4]=x*i+w*o+b*u+T*p,e[5]=x*n+w*a+b*c+T*g,e[6]=x*s+w*h+b*d+T*v,e[7]=x*r+w*l+b*f+T*y,x=m[8],w=m[9],b=m[10],T=m[11],e[8]=x*i+w*o+b*u+T*p,e[9]=x*n+w*a+b*c+T*g,e[10]=x*s+w*h+b*d+T*v,e[11]=x*r+w*l+b*f+T*y,x=m[12],w=m[13],b=m[14],T=m[15],e[12]=x*i+w*o+b*u+T*p,e[13]=x*n+w*a+b*c+T*g,e[14]=x*s+w*h+b*d+T*v,e[15]=x*r+w*l+b*f+T*y,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},scale:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),s=1-i,r=t.x,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=i[0],c=i[1],d=i[2],f=i[3],p=i[4],g=i[5],v=i[6],y=i[7],m=i[8],x=i[9],w=i[10],b=i[11],T=n*n*l+h,S=s*n*l+r*a,_=r*n*l-s*a,A=n*s*l-r*a,C=s*s*l+h,M=r*s*l+n*a,P=n*r*l+s*a,E=s*r*l-n*a,k=r*r*l+h;return i[0]=u*T+p*S+m*_,i[1]=c*T+g*S+x*_,i[2]=d*T+v*S+w*_,i[3]=f*T+y*S+b*_,i[4]=u*A+p*C+m*M,i[5]=c*A+g*C+x*M,i[6]=d*A+v*C+w*M,i[7]=f*A+y*C+b*M,i[8]=u*P+p*E+m*k,i[9]=c*P+g*E+x*k,i[10]=d*P+v*E+w*k,i[11]=f*P+y*E+b*k,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,y=o*h,m=o*l;return i[0]=1-(f+g),i[1]=c+m,i[2]=d-y,i[3]=0,i[4]=c-m,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+y,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,y=r*h;return e[0]=1-(d+p),e[1]=u+y,e[2]=c-v,e[3]=0,e[4]=u-y,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),y=h*(g*=v)-l*(p*=v),m=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(y*y+m*m+x*x))?(y*=v=1/v,m*=v,x*=v):(y=0,m=0,x=0);var w=p*x-g*m,b=g*y-f*x,T=f*m-p*y;return(v=Math.sqrt(w*w+b*b+T*T))?(w*=v=1/v,b*=v,T*=v):(w=0,b=0,T=0),n[0]=y,n[1]=w,n[2]=f,n[3]=0,n[4]=m,n[5]=b,n[6]=p,n[7]=0,n[8]=x,n[9]=T,n[10]=g,n[11]=0,n[12]=-(y*s+m*r+x*o),n[13]=-(w*s+b*r+T*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.val,h=Math.sin(i),l=Math.cos(i);return n[10]=1,n[15]=1,n[0]=l,n[1]=h,n[4]=-h,n[5]=l,h=Math.sin(e),l=Math.cos(e),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;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,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*f,t[8]=(r*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],y=c[5],m=c[6],x=c[7],w=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+y*h,e[4]=g*n+v*o+y*l,e[5]=g*s+v*a+y*u,e[6]=m*i+x*r+w*h,e[7]=m*n+x*o+w*l,e[8]=m*s+x*a+w*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-h*s,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,s=t.w,r=e+e,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,y=this.val;return y[0]=1-(c+f),y[3]=l+v,y[6]=u-g,y[1]=l-v,y[4]=1-(h+f),y[7]=d+p,y[2]=u+g,y[5]=d-p,y[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],y=e[14],m=e[15],x=n*h-s*a,w=n*l-r*a,b=n*u-o*a,T=s*l-r*h,S=s*u-o*h,_=r*u-o*l,A=c*v-d*g,C=c*y-f*g,M=c*m-p*g,P=d*y-f*v,E=d*m-p*v,k=f*m-p*y,L=x*k-w*E+b*P+T*M-S*C+_*A;return L?(L=1/L,i[0]=(h*k-l*E+u*P)*L,i[1]=(l*M-a*k-u*C)*L,i[2]=(a*E-h*M+u*A)*L,i[3]=(r*E-s*k-o*P)*L,i[4]=(n*k-r*M+o*C)*L,i[5]=(s*M-n*E-o*A)*L,i[6]=(v*_-y*S+m*T)*L,i[7]=(y*b-g*_-m*w)*L,i[8]=(g*S-v*b+m*x)*L,this):null}});t.exports=n},function(t,e){t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e,i){var n=i(244);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t<e+i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)<i}},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},function(t,e){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n){var s="txt";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"text",cache:t.cacheManager.text,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this}),t.exports=l},function(t,e,i){var n=i(0),s=i(21),r=i(2),o=i(141),a=i(8),h=new n({Extends:s,initialize:function(t,e,i,n){if(a(e)){var o=e;e=r(o,"key"),n=r(o,"config",n)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:n};s.call(this,t,h),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t<this.data.length;t++){var e=this.data[t];e.oncanplaythrough=null,e.onerror=null}this.loader.nextFile(this,!1)},onProgress:function(t){var e=t.target;e.oncanplaythrough=null,e.onerror=null,this.filesLoaded++,this.percentComplete=Math.min(this.filesLoaded/this.filesTotal,1),this.loader.emit("fileprogress",this,this.percentComplete),this.filesLoaded===this.filesTotal&&this.onLoad()},load:function(){this.data=[];var t=this.config&&this.config.instances||1;this.filesTotal=t,this.filesLoaded=0,this.percentComplete=0;for(var e=0;e<t;e++){var i=new Audio;i.dataset.name=this.key+("0"+e).slice(-2),i.dataset.used="false",this.locked?i.dataset.locked="true":(i.dataset.locked="false",i.preload="auto",i.oncanplaythrough=this.onProgress.bind(this),i.onerror=this.onError.bind(this)),this.data.push(i)}for(e=0;e<this.data.length;e++)(i=this.data[e]).src=o(this,this.loader.baseURL),this.locked||i.load();this.locked&&setTimeout(this.onLoad.bind(this))}});t.exports=h},function(t,e,i){var n=i(0),s=i(26),r=i(21),o=i(7),a=i(2),h=i(252),l=i(8),u=new n({Extends:r,initialize:function(t,e,i,n,s){if(l(e)){var o=e;e=a(o,"key"),n=a(o,"xhrSettings"),s=a(o,"context",s)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:n,config:{context:s}};r.call(this,t,h)},onProcess:function(){this.state=s.FILE_PROCESSING;var t=this;this.config.context.decodeAudioData(this.xhrLoader.response,function(e){t.data=e,t.onProcessComplete()},function(e){console.error("Error decoding audio: "+this.key+" - ",e?e.message:null),t.onProcessError()}),this.config.context=null}});u.create=function(t,e,i,n,s){var r=t.systems.game,o=r.config.audio,c=r.device.audio;l(e)&&(i=a(e,"url",[]),n=a(e,"config",{}));var d=u.getAudioURL(r,i);return d?!c.webAudio||o&&o.disableWebAudio?new h(t,e,d,n):new u(t,e,d,s,r.sound.context):null},u.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n=a(e[i],"url",e[i]);if(0===n.indexOf("blob:")||0===n.indexOf("data:"))return n;var s=n.match(/\.([a-zA-Z0-9]+)($|\?)/);if(s=a(e[i],"type",s?s[1]:"").toLowerCase(),t.device.audio[s])return{url:n,type:s}}return null},o.register("audio",function(t,e,i,n){var s,r=this.systems.game,o=r.config.audio,a=r.device.audio;if(o&&o.noAudio||!a.webAudio&&!a.audioData)return this;if(Array.isArray(t))for(var h=0;h<t.length;h++)(s=u.create(this,t[h]))&&this.addFile(s);else(s=u.create(this,t,e,i,n))&&this.addFile(s);return this}),t.exports=u},function(t,e,i){var n=i(140);t.exports=function(t,e){var i=n(e,t.xhrSettings),s=new XMLHttpRequest;return s.open("GET",t.src,i.async,i.user,i.password),s.responseType=t.xhrSettings.responseType,s.timeout=i.timeout,i.header&&i.headerValue&&s.setRequestHeader(i.header,i.headerValue),i.requestedWith&&s.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&s.overrideMimeType(i.overrideMimeType),s.onload=t.onLoad.bind(t,s),s.onerror=t.onError.bind(t),s.onprogress=t.onProgress.bind(t),s.send(),s}},function(t,e,i){var n=i(0),s=i(2),r=i(605),o=i(603),a=new n({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var n=0;n<e.length;n++){var a=e[n];"string"==typeof a?this.keyCodes.push(a.toUpperCase().charCodeAt(0)):"number"==typeof a?this.keyCodes.push(a):a.hasOwnProperty("keyCode")&&this.keyCodes.push(a.keyCode)}this.current=this.keyCodes[0],this.index=0,this.size=this.keyCodes.length,this.timeLastMatched=0,this.matched=!1,this.timeMatched=0,this.resetOnWrongKey=s(i,"resetOnWrongKey",!0),this.maxKeyDelay=s(i,"maxKeyDelay",0),this.resetOnMatch=s(i,"resetOnMatch",!1),this.deleteOnMatch=s(i,"deleteOnMatch",!1);var h=this,l=function(t){!h.matched&&h.enabled&&(r(t,h)&&(h.manager.emit("keycombomatch",h,t),h.resetOnMatch?o(h):h.deleteOnMatch&&h.destroy()))};this.onKeyDown=l,this.manager.on("keydown",l)},progress:{get:function(){return this.index/this.size}},destroy:function(){this.enabled=!1,this.keyCodes=[],this.manager.off("keydown",this.onKeyDown),this.manager=null}});t.exports=a},function(t,e,i){var n=new(i(0))({initialize:function(t){this.keyCode=t,this.originalEvent=void 0,this.preventDefault=!0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},reset:function(){return this.preventDefault=!0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this}});t.exports=n},function(t,e,i){var n=i(259),s=i(258),r=i(0),o=i(11),a=i(3),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r<e.buttons.length;r++)i.push(new s(this,r));this.buttons=i;var h=[];for(r=0;r<e.axes.length;r++)h.push(new n(this,r));this.axes=h,this.vibration=e.vibrationActuator;var l={value:0,pressed:!1};this._LCLeft=i[14]?i[14]:l,this._LCRight=i[15]?i[15]:l,this._LCTop=i[12]?i[12]:l,this._LCBottom=i[13]?i[13]:l,this._RCLeft=i[2]?i[2]:l,this._RCRight=i[1]?i[1]:l,this._RCTop=i[3]?i[3]:l,this._RCBottom=i[0]?i[0]:l,this._FBLeftTop=i[4]?i[4]:l,this._FBLeftBottom=i[6]?i[6]:l,this._FBRightTop=i[5]?i[5]:l,this._FBRightBottom=i[7]?i[7]:l;var u={value:0};this._HAxisLeft=h[0]?h[0]:u,this._VAxisLeft=h[1]?h[1]:u,this._HAxisRight=h[2]?h[2]:u,this._VAxisRight=h[3]?h[3]:u,this.leftStick=new a,this.rightStick=new a},getAxisTotal:function(){return this.axes.length},getAxisValue:function(t){return this.axes[t].getValue()},setAxisThreshold:function(t){for(var e=0;e<this.axes.length;e++)this.axes[e].threshold=t},getButtonTotal:function(){return this.buttons.length},getButtonValue:function(t){return this.buttons[t].value},isButtonDown:function(t){return this.buttons[t].pressed},update:function(t){var e,i=this.buttons,n=t.buttons,s=i.length;for(e=0;e<s;e++)i[e].update(n[e].value);var r=this.axes,o=t.axes;for(s=r.length,e=0;e<s;e++)r[e].update(o[e]);s>=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t<this.buttons.length;t++)this.buttons[t].destroy();for(t=0;t<this.axes.length;t++)this.axes[t].destroy();this.buttons=[],this.axes=[]},connected:{get:function(){return this.pad.connected}},timestamp:{get:function(){return this.pad.timestamp}},left:{get:function(){return this._LCLeft.pressed}},right:{get:function(){return this._LCRight.pressed}},up:{get:function(){return this._LCTop.pressed}},down:{get:function(){return this._LCBottom.pressed}},A:{get:function(){return this._RCBottom.pressed}},Y:{get:function(){return this._RCTop.pressed}},X:{get:function(){return this._RCLeft.pressed}},B:{get:function(){return this._RCRight.pressed}},L1:{get:function(){return this._FBLeftTop.value}},L2:{get:function(){return this._FBLeftBottom.value}},R1:{get:function(){return this._FBRightTop.value}},R2:{get:function(){return this._FBRightBottom.value}}});t.exports=h},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit("down",e,this,t),this.pad.emit("down",i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit("up",e,this,t),this.pad.emit("up",i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value)<this.threshold?0:this.value},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e){t.exports=function(t,e,i){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragX:0,dragY:0}}},function(t,e,i){var n=i(6);function s(t,e,i,n){var s=t-i,r=e-n,o=s*s+r*r;return Math.sqrt(o)}t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x1,r=t.y1,o=t.x2,a=t.y2,h=t.x3,l=t.y3,u=s(h,l,o,a),c=s(i,r,h,l),d=s(o,a,i,r),f=u+c+d;return e.x=(i*u+o*c+h*d)/f,e.y=(r*u+a*c+l*d)/f,e}},function(t,e){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},function(t,e){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.x<t.right&&e.right>t.x&&e.right<t.right&&e.y>t.y&&e.y<t.bottom&&e.bottom>t.y&&e.bottom<t.bottom}},function(t,e,i){var n=i(9);n.Area=i(656),n.Ceil=i(655),n.CeilAll=i(654),n.CenterOn=i(175),n.Clone=i(653),n.Contains=i(39),n.ContainsPoint=i(652),n.ContainsRect=i(264),n.CopyFrom=i(651),n.Decompose=i(270),n.Equals=i(650),n.FitInside=i(649),n.FitOutside=i(648),n.Floor=i(647),n.FloorAll=i(646),n.FromPoints=i(173),n.GetAspectRatio=i(145),n.GetCenter=i(645),n.GetPoint=i(190),n.GetPoints=i(398),n.GetSize=i(644),n.Inflate=i(643),n.Intersection=i(642),n.MarchingAnts=i(388),n.MergePoints=i(641),n.MergeRect=i(640),n.MergeXY=i(639),n.Offset=i(638),n.OffsetPoint=i(637),n.Overlaps=i(636),n.Perimeter=i(124),n.PerimeterPoint=i(635),n.Random=i(187),n.RandomOutside=i(634),n.SameDimensions=i(633),n.Scale=i(632),n.Union=i(309),t.exports=n},function(t,e){t.exports=function(t){return t.x*t.x+t.y*t.y}},function(t,e){t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},function(t,e,i){var n=i(16),s=i(53),r=i(68);t.exports=function(t){var e=r(t)-n.TAU;return s(e,-Math.PI,Math.PI)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},function(t,e){t.exports=function(t,e){return(t.x-e.x1)*(e.y2-e.y1)==(e.x2-e.x1)*(t.y-e.y1)}},function(t,e,i){var n=i(40),s=new(i(6));t.exports=function(t,e,i){if(void 0===i&&(i=s),n(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(n(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){t.exports={CircleToCircle:i(703),CircleToRectangle:i(702),GetRectangleIntersection:i(701),LineToCircle:i(272),LineToLine:i(107),LineToRectangle:i(700),PointToLine:i(271),PointToLineSegment:i(699),RectangleToRectangle:i(148),RectangleToTriangle:i(698),RectangleToValues:i(697),TriangleToCircle:i(696),TriangleToLine:i(695),TriangleToTriangle:i(694)}},function(t,e,i){t.exports={Circle:i(723),Ellipse:i(713),Intersects:i(273),Line:i(693),Point:i(675),Polygon:i(661),Rectangle:i(265),Triangle:i(631)}},function(t,e,i){var n=i(0),s=i(276),r=i(10),o=new n({initialize:function(){this.lightPool=[],this.lights=[],this.culledLights=[],this.ambientColor={r:.1,g:.1,b:.1},this.active=!1,this.maxLights=-1},enable:function(){return-1===this.maxLights&&(this.maxLights=this.scene.sys.game.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},cull:function(t){var e=this.lights,i=this.culledLights,n=e.length,s=t.x+t.width/2,r=t.y+t.height/2,o=(t.width+t.height)/2,a={x:0,y:0},h=t.matrix,l=this.systems.game.config.height;i.length=0;for(var u=0;u<n&&i.length<this.maxLights;u++){var c=e[u];h.transformPoint(c.x,c.y,a);var d=s-(a.x-t.scrollX*c.scrollFactorX*t.zoom),f=r-(l-(a.y-t.scrollY*c.scrollFactorY*t.zoom));Math.sqrt(d*d+f*f)<c.radius+o&&i.push(e[u])}return i},forEachLight:function(t){if(t){for(var e=this.lights,i=e.length,n=0;n<i;++n)t(e[n]);return this}},setAmbientColor:function(t){var e=r.getFloatsFromUintRGB(t);return this.ambientColor.r=e[0],this.ambientColor.g=e[1],this.ambientColor.b=e[2],this},getMaxVisibleLights:function(){return 10},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,n,o){var a,h=null;return t=void 0===t?0:t,e=void 0===e?0:e,n=void 0===n?16777215:n,i=void 0===i?100:i,o=void 0===o?1:o,a=r.getFloatsFromUintRGB(n),h=null,this.lightPool.length>0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],o):h=new s(t,e,i,a[0],a[1],a[2],o),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=o},function(t,e,i){var n=i(0),s=i(10),r=new n({initialize:function(t,e,i,n,s,r,o){this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1},set:function(t,e,i,n,s,r,o){return this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1,this},setScrollFactor:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this},setColor:function(t){var e=s.getFloatsFromUintRGB(t);return this.r=e[0],this.g=e[1],this.b=e[2],this},setIntensity:function(t){return this.intensity=t,this},setPosition:function(t,e){return this.x=t,this.y=e,this},setRadius:function(t){return this.radius=t,this}});t.exports=r},function(t,e,i){var n=i(65),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;f<e;f++){var p=d*(f/e),g=0,v=new s;p<l?(g=p/l,v.x=o.x1+(o.x2-o.x1)*g,v.y=o.y1+(o.y2-o.y1)*g):p>l+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e,i){var n=i(6),s=i(65);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return c<h?(d=c/h,i.x=r.x1+(r.x2-r.x1)*d,i.y=r.y1+(r.y2-r.y1)*d):c>h+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(0),s=i(27),r=i(59),o=i(772),a=new n({Extends:s,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),s.call(this,t,"Triangle",new r(n,o,a,h,l,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(f,p),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,n,s,r){return this.geom.setTo(t,e,i,n,s,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(775),s=i(0),r=i(64),o=i(27),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l<e;l++)t.push(a+Math.cos(s)*n,h+Math.sin(s)*n),s+=o,t.push(a+Math.cos(s)*i,h+Math.sin(s)*i),s+=o;return t.push(a,h+-n),this.pathIndexes=r(t),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(0),s=i(9),r=i(27),o=i(778),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new s(0,0,n,o)),this.setPosition(e,i),this.setSize(n,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e){var i=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var e,n=[],s=t.points;for(e=0;e<s.length;e++)n.push([s[e].x,s[e].y]);var r=[];for(n.length>0&&r.push(i([0,0],n[0])),e=0;e<n.length-1;e++){var o=n[e],a=n[e+1],h=o[0],l=o[1],u=a[0],c=a[1];r.push([.85*h+.15*u,.85*l+.15*c]),r.push([.15*h+.85*u,.15*l+.85*c])}return n.length>1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(65),s=i(54);t.exports=function(t){for(var e=t.points,i=0,r=0;r<e.length;r++){var o=e[r],a=e[(r+1)%e.length],h=new s(o.x,o.y,a.x,a.y);i+=n(h)}return i}},function(t,e,i){var n=i(65),s=i(54),r=i(283);t.exports=function(t,e,i,o){void 0===o&&(o=[]);var a=t.points,h=r(t);e||(e=h/i);for(var l=0;l<e;l++)for(var u=h*(l/e),c=0,d=0;d<a.length;d++){var f=a[d],p=a[(d+1)%a.length],g=new s(f.x,f.y,p.x,p.y),v=n(g);if(!(u<c||u>c+v)){var y=g.getPoint((u-c)/v);o.push(y);break}c+=v}return o}},function(t,e,i){var n=i(9);t.exports=function(t,e){void 0===e&&(e=new n);for(var i,s=1/0,r=1/0,o=-s,a=-r,h=0;h<t.points.length;h++)i=t.points[h],s=Math.min(s,i.x),r=Math.min(r,i.y),o=Math.max(o,i.x),a=Math.max(a,i.y);return e.x=s,e.y=r,e.width=o-s,e.height=a-r,e}},function(t,e,i){var n=i(781),s=i(0),r=i(64),o=i(285),a=i(151),h=i(27),l=i(282),u=new s({Extends:h,Mixins:[n],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new a(n));var l=o(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==s&&this.setFillStyle(s,r),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e<t;e++)l(this.geom);return this.updateData()},updateData:function(){for(var t=[],e=this.geom.points,i=0;i<e.length;i++)t.push(e[i].x,e[i].y);return t.push(e[0].x,e[0].y),this.pathIndexes=r(t),this.pathData=t,this}});t.exports=u},function(t,e,i){var n=i(0),s=i(27),r=i(54),o=i(784),a=new n({Extends:s,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=0),void 0===a&&(a=128),void 0===h&&(h=0),s.call(this,t,"Line",new r(n,o,a,h));var c=this.geom.right-this.geom.left,d=this.geom.bottom-this.geom.top;this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(c,d),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,n){return this.geom.setTo(t,e,i,n),this}});t.exports=a},function(t,e,i){var n=i(0),s=i(787),r=i(27),o=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,n,s,o,a,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=48),void 0===s&&(s=32),void 0===o&&(o=!1),void 0===a&&(a=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),r.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=a,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=o,this.isFilled=!0,this.setPosition(e,i),this.setSize(n,s),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},function(t,e,i){var n=i(790),s=i(0),r=i(27),o=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,n,s,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=48),void 0===s&&(s=32),void 0===o&&(o=15658734),void 0===a&&(a=10066329),void 0===h&&(h=13421772),r.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=o,this.fillLeft=a,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(n,s),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},function(t,e,i){var n=i(0),s=i(27),r=i(793),o=new n({Extends:s,Mixins:[r],initialize:function(t,e,i,n,r,o,a,h,l,u,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===r&&(r=128),void 0===o&&(o=32),void 0===a&&(a=32),s.call(this,t,"Grid",null),this.cellWidth=o,this.cellHeight=a,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(e,i),this.setSize(n,r),void 0!==h&&this.setFillStyle(h,l),void 0!==u&&this.setOutlineStyle(u,c),this.updateDisplayOrigin()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showCells=!1:(this.fillColor=t,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showAltCells=!1:(this.altFillColor=t,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showOutline=!1:(this.outlineFillColor=t,this.outlineFillAlpha=e,this.showOutline=!0),this}});t.exports=o},function(t,e,i){var n=i(0),s=i(64),r=i(796),o=i(90),a=i(27),h=new n({Extends:a,Mixins:[r],initialize:function(t,e,i,n,s,r,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===s&&(s=128),a.call(this,t,"Ellipse",new o(n/2,s/2,n,s)),this._smoothness=64,this.setPosition(e,i),this.width=n,this.height=s,void 0!==r&&this.setFillStyle(r,h),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.geom.setSize(t,e),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i<e.length;i++)t.push(e[i].x,e[i].y);return t.push(e[0].x,e[0].y),this.pathIndexes=s(t),this.pathData=t,this}});t.exports=h},function(t,e,i){var n=i(0),s=i(799),r=i(64),o=i(9),a=i(27),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),s=0;s<n.length;s++)i.push(n[s].x,n[s].y);return i.push(n[0].x,n[0].y),this.pathIndexes=r(i),this.pathData=i,this}});t.exports=h},function(t,e,i){var n=i(802),s=i(0),r=i(31),o=i(64),a=i(71),h=i(16),l=i(27),u=new s({Extends:l,Mixins:[n],initialize:function(t,e,i,n,s,r,o,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===s&&(s=0),void 0===r&&(r=360),void 0===o&&(o=!1),l.call(this,t,"Arc",new a(0,0,n)),this._startAngle=s,this._endAngle=r,this._anticlockwise=o,this._iterations=.01,this.setPosition(e,i),this.setSize(this.geom.radius,this.geom.radius),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t,this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,n=r(this._startAngle),s=r(this._endAngle),a=i/2,l=i/2;s-=n,this._anticlockwise?s<-h.PI2?s=-h.PI2:s>0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<<Math.ceil(e)}},function(t,e){t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}},function(t,e,i){var n=i(0),s=i(31),r=i(84),o=i(4),a=i(61),h=i(83),l=i(3),u=new n({Extends:a,initialize:function(t,e,i,n,s,r){a.call(this,t,i,n,s,r),this.path=e,this.rotateToPath=!1,this.pathRotationVerticalAdjust=!1,this.pathRotationOffset=0,this.pathOffset=new l(i,n),this.pathVector=new l,this.pathTween,this.pathConfig=null,this._prevDirection=h.PLAYING_FORWARD},setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=!1),this.rotateToPath=t,this.pathRotationOffset=e,this.pathRotationVerticalAdjust=i,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=0,t.to=1;var n=r(t,"positionOnPath",!1);if(this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=o(t,"rotationOffset",0),this.pathRotationVerticalAdjust=r(t,"verticalAdjust",!1),this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),n&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=h.PLAYING_FORWARD,this.rotateToPath){var a=this.path.getPoint(.1);this.rotation=Math.atan2(a.y-this.y,a.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},preUpdate:function(t,e){this.anims.update(t,e);var i=this.pathTween;if(i){var n=i.data[0];if(n.state!==h.PLAYING_FORWARD&&n.state!==h.PLAYING_BACKWARD)return;var r=this.pathVector;this.path.getPoint(i.getValue(),r),r.add(this.pathOffset);var o=this.x,a=this.y;this.setPosition(r.x,r.y);var l=this.x-o,u=this.y-a;if(0===l&&0===u)return;if(n.state!==this._prevDirection)return void(this._prevDirection=n.state);this.rotateToPath&&(this.rotation=Math.atan2(u,l)+s(this.pathRotationOffset),this.pathRotationVerticalAdjust&&(this.flipY=0!==this.rotation&&n.state===h.PLAYING_BACKWARD))}}});t.exports=u},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t){this.source=t,this._tempVec=new s},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=r},function(t,e){t.exports=function(t,e){for(var i=0;i<e.length;i++)if(t.hasOwnProperty(e[i]))return!0;return!1}},function(t,e){t.exports=function(t,e){return Math.random()*(e-t)+t}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){void 0===n&&(n=!1),void 0===s&&(s=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=n,this.counter=-1,this.seamless=s,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._length<i&&this.counter>this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=i(66),s=i(0),r=i(14),o=i(301),a=i(300),h=i(822),l=i(2),u=i(162),c=i(298),d=i(85),f=i(303),p=i(297),g=i(9),v=i(110),y=i(3),m=i(53),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0),this.y=new h(e,"y",0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3),this.angle=new h(e,"angle",{min:0,max:360}),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new y,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e<this.configFastMap.length;e++)i=this.configFastMap[e],d(t,i)&&(this[i]=l(t,i));for(e=0;e<this.configOpMap.length;e++)i=this.configOpMap[e],d(t,i)&&this[i].loadConfig(t);if(this.acceleration=0!==this.accelerationX.propertyValue||0!==this.accelerationY.propertyValue,this.moveTo=0!==this.moveToX.propertyValue||0!==this.moveToY.propertyValue,d(t,"speed")&&(this.speedX.loadConfig(t,"speed"),this.speedY=null),(c(t,["speedX","speedY"])||this.moveTo)&&(this.radial=!1),d(t,"scale")&&(this.scaleX.loadConfig(t,"scale"),this.scaleY=null),d(t,"callbackScope")){var n=l(t,"callbackScope",null);this.emitCallbackScope=n,this.deathCallbackScope=n}return d(t,"emitZone")&&this.setEmitZone(t.emitZone),d(t,"deathZone")&&this.setDeathZone(t.deathZone),d(t,"bounds")&&this.setBounds(t.bounds),d(t,"followOffset")&&this.followOffset.setFromObject(l(t,"followOffset",0)),d(t,"frame")&&this.setFrame(t.frame),this},toJSON:function(t){void 0===t&&(t={});var e=0,i="";for(e=0;e<this.configFastMap.length;e++)t[i=this.configFastMap[e]]=this[i];for(e=0;e<this.configOpMap.length;e++)this[i=this.configOpMap[e]]&&(t[i]=this[i].toJSON());return this.speedY||(delete t.speedX,t.speed=this.speedX.toJSON()),this.scaleY||(delete t.scaleX,t.scale=this.scaleX.toJSON()),t},startFollow:function(t,e,i,n){return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=!1),this.follow=t,this.followOffset.set(e,i),this.trackVisible=n,this},stopFollow:function(){return this.follow=null,this.followOffset.set(0,0),this.trackVisible=!1,this},getFrame:function(){if(1===this.frames.length)return this.defaultFrame;if(this.randomFrame)return u(this.frames);var t=this.frames[this.currentFrame];return this._frameCounter++,this._frameCounter===this.frameQuantity&&(this._frameCounter=0,this.currentFrame=m(this.currentFrame+1,0,this._frameLength)),t},setFrame:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomFrame=e,this.frameQuantity=i,this.currentFrame=0,this._frameCounter=0;var n=typeof t;if(Array.isArray(t)||"string"===n||"number"===n)this.manager.setEmitterFrames(t,this);else if("object"===n){var s=t;(t=l(s,"frames",null))&&this.manager.setEmitterFrames(t,this);var r=l(s,"cycle",!1);this.randomFrame=!r,this.frameQuantity=l(s,"quantity",i)}return this._frameLength=this.frames.length,1===this._frameLength&&(this.frameQuantity=1,this.randomFrame=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},setPosition:function(t,e){return this.x.onChange(t),this.y.onChange(e),this},setBounds:function(t,e,i,n){if("object"==typeof t){var s=t;t=s.x,e=s.y,i=d(s,"w")?s.w:s.width,n=d(s,"h")?s.h:s.height}return this.bounds?this.bounds.setTo(t,e,i,n):this.bounds=new g(t,e,i,n),this},setSpeedX:function(t){return this.speedX.onChange(t),this.radial=!1,this},setSpeedY:function(t){return this.speedY&&(this.speedY.onChange(t),this.radial=!1),this},setSpeed:function(t){return this.speedX.onChange(t),this.speedY=null,this.radial=!0,this},setScaleX:function(t){return this.scaleX.onChange(t),this},setScaleY:function(t){return this.scaleY.onChange(t),this},setScale:function(t){return this.scaleX.onChange(t),this.scaleY=null,this},setGravityX:function(t){return this.gravityX=t,this},setGravityY:function(t){return this.gravityY=t,this},setGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setAlpha:function(t){return this.alpha.onChange(t),this},setEmitterAngle:function(t){return this.angle.onChange(t),this},setAngle:function(t){return this.angle.onChange(t),this},setLifespan:function(t){return this.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity.onChange(t),this},setFrequency:function(t,e){return this.frequency=t,this._counter=0,e&&this.quantity.onChange(e),this},setEmitZone:function(t){if(void 0===t)this.emitZone=null;else{var e=l(t,"type","random"),i=l(t,"source",null);switch(e){case"random":this.emitZone=new p(i);break;case"edge":var n=l(t,"quantity",1),s=l(t,"stepRate",0),r=l(t,"yoyo",!1),o=l(t,"seamless",!0);this.emitZone=new a(i,n,s,r,o)}}return this},setDeathZone:function(t){if(void 0===t)this.deathZone=null;else{var e=l(t,"type","onEnter"),i=l(t,"source",null);if(i&&"function"==typeof i.contains){var n="onEnter"===e;this.deathZone=new o(i,n)}}return this},reserve:function(t){for(var e=this.dead,i=0;i<t;i++)e.push(new this.particleClass(this));return this},getAliveParticleCount:function(){return this.alive.length},getDeadParticleCount:function(){return this.dead.length},getParticleCount:function(){return this.getAliveParticleCount()+this.getDeadParticleCount()},atLimit:function(){return this.maxParticles>0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s<n;++s)t.call(e,i[s],this);return this},forEachDead:function(t,e){for(var i=this.dead,n=i.length,s=0;s<n;++s)t.call(e,i[s],this);return this},start:function(){return this.on=!0,this._counter=0,this},stop:function(){return this.on=!1,this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},depthSort:function(){return v.inplace(this.alive,this.depthSortCallback),this},flow:function(t,e){return void 0===e&&(e=1),this.frequency=t,this.quantity.onChange(e),this.start()},explode:function(t,e,i){return this.frequency=-1,this.emitParticle(t,e,i)},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.quantity.onEmit());for(var n=this.dead,s=0;s<t;s++){var r;if((r=n.length>0?n.pop():new this.particleClass(this)).fire(e,i),this.particleBringToTop?this.alive.push(r):this.alive.unshift(r),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,r,this),this.atLimit())break}return r}},preUpdate:function(t,e){var i=(e*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible);for(var n=this.manager.getProcessors(),s=this.alive,r=s.length,o=0;o<r;o++){var a=s[o];if(a.update(e,i,n)){var h=s[r-1];s[r-1]=a,s[o]=h,o-=1,r-=1}}var l=s.length-r;if(l>0){var u=s.splice(s.length-l,l),c=this.deathCallback,d=this.deathCallbackScope;if(c)for(var f=0;f<u.length;f++)c.call(d,u[f]);this.dead.concat(u),v.inplace(s,this.indexSortCallback)}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y},indexSortCallback:function(t,e){return t.index-e.index}});t.exports=x},function(t,e,i){var n=i(0),s=i(31),r=i(52),o=new n({initialize:function(t){this.emitter=t,this.frame=null,this.index=0,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint"),this.index=i.alive.length},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;u<n.length;u++)n[u].update(this,e,i)},checkBounds:function(t){var e=t.bounds,i=-this.bounce;this.x<e.x&&t.collideLeft?(this.x=e.x,this.velocityX*=i):this.x>e.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.y<e.y&&t.collideTop?(this.y=e.y,this.velocityY*=i):this.y>e.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s<this._epsilon&&(s=this._epsilon);var o=this._power*e/(s*r)*100;t.velocityX+=i*o,t.velocityY+=n*o}},epsilon:{get:function(){return Math.sqrt(this._epsilon)},set:function(t){this._epsilon=t*t}},power:{get:function(){return this._power/this._gravity},set:function(t){this._power=t*this._gravity}},gravity:{get:function(){return this._gravity},set:function(t){var e=this.power;this._gravity=t,this.power=e}}});t.exports=r},function(t,e,i){var n=i(157),s=i(22);t.exports=function(t,e,i,r,o,a,h){var l=e.commandBuffer,u=l.length,c=a||t.currentContext;if(0!==u&&s(t,c,e,r,o)){var d=1,f=1,p=0,g=0,v=1,y=0,m=0,x=0;c.save(),c.beginPath();for(var w=0;w<u;++w)switch(l[w]){case n.ARC:c.arc(l[w+1],l[w+2],l[w+3],l[w+4],l[w+5],l[w+6]),w+=7;break;case n.LINE_STYLE:v=l[w+1],p=l[w+2],d=l[w+3],y=(16711680&p)>>>16,m=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+y+","+m+","+x+","+d+")",c.lineWidth=v,w+=3;break;case n.FILL_STYLE:g=l[w+1],f=l[w+2],y=(16711680&g)>>>16,m=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+y+","+m+","+x+","+f+")",w+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[w+1],l[w+2],l[w+3],l[w+4]):c.fillRect(l[w+1],l[w+2],l[w+3],l[w+4]),w+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.fill(),w+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.stroke(),w+=6;break;case n.LINE_TO:c.lineTo(l[w+1],l[w+2]),w+=2;break;case n.MOVE_TO:c.moveTo(l[w+1],l[w+2]),w+=2;break;case n.LINE_FX_TO:c.lineTo(l[w+1],l[w+2]),w+=5;break;case n.MOVE_FX_TO:c.moveTo(l[w+1],l[w+2]),w+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[w+1],l[w+2]),w+=2;break;case n.SCALE:c.scale(l[w+1],l[w+2]),w+=2;break;case n.ROTATE:c.rotate(l[w+1]),w+=1;break;case n.GRADIENT_FILL_STYLE:w+=5;break;case n.GRADIENT_LINE_STYLE:w+=6;break;case n.SET_TEXTURE:w+=2}c.restore()}}},function(t,e){t.exports=function(t){var e=t.width/2,i=t.height/2,n=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*n/(10+Math.sqrt(4-3*n)))}},function(t,e,i){var n=i(306),s=i(156),r=i(93),o=i(16);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h<e;h++){var l=r(h/e,0,o.PI2);a.push(s(t,l))}return a}},function(t,e,i){var n=i(156),s=i(93),r=i(16),o=i(6);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(9);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=Math.min(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.right,e.right)-s,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(s,r,o,a)}},function(t,e){function i(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,e,n,s){void 0===e&&(e=0),void 0===n&&(n=0);var r={},o=t.getElementsByTagName("info")[0],a=t.getElementsByTagName("common")[0];r.font=o.getAttribute("face"),r.size=i(o,"size"),r.lineHeight=i(a,"lineHeight")+n,r.chars={};var h=t.getElementsByTagName("char"),l=void 0!==s&&s.trimmed;if(l)var u=s.height,c=s.width;for(var d=0;d<h.length;d++){var f=h[d],p=i(f,"id"),g=i(f,"x"),v=i(f,"y"),y=i(f,"width"),m=i(f,"height");l&&(g<c&&(c=g),v<u&&(u=v)),r.chars[p]={x:g,y:v,width:y,height:m,centerX:Math.floor(y/2),centerY:Math.floor(m/2),xOffset:i(f,"xoffset"),yOffset:i(f,"yoffset"),xAdvance:i(f,"xadvance")+e,data:{},kerning:{}}}if(l&&0!==u&&0!==c)for(var x in r.chars){var w=r.chars[x];w.x-=s.x,w.y-=s.y}var b=t.getElementsByTagName("kerning");for(d=0;d<b.length;d++){var T=b[d],S=i(T,"first"),_=i(T,"second"),A=i(T,"amount");r.chars[_].kerning[S]=A}return r}},function(t,e,i){var n=i(12);t.exports=function(t,e){var i=n(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var s=t.anims,r=n(i,"key",void 0),o=n(i,"startFrame",void 0),a=n(i,"delay",0),h=n(i,"repeat",0),l=n(i,"repeatDelay",0),u=n(i,"yoyo",!1),c=n(i,"play",!1),d=n(i,"delayedPlay",0);s.setDelay(a),s.setRepeat(h),s.setRepeatDelay(l),s.setYoyo(u),c?s.play(r,o):d>0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(4),s=i(122),r=function(t,e,i){for(var n=[],s=0;s<t.length;s++)for(var r=0;r<e.length;r++)for(var o=0;o<i;o++)n.push({a:t[s],b:e[r]});return n};t.exports=function(t,e,i){var o=n(i,"max",0),a=n(i,"qty",1),h=n(i,"random",!1),l=n(i,"randomB",!1),u=n(i,"repeat",0),c=n(i,"yoyo",!1),d=[];if(l&&s(e),-1===u)if(0===o)u=0;else{var f=t.length*e.length*a;c&&(f*=2),u=Math.ceil(o/f)}for(var p=0;p<=u;p++){var g=r(t,e,a);h&&s(g),d=d.concat(g),c&&(g.reverse(),d=d.concat(g))}return o&&d.splice(o),d}},function(t,e){var i=function(t,e,r,o,a){for(r=r||0,o=o||t.length-1,a=a||s;o>r;){if(o-r>600){var h=o-r+1,l=e-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(e-l*c/h+d)),p=Math.min(o,Math.floor(e+(h-l)*c/h+d));i(t,e,f,p,a)}var g=t[e],v=r,y=o;for(n(t,r,e),a(t[o],g)>0&&n(t,r,o);v<y;){for(n(t,v,y),v++,y--;a(t[v],g)<0;)v++;for(;a(t[y],g)>0;)y--}0===a(t[r],g)?n(t,r,y):n(t,++y,o),y<=e&&(r=y+1),e<=y&&(o=y-1)}};function n(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function s(t,e){return t<e?-1:t>e?1:0}t.exports=i},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),s=0;s<i;s++){n[s]=new Array(e);for(var r=e-1;r>-1;r--)n[s][r]=t[r][s]}return n}},function(t,e,i){t.exports={AtlasXML:i(886),Canvas:i(885),Image:i(884),JSONArray:i(883),JSONHash:i(882),SpriteSheet:i(881),SpriteSheetFromAtlas:i(880),UnityYAML:i(879)}},function(t,e,i){var n=i(24),s=i(0),r=i(117),o=i(94),a=new s({initialize:function(t,e,i,n){var s=t.manager.game;this.renderer=s.renderer,this.texture=t,this.source=e,this.image=e,this.compressionAlgorithm=null,this.resolution=1,this.width=i||e.naturalWidth||e.width||0,this.height=n||e.naturalHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isRenderTexture="RenderTexture"===e.type,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.init(s)},init:function(t){this.renderer&&(this.renderer.gl?this.isCanvas?this.glTexture=this.renderer.canvasToTexture(this.image):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=this.renderer.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.glTexture=this.renderer.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t)},update:function(){this.renderer.gl&&this.isCanvas&&(this.glTexture=this.renderer.canvasToTexture(this.image,this.glTexture))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&n.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=a},function(t,e,i){var n=i(24),s=i(887),r=i(0),o=i(37),a=i(26),h=i(11),l=i(357),u=i(4),c=i(316),d=i(165),f=new r({Extends:h,initialize:function(t){h.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=n.create2D(this,1,1),this._tempContext=this._tempCanvas.getContext("2d"),this._pending=0,t.events.once("boot",this.boot,this)},boot:function(){this._pending=2,this.on("onload",this.updatePending,this),this.on("onerror",this.updatePending,this),this.addBase64("__DEFAULT",this.game.config.defaultImage),this.addBase64("__MISSING",this.game.config.missingImage),this.game.events.once("destroy",this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off("onload"),this.off("onerror"),this.game.events.emit("texturesready"))},checkKey:function(t){return!this.exists(t)||(console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return console.warn("No texture found matching key: "+t),this;t=this.get(t)}return this.list.hasOwnProperty(t.key)&&(delete this.list[t.key],t.destroy(),this.emit("removetexture",t.key)),this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,n=new Image;n.onerror=function(){i.emit("onerror",t)},n.onload=function(){var e=i.create(t,n);c.Image(e,0),i.emit("addtexture",t,e),i.emit("onload",t,e)},n.src=e}return this},getBase64:function(t,e,i,s){void 0===i&&(i="image/png"),void 0===s&&(s=.92);var r="",o=this.getFrame(t,e);if(o){var a=o.canvasData,h=n.create2D(this,a.width,a.height);h.getContext("2d").drawImage(o.source.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),r=h.toDataURL(i,s),n.remove(h)}return r},addImage:function(t,e,i){var n=null;return this.checkKey(t)&&(n=this.create(t,e),c.Image(n,0),i&&n.setDataSource(i),this.emit("addtexture",t,n)),n},addRenderTexture:function(t,e){var i=null;return this.checkKey(t)&&((i=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),this.emit("addtexture",t,i)),i},generate:function(t,e){if(this.checkKey(t)){var i=n.create(this,1,1);return e.canvas=i,l(e),this.addCanvas(t,i)}return null},createCanvas:function(t,e,i){if(void 0===e&&(e=256),void 0===i&&(i=256),this.checkKey(t)){var s=n.create(this,e,i,a.CANVAS,!0);return this.addCanvas(t,s)}return null},addCanvas:function(t,e,i){void 0===i&&(i=!1);var n=null;return i?n=new s(this,t,e,e.width,e.height):this.checkKey(t)&&(n=new s(this,t,e,e.width,e.height),this.list[t]=n,this.emit("addtexture",t,n)),n},addAtlas:function(t,e,i,n){return Array.isArray(i.textures)||Array.isArray(i.frames)?this.addAtlasJSONArray(t,e,i,n):this.addAtlasJSONHash(t,e,i,n)},addAtlasJSONArray:function(t,e,i,n){var s=null;if(this.checkKey(t)){if(s=this.create(t,e),Array.isArray(i))for(var r=1===i.length,o=0;o<s.source.length;o++){var a=r?i[0]:i[o];c.JSONArray(s,o,a)}else c.JSONArray(s,0,i);n&&s.setDataSource(n),this.emit("addtexture",t,s)}return s},addAtlasJSONHash:function(t,e,i,n){var s=null;if(this.checkKey(t)){if(s=this.create(t,e),Array.isArray(i))for(var r=0;r<i.length;r++)c.JSONHash(s,r,i[r]);else c.JSONHash(s,0,i);n&&s.setDataSource(n),this.emit("addtexture",t,s)}return s},addAtlasXML:function(t,e,i,n){var s=null;return this.checkKey(t)&&(s=this.create(t,e),c.AtlasXML(s,0,i),n&&s.setDataSource(n),this.emit("addtexture",t,s)),s},addUnityAtlas:function(t,e,i,n){var s=null;return this.checkKey(t)&&(s=this.create(t,e),c.UnityYAML(s,0,i),n&&s.setDataSource(n),this.emit("addtexture",t,s)),s},addSpriteSheet:function(t,e,i){var n=null;if(this.checkKey(t)){var s=(n=this.create(t,e)).source[0].width,r=n.source[0].height;c.SpriteSheet(n,0,0,0,s,r,i),this.emit("addtexture",t,n)}return n},addSpriteSheetFromAtlas:function(t,e){if(!this.checkKey(t))return null;var i=u(e,"atlas",null),n=u(e,"frame",null);if(i&&n){var s=this.get(i).get(n);if(s){var r=this.create(t,s.source.image);return s.trimmed?c.SpriteSheetFromAtlas(r,s,e):c.SpriteSheet(r,0,s.cutX,s.cutY,s.cutWidth,s.cutHeight,e),this.emit("addtexture",t,r),r}}},create:function(t,e,i,n){var s=null;return this.checkKey(t)&&(s=new d(this,t,e,i,n),this.list[t]=s),s},exists:function(t){return this.list.hasOwnProperty(t)},get:function(t){return void 0===t&&(t="__DEFAULT"),this.list[t]?this.list[t]:this.list.__MISSING},cloneFrame:function(t,e){if(this.list[t])return this.list[t].get(e).clone()},getFrame:function(t,e){if(this.list[t])return this.list[t].get(e)},getTextureKeys:function(){var t=[];for(var e in this.list)"__DEFAULT"!==e&&"__MISSING"!==e&&t.push(e);return t},getPixel:function(t,e,i,n){var s=this.getFrame(i,n);if(s){t-=s.x,e-=s.y;var r=s.data.cut;if(t+=r.x,e+=r.y,t>=r.x&&t<r.r&&e>=r.y&&e<r.b){var a=this._tempContext;a.clearRect(0,0,1,1),a.drawImage(s.source.image,t,e,1,1,0,0,1,1);var h=a.getImageData(0,0,1,1);return new o(h.data[0],h.data[1],h.data[2],h.data[3])}}return null},getPixelAlpha:function(t,e,i,n){var s=this.getFrame(i,n);if(s){t-=s.x,e-=s.y;var r=s.data.cut;if(t+=r.x,e+=r.y,t>=r.x&&t<r.r&&e>=r.y&&e<r.b){var o=this._tempContext;return o.clearRect(0,0,1,1),o.drawImage(s.source.image,t,e,1,1,0,0,1,1),o.getImageData(0,0,1,1).data[3]}}return null},setTexture:function(t,e,i){return this.list[e]&&(t.texture=this.list[e],t.frame=t.texture.get(i)),t},renameTexture:function(t,e){var i=this.get(t);return!(!i||t===e)&&(i.key=e,this.list[e]=i,delete this.list[t],!0)},each:function(t,e){for(var i=[null],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var s in this.list)i[0]=this.list[s],t.apply(e,i)},destroy:function(){for(var t in this.list)this.list[t].destroy();this.list={},this.game=null,n.remove(this._tempCanvas)}});t.exports=f},function(t,e,i){var n=i(114),s=new(i(0))({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),this.audioBuffer?(this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)):console.warn("Audio cache entry missing: "+e)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit("play",this),!0)},pause:function(){return!(this.manager.context.currentTime<this.startTime)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.getCurrentTime(),this.stopAndRemoveBufferSource(),this.emit("pause",this),!0))},resume:function(){return!(this.manager.context.currentTime<this.startTime)&&(!!n.prototype.resume.call(this)&&(this.createAndStartBufferSource(),this.emit("resume",this),!0))},stop:function(){return!!n.prototype.stop.call(this)&&(this.stopAndRemoveBufferSource(),this.emit("stop",this),!0)},createAndStartBufferSource:function(){var t=this.currentConfig.seek,e=this.currentConfig.delay,i=this.manager.context.currentTime+e,n=(this.currentMarker?this.currentMarker.start:0)+t,s=this.duration-t;this.playTime=i-t,this.startTime=i,this.source=this.createBufferSource(),this.applyConfig(),this.source.start(Math.max(0,i),Math.max(0,n),Math.max(0,s)),this.resetConfig()},createAndStartLoopBufferSource:function(){var t=this.getLoopTime(),e=this.currentMarker?this.currentMarker.start:0,i=this.duration;this.loopTime=t,this.loopSource=this.createBufferSource(),this.loopSource.playbackRate.setValueAtTime(this.totalRate,0),this.loopSource.start(Math.max(0,t),Math.max(0,e),Math.max(0,i))},createBufferSource:function(){var t=this,e=this.manager.context.createBufferSource();return e.buffer=this.audioBuffer,e.connect(this.muteNode),e.onended=function(e){e.target===t.source&&(t.currentConfig.loop?t.hasLooped=!0:t.hasEnded=!0)},e},stopAndRemoveBufferSource:function(){this.source&&(this.source.stop(),this.source.disconnect(),this.source=null),this.playTime=0,this.startTime=0,this.stopAndRemoveLoopBufferSource()},stopAndRemoveLoopBufferSource:function(){this.loopSource&&(this.loopSource.stop(),this.loopSource.disconnect(),this.loopSource=null),this.loopTime=0},applyConfig:function(){this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:1}),n.prototype.applyConfig.call(this)},update:function(t,e){this.hasEnded?(this.hasEnded=!1,n.prototype.stop.call(this),this.stopAndRemoveBufferSource(),this.emit("ended",this)):this.hasLooped&&(this.hasLooped=!1,this.source=this.loopSource,this.loopSource=null,this.playTime=this.startTime=this.loopTime,this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:this.totalRate}),this.createAndStartLoopBufferSource(),this.emit("looped",this))},destroy:function(){n.prototype.destroy.call(this),this.audioBuffer=null,this.stopAndRemoveBufferSource(),this.muteNode.disconnect(),this.muteNode=null,this.volumeNode.disconnect(),this.volumeNode=null,this.rateUpdates.length=0,this.rateUpdates=null},calculateRate:function(){n.prototype.calculateRate.call(this);var t=this.manager.context.currentTime;this.source&&"number"==typeof this.totalRate&&this.source.playbackRate.setValueAtTime(this.totalRate,t),this.isPlaying&&(this.rateUpdates.push({time:Math.max(this.startTime,t)-this.playTime,rate:this.totalRate}),this.loopSource&&(this.stopAndRemoveLoopBufferSource(),this.createAndStartLoopBufferSource()))},getCurrentTime:function(){for(var t=0,e=0;e<this.rateUpdates.length;e++){t+=((e<this.rateUpdates.length-1?this.rateUpdates[e+1].time:this.manager.context.currentTime-this.playTime)-this.rateUpdates[e].time)*this.rateUpdates[e].rate}return t},getLoopTime:function(){for(var t=0,e=0;e<this.rateUpdates.length-1;e++)t+=(this.rateUpdates[e+1].time-this.rateUpdates[e].time)*this.rateUpdates[e].rate;var i=this.rateUpdates[this.rateUpdates.length-1];return this.playTime+i.time+(this.duration-t)/i.rate},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.calculateRate(),this.emit("rate",this,t)}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.calculateRate(),this.emit("detune",this,t)}},setDetune:function(t){return this.detune=t,this},mute:{get:function(){return 0===this.muteNode.gain.value},set:function(t){this.currentConfig.mute=t,this.muteNode.gain.setValueAtTime(t?0:1,0),this.emit("mute",this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.volumeNode.gain.value},set:function(t){this.currentConfig.volume=t,this.volumeNode.gain.setValueAtTime(t,0),this.emit("volume",this,t)}},setVolume:function(t){return this.volume=t,this},seek:{get:function(){return this.isPlaying?this.manager.context.currentTime<this.startTime?this.startTime-this.playTime:this.getCurrentTime():this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.context.currentTime<this.startTime||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.currentConfig.seek=t,this.isPlaying&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource()),this.emit("seek",this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.isPlaying&&(this.stopAndRemoveLoopBufferSource(),t&&this.createAndStartLoopBufferSource()),this.emit("loop",this,t)}},setLoop:function(t){return this.loop=t,this}});t.exports=s},function(t,e,i){var n=i(115),s=i(0),r=i(319),o=new s({Extends:n,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),n.call(this,t),this.locked&&this.unlock()},createAudioContext:function(t){var e=t.config.audio;return e&&e.context?(e.context.resume(),e.context):new AudioContext},add:function(t,e){var i=new r(this,t,e);return this.sounds.push(i),i},unlock:function(){var t=this,e=function(){t.context.resume().then(function(){document.body.removeEventListener("touchstart",e),document.body.removeEventListener("touchend",e),document.body.removeEventListener("click",e),t.unlocked=!0})};document.body&&(document.body.addEventListener("touchstart",e,!1),document.body.addEventListener("touchend",e,!1),document.body.addEventListener("click",e,!1))},onBlur:function(){this.context.suspend()},onFocus:function(){this.context.resume()},destroy:function(){if(this.destination=null,this.masterVolumeNode.disconnect(),this.masterVolumeNode=null,this.masterMuteNode.disconnect(),this.masterMuteNode=null,this.game.config.audio&&this.game.config.audio.context)this.context.suspend();else{var t=this;this.context.close().then(function(){t.context=null})}n.prototype.destroy.call(this)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return 0===this.masterMuteNode.gain.value},set:function(t){this.masterMuteNode.gain.setValueAtTime(t?0:1,0),this.emit("mute",this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this.masterVolumeNode.gain.value},set:function(t){this.masterVolumeNode.gain.setValueAtTime(t,0),this.emit("volume",this,t)}}});t.exports=o},function(t,e,i){var n=i(114),s=i(0),r=i(11),o=i(20),a=new s({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!1},updateMarker:function(t){return!1},removeMarker:function(t){return null},play:function(t,e){return!1},pause:function(){return!1},resume:function(){return!1},stop:function(){return!1},destroy:function(){this.manager.remove(this),n.prototype.destroy.call(this)}});t.exports=a},function(t,e,i){var n=i(115),s=i(0),r=i(11),o=i(321),a=i(1),h=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return n.prototype.remove.call(this,t)},removeByKey:function(t){return n.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){n.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){n.prototype.destroy.call(this)}});t.exports=h},function(t,e,i){var n=i(114),s=new(i(0))({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),this.tags?(this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,n.call(this,t,e,i)):console.warn("Audio cache entry missing: "+e)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!n.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit("play",this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit("pause",this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit("resume",this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit("stop",this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t<this.tags.length;t++){var e=this.tags[t];if("false"===e.dataset.used)return e.dataset.used="true",this.audio=e,!0}if(!this.manager.override)return!1;var i=[];this.manager.forEachActiveSound(function(t){t.key===this.key&&t.audio&&i.push(t)},this),i.sort(function(t,e){return t.loop===e.loop?e.seek/e.duration-t.seek/t.duration:t.loop?1:-1});var n=i[0];return this.audio=n.audio,n.reset(),n.audio=null,n.startTime=0,n.previousTime=0,!0},playCatchPromise:function(){var t=this.audio.play();t&&t.catch(function(t){console.warn(t)})},stopAndReleaseAudioTag:function(){this.audio.pause(),this.audio.dataset.used="false",this.audio=null,this.startTime=0,this.previousTime=0},reset:function(){n.prototype.stop.call(this)},onBlur:function(){this.isPlaying=!1,this.isPaused=!0,this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.currentConfig.delay=Math.max(0,(this.startTime-window.performance.now())/1e3),this.stopAndReleaseAudioTag()},onFocus:function(){this.isPlaying=!0,this.isPaused=!1,this.pickAndPlayAudioTag()},update:function(t,e){if(this.isPlaying)if(this.startTime>0)this.startTime<t-this.manager.audioPlayDelay&&(this.audio.currentTime+=Math.max(0,t-this.startTime)/1e3,this.startTime=0,this.previousTime=this.audio.currentTime,this.playCatchPromise());else{var i=this.currentMarker?this.currentMarker.start:0,n=i+this.duration,s=this.audio.currentTime;if(this.currentConfig.loop)s>=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s<i&&(this.audio.currentTime+=i,s=this.audio.currentTime),s<this.previousTime&&this.emit("looped",this);else if(s>=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit("ended",this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||this.emit("mute",this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||this.emit("volume",this,t)}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,"rate",t)||(this.calculateRate(),this.emit("rate",this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,"detune",t)||(this.calculateRate(),this.emit("detune",this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit("seek",this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit("loop",this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=s},function(t,e,i){var n=i(115),s=i(0),r=i(323),o=new s({Extends:n,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,n.call(this,t)},add:function(t,e){var i=new r(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var n=0;n<i.length;n++)if("true"===i[n].dataset.locked)return t.locked=!0,!1;return!0}),this.locked){var e=!1,i=function(){e=!0},n=function(){if(e)e=!1;else{document.body.removeEventListener("touchmove",i),document.body.removeEventListener("touchend",n);var s=[];if(t.game.cache.audio.entries.each(function(t,e){for(var i=0;i<e.length;i++){var n=e[i];"true"===n.dataset.locked&&s.push(n)}return!0}),0!==s.length){var r=s[s.length-1];r.oncanplaythrough=function(){r.oncanplaythrough=null,s.forEach(function(t){t.dataset.locked="false"}),t.unlocked=!0},s.forEach(function(t){t.load()})}}};this.once("unlocked",function(){for(this.forEachActiveSound(function(t){null===t.currentMarker&&0===t.duration&&(t.duration=t.tags[0].duration),t.totalDuration=t.tags[0].duration});this.lockedActionsQueue.length;){var t=this.lockedActionsQueue.shift();t.sound[t.prop].apply?t.sound[t.prop].apply(t.sound,t.value||[]):t.sound[t.prop]=t.value}},this),document.body.addEventListener("touchmove",i,!1),document.body.addEventListener("touchend",n,!1)}},onBlur:function(){this.forEachActiveSound(function(t){t.isPlaying&&(this.onBlurPausedSounds.push(t),t.onBlur())})},onFocus:function(){this.onBlurPausedSounds.forEach(function(t){t.onFocus()}),this.onBlurPausedSounds.length=0},destroy:function(){n.prototype.destroy.call(this),this.onBlurPausedSounds.length=0,this.onBlurPausedSounds=null},isLocked:function(t,e,i){return"true"===t.tags[0].dataset.locked&&(this.lockedActionsQueue.push({sound:t,prop:e,value:i}),!0)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return this._mute},set:function(t){this._mute=t,this.forEachActiveSound(function(t){t.updateMute()}),this.emit("mute",this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this._volume},set:function(t){this._volume=t,this.forEachActiveSound(function(t){t.updateVolume()}),this.emit("volume",this,t)}}});t.exports=o},function(t,e,i){var n=i(324),s=i(322),r=i(320),o={create:function(t){var e=t.config.audio,i=t.device.audio;return e&&e.noAudio||!i.webAudio&&!i.audioData?new s(t):!i.webAudio||e&&e.disableWebAudio?new n(t):new r(t)}};t.exports=o},function(t,e,i){var n=i(116),s=i(4),r=i(96),o=i(888),a={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:n.PENDING,key:s(t,"key",""),active:s(t,"active",!1),visible:s(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:s(t,"pack",!1),cameras:s(t,"cameras",null),map:s(t,"map",r(o,s(t,"mapAdd",{}))),physics:s(t,"physics",{}),loader:s(t,"loader",{}),plugins:s(t,"plugins",!1),input:s(t,"input",{})}}};t.exports=a},function(t,e){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},function(t,e,i){var n=i(0),s=i(166),r=new n({initialize:function(t){this.sys=new s(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.impact,this.matter},update:function(){}});t.exports=r},function(t,e,i){var n=i(0),s=i(116),r=i(4),o=i(1),a=i(328),h=i(166),l=new n({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)this._pending.push({key:"default",scene:e[i],autoStart:0===i,data:{}})}t.events.once("ready",this.bootQueue,this)},bootQueue:function(){if(!this.isBooted){var t,e,i,n;for(t=0;t<this._pending.length;t++){var s;i=(e=this._pending[t]).key,(n=e.scene)instanceof a?s=this.createSceneFromInstance(i,n):"object"==typeof n?s=this.createSceneFromObject(i,n):"function"==typeof n&&(s=this.createSceneFromFunction(i,n)),i=s.sys.settings.key,this.keys[i]=s,this.scenes.push(s),this._data[i]&&(s.sys.settings.data=this._data[i].data,this._data[i].autoStart&&(e.autoStart=!0)),(e.autoStart||s.sys.settings.active)&&this._start.push(i)}for(this._pending.length=0,this._data={},this.isBooted=!0,t=0;t<this._start.length;t++)e=this._start[t],this.start(e);this._start.length=0}},processQueue:function(){var t=this._pending.length,e=this._queue.length;if(0!==t||0!==e){var i,n;if(t){for(i=0;i<t;i++)n=this._pending[i],this.add(n.key,n.scene,n.autoStart,n.data);for(i=0;i<this._start.length;i++)n=this._start[i],this.start(n);return this._start.length=0,void(this._pending.length=0)}for(i=0;i<this._queue.length;i++)this[(n=this._queue[i]).op](n.keyA,n.keyB);this._queue.length=0}},add:function(t,e,i,n){return void 0===i&&(i=!1),void 0===n&&(n={}),this.isProcessing||!this.isBooted?(this._pending.push({key:t,scene:e,autoStart:i,data:n}),this.isBooted||(this._data[t]={data:n}),null):(t=this.getKey(t,e),e instanceof a?s=this.createSceneFromInstance(t,e):"object"==typeof e?(e.key=t,s=this.createSceneFromObject(t,e)):"function"==typeof e&&(s=this.createSceneFromFunction(t,e)),s.sys.settings.data=n,t=s.sys.settings.key,this.keys[t]=s,this.scenes.push(s),(i||s.sys.settings.active)&&(this._pending.length?this._start.push(t):this.start(t)),s);var s},remove:function(t){if(this.isProcessing)this._queue.push({op:"remove",keyA:t,keyB:null});else{var e=this.getScene(t);if(!e||e.sys.isTransitioning())return this;var i=this.scenes.indexOf(e),n=e.sys.settings.key;i>-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit("transitioninit",n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once("complete",this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},resize:function(t,e){for(var i=0;i<this.scenes.length;i++){this.scenes[i].sys.resize(t,e)}},render:function(t){for(var e=0;e<this.scenes.length;e++){var i=this.scenes[e].sys;i.settings.visible&&i.settings.status>=s.LOADING&&i.settings.status<s.SLEEPING&&i.render(t)}this.isProcessing=!1},create:function(t){var e=t.sys,i=e.settings;t.create&&(i.status=s.CREATING,t.create.call(t,i.data),i.isTransition&&e.events.emit("transitionstart",i.transitionFrom,i.transitionDuration)),t.update&&(e.sceneUpdate=t.update),i.status=s.RUNNING},createSceneFromFunction:function(t,e){var i=new e;if(i instanceof a){var n=i.sys.settings.key;if(""!==n&&(t=n),this.keys.hasOwnProperty(t))throw new Error("Cannot add a Scene with duplicate key: "+t);return this.createSceneFromInstance(t,i)}return i.sys=new h(i),i.sys.settings.key=t,i.sys.init(this.game),i},createSceneFromInstance:function(t,e){var i=e.sys.settings.key;return""!==i?t=i:e.sys.settings.key=t,e.sys.init(this.game),e},createSceneFromObject:function(t,e){var i=new a(e),n=i.sys.settings.key;""!==n?t=n:i.sys.settings.key=t,i.sys.init(this.game);for(var s=["init","preload","create","update","render"],o=0;o<s.length;o++){var h=r(e,s[o],null);h&&(i[s[o]]=h)}if(e.hasOwnProperty("extend"))for(var l in e.extend){var u=e.extend[l];"data"===l&&i.hasOwnProperty("data")&&"object"==typeof u?i.data.merge(u):"sys"!==l&&(i[l]=u)}return i},getKey:function(t,e){if(t||(t="default"),"function"==typeof e)return t;if(e instanceof a?t=e.sys.settings.key:"object"==typeof e&&e.hasOwnProperty("key")&&(t=e.key),this.keys.hasOwnProperty(t))throw new Error("Cannot add a Scene with duplicate key: "+t);return t},getScene:function(t){if("string"==typeof t){if(this.keys[t])return this.keys[t]}else for(var e=0;e<this.scenes.length;e++)if(t===this.scenes[e])return t;return null},isActive:function(t){var e=this.getScene(t);return e?e.sys.isActive():null},isVisible:function(t){var e=this.getScene(t);return e?e.sys.isVisible():null},isSleeping:function(t){var e=this.getScene(t);return e?e.sys.isSleeping():null},pause:function(t,e){var i=this.getScene(t);return i&&i.sys.pause(e),this},resume:function(t,e){var i=this.getScene(t);return i&&i.sys.resume(e),this},sleep:function(t,e){var i=this.getScene(t);return i&&!i.sys.isTransitioning()&&i.sys.sleep(e),this},wake:function(t,e){var i=this.getScene(t);return i&&i.sys.wake(e),this},run:function(t,e){var i=this.getScene(t);if(!i){for(var n=0;n<this._pending.length;n++)if(this._pending[n].key===t){this.queueOp("start",t,e);break}return this}i.sys.isSleeping()?i.sys.wake(e):i.sys.isBooted&&!i.sys.isActive()?i.sys.resume(e):this.start(t,e)},start:function(t,e){if(!this.isBooted)return this._data[t]={autoStart:!0,data:e},this;var i=this.getScene(t);if(i){var n;if(i.sys.isActive()||i.sys.isPaused())i.sys.shutdown(),i.sys.start(e);else if(i.sys.start(e),i.sys.load&&(n=i.sys.load),n&&i.sys.settings.hasOwnProperty("pack")&&(n.reset(),n.addPack({payload:i.sys.settings.pack})))return i.sys.settings.status=s.LOADING,n.once("complete",this.payloadComplete,this),n.start(),this;this.bootScene(i)}return this},stop:function(t){var e=this.getScene(t);return e&&!e.sys.isTransitioning()&&e.sys.shutdown(),this},switch:function(t,e){var i=this.getScene(t),n=this.getScene(e);return i&&n&&i!==n&&(this.sleep(t),this.isSleeping(e)?this.wake(e):this.start(e)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e<this.scenes.length){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.push(i)}}return this},sendToBack:function(t){if(this.isProcessing)this._queue.push({op:"sendToBack",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e>0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e<this.scenes.length-1){var i=e+1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveAbove:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveAbove",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(-1!==i&&-1!==n){var s=this.getAt(n);this.scenes.splice(n,1),this.scenes.splice(i+1,0,s)}}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(-1!==i&&-1!==n){var s=this.getAt(n);this.scenes.splice(n,1),0===i?this.scenes.unshift(s):this.scenes.splice(i,0,s)}}return this},queueOp:function(t,e,i){return this._queue.push({op:t,keyA:e,keyB:i}),this},swapPosition:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"swapPosition",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(i!==n&&-1!==i&&-1!==n){var s=this.getAt(i);this.scenes[i]=this.scenes[n],this.scenes[n]=s}}return this},dump:function(){for(var t=[],e=["pending","init","start","loading","creating","running","paused","sleeping","shutdown","destroyed"],i=0;i<this.scenes.length;i++){var n=this.scenes[i].sys,r=!n.settings.visible||n.settings.status!==s.RUNNING&&n.settings.status!==s.PAUSED?"[-] ":"[*] ";r+=n.settings.key+" ("+e[n.settings.status]+")",t.push(r)}console.log(t.join("\n"))},destroy:function(){for(var t=0;t<this.scenes.length;t++){this.scenes[t].sys.destroy()}this.update=o,this.scenes=[],this._pending=[],this._start=[],this._queue=[],this.game=null}});t.exports=l},function(t,e,i){var n=i(91);t.exports=function(t,e,i,s){var r;if(void 0===s&&(s=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(n(t,r),i&&i.call(s,e),e):null;for(var o=e.length-1;o>=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e,i){var n=i(0),s=i(11),r=i(7),o=i(13),a=i(5),h=i(2),l=i(15),u=i(330),c=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once("boot",this.boot,this)},boot:function(){var t,e,i,n,s,r,o,a=this.game.config,l=a.installGlobalPlugins;for(l=l.concat(this._pendingGlobal),t=0;t<l.length;t++)e=l[t],i=h(e,"key",null),n=h(e,"plugin",null),s=h(e,"start",!1),r=h(e,"mapping",null),o=h(e,"data",null),i&&n&&this.install(i,n,s,r,o);for(l=(l=a.installScenePlugins).concat(this._pendingScene),t=0;t<l.length;t++)e=l[t],i=h(e,"key",null),n=h(e,"plugin",null),r=h(e,"mapping",null),i&&n&&this.installScenePlugin(i,n,r);this._pendingGlobal=[],this._pendingScene=[],this.game.events.once("destroy",this.destroy,this)},addToScene:function(t,e,i){var n,s,r,o=this.game,a=t.scene,h=t.settings.map,u=t.settings.isBooted;for(n=0;n<e.length;n++)o[s=e[n]]?(t[s]=o[s],h.hasOwnProperty(s)&&(a[h[s]]=t[s])):"game"===s&&h.hasOwnProperty(s)&&(a[h[s]]=o);for(var c=0;c<i.length;c++)for(r=i[c],n=0;n<r.length;n++)if(s=r[n],l.hasCore(s)){var d=l.getCore(s),f=new d.plugin(a,this);t[d.mapping]=f,d.custom?a[d.mapping]=f:h.hasOwnProperty(d.mapping)&&(a[h[d.mapping]]=f),u&&f.boot()}for(r=this.plugins,n=0;n<r.length;n++){var p=r[n];p.mapping&&(a[p.mapping]=p.plugin)}},getDefaultScenePlugins:function(){var t=this.game.config.defaultPlugins;return t=t.concat(this.scenePlugins)},installScenePlugin:function(t,e,i,n){if("function"==typeof e){if(l.hasCore(t))console.warn("Scene Plugin key in use: "+t);else if(l.register(t,e,i,!0),this.scenePlugins.push(t),n){var s=new e(n,this);n.sys[t]=s,i&&""!==i&&(n[i]=s),s.boot()}}else console.warn("Invalid Scene Plugin: "+t)},install:function(t,e,i,n,s){if(void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=null),"function"==typeof e)if(l.hasCustom(t))console.warn("Plugin key in use: "+t);else if(null!==n&&(i=!0),this.game.isBooted){if(l.registerCustom(t,e,n,s),i)return this.start(t)}else this._pendingGlobal.push({key:t,plugin:e,start:i,mapping:n,data:s});else console.warn("Invalid Plugin: "+t)},getIndex:function(t){for(var e=this.plugins,i=0;i<e.length;i++){if(e[i].key===t)return i}return-1},getEntry:function(t){var e=this.getIndex(t);if(-1!==e)return this.plugins[e]},isActive:function(t){var e=this.getEntry(t);return e&&e.active},start:function(t,e){void 0===e&&(e=t);var i=this.getEntry(e);return i&&!i.active?(i.active=!0,i.plugin.start()):i||(i=this.createEntry(t,e)),i?i.plugin:null},createEntry:function(t,e){var i=l.getCustom(t);if(i){var n=new i.plugin(this);i={key:e,plugin:n,active:!0,mapping:i.mapping,data:i.data},this.plugins.push(i),n.init(i.data),n.start()}return i},stop:function(t){var e=this.getEntry(t);return e&&e.active&&(e.active=!1,e.plugin.stop()),this},get:function(t,e){void 0===e&&(e=!0);var i=this.getEntry(t);if(i)return i.plugin;var n=this.getClass(t);return n&&e?(i=this.createEntry(t,t))?i.plugin:null:n||null},getClass:function(t){return l.getCustomClass(t)},removeGlobalPlugin:function(t){var e=this.getEntry(t);e&&u(this.plugins,e),l.removeCustom(t)},removeScenePlugin:function(t){u(this.scenePlugins,t),l.remove(t)},registerGameObject:function(t,e,i){return e&&a.register(t,e),i&&o.register(t,i),this},registerFileType:function(t,e,i){r.register(t,e),i&&i.sys.load&&(i.sys.load[t]=e)},destroy:function(){for(var t=0;t<this.plugins.length;t++)this.plugins[t].plugin.destroy();l.destroyCustomPlugins(),this.game.noReturn&&l.destroyCorePlugins(),this.game=null,this.plugins=[],this.scenePlugins=[]}});t.exports=c},function(t,e,i){var n=i(3);t.exports=function(t,e,i,s,r,o,a,h){void 0===h&&(h=new n);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,f=-l*a,p=u*a,g=1/(c*p+f*-d);return h.x=p*g*t+-f*g*e+(s*f-i*p)*g,h.y=c*g*e+-d*g*t+(-s*c+i*d)*g,h}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=s,this.onTouchMove=s,this.onTouchEnd=s,this.onTouchCancel=s,t.events.once("boot",this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target||(this.target=this.manager.game.canvas),this.enabled&&this.target&&this.startListeners()},startListeners:function(){var t=this;this.onTouchStart=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&(t.manager.queueTouchStart(e),t.capture&&e.preventDefault())},this.onTouchMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&(t.manager.queueTouchMove(e),t.capture&&e.preventDefault())},this.onTouchEnd=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&(t.manager.queueTouchEnd(e),t.capture&&e.preventDefault())},this.onTouchCancel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&(t.manager.queueTouchCancel(e),t.capture&&e.preventDefault())};var e=this.target;if(e){var i={passive:!0},n={passive:!1};this.capture?(e.addEventListener("touchstart",this.onTouchStart,n),e.addEventListener("touchmove",this.onTouchMove,n),e.addEventListener("touchend",this.onTouchEnd,n),e.addEventListener("touchcancel",this.onTouchCancel,n)):(e.addEventListener("touchstart",this.onTouchStart,i),e.addEventListener("touchmove",this.onTouchMove,i),e.addEventListener("touchend",this.onTouchEnd,i)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel)},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=r},function(t,e,i){var n=i(181);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var n=i(0),s=i(52),r=i(334),o=i(3),a=new n({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.camera=null,this.buttons=0,this.position=new o,this.prevPosition=new o,this.worldX=0,this.worldY=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.dragState=0,this.isDown=!1,this.dirty=!1,this.justDown=!1,this.justUp=!1,this.justMoved=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},reset:function(){this.dirty=!1,this.justDown=!1,this.justUp=!1,this.justMoved=!1,this.movementX=0,this.movementY=0},up:function(t,e){t.buttons&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e),this.justUp=!0,this.isDown=!1,this.dirty=!0,this.wasTouch=!1},down:function(t,e){t.buttons&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e),this.justDown=!0,this.isDown=!0,this.dirty=!0,this.wasTouch=!1},move:function(t){t.buttons&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),this.manager.mouse.locked&&(this.movementX+=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY+=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.justMoved=!0,this.dirty=!0,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e,this.justDown=!0,this.isDown=!0,this.dirty=!0,this.wasTouch=!0,this.wasCanceled=!1},touchmove:function(t){this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),this.justMoved=!0,this.dirty=!0,this.wasTouch=!0},touchend:function(t,e){this.buttons=0,this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e,this.justUp=!0,this.isDown=!1,this.dirty=!0,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1},touchcancel:function(t){this.buttons=0,this.event=t,this.primaryDown=!1,this.justUp=!1,this.isDown=!1,this.dirty=!0,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return 1&this.buttons},rightButtonDown:function(){return 2&this.buttons},middleButtonDown:function(){return 4&this.buttons},backButtonDown:function(){return 8&this.buttons},forwardButtonDown:function(){return 16&this.buttons},getDistance:function(){return s(this.downX,this.downY,this.x,this.y)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,n=this.prevPosition.y,s=this.position.x,o=this.position.y,a=0;a<t;a++){var h=1/t*a;e[a]={x:r(h,i,s),y:r(h,n,o)}}return e},destroy:function(){this.camera=null,this.manager=null,this.position=null},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}}});t.exports=a},function(t,e,i){var n=i(0),s=i(168),r=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.locked=!1,t.events.once("boot",this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.capture=t.inputMouseCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",function(t){return t.preventDefault(),!1}),this},requestPointerLock:function(){if(s.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){s.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this,e=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&(t.manager.queueMouseMove(e),t.capture&&e.preventDefault())},i=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&(t.manager.queueMouseDown(e),t.capture&&e.preventDefault())},n=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&(t.manager.queueMouseUp(e),t.capture&&e.preventDefault())};this.onMouseMove=e,this.onMouseDown=i,this.onMouseUp=n;var r=this.target,o={passive:!0},a={passive:!1};if(r.addEventListener("mousemove",e,this.capture?a:o),r.addEventListener("mousedown",i,this.capture?a:o),r.addEventListener("mouseup",n,this.capture?a:o),s.pointerLock){var h=function(e){var i=t.target;t.locked=document.pointerLockElement===i||document.mozPointerLockElement===i||document.webkitPointerLockElement===i,t.manager.queue.push(e)};this.pointerLockChange=h,document.addEventListener("pointerlockchange",h,!0),document.addEventListener("mozpointerlockchange",h,!0),document.addEventListener("webkitpointerlockchange",h,!0)}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),s.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.manager=null}});t.exports=r},function(t,e){t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,TOUCH_CANCEL:7,POINTER_LOCK_CHANGE:6}},function(t,e,i){var n=i(0),s=i(337),r=i(11),o=i(336),a=i(335),h=i(9),l=i(333),u=i(38),c=i(332),d=new n({initialize:function(t,e){this.game=t,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.queue=[],this.domCallbacks={up:[],down:[],move:[],upOnce:[],downOnce:[],moveOnce:[]},this._hasUpCallback=!1,this._hasDownCallback=!1,this._hasMoveCallback=!1,this._customCursor="",this._setCursor=0,this.defaultCursor="",this.mouse=e.inputMouse?new o(this):null,this.touch=e.inputTouch?new l(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++)this.pointers.push(new a(this,i));this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.dirty=!1,this.scale={x:1,y:1},this.globalTopOnly=!0,this.ignoreEvents=!1,this.bounds=new h,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new u,this._tempMatrix2=new u,t.events.once("boot",this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.updateBounds(),this.events.emit("boot"),this.game.events.on("prestep",this.update,this),this.game.events.on("poststep",this.postUpdate,this),this.game.events.once("destroy",this.destroy,this)},updateBounds:function(){var t=this.bounds,e=this.canvas.getBoundingClientRect();t.x=e.left+window.pageXOffset-document.documentElement.clientLeft,t.y=e.top+window.pageYOffset-document.documentElement.clientTop,t.width=e.width,t.height=e.height},resize:function(){this.updateBounds();var t=this.game.config.width,e=this.game.config.height,i=this.bounds.width,n=this.bounds.height;this.scale.x=t/i,this.scale.y=e/n},update:function(t){var e;this._setCursor=0,this.events.emit("update"),this.ignoreEvents=!1,this.dirty=!1;var i=this.queue.length,n=this.pointers;for(e=0;e<this.pointersTotal;e++)n[e].reset();if(this.enabled&&0!==i){this.dirty=!0,this.updateBounds(),this.scale.x=this.game.config.width/this.bounds.width,this.scale.y=this.game.config.height/this.bounds.height;var r=this.queue.splice(0,i),o=this.mousePointer;for(e=0;e<i;e+=2){var a=r[e],h=r[e+1];switch(a){case s.MOUSE_DOWN:o.down(h,t);break;case s.MOUSE_MOVE:o.move(h,t);break;case s.MOUSE_UP:o.up(h,t);break;case s.TOUCH_START:this.startPointer(h,t);break;case s.TOUCH_MOVE:this.updatePointer(h,t);break;case s.TOUCH_END:this.stopPointer(h,t);break;case s.TOUCH_CANCEL:this.cancelPointer(h,t);break;case s.POINTER_LOCK_CHANGE:this.events.emit("pointerlockchange",h,this.mouse.locked)}}}},postUpdate:function(){1===this._setCursor?this.canvas.style.cursor=this._customCursor:2===this._setCursor&&(this.canvas.style.cursor=this.defaultCursor)},setDefaultCursor:function(t){this.defaultCursor=t,this.canvas.style.cursor!==t&&(this.canvas.style.cursor=t)},setCursor:function(t){t.cursor&&(this._setCursor=1,this._customCursor=t.cursor)},resetCursor:function(t){t.cursor&&(this._setCursor=2)},startPointer:function(t,e){for(var i=this.pointers,n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],r=1;r<this.pointersTotal;r++){var o=i[r];if(!o.active){o.touchstart(s,e),this.activePointer=o;break}}},updatePointer:function(t,e){for(var i=this.pointers,n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],r=1;r<this.pointersTotal;r++){var o=i[r];if(o.active&&o.identifier===s.identifier){o.touchmove(s,e),this.activePointer=o;break}}},stopPointer:function(t,e){for(var i=this.pointers,n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],r=1;r<this.pointersTotal;r++){var o=i[r];if(o.active&&o.identifier===s.identifier){o.touchend(s,e);break}}},cancelPointer:function(t,e){for(var i=this.pointers,n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],r=1;r<this.pointersTotal;r++){var o=i[r];if(o.active&&o.identifier===s.identifier){o.touchend(s,e);break}}},addPointer:function(t){void 0===t&&(t=1);var e=[];this.pointersTotal+t>10&&(t=10-this.pointersTotal);for(var i=0;i<t;i++){var n=this.pointers.length,s=new a(this,n);this.pointers.push(s),this.pointersTotal++,e.push(s)}return e},processDomCallbacks:function(t,e,i){var n=0;for(n=0;n<t.length;n++)t[n](i);for(n=0;n<e.length;n++)e[n](i);return t=[],e.length>0},queueTouchStart:function(t){if(this.queue.push(s.TOUCH_START,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueTouchMove:function(t){if(this.queue.push(s.TOUCH_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueTouchEnd:function(t){if(this.queue.push(s.TOUCH_END,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},queueTouchCancel:function(t){this.queue.push(s.TOUCH_CANCEL,t)},queueMouseDown:function(t){if(this.queue.push(s.MOUSE_DOWN,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueMouseMove:function(t){if(this.queue.push(s.MOUSE_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueMouseUp:function(t){if(this.queue.push(s.MOUSE_UP,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},addUpCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.upOnce.push(t):this.domCallbacks.up.push(t),this._hasUpCallback=!0,this},addDownCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.downOnce.push(t):this.domCallbacks.down.push(t),this._hasDownCallback=!0,this},addMoveCallback:function(t,e){return void 0===e&&(e=!1),e?this.domCallbacks.moveOnce.push(t):this.domCallbacks.move.push(t),this._hasMoveCallback=!0,this},inputCandidate:function(t,e){var i=t.input;if(!i||!i.enabled||!t.willRender(e))return!1;var n=!0,s=t.parentContainer;if(s)do{if(!s.willRender(e)){n=!1;break}s=s.parentContainer}while(s);return n},hitTest:function(t,e,i,n){void 0===n&&(n=this._tempHitTest);var s=this._tempPoint,r=i.scrollX,o=i.scrollY;n.length=0;var a=t.x,h=t.y;1!==i.resolution&&(a+=i._x,h+=i._y),i.getWorldPoint(a,h,s),t.worldX=s.x,t.worldY=s.y;for(var l={x:0,y:0},u=this._tempMatrix,d=this._tempMatrix2,f=0;f<e.length;f++){var p=e[f];if(this.inputCandidate(p,i)){var g=s.x+r*p.scrollFactorX-r,v=s.y+o*p.scrollFactorY-o;p.parentContainer?(p.getWorldTransformMatrix(u,d),u.applyInverse(g,v,l)):c(g,v,p.x,p.y,p.rotation,p.scaleX,p.scaleY,l),this.pointWithinHitArea(p,l.x,l.y)&&n.push(p)}}return n},pointWithinHitArea:function(t,e,i){e+=t.displayOriginX,i+=t.displayOriginY;var n=t.input;return!(!n||!n.hitAreaCallback(n.hitArea,e,i,t))&&(n.localX=e,n.localY=i,!0)},pointWithinInteractiveObject:function(t,e,i){return!!t.hitArea&&(e+=t.gameObject.displayOriginX,i+=t.gameObject.displayOriginY,t.localX=e,t.localY=i,t.hitAreaCallback(t.hitArea,e,i,t))},transformPointer:function(t,e,i){t.prevPosition.x=t.x,t.prevPosition.y=t.y,t.x=(e-this.bounds.left)*this.scale.x,t.y=(i-this.bounds.top)*this.scale.y},transformX:function(t){return(t-this.bounds.left)*this.scale.x},transformY:function(t){return(t-this.bounds.top)*this.scale.y},getOffsetX:function(){return this.bounds.left},getOffsetY:function(){return this.bounds.top},getScaleX:function(){return this.game.config.width/this.bounds.width},getScaleY:function(){return this.game.config.height/this.bounds.height},destroy:function(){this.events.removeAllListeners(),this.mouse&&this.mouse.destroy(),this.touch&&this.touch.destroy();for(var t=0;t<this.pointers.length;t++)this.pointers[t].destroy();this.domCallbacks={},this.pointers=[],this.queue=[],this._tempHitTest=[],this._tempMatrix.destroy(),this.canvas=null,this.game=null}});t.exports=d},function(t,e,i){var n,s,r,o=i(24),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},function(t,e,i){t.exports={os:i(92),browser:i(118),features:i(168),input:i(902),audio:i(901),video:i(900),fullscreen:i(899),canvasFeatures:i(339)}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0;var t=this;this.step=function e(i){t.lastTime=t.tick,t.tick=i,t.timeOutID=window.requestAnimationFrame(e),t.callback(i)},this.stepTimeout=function e(){var i=Date.now(),n=Math.max(16+t.lastTime-i,0);t.lastTime=t.tick,t.tick=i,t.timeOutID=window.setTimeout(e,n),t.callback(i)}},start:function(t,e){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){var n=i(92);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova&&!n.cocoonJS?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e){t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},function(t,e,i){var n=i(37);n.ColorToRGBA=i(915),n.ComponentToHex=i(346),n.GetColor=i(177),n.GetColor32=i(376),n.HexStringToColor=i(377),n.HSLToColor=i(914),n.HSVColorWheel=i(913),n.HSVToRGB=i(176),n.HueToComponent=i(345),n.IntegerToColor=i(374),n.IntegerToRGB=i(373),n.Interpolate=i(912),n.ObjectToColor=i(372),n.RandomRGB=i(911),n.RGBStringToColor=i(371),n.RGBToHSV=i(375),n.RGBToString=i(910),n.ValueToColor=i(178),t.exports=n},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(171),s=i(0),r=i(70),o=i(3),a=new s({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;e<t.length;e++){var i=new o;"number"==typeof t[e]?(i.x=t[e],i.y=t[e+1],e++):Array.isArray(t[e])?(i.x=t[e][0],i.y=t[e][1]):(i.x=t[e].x,i.y=t[e].y),this.points.push(i)}return this},addPoint:function(t,e){var i=new o(t,e);return this.points.push(i),i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.points[0])},getResolution:function(t){return t*this.points.length},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.points,s=(i.length-1)*t,r=Math.floor(s),a=s-r,h=i[0===r?r:r-1],l=i[r],u=i[r>i.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e<this.points.length;e++)t.push(this.points[e].x),t.push(this.points[e].y);return{type:this.type,points:t}}});a.fromJSON=function(t){return new a(t.points)},t.exports=a},function(t,e){t.exports=function(t,e,i,n){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}},function(t,e,i){var n=i(0),s=i(70),r=i(350),o=i(3),a=new n({Extends:s,initialize:function(t,e,i){s.call(this,"QuadraticBezier"),Array.isArray(t)&&(i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,n=this.p1,s=this.p2;return e.set(r(t,i.x,n.x,s.x),r(t,i.y,n.y,s.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);return t.strokePath(),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y]}}});a.fromJSON=function(t){var e=t.points,i=new o(e[0],e[1]),n=new o(e[2],e[3]),s=new o(e[4],e[5]);return new a(i,n,s)},t.exports=a},function(t,e,i){var n=i(0),s=i(70),r=i(173),o=i(9),a=i(3),h=new a,l=new n({Extends:s,initialize:function(t,e){s.call(this,"LineCurve"),Array.isArray(t)&&(e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e},getBounds:function(t){return void 0===t&&(t=new o),r([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new a),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(){return h.copy(this.p1).subtract(this.p0).normalize()},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});l.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),n=new a(e[2],e[3]);return new l(i,n)},t.exports=l},function(t,e,i){var n=i(0),s=i(70),r=i(31),o=i(4),a=i(172),h=i(3),l=new n({Extends:s,initialize:function(t,e,i,n,a,l,u,c){if("object"==typeof t){var d=t;t=o(d,"x",0),e=o(d,"y",0),i=o(d,"xRadius",0),n=o(d,"yRadius",i),a=o(d,"startAngle",0),l=o(d,"endAngle",360),u=o(d,"clockwise",!1),c=o(d,"rotation",0)}else void 0===n&&(n=i),void 0===a&&(a=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===c&&(c=0);s.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=n,this._startAngle=r(a),this._endAngle=r(l),this._clockwise=u,this._rotation=r(c)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,n=this._endAngle-this._startAngle,s=Math.abs(n)<Number.EPSILON;n<0;)n+=i;for(;n>i;)n-=i;n<Number.EPSILON&&(n=s?0:i),this._clockwise&&!s&&(n===i?n=-i:n-=i);var r=this._startAngle+t*n,o=this.p0.x+this._xRadius*Math.cos(r),a=this.p0.y+this._yRadius*Math.sin(r);if(0!==this._rotation){var l=Math.cos(this._rotation),u=Math.sin(this._rotation),c=o-this.p0.x,d=a-this.p0.y;o=c*l-d*u+this.p0.x,a=c*u+d*l+this.p0.y}return e.set(o,a)},setXRadius:function(t){return this.xRadius=t,this},setYRadius:function(t){return this.yRadius=t,this},setWidth:function(t){return this.xRadius=2*t,this},setHeight:function(t){return this.yRadius=2*t,this},setStartAngle:function(t){return this.startAngle=t,this},setEndAngle:function(t){return this.endAngle=t,this},setClockwise:function(t){return this.clockwise=t,this},setRotation:function(t){return this.rotation=t,this},x:{get:function(){return this.p0.x},set:function(t){this.p0.x=t}},y:{get:function(){return this.p0.y},set:function(t){this.p0.y=t}},xRadius:{get:function(){return this._xRadius},set:function(t){this._xRadius=t}},yRadius:{get:function(){return this._yRadius},set:function(t){this._yRadius=t}},startAngle:{get:function(){return a(this._startAngle)},set:function(t){this._startAngle=r(t)}},endAngle:{get:function(){return a(this._endAngle)},set:function(t){this._endAngle=r(t)}},clockwise:{get:function(){return this._clockwise},set:function(t){this._clockwise=t}},angle:{get:function(){return a(this._rotation)},set:function(t){this._rotation=r(t)}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t}},toJSON:function(){return{type:this.type,x:this.p0.x,y:this.p0.y,xRadius:this._xRadius,yRadius:this._yRadius,startAngle:a(this._startAngle),endAngle:a(this._endAngle),clockwise:this._clockwise,rotation:a(this._rotation)}}});l.fromJSON=function(t){return new l(t)},t.exports=l},function(t,e){t.exports=function(t,e,i,n,s){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,s)}},function(t,e,i){var n=i(0),s=i(354),r=i(70),o=i(3),a=new n({Extends:r,initialize:function(t,e,i,n){r.call(this,"CubicBezierCurve"),Array.isArray(t)&&(n=new o(t[6],t[7]),i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=n},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,n=this.p1,r=this.p2,a=this.p3;return e.set(s(t,i.x,n.x,r.x,a.x),s(t,i.y,n.y,r.y,a.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);return t.strokePath(),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y,this.p3.x,this.p3.y]}}});a.fromJSON=function(t){var e=t.points,i=new o(e[0],e[1]),n=new o(e[2],e[3]),s=new o(e[4],e[5]),r=new o(e[6],e[7]);return new a(i,n,s,r)},t.exports=a},function(t,e){t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},function(t,e,i){var n=i(356),s=i(24),r=i(4);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",n),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),f=Math.floor(Math.abs(e[0].length*a)),p=Math.floor(Math.abs(e.length*h));i||(i=s.create2D(this,f,p),l=!1,u=!1),l&&(i.width=f,i.height=p);var g=i.getContext("2d");u&&g.clearRect(0,0,f,p),c&&c(i,g);for(var v=0;v<e.length;v++)for(var y=e[v],m=0;m<y.length;m++){var x=y[m];"."!==x&&" "!==x&&(g.fillStyle=o[x],g.fillRect(m*a,v*h,a,h))}return d&&d(i,g),i}},function(t,e,i){t.exports=i(952)},function(t,e,i){t.exports={In:i(955),Out:i(954),InOut:i(953)}},function(t,e,i){t.exports={In:i(958),Out:i(957),InOut:i(956)}},function(t,e,i){t.exports={In:i(961),Out:i(960),InOut:i(959)}},function(t,e,i){t.exports={In:i(964),Out:i(963),InOut:i(962)}},function(t,e,i){t.exports=i(965)},function(t,e,i){t.exports={In:i(968),Out:i(967),InOut:i(966)}},function(t,e,i){t.exports={In:i(971),Out:i(970),InOut:i(969)}},function(t,e,i){t.exports={In:i(974),Out:i(973),InOut:i(972)}},function(t,e,i){t.exports={In:i(977),Out:i(976),InOut:i(975)}},function(t,e,i){t.exports={In:i(980),Out:i(979),InOut:i(978)}},function(t,e,i){t.exports={In:i(983),Out:i(982),InOut:i(981)}},function(t,e,i){t.exports={Fade:i(986),Flash:i(985),Pan:i(984),Shake:i(951),Zoom:i(950)}},function(t,e,i){var n=i(37);t.exports=function(t){var e=new n,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var s=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(s,r,o,255*a)}return e}},function(t,e,i){var n=i(37);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e){t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(37),s=i(373);t.exports=function(t){var e=s(t);return new n(e.r,e.g,e.b,e.a)}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(e<i?6:0):r===e?a=(i-t)/o+2:r===i&&(a=(t-e)/o+4),a/=6),n.hasOwnProperty("_h")?(n._h=a,n._s=h,n._v=l):(n.h=a,n.s=h,n.v=l),n}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e,i){var n=i(37);t.exports=function(t){var e=new n;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var s=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(s,r,o)}return e}},function(t,e,i){var n=i(121),s=i(24),r=i(175),o=i(23),a=i(0),h=i(14),l=i(370),u=i(119),c=i(9),d=i(3),f=new a({Extends:n,Mixins:[h.Flip,h.Tint],initialize:function(t,e,i,s){n.call(this,t,e,i,s),this.inputEnabled=!0,this.fadeEffect=new l.Fade(this),this.flashEffect=new l.Flash(this),this.shakeEffect=new l.Shake(this),this.panEffect=new l.Pan(this),this.zoomEffect=new l.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null,this.renderToTexture=!1,this.canvas=null,this.context=null,this.glTexture=null,this.framebuffer=null,this.pipeline=null},setRenderToTexture:function(t){var e=this.scene.sys.game.renderer;return e.gl?(this.glTexture=e.createTextureFromSource(null,this.width,this.height,0),this.framebuffer=e.createFramebuffer(this.width,this.height,this.glTexture,!1)):(this.canvas=s.create2D(this,this.width,this.height),this.context=this.canvas.getContext("2d")),this.renderToTexture=!0,t&&this.setPipeline(t),this},setPipeline:function(t){if("string"==typeof t){var e=this.scene.sys.game.renderer;e.gl&&e.hasPipeline(t)&&(this.pipeline=e.getPipeline(t))}else this.pipeline=t;return this},clearRenderToTexture:function(){var t=this.scene.sys.game.renderer;return t.gl?(this.framebuffer&&t.deleteFramebuffer(this.framebuffer),this.glTexture&&t.deleteTexture(this.glTexture),this.framebuffer=null,this.glTexture=null,this.pipeline=null):(s.remove(this),this.canvas=null,this.context=null),this.renderToTexture=!1,this},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new c(0,0,t,e),this._follow){var i=this.width/2,n=this.height/2,s=this._follow.x-this.followOffset.x,o=this._follow.y-this.followOffset.y;this.midPoint.set(s,o),this.scrollX=s-i,this.scrollY=o-n}r(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,n,s,r){return this.fadeEffect.start(!1,t,e,i,n,!0,s,r)},fadeOut:function(t,e,i,n,s,r){return this.fadeEffect.start(!0,t,e,i,n,!0,s,r)},fadeFrom:function(t,e,i,n,s,r,o){return this.fadeEffect.start(!1,t,e,i,n,s,r,o)},fade:function(t,e,i,n,s,r,o){return this.fadeEffect.start(!0,t,e,i,n,s,r,o)},flash:function(t,e,i,n,s,r,o){return this.flashEffect.start(t,e,i,n,s,r,o)},shake:function(t,e,i,n,s){return this.shakeEffect.start(t,e,i,n,s)},pan:function(t,e,i,n,s,r,o){return this.panEffect.start(t,e,i,n,s,r,o)},zoomTo:function(t,e,i,n,s,r){return this.zoomEffect.start(t,e,i,n,s,r)},preRender:function(t,e){var i=this.width,n=this.height,s=.5*i,o=.5*n,a=this.zoom*t,h=this.matrix,l=i*this.originX,c=n*this.originY,d=this._follow,f=this.deadzone,p=this.scrollX,g=this.scrollY;if(f&&r(f,this.midPoint.x,this.midPoint.y),d){var v=d.x-this.followOffset.x,y=d.y-this.followOffset.y;f?(v<f.x?p=u(p,p-(f.x-v),this.lerp.x):v>f.right&&(p=u(p,p+(v-f.right),this.lerp.x)),y<f.y?g=u(g,g-(f.y-y),this.lerp.y):y>f.bottom&&(g=u(g,g+(y-f.bottom),this.lerp.y))):(p=u(p,v-l,this.lerp.x),g=u(g,y-c,this.lerp.y))}this.useBounds&&(p=this.clampX(p),g=this.clampY(g)),this.roundPixels&&(l=Math.round(l),c=Math.round(c)),this.scrollX=p,this.scrollY=g;var m=p+s,x=g+o;this.midPoint.set(m,x);var w=i/a,b=n/a;this.worldView.setTo(m-w/2,x-b/2,w,b),h.loadIdentity(),h.scale(e,e),h.translate(this.x+l,this.y+c),h.rotate(this.rotation),h.scale(a,a),h.translate(-l,-c),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(380),s=new(i(0))({initialize:function(t){this.game=t,this.binary=new n,this.bitmapFont=new n,this.json=new n,this.physics=new n,this.shader=new n,this.audio=new n,this.text=new n,this.html=new n,this.obj=new n,this.tilemap=new n,this.xml=new n,this.custom={},this.game.events.once("destroy",this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new n),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","text","html","obj","tilemap","xml"],e=0;e<t.length;e++)this[t[e]].destroy(),this[t[e]]=null;for(var i in this.custom)this.custom[i].destroy();this.custom=null,this.game=null}});t.exports=s},function(t,e,i){var n=i(0),s=i(180),r=i(11),o=new n({initialize:function(){this.entries=new s,this.events=new r},add:function(t,e){return this.entries.set(t,e),this.events.emit("add",this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit("remove",this,t,e.data)),this},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},function(t,e,i){var n=i(384),s=i(0),r=i(180),o=i(11),a=i(4),h=i(179),l=new s({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.paused=!1,this.name="AnimationManager",t.events.once("boot",this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once("destroy",this.destroy,this)},add:function(t,e){if(!this.anims.has(t))return e.key=t,this.anims.set(t,e),this.emit("add",t,e),this;console.warn("Animation with key",t,"already exists")},create:function(t){var e=t.key;if(e&&!this.anims.has(e)){var i=new n(this,e,t);return this.anims.set(e,i),this.emit("add",e,i),i}console.warn("Invalid Animation Key, or Key already in use: "+e)},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var n=0;n<t.anims.length;n++)i.push(this.create(t.anims[n]));t.hasOwnProperty("globalTimeScale")&&(this.globalTimeScale=t.globalTimeScale)}else t.hasOwnProperty("key")&&"frame"===t.type&&i.push(this.create(t));return i},generateFrameNames:function(t,e){var i=a(e,"prefix",""),n=a(e,"start",0),s=a(e,"end",0),r=a(e,"suffix",""),o=a(e,"zeroPad",0),l=a(e,"outputArray",[]),u=a(e,"frames",!1),c=this.textureManager.get(t);if(!c)return l;var d,f,p=n<s?1:-1;if(s+=p,e)if(Array.isArray(u))for(d=0;d<u.length;d++)f=i+h(u[d],o,"0",1)+r,c.has(f)&&l.push({key:t,frame:f});else for(d=n;d!==s;d+=p)f=i+h(d,o,"0",1)+r,c.has(f)&&l.push({key:t,frame:f});else for(u=c.getFrameNames(),d=0;d<u.length;d++)l.push({key:t,frame:u[d]});return l},generateFrameNumbers:function(t,e){var i,n=a(e,"start",0),s=a(e,"end",-1),r=a(e,"first",!1),o=a(e,"outputArray",[]),h=a(e,"frames",!1),l=this.textureManager.get(t);if(!l)return o;if(r&&l.has(r)&&o.push({key:t,frame:r}),Array.isArray(h))for(i=0;i<h.length;i++)l.has(h[i])&&o.push({key:t,frame:h[i]});else for(-1===s&&(s=l.frameTotal),i=n;i<=s;i++)l.has(i)&&o.push({key:t,frame:i});return o},get:function(t){return this.anims.get(t)},load:function(t,e,i){var n=this.get(e);return n&&n.load(t,i),t},pauseAll:function(){return this.paused||(this.paused=!0,this.emit("pauseall")),this},play:function(t,e){if(Array.isArray(e)||(e=[e]),this.get(t)){for(var i=0;i<e.length;i++)e[i].anims.play(t);return this}},remove:function(t){var e=this.get(t);return e&&(this.emit("remove",t,e),this.anims.delete(t)),e},resumeAll:function(){return this.paused&&(this.paused=!1,this.emit("resumeall")),this},staggerPlay:function(t,e,i){if(void 0===i&&(i=0),Array.isArray(e)||(e=[e]),this.get(t)){for(var n=0;n<e.length;n++)e[n].anims.delayedPlay(i*n,t);return this}},toJSON:function(t){if(void 0!==t&&""!==t)return this.anims.get(t).toJSON();var e={anims:[],globalTimeScale:this.globalTimeScale};return this.anims.each(function(t,i){e.anims.push(i.toJSON())}),e},destroy:function(){this.anims.clear(),this.textureManager=null,this.game=null}});t.exports=l},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e){t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,s,r=1;if(i){if(t<e[0][i])return e[0];for(;e[r][i]<t;)r++}else for(;e[r]<t;)r++;return r>e.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=i(23),s=i(0),r=i(383),o=i(382),a=i(4),h=new s({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,a(i,"frames",[]),a(i,"defaultTextureKey",null)),this.frameRate=a(i,"frameRate",null),this.duration=a(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=a(i,"skipMissedFrames",!0),this.delay=a(i,"delay",0),this.repeat=a(i,"repeat",0),this.repeatDelay=a(i,"repeatDelay",0),this.yoyo=a(i,"yoyo",!1),this.showOnStart=a(i,"showOnStart",!1),this.hideOnComplete=a(i,"hideOnComplete",!1),this.paused=!1,this.manager.on("pauseall",this.pause,this),this.manager.on("resumeall",this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t<this.frames.length},completeAnimation:function(t){this.hideOnComplete&&(t.parent.visible=!1),t.stop()},getFirstTick:function(t,e){void 0===e&&(e=!0),t.accumulator=0,t.nextTick=t.msPerFrame+t.currentFrame.duration,e&&(t.nextTick+=t._delay)},getFrameAt:function(t){return this.frames[t]},getFrames:function(t,e,i){var n,s,r,h,l=[],u=1;if("string"==typeof e){h=e;var c=t.get(h).getFrameNames();e=[],c.forEach(function(t,i){e.push({key:h,frame:i})})}if(!Array.isArray(e)||0===e.length)return l;for(r=0;r<e.length;r++){var d=e[r],f=a(d,"key",i);if(f){var p=a(d,"frame",0),g=t.getFrame(f,p);(s=new o(f,p,u,g)).duration=a(d,"duration",0),s.isFirst=!n,n&&(n.nextFrame=s,s.prevFrame=n),l.push(s),n=s,u++}}if(l.length>0){s.isLast=!0,s.nextFrame=l[0],l[0].prevFrame=s;var v=1/(l.length-1);for(r=0;r<l.length;r++)l[r].progress=r*v}return l},getNextTick:function(t){t.accumulator-=t.nextTick,t.nextTick=t.msPerFrame+t.currentFrame.duration},load:function(t,e){e>=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),r(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);t._repeatDelay>0&&!1===t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay):(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying&&(this.getNextTick(t),t.pendingRepeat=!1,t.parent.emit("animationrepeat",this,t.currentFrame,t.repeatCounter,t.parent)))},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t=this.frames.length,e=1/(t-1),i=0;i<t;i++){var n=this.frames[i];n.index=i+1,n.isFirst=!1,n.isLast=!1,n.progress=i*e,0===i?(n.isFirst=!0,n.isLast=1===t,n.prevFrame=this.frames[t-1],n.nextFrame=this.frames[i+1]):i===t-1?(n.isLast=!0,n.prevFrame=this.frames[t-2],n.nextFrame=this.frames[0]):t>1&&(n.prevFrame=this.frames[i-1],n.nextFrame=this.frames[i+1])}return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off("pauseall",this.pause,this),this.manager.off("resumeall",this.resume,this),this.manager.remove(this.key);for(var t=0;t<this.frames.length;t++)this.frames[t].destroy();this.frames=[],this.manager=null}});t.exports=h},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var n=Math.round(t.x1),s=Math.round(t.y1),r=Math.round(t.x2),o=Math.round(t.y2),a=Math.abs(r-n),h=Math.abs(o-s),l=n<r?1:-1,u=s<o?1:-1,c=a-h;i.push({x:n,y:s});for(var d=1;n!==r||s!==o;){var f=c<<1;f>-h&&(c-=h,n+=l),f<a&&(c+=a,s+=u),d%e==0&&i.push({x:n,y:s}),d++}return i}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n<e;n++)i=t.pop(),t.unshift(i);return i}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n<e;n++)i=t.shift(),t.push(i);return i}},function(t,e,i){var n=i(124),s=i(6);t.exports=function(t,e,i,r){if(void 0===r&&(r=[]),!e&&!i)return r;e?i=Math.round(n(t)/e):e=n(t)/i;for(var o=t.x,a=t.y,h=0,l=0;l<i;l++)switch(r.push(new s(o,a)),h){case 0:(o+=e)>=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){var n=i(16),s=i(38),r=i(199),o=i(198),a={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=r(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new s),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new s),void 0===e&&(e=new s);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t}};t.exports=a},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,scaleMode:t.scaleMode,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e){var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.geometryMask=e},setShape:function(t){this.geometryMask=t},preRenderWebGL:function(t,e,i){var n=t.gl,s=this.geometryMask;t.flush(),n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.NOTEQUAL,1,1),n.stencilOp(n.REPLACE,n.REPLACE,n.REPLACE),s.renderWebGL(t,s,0,i),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilFunc(n.EQUAL,1,1),n.stencilOp(n.KEEP,n.KEEP,n.KEEP)},postRenderWebGL:function(t){var e=t.gl;t.flush(),e.disable(e.STENCIL_TEST)},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,0,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){var i=t.sys.game.renderer;if(this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,i&&i.gl){var n=i.width,s=i.height,r=0==(n&n-1)&&0==(s&s-1),o=i.gl,a=r?o.REPEAT:o.CLAMP_TO_EDGE,h=o.LINEAR;this.mainTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.maskTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.mainFramebuffer=i.createFramebuffer(n,s,this.mainTexture,!1),this.maskFramebuffer=i.createFramebuffer(n,s,this.maskTexture,!1),i.onContextRestored(function(t){var e=t.width,i=t.height,n=0==(e&e-1)&&0==(i&i-1),s=t.gl,r=n?s.REPEAT:s.CLAMP_TO_EDGE,o=s.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!1),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!1)},this)}},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BitmapMaskPipeline.beginMask(this,e,i)},postRenderWebGL:function(t){t.pipelines.BitmapMaskPipeline.endMask(this)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null;var t=this.renderer;t&&t.gl&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer)),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null,this.renderer=null}});t.exports=n},function(t,e,i){var n=i(394),s=i(393),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&this.texture&&(t=this),new n(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new s(this.scene,t)}};t.exports=r},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x-e,a=t.y-i;return t.x=o*s-a*r+e,t.y=o*r+a*s+i,t}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var n=i(190),s=i(124);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o<e;o++){var a=o/e;r.push(n(t,a))}return r}},function(t,e){var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e,i){var n=i(66),s={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,e,i){var n=i(23),s={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,s){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=s},function(t,e){t.exports=function(t){return Math.PI*t.radius*2}},function(t,e,i){var n=i(402),s=i(192),r=i(93),o=i(16);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h<e;h++){var l=r(h/e,0,o.PI2);a.push(s(t,l))}return a}},function(t,e,i){var n=new(i(0))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n<t.length;n++)e=.02519603282416938*(i+=t.charCodeAt(n)),e-=i=e>>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e<t.length&&null!=t[e];e++){var i=t[e];this.s0-=this.hash(i),this.s0+=~~(this.s0<0),this.s1-=this.hash(i),this.s1+=~~(this.s1<0),this.s2-=this.hash(i),this.s2+=~~(this.s2<0)}},integer:function(){return 4294967296*this.rnd()},frac:function(){return this.rnd()+1.1102230246251565e-16*(2097152*this.rnd()|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},between:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},realInRange:function(t,e){return this.frac()*(e-t)+t},normal:function(){return 1-2*this.frac()},uuid:function(){var t="",e="";for(e=t="";t++<36;e+=~t%5|3*t&4?(15^t?8^this.frac()*(20^t?16:4):4).toString(16):"-");return e},pick:function(t){return t[this.integerInRange(0,t.length-1)]},sign:function(){return this.pick(this.signs)},weightedPick:function(t){return t[~~(Math.pow(this.frac(),2)*(t.length-1)+.5)]},timestamp:function(t,e){return this.realInRange(t||9466848e5,e||1577862e6)},angle:function(){return this.integerInRange(-180,180)},rotation:function(){return this.realInRange(-3.1415926,3.1415926)},state:function(t){return"string"==typeof t&&t.match(/^!rnd/)&&(t=t.split(","),this.c=parseFloat(t[1]),this.s0=parseFloat(t[2]),this.s1=parseFloat(t[3]),this.s2=parseFloat(t[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")},shuffle:function(t){for(var e=t.length-1,i=e;i>0;i--){var n=Math.floor(this.frac()*(e+1)),s=t[n];t[n]=t[i],t[i]=s}return t}});t.exports=n},function(t,e,i){var n=i(192),s=i(93),r=i(16),o=i(6);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(44),s=i(42),r=i(43),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(46),s=i(42),r=i(45),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(75),s=i(42),r=i(74),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(44),r=i(73),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(72),s=i(46),r=i(73),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(74),s=i(73);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(411),s=i(75),r=i(72);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(48),s=i(44),r=i(47),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(46),r=i(47),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(75),r=i(47),o=i(74);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(193),s=[];s[n.BOTTOM_CENTER]=i(415),s[n.BOTTOM_LEFT]=i(414),s[n.BOTTOM_RIGHT]=i(413),s[n.CENTER]=i(412),s[n.LEFT_CENTER]=i(410),s[n.RIGHT_CENTER]=i(409),s[n.TOP_CENTER]=i(408),s[n.TOP_LEFT]=i(407),s[n.TOP_RIGHT]=i(406);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){t.exports={Angle:i(1050),Call:i(1049),GetFirst:i(1048),GetLast:i(1047),GridAlign:i(1046),IncAlpha:i(1035),IncX:i(1034),IncXY:i(1033),IncY:i(1032),PlaceOnCircle:i(1031),PlaceOnEllipse:i(1030),PlaceOnLine:i(1029),PlaceOnRectangle:i(1028),PlaceOnTriangle:i(1027),PlayAnimation:i(1026),PropertyValueInc:i(32),PropertyValueSet:i(25),RandomCircle:i(1025),RandomEllipse:i(1024),RandomLine:i(1023),RandomRectangle:i(1022),RandomTriangle:i(1021),Rotate:i(1020),RotateAround:i(1019),RotateAroundDistance:i(1018),ScaleX:i(1017),ScaleXY:i(1016),ScaleY:i(1015),SetAlpha:i(1014),SetBlendMode:i(1013),SetDepth:i(1012),SetHitArea:i(1011),SetOrigin:i(1010),SetRotation:i(1009),SetScale:i(1008),SetScaleX:i(1007),SetScaleY:i(1006),SetTint:i(1005),SetVisible:i(1004),SetX:i(1003),SetXY:i(1002),SetY:i(1001),ShiftPosition:i(1e3),Shuffle:i(999),SmootherStep:i(998),SmoothStep:i(997),Spread:i(996),ToggleVisible:i(995),WrapInRectangle:i(994)}},function(t,e){var i={};t.exports=i,i.create=function(t,e){var n=t.bodyA,s=t.bodyB,r={id:i.id(n,s),bodyA:n,bodyB:s,activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:n.isSensor||s.isSensor,timeCreated:e,timeUpdated:e,collision:null,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return i.update(r,t,e),r},i.update=function(t,e,n){if(t.collision=e,e.collided){var s=e.supports,r=t.activeContacts,o=e.parentA,a=e.parentB;t.inverseMass=o.inverseMass+a.inverseMass,t.friction=Math.min(o.friction,a.friction),t.frictionStatic=Math.max(o.frictionStatic,a.frictionStatic),t.restitution=Math.max(o.restitution,a.restitution),t.slop=Math.max(o.slop,a.slop);for(var h=0;h<s.length;h++)r[h]=s[h].contact;var l=s.length;l<r.length&&(r.length=l),t.separation=e.depth,i.setActive(t,!0,n)}else!0===t.isActive&&i.setActive(t,!1,n)},i.setActive=function(t,e,i){e?(t.isActive=!0,t.timeUpdated=i):(t.isActive=!1,t.activeContacts.length=0)},i.id=function(t,e){return t.id<e.id?"A"+t.id+"B"+e.id:"A"+e.id+"B"+t.id}},function(t,e,i){t.exports={Bounce:i(1103),Collision:i(1102),Force:i(1101),Friction:i(1100),Gravity:i(1099),Mass:i(1098),Static:i(1097),Sensor:i(1096),SetBody:i(1095),Sleep:i(1093),Transform:i(1092),Velocity:i(1091)}},function(t,e,i){var n=i(0),s=i(895),r=i(196),o=10,a=new n({Extends:r,initialize:function(t){o=t.maxLights,t.fragShader=s.replace("%LIGHT_COUNT%",o.toString()),r.call(this,t),this.defaultNormalMap},boot:function(){this.defaultNormalMap=this.game.textures.getFrame("__DEFAULT")},onBind:function(t){r.prototype.onBind.call(this);var e=this.renderer,i=this.program;return this.mvpUpdate(),e.setInt1(i,"uNormSampler",1),e.setFloat2(i,"uResolution",this.width,this.height),t&&this.setNormalMap(t),this},onRender:function(t,e){this.active=!1;var i=t.sys.lights;if(!i||i.lights.length<=0||!i.active)return this;var n=i.cull(e),s=Math.min(n.length,o);if(0===s)return this;this.active=!0;var r,a=this.renderer,h=this.program,l=e.matrix,u={x:0,y:0},c=a.height;for(r=0;r<o;++r)a.setFloat1(h,"uLights["+r+"].radius",0);for(a.setFloat4(h,"uCamera",e.x,e.y,e.rotation,e.zoom),a.setFloat3(h,"uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),r=0;r<s;++r){var d=n[r],f="uLights["+r+"].";l.transformPoint(d.x,d.y,u),a.setFloat2(h,f+"position",u.x-e.scrollX*d.scrollFactorX*e.zoom,c-(u.y-e.scrollY*d.scrollFactorY*e.zoom)),a.setFloat3(h,f+"color",d.r,d.g,d.b),a.setFloat1(h,f+"intensity",d.intensity),a.setFloat1(h,f+"radius",d.radius)}return this},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w,b,T,S,_,A,C,M,P,E){var k;if(this.active)if(this.renderer.setPipeline(this),t.displayTexture?k=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?k=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(k=t.tileset.image.dataSource[0]),k){this.setTexture2D(k.glTexture,1);var L=this._tempMatrix1,F=this._tempMatrix2,R=this._tempMatrix3,O=y/i+C,D=m/n+M,B=(y+x)/i+C,I=(m+w)/n+M,Y=o,X=a,z=-g,N=-v;if(t.isCropped){var U=t._crop;Y=U.width,X=U.height,o=U.width,a=U.height;var V=y=U.x,G=m=U.y;c&&(V=x-U.x-U.width),d&&!e.isRenderTexture&&(G=w-U.y-U.height),O=V/i+C,D=G/n+M,B=(V+U.width)/i+C,I=(G+U.height)/n+M,z=-g+y,N=-v+m}d^=e.isRenderTexture?1:0,c&&(Y*=-1,z+=o),d&&(X*=-1,N+=a);var W=z+Y,H=N+X;F.applyITRS(s,r,u,h,l),L.copyFrom(P.matrix),E?(L.multiplyWithOffset(E,-P.scrollX*f,-P.scrollY*p),F.e=s,F.f=r,L.multiply(F,R)):(F.e-=P.scrollX*f,F.f-=P.scrollY*p,L.multiply(F,R));var j=R.getX(z,N),q=R.getY(z,N),K=R.getX(z,H),J=R.getY(z,H),Z=R.getX(W,H),Q=R.getY(W,H),$=R.getX(W,N),tt=R.getY(W,N);P.roundPixels&&(j|=0,q|=0,K|=0,J|=0,Z|=0,Q|=0,$|=0,tt|=0),this.setTexture2D(e,0),this.batchQuad(j,q,K,J,Z,Q,$,tt,O,D,B,I,b,T,S,_,A)}else console.warn("Normal map missing or invalid")},setNormalMap:function(t){var e;this.active&&t&&(t.texture&&(e=t.texture.dataSource[t.frame.sourceIndex]),e||(e=this.defaultNormalMap),this.setTexture2D(e.glTexture,1),this.renderer.setPipeline(t.defaultPipeline))},batchSprite:function(t,e,i){if(this.active){var n=t.texture.dataSource[t.frame.sourceIndex];n&&(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),r.prototype.batchSprite.call(this,t,e,i))}}});a.LIGHT_COUNT=o,t.exports=a},function(t,e,i){var n=i(0),s=i(897),r=i(896),o=i(197),a=new n({Extends:o,initialize:function(t){o.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:t.topology?t.topology:t.renderer.gl.TRIANGLES,vertShader:t.vertShader?t.vertShader:r,fragShader:t.fragShader?t.fragShader:s,vertexCapacity:t.vertexCapacity?t.vertexCapacity:3,vertexSize:t.vertexSize?t.vertexSize:2*Float32Array.BYTES_PER_ELEMENT,vertices:new Float32Array([-1,1,-1,-7,7,1]).buffer,attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.maxQuads=1,this.resolutionDirty=!0},onBind:function(){o.prototype.onBind.call(this);var t=this.renderer,e=this.program;return this.resolutionDirty&&(t.setFloat2(e,"uResolution",this.width,this.height),t.setInt1(e,"uMainSampler",0),t.setInt1(e,"uMaskSampler",1),this.resolutionDirty=!1),this},resize:function(t,e,i){return o.prototype.resize.call(this,t,e,i),this.resolutionDirty=!0,this},beginMask:function(t,e,i){var n=this.renderer,s=this.gl,r=t.bitmapMask;r&&s&&(n.flush(),n.setFramebuffer(t.maskFramebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),r.renderWebGL(n,r,0,i),n.flush(),n.setFramebuffer(t.mainFramebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT))},endMask:function(t){var e=this.renderer,i=this.gl;t.bitmapMask&&i&&(e.setFramebuffer(null),e.setPipeline(this),e.setTexture2D(t.maskTexture,1),e.setTexture2D(t.mainTexture,0),e.setInt1(this.program,"uInvertMaskAlpha",t.invertAlpha),i.drawArrays(this.topology,0,3))}});t.exports=a},function(t,e){t.exports=function(t,e,i){e||(e="image/png"),i||(i=.92);var n=t.getContext("experimental-webgl"),s=new Uint8Array(n.drawingBufferWidth*n.drawingBufferHeight*4);n.readPixels(0,0,n.drawingBufferWidth,n.drawingBufferHeight,n.RGBA,n.UNSIGNED_BYTE,s);var r,o=document.createElement("canvas"),a=o.getContext("2d");o.width=n.drawingBufferWidth,o.height=n.drawingBufferHeight;for(var h=(r=a.getImageData(0,0,o.width,o.height)).data,l=0;l<o.height;l+=1)for(var u=0;u<o.width;u+=1){var c=4*((o.height-l)*o.width+u),d=4*(l*o.width+u);h[d+0]=s[c+0],h[d+1]=s[c+1],h[d+2]=s[c+2],h[d+3]=s[c+3]}a.putImageData(r,0,0);var f=o.toDataURL(e,i),p=new Image;return p.src=f,p}},function(t,e,i){var n=i(121),s=i(0),r=i(26),o=i(117),a=i(91),h=i(38),l=i(10),u=i(422),c=i(421),d=i(420),f=i(196),p=new s({initialize:function(t){var e=this,i=t.config,s={alpha:i.transparent,depth:!1,antialias:i.antialias,premultipliedAlpha:i.premultipliedAlpha,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,failIfMajorPerformanceCaveat:i.failIfMajorPerformanceCaveat,powerPreference:i.powerPreference};this.config={clearBeforeRender:i.clearBeforeRender,antialias:i.antialias,backgroundColor:i.backgroundColor,contextCreation:s,resolution:i.resolution,autoResize:i.autoResize,roundPixels:i.roundPixels,maxTextures:i.maxTextures,maxTextureSize:i.maxTextureSize,batchSize:i.batchSize,maxLights:i.maxLights},this.game=t,this.type=r.WEBGL,this.width=t.config.width,this.height=t.config.height,this.canvas=t.canvas,this.lostContextCallbacks=[],this.restoredContextCallbacks=[],this.blendModes=[],this.nativeTextures=[],this.contextLost=!1,this.pipelines=null,this.snapshotState={callback:null,type:null,encoder:null},this.currentActiveTextureUnit=0,this.currentTextures=new Array(16),this.currentFramebuffer=null,this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.canvas.addEventListener("webglcontextlost",function(t){e.contextLost=!0,t.preventDefault();for(var i=0;i<e.lostContextCallbacks.length;++i){var n=e.lostContextCallbacks[i];n[0].call(n[1],e)}},!1),this.canvas.addEventListener("webglcontextrestored",function(){e.contextLost=!1,e.init(e.config);for(var t=0;t<e.restoredContextCallbacks.length;++t){var i=e.restoredContextCallbacks[t];i[0].call(i[1],e)}},!1),this.gl=null,this.supportedExtensions=null,this.extensions={},this.glFormats=[],this.compression={ETC1:!1,PVRTC:!1,S3TC:!1},this.drawingBufferHeight=0,this.blankTexture=null,this.defaultCamera=new n(0,0,0,0),this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,this._tempMatrix4=new h,this.init(this.config)},init:function(t){var e,i=this.canvas,n=t.backgroundColor;if(!(e=this.game.config.context?this.game.config.context:i.getContext("webgl",t.contextCreation)||i.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e,this.game.context=e;for(var s=0;s<=16;s++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT;var o=e.getSupportedExtensions();t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE));var a="WEBGL_compressed_texture_",h="WEBKIT_"+a;this.compression.ETC1=e.getExtension(a+"etc1")||e.getExtension(h+"etc1"),this.compression.PVRTC=e.getExtension(a+"pvrtc")||e.getExtension(h+"pvrtc"),this.compression.S3TC=e.getExtension(a+"s3tc")||e.getExtension(h+"s3tc"),this.supportedExtensions=o,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(n.redGL,n.greenGL,n.blueGL,1);for(var l=0;l<this.currentTextures.length;++l)this.currentTextures[l]=null;return this.pipelines={},this.addPipeline("TextureTintPipeline",new f({game:this.game,renderer:this})),this.addPipeline("BitmapMaskPipeline",new c({game:this.game,renderer:this})),this.addPipeline("Light2D",new d({game:this.game,renderer:this,maxLights:t.maxLights})),this.setBlendMode(r.BlendModes.NORMAL),this.resize(this.width,this.height),this.game.events.once("texturesready",this.boot,this),this},boot:function(){for(var t in this.pipelines)this.pipelines[t].boot();var e=this.game.textures.getFrame("__DEFAULT");this.pipelines.TextureTintPipeline.currentFrame=e,this.blankTexture=e},resize:function(t,e){var i=this.gl,n=this.pipelines,s=this.config.resolution;for(var r in this.width=Math.floor(t*s),this.height=Math.floor(e*s),this.canvas.width=this.width,this.canvas.height=this.height,this.config.autoResize&&(this.canvas.style.width=this.width/s+"px",this.canvas.style.height=this.height/s+"px"),i.viewport(0,0,this.width,this.height),n)n[r].resize(t,e,s);return this.drawingBufferHeight=i.drawingBufferHeight,this.defaultCamera.setSize(t,e),i.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this},onContextRestored:function(t,e){return this.restoredContextCallbacks.push([t,e]),this},onContextLost:function(t,e){return this.lostContextCallbacks.push([t,e]),this},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},flush:function(){this.currentPipeline&&this.currentPipeline.flush()},hasPipeline:function(t){return t in this.pipelines},getPipeline:function(t){return this.hasPipeline(t)?this.pipelines[t]:null},removePipeline:function(t){return delete this.pipelines[t],this},addPipeline:function(t,e){return this.hasPipeline(t)?console.warn("Pipeline exists: "+t):this.pipelines[t]=e,e.name=t,this.pipelines[t].resize(this.width,this.height,this.config.resolution),e},pushScissor:function(t,e,i,n){var s=[t,e,i,n];return this.scissorStack.push(s),this.setScissor(t,e,i,n),this.currentScissor=s,s},setScissor:function(t,e,i,n){var s=this.gl,r=this.currentScissor,o=r[0],a=r[1],h=r[2],l=r[3];o===t&&a===e&&h===i&&l===n||(this.flush(),i>0&&n>0&&s.scissor(t,this.drawingBufferHeight-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},setBlendMode:function(t){var e=this.gl,i=this.blendModes[t];return t!==r.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t&&(this.flush(),e.enable(e.BLEND),e.blendEquation(i.equation),i.func.length>2?e.blendFuncSeparate(i.func[0],i.func[1],i.func[2],i.func[3]):e.blendFunc(i.func[0],i.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>16&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e){var i=this.gl;return t!==this.currentTextures[e]&&(this.flush(),this.currentActiveTextureUnit!==e&&(i.activeTexture(i.TEXTURE0+e),this.currentActiveTextureUnit=e),i.bindTexture(i.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t){var e=this.gl,i=this.width,n=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(i=t.renderTexture.width,n=t.renderTexture.height):this.flush(),e.bindFramebuffer(e.FRAMEBUFFER,t),e.viewport(0,0,i,n),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,a=s.NEAREST,h=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,o(e,i)&&(h=s.REPEAT),n===r.ScaleModes.LINEAR&&this.config.antialias&&(a=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,a,a,h,h,s.RGBA,t):this.createTexture2D(0,a,a,h,h,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=void 0===l||null===l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null===o||void 0===o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&a(this.nativeTextures,e),this.gl.deleteTexture(t),this.currentTextures[0]===t&&this.setBlankTexture(!0),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,s=t._ch,r=this.pipelines.TextureTintPipeline,o=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-s),this.setFramebuffer(t.framebuffer);var a=this.gl;a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),r.projOrtho(e,n+e,i,s+i,-1e3,1e3),o.alphaGL>0&&r.drawFillRect(e,i,n+e,s+i,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL),t.emit("prerender",t)}else this.pushScissor(e,i,n,s),o.alphaGL>0&&r.drawFillRect(e,i,n,s,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL)},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,l.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,l.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit("postrender",t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=l.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.config.backgroundColor,i=this.pipelines;for(var n in this.config.clearBeforeRender&&(t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)),t.enable(t.SCISSOR_TEST),i)i[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,o=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);this.preRenderCamera(n);for(var l=0;l<o;l++){var u=s[l];if(u.willRender(n)){u.blendMode!==this.currentBlendMode&&this.setBlendMode(u.blendMode);var c=u.mask;c?(c.preRenderWebGL(this,u,n),u.renderWebGL(this,u,i,n),c.postRenderWebGL(this,u)):u.renderWebGL(this,u,i,n)}}this.setBlendMode(r.BlendModes.NORMAL),this.postRenderCamera(n)}},postRender:function(){if(!this.contextLost){this.flush(),this.snapshotState.callback&&(this.snapshotState.callback(u(this.canvas,this.snapshotState.type,this.snapshotState.encoder)),this.snapshotState.callback=null);var t=this.pipelines;for(var e in t)t[e].onPostRender()}},snapshot:function(t,e,i){return this.snapshotState.callback=t,this.snapshotState.type=e,this.snapshotState.encoder=i,this},canvasToTexture:function(t,e,i){void 0===i&&(i=!1);var n=this.gl;if(e)this.setTexture2D(e,0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.width=t.width,e.height=t.height,this.setTexture2D(null,0);else{var s=n.CLAMP_TO_EDGE;!i&&o(t.width,t.height)&&(s=n.REPEAT),e=this.createTexture2D(0,n.NEAREST,n.NEAREST,s,s,n.RGBA,t,t.width,t.height,!0)}return e},setTextureFilter:function(t,e){var i=this.gl,n=[i.LINEAR,i.NEAREST][e];return this.setTexture2D(t,0),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,n),this.setTexture2D(null,0),this},setFloat1:function(t,e,i){return this.setProgram(t),this.gl.uniform1f(this.gl.getUniformLocation(t,e),i),this},setFloat2:function(t,e,i,n){return this.setProgram(t),this.gl.uniform2f(this.gl.getUniformLocation(t,e),i,n),this},setFloat3:function(t,e,i,n,s){return this.setProgram(t),this.gl.uniform3f(this.gl.getUniformLocation(t,e),i,n,s),this},setFloat4:function(t,e,i,n,s,r){return this.setProgram(t),this.gl.uniform4f(this.gl.getUniformLocation(t,e),i,n,s,r),this},setFloat1v:function(t,e,i){return this.setProgram(t),this.gl.uniform1fv(this.gl.getUniformLocation(t,e),i),this},setFloat2v:function(t,e,i){return this.setProgram(t),this.gl.uniform2fv(this.gl.getUniformLocation(t,e),i),this},setFloat3v:function(t,e,i){return this.setProgram(t),this.gl.uniform3fv(this.gl.getUniformLocation(t,e),i),this},setFloat4v:function(t,e,i){return this.setProgram(t),this.gl.uniform4fv(this.gl.getUniformLocation(t,e),i),this},setInt1:function(t,e,i){return this.setProgram(t),this.gl.uniform1i(this.gl.getUniformLocation(t,e),i),this},setInt2:function(t,e,i,n){return this.setProgram(t),this.gl.uniform2i(this.gl.getUniformLocation(t,e),i,n),this},setInt3:function(t,e,i,n,s){return this.setProgram(t),this.gl.uniform3i(this.gl.getUniformLocation(t,e),i,n,s),this},setInt4:function(t,e,i,n,s,r){return this.setProgram(t),this.gl.uniform4i(this.gl.getUniformLocation(t,e),i,n,s,r),this},setMatrix2:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix2fv(this.gl.getUniformLocation(t,e),i,n),this},setMatrix3:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix3fv(this.gl.getUniformLocation(t,e),i,n),this},setMatrix4:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix4fv(this.gl.getUniformLocation(t,e),i,n),this},getMaxTextures:function(){return this.config.maxTextures},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){for(var t in this.pipelines)this.pipelines[t].destroy(),delete this.pipelines[t];for(var e=0;e<this.nativeTextures.length;++e)this.deleteTexture(this.nativeTextures[e]),delete this.nativeTextures[e];delete this.gl,delete this.game,this.contextLost=!0,this.extensions={},this.nativeTextures.length=0}});t.exports=p},function(t,e,i){var n=i(66),s=i(339);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[n.NORMAL]=i,t[n.ADD]="lighter",t[n.MULTIPLY]=e?"multiply":i,t[n.SCREEN]=e?"screen":i,t[n.OVERLAY]=e?"overlay":i,t[n.DARKEN]=e?"darken":i,t[n.LIGHTEN]=e?"lighten":i,t[n.COLOR_DODGE]=e?"color-dodge":i,t[n.COLOR_BURN]=e?"color-burn":i,t[n.HARD_LIGHT]=e?"hard-light":i,t[n.SOFT_LIGHT]=e?"soft-light":i,t[n.DIFFERENCE]=e?"difference":i,t[n.EXCLUSION]=e?"exclusion":i,t[n.HUE]=e?"hue":i,t[n.SATURATION]=e?"saturation":i,t[n.COLOR]=e?"color":i,t[n.LUMINOSITY]=e?"luminosity":i,t}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e="image/png"),void 0===i&&(i=.92);var n=t.toDataURL(e,i),s=new Image;return s.src=n,s}},function(t,e,i){var n=i(425),s=i(0),r=i(26),o=i(424),a=i(94),h=i(120),l=i(38),u=new s({initialize:function(t){this.game=t,this.type=r.CANVAS,this.drawCount=0,this.width=t.config.width,this.height=t.config.height,this.config={clearBeforeRender:t.config.clearBeforeRender,backgroundColor:t.config.backgroundColor,resolution:t.config.resolution,autoResize:t.config.autoResize,antialias:t.config.antialias,roundPixels:t.config.roundPixels},this.scaleMode=t.config.antialias?a.LINEAR:a.NEAREST,this.gameCanvas=t.canvas,this.gameContext=this.game.config.context?this.game.config.context:this.gameCanvas.getContext("2d"),this.currentContext=this.gameContext,this.blendModes=o(),this.currentScaleMode=0,this.snapshotCallback=null,this.snapshotType=null,this.snapshotEncoder=null,this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this._tempMatrix4=new l,this.init()},init:function(){this.resize(this.width,this.height)},resize:function(t,e){var i=this.config.resolution;this.width=t*i,this.height=e*i,this.gameCanvas.width=this.width,this.gameCanvas.height=this.height,this.config.autoResize&&(this.gameCanvas.style.width=this.width/i+"px",this.gameCanvas.style.height=this.height/i+"px"),this.scaleMode===a.NEAREST&&h.disable(this.gameContext)},onContextLost:function(){},onContextRestored:function(){},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,n=this.height;e.clearBeforeRender&&t.clearRect(0,0,i,n),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,n)),this.drawCount=0},render:function(t,e,i,n){var s=e.list,r=s.length,o=n._cx,a=n._cy,h=n._cw,l=n._ch,u=n.renderToTexture?n.context:t.sys.context,c=0!==o||0!==a||h!==u.canvas.width||l!==u.canvas.height;this.currentContext=u,n.transparent||(u.fillStyle=n.backgroundColor.rgba,u.fillRect(o,a,h,l)),u.globalAlpha=n.alpha,u.globalCompositeOperation="source-over",this.drawCount+=s.length,c&&(u.save(),u.beginPath(),u.rect(o,a,h,l),u.clip()),n.renderToTexture&&n.emit("prerender",n),n.matrix.copyToContext(u);for(var d=0;d<r;d++){var f=s[d];f.willRender(n)&&(f.mask&&f.mask.preRenderCanvas(this,f,n),f.renderCanvas(this,f,i,n),f.mask&&f.mask.postRenderCanvas(this,f,n))}u.setTransform(1,0,0,1,0,0),u.globalCompositeOperation="source-over",u.globalAlpha=1,n.flashEffect.postRenderCanvas(u),n.fadeEffect.postRenderCanvas(u),n.dirty=!1,c&&u.restore(),n.renderToTexture&&(n.emit("postrender",n),t.sys.context.drawImage(n.canvas,o,a))},postRender:function(){var t=this.gameContext;t.globalAlpha=1,t.globalCompositeOperation="source-over",this.snapshotCallback&&(this.snapshotCallback(n(this.gameCanvas,this.snapshotType,this.snapshotEncoder)),this.snapshotCallback=null)},snapshot:function(t,e,i){this.snapshotCallback=t,this.snapshotType=e,this.snapshotEncoder=i},batchSprite:function(t,e,i,n){var s=i.alpha*t.alpha;if(0!==s){var r=this.currentContext,o=this._tempMatrix1,a=this._tempMatrix2,h=this._tempMatrix3,l=e.canvasData,u=l.x,c=l.y,d=e.cutWidth,f=e.cutHeight,p=e.source.resolution,g=-t.displayOriginX+e.x,v=-t.displayOriginY+e.y,y=t.flipX?-1:1,m=t.flipY?-1:1;if(t.isCropped){var x=t._crop;x.flipX===t.flipX&&x.flipY===t.flipY||e.updateCropUVs(x,t.flipX,t.flipY),d=x.cw,f=x.ch,u=x.cx,c=x.cy,g=-t.displayOriginX+x.x,v=-t.displayOriginY+x.y,-1===y&&(g>=0?g=-(g+d):g<0&&(g=Math.abs(g)-d)),-1===m&&(v>=0?v=-(v+f):v<0&&(v=Math.abs(v)-f))}a.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.scale(y,m),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,g,v,d/p,f/p),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=u},function(t,e,i){var n=new(i(0))({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.once("remove",this.remove,this),this.isPlaying=!1,this.currentAnim=null,this.currentFrame=null,this._timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this._delay=0,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this.forward=!0,this._reverse=!1,this.accumulator=0,this.nextTick=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},setDelay:function(t){return void 0===t&&(t=0),this._delay=t,this.parent},getDelay:function(){return this._delay},delayedPlay:function(t,e,i){return this.play(e,!0,i),this.nextTick+=t,this.parent},getCurrentKey:function(){if(this.currentAnim)return this.currentAnim.key},load:function(t,e){return void 0===e&&(e=0),this.isPlaying&&this.stop(),this.animationManager.load(this,t,e),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.updateFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.updateFrame(t),this.parent},isPaused:{get:function(){return this._paused}},play:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!0,this._reverse=!1,this._startAnimation(t,i))},playReverse:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!1,this._reverse=!0,this._startAnimation(t,i))},_startAnimation:function(t,e){this.load(t,e);var i=this.currentAnim,n=this.parent;return this.repeatCounter=-1===this._repeat?Number.MAX_VALUE:this._repeat,i.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,i.showOnStart&&(n.visible=!0),n.emit("animationstart",this.currentAnim,this.currentFrame,n),n},reverse:function(t){return this.isPlaying&&this.currentAnim.key===t?(this._reverse=!this._reverse,this.forward=!this.forward,this.parent):this.parent},getProgress:function(){var t=this.currentFrame.progress;return this.forward||(t=1-t),t},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},remove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},getRepeat:function(){return this._repeat},setRepeat:function(t){return this._repeat=t,this.repeatCounter=0,this.parent},getRepeatDelay:function(){return this._repeatDelay},setRepeatDelay:function(t){return this._repeatDelay=t,this.parent},restart:function(t){void 0===t&&(t=!1),this.currentAnim.getFirstTick(this,t),this.forward=!0,this.isPlaying=!0,this.pendingRepeat=!1,this._paused=!1,this.updateFrame(this.currentAnim.frames[0]);var e=this.parent;return e.emit("animationrestart",this.currentAnim,this.currentFrame,e),this.parent},stop:function(){this._pendingStop=0,this.isPlaying=!1;var t=this.parent;return t.emit("animationcomplete",this.currentAnim,this.currentFrame,t),t},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopOnRepeat:function(){return this._pendingStop=2,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},setTimeScale:function(t){return void 0===t&&(t=1),this._timeScale=t,this.parent},getTimeScale:function(){return this._timeScale},getTotalFrames:function(){return this.currentAnim.frames.length},update:function(t,e){if(this.currentAnim&&this.isPlaying&&!this.currentAnim.paused){if(this.accumulator+=e*this._timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.currentAnim.completeAnimation(this);this.accumulator>=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit("animationupdate",i,t,e),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off("remove",this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=n},function(t,e){t.exports=function(t){return t.split("").reverse().join("")}},function(t,e){t.exports=function(t,e){return t.replace(/%([0-9]+)/g,function(t,i){return e[Number(i)-1]})}},function(t,e,i){t.exports={Format:i(429),Pad:i(179),Reverse:i(428),UppercaseFirst:i(327),UUID:i(295)}},function(t,e,i){var n=i(63);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)&&(i[s]=e[s]);return i}},function(t,e){t.exports=function(t,e){for(var i=0;i<e.length;i++)if(!t.hasOwnProperty(e[i]))return!1;return!0}},function(t,e,i){var n=i(4),s=i(23);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=n(t,e,o);return s(a,i,r)}},function(t,e,i){t.exports={Clone:i(63),Extend:i(20),GetAdvancedValue:i(12),GetFastValue:i(2),GetMinMaxValue:i(433),GetValue:i(4),HasAll:i(432),HasAny:i(298),HasValue:i(85),IsPlainObject:i(8),Merge:i(96),MergeRight:i(431)}},function(t,e,i){t.exports={Array:i(164),Objects:i(434),String:i(430)}},function(t,e,i){var n=i(0),s=i(203),r=i(15),o=i(202),a=i(83),h=i(97),l=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.timeScale=1,this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},start:function(){var t=this.systems.events;t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this),this.timeScale=1},createTimeline:function(t){return o(this,t)},timeline:function(t){var e=o(this,t);return e.paused||(this._add.push(e),this._toProcess++),e},create:function(t){return h(this,t)},add:function(t){var e=h(this,t);return this._add.push(e),this._toProcess++,e},existing:function(t){return this._add.push(t),this._toProcess++,this},addCounter:function(t){var e=s(this,t);return this._add.push(e),this._toProcess++,e},preUpdate:function(){if(0!==this._toProcess){var t,e,i=this._destroy,n=this._active,s=this._pending;for(t=0;t<i.length;t++){e=i[t];var r=n.indexOf(e);-1===r?(r=s.indexOf(e))>-1&&(e.state=a.REMOVED,s.splice(r,1)):(e.state=a.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;t<i.length;t++)(e=i[t]).state===a.PENDING_ADD&&(e.init()?(e.play(),this._active.push(e)):this._pending.push(e));i.length=0,this._toProcess=0}},update:function(t,e){var i,n=this._active;e*=this.timeScale;for(var s=0;s<n.length;s++)(i=n[s]).update(t,e)&&(this._destroy.push(i),this._toProcess++)},makeActive:function(t){if(-1===this._add.indexOf(t)&&-1===this._active.indexOf(t)){var e=this._pending.indexOf(t);return-1!==e&&this._pending.splice(e,1),this._add.push(t),t.state=a.PENDING_ADD,this._toProcess++,this}},each:function(t,e){for(var i=[null],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var s in this.list)i[0]=this.list[s],t.apply(e,i)},getAllTweens:function(){for(var t=this._active,e=[],i=0;i<t.length;i++)e.push(t[i]);return e},getGlobalTimeScale:function(){return this.timeScale},getTweensOf:function(t){var e,i,n=this._active,s=[];if(Array.isArray(t))for(i=0;i<n.length;i++){e=n[i];for(var r=0;r<t.length;r++)e.hasTarget(t[r])&&s.push(e)}else for(i=0;i<n.length;i++)(e=n[i]).hasTarget(t)&&s.push(e);return s},isTweening:function(t){for(var e,i=this._active,n=0;n<i.length;n++)if((e=i[n]).hasTarget(t)&&e.isPlaying())return!0;return!1},killAll:function(){for(var t=this.getAllTweens(),e=0;e<t.length;e++)t[e].stop();return this},killTweensOf:function(t){for(var e=this.getTweensOf(t),i=0;i<e.length;i++)e[i].stop();return this},pauseAll:function(){for(var t=this._active,e=0;e<t.length;e++)t[e].pause();return this},resumeAll:function(){for(var t=this._active,e=0;e<t.length;e++)t[e].resume();return this},setGlobalTimeScale:function(t){return this.timeScale=t,this},shutdown:function(){this.killAll(),this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0;var t=this.systems.events;t.off("preupdate",this.preUpdate,this),t.off("update",this.update,this),t.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("TweenManager",l,"tweens"),t.exports=l},function(t,e){t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","loop","loopDelay","offset","onComplete","onCompleteParams","onCompleteScope","onLoop","onLoopParams","onLoopScope","onRepeat","onRepeatParams","onRepeatScope","onStart","onStartParams","onStartScope","onUpdate","onUpdateParams","onUpdateScope","onYoyo","onYoyoParams","onYoyoScope","paused","props","repeat","repeatDelay","targets","useFrames","yoyo"]},function(t,e,i){t.exports={GetBoolean:i(84),GetEaseFunction:i(86),GetNewValue:i(98),GetProps:i(205),GetTargets:i(131),GetTweens:i(204),GetValueOp:i(130),NumberTweenBuilder:i(203),TimelineBuilder:i(202),TweenBuilder:i(97)}},function(t,e,i){var n=i(83),s=i(20),r={Builders:i(438),TweenManager:i(436),Tween:i(128),TweenData:i(127),Timeline:i(201)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(0),s=i(15),r=i(206),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=Date.now(),this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},start:function(){var t=this.systems.events;t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this)},addEvent:function(t){var e=new r(t);return this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,n){return this.addEvent({delay:t,callback:e,args:i,callbackScope:n})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeAllEvents:function(){return this._pendingRemoval=this._pendingRemoval.concat(this._active),this},preUpdate:function(){var t=this._pendingRemoval.length,e=this._pendingInsertion.length;if(0!==t||0!==e){var i,n;for(i=0;i<t;i++){n=this._pendingRemoval[i];var s=this._active.indexOf(n);s>-1&&this._active.splice(s,1),n.destroy()}for(i=0;i<e;i++)n=this._pendingInsertion[i],this._active.push(n);this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){if(this.now=t,!this.paused){e*=this.timeScale;for(var i=0;i<this._active.length;i++){var n=this._active[i];if(!n.paused&&(n.elapsed+=e*n.timeScale,n.elapsed>=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t<this._pendingInsertion.length;t++)this._pendingInsertion[t].destroy();for(t=0;t<this._active.length;t++)this._active[t].destroy();for(t=0;t<this._pendingRemoval.length;t++)this._pendingRemoval[t].destroy();this._active.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;var e=this.systems.events;e.off("preupdate",this.preUpdate,this),e.off("update",this.update,this),e.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});s.register("Clock",o,"time"),t.exports=o},function(t,e,i){t.exports={Clock:i(440),TimerEvent:i(206)}},function(t,e,i){var n=i(5),s=i(132);n.register("tilemap",function(t,e,i,n,r,o,a){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===n&&(n=void 0),null===r&&(r=void 0),s(this.scene,t,e,i,n,r,o,a)})},function(t,e,i){var n=i(13),s=i(132);n.register("tilemap",function(t){var e=void 0!==t?t:{};return s(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)})},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix);var u=t.currentContext,c=e.gidMap;u.save(),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l),l.copyToContext(u)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,h.copyToContext(u));var d=n.alpha*e.alpha;u.globalAlpha=n.alpha*e.alpha;for(var f=0;f<o;f++){var p=r[f],g=c[p.index];if(g){var v=g.image.getSourceImage(),y=g.getTileTextureCoordinates(p.index);if(y){var m=p.width/2,x=p.height/2;u.save(),u.translate(p.pixelX+m,p.pixelY+x),0!==p.rotation&&u.rotate(p.rotation),(p.flipX||p.flipY)&&u.scale(p.flipX?-1:1,p.flipY?-1:1),u.globalAlpha=d*p.alpha,u.drawImage(v,y.x,y.y,p.width,p.height,-m,-x,p.width,p.height),u.restore()}}}u.restore()}}},function(t,e){t.exports=function(t,e,i,n){var s=e.tileset,r=e.pipeline,o=r.vertexBuffer;t.setPipeline(r),r.modelIdentity(),r.modelTranslate(e.x-n.scrollX*e.scrollFactorX,e.y-n.scrollY*e.scrollFactorY,0),r.modelScale(e.scaleX,e.scaleY,1),r.viewLoad2D(n.matrix.matrix);for(var a=0;a<s.length;a++)e.upload(n,a),e.vertexCount[a]>0&&(t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer[a],t.setPipeline(r),t.setTexture2D(s[a].glTexture,0),t.gl.drawArrays(r.topology,0,e.vertexCount[a]));r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}},function(t,e,i){var n=i(1),s=i(1);n=i(445),s=i(444),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix);var u=t.currentContext,c=e.gidMap;u.save(),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l),l.copyToContext(u)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,h.copyToContext(u));for(var d=n.alpha*e.alpha,f=0;f<o;f++){var p=r[f],g=c[p.index];if(g){var v=g.image.getSourceImage(),y=g.getTileTextureCoordinates(p.index);if(y){var m=p.width/2,x=p.height/2;u.save(),u.translate(p.pixelX+m,p.pixelY+x),0!==p.rotation&&u.rotate(p.rotation),(p.flipX||p.flipY)&&u.scale(p.flipX?-1:1,p.flipY?-1:1),u.globalAlpha=d*p.alpha,u.drawImage(v,y.x,y.y,p.width,p.height,-m,-x,p.width,p.height),u.restore()}}}u.restore()}}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s){e.cull(s);var r=e.culledTiles,o=r.length,a=s.alpha*e.alpha;if(!(0===o||a<=0))for(var h=e.gidMap,l=e.pipeline,u=n.getTintAppendFloatAlpha,c=e.scrollFactorX,d=e.scrollFactorY,f=e.x,p=e.y,g=e.scaleX,v=e.scaleY,y=e.tileset,m=0;m<y.length;m++)for(var x=y[m],w=x.glTexture,b=0;b<o;b++){var T=r[b],S=h[T.index];if(S===x){var _=S.getTileTextureCoordinates(T.index);if(null!==_){var A=T.width,C=T.height,M=_.x,P=_.y,E=.5*T.width,k=.5*T.height,L=u(T.tint,a*T.alpha);l.batchTexture(e,w,w.width,w.height,(E+f+T.pixelX)*g,(k+p+T.pixelY)*v,T.width,T.height,g,v,T.rotation,T.flipX,T.flipY,c,d,E,k,M,P,A,C,L,L,L,L,!1,0,0,s,null,!0)}}}}},function(t,e,i){var n=i(1),s=i(1);n=i(448),s=i(447),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(99);t.exports=function(t){for(var e=[],i=[],s=0;s<t.layer.length;s++){var r=t.layer[s],o=r.tilesetName;""!==o&&-1===i.indexOf(o)&&(i.push(o),e.push(new n(o,0,r.tilesize,r.tilesize,0,0)))}return e}},function(t,e,i){var n=i(78),s=i(55);t.exports=function(t,e){for(var i=[],r=0;r<t.layer.length;r++){for(var o=t.layer[r],a=new n({name:o.name,width:o.width,height:o.height,tileWidth:o.tilesize,tileHeight:o.tilesize,visible:1===o.visible}),h=[],l=[],u=0;u<o.data.length;u++){for(var c=0;c<o.data[u].length;c++){var d,f=o.data[u][c]-1;d=f>-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(20);t.exports=function(t){for(var e,i,s,r,o,a=0;a<t.layers.length;a++){e=t.layers[a],r=null;for(var h=0;h<e.data.length;h++){o=e.data[h];for(var l=0;l<o.length;l++)null===(i=o[l])||i.index<0||(s=t.tiles[i.index][2],r=t.tilesets[s],i.width=r.tileWidth,i.height=r.tileHeight,r.tileProperties&&r.tileProperties[i.index-r.firstgid]&&(i.properties=n(i.properties,r.tileProperties[i.index-r.firstgid])))}}}},function(t,e){t.exports=function(t){for(var e=[],i=0;i<t.tilesets.length;i++)for(var n=t.tilesets[i],s=n.tileMargin,r=n.tileMargin,o=0,a=0,h=0,l=n.firstgid;l<n.firstgid+n.total&&(e[l]=[s,r,i],s+=n.tileWidth+n.tileSpacing,++o!==n.total)&&(++a!==n.columns||(s=n.tileMargin,r+=n.tileHeight+n.tileSpacing,a=0,++h!==n.rows));l++);return e}},function(t,e,i){var n=i(2),s=i(212),r=i(211);t.exports=function(t){for(var e=[],i=0;i<t.layers.length;i++)if("objectgroup"===t.layers[i].type){for(var o=t.layers[i],a=n(o,"offsetx",0),h=n(o,"offsety",0),l=[],u=0;u<o.objects.length;u++){var c=s(o.objects[u],a,h);l.push(c)}var d=new r(o);d.objects=l,e.push(d)}return e}},function(t,e,i){var n=i(85);t.exports=function(t,e){for(var i={},s=0;s<e.length;s++){var r=e[s];n(t,r)&&(i[r]=t[r])}return i}},function(t,e,i){var n=i(99),s=i(213),r=i(212);t.exports=function(t){for(var e,i=[],o=[],a=null,h=0;h<t.tilesets.length;h++){var l=t.tilesets[h];if(l.source)console.warn("Phaser can't load external tilesets. Use the Embed Tileset button and then export the map again.");else if(l.image){var u=new n(l.name,l.firstgid,l.tilewidth,l.tileheight,l.margin,l.spacing);if(t.version>1){if(Array.isArray(l.tiles)){for(var c={},d={},f=0;f<l.tiles.length;f++){var p=l.tiles[f];if(p.properties){var g={};p.properties.forEach(function(t){g[t.name]=t.value}),d[p.id]=g}if(p.objectgroup&&(c[p.id]={objectgroup:p.objectgroup},p.objectgroup.objects)){var v=p.objectgroup.objects.map(function(t){return r(t)});c[p.id].objectgroup.objects=v}}u.tileData=c,u.tileProperties=d}}else if(l.tileproperties&&(u.tileProperties=l.tileproperties),l.tiles)for(e in u.tileData=l.tiles,u.tileData){var y=u.tileData[e].objectgroup;if(y&&y.objects){var m=y.objects.map(function(t){return r(t)});u.tileData[e].objectgroup.objects=m}}u.updateTileData(l.imagewidth,l.imageheight),i.push(u)}else{var x=new s(l.name,l.firstgid,l.tilewidth,l.tileheight,l.margin,l.spacing,l.properties);for(e in l.tiles){var w=l.tiles[e].image,b=l.firstgid+parseInt(e,10);x.addImage(b,w)}o.push(x)}a&&(a.lastgid=l.firstgid-1),a=l}return{tilesets:i,imageCollections:o}}},function(t,e,i){var n=i(2);t.exports=function(t){for(var e=[],i=0;i<t.layers.length;i++)if("imagelayer"===t.layers[i].type){var s=t.layers[i];e.push({name:s.name,image:s.image,x:n(s,"offsetx",0)+s.x,y:n(s,"offsety",0)+s.y,alpha:s.opacity,visible:s.visible,properties:n(s,"properties",{})})}return e}},function(t,e){t.exports=function(t){for(var e=window.atob(t),i=e.length,n=new Array(i/4),s=0;s<i;s+=4)n[s/4]=(e.charCodeAt(s)|e.charCodeAt(s+1)<<8|e.charCodeAt(s+2)<<16|e.charCodeAt(s+3)<<24)>>>0;return n}},function(t,e,i){var n=i(458),s=i(2),r=i(78),o=i(214),a=i(55);t.exports=function(t,e){for(var i=[],h=0;h<t.layers.length;h++)if("tilelayer"===t.layers[h].type){var l=t.layers[h];if(l.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+l.name+"'");else{l.encoding&&"base64"===l.encoding&&(l.data=n(l.data),delete l.encoding);for(var u=new r({name:l.name,x:s(l,"offsetx",0)+l.x,y:s(l,"offsety",0)+l.y,width:l.width,height:l.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:l.opacity,visible:l.visible,properties:s(l,"properties",{})}),c=0,d=[],f=[],p=0,g=l.data.length;p<g;p++){var v=o(l.data[p]);if(v.gid>0){var y=new a(u,v.gid,c,f.length,t.tilewidth,t.tileheight);y.rotation=v.rotation,y.flipX=v.flipped,d.push(y)}else{var m=e?null:new a(u,-1,c,f.length,t.tilewidth,t.tileheight);d.push(m)}++c===l.width&&(f.push(d),c=0,d=[])}u.data=f,i.push(u)}}return i}},function(t,e,i){t.exports={Parse:i(217),Parse2DArray:i(133),ParseCSV:i(216),Impact:i(210),Tiled:i(215)}},function(t,e,i){var n=i(50),s=i(49),r=i(3);t.exports=function(t,e,i,o,a,h){return void 0===o&&(o=new r(0,0)),o.x=n(t,i,a,h),o.y=s(e,i,a,h),o}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o){if(void 0!==r){var a,h=n(t,e,i,s,null,o),l=0;for(a=0;a<r.length;a++)l+=r[a].weight;if(!(l<=0))for(a=0;a<h.length;a++){for(var u=Math.random()*l,c=0,d=-1,f=0;f<r.length;f++)if(u<=(c+=r[f].weight)){var p=r[f].index;d=Array.isArray(p)?p[Math.floor(Math.random()*p.length)]:p;break}h[a].index=d}}}},function(t,e,i){var n=i(101),s=i(100),r=i(3);t.exports=function(t,e,i,o,a){return void 0===i&&(i=new r(0,0)),i.x=n(t,o,a),i.y=s(e,o,a),i}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l<h.length;l++)h[l]&&(h[l].index===t?h[l].index=e:h[l].index===e&&(h[l].index=t))}},function(t,e,i){var n=i(17),s=i(122);t.exports=function(t,e,i,r,o){var a=n(t,e,i,r,null,o),h=a.map(function(t){return t.index});s(h);for(var l=0;l<a.length;l++)a[l].index=h[l]}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o,a){for(var h=n(t,e,i,s,null,a),l=0;l<h.length;l++)h[l].setCollisionCallback(r,o)}},function(t,e){t.exports=function(t,e,i,n){if("number"==typeof t)n.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,r=t.length;s<r;s++)n.callbacks[t[s]]=null!==e?{callback:e,callbackContext:i}:void 0}},function(t,e,i){var n=i(56),s=i(34);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var r=0;r<i.height;r++)for(var o=0;o<i.width;o++){var a=i.data[r][o];if(a){var h=a.getCollisionGroup();h&&h.objects&&h.objects.length>0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e,i){var n=i(56),s=i(34),r=i(85);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;a<o.height;a++)for(var h=0;h<o.width;h++){var l=o.data[a][h];if(l)for(var u in t)if(r(l.properties,u)){var c=t[u];Array.isArray(c)||(c=[c]);for(var d=0;d<c.length;d++)l.properties[u]===c[d]&&n(l,e)}}i&&s(0,0,o.width,o.height,o)}},function(t,e,i){var n=i(56),s=i(34),r=i(134);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a<o.height;a++)for(var h=0;h<o.width;h++){var l=o.data[a][h];l&&-1===t.indexOf(l.index)&&(n(l,e),r(l.index,e,o))}i&&s(0,0,o.width,o.height,o)}},function(t,e,i){var n=i(56),s=i(34),r=i(134);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!0),void 0===o&&(o=!0),!(t>e)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l<a.height;l++)for(var u=0;u<a.width;u++){var c=a.data[l][u];c&&c.index>=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(56),s=i(34),r=i(134);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a<t.length;a++)r(t[a],e,o);for(var h=0;h<o.height;h++)for(var l=0;l<o.width;l++){var u=o.data[h][l];u&&-1!==t.indexOf(u.index)&&n(u,e)}i&&s(0,0,o.width,o.height,o)}},function(t,e,i){var n=i(17),s=i(347),r=new s(105,210,231,150),o=new s(243,134,48,200),a=new s(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var s=void 0!==e.tileColor?e.tileColor:r,h=void 0!==e.collidingTileColor?e.collidingTileColor:o,l=void 0!==e.faceColor?e.faceColor:a,u=n(0,0,i.width,i.height,null,i);t.translate(i.tilemapLayer.x,i.tilemapLayer.y),t.scale(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var c=0;c<u.length;c++){var d=u[c],f=d.width,p=d.height,g=d.pixelX,v=d.pixelY,y=d.collides?h:s;null!==y&&(t.fillStyle(y.color,y.alpha/255),t.fillRect(g,v,f,p)),g+=1,v+=1,f-=2,p-=2,null!==l&&(t.lineStyle(1,l.color,l.alpha/255),d.faceTop&&t.lineBetween(g,v,g+f,v),d.faceRight&&t.lineBetween(g+f,v,g+f,v+p),d.faceBottom&&t.lineBetween(g,v+p,g+f,v+p),d.faceLeft&&t.lineBetween(g,v,g,v+p))}}},function(t,e,i){var n=i(218),s=i(50),r=i(49);t.exports=function(t,e,i,o,a,h){var l=s(t,!0,a,h),u=r(e,!0,a,h);return n(l,u,i,o,h)}},function(t,e,i){var n=i(17),s=i(162);t.exports=function(t,e,i,r,o,a){var h,l=n(t,e,i,r,null,a);if(void 0===o)for(o=[],h=0;h<l.length;h++)-1===o.indexOf(l[h].index)&&o.push(l[h].index);for(h=0;h<l.length;h++)l[h].index=s(o)}},function(t,e,i){var n=i(34),s=i(135);t.exports=function(t,e,i,r,o){if(!Array.isArray(t))return null;void 0===r&&(r=!0),Array.isArray(t[0])||(t=[t]);for(var a=t.length,h=t[0].length,l=0;l<a;l++)for(var u=0;u<h;u++){var c=t[l][u];s(c,e+u,i+l,!1,o)}r&&n(e-1,i-1,h+2,a+2,o)}},function(t,e,i){var n=i(135),s=i(50),r=i(49);t.exports=function(t,e,i,o,a,h){var l=s(e,!0,a,h),u=r(i,!0,a,h);return n(t,l,u,o,h)}},function(t,e,i){var n=i(219),s=i(50),r=i(49);t.exports=function(t,e,i,o){var a=s(t,!0,i,o),h=r(e,!0,i,o);return n(a,h,o)}},function(t,e,i){var n=i(17),s=i(50),r=i(49);t.exports=function(t,e,i,o,a,h,l){var u=s(t,!0,h,l),c=r(e,!0,h,l),d=Math.ceil(s(t+i,!1,h,l)),f=Math.ceil(r(e+o,!1,h,l));return n(u,c,d-u,f-c,a,l)}},function(t,e,i){var n=i(274),s=i(17),r=i(273),o=i(1),a=i(101),h=i(100),l=i(50),u=i(49),c=function(t,e){return r.RectangleToTriangle(e,t)};t.exports=function(t,e,i,d){if(void 0===t)return[];var f=o;t instanceof n.Circle?f=r.CircleToRectangle:t instanceof n.Rectangle?f=r.RectangleToRectangle:t instanceof n.Triangle?f=c:t instanceof n.Line&&(f=r.LineToRectangle);var p=l(t.left,!0,i,d),g=u(t.top,!0,i,d),v=Math.ceil(l(t.right,!1,i,d)),y=Math.ceil(u(t.bottom,!1,i,d)),m=Math.max(v-p,1),x=Math.max(y-g,1),w=s(p,g,m,x,e,d),b=d.tileWidth,T=d.tileHeight;d.tilemapLayer&&(b*=d.tilemapLayer.scaleX,T*=d.tilemapLayer.scaleY);for(var S=[],_=new n.Rectangle(0,0,b,T),A=0;A<w.length;A++){var C=w[A];_.x=a(C.x,i,d),_.y=h(C.y,i,d),f(t,_)&&S.push(C)}return S}},function(t,e,i){var n=i(102),s=i(50),r=i(49);t.exports=function(t,e,i,o,a){var h=s(t,!0,o,a),l=r(e,!0,o,a);return n(h,l,i,a)}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o,a,h){n(i,s,r,o,a,h).forEach(t,e)}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o,a,h){return n(i,s,r,o,a,h).find(t,e)||null}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=!1);var s,r,o,a=0;if(i){for(r=n.height-1;r>=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r<n.height;r++)for(s=0;s<n.width;s++)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}return null}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o,a,h){return n(i,s,r,o,a,h).filter(t,e)}},function(t,e,i){var n=i(17),s=i(34),r=i(56);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=n(e,i,o,a,null,l),d=0;d<c.length;d++)c[d].index=t,r(c[d],u);h&&s(e-1,i-1,o+2,a+2,l)}},function(t,e,i){var n=i(142),s=i(243);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o,a,h,l=t.tilemapLayer.tilemap,u=t.tilemapLayer,c=t.data,d=t.width,f=t.height,p=Math.floor(l.tileWidth*u.scaleX),g=Math.floor(l.tileHeight*u.scaleY),v=0,y=d,m=0,x=f;if(!u.skipCull&&1===u.scrollFactorX&&1===u.scrollFactorY){var w=n(e.worldView.x-u.x,p,0,!0)-u.cullPaddingX,b=s(e.worldView.right-u.x,p,0,!0)+u.cullPaddingX,T=n(e.worldView.y-u.y,g,0,!0)-u.cullPaddingY,S=s(e.worldView.bottom-u.y,g,0,!0)+u.cullPaddingY;v=Math.max(0,w),y=Math.min(d,b),m=Math.max(0,T),x=Math.min(f,S)}if(0===r)for(a=m;a<x;a++)for(o=v;o<y;o++)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(1===r)for(a=m;a<x;a++)for(o=y;o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=m;a--)for(o=v;o<y;o++)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(3===r)for(a=x;a>=m;a--)for(o=y;o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(101),s=i(100),r=i(17),o=i(220);t.exports=function(t,e,i,a,h,l){void 0===i&&(i={}),Array.isArray(t)||(t=[t]);var u=l.tilemapLayer;void 0===a&&(a=u.scene),void 0===h&&(h=a.cameras.main);var c,d=r(0,0,l.width,l.height,null,l),f=[];for(c=0;c<d.length;c++){var p=d[c];if(-1!==t.indexOf(p.index)){i.x=n(p.x,h,l),i.y=s(p.y,h,l);var g=a.make.sprite(i);f.push(g)}}if("number"==typeof e)for(c=0;c<t.length;c++)o(t[c],e,0,0,l.width,l.height,l);else if(Array.isArray(e))for(c=0;c<t.length;c++)o(t[c],e[c],0,0,l.width,l.height,l);return f}},function(t,e,i){var n=i(17),s=i(34);t.exports=function(t,e,i,r,o,a,h,l){t<0&&(t=0),e<0&&(e=0),void 0===h&&(h=!0);for(var u=n(t,e,i,r,null,l),c=o-t,d=a-e,f=0;f<u.length;f++){var p=u[f].x+c,g=u[f].y+d;p>=0&&p<l.width&&g>=0&&g<l.height&&l.data[g][p]&&l.data[g][p].copy(u[f])}h&&s(o-1,a-1,i+2,r+2,l)}},function(t,e,i){t.exports={Components:i(103),Parsers:i(460),Formats:i(29),ImageCollection:i(213),ParseToTilemap:i(132),Tile:i(55),Tilemap:i(209),TilemapCreator:i(443),TilemapFactory:i(442),Tileset:i(99),LayerData:i(78),MapData:i(77),ObjectLayer:i(211),DynamicTilemapLayer:i(208),StaticTilemapLayer:i(207)}},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){var n=i(20),s=i(491),r={FilterMode:s,Frame:i(113),Parsers:i(316),Texture:i(165),TextureManager:i(318),TextureSource:i(317)};r=n(!1,r,s),t.exports=r},function(t,e,i){t.exports={List:i(112),Map:i(180),ProcessQueue:i(228),RTree:i(227),Set:i(95)}},function(t,e,i){t.exports={SoundManagerCreator:i(325),BaseSound:i(114),BaseSoundManager:i(115),WebAudioSound:i(319),WebAudioSoundManager:i(320),HTML5AudioSound:i(323),HTML5AudioSoundManager:i(324),NoAudioSound:i(321),NoAudioSoundManager:i(322)}},function(t,e,i){var n=i(23),s=i(0),r=i(2),o=i(15),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.pluginStart,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once("shutdown",this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=r(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var n=r(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=r(t,"sleep",!1),this._willRemove=r(t,"remove",!1);var s=r(t,"onUpdate",null);s&&(this._onUpdate=s,this._onUpdateScope=r(t,"onUpdateScope",this.scene));var o=r(t,"allowInput",!1);this.settings.transitionAllowInput=o;var a=i.sys.settings;return a.isTransition=!0,a.transitionFrom=this.scene,a.transitionDuration=n,a.transitionAllowInput=o,r(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):r(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake():this.manager.start(e,r(t,"data")),this.systems.events.emit("transitionout",i,n),this.systems.events.on("update",this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off("update",this.step,this),t.events.emit("transitioncomplete",this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i){return this.manager.add(t,e,i),this},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off("shutdown",this.shutdown,this),t.off("postupdate",this.step,this),t.off("transitionout")},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",a,"scenePlugin"),t.exports=a},function(t,e,i){var n=i(116),s=i(20),r={SceneManager:i(329),ScenePlugin:i(495),Settings:i(326),Systems:i(166)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(221),s=new(i(0))({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this)},boot:function(){}});t.exports=s},function(t,e,i){t.exports={BasePlugin:i(221),DefaultPlugins:i(167),PluginCache:i(15),PluginManager:i(331),ScenePlugin:i(497)}},function(t,e,i){var n={};t.exports=n;var s=i(137),r=(i(194),i(33));n.create=function(t){var e=s.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return r.extend(e,i,t)}},function(t,e,i){var n={};t.exports=n;var s=i(33);n._registry={},n.register=function(t){if(n.isPlugin(t)||s.warn("Plugin.register:",n.toString(t),"does not implement all required fields."),t.name in n._registry){var e=n._registry[t.name],i=n.versionParse(t.version).number,r=n.versionParse(e.version).number;i>r?(s.warn("Plugin.register:",n.toString(e),"was upgraded to",n.toString(t)),n._registry[t.name]=t):i<r?s.warn("Plugin.register:",n.toString(e),"can not be downgraded to",n.toString(t)):t!==e&&s.warn("Plugin.register:",n.toString(t),"is already registered to different plugin object")}else n._registry[t.name]=t;return t},n.resolve=function(t){return n._registry[n.dependencyParse(t).name]},n.toString=function(t){return"string"==typeof t?t:(t.name||"anonymous")+"@"+(t.version||t.range||"0.0.0")},n.isPlugin=function(t){return t&&t.name&&t.version&&t.install},n.isUsed=function(t,e){return t.used.indexOf(e)>-1},n.isFor=function(t,e){var i=t.for&&n.dependencyParse(t.for);return!t.for||e.name===i.name&&n.versionSatisfies(e.version,i.range)},n.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=n.dependencies(t),r=s.topologicalSort(i),o=[],a=0;a<r.length;a+=1)if(r[a]!==t.name){var h=n.resolve(r[a]);h?n.isUsed(t,h.name)||(n.isFor(h,t)||(s.warn("Plugin.use:",n.toString(h),"is for",h.for,"but installed on",n.toString(t)+"."),h._warned=!0),h.install?h.install(t):(s.warn("Plugin.use:",n.toString(h),"does not specify an install function."),h._warned=!0),h._warned?(o.push("🔶 "+n.toString(h)),delete h._warned):o.push("✅ "+n.toString(h)),t.used.push(h.name)):o.push("⌠"+r[a])}o.length>0&&!h.silent&&s.info(o.join(" "))}else s.warn("Plugin.use:",n.toString(t),"does not specify any dependencies to install.")},n.dependencies=function(t,e){var i=n.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=n.resolve(t)||t,e[r]=s.map(t.uses||[],function(e){n.isPlugin(e)&&n.register(e);var r=n.dependencyParse(e),o=n.resolve(e);return o&&!n.versionSatisfies(o.version,r.range)?(s.warn("Plugin.dependencies:",n.toString(o),"does not satisfy",n.toString(r),"used by",n.toString(i)+"."),o._warned=!0,t._warned=!0):o||(s.warn("Plugin.dependencies:",n.toString(e),"used by",n.toString(i),"could not be resolved."),t._warned=!0),r.name});for(var o=0;o<e[r].length;o+=1)n.dependencies(e[r][o],e);return e}},n.dependencyParse=function(t){return s.isString(t)?(/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?))?$/.test(t)||s.warn("Plugin.dependencyParse:",t,"is not a valid dependency string."),{name:t.split("@")[0],range:t.split("@")[1]||"*"}):{name:t.name,range:t.range||t.version}},n.versionParse=function(t){/^\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?$/.test(t)||s.warn("Plugin.versionParse:",t,"is not a valid version or range.");var e=t.split("-");t=e[0];var i=isNaN(Number(t[0])),n=i?t.substr(1):t,r=s.map(n.split("."),function(t){return Number(t)});return{isRange:i,version:n,range:t,operator:i?t[0]:"",parts:r,prerelease:e[1],number:1e8*r[0]+1e4*r[1]+r[2]}},n.versionSatisfies=function(t,e){e=e||"*";var i=n.versionParse(e),s=i.parts,r=n.versionParse(t),o=r.parts;if(i.isRange){if("*"===i.operator||"*"===t)return!0;if("~"===i.operator)return o[0]===s[0]&&o[1]===s[1]&&o[2]>=s[2];if("^"===i.operator)return s[0]>0?o[0]===s[0]&&r.number>=i.number:s[1]>0?o[1]===s[1]&&o[2]>=s[2]:o[2]===s[2]}return t===e||"*"===t}},function(t,e,i){var n=i(1065);n.Body=i(67),n.Composite=i(137),n.World=i(499),n.Detector=i(503),n.Grid=i(1064),n.Pairs=i(1063),n.Pair=i(418),n.Query=i(1089),n.Resolver=i(1062),n.SAT=i(502),n.Constraint=i(194),n.Common=i(33),n.Engine=i(1061),n.Events=i(195),n.Sleeping=i(222),n.Plugin=i(500),n.Bodies=i(126),n.Composites=i(1068),n.Axes=i(505),n.Bounds=i(80),n.Svg=i(1087),n.Vector=i(81),n.Vertices=i(76),n.World.add=n.Composite.add,n.World.remove=n.Composite.remove,n.World.addComposite=n.Composite.addComposite,n.World.addBody=n.Composite.addBody,n.World.addConstraint=n.Composite.addConstraint,n.World.clear=n.Composite.clear,t.exports=n},function(t,e,i){var n={};t.exports=n;var s=i(76),r=i(81);n.collides=function(t,e,i){var o,a,h,l,u=!1;if(i){var c=t.parent,d=e.parent,f=c.speed*c.speed+c.angularSpeed*c.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;u=i&&i.collided&&f<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&u){var p=l.axisBody,g=p===t?e:t,v=[p.axes[i.axisNumber]];if(h=n._overlapAxes(p.vertices,g.vertices,v),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=n._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=n._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlap<a.overlap?(h=o,l.axisBody=t):(h=a,l.axisBody=e),l.axisNumber=h.axisNumber}l.bodyA=t.id<e.id?t:e,l.bodyB=t.id<e.id?e:t,l.collided=!0,l.depth=h.overlap,l.parentA=l.bodyA.parent,l.parentB=l.bodyB.parent,t=l.bodyA,e=l.bodyB,r.dot(h.axis,r.sub(e.position,t.position))<0?l.normal={x:h.axis.x,y:h.axis.y}:l.normal={x:-h.axis.x,y:-h.axis.y},l.tangent=r.perp(l.normal),l.penetration=l.penetration||{},l.penetration.x=l.normal.x*l.depth,l.penetration.y=l.normal.y*l.depth;var y=n._findSupports(t,e,l.normal),m=[];if(s.contains(t.vertices,y[0])&&m.push(y[0]),s.contains(t.vertices,y[1])&&m.push(y[1]),m.length<2){var x=n._findSupports(e,t,r.neg(l.normal));s.contains(e.vertices,x[0])&&m.push(x[0]),m.length<2&&s.contains(e.vertices,x[1])&&m.push(x[1])}return m.length<1&&(m=[y[0]]),l.supports=m,l},n._overlapAxes=function(t,e,i){for(var s,o,a=r._temp[0],h=r._temp[1],l={overlap:Number.MAX_VALUE},u=0;u<i.length;u++){if(o=i[u],n._projectToAxis(a,t,o),n._projectToAxis(h,e,o),(s=Math.min(a.max-h.min,h.max-a.min))<=0)return l.overlap=s,l;s<l.overlap&&(l.overlap=s,l.axis=o,l.axisNumber=u)}return l},n._projectToAxis=function(t,e,i){for(var n=r.dot(e[0],i),s=n,o=1;o<e.length;o+=1){var a=r.dot(e[o],i);a>s?s=a:a<n&&(n=a)}t.min=n,t.max=s},n._findSupports=function(t,e,i){for(var n,s,o,a,h=Number.MAX_VALUE,l=r._temp[0],u=e.vertices,c=t.position,d=0;d<u.length;d++)s=u[d],l.x=s.x-c.x,l.y=s.y-c.y,(n=-r.dot(i,l))<h&&(h=n,o=s);return s=u[o.index-1>=0?o.index-1:u.length-1],l.x=s.x-c.x,l.y=s.y-c.y,h=-r.dot(i,l),a=s,s=u[(o.index+1)%u.length],l.x=s.x-c.x,l.y=s.y-c.y,(n=-r.dot(i,l))<h&&(a=s),[o,a]}},function(t,e,i){var n={};t.exports=n;var s=i(502),r=i(418),o=i(80);n.collisions=function(t,e){for(var i=[],a=e.pairs.table,h=e.metrics,l=0;l<t.length;l++){var u=t[l][0],c=t[l][1];if((!u.isStatic&&!u.isSleeping||!c.isStatic&&!c.isSleeping)&&n.canCollide(u.collisionFilter,c.collisionFilter)&&(h.midphaseTests+=1,o.overlaps(u.bounds,c.bounds)))for(var d=u.parts.length>1?1:0;d<u.parts.length;d++)for(var f=u.parts[d],p=c.parts.length>1?1:0;p<c.parts.length;p++){var g=c.parts[p];if(f===u&&g===c||o.overlaps(f.bounds,g.bounds)){var v,y=a[r.id(f,g)];v=y&&y.isActive?y.collision:null;var m=s.collides(f,g,v);h.narrowphaseTests+=1,m.reused&&(h.narrowReuseCount+=1),m.collided&&(i.push(m),h.narrowDetections+=1)}}}return i},n.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n=i(126),s=i(67),r=i(0),o=i(419),a=i(2),h=i(85),l=i(76),u=new r({Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(t,e,i){this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var n=a(i,"body",null),s=a(i,"addToWorld",!0);if(n)this.setBody(n,s);else{var r=e.getCollisionGroup();a(r,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,r=n.rectangle(i,s,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),u=this.tile.getCollisionGroup(),c=a(u,"objects",[]),d=[],f=0;f<c.length;f++){var p=c[f],g=r+p.x*e,v=o+p.y*i,y=p.width*e,m=p.height*i,x=null;if(p.rectangle)x=n.rectangle(g+y/2,v+m/2,y,m,t);else if(p.ellipse)x=n.circle(g+y/2,v+m/2,y/2,t);else if(p.polygon||p.polyline){var w=(p.polygon?p.polygon:p.polyline).map(function(t){return{x:t.x*e,y:t.y*i}}),b=l.create(w);if(l.isConvex(w)){var T=l.centre(b);g+=T.x,v+=T.y}x=n.fromVertices(g,v,b,t)}x&&d.push(x)}return 1===d.length?this.setBody(d[0],t.addToWorld):d.length>1&&(t.parts=d,this.setBody(s.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(81),r=i(33);n.fromVertices=function(t){for(var e={},i=0;i<t.length;i++){var n=(i+1)%t.length,o=s.normalise({x:t[n].y-t[i].y,y:t[i].x-t[n].x}),a=0===o.y?1/0:o.x/o.y;e[a=a.toFixed(3).toString()]=o}return r.values(e)},n.rotate=function(t,e){if(0!==e)for(var i=Math.cos(e),n=Math.sin(e),s=0;s<t.length;s++){var r,o=t[s];r=o.x*i-o.y*n,o.y=o.x*n+o.y*i,o.x=r}}},function(t,e,i){t.exports={Acceleration:i(1121),BodyScale:i(1120),BodyType:i(1119),Bounce:i(1118),CheckAgainst:i(1117),Collides:i(1116),Debug:i(1115),Friction:i(1114),Gravity:i(1113),Offset:i(1112),SetGameObject:i(1111),Velocity:i(1110)}},function(t,e,i){var n=i(229);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.y,a=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=r,e.velocity.y=o-a*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=r,t.velocity.y=a-o*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{r*=.5,t.y-=r,e.y+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},function(t,e,i){var n=i(230);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(509);t.exports=function(t,e,i,s,r){var o=0;return t.deltaY()<0&&!t.blocked.up&&e.collideDown&&t.checkCollision.up?e.faceBottom&&t.y<s&&(o=t.y-s)<-r&&(o=0):t.deltaY()>0&&!t.blocked.down&&e.collideUp&&t.checkCollision.down&&e.faceTop&&t.bottom>i&&(o=t.bottom-i)>r&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:n(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(511);t.exports=function(t,e,i,s,r){var o=0;return t.deltaX()<0&&!t.blocked.left&&e.collideRight&&t.checkCollision.left?e.faceRight&&t.x<s&&(o=t.x-s)<-r&&(o=0):t.deltaX()>0&&!t.blocked.right&&e.collideLeft&&t.checkCollision.right&&e.faceLeft&&t.right>i&&(o=t.right-i)>r&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:n(t,o)),o}},function(t,e,i){var n=i(512),s=i(510),r=i(226);t.exports=function(t,e,i,o,a,h){var l=o.left,u=o.top,c=o.right,d=o.bottom,f=i.faceLeft||i.faceRight,p=i.faceTop||i.faceBottom;if(!f&&!p)return!1;var g=0,v=0,y=0,m=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()<e.deltaAbsY()&&(m=-1),0!==e.deltaX()&&0!==e.deltaY()&&f&&p&&(y=Math.min(Math.abs(e.position.x-c),Math.abs(e.right-l)),m=Math.min(Math.abs(e.position.y-d),Math.abs(e.bottom-u))),y<m){if(f&&0!==(g=n(e,i,l,c,h))&&!r(o,e))return!0;p&&(v=s(e,i,u,d,h))}else{if(p&&0!==(v=s(e,i,u,d,h))&&!r(o,e))return!0;f&&(g=n(e,i,l,c,h))}return 0!==g||0!==v}},function(t,e){t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},function(t,e){t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},function(t,e){t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},function(t,e){t.exports={setMass:function(t){return this.body.mass=t,this}}},function(t,e){var i={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=i},function(t,e){t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},function(t,e){t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},function(t,e){var i={enableBody:function(t,e,i,n,s){return t&&this.body.reset(e,i),n&&(this.body.gameObject.active=!0),s&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=i},function(t,e){t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e){t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t){return this.body.collideWorldBounds=t,this}}},function(t,e){t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},function(t,e){t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},function(t,e,i){var n=i(0),s=i(31),r=i(52),o=i(249),a=i(238),h=i(2),l=i(96),u=i(15),c=i(3),d=i(233),f=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.world=new d(this.scene,this.config),this.add=new a(this.world),this.systems.events.once("destroy",this.destroy,this)},start:function(){this.world||(this.world=new d(this.scene,this.config),this.add=new a(this.world));var t=this.systems.events;t.on("update",this.world.update,this.world),t.on("postupdate",this.world.postUpdate,this.world),t.once("shutdown",this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,n,s,!1)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,n,s,r){void 0===n&&(n=60);var o=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(o,n),void 0!==s&&void 0!==r&&t.body.maxVelocity.set(s,r),o},accelerateToObject:function(t,e,i,n,s){return this.accelerateTo(t,e.x,e.y,i,n,s)},closest:function(t){for(var e=this.world.tree.all(),i=Number.MAX_VALUE,n=null,s=t.x,r=t.y,a=e.length-1;a>=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l<i&&(n=h,i=l)}return n},furthest:function(t){for(var e=this.world.tree.all(),i=-1,n=null,s=t.x,r=t.y,a=e.length-1;a>=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l>i&&(n=h,i=l)}return n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(t,e)},shutdown:function(){if(this.world){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("postupdate",this.world.postUpdate,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});u.register("ArcadePhysics",f,"arcadePhysics"),t.exports=f},function(t,e,i){var n=i(35),s=i(20),r={ArcadePhysics:i(527),Body:i(232),Collider:i(231),Factory:i(238),Group:i(235),Image:i(237),Sprite:i(104),StaticBody:i(225),StaticGroup:i(234),World:i(233)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(138),s=i(240),r=i(239),o=new s,a=new r,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+n*n+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12]*s,this.y=r[1]*e+r[5]*i+r[9]*n+r[13]*s,this.z=r[2]*e+r[6]*i+r[10]*n+r[14]*s,this.w=r[3]*e+r[7]*i+r[11]*n+r[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var s=[],r=[],o=0;o<t;o++)e+=(i-=e*n)*n,s[o]=i,r[o]=e;return{sin:r,cos:s,length:t}}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,s=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*s,t.y=Math.sin(i)*s,t.z=n*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=e+1);var s=(t-e)/(i-e);return s>1?void 0!==n?(s=(n-t)/(n-i))<0&&(s=0):s=1:s<0&&(s=0),s}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},function(t,e){t.exports=function(t){for(var e=0,i=0;i<t.length;i++)e+=+t[i];return e/t.length}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),n?(i+t)/e:i+t)}},function(t,e,i){t.exports={Ceil:i(243),Floor:i(142),To:i(547)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){t.exports={GetNext:i(294),IsSize:i(117),IsValue:i(549)}},function(t,e,i){var n=i(182);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var n=i(119);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return e<0?n(t[0],t[1],s):e>1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(171);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return t[0]===t[i]?(e<0&&(r=Math.floor(s=i*(1+e))),n(s-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(n(-s,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(s-r,t[r?r-1:0],t[r],t[i<r+1?i:r+1],t[i<r+2?i:r+2])}},function(t,e,i){var n=i(245);t.exports=function(t,e){for(var i=0,s=t.length-1,r=0;r<=s;r++)i+=Math.pow(1-e,s-r)*Math.pow(e,r)*t[r]*n(s,r);return i}},function(t,e,i){t.exports={Bezier:i(554),CatmullRom:i(553),CubicBezier:i(354),Linear:i(552),QuadraticBezier:i(350),SmoothStep:i(334),SmootherStep:i(551)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},function(t,e,i){t.exports={Ceil:i(557),Equal:i(248),Floor:i(556),GreaterThan:i(247),LessThan:i(246)}},function(t,e,i){t.exports={Back:i(369),Bounce:i(368),Circular:i(367),Cubic:i(366),Elastic:i(365),Expo:i(364),Linear:i(363),Quadratic:i(362),Quartic:i(361),Quintic:i(360),Sine:i(359),Stepped:i(358)}},function(t,e){t.exports=function(t,e,i,n,s){return void 0===s&&(s=2),Math.sqrt(Math.pow(i-t,s)+Math.pow(n-e,s))}},function(t,e,i){t.exports={Between:i(52),Power:i(560),Squared:i(249)}},function(t,e){t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},function(t,e,i){var n=i(16);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e?t:(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e<t?e+=n.PI2:e-=n.PI2),e>t?t+=i:e<t&&(t-=i)),t)}},function(t,e,i){var n=i(250);t.exports=function(t){return n(t+Math.PI)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(i-t,n-e)}},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},function(t,e,i){t.exports={Between:i(568),BetweenY:i(567),BetweenPoints:i(566),BetweenPointsY:i(565),Reverse:i(564),RotateTo:i(563),ShortestBetween:i(562),Normalize:i(250),Wrap:i(199),WrapDegrees:i(198)}},function(t,e,i){var n=i(16),s=i(20),r={Angle:i(569),Distance:i(561),Easing:i(559),Fuzzy:i(558),Interpolation:i(555),Pow2:i(550),Snap:i(548),RandomDataGenerator:i(404),Average:i(546),Bernstein:i(245),Between:i(170),CatmullRom:i(171),CeilTo:i(545),Clamp:i(23),DegToRad:i(31),Difference:i(544),Factorial:i(244),FloatBetween:i(299),FloorTo:i(543),FromPercent:i(93),GetSpeed:i(542),IsEven:i(541),IsEvenStrict:i(540),Linear:i(119),MaxAdd:i(539),MinSub:i(538),Percent:i(537),RadToDeg:i(172),RandomXY:i(536),RandomXYZ:i(535),RandomXYZW:i(534),Rotate:i(242),RotateAround:i(396),RotateAroundDistance:i(183),RoundAwayFromZero:i(314),RoundTo:i(533),SinCosTableGenerator:i(532),SmootherStep:i(182),SmoothStep:i(181),TransformXY:i(332),Within:i(531),Wrap:i(53),Vector2:i(3),Vector3:i(138),Vector4:i(530),Matrix3:i(241),Matrix4:i(240),Quaternion:i(239),RotateVec3:i(529)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(0),s=i(18),r=i(95),o=i(11),a=i(7),h=i(2),l=i(15),u=i(105),c=new n({Extends:o,initialize:function(t){o.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,a.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(h(i,"baseURL",e.loaderBaseURL)),this.setPath(h(i,"path",e.loaderPath)),this.setPrefix(h(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=h(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=u(h(i,"responseType",e.loaderResponseType),h(i,"async",e.loaderAsync),h(i,"user",e.loaderUser),h(i,"password",e.loaderPassword),h(i,"timeout",e.loaderTimeout)),this.crossOrigin=h(i,"crossOrigin",e.loaderCrossOrigin),this.totalToLoad=0,this.progress=0,this.list=new r,this.inflight=new r,this.queue=new r,this._deleteQueue=new r,this.totalFailed=0,this.totalComplete=0,this.state=s.LOADER_IDLE,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.pluginStart,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},pluginStart:function(){this.systems.events.once("shutdown",this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];this.keyExists(i)||(this.list.set(i),this.emit("addfile",i.key,i.type,this,i),this.isLoading()&&(this.totalToLoad++,this.updateProgress()))}},keyExists:function(t){var e=t.hasCacheConflict();return e||this.list.iterate(function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1}),!e&&this.isLoading()&&(this.inflight.iterate(function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1}),this.queue.iterate(function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1})),e},addPack:function(t,e){e&&t.hasOwnProperty(e)&&(t={packKey:t[e]});var i=0,n=this.baseURL,s=this.path,r=this.prefix;for(var o in t){var a=t[o],l=h(a,"baseURL",n),u=h(a,"path",s),c=h(a,"prefix",r),d=h(a,"files",null),f=h(a,"defaultType","void");if(Array.isArray(d)){this.setBaseURL(l),this.setPath(u),this.setPrefix(c);for(var p=0;p<d.length;p++){var g=d[p],v=g.hasOwnProperty("type")?g.type:f;this[v]&&(this[v](g),i++)}}}return this.setBaseURL(n),this.setPath(s),this.setPrefix(r),i>0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit("start",this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on("update",this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit("progress",this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.size<this.maxParallelDownloads&&this.checkLoadQueue()},checkLoadQueue:function(){this.list.each(function(t){if((t.state===s.FILE_POPULATED||t.state===s.FILE_PENDING&&this.inflight.size<this.maxParallelDownloads)&&(this.inflight.set(t),this.list.delete(t),t.crossOrigin||(t.crossOrigin=this.crossOrigin),t.load()),this.inflight.size===this.maxParallelDownloads)return!1},this)},nextFile:function(t,e){this.inflight&&(this.inflight.delete(t),this.updateProgress(),e?(this.totalComplete++,this.queue.set(t),this.emit("load",t),t.onProcess()):(this.totalFailed++,this._deleteQueue.set(t),this.emit("loaderror",t),this.fileProcessComplete(t)))},fileProcessComplete:function(t){this.scene&&this.systems&&this.systems.game&&!this.systems.game.pendingDestroy&&(t.state===s.FILE_ERRORED?t.multiFile&&t.multiFile.onFileFailed(t):t.state===s.FILE_COMPLETE&&(t.multiFile?t.multiFile.isReadyToProcess()&&t.multiFile.addToCache():t.addToCache()),this.queue.delete(t),0===this.list.size&&0===this.inflight.size&&0===this.queue.size&&this.loadComplete())},loadComplete:function(){this.emit("loadcomplete",this),this.list.clear(),this.inflight.clear(),this.queue.clear(),this.progress=1,this.state=s.LOADER_COMPLETE,this.systems.events.off("update",this.update,this),this._deleteQueue.iterateLocal("destroy"),this._deleteQueue.clear(),this.emit("complete",this,this.totalComplete,this.totalFailed)},flagForRemoval:function(t){this._deleteQueue.set(t)},saveJSON:function(t,e){return this.save(JSON.stringify(t),e)},save:function(t,e,i){void 0===e&&(e="file.json"),void 0===i&&(i="application/json");var n=new Blob([t],{type:i}),s=URL.createObjectURL(n),r=document.createElement("a");return r.download=e,r.textContent="Download "+e,r.href=s,r.click(),this},reset:function(){this.list.clear(),this.inflight.clear(),this.queue.clear();var t=this.systems.game.config,e=this.systems.settings.loader;this.setBaseURL(h(e,"baseURL",t.loaderBaseURL)),this.setPath(h(e,"path",t.loaderPath)),this.setPrefix(h(e,"prefix",t.loaderPrefix)),this.state=s.LOADER_IDLE},shutdown:function(){this.reset(),this.state=s.LOADER_SHUTDOWN,this.systems.events.off("update",this.update,this),this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.state=s.LOADER_DESTROYED,this.systems.events.off("update",this.update,this),this.systems.events.off("start",this.pluginStart,this),this.list=null,this.inflight=null,this.queue=null,this.scene=null,this.systems=null,this.textureManager=null,this.cacheManager=null}});l.register("Loader",c,"load"),t.exports=c},function(t,e,i){var n=i(0),s=i(7),r=i(2),o=i(58),a=i(8),h=i(57),l=i(251),u=new n({Extends:h,initialize:function(t,e,i,n,s,u){var c,d;if(a(e)){var f=e;c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new l(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","txt"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new o(t,e,i,s),d=new l(t,e,n,u);c.linkFile?h.call(this,t,"unityatlas",e,[c,d,c.linkFile]):h.call(this,t,"unityatlas",e,[c,d])},addToCache:function(){if(0===this.failed&&!this.complete){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});s.register("unityAtlas",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new u(this,t[o]),this.addFile(r.files);else r=new u(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=u},function(t,e,i){var n=i(0),s=i(7),r=i(51),o=i(29),a=new n({Extends:r,initialize:function(t,e,i,n){r.call(this,t,e,i,n),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.TILED_JSON,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});s.register("tilemapTiledJSON",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new a(this,t[n]));else this.addFile(new a(this,t,e,i));return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(7),r=i(51),o=i(29),a=new n({Extends:r,initialize:function(t,e,i,n){r.call(this,t,e,i,n),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.WELTMEISTER,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});s.register("tilemapImpact",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new a(this,t[n]));else this.addFile(new a(this,t,e,i));return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=i(29),u=new n({Extends:r,initialize:function(t,e,i,n){var s="csv";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var u={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,u),this.tilemapFormat=l.CSV},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});o.register("tilemapCSV",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new u(this,t[n]));else this.addFile(new u(this,t,e,i));return this}),t.exports=u},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n,s){var o="svg";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),n=a(l,"svgConfig",{}),s=a(l,"xhrSettings"),o=a(l,"extension",o)}var u={type:"svg",cache:t.textureManager,extension:o,responseType:"text",key:e,url:i,xhrSettings:s,config:{width:a(n,"width"),height:a(n,"height"),scale:a(n,"scale")}};r.call(this,t,u)},onProcess:function(){this.state=s.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,n=this.config.height,o=this.config.scale;t:if(i&&n||o){var a=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],h=a.hasAttribute("viewBox"),l=parseFloat(a.getAttribute("width")),u=parseFloat(a.getAttribute("height"));if(!h&&l&&u)a.setAttribute("viewBox","0 0 "+l+" "+u);else if(h&&!l&&!u){var c=a.getAttribute("viewBox").split(/\s+|,/);l=c[2],u=c[3]}if(o){if(!l||!u)break t;i=l*o,n=u*o}a.setAttribute("width",i.toString()+"px"),a.setAttribute("height",n.toString()+"px"),e=[(new XMLSerializer).serializeToString(a)]}try{var d=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var f=this,p=!1;this.data.onload=function(){p||r.revokeObjectURL(f.data),f.onProcessComplete()},this.data.onerror=function(){p?f.onProcessError():(p=!0,r.revokeObjectURL(f.data),f.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},r.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("svg",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i,n));return this}),t.exports=l},function(t,e,i){var n=i(0),s=i(7),r=i(58),o=new n({Extends:r,initialize:function(t,e,i,n,s){r.call(this,t,e,i,s,n),this.type="spritesheet"},addToCache:function(){var t=this.cache.addSpriteSheet(this.key,this.data,this.config);this.pendingDestroy(t)}});s.register("spritesheet",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new o(this,t[s]));else this.addFile(new o(this,t,e,i,n));return this}),t.exports=o},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n){var s="js";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"script",cache:!1,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("script",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this}),t.exports=l},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),n=a(c,"systemKey"),o=a(c,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{systemKey:n,sceneKey:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=s.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,n=a(e,"systemKey",i),r=a(e,"sceneKey",i);this.state===s.FILE_POPULATED?t.installScenePlugin(n,this.data,r,this.loader.scene):(this.state=s.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(n,window[this.key],r,this.loader.scene)),this.onProcessComplete()}});o.register("scenePlugin",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,i,n,s));return this}),t.exports=l},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),n=a(c,"start"),o=a(c,"mapping")}var d={type:"plugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{start:n,mapping:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=s.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=a(e,"start",!1),n=a(e,"mapping",null);this.state===s.FILE_POPULATED?t.install(this.key,this.data,i,n):(this.state=s.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.install(this.key,window[this.key],i,n)),this.onProcessComplete()}});o.register("plugin",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,i,n,s));return this}),t.exports=l},function(t,e,i){var n=i(0),s=i(18),r=i(7),o=i(51),a=new n({Extends:o,initialize:function(t,e,i,n,s){o.call(this,t,e,i,n,s),this.type="packfile"},onProcess:function(){this.state!==s.FILE_POPULATED&&(this.state=s.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.loader.addPack(this.data,this.config),this.onProcessComplete()}});r.register("pack",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new a(this,t[s]));else this.addFile(new a(this,t,e,n,i));return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(7),r=i(2),o=i(58),a=i(8),h=i(51),l=i(57),u=new n({Extends:l,initialize:function(t,e,i,n,s,o,u){if(a(e)){var c=e;e=r(c,"key"),i=r(c,"url"),o=r(c,"xhrSettings"),n=r(c,"path"),s=r(c,"baseURL"),u=r(c,"textureXhrSettings")}var d=new h(t,e,i,o);l.call(this,t,"multiatlas",e,[d]),this.config.path=n,this.config.baseURL=s,this.config.textureXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,n=this.loader,s=n.baseURL,a=n.path,h=n.prefix,l=r(i,"baseURL",s),u=r(i,"path",a),c=r(i,"prefix",h),d=r(i,"textureXhrSettings");n.setBaseURL(l),n.setPath(u),n.setPrefix(c);for(var f=0;f<e.length;f++){var p=e[f].image,g="_MA_"+p,v=new o(n,g,p,d);if(this.addToMultiFile(v),n.addFile(v),e[f].normalMap){var y=new o(n,g,e[f].normalMap,d);y.type="normalMap",v.setLink(y),this.addToMultiFile(y),n.addFile(y)}}n.setBaseURL(s),n.setPath(a),n.setPrefix(h)}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0];t.addToCache();for(var e=[],i=[],n=[],s=1;s<this.files.length;s++){var r=this.files[s];if("normalMap"!==r.type)for(var o=r.key.substr(4),a=r.data,h=0;h<t.data.textures.length;h++){var l=t.data.textures[h];if(l.image===o){i.push(a),e.push(l),r.linkFile&&n.push(r.linkFile.data);break}}}for(0===n.length&&(n=void 0),this.loader.textureManager.addAtlasJSONArray(this.key,i,e,n),this.complete=!0,s=0;s<this.files.length;s++)this.files[s].pendingDestroy()}}});s.register("multiatlas",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new u(this,t[o]),this.addFile(r.files);else r=new u(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=u},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n,s,o){void 0===n&&(n=512),void 0===s&&(s=512);var l="html";if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),o=a(u,"xhrSettings"),l=a(u,"extension",l),n=a(u,"width",n),s=a(u,"height",s)}var c={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:o,config:{width:n,height:s}};r.call(this,t,c)},onProcess:function(){this.state=s.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push('<svg width="'+t+'px" height="'+e+'px" viewBox="0 0 '+t+" "+e+'" xmlns="http://www.w3.org/2000/svg">'),i.push('<foreignObject width="100%" height="100%">'),i.push('<body xmlns="http://www.w3.org/1999/xhtml">'),i.push(this.xhrLoader.responseText),i.push("</body>"),i.push("</foreignObject>"),i.push("</svg>");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,i,n,s));return this}),t.exports=l},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n){var s="html";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"text",cache:t.cacheManager.html,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("html",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this}),t.exports=l},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n){var s="glsl";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"glsl",cache:t.cacheManager.shader,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("glsl",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this}),t.exports=l},function(t,e,i){var n=i(0),s=i(7),r=i(2),o=i(58),a=i(8),h=i(57),l=i(310),u=i(139),c=new n({Extends:h,initialize:function(t,e,i,n,s,l){var c,d;if(a(e)){var f=e;e=r(f,"key"),c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new u(t,{key:e,url:r(f,"fontDataURL"),extension:r(f,"fontDataExtension","xml"),xhrSettings:r(f,"fontDataXhrSettings")})}else c=new o(t,e,i,s),d=new u(t,e,n,l);c.linkFile?h.call(this,t,"bitmapfont",e,[c,d,c.linkFile]):h.call(this,t,"bitmapfont",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.loader.cacheManager.bitmapFont.add(t.key,{data:l(e.data),texture:t.key,frame:null}),this.complete=!0}}});s.register("bitmapFont",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new c(this,t[o]),this.addFile(r.files);else r=new c(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=c},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n,s){var o="bin";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),n=a(l,"xhrSettings"),o=a(l,"extension",o),s=a(l,"dataType",s)}var u={type:"binary",cache:t.cacheManager.binary,extension:o,responseType:"arraybuffer",key:e,url:i,xhrSettings:n,config:{dataType:s}};r.call(this,t,u)},onProcess:function(){this.state=s.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});o.register("binary",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,n,i));return this}),t.exports=l},function(t,e,i){var n=i(253),s=i(0),r=i(7),o=i(2),a=i(8),h=i(51),l=i(57),u=new s({Extends:l,initialize:function(t,e,i,s,r,u,c){if(a(e)){var d=e;e=o(d,"key"),i=o(d,"jsonURL"),s=o(d,"audioURL"),r=o(d,"audioConfig"),u=o(d,"audioXhrSettings"),c=o(d,"jsonXhrSettings")}var f;if(s){var p=n.create(t,e,s,r,u);p&&(f=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[p,f]),this.config.resourceLoad=!1)}else f=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[f]),this.config.resourceLoad=!0,this.config.audioConfig=r,this.config.audioXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=o(this.config,"audioConfig"),s=o(this.config,"audioXhrSettings"),r=n.create(this.loader,t.key,e,i,s);r&&(this.addToMultiFile(r),this.loader.addFile(r))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});r.register("audioSprite",function(t,e,i,n,s,r){var o,a=this.systems.game,h=a.config.audio,l=a.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var c=0;c<t.length;c++)(o=new u(this,t[c])).files&&this.addFile(o.files);else(o=new u(this,t,e,i,n,s,r)).files&&this.addFile(o.files);return this})},function(t,e,i){var n=i(0),s=i(7),r=i(2),o=i(58),a=i(8),h=i(57),l=i(139),u=new n({Extends:h,initialize:function(t,e,i,n,s,u){var c,d;if(a(e)){var f=e;e=r(f,"key"),c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new l(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","xml"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new o(t,e,i,s),d=new l(t,e,n,u);c.linkFile?h.call(this,t,"atlasxml",e,[c,d,c.linkFile]):h.call(this,t,"atlasxml",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});s.register("atlasXML",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new u(this,t[o]),this.addFile(r.files);else r=new u(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=u},function(t,e,i){var n=i(0),s=i(7),r=i(2),o=i(58),a=i(8),h=i(51),l=i(57),u=new n({Extends:l,initialize:function(t,e,i,n,s,u){var c,d;if(a(e)){var f=e;e=r(f,"key"),c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new h(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","json"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new o(t,e,i,s),d=new h(t,e,n,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});s.register("atlas",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new u(this,t[o]),this.addFile(r.files);else r=new u(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=u},function(t,e,i){var n=i(0),s=i(7),r=i(51),o=new n({Extends:r,initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.type="animationJSON"},onProcess:function(){this.loader.once("loadcomplete",this.onLoadComplete,this),r.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data),this.pendingDestroy()}});s.register("animation",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new o(this,t[s]));else this.addFile(new o(this,t,e,n,i));return this}),t.exports=o},function(t,e,i){t.exports={AnimationJSONFile:i(591),AtlasJSONFile:i(590),AtlasXMLFile:i(589),AudioFile:i(253),AudioSpriteFile:i(588),BinaryFile:i(587),BitmapFontFile:i(586),GLSLFile:i(585),HTML5AudioFile:i(252),HTMLFile:i(584),HTMLTextureFile:i(583),ImageFile:i(58),JSONFile:i(51),MultiAtlasFile:i(582),PackFile:i(581),PluginFile:i(580),ScenePluginFile:i(579),ScriptFile:i(578),SpriteSheetFile:i(577),SVGFile:i(576),TextFile:i(251),TilemapCSVFile:i(575),TilemapImpactFile:i(574),TilemapJSONFile:i(573),UnityAtlasFile:i(572),XMLFile:i(139)}},function(t,e,i){var n=i(18),s=i(20),r={FileTypes:i(592),File:i(21),FileTypesManager:i(7),GetURL:i(141),LoaderPlugin:i(571),MergeXHRSettings:i(140),MultiFile:i(57),XHRLoader:i(254),XHRSettings:i(105)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={TouchManager:i(333)}},function(t,e,i){t.exports={MouseManager:i(336)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=50),t.isUp&&t.duration<e}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=50),t.isDown&&t.duration<e}},function(t,e){t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},function(t,e){t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},function(t,e){t.exports=function(t,e){if(t.originalEvent=e,t.preventDefault&&e.preventDefault(),t.enabled)return t.isDown=!1,t.isUp=!0,t.timeUp=e.timeStamp,t.duration=t.timeUp-t.timeDown,t.repeats=0,t._justDown=!1,t._justUp=!0,t._tick=-1,t}},function(t,e){t.exports=function(t,e){if(t.originalEvent=e,t.preventDefault&&e.preventDefault(),t.enabled)return t.altKey=e.altKey,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.location=e.location,!1===t.isDown&&(t.isDown=!0,t.isUp=!1,t.timeDown=e.timeStamp,t.duration=0,t._justDown=!0,t._justUp=!1),t.repeats++,t}},function(t,e,i){var n=i(143),s={};for(var r in n)s[n[r]]=r;t.exports=s},function(t,e){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},function(t,e){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},function(t,e,i){var n=i(604);t.exports=function(t,e){if(e.matched)return!0;var i=!1,s=!1;if(t.keyCode===e.current)if(e.index>0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e,i){var n=i(0),s=i(11),r=i(4),o=i(106),a=i(256),h=i(143),l=i(255),u=i(602),c=i(601),d=i(600),f=i(142),p=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.keys=[],this.combos=[],this.queue=[],this.onKeyHandler,this.time=0,t.pluginEvents.once("boot",this.boot,this),t.pluginEvents.on("start",this.start,this)},boot:function(){var t=this.settings.input,e=this.scene.sys.game.config;this.enabled=r(t,"keyboard",e.inputKeyboard),this.target=r(t,"keyboard.target",e.inputKeyboardEventTarget),this.sceneInputPlugin.pluginEvents.once("destroy",this.destroy,this)},start:function(){this.enabled&&this.startListeners(),this.sceneInputPlugin.pluginEvents.once("shutdown",this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=function(e){if(!e.defaultPrevented&&t.isActive()){t.queue.push(e);var i=t.keys[e.keyCode];i&&i.preventDefault&&e.preventDefault()}};this.onKeyHandler=e,this.target.addEventListener("keydown",e,!1),this.target.addEventListener("keyup",e,!1),this.sceneInputPlugin.pluginEvents.on("update",this.update,this)},stopListeners:function(){this.target.removeEventListener("keydown",this.onKeyHandler),this.target.removeEventListener("keyup",this.onKeyHandler),this.sceneInputPlugin.pluginEvents.off("update",this.update)},createCursorKeys:function(){return this.addKeys({up:h.UP,down:h.DOWN,left:h.LEFT,right:h.RIGHT,space:h.SPACE,shift:h.SHIFT})},addKeys:function(t){var e={};if("string"==typeof t){t=t.split(",");for(var i=0;i<t.length;i++){var n=t[i].trim();n&&(e[n]=this.addKey(n))}}else for(var s in t)e[s]=this.addKey(t[s]);return e},addKey:function(t){var e=this.keys;if(t instanceof a){var i=e.indexOf(t);return i>-1?e[i]=t:e[t.keyCode]=t,t}return"string"==typeof t&&(t=h[t.toUpperCase()]),e[t]||(e[t]=new a(t)),e[t]},removeKey:function(t){var e=this.keys;if(t instanceof a){var i=e.indexOf(t);i>-1&&(this.keys[i]=void 0)}else"string"==typeof t&&(t=h[t.toUpperCase()]);e[t]&&(e[t]=void 0)},createCombo:function(t,e){return new l(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=f(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(t){this.time=t;var e=this.queue.length;if(this.enabled&&0!==e)for(var i=this.queue.splice(0,e),n=this.keys,s=0;s<e;s++){var r=i[s],o=r.keyCode;"keydown"===r.type?(!u[o]||void 0!==n[o]&&!1!==n[o].isDown||(this.emit(r.type,r),this.emit("keydown_"+u[o],r)),n[o]&&c(n[o],r)):(this.emit(r.type,r),this.emit("keyup_"+u[o],r),n[o]&&d(n[o],r))}},resetKeys:function(){for(var t=this.keys,e=0;e<t.length;e++)t[e]&&t[e].reset();return this},shutdown:function(){this.resetKeys(),this.stopListeners(),this.removeAllListeners(),this.queue=[]},destroy:function(){this.shutdown(),this.keys=[],this.combos=[],this.queue=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.target=null}});o.register("KeyboardPlugin",p,"keyboard","keyboard","inputKeyboard"),t.exports=p},function(t,e,i){t.exports={KeyboardPlugin:i(606),Key:i(256),KeyCodes:i(143),KeyCombo:i(255),JustDown:i(599),JustUp:i(598),DownDuration:i(597),UpDuration:i(596)}},function(t,e){t.exports=function(t,e){return function(i,n,s,r){var o=t.getPixelAlpha(n,s,r.texture.key,r.frame.name);return o&&o>=e}}},function(t,e,i){var n=i(71),s=i(40),r=i(0),o=i(260),a=i(608),h=i(52),l=i(90),u=i(89),c=i(11),d=i(2),f=i(106),p=i(8),g=i(15),v=i(9),y=i(39),m=i(59),x=i(69),w=new r({Extends:c,initialize:function(t){c.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new c,this.enabled=!0,this.displayList,this.cameras,f.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once("destroy",this.destroy,this),this.pluginEvents.emit("boot")},start:function(){var t=this.systems.events;t.on("transitionstart",this.transitionIn,this),t.on("transitionout",this.transitionOut,this),t.on("transitioncomplete",this.transitionComplete,this),t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this),this.enabled=!0,this.pluginEvents.emit("start")},preUpdate:function(){this.pluginEvents.emit("preUpdate");var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,n=e.length;if(0!==i||0!==n){for(var s=this._list,r=0;r<i;r++){var o=t[r],a=s.indexOf(o);a>-1&&(s.splice(a,1),this.clear(o))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},update:function(t,e){if(this.isActive()){this.pluginEvents.emit("update",t,e);var i=this.manager;if(!i.globalTopOnly||!i.ignoreEvents){var n=i.dirty||0===this.pollRate;if(this.pollRate>-1&&(this._pollTimer-=e,this._pollTimer<0&&(n=!0,this._pollTimer=this.pollRate)),n)for(var s=this.manager.pointers,r=0;r<this.manager.pointersTotal;r++){var o=s[r];this._tempZones=[],this._temp=this.hitTestPointer(o),this.sortGameObjects(this._temp),this.sortGameObjects(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1));var a=this.processDragEvents(o,t);o.wasTouch||(a+=this.processOverOutEvents(o)),o.justDown&&(a+=this.processDownEvents(o)),o.justUp&&(a+=this.processUpEvents(o)),o.justMoved&&(a+=this.processMoveEvents(o)),a>0&&i.globalTopOnly&&(i.ignoreEvents=!0)}}}},clear:function(t){var e=t.input;if(e){this.queueForRemoval(t),e.gameObject=void 0,e.target=void 0,e.hitArea=void 0,e.hitAreaCallback=void 0,e.callbackContext=void 0,this.manager.resetCursor(e),t.input=null;var i=this._draggable.indexOf(t);return i>-1&&this._draggable.splice(i,1),(i=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(i,1),(i=this._over[0].indexOf(t))>-1&&this._over[0].splice(i,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i<e.length;i++){for(var n=e[i],s=this.manager.hitTest(t,this._list,n),r=0;r<s.length;r++){var o=s[r];o.input.dropZone&&this._tempZones.push(o)}if(s.length>0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o<i.length;o++){var a=i[o];if(a.input){if(e++,a.emit("pointerdown",t,a.input.localX,a.input.localY,s),n.cancelled){r=!0;break}if(this.emit("gameobjectdown",t,a,s),n.cancelled){r=!0;break}}}return r||this.emit("pointerdown",t,i),e},processDragEvents:function(t,e){if(0===this._draggable.length)return 0;var i,n,s,r,o=this._temp;if(0===t.dragState&&t.primaryDown&&t.justDown&&o.length>0?t.dragState=1:t.dragState>0&&!t.primaryDown&&t.justUp&&(t.dragState=5),1===t.dragState){var a=[];for(i=0;i<o.length;i++)(n=o[i]).input.draggable&&0===n.input.dragState&&a.push(n);if(0===a.length)return t.dragState=0,0;a.length>1&&(this.sortGameObjects(a),this.topOnly&&a.splice(1)),this._drag[t.id]=a,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?t.dragState=3:t.dragState=2}if(2===t.dragState&&(this.dragDistanceThreshold>0&&h(t.x,t.y,t.downX,t.downY)>=this.dragDistanceThreshold&&(t.dragState=3),this.dragTimeThreshold>0&&e>=t.downTime+this.dragTimeThreshold&&(t.dragState=3)),3===t.dragState){for(s=this._drag[t.id],i=0;i<s.length;i++)(r=(n=s[i]).input).dragState=2,r.dragX=t.x-n.x,r.dragY=t.y-n.y,r.dragStartX=n.x,r.dragStartY=n.y,n.emit("dragstart",t,r.dragX,r.dragY),this.emit("dragstart",t,n);return t.dragState=4,s.length}if(4===t.dragState&&t.justMoved&&!t.justUp){var l=this._tempZones;for(s=this._drag[t.id],i=0;i<s.length;i++){if((r=(n=s[i]).input).target){var u=l.indexOf(r.target);0===u?(n.emit("dragover",t,r.target),this.emit("dragover",t,n,r.target)):u>0?(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),l[0]?(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):r.target=null)}else!r.target&&l[0]&&(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target));var c=t.x-n.input.dragX,d=t.y-n.input.dragY;n.emit("drag",t,c,d),this.emit("drag",t,n,c,d)}return s.length}if(5===t.dragState){for(s=this._drag[t.id],i=0;i<s.length;i++)if(2===(r=(n=s[i]).input).dragState){r.dragState=0,r.dragX=r.localX-n.displayOriginX,r.dragY=r.localY-n.displayOriginY;var f=!1;r.target&&(n.emit("drop",t,r.target),this.emit("drop",t,n,r.target),r.target=null,f=!0),n.emit("dragend",t,r.dragX,r.dragY,f),this.emit("dragend",t,n,f)}t.dragState=0,s.splice(0)}return 0},processMoveEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o<i.length;o++){var a=i[o];if(a.input){if(e++,a.emit("pointermove",t,a.input.localX,a.input.localY,s),n.cancelled){r=!0;break}if(this.emit("gameobjectmove",t,a,s),n.cancelled){r=!0;break}if(this.topOnly)break}}return r||this.emit("pointermove",t,i),e},processOverOutEvents:function(t){var e,i,n=this._temp,s=[],r=[],o=[],a=this._over[t.id],h=this._drag[t.id],l=this.manager;for(e=0;e<a.length;e++)i=a[e],-1===n.indexOf(i)&&-1===h.indexOf(i)?s.push(i):o.push(i);for(e=0;e<n.length;e++)i=n[e],-1===a.indexOf(i)&&r.push(i);var u=s.length,c=0,d=this._eventData,f=this._eventContainer;d.cancelled=!1;var p=!1;if(u>0){for(this.sortGameObjects(s),e=0;e<u;e++)if((i=s[e]).input){if(i.emit("pointerout",t,f),l.resetCursor(i.input),c++,d.cancelled){p=!0;break}if(this.emit("gameobjectout",t,i,f),d.cancelled){p=!0;break}}p||this.emit("pointerout",t,s)}if(u=r.length,d.cancelled=!1,p=!1,u>0){for(this.sortGameObjects(r),e=0;e<u;e++)if((i=r[e]).input){if(i.emit("pointerover",t,i.input.localX,i.input.localY,f),l.setCursor(i.input),c++,d.cancelled){p=!0;break}if(this.emit("gameobjectover",t,i,f),d.cancelled){p=!0;break}}p||this.emit("pointerover",t,r)}return a=o.concat(r),this._over[t.id]=this.sortGameObjects(a),c},processUpEvents:function(t){var e=this._temp,i=this._eventData,n=this._eventContainer;i.cancelled=!1;for(var s=!1,r=0;r<e.length;r++){var o=e[r];if(o.input){if(o.emit("pointerup",t,o.input.localX,o.input.localY,n),i.cancelled){s=!0;break}if(this.emit("gameobjectup",t,o,n),i.cancelled){s=!0;break}}}return s||this.emit("pointerup",t,e),e.length},queueForInsertion:function(t){return-1===this._pendingInsertion.indexOf(t)&&-1===this._list.indexOf(t)&&this._pendingInsertion.push(t),this},queueForRemoval:function(t){return this._pendingRemoval.push(t),this},setDraggable:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];n.input.draggable=e;var s=this._draggable.indexOf(n);e&&-1===s?this._draggable.push(n):!e&&s>-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return a(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,a=!1;if(p(e)){var h=e;e=d(h,"hitArea",null),i=d(h,"hitAreaCallback",null),n=d(h,"draggable",!1),s=d(h,"dropZone",!1),r=d(h,"cursor",!1),a=d(h,"useHandCursor",!1);var l=d(h,"pixelPerfect",!1),u=d(h,"alphaTolerance",1);l&&(e={},i=this.makePixelPerfect(u)),e&&i||this.setHitAreaFromTexture(t)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c<t.length;c++){var f=t[c],g=f.input?f.input:o(f,e,i);g.dropZone=s,g.cursor=a?"pointer":r,f.input=g,n&&this.setDraggable(f),this.queueForInsertion(f)}return this},setHitAreaCircle:function(t,e,i,r,o){void 0===o&&(o=s);var a=new n(e,i,r);return this.setHitArea(t,a,o)},setHitAreaEllipse:function(t,e,i,n,s,r){void 0===r&&(r=u);var o=new l(e,i,n,s);return this.setHitArea(t,o,r)},setHitAreaFromTexture:function(t,e){void 0===e&&(e=y),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i],s=n.frame,r=0,a=0;s?(r=s.realWidth,a=s.realHeight):n.width&&(r=n.width,a=n.height),"Container"!==n.type||0!==r&&0!==a?0!==r&&0!==a&&(n.input=o(n,new v(0,0,r,a),e),this.queueForInsertion(n)):console.warn("Container.setInteractive() must specify a Shape or call setSize() first")}return this},setHitAreaRectangle:function(t,e,i,n,s,r){void 0===r&&(r=y);var o=new v(e,i,n,s);return this.setHitArea(t,o,r)},setHitAreaTriangle:function(t,e,i,n,s,r,o,a){void 0===a&&(a=x);var h=new m(e,i,n,s,r,o);return this.setHitArea(t,h,a)},setPollAlways:function(){return this.pollRate=0,this._pollTimer=0,this},setPollOnMove:function(){return this.pollRate=-1,this._pollTimer=0,this},setPollRate:function(t){return this.pollRate=t,this._pollTimer=0,this},setGlobalTopOnly:function(t){return this.manager.globalTopOnly=t,this},setTopOnly:function(t){return this.topOnly=t,this},sortGameObjects:function(t){return t.length<2?t:(this.scene.sys.depthSort(),t.sort(this.sortHandlerGO.bind(this)))},sortHandlerGO:function(t,e){if(!t.parentContainer&&!e.parentContainer)return this.displayList.getIndex(e)-this.displayList.getIndex(t);if(t.parentContainer===e.parentContainer)return e.parentContainer.getIndex(e)-t.parentContainer.getIndex(t);if(t.parentContainer===e)return-1;if(e.parentContainer===t)return 1;for(var i=t.getIndexList(),n=e.getIndexList(),s=Math.min(i.length,n.length),r=0;r<s;r++){var o=i[r],a=n[r];if(o!==a)return a-o}return 0},stopPropagation:function(){return this.manager.globalTopOnly&&(this.manager.ignoreEvents=!0),this},addUpCallback:function(t,e){return this.manager.addUpCallback(t,e),this},addDownCallback:function(t,e){return this.manager.addDownCallback(t,e),this},addMoveCallback:function(t,e){return this.manager.addMoveCallback(t,e),this},addPointer:function(t){return this.manager.addPointer(t)},setDefaultCursor:function(t){return this.manager.setDefaultCursor(t),this},transitionIn:function(){this.enabled=this.settings.transitionAllowInput},transitionComplete:function(){this.settings.transitionAllowInput||(this.enabled=!0)},transitionOut:function(){this.enabled=this.settings.transitionAllowInput},shutdown:function(){this.pluginEvents.emit("shutdown"),this._temp.length=0,this._list.length=0,this._draggable.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;for(var t=0;t<10;t++)this._drag[t]=[],this._over[t]=[];this.removeAllListeners();var e=this.systems.events;e.off("transitionstart",this.transitionIn,this),e.off("transitionout",this.transitionOut,this),e.off("transitioncomplete",this.transitionComplete,this),e.off("preupdate",this.preUpdate,this),e.off("update",this.update,this),e.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.pluginEvents.emit("destroy"),this.pluginEvents.removeAllListeners(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.cameras=null,this.manager=null,this.events=null,this.mouse=null},x:{get:function(){return this.manager.activePointer.x}},y:{get:function(){return this.manager.activePointer.y}},mousePointer:{get:function(){return this.manager.mousePointer}},activePointer:{get:function(){return this.manager.activePointer}},pointer1:{get:function(){return this.manager.pointers[1]}},pointer2:{get:function(){return this.manager.pointers[2]}},pointer3:{get:function(){return this.manager.pointers[3]}},pointer4:{get:function(){return this.manager.pointers[4]}},pointer5:{get:function(){return this.manager.pointers[5]}},pointer6:{get:function(){return this.manager.pointers[6]}},pointer7:{get:function(){return this.manager.pointers[7]}},pointer8:{get:function(){return this.manager.pointers[8]}},pointer9:{get:function(){return this.manager.pointers[9]}},pointer10:{get:function(){return this.manager.pointers[10]}}});g.register("InputPlugin",w,"input"),t.exports=w},function(t,e){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},function(t,e){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},function(t,e){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},function(t,e,i){t.exports={DUALSHOCK_4:i(612),SNES_USB:i(611),XBOX_360:i(610)}},function(t,e,i){var n=i(0),s=i(11),r=i(257),o=i(4),a=i(106),h=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once("boot",this.boot,this),t.pluginEvents.on("start",this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=o(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=o(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once("destroy",this.destroy,this)},start:function(){this.enabled&&this.startListeners(),this.sceneInputPlugin.pluginEvents.once("shutdown",this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=this.target,i=function(e){!e.defaultPrevented&&t.isActive()&&(t.refreshPads(),t.queue.push(e))};this.onGamepadHandler=i,e.addEventListener("gamepadconnected",i,!1),e.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on("update",this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off("update",this.update)},disconnectAll:function(){for(var t=0;t<this.gamepads.length;t++)this.gamepads.connected=!1},refreshPads:function(){var t=navigator.getGamepads();if(t)for(var e=this.gamepads,i=0;i<t.length;i++){var n=t[i];if(n){var s=n.id,o=n.index,a=e[o];if(a)a.id!==s?(a.destroy(),e[o]=new r(this,n)):a.update(n);else{var h=new r(this,n);e[o]=h,this._pad1?this._pad2?this._pad3?this._pad4||(this._pad4=h):this._pad3=h:this._pad2=h:this._pad1=h}}}else this.disconnectAll()},getAll:function(){for(var t=[],e=this.gamepads,i=0;i<e.length;i++)e[i]&&t.push(e[i]);return t},getPad:function(t){for(var e=this.gamepads,i=0;i<e.length;i++)if(e[i]&&e[i].index===t)return e[i]},update:function(){if(this.enabled){this.refreshPads();var t=this.queue.length;if(0!==t)for(var e=this.queue.splice(0,t),i=0;i<t;i++){var n=e[i],s=this.getPad(n.gamepad.index);"gamepadconnected"===n.type?this.emit("connected",s,n):"gamepaddisconnected"===n.type&&this.emit("disconnected",s,n)}}},shutdown:function(){this.stopListeners(),this.disconnectAll(),this.removeAllListeners()},destroy:function(){this.shutdown();for(var t=0;t<this.gamepads.length;t++)this.gamepads[t]&&this.gamepads[t].destroy();this.gamepads=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.target=null},total:{get:function(){return this.gamepads.length}},pad1:{get:function(){return this._pad1}},pad2:{get:function(){return this._pad2}},pad3:{get:function(){return this._pad3}},pad4:{get:function(){return this._pad4}}});a.register("GamepadPlugin",h,"gamepad","gamepad","inputGamepad"),t.exports=h},function(t,e,i){t.exports={Axis:i(259),Button:i(258),Gamepad:i(257),GamepadPlugin:i(614),Configs:i(613)}},function(t,e,i){var n=i(337),s=i(20),r={CreateInteractiveObject:i(260),Gamepad:i(615),InputManager:i(338),InputPlugin:i(609),InputPluginCache:i(106),Keyboard:i(607),Mouse:i(595),Pointer:i(335),Touch:i(594)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(144);t.exports=function(t,e,i){return n(t,e.x,e.y,i)}},function(t,e,i){var n=i(144),s=i(261);t.exports=function(t,e){var i=s(t);return n(t,i.x,i.y,e)}},function(t,e,i){var n=i(65);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),s=t.getLineC();return n(e)+n(i)+n(s)}},function(t,e){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},function(t,e){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},function(t,e,i){var n=i(69);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(59);t.exports=function(t){return new n(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},function(t,e,i){var n=i(71);t.exports=function(t,e){void 0===e&&(e=new n);var i,s,r=t.x1,o=t.y1,a=t.x2,h=t.y2,l=t.x3,u=t.y3,c=a-r,d=h-o,f=l-r,p=u-o,g=c*(r+a)+d*(o+h),v=f*(r+l)+p*(o+u),y=2*(c*(u-h)-d*(l-a));if(Math.abs(y)<1e-6){var m=Math.min(r,a,l),x=Math.min(o,h,u);i=.5*(Math.max(r,a,l)-m),s=.5*(Math.max(o,h,u)-x),e.x=m+i,e.y=x+s,e.radius=Math.sqrt(i*i+s*s)}else e.x=(p*g-d*v)/y,e.y=(c*v-f*g)/y,i=e.x-r,s=e.y-o,e.radius=Math.sqrt(i*i+s*s);return e}},function(t,e,i){var n=i(3);function s(t,e,i,n){return t*n-e*i}t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x3,r=t.y3,o=t.x1-i,a=t.y1-r,h=t.x2-i,l=t.y2-r,u=2*s(o,a,h,l),c=s(a,o*o+a*a,l,h*h+l*l),d=s(o,o*o+a*a,h,h*h+l*l);return e.x=i-c/u,e.y=r+d/u,e}},function(t,e,i){var n=i(263),s=i(262);t.exports=function(t,e,i,r){void 0===r&&(r=n);var o=r(t),a=e-o.x,h=i-o.y;return s(t,a,h)}},function(t,e,i){var n=i(59);t.exports=function(t,e,i,s){return void 0===s&&(s=i),new n(t,e,t,e-s,t+i,e)}},function(t,e,i){var n=i(64),s=i(59);t.exports=function(t,e,i,r,o){void 0===e&&(e=null),void 0===i&&(i=1),void 0===r&&(r=1),void 0===o&&(o=[]);for(var a,h,l,u,c,d,f,p,g,v=n(t,e),y=0;y<v.length;y+=3)a=v[y],h=v[y+1],l=v[y+2],u=t[2*a]*i,c=t[2*a+1]*r,d=t[2*h]*i,f=t[2*h+1]*r,p=t[2*l]*i,g=t[2*l+1]*r,o.push(new s(u,c,d,f,p,g));return o}},function(t,e,i){var n=i(59);t.exports=function(t,e,i){var s=i*(Math.sqrt(3)/2);return new n(t,e,t+i/2,e+s,t-i/2,e+s)}},function(t,e){t.exports=function(t){var e=t.x1,i=t.y1,n=t.x2,s=t.y2,r=t.x3,o=t.y3;return Math.abs(((r-e)*(s-i)-(n-e)*(o-i))/2)}},function(t,e,i){var n=i(59);n.Area=i(630),n.BuildEquilateral=i(629),n.BuildFromPolygon=i(628),n.BuildRight=i(627),n.CenterOn=i(626),n.Centroid=i(263),n.CircumCenter=i(625),n.CircumCircle=i(624),n.Clone=i(623),n.Contains=i(69),n.ContainsArray=i(147),n.ContainsPoint=i(622),n.CopyFrom=i(621),n.Decompose=i(269),n.Equals=i(620),n.GetPoint=i(278),n.GetPoints=i(277),n.InCenter=i(261),n.Perimeter=i(619),n.Offset=i(262),n.Random=i(184),n.Rotate=i(618),n.RotateAroundPoint=i(617),n.RotateAroundXY=i(144),t.exports=n},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},function(t,e){t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},function(t,e,i){var n=i(170),s=i(264),r=i(6);t.exports=function(t,e,i){if(void 0===i&&(i=new r),s(t,e))switch(n(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},function(t,e,i){var n=i(6),s=i(31);t.exports=function(t,e,i){void 0===i&&(i=new n),e=s(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)<Math.abs(h*o)?h=a*r/o:a=h*o/r,i.x=a+t.centerX,i.y=h+t.centerY,i}},function(t,e){t.exports=function(t,e){return t.x<e.right&&t.right>e.x&&t.y<e.bottom&&t.bottom>e.y}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e,i){var n=Math.min(t.x,e),s=Math.max(t.right,e);t.x=n,t.width=s-n;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},function(t,e){t.exports=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.right,e.right);t.x=i,t.width=n-i;var s=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=s,t.height=r-s,t}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;o<e.length;o++)i=Math.min(i,e[o].x),n=Math.max(n,e[o].x),s=Math.min(s,e[o].y),r=Math.max(r,e[o].y);return t.x=i,t.y=s,t.width=n-i,t.height=r-s,t}},function(t,e,i){var n=i(9),s=i(148);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e,i){var n=i(175);t.exports=function(t,e,i){var s=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),n(t,s,r)}},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e,i){var n=i(145);t.exports=function(t,e){var i=n(t);return i>n(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e,i){var n=i(145);t.exports=function(t,e){var i=n(t);return i<n(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(39);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(9);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},function(t,e){t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},function(t,e){t.exports=function(t){return t.width*t.height}},function(t,e){t.exports=function(t){return t.points.reverse(),t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i<t.points.length;i++)e.push(t.points[i].x),e.push(t.points[i].y);return e}},function(t,e,i){var n=i(150);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(151);t.exports=function(t){return new n(t.points)}},function(t,e,i){var n=i(151);n.Clone=i(660),n.Contains=i(150),n.ContainsPoint=i(659),n.GetAABB=i(285),n.GetNumberArray=i(658),n.GetPoints=i(284),n.Perimeter=i(283),n.Reverse=i(657),n.Smooth=i(282),t.exports=n},function(t,e,i){var n=i(267);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=n(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.x*e.x+t.y*e.y;return 0!==s&&(i.x=s*e.x,i.y=s*e.y),i}},function(t,e,i){var n=i(6),s=i(266);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=(t.x*e.x+t.y*e.y)/s(e);return 0!==r&&(i.x=r*e.x,i.y=r*e.y),i}},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.setTo(-t.x,-t.y)}},function(t,e){t.exports=function(t){return t.setTo(t.y,t.x)}},function(t,e,i){var n=i(6);t.exports=function(t,e,i,s){return void 0===i&&(i=0),void 0===s&&(s=new n),s.x=t.x+(e.x-t.x)*i,s.y=t.y+(e.y-t.y)*i,s}},function(t,e,i){var n=i(9);t.exports=function(t,e){void 0===e&&(e=new n);for(var i=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=0;a<t.length;a++){var h=t[a];h.x>i&&(i=h.x),h.x<s&&(s=h.x),h.y>r&&(r=h.y),h.y<o&&(o=h.y)}return e.x=s,e.y=o,e.width=i-s,e.height=r-o,e}},function(t,e,i){var n=i(6);t.exports=function(t,e){if(void 0===e&&(e=new n),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var s=0;s<i;s++)e.x+=t[s].x,e.y+=t[s].y;e.x/=i,e.y/=i}return e}},function(t,e){t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y)}},function(t,e,i){var n=i(6);t.exports=function(t){return new n(t.x,t.y)}},function(t,e){t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},function(t,e,i){var n=i(6);n.Ceil=i(674),n.Clone=i(673),n.CopyFrom=i(672),n.Equals=i(671),n.Floor=i(670),n.GetCentroid=i(669),n.GetMagnitude=i(267),n.GetMagnitudeSq=i(266),n.GetRectangleFromPoints=i(668),n.Interpolate=i(667),n.Invert=i(666),n.Negative=i(665),n.Project=i(664),n.ProjectUnit=i(663),n.SetMagnitude=i(662),t.exports=n},function(t,e){t.exports=function(t){return Math.abs(t.x1-t.x2)}},function(t,e){t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},function(t,e){t.exports=function(t,e,i,n,s){return t.x1=e,t.y1=i,t.x2=e+Math.cos(n)*s,t.y2=i+Math.sin(n)*s,t}},function(t,e,i){var n=i(146);t.exports=function(t,e,i){return n(t,e.x,e.y,i)}},function(t,e,i){var n=i(146);t.exports=function(t,e){var i=(t.x1+t.x2)/2,s=(t.y1+t.y2)/2;return n(t,i,s,e)}},function(t,e,i){var n=i(68),s=i(268);t.exports=function(t,e){return 2*s(e)-Math.PI-n(t)}},function(t,e){t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},function(t,e){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},function(t,e,i){var n=i(16),s=i(68);t.exports=function(t){return Math.sin(s(t)-n.TAU)}},function(t,e,i){var n=i(16),s=i(68);t.exports=function(t){return Math.cos(s(t)-n.TAU)}},function(t,e){t.exports=function(t){return Math.abs(t.y1-t.y2)}},function(t,e,i){var n=i(16),s=i(68),r=i(6);t.exports=function(t,e){void 0===e&&(e=new r);var i=s(t)-n.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},function(t,e){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},function(t,e){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},function(t,e,i){var n=i(54);t.exports=function(t){return new n(t.x1,t.y1,t.x2,t.y2)}},function(t,e){t.exports=function(t,e,i){var n=e-(t.x1+t.x2)/2,s=i-(t.y1+t.y2)/2;return t.x1+=n,t.y1+=s,t.x2+=n,t.y2+=s,t}},function(t,e,i){var n=i(54);n.Angle=i(68),n.BresenhamPoints=i(385),n.CenterOn=i(692),n.Clone=i(691),n.CopyFrom=i(690),n.Equals=i(689),n.GetMidPoint=i(688),n.GetNormal=i(687),n.GetPoint=i(397),n.GetPoints=i(189),n.Height=i(686),n.Length=i(65),n.NormalAngle=i(268),n.NormalX=i(685),n.NormalY=i(684),n.Offset=i(683),n.PerpSlope=i(682),n.Random=i(188),n.ReflectAngle=i(681),n.Rotate=i(680),n.RotateAroundPoint=i(679),n.RotateAroundXY=i(146),n.SetToAngle=i(678),n.Slope=i(677),n.Width=i(676),t.exports=n},function(t,e,i){var n=i(147),s=i(269),r=i(107);t.exports=function(t,e){if(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)return!1;var i=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=e.getLineA(),l=e.getLineB(),u=e.getLineC();if(r(i,h)||r(i,l)||r(i,u))return!0;if(r(o,h)||r(o,l)||r(o,u))return!0;if(r(a,h)||r(a,l)||r(a,u))return!0;var c=s(t),d=n(e,c,!0);return d.length>0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e,i){var n=i(69),s=i(107);t.exports=function(t,e){return!!(n(t,e.getPointA())||n(t,e.getPointB())||s(t.getLineA(),e)||s(t.getLineB(),e)||s(t.getLineC(),e))}},function(t,e,i){var n=i(272),s=i(69);t.exports=function(t,e){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top||!s(t,e.x,e.y)&&!n(t.getLineA(),e)&&!n(t.getLineB(),e)&&!n(t.getLineC(),e))}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||i<t.left-r||n>t.bottom+r||s<t.top-r)}},function(t,e,i){var n=i(107),s=i(39),r=i(147),o=i(270);t.exports=function(t,e){if(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)return!1;var i=e.getLineA(),a=e.getLineB(),h=e.getLineC();if(s(t,i.x1,i.y1)||s(t,i.x2,i.y2))return!0;if(s(t,a.x1,a.y1)||s(t,a.x2,a.y2))return!0;if(s(t,h.x1,h.y1)||s(t,h.x2,h.y2))return!0;var l=t.getLineA(),u=t.getLineB(),c=t.getLineC(),d=t.getLineD();if(n(i,l)||n(i,u)||n(i,c)||n(i,d))return!0;if(n(a,l)||n(a,u)||n(a,c)||n(a,d))return!0;if(n(h,l)||n(h,u)||n(h,c)||n(h,d))return!0;var f=o(t);return r(e,f,!0).length>0}},function(t,e,i){var n=i(271);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i<o&&s>=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n<a&&r>=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(9),s=i(148);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e,i){var n=i(52);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(9);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(89);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(89);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(90);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(90);n.Area=i(712),n.Circumference=i(306),n.CircumferencePoint=i(156),n.Clone=i(711),n.Contains=i(89),n.ContainsPoint=i(710),n.ContainsRect=i(709),n.CopyFrom=i(708),n.Equals=i(707),n.GetBounds=i(706),n.GetPoint=i(308),n.GetPoints=i(307),n.Offset=i(705),n.OffsetPoint=i(704),n.Random=i(185),t.exports=n},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(9);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e,i){var n=i(40);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(40);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(71);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(71);n.Area=i(722),n.Circumference=i(402),n.CircumferencePoint=i(192),n.Clone=i(721),n.Contains=i(40),n.ContainsPoint=i(720),n.ContainsRect=i(719),n.CopyFrom=i(718),n.Equals=i(717),n.GetBounds=i(716),n.GetPoint=i(405),n.GetPoints=i(403),n.Offset=i(715),n.OffsetPoint=i(714),n.Random=i(191),t.exports=n},function(t,e,i){var n=i(0),s=i(275),r=i(15),o=new n({Extends:s,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once("boot",this.boot,this),s.call(this)},boot:function(){var t=this.systems.events;t.on("shutdown",this.shutdown,this),t.on("destroy",this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",o,"lights"),t.exports=o},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(149);s.register("quad",function(t,e){void 0===t&&(t={});var i=r(t,"x",0),s=r(t,"y",0),a=r(t,"key",null),h=r(t,"frame",null),l=new o(this.scene,i,s,a,h);return void 0!==e&&(t.add=e),n(this.scene,l,t),l})},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(4),a=i(108);s.register("mesh",function(t,e){void 0===t&&(t={});var i=r(t,"key",null),s=r(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"colors",[]),u=o(t,"alphas",[]),c=o(t,"uv",[]),d=new a(this.scene,0,0,h,c,l,u,i,s);return void 0!==e&&(t.add=e),n(this.scene,d,t),d})},function(t,e,i){var n=i(149);i(5).register("quad",function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))})},function(t,e,i){var n=i(108);i(5).register("mesh",function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))})},function(t,e){t.exports=function(){}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=this.pipeline;t.setPipeline(o,e);var a=o._tempMatrix1,h=o._tempMatrix2,l=o._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(s.matrix),r?(a.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l)):(h.e-=s.scrollX*e.scrollFactorX,h.f-=s.scrollY*e.scrollFactorY,a.multiply(h,l));var u=e.frame.glTexture,c=e.vertices,d=e.uv,f=e.colors,p=e.alphas,g=c.length,v=Math.floor(.5*g);o.vertexCount+v>=o.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var y=o.vertexViewF32,m=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,w=0,b=e.tintFill,T=0;T<g;T+=2){var S=c[T+0],_=c[T+1],A=S*l.a+_*l.c+l.e,C=S*l.b+_*l.d+l.f;s.roundPixels&&(A|=0,C|=0),y[++x]=A,y[++x]=C,y[++x]=d[T+0],y[++x]=d[T+1],y[++x]=b,m[++x]=n.getTintAppendFloatAlpha(f[w],s.alpha*p[w]),w++}o.vertexCount+=v}},function(t,e,i){var n=i(1),s=i(1);n=i(730),s=i(729),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(13),s=i(12),r=i(125);n.register("zone",function(t){var e=s(t,"x",0),i=s(t,"y",0),n=s(t,"width",1),o=s(t,"height",n);return new r(this.scene,e,i,n,o)})},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(152);s.register("tileSprite",function(t,e){void 0===t&&(t={});var i=r(t,"x",0),s=r(t,"y",0),a=r(t,"width",512),h=r(t,"height",512),l=r(t,"key",""),u=r(t,"frame",""),c=new o(this.scene,i,s,a,h,l,u);return void 0!==e&&(t.add=e),n(this.scene,c,t),c})},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(153);s.register("text",function(t,e){void 0===t&&(t={});var i=r(t,"text",""),s=r(t,"style",null),a=r(t,"padding",null);null!==a&&(s.padding=a);var h=new o(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),n(this.scene,h,t),h.autoRound=r(t,"autoRound",!0),h.resolution=r(t,"resolution",1),h})},function(t,e,i){var n=i(109),s=i(28),r=i(13),o=i(12),a=i(4);r.register("bitmapText",function(t,e){void 0===t&&(t={});var i=a(t,"font",""),r=o(t,"text",""),h=o(t,"size",!1),l=a(t,"align",0),u=new n(this.scene,0,0,i,r,h,l);return void 0!==e&&(t.add=e),s(this.scene,u,t),u})},function(t,e,i){var n=i(28),s=i(311),r=i(13),o=i(12),a=i(61);r.register("sprite",function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),h=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),n(this.scene,h,t),s(h,t),h})},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(154);s.register("renderTexture",function(t,e){void 0===t&&(t={});var i=r(t,"x",0),s=r(t,"y",0),a=r(t,"width",32),h=r(t,"height",32),l=new o(this.scene,i,s,a,h);return void 0!==e&&(t.add=e),n(this.scene,l,t),l})},function(t,e,i){var n=i(13),s=i(12),r=i(2),o=i(155);n.register("particles",function(t,e){void 0===t&&(t={});var i=s(t,"key",null),n=s(t,"frame",null),a=r(t,"emitters",null),h=new o(this.scene,i,n,a);return void 0!==e&&(t.add=e),r(t,"add",!1)&&this.displayList.add(h),this.updateList.add(h),h})},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(87);s.register("image",function(t,e){void 0===t&&(t={});var i=r(t,"key",null),s=r(t,"frame",null),a=new o(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),n(this.scene,a,t),a})},function(t,e,i){var n=i(13),s=i(88);n.register("group",function(t){return new s(this.scene,null,t)})},function(t,e,i){var n=i(13),s=i(158);n.register("graphics",function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new s(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i})},function(t,e,i){var n=i(159),s=i(28),r=i(13),o=i(12);r.register("dynamicBitmapText",function(t,e){void 0===t&&(t={});var i=o(t,"font",""),r=o(t,"text",""),a=o(t,"size",!1),h=new n(this.scene,0,0,i,r,a);return void 0!==e&&(t.add=e),s(this.scene,h,t),h})},function(t,e,i){var n=i(28),s=i(160),r=i(13),o=i(12);r.register("container",function(t,e){void 0===t&&(t={});var i=o(t,"x",0),r=o(t,"y",0),a=new s(this.scene,i,r);return void 0!==e&&(t.add=e),n(this.scene,a,t),a})},function(t,e,i){var n=i(161),s=i(28),r=i(13),o=i(12);r.register("blitter",function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),a=new n(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,a,t),a})},function(t,e,i){var n=i(5),s=i(279);n.register("triangle",function(t,e,i,n,r,o,a,h,l,u){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h,l,u))})},function(t,e,i){var n=i(280);i(5).register("star",function(t,e,i,s,r,o,a){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a))})},function(t,e,i){var n=i(5),s=i(281);n.register("rectangle",function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))})},function(t,e,i){var n=i(5),s=i(286);n.register("polygon",function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,n,r))})},function(t,e,i){var n=i(5),s=i(287);n.register("line",function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))})},function(t,e,i){var n=i(5),s=i(288);n.register("isotriangle",function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))})},function(t,e,i){var n=i(5),s=i(289);n.register("isobox",function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))})},function(t,e,i){var n=i(5),s=i(290);n.register("grid",function(t,e,i,n,r,o,a,h,l,u){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h,l,u))})},function(t,e,i){var n=i(291);i(5).register("ellipse",function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))})},function(t,e,i){var n=i(5),s=i(292);n.register("curve",function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,n,r))})},function(t,e,i){var n=i(293),s=i(5);s.register("arc",function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))}),s.register("circle",function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,0,360,!1,s,r))})},function(t,e,i){var n=i(125);i(5).register("zone",function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))})},function(t,e,i){var n=i(152);i(5).register("tileSprite",function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))})},function(t,e,i){var n=i(153);i(5).register("text",function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))})},function(t,e,i){var n=i(109);i(5).register("bitmapText",function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))})},function(t,e,i){var n=i(5),s=i(61);n.register("sprite",function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.displayList.add(r),this.updateList.add(r),r})},function(t,e,i){var n=i(5),s=i(154);n.register("renderTexture",function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))})},function(t,e,i){var n=i(5),s=i(296);n.register("follower",function(t,e,i,n,r){var o=new s(this.scene,t,e,i,n,r);return this.displayList.add(o),this.updateList.add(o),o})},function(t,e,i){var n=i(5),s=i(155);n.register("particles",function(t,e,i){var n=new s(this.scene,t,e,i);return this.displayList.add(n),this.updateList.add(n),n})},function(t,e,i){var n=i(87);i(5).register("image",function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))})},function(t,e,i){var n=i(88);i(5).register("group",function(t,e){return this.updateList.add(new n(this.scene,t,e))})},function(t,e,i){var n=i(158);i(5).register("graphics",function(t){return this.displayList.add(new n(this.scene,t))})},function(t,e,i){var n=i(159);i(5).register("dynamicBitmapText",function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))})},function(t,e,i){var n=i(160);i(5).register("container",function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))})},function(t,e,i){var n=i(161);i(5).register("blitter",function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))})},function(t,e,i){var n=i(30),s=i(36),r=i(22);t.exports=function(t,e,i,o,a){var h=t.currentContext;if(r(t,h,e,o,a)){var l=e._displayOriginX,u=e._displayOriginY,c=e.geom.x1-l,d=e.geom.y1-u,f=e.geom.x2-l,p=e.geom.y2-u,g=e.geom.x3-l,v=e.geom.y3-u;h.beginPath(),h.moveTo(c,d),h.lineTo(f,p),h.lineTo(g,v),h.closePath(),e.isFilled&&(n(h,e),h.fill()),e.isStroked&&(s(h,e),h.stroke())}}},function(t,e,i){var n=i(60),s=i(10);t.exports=function(t,e,i,r,o){var a=this.pipeline,h=a._tempMatrix1,l=a._tempMatrix2,u=a._tempMatrix3;t.setPipeline(a),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),h.copyFrom(r.matrix),o?(h.multiplyWithOffset(o,-r.scrollX*e.scrollFactorX,-r.scrollY*e.scrollFactorY),l.e=e.x,l.f=e.y):(l.e-=r.scrollX*e.scrollFactorX,l.f-=r.scrollY*e.scrollFactorY),h.multiply(l,u);var c=e._displayOriginX,d=e._displayOriginY,f=r.alpha*e.alpha;if(e.isFilled){var p=a.fillTint,g=s.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*f);p.TL=g,p.TR=g,p.BL=g,p.BR=g;var v=e.geom.x1-c,y=e.geom.y1-d,m=e.geom.x2-c,x=e.geom.y2-d,w=e.geom.x3-c,b=e.geom.y3-d;a.setTexture2D(),a.batchFillTriangle(v,y,m,x,w,b,l,h)}e.isStroked&&n(a,e,f,c,d)}},function(t,e,i){var n=i(1),s=i(1);n=i(771),s=i(770),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(30),s=i(36),r=i(22);t.exports=function(t,e,i,o,a){var h=t.currentContext;if(r(t,h,e,o,a)){var l=e._displayOriginX,u=e._displayOriginY,c=e.pathData,d=c.length-1,f=c[0]-l,p=c[1]-u;h.beginPath(),h.moveTo(f,p),e.closePath||(d-=2);for(var g=2;g<d;g+=2){var v=c[g]-l,y=c[g+1]-u;h.lineTo(v,y)}h.closePath(),e.isFilled&&(n(h,e),h.fill()),e.isStroked&&(s(h,e),h.stroke())}}},function(t,e,i){var n=i(82),s=i(60);t.exports=function(t,e,i,r,o){var a=this.pipeline,h=a._tempMatrix1,l=a._tempMatrix2,u=a._tempMatrix3;t.setPipeline(a),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),h.copyFrom(r.matrix),o?(h.multiplyWithOffset(o,-r.scrollX*e.scrollFactorX,-r.scrollY*e.scrollFactorY),l.e=e.x,l.f=e.y):(l.e-=r.scrollX*e.scrollFactorX,l.f-=r.scrollY*e.scrollFactorY),h.multiply(l,u);var c=e._displayOriginX,d=e._displayOriginY,f=r.alpha*e.alpha;e.isFilled&&n(a,u,e,f,c,d),e.isStroked&&s(a,e,f,c,d)}},function(t,e,i){var n=i(1),s=i(1);n=i(774),s=i(773),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(30),s=i(36),r=i(22);t.exports=function(t,e,i,o,a){var h=t.currentContext;if(r(t,h,e,o,a)){var l=e._displayOriginX,u=e._displayOriginY;e.isFilled&&(n(h,e),h.fillRect(-l,-u,e.width,e.height)),e.isStroked&&(s(h,e),h.beginPath(),h.rect(-l,-u,e.width,e.height),h.stroke())}}},function(t,e,i){var n=i(60),s=i(10);t.exports=function(t,e,i,r,o){var a=this.pipeline,h=a._tempMatrix1,l=a._tempMatrix2,u=a._tempMatrix3;t.setPipeline(a),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),h.copyFrom(r.matrix),o?(h.multiplyWithOffset(o,-r.scrollX*e.scrollFactorX,-r.scrollY*e.scrollFactorY),l.e=e.x,l.f=e.y):(l.e-=r.scrollX*e.scrollFactorX,l.f-=r.scrollY*e.scrollFactorY),h.multiply(l,u);var c=e._displayOriginX,d=e._displayOriginY,f=r.alpha*e.alpha;if(e.isFilled){var p=a.fillTint,g=s.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*f);p.TL=g,p.TR=g,p.BL=g,p.BR=g,a.batchFillRect(-c,-d,e.width,e.height)}e.isStroked&&n(a,e,f,c,d)}},function(t,e,i){var n=i(1),s=i(1);n=i(777),s=i(776),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(30),s=i(36),r=i(22);t.exports=function(t,e,i,o,a){var h=t.currentContext;if(r(t,h,e,o,a)){var l=e._displayOriginX,u=e._displayOriginY,c=e.pathData,d=c.length-1,f=c[0]-l,p=c[1]-u;h.beginPath(),h.moveTo(f,p),e.closePath||(d-=2);for(var g=2;g<d;g+=2){var v=c[g]-l,y=c[g+1]-u;h.lineTo(v,y)}h.closePath(),e.isFilled&&(n(h,e),h.fill()),e.isStroked&&(s(h,e),h.stroke())}}},function(t,e,i){var n=i(82),s=i(60);t.exports=function(t,e,i,r,o){var a=this.pipeline,h=a._tempMatrix1,l=a._tempMatrix2,u=a._tempMatrix3;t.setPipeline(a),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),h.copyFrom(r.matrix),o?(h.multiplyWithOffset(o,-r.scrollX*e.scrollFactorX,-r.scrollY*e.scrollFactorY),l.e=e.x,l.f=e.y):(l.e-=r.scrollX*e.scrollFactorX,l.f-=r.scrollY*e.scrollFactorY),h.multiply(l,u);var c=e._displayOriginX,d=e._displayOriginY,f=r.alpha*e.alpha;e.isFilled&&n(a,u,e,f,c,d),e.isStroked&&s(a,e,f,c,d)}},function(t,e,i){var n=i(1),s=i(1);n=i(780),s=i(779),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(36),s=i(22);t.exports=function(t,e,i,r,o){var a=t.currentContext;if(s(t,a,e,r,o)){var h=e._displayOriginX,l=e._displayOriginY;e.isStroked&&(n(a,e),a.beginPath(),a.moveTo(e.geom.x1-h,e.geom.y1-l),a.lineTo(e.geom.x2-h,e.geom.y2-l),a.stroke())}}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=this.pipeline,a=o._tempMatrix1,h=o._tempMatrix2;t.setPipeline(o),h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(s.matrix),r?(a.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y):(h.e-=s.scrollX*e.scrollFactorX,h.f-=s.scrollY*e.scrollFactorY);var l=e._displayOriginX,u=e._displayOriginY,c=s.alpha*e.alpha;if(e.isStroked){var d=o.strokeTint,f=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*c);d.TL=f,d.TR=f,d.BL=f,d.BR=f;var p=e._startWidth,g=e._endWidth;o.setTexture2D(),o.batchLine(e.geom.x1-l,e.geom.y1-u,e.geom.x2-l,e.geom.y2-u,p,g,1,0,!1,h,a)}}},function(t,e,i){var n=i(1),s=i(1);n=i(783),s=i(782),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(30),s=i(22);t.exports=function(t,e,i,r,o){var a=t.currentContext;if(s(t,a,e,r,o)&&e.isFilled){var h=e.width,l=e.height,u=h/2,c=h/e.projection,d=e.isReversed;e.showTop&&d&&(n(a,e,e.fillTop),a.beginPath(),a.moveTo(-u,-l),a.lineTo(0,-c-l),a.lineTo(u,-l),a.lineTo(0,c-l),a.fill()),e.showLeft&&(n(a,e,e.fillLeft),a.beginPath(),d?(a.moveTo(-u,-l),a.lineTo(0,c),a.lineTo(0,c-l)):(a.moveTo(-u,0),a.lineTo(0,c),a.lineTo(0,c-l)),a.fill()),e.showRight&&(n(a,e,e.fillRight),a.beginPath(),d?(a.moveTo(u,-l),a.lineTo(0,c),a.lineTo(0,c-l)):(a.moveTo(u,0),a.lineTo(0,c),a.lineTo(0,c-l)),a.fill())}}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=this.pipeline,a=o._tempMatrix1,h=o._tempMatrix2,l=o._tempMatrix3;t.setPipeline(o),h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(s.matrix),r?(a.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y):(h.e-=s.scrollX*e.scrollFactorX,h.f-=s.scrollY*e.scrollFactorY),a.multiply(h,l);var u=e.width,c=e.height,d=u/2,f=u/e.projection,p=e.isReversed,g=s.alpha*e.alpha;if(e.isFilled){var v,y,m,x,w,b,T;if(e.showTop&&p){v=n.getTintAppendFloatAlphaAndSwap(e.fillTop,g),y=l.getX(-d,-c),m=l.getY(-d,-c),x=l.getX(0,-f-c),w=l.getY(0,-f-c),b=l.getX(d,-c),T=l.getY(d,-c);var S=l.getX(0,f-c),_=l.getY(0,f-c);o.setTexture2D(),o.batchQuad(y,m,x,w,b,T,S,_,0,0,1,1,v,v,v,v,2)}e.showLeft&&(v=n.getTintAppendFloatAlphaAndSwap(e.fillLeft,g),p?(y=l.getX(-d,-c),m=l.getY(-d,-c),x=l.getX(0,f),w=l.getY(0,f),b=l.getX(0,f-c),T=l.getY(0,f-c)):(y=l.getX(-d,0),m=l.getY(-d,0),x=l.getX(0,f),w=l.getY(0,f),b=l.getX(0,f-c),T=l.getY(0,f-c)),o.batchTri(y,m,x,w,b,T,0,0,1,1,v,v,v,2)),e.showRight&&(v=n.getTintAppendFloatAlphaAndSwap(e.fillRight,g),p?(y=l.getX(d,-c),m=l.getY(d,-c),x=l.getX(0,f),w=l.getY(0,f),b=l.getX(0,f-c),T=l.getY(0,f-c)):(y=l.getX(d,0),m=l.getY(d,0),x=l.getX(0,f),w=l.getY(0,f),b=l.getX(0,f-c),T=l.getY(0,f-c)),o.setTexture2D(),o.batchTri(y,m,x,w,b,T,0,0,1,1,v,v,v,2))}}},function(t,e,i){var n=i(1),s=i(1);n=i(786),s=i(785),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(30),s=i(22);t.exports=function(t,e,i,r,o){var a=t.currentContext;if(s(t,a,e,r,o)&&e.isFilled){var h=e.width,l=e.height,u=h/2,c=h/e.projection;e.showTop&&(n(a,e,e.fillTop),a.beginPath(),a.moveTo(-u,-l),a.lineTo(0,-c-l),a.lineTo(u,-l),a.lineTo(u,-1),a.lineTo(0,c-1),a.lineTo(-u,-1),a.lineTo(-u,-l),a.fill()),e.showLeft&&(n(a,e,e.fillLeft),a.beginPath(),a.moveTo(-u,0),a.lineTo(0,c),a.lineTo(0,c-l),a.lineTo(-u,-l),a.lineTo(-u,0),a.fill()),e.showRight&&(n(a,e,e.fillRight),a.beginPath(),a.moveTo(u,0),a.lineTo(0,c),a.lineTo(0,c-l),a.lineTo(u,-l),a.lineTo(u,0),a.fill())}}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=this.pipeline,a=o._tempMatrix1,h=o._tempMatrix2,l=o._tempMatrix3;t.setPipeline(o),h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(s.matrix),r?(a.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y):(h.e-=s.scrollX*e.scrollFactorX,h.f-=s.scrollY*e.scrollFactorY),a.multiply(h,l);var u,c,d,f,p,g,v,y,m,x=e.width,w=e.height,b=x/2,T=x/e.projection,S=s.alpha*e.alpha;e.isFilled&&(e.showTop&&(u=n.getTintAppendFloatAlphaAndSwap(e.fillTop,S),c=l.getX(-b,-w),d=l.getY(-b,-w),f=l.getX(0,-T-w),p=l.getY(0,-T-w),g=l.getX(b,-w),v=l.getY(b,-w),y=l.getX(0,T-w),m=l.getY(0,T-w),o.setTexture2D(),o.batchQuad(c,d,f,p,g,v,y,m,0,0,1,1,u,u,u,u,2)),e.showLeft&&(u=n.getTintAppendFloatAlphaAndSwap(e.fillLeft,S),c=l.getX(-b,0),d=l.getY(-b,0),f=l.getX(0,T),p=l.getY(0,T),g=l.getX(0,T-w),v=l.getY(0,T-w),y=l.getX(-b,-w),m=l.getY(-b,-w),o.setTexture2D(),o.batchQuad(c,d,f,p,g,v,y,m,0,0,1,1,u,u,u,u,2)),e.showRight&&(u=n.getTintAppendFloatAlphaAndSwap(e.fillRight,S),c=l.getX(b,0),d=l.getY(b,0),f=l.getX(0,T),p=l.getY(0,T),g=l.getX(0,T-w),v=l.getY(0,T-w),y=l.getX(b,-w),m=l.getY(b,-w),o.setTexture2D(),o.batchQuad(c,d,f,p,g,v,y,m,0,0,1,1,u,u,u,u,2)))}},function(t,e,i){var n=i(1),s=i(1);n=i(789),s=i(788),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(30),s=i(36),r=i(22);t.exports=function(t,e,i,o,a){var h=t.currentContext;if(r(t,h,e,o,a)){var l=e._displayOriginX,u=e._displayOriginY;e.isFilled&&(n(h,e),h.fillRect(-l,-u,e.width,e.height)),e.isStroked&&(s(h,e),h.beginPath(),h.rect(-l,-u,e.width,e.height),h.stroke())}}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=this.pipeline,a=o._tempMatrix1,h=o._tempMatrix2,l=o._tempMatrix3;t.setPipeline(o),h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(s.matrix),r?(a.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y):(h.e-=s.scrollX*e.scrollFactorX,h.f-=s.scrollY*e.scrollFactorY),a.multiply(h,l),l.translate(-e._displayOriginX,-e._displayOriginY);var u,c,d=s.alpha*e.alpha,f=e.width,p=e.height,g=e.cellWidth,v=e.cellHeight,y=Math.ceil(f/g),m=Math.ceil(p/v),x=g,w=v,b=g-(y*g-f),T=v-(m*v-p),S=e.showCells,_=e.showAltCells,A=e.showOutline,C=0,M=0,P=0,E=0,k=0;if(A&&(x--,w--,b===g&&b--,T===v&&T--),S&&e.fillAlpha>0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M<m;M++)for(_&&(P=M%2),C=0;C<y;C++)_&&P?P=0:(P++,E=C<y-1?x:b,k=M<m-1?w:T,o.setTexture2D(),o.batchFillRect(C*g,M*v,E,k));if(_&&e.altFillAlpha>0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M<m;M++)for(_&&(P=M%2),C=0;C<y;C++)!_||P?(P=0,E=C<y-1?x:b,k=M<m-1?w:T,o.setTexture2D(),o.batchFillRect(C*g,M*v,E,k)):P=1;if(A&&e.outlineFillAlpha>0){var L=o.strokeTint,F=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(L.TL=F,L.TR=F,L.BL=F,L.BR=F,C=1;C<y;C++){var R=C*g;o.setTexture2D(),o.batchLine(R,0,R,p,1,1,1,0,!1)}for(M=1;M<m;M++){var O=M*v;o.setTexture2D(),o.batchLine(0,O,f,O,1,1,1,0,!1)}}}},function(t,e,i){var n=i(1),s=i(1);n=i(792),s=i(791),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(30),s=i(36),r=i(22);t.exports=function(t,e,i,o,a){var h=t.currentContext;if(r(t,h,e,o,a)){var l=e._displayOriginX,u=e._displayOriginY,c=e.pathData,d=c.length-1,f=c[0]-l,p=c[1]-u;h.beginPath(),h.moveTo(f,p),e.closePath||(d-=2);for(var g=2;g<d;g+=2){var v=c[g]-l,y=c[g+1]-u;h.lineTo(v,y)}h.closePath(),e.isFilled&&(n(h,e),h.fill()),e.isStroked&&(s(h,e),h.stroke())}}},function(t,e,i){var n=i(82),s=i(60);t.exports=function(t,e,i,r,o){var a=this.pipeline,h=a._tempMatrix1,l=a._tempMatrix2,u=a._tempMatrix3;t.setPipeline(a),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),h.copyFrom(r.matrix),o?(h.multiplyWithOffset(o,-r.scrollX*e.scrollFactorX,-r.scrollY*e.scrollFactorY),l.e=e.x,l.f=e.y):(l.e-=r.scrollX*e.scrollFactorX,l.f-=r.scrollY*e.scrollFactorY),h.multiply(l,u);var c=e._displayOriginX,d=e._displayOriginY,f=r.alpha*e.alpha;e.isFilled&&n(a,u,e,f,c,d),e.isStroked&&s(a,e,f,c,d)}},function(t,e,i){var n=i(1),s=i(1);n=i(795),s=i(794),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(30),s=i(36),r=i(22);t.exports=function(t,e,i,o,a){var h=t.currentContext;if(r(t,h,e,o,a)){var l=e._displayOriginX+e._curveBounds.x,u=e._displayOriginY+e._curveBounds.y,c=e.pathData,d=c.length-1,f=c[0]-l,p=c[1]-u;h.beginPath(),h.moveTo(f,p),e.closePath||(d-=2);for(var g=2;g<d;g+=2){var v=c[g]-l,y=c[g+1]-u;h.lineTo(v,y)}e.closePath&&h.closePath(),e.isFilled&&(n(h,e),h.fill()),e.isStroked&&(s(h,e),h.stroke())}}},function(t,e,i){var n=i(82),s=i(60);t.exports=function(t,e,i,r,o){var a=this.pipeline,h=a._tempMatrix1,l=a._tempMatrix2,u=a._tempMatrix3;t.setPipeline(a),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),h.copyFrom(r.matrix),o?(h.multiplyWithOffset(o,-r.scrollX*e.scrollFactorX,-r.scrollY*e.scrollFactorY),l.e=e.x,l.f=e.y):(l.e-=r.scrollX*e.scrollFactorX,l.f-=r.scrollY*e.scrollFactorY),h.multiply(l,u);var c=e._displayOriginX+e._curveBounds.x,d=e._displayOriginY+e._curveBounds.y,f=r.alpha*e.alpha;e.isFilled&&n(a,u,e,f,c,d),e.isStroked&&s(a,e,f,c,d)}},function(t,e,i){var n=i(1),s=i(1);n=i(798),s=i(797),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(31),s=i(30),r=i(36),o=i(22);t.exports=function(t,e,i,a,h){var l=t.currentContext;if(o(t,l,e,a,h)){var u=e.radius;l.beginPath(),l.arc(u-e.originX*(2*u),u-e.originY*(2*u),u,n(e._startAngle),n(e._endAngle),e.anticlockwise),e.closePath&&l.closePath(),e.isFilled&&(s(l,e),l.fill()),e.isStroked&&(r(l,e),l.stroke())}}},function(t,e,i){var n=i(82),s=i(60);t.exports=function(t,e,i,r,o){var a=this.pipeline,h=a._tempMatrix1,l=a._tempMatrix2,u=a._tempMatrix3;t.setPipeline(a),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),h.copyFrom(r.matrix),o?(h.multiplyWithOffset(o,-r.scrollX*e.scrollFactorX,-r.scrollY*e.scrollFactorY),l.e=e.x,l.f=e.y):(l.e-=r.scrollX*e.scrollFactorX,l.f-=r.scrollY*e.scrollFactorY),h.multiply(l,u);var c=e._displayOriginX,d=e._displayOriginY,f=r.alpha*e.alpha;e.isFilled&&n(a,u,e,f,c,d),e.isStroked&&s(a,e,f,c,d)}},function(t,e,i){var n=i(1),s=i(1);n=i(801),s=i(800),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){e.updateCanvas(),t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){e.updateCanvas();var o=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,e.fillPattern,e.displayFrame.width*e.tileScaleX,e.displayFrame.height*e.tileScaleY,e.x,e.y,e.width,e.height,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.originX*e.width,e.originY*e.height,0,0,e.width,e.height,o(e._tintTL,s.alpha*e._alphaTL),o(e._tintTR,s.alpha*e._alphaTR),o(e._tintBL,s.alpha*e._alphaBL),o(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,e.tilePositionX%e.displayFrame.width/e.displayFrame.width,e.tilePositionY%e.displayFrame.height/e.displayFrame.height,s,r)}},function(t,e,i){var n=i(1),s=i(1);n=i(804),s=i(803),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(24);t.exports=function(t){var e=n.create(this),i=e.getContext("2d");t.syncFont(e,i);var s=Math.ceil(i.measureText(t.testString).width*t.baselineX),r=s,o=2*r;r=r*t.baselineY|0,e.width=s,e.height=o,i.fillStyle="#f00",i.fillRect(0,0,s,o),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,r);var a={ascent:0,descent:0,fontSize:0};if(!i.getImageData(0,0,s,o))return a.ascent=r,a.descent=r+6,a.fontSize=a.ascent+a.descent,n.remove(e),a;var h,l,u=i.getImageData(0,0,s,o).data,c=u.length,d=4*s,f=0,p=!1;for(h=0;h<r;h++){for(l=0;l<d;l+=4)if(255!==u[f+l]){p=!0;break}if(p)break;f+=d}for(a.ascent=r-h,f=c-d,p=!1,h=o;h>r;h--){for(l=0;l<d;l+=4)if(255!==u[f+l]){p=!0;break}if(p)break;f-=d}return a.descent=h-r,a.fontSize=a.ascent+a.descent,n.remove(e),a}},function(t,e,i){var n=i(0),s=i(12),r=i(4),o=i(806),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new n({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this._font,this.setStyle(e,!1,!0);var i=r(e,"metrics",!1);this.metrics=i?{ascent:r(i,"ascent",0),descent:r(i,"descent",0),fontSize:r(i,"fontSize",0)}:o(this)},setStyle:function(t,e,i){for(var n in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var o=i?a[n][1]:this[n];this[n]="wordWrapCallback"===n||"wordWrapCallbackScope"===n?r(t,a[n][0],o):s(t,a[n][0],o)}var h=r(t,"font",null);this._font=null===h?[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim():h;var l=r(t,"fill",null);return null!==l&&(this.color=l),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t){var e=t,i="",n="";return"string"!=typeof t&&(e=r(t,"fontFamily","Courier"),i=r(t,"fontSize","16px"),n=r(t,"fontStyle","")),e===this.fontFamily&&i===this.fontSize&&n===this.fontStyle||(this.fontFamily=e,this.fontSize=i,this.fontStyle=n,this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},function(t,e){t.exports=function(t,e,i,n,s){""!==e.text&&t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){if(""!==e.text){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a/e.style.resolution,h/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r)}}},function(t,e,i){var n=i(1),s=i(1);n=i(809),s=i(808),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i){var n=t.canvas,s=t.context,r=t.style,o=[],a=0,h=i.length;r.maxLines>0&&r.maxLines<i.length&&(h=r.maxLines),r.syncFont(n,s);for(var l=0;l<h;l++){var u=r.strokeThickness;u+=s.measureText(i[l]).width,r.wordWrap&&(u-=s.measureText(" ").width),o[l]=Math.ceil(u),a=Math.max(a,o[l])}var c=e.fontSize+r.strokeThickness,d=c*h,f=t.lineSpacing;return i.length>1&&(d+=f*(i.length-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(4);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,y={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},m=0,x=0;x<a.length;x++){var w=a.charCodeAt(x);y.chars[w]={x:g,y:v,width:i,height:s,centerX:r,centerY:o,xOffset:0,yOffset:0,xAdvance:i,data:{},kerning:{}},++m===p?(m=0,g=l,v+=s+d):g+=i+c}return{data:y,frame:null,texture:h}}}},function(t,e){t.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(813),s=i(20),r={Parse:i(812)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r),t.setBlankTexture(!0)}},function(t,e,i){var n=i(1),s=i(1);n=i(816),s=i(815),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){t.exports={DeathZone:i(301),EdgeZone:i(300),RandomZone:i(297)}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.emitters.list,o=r.length;if(0!==o){var a=t._tempMatrix1.copyFrom(n.matrix),h=t._tempMatrix2,l=t._tempMatrix3,u=t._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);a.multiply(u);var c=n.roundPixels,d=t.currentContext;d.save();for(var f=0;f<o;f++){var p=r[f],g=p.alive,v=g.length;if(p.visible&&0!==v){var y=n.scrollX*p.scrollFactorX,m=n.scrollY*p.scrollFactorY;s&&(a.multiplyWithOffset(s,-y,-m),y=0,m=0),d.globalCompositeOperation=t.blendModes[p.blendMode];for(var x=0;x<v;x++){var w=g[x],b=w.alpha*n.alpha;if(!(b<=0)){var T=w.frame,S=T.canvasData,_=-T.halfWidth,A=-T.halfHeight;l.applyITRS(0,0,w.rotation,w.scaleX,w.scaleY),l.e=w.x-y,l.f=w.y-m,a.multiply(l,h),d.globalAlpha=b,d.save(),h.copyToContext(d),c&&(_|=0,A|=0),d.drawImage(T.source.image,S.x,S.y,S.width,S.height,_,A,S.width,S.height),d.restore()}}}}d.restore()}}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.emitters.list,a=o.length;if(0!==a){var h=this.pipeline,l=h._tempMatrix1.copyFrom(s.matrix),u=h._tempMatrix2,c=h._tempMatrix3,d=h._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);l.multiply(d),t.setPipeline(h);var f=s.roundPixels,p=e.defaultFrame.glTexture,g=n.getTintAppendFloatAlphaAndSwap;h.setTexture2D(p,0);for(var v=0;v<a;v++){var y=o[v],m=y.alive,x=m.length;if(y.visible&&0!==x){var w=s.scrollX*y.scrollFactorX,b=s.scrollY*y.scrollFactorY;r&&(l.multiplyWithOffset(r,-w,-b),w=0,b=0),t.setBlendMode(y.blendMode)&&h.setTexture2D(p,0);for(var T=0;T<x;T++){var S=m[T],_=S.alpha*s.alpha;if(!(_<=0)){var A=S.frame,C=-A.halfWidth,M=-A.halfHeight,P=C+A.width,E=M+A.height;c.applyITRS(0,0,S.rotation,S.scaleX,S.scaleY),c.e=S.x-w,c.f=S.y-b,l.multiply(c,u);var k=u.getX(C,M),L=u.getY(C,M),F=u.getX(C,E),R=u.getY(C,E),O=u.getX(P,E),D=u.getY(P,E),B=u.getX(P,M),I=u.getY(P,M);f&&(k|=0,L|=0,F|=0,R|=0,O|=0,D|=0,B|=0,I|=0);var Y=g(S.tint,_);h.batchQuad(k,L,F,R,O,D,B,I,A.u0,A.v0,A.u1,A.v1,Y,Y,Y,Y,0)&&h.setTexture2D(p,0)}}}}}}},function(t,e,i){var n=i(1),s=i(1);n=i(820),s=i(819),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(0),s=i(299),r=i(86),o=i(2),a=i(53),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if("number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&(this.has(t,"random")||this.hasBoth(t,"start","end")||this.hasBoth(t,"min","max"))){this.start=this.has(t,"start")?t.start:t.min,this.end=this.has(t,"end")?t.end:t.max;var i=this.hasBoth(t,"min","max")||this.has(t,"random");if(i){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}if(this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){t.exports={GravityWell:i(304),Particle:i(303),ParticleEmitter:i(302),ParticleEmitterManager:i(155),Zones:i(818)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e,i){var n=i(1),s=i(1);n=i(825),s=i(824),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e,i){var n=i(1),s=i(1);n=i(828),s=i(827),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(157),s=i(10),r=function(t,e,i){this.x=t,this.y=e,this.width=i},o=function(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new r(t,e,i)},a=[];t.exports=function(t,e,i,h,l){if(0!==e.commandBuffer.length){var u=this.pipeline,c=u._tempMatrix1,d=u._tempMatrix2,f=u._tempMatrix4;t.setPipeline(u),f.loadIdentity(),d.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),c.copyFrom(h.matrix),l?(c.multiplyWithOffset(l,-h.scrollX*e.scrollFactorX,-h.scrollY*e.scrollFactorY),d.e=e.x,d.f=e.y,c.multiply(d)):(d.e-=h.scrollX*e.scrollFactorX,d.f-=h.scrollY*e.scrollFactorY,c.multiply(d));for(var p=e.commandBuffer,g=h.alpha*e.alpha,v=1,y=u.fillTint,m=u.strokeTint,x=0,w=0,b=0,T=2*Math.PI,S=[],_=0,A=!1,C=null,M=s.getTintAppendFloatAlphaAndSwap,P=t.blankTexture.glTexture,E=0;E<p.length;E++)switch(p[E]){case n.BEGIN_PATH:S.length=0,C=null,A=!0;break;case n.CLOSE_PATH:A=!1,C&&C.points.length&&C.points.push(C.points[0]);break;case n.FILL_PATH:for(_=0;_<S.length;_++)u.setTexture2D(P),u.batchFillPath(S[_].points,f,c);break;case n.STROKE_PATH:for(_=0;_<S.length;_++)u.setTexture2D(P),u.batchStrokePath(S[_].points,v,A,f,c);break;case n.LINE_STYLE:v=p[++E];var k=M(p[++E],p[++E]*g);m.TL=k,m.TR=k,m.BL=k,m.BR=k;break;case n.FILL_STYLE:var L=M(p[++E],p[++E]*g);y.TL=L,y.TR=L,y.BL=L,y.BR=L;break;case n.GRADIENT_FILL_STYLE:var F=p[++E]*g;y.TL=M(p[++E],F),y.TR=M(p[++E],F),y.BL=M(p[++E],F),y.BR=M(p[++E],F);break;case n.GRADIENT_LINE_STYLE:v=p[++E];var R=p[++E]*g;m.TL=M(p[++E],R),m.TR=M(p[++E],R),m.BL=M(p[++E],R),m.BR=M(p[++E],R);break;case n.ARC:var O=0,D=p[++E],B=p[++E],I=p[++E],Y=p[++E],X=p[++E],z=p[++E],N=p[++E];for(X-=Y,z?X<-T?X=-T:X>0&&(X=X%T-T):X>T?X=T:X<0&&(X=T+X%T),null===C&&(C=new o(D+Math.cos(Y)*I,B+Math.sin(Y)*I,v),S.push(C),O+=.01);O<1+N;)b=X*O+Y,x=D+Math.cos(b)*I,w=B+Math.sin(b)*I,C.points.push(new r(x,w,v)),O+=.01;b=X+Y,x=D+Math.cos(b)*I,w=B+Math.sin(b)*I,C.points.push(new r(x,w,v));break;case n.FILL_RECT:u.setTexture2D(P),u.batchFillRect(p[++E],p[++E],p[++E],p[++E],f,c);break;case n.FILL_TRIANGLE:u.setTexture2D(P),u.batchFillTriangle(p[++E],p[++E],p[++E],p[++E],p[++E],p[++E],f,c);break;case n.STROKE_TRIANGLE:u.setTexture2D(P),u.batchStrokeTriangle(p[++E],p[++E],p[++E],p[++E],p[++E],p[++E],v,f,c);break;case n.LINE_TO:null!==C?C.points.push(new r(p[++E],p[++E],v)):(C=new o(p[++E],p[++E],v),S.push(C));break;case n.MOVE_TO:C=new o(p[++E],p[++E],v),S.push(C);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:D=p[++E],B=p[++E],f.translate(D,B);break;case n.SCALE:D=p[++E],B=p[++E],f.scale(D,B);break;case n.ROTATE:f.rotate(p[++E]);break;case n.SET_TEXTURE:var U=p[++E],V=p[++E];u.currentFrame=U,u.setTexture2D(U.glTexture,0),u.tintEffect=V,P=U.glTexture;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,u.tintEffect=2,P=t.blankTexture.glTexture}}}},function(t,e,i){var n=i(1),s=i(1);n=i(830),s=i(305),s=i(305),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(22);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length,h=t.currentContext;if(0!==a&&n(t,h,e,s,r)){var l=e.frame,u=e.displayCallback,c=s.scrollX*e.scrollFactorX,d=s.scrollY*e.scrollFactorY,f=e.fontData.chars,p=e.fontData.lineHeight,g=0,v=0,y=0,m=0,x=null,w=0,b=0,T=0,S=0,_=0,A=0,C=null,M=0,P=e.frame.source.image,E=l.cutX,k=l.cutY,L=0,F=e.fontSize/e.fontData.size;e.cropWidth>0&&e.cropHeight>0&&(h.save(),h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var R=0;R<a;++R)if(F=e.fontSize/e.fontData.size,L=0,10!==(m=o.charCodeAt(R))){if(x=f[m]){if(w=E+x.x,b=k+x.y,T=x.width,S=x.height,_=y+x.xOffset+g-e.scrollX,A=x.yOffset+v-e.scrollY,null!==C){var O=x.kerning[M];_+=void 0!==O?O:0}if(u){var D=u({tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:R,charCode:m,x:_,y:A,scale:F,rotation:0,data:x.data});_=D.x,A=D.y,F=D.scale,L=D.rotation}_*=F,A*=F,_-=c,A-=d,s.roundPixels&&(_|=0,A|=0),h.save(),h.translate(_,A),h.rotate(L),h.scale(F,F),h.drawImage(P,w,b,T,S,0,0,T,S),h.restore(),g+=x.xAdvance,y+=1,C=x,M=m}}else g=0,y=0,v+=p,C=null;e.cropWidth>0&&e.cropHeight>0&&h.restore(),h.restore()}}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length;if(0!==a){var h=this.pipeline;t.setPipeline(h,e);var l=e.cropWidth>0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,y=p.cutY,m=g.width,x=g.height,w=e._isTinted&&e.tintFill,b=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),T=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),S=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),_=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var A,C,M=0,P=0,E=0,k=0,L=e.letterSpacing,F=0,R=0,O=0,D=0,B=e.scrollX,I=e.scrollY,Y=e.fontData,X=Y.chars,z=Y.lineHeight,N=e.fontSize/Y.size,U=0,V=e._align,G=0,W=0;e.getTextBounds(!1);var H=e._bounds.lines;1===V?W=(H.longest-H.lengths[0])/2:2===V&&(W=H.longest-H.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,J=0;J<a;J++)if(10!==(E=o.charCodeAt(J))){if(A=X[E]){F=v+A.x,R=y+A.y,O=A.width,D=A.height;var Z=A.xOffset+M-B,Q=A.yOffset+P-I;if(null!==C){var $=A.kerning[k];Z+=void 0!==$?$:0}if(M+=A.xAdvance+L,C=A,k=E,0!==O&&0!==D&&32!==E){if(N=e.fontSize/e.fontData.size,U=0,q){K.color=0,K.tint.topLeft=b,K.tint.topRight=T,K.tint.bottomLeft=S,K.tint.bottomRight=_,K.index=J,K.charCode=E,K.x=Z,K.y=Q,K.scale=N,K.rotation=U,K.data=A.data;var tt=q(K);Z=tt.x,Q=tt.y,N=tt.scale,U=tt.rotation,tt.color?(b=tt.color,T=tt.color,S=tt.color,_=tt.color):(b=tt.tint.topLeft,T=tt.tint.topRight,S=tt.tint.bottomLeft,_=tt.tint.bottomRight),b=n.getTintAppendFloatAlpha(b,s.alpha*e._alphaTL),T=n.getTintAppendFloatAlpha(T,s.alpha*e._alphaTR),S=n.getTintAppendFloatAlpha(S,s.alpha*e._alphaBL),_=n.getTintAppendFloatAlpha(_,s.alpha*e._alphaBR)}Z*=N,Q*=N,Z-=e.displayOriginX,Q-=e.displayOriginY,Z+=W,f.applyITRS(Z,Q,U,N,N),d.multiply(f,c);var et=F/m,it=R/x,nt=(F+O)/m,st=(R+D)/x,rt=O,ot=D,at=c.e,ht=c.f,lt=ot*c.c+c.e,ut=ot*c.d+c.f,ct=rt*c.a+ot*c.c+c.e,dt=rt*c.b+ot*c.d+c.f,ft=rt*c.a+c.e,pt=rt*c.b+c.f;j&&(at|=0,ht|=0,lt|=0,ut|=0,ct|=0,dt|=0,ft|=0,pt|=0),h.batchQuad(at,ht,lt,ut,ct,dt,ft,pt,et,it,nt,st,b,T,S,_,w)}}}else G++,1===V?W=(H.longest-H.lengths[G])/2:2===V&&(W=H.longest-H.lengths[G]),M=0,P+=z,C=null;l&&(h.flush(),t.popScissor())}}},function(t,e,i){var n=i(1),s=i(1);n=i(833),s=i(832),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.list;if(0!==r.length){var o=e.localTransform;s?(o.loadIdentity(),o.multiply(s),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY)):o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);for(var h=e._alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c<r.length;c++){var d=r[c];if(d.willRender(n)){var f=d._alpha,p=d._blendMode,g=d.scrollFactorX,v=d.scrollFactorY;d.setScrollFactor(g*l,v*u),d.setAlpha(f*h),a&&d.setBlendMode(e._blendMode),d.renderCanvas(t,d,i,n,o),d.setAlpha(f),d.setScrollFactor(g,v),d.setBlendMode(p)}}}}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.list;if(0!==r.length){var o=e.localTransform;s?(o.loadIdentity(),o.multiply(s),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY)):o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);for(var h=e._alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c<r.length;c++){var d=r[c];if(d.willRender(n)){var f=d._alpha,p=d.scrollFactorX,g=d.scrollFactorY;a||d.blendMode===t.currentBlendMode||t.setBlendMode(d.blendMode),d.setScrollFactor(p*l,g*u),d.setAlpha(f*h),d.renderWebGL(t,d,i,n,o),d.setAlpha(f),d.setScrollFactor(p,g)}}}}},function(t,e,i){var n=i(1),s=i(1);n=i(836),s=i(835),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){this.parent=t,this.x=e,this.y=i,this.frame=n,this.data={},this._visible=s,this._alpha=1,this.flipX=!1,this.flipY=!1},setFrame:function(t){return this.frame=void 0===t?this.parent.frame:this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(t){this._visible=t,this.parent.dirty=!0}},alpha:{get:function(){return this._alpha},set:function(t){this._alpha=t,this.parent.dirty=!0}}});t.exports=n},function(t,e){t.exports=function(t,e,i,n,s){var r=e.getRenderList();if(0!==r.length){var o=t.currentContext,a=n.alpha*e.alpha;if(0!==a){o.globalCompositeOperation=t.blendModes[e.blendMode];var h=e.x-n.scrollX*e.scrollFactorX,l=e.y-n.scrollY*e.scrollFactorY;o.save(),s&&s.copyToContext(o);for(var u=n.roundPixels,c=0;c<r.length;c++){var d=r[c],f=d.flipX||d.flipY,p=d.frame,g=p.canvasData,v=p.x,y=p.y,m=1,x=1,w=d.alpha*a;0!==w&&(o.globalAlpha=w,f?(d.flipX&&(m=-1,v-=g.width),d.flipY&&(x=-1,y-=g.height),o.save(),o.translate(d.x+h,d.y+l),o.scale(m,x),o.drawImage(p.source.image,g.x,g.y,g.width,g.height,v,y,g.width,g.height),o.restore()):(u&&(v|=0,y|=0),o.drawImage(p.source.image,g.x,g.y,g.width,g.height,v+d.x+h,y+d.y+l,g.width,g.height)))}o.restore()}}}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.getRenderList();if(0!==o.length){var a=this.pipeline;t.setPipeline(a,e);var h=s.scrollX*e.scrollFactorX,l=s.scrollY*e.scrollFactorY,u=a._tempMatrix1;u.copyFrom(s.matrix),r&&(u.multiplyWithOffset(r,-h,-l),h=0,l=0);for(var c=e.x-h,d=e.y-l,f=-1,p=s.alpha*e.alpha,g=s.roundPixels,v=0;v<o.length;v++){var y=o[v],m=y.frame,x=y.alpha*p;if(0!==x){var w=m.width,b=m.height,T=c+y.x+m.x,S=d+y.y+m.y;y.flipX&&(w*=-1,T+=m.width),y.flipY&&(b*=-1,S+=m.height);var _=T+w,A=S+b,C=u.getX(T,S),M=u.getY(T,S),P=u.getX(_,A),E=u.getY(_,A),k=n.getTintAppendFloatAlpha(16777215,x);m.sourceIndex!==f&&(a.setTexture2D(m.glTexture,0),f=m.sourceIndex),g&&(C|=0,M|=0,P|=0,E|=0),a.batchQuad(C,M,C,E,P,E,P,M,m.u0,m.v0,m.u1,m.v1,k,k,k,k,!1)&&(f=-1)}}}}},function(t,e,i){var n=i(1),s=i(1);n=i(840),s=i(839),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(22);t.exports=function(t,e,i,s,r){var o=e._text,a=o.length,h=t.currentContext;if(0!==a&&n(t,h,e,s,r)){var l=e.frame,u=e.fontData.chars,c=e.fontData.lineHeight,d=e._letterSpacing,f=0,p=0,g=0,v=null,y=0,m=0,x=0,w=0,b=0,T=0,S=null,_=0,A=e.frame.source.image,C=l.cutX,M=l.cutY,P=e._fontSize/e.fontData.size,E=e._align,k=0,L=0;e.getTextBounds(!1);var F=e._bounds.lines;1===E?L=(F.longest-F.lengths[0])/2:2===E&&(L=F.longest-F.lengths[0]),h.translate(-e.displayOriginX,-e.displayOriginY);for(var R=s.roundPixels,O=0;O<a;O++)if(10!==(g=o.charCodeAt(O))){if(v=u[g]){if(y=C+v.x,m=M+v.y,x=v.width,w=v.height,b=v.xOffset+f,T=v.yOffset+p,null!==S){var D=v.kerning[_];b+=void 0!==D?D:0}b*=P,T*=P,b+=L,f+=v.xAdvance+d,S=v,_=g,0!==x&&0!==w&&32!==g&&(R&&(b|=0,T|=0),h.save(),h.translate(b,T),h.scale(P,P),h.drawImage(A,y,m,x,w,0,0,x,w),h.restore())}}else k++,1===E?L=(F.longest-F.lengths[k])/2:2===E&&(L=F.longest-F.lengths[k]),f=0,p+=c,S=null;h.restore()}}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e._text,a=o.length;if(0!==a){var h=this.pipeline;t.setPipeline(h,e);var l=h._tempMatrix1,u=h._tempMatrix2,c=h._tempMatrix3;u.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),l.copyFrom(s.matrix),r?(l.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),u.e=e.x,u.f=e.y,l.multiply(u,c)):(u.e-=s.scrollX*e.scrollFactorX,u.f-=s.scrollY*e.scrollFactorY,l.multiply(u,c));var d=e.frame,f=d.glTexture,p=d.cutX,g=d.cutY,v=f.width,y=f.height,m=e._isTinted&&e.tintFill,x=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),w=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),b=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),T=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(f,0);var S,_,A=0,C=0,M=0,P=0,E=e._letterSpacing,k=0,L=0,F=0,R=0,O=e.fontData,D=O.chars,B=O.lineHeight,I=e._fontSize/O.size,Y=e._align,X=0,z=0;e.getTextBounds(!1);var N=e._bounds.lines;1===Y?z=(N.longest-N.lengths[0])/2:2===Y&&(z=N.longest-N.lengths[0]);for(var U=s.roundPixels,V=0;V<a;V++)if(10!==(M=o.charCodeAt(V))){if(S=D[M]){k=p+S.x,L=g+S.y,F=S.width,R=S.height;var G=S.xOffset+A,W=S.yOffset+C;if(null!==_){var H=S.kerning[P];G+=void 0!==H?H:0}if(A+=S.xAdvance+E,_=S,P=M,0!==F&&0!==R&&32!==M){G*=I,W*=I,G-=e.displayOriginX,W-=e.displayOriginY;var j=k/v,q=L/y,K=(k+F)/v,J=(L+R)/y,Z=(G+=z)+F*I,Q=W+R*I,$=c.getX(G,W),tt=c.getY(G,W),et=c.getX(G,Q),it=c.getY(G,Q),nt=c.getX(Z,Q),st=c.getY(Z,Q),rt=c.getX(Z,W),ot=c.getY(Z,W);U&&($|=0,tt|=0,et|=0,it|=0,nt|=0,st|=0,rt|=0,ot|=0),h.batchQuad($,tt,et,it,nt,st,rt,ot,j,q,K,J,x,w,b,T,m)}}}else X++,1===Y?z=(N.longest-N.lengths[X])/2:2===Y&&(z=N.longest-N.lengths[X]),A=0,C+=B,_=null}}},function(t,e,i){var n=i(1),s=i(1);n=i(843),s=i(842),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(310);t.exports=function(t,e,i,s,r,o,a){var h=t.sys.textures.getFrame(i,s),l=t.sys.cache.xml.get(r);if(h&&l){var u=n(l,o,a,h);return t.sys.cache.bitmapFont.add(e,{data:u,texture:i,frame:s}),!0}return!1}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null}});for(var n=t.text,s=n.length,r=Number.MAX_VALUE,o=Number.MAX_VALUE,a=0,h=0,l=t.fontData.chars,u=t.fontData.lineHeight,c=t.letterSpacing,d=0,f=0,p=0,g=null,v=0,y=0,m=t.fontSize/t.fontData.size,x=m*t.scaleX,w=m*t.scaleY,b=null,T=0,S=[],_=Number.MAX_VALUE,A=0,C=0,M=0,P=0;P<s;P++)if(10!==(p=n.charCodeAt(P))){if(g=l[p]){if(v=d,y=f,null!==b){var E=g.kerning[T];v+=void 0!==E?E:0}r>v&&(r=v),o>y&&(o=y);var k=v+g.xAdvance,L=y+u;a<k&&(a=k),h<L&&(h=L),d+=g.xAdvance+c,b=g,T=p,M=k*m}}else d=0,f+=u,b=null,S[C]=M,M>A&&(A=M),M<_&&(_=M),C++,M=0;S[C]=M,M>A&&(A=M),M<_&&(_=M);var F=i.local,R=i.global,O=i.lines;return F.x=r*m,F.y=o*m,F.width=a*m,F.height=h*m,R.x=t.x-t.displayOriginX+r*x,R.y=t.y-t.displayOriginY+o*w,R.width=a*x,R.height=h*w,O.shortest=_,O.longest=A,O.lengths=S,e&&(F.x=Math.round(F.x),F.y=Math.round(F.y),F.width=Math.round(F.width),F.height=Math.round(F.height),R.x=Math.round(R.x),R.y=Math.round(R.y),R.width=Math.round(R.width),R.height=Math.round(R.height),O.shortest=Math.round(_),O.longest=Math.round(A)),i}},function(t,e,i){var n=i(0),s=i(15),r=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},start:function(){var t=this.systems.events;t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this)},add:function(t){return-1===this._list.indexOf(t)&&-1===this._pendingInsertion.indexOf(t)&&this._pendingInsertion.push(t),t},preUpdate:function(){var t=this._pendingRemoval.length,e=this._pendingInsertion.length;if(0!==t||0!==e){var i,n;for(i=0;i<t;i++){n=this._pendingRemoval[i];var s=this._list.indexOf(n);s>-1&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=0;i<this._list.length;i++){var n=this._list[i];n.active&&n.preUpdate.call(n,t,e)}},remove:function(t){var e=this._list.indexOf(t);return-1!==e&&this._list.splice(e,1),t},removeAll:function(){for(var t=this._list.length;t--;)this.remove(this._list[t]);return this},shutdown:function(){for(var t=this._list.length;t--;)this._list[t].destroy(!0);for(t=this._pendingRemoval.length;t--;)this._pendingRemoval[t].destroy(!0);for(t=this._pendingInsertion.length;t--;)this._pendingInsertion[t].destroy(!0);this._list.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;var e=this.systems.events;e.off("preupdate",this.preUpdate,this),e.off("update",this.update,this),e.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null},length:{get:function(){return this._list.length}}});s.register("UpdateList",r,"updateList"),t.exports=r},function(t,e){t.exports=function(t,e,i){if(e!==i){var n=t.indexOf(e),s=t.indexOf(i);if(n<0||s<0)throw new Error("Supplied items must be elements of the same array");return t[n]=i,t[s]=e,t}}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r))for(var o=s;o<r;o++){var a=t[o];a.hasOwnProperty(e)&&(a[e]=i)}return t}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e),s=t.indexOf(i);return-1!==n&&-1===s&&(t[n]=i,!0)}},function(t,e,i){var n=i(91);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return n(t,s)}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),n(t,e,i)){var o=i-e,a=t.splice(e,o);if(s)for(var h=0;h<a.length;h++){var l=a[h];s.call(r,l)}return a}return[]}},function(t,e,i){var n=i(91);t.exports=function(t,e,i,s){if(void 0===s&&(s=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=n(t,e);return i&&i.call(s,r),r}},function(t,e,i){var n=i(314);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var s=[],r=Math.max(n((e-t)/(i||1)),0),o=0;o<r;o++)s.push(t),t+=i;return s}},function(t,e){t.exports=function(t,e,i,n){for(var s=[],r=t;r<=e;r++)if(i||n){var o=i?i+r.toString():r.toString();n&&(o=o.concat(n)),s.push(o)}else s.push(r);return s}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i<t.length-2){var n=t[i+1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r))for(var o=s;o<r;o++){var a=t[o];if(!e||e&&void 0===i&&a.hasOwnProperty(e)||e&&void 0!==i&&a[e]===i)return a}return null}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){void 0===s&&(s=0),void 0===r&&(r=t.length);var o=[];if(n(t,s,r))for(var a=s;a<r;a++){var h=t[a];(!e||e&&void 0===i&&h.hasOwnProperty(e)||e&&void 0!==i&&h[e]===i)&&o.push(h)}return o}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r)){var o,a=[null];for(o=5;o<arguments.length;o++)a.push(arguments[o]);for(o=s;o<r;o++)a[0]=t[o],e.apply(i,a)}return t}},function(t,e){t.exports=function(t,e,i){var n,s=[null];for(n=3;n<arguments.length;n++)s.push(arguments[n]);for(n=0;n<t.length;n++)s[0]=t[n],e.apply(i,s);return t}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){void 0===s&&(s=0),void 0===r&&(r=t.length);var o=0;if(n(t,s,r))for(var a=s;a<r;a++)t[a][e]===i&&o++;return o}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i<t.length&&(t.splice(i,1),t.push(e)),e}},function(t,e){t.exports=function(t,e,i,n,s,r){if(void 0===i&&(i=0),void 0===r&&(r=t),n>0){var o=n-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),s&&s.call(r,l)}return e}},function(t,e){t.exports=function(t,e,i,n,s){if(void 0===s&&(s=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a<o;a++){var h=e[a];t.push(h),n&&n.call(s,h)}return e}},function(t,e,i){var n=i(111);t.exports=function(t){return n(t,-90)}},function(t,e,i){var n=i(111);t.exports=function(t){return n(t,90)}},function(t,e,i){var n=i(111);t.exports=function(t){return n(t,180)}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].reverse();return t}},function(t,e,i){var n=i(179),s=i(163);t.exports=function(t){var e="";if(!s(t))return e;for(var i=0;i<t.length;i++){for(var r=0;r<t[i].length;r++){var o=t[i][r].toString();e+="undefined"!==o?n(o,2):"?",r<t[i].length-1&&(e+=" |")}if(i<t.length-1){e+="\n";for(var a=0;a<t[i].length;a++)e+="---",a<t[i].length-1&&(e+="+");e+="\n"}}return e}},function(t,e,i){t.exports={CheckMatrix:i(163),MatrixToString:i(873),ReverseColumns:i(872),ReverseRows:i(871),Rotate180:i(870),RotateLeft:i(869),RotateMatrix:i(111),RotateRight:i(868),TransposeMatrix:i(315)}},function(t,e,i){var n=i(0),s=i(112),r=i(15),o=i(110),a=new n({Extends:s,initialize:function(t){s.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},start:function(){this.systems.events.once("shutdown",this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(o.inplace(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},sortGameObjects:function(t){return void 0===t&&(t=this.list),this.scene.sys.depthSort(),t.sort(this.sortIndexHandler.bind(this))},getTopGameObject:function(t){return this.sortGameObjects(t),t[t.length-1]},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list.length;t--;)this.list[t].destroy(!0);this.list.length=0,this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("DisplayList",a,"displayList"),t.exports=a},function(t,e,i){var n={DisplayList:i(875),GameObjectCreator:i(13),GameObjectFactory:i(5),UpdateList:i(847),Components:i(14),BuildGameObject:i(28),BuildGameObjectAnimation:i(311),GameObject:i(19),BitmapText:i(109),Blitter:i(161),Container:i(160),DynamicBitmapText:i(159),Graphics:i(158),Group:i(88),Image:i(87),Particles:i(823),PathFollower:i(296),RenderTexture:i(154),RetroFont:i(814),Sprite:i(61),Text:i(153),TileSprite:i(152),Zone:i(125),Shape:i(27),Arc:i(293),Curve:i(292),Ellipse:i(291),Grid:i(290),IsoBox:i(289),IsoTriangle:i(288),Line:i(287),Polygon:i(286),Rectangle:i(281),Star:i(280),Triangle:i(279),Factories:{Blitter:i(769),Container:i(768),DynamicBitmapText:i(767),Graphics:i(766),Group:i(765),Image:i(764),Particles:i(763),PathFollower:i(762),RenderTexture:i(761),Sprite:i(760),StaticBitmapText:i(759),Text:i(758),TileSprite:i(757),Zone:i(756),Arc:i(755),Curve:i(754),Ellipse:i(753),Grid:i(752),IsoBox:i(751),IsoTriangle:i(750),Line:i(749),Polygon:i(748),Rectangle:i(747),Star:i(746),Triangle:i(745)},Creators:{Blitter:i(744),Container:i(743),DynamicBitmapText:i(742),Graphics:i(741),Group:i(740),Image:i(739),Particles:i(738),RenderTexture:i(737),Sprite:i(736),StaticBitmapText:i(735),Text:i(734),TileSprite:i(733),Zone:i(732)}};n.Mesh=i(108),n.Quad=i(149),n.Factories.Mesh=i(728),n.Factories.Quad=i(727),n.Creators.Mesh=i(726),n.Creators.Quad=i(725),n.Light=i(276),i(275),i(724),t.exports=n},function(t,e){t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")});e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit("hidden"):i.emit("visible")},!1),window.onblur=function(){i.emit("blur")},window.onfocus=function(){i.emit("focus")},window.focus&&t.config.autoFocus&&(window.focus(),t.canvas.addEventListener("mousedown",function(){window.focus()},{passive:!0})),t.canvas&&(t.canvas.onmouseout=function(){t.isOver=!1,i.emit("mouseout")},t.canvas.onmouseover=function(){t.isOver=!0,i.emit("mouseover")})}},function(t,e,i){var n=i(0),s=i(4),r=i(1),o=i(341),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0,this.frame=0;for(var e=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=Math.min(this._target,this.deltaHistory[e]);this.delta=0,this.deltaIndex=0,this._coolDown=this.panicMax},start:function(t){if(this.started)return this;this.started=!0,this.running=!0;for(var e=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=this._target;this.resetDelta(),this.startTime=window.performance.now(),this.callback=t,this.raf.start(this.step.bind(this),this.forceSetTimeOut)},step:function(t){this.frame++;var e=t-this.lastTime;e<0&&(e=0),this.rawDelta=e;var i=this.deltaIndex,n=this.deltaHistory,s=this.deltaSmoothingMax,r=e;(this._coolDown>0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;a<s;a++)o+=n[a];o/=s,this.delta=o,this.time+=this.rawDelta,t>this.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t},tick:function(){this.step(window.performance.now())},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime=window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step(window.performance.now())},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e){var i=0,n=function(t,e,n,s){var r=i-s.y-s.height;t.add(n,e,s.x,r,s.width,s.height)};t.exports=function(t,e,s){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height),i=r.height;for(var o=s.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;c<o.length;c++){var d=o[c].match(a);if(d){var f="- "===d[1],p=d[2],g=d[3];if(f&&(l!==h&&(n(t,e,l,u),h=l),u={x:0,y:0,width:0,height:0}),"name"!==p)switch(p){case"x":case"y":case"width":case"height":u[p]=parseInt(g,10)}else l=g}}return l!==h&&n(t,e,l,u),t}},function(t,e,i){var n=i(2);t.exports=function(t,e,i){var s=n(i,"frameWidth",null),r=n(i,"frameHeight",s);if(!s)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o,a=n(i,"startFrame",0),h=n(i,"endFrame",-1),l=n(i,"margin",0),u=n(i,"spacing",0),c=e.cutX,d=e.cutY,f=e.cutWidth,p=e.cutHeight,g=e.realWidth,v=e.realHeight,y=Math.floor((g-l+u)/(s+u)),m=Math.floor((v-l+u)/(r+u)),x=y*m,w=e.x,b=s-w,T=s-(g-f-w),S=e.y,_=r-S,A=r-(v-p-S);(a>x||a<-x)&&(a=0),a<0&&(a=x+a),-1!==h&&(x=a+(h+1));for(var C=l,M=l,P=0,E=e.sourceIndex,k=0;k<m;k++){for(var L=0===k,F=k===m-1,R=0;R<y;R++){var O=0===R,D=R===y-1;if(o=t.add(P,E,c+C,d+M,s,r),O||L||D||F){var B=O?w:0,I=L?S:0,Y=s,X=r;O?Y=b:D&&(Y=T),L?X=_:F&&(X=A),o.cutWidth=Y,o.cutHeight=X,o.setTrim(s,r,B,I,Y,X)}C+=u,C+=O?b:D||s,P++}C=l,M+=u,M+=L?_:F?A:r}return t}},function(t,e,i){var n=i(2);t.exports=function(t,e,i,s,r,o,a){var h=n(a,"frameWidth",null),l=n(a,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var c=n(a,"startFrame",0),d=n(a,"endFrame",-1),f=n(a,"margin",0),p=n(a,"spacing",0),g=Math.floor((r-f+p)/(h+p))*Math.floor((o-f+p)/(l+p));0===g&&console.warn("SpriteSheet frame dimensions will result in zero frames."),(c>g||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,y=f,m=0,x=0,w=0;w<g;w++){m=0,x=0;var b=v+h,T=y+l;b>r&&(m=b-r),T>o&&(x=T-o),t.add(w,e,i+v,s+y,h-m,l-x),(v+=h+p)+h>r&&(v=f,y+=l+p)}return t}},function(t,e,i){var n=i(63);t.exports=function(t,e,i){if(i.frames){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);var r,o=i.frames;for(var a in o){var h=o[a];r=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted()),r.customData=n(h)}for(var l in i)"frames"!==l&&(Array.isArray(i[l])?t.customData[l]=i[l].slice(0):t.customData[l]=i[l]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},function(t,e,i){var n=i(63);t.exports=function(t,e,i){if(i.frames||i.textures){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var r,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a<o.length;a++){var h=o[a];r=t.add(h.filename,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted()),h.anchor&&(r.customPivot=!0,r.pivotX=h.anchor.x,r.pivotY=h.anchor.y),r.customData=n(h)}for(var l in i)"frames"!==l&&(Array.isArray(i[l])?t.customData[l]=i[l].slice(0):t.customData[l]=i[l]);return t}console.warn("Invalid Texture Atlas JSON Array")}},function(t,e){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},function(t,e){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var s,r=i.getElementsByTagName("SubTexture"),o=0;o<r.length;o++){var a=r[o].attributes,h=a.name.value,l=parseInt(a.x.value,10),u=parseInt(a.y.value,10),c=parseInt(a.width.value,10),d=parseInt(a.height.value,10);if(s=t.add(h,e,l,u,c,d),a.frameX){var f=Math.abs(parseInt(a.frameX.value,10)),p=Math.abs(parseInt(a.frameY.value,10)),g=parseInt(a.frameWidth.value,10),v=parseInt(a.frameHeight.value,10);s.setTrim(c,d,f,p,g,v)}}return t}console.warn("Invalid Texture Atlas XML given")}},function(t,e,i){var n=i(0),s=i(37),r=i(117),o=i(165),a=new n({Extends:o,initialize:function(t,e,i,n,s){o.call(this,t,e,i,n,s),this.add("__BASE",0,0,0,n,s),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=n,this.height=s,this.imageData=this.context.getImageData(0,0,n,s),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},getPixel:function(t,e,i){i||(i=new s);var n=~~(t+e*this.width);n*=4;var r=this.data[n],o=this.data[++n],a=this.data[++n],h=this.data[++n];return i.setTo(r,o,a,h)},refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(){return this.context.clearRect(0,0,this.width,this.height),this.update()},setSize:function(t,e){return void 0===e&&(e=t),t===this.width&&e===this.height||(this.canvas.width=t,this.canvas.height=e,this._source.width=t,this._source.height=e,this._source.isPowerOf2=r(t,e),this.frames.__BASE.setSize(t,e,0,0),this.refresh()),this}});t.exports=a},function(t,e,i){t.exports={game:"game",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e,i){var n=i(2);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=n(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},function(t,e,i){var n=i(2),s=i(327);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=n(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(s(e+"Physics")),i)for(var o in i)o=s(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},function(t,e,i){var n=i(26);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===n.CANVAS?i="Canvas":e.renderType===n.HEADLESS&&(i="Headless");var s,r=e.audio,o=t.device.audio;if(s=!o.webAudio||r&&r.disableWebAudio?r&&r.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio":"Web Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+n.VERSION+" / https://phaser.io");else{var a,h="",l=[h];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach(function(t){h=h.concat("%c "),l.push("background: "+t),a=t}),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a):(h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),l.push("background: #fff"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / "))),e.hidePhaser||(h=h.concat("Phaser v"+n.VERSION+" ("+i+" | "+s+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform mat4 uModelMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}","",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);"," vec4 color = texture;",""," if (outTintEffect == 0.0)"," {"," // Multiply texture tint"," color = texture * texel;"," }"," else if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.rgb * outTint.a, texture.a);"," color.a = texture.a * texel.a;"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},function(t,e){var i={modelMatrixDirty:!1,viewMatrixDirty:!1,projectionMatrixDirty:!1,modelMatrix:null,viewMatrix:null,projectionMatrix:null,mvpInit:function(){return this.modelMatrixDirty=!0,this.viewMatrixDirty=!0,this.projectionMatrixDirty=!0,this.modelMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this},mvpUpdate:function(){var t=this.program;return this.modelMatrixDirty&&(this.renderer.setMatrix4(t,"uModelMatrix",!1,this.modelMatrix),this.modelMatrixDirty=!1),this.viewMatrixDirty&&(this.renderer.setMatrix4(t,"uViewMatrix",!1,this.viewMatrix),this.viewMatrixDirty=!1),this.projectionMatrixDirty&&(this.renderer.setMatrix4(t,"uProjectionMatrix",!1,this.projectionMatrix),this.projectionMatrixDirty=!1),this},modelIdentity:function(){var t=this.modelMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.modelMatrixDirty=!0,this},modelScale:function(t,e,i){var n=this.modelMatrix;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this.modelMatrixDirty=!0,this},modelTranslate:function(t,e,i){var n=this.modelMatrix;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this.modelMatrixDirty=!0,this},modelRotateX:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this.modelMatrixDirty=!0,this},modelRotateY:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this.modelMatrixDirty=!0,this},modelRotateZ:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this.modelMatrixDirty=!0,this},viewIdentity:function(){var t=this.viewMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.viewMatrixDirty=!0,this},viewScale:function(t,e,i){var n=this.viewMatrix;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this.viewMatrixDirty=!0,this},viewTranslate:function(t,e,i){var n=this.viewMatrix;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this.viewMatrixDirty=!0,this},viewRotateX:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this.viewMatrixDirty=!0,this},viewRotateY:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this.viewMatrixDirty=!0,this},viewRotateZ:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this.viewMatrixDirty=!0,this},viewLoad2D:function(t){var e=this.viewMatrix;return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=0,e[4]=t[2],e[5]=t[3],e[6]=0,e[7]=0,e[8]=t[4],e[9]=t[5],e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this.viewMatrixDirty=!0,this},viewLoad:function(t){var e=this.viewMatrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this.viewMatrixDirty=!0,this},projIdentity:function(){var t=this.projectionMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.projectionMatrixDirty=!0,this},projOrtho:function(t,e,i,n,s,r){var o=this.projectionMatrix,a=1/(t-e),h=1/(i-n),l=1/(s-r);return o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this.projectionMatrixDirty=!0,this},projPersp:function(t,e,i,n){var s=this.projectionMatrix,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this.projectionMatrixDirty=!0,this}};t.exports=i},function(t,e){t.exports=["#define SHADER_NAME PHASER_FORWARD_DIFFUSE_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.rgb * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," float alpha = mainColor.a;",""," if (!uInvertMaskAlpha)"," {"," alpha *= (maskColor.a);"," }"," else"," {"," alpha *= (1.0 - maskColor.a);"," }",""," gl_FragColor = vec4(mainColor.rgb * alpha, alpha);","}",""].join("\n")},function(t,e,i){var n=i(348),s=i(24),r=i(26),o=i(168);t.exports=function(t){var e,a,h=t.config;if(h.renderType!==r.HEADLESS)if(h.renderType===r.CANVAS||h.renderType!==r.CANVAS&&!o.webGL){if(!o.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");h.renderType=r.CANVAS}else h.renderType=r.WEBGL;h.antialias||s.disableSmoothing(),h.canvas?(t.canvas=h.canvas,t.canvas.width=t.config.width,t.canvas.height=t.config.height):t.canvas=s.create(t,h.width*h.resolution,h.height*h.resolution,h.renderType),h.canvasStyle&&(t.canvas.style=h.canvasStyle),h.antialias||n.setCrisp(t.canvas),t.canvas.style.width=(h.width*h.zoom).toString()+"px",t.canvas.style.height=(h.height*h.zoom).toString()+"px",h.renderType!==r.HEADLESS&&(e=i(426),a=i(423),h.renderType===r.WEBGL?t.renderer=new a(t):(t.renderer=new e(t),t.context=t.renderer.gameContext))}},function(t,e){var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){var t,e=["requestFullscreen","requestFullScreen","webkitRequestFullscreen","webkitRequestFullScreen","msRequestFullscreen","msRequestFullScreen","mozRequestFullScreen","mozRequestFullscreen"],n=document.createElement("div");for(t=0;t<e.length;t++)if(n[e[t]]){i.available=!0,i.request=e[t];break}var s=["cancelFullScreen","exitFullscreen","webkitCancelFullScreen","webkitExitFullscreen","msCancelFullScreen","msExitFullscreen","mozCancelFullScreen","mozExitFullscreen"];if(i.available)for(t=0;t<s.length;t++)if(document[s[t]]){i.cancel=s[t];break}return window.Element&&Element.ALLOW_KEYBOARD_INPUT&&(i.keyboard=!0),i}()},function(t,e){var i={h264Video:!1,hlsVideo:!1,mp4Video:!1,oggVideo:!1,vp9Video:!1,webmVideo:!1};t.exports=function(){var t=document.createElement("video"),e=!!t.canPlayType;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(i.oggVideo=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.h264Video=!0,i.mp4Video=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(i.webmVideo=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(i.vp9Video=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.hlsVideo=!0))}catch(t){}return i}()},function(t,e,i){var n=i(118),s={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){s.audioData=!!window.Audio,s.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(s.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(s.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(s.mp3=!0),t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(s.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(s.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(s.webm=!0),""!==t.canPlayType('audio/mp4;codecs="ec-3"')))if(n.edge)s.dolby=!0;else if(n.safari&&n.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e,i){var n=i(92),s=i(118),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),n.cocoonJS||("onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},function(t,e,i){var n=i(0),s=i(26),r=i(340),o=i(2),a=i(4),h=i(8),l=i(16),u=i(1),c=i(167),d=i(178),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",null),this.scaleMode=a(t,"scaleMode",0),this.expandParent=a(t,"expandParent",!1),this.minWidth=a(t,"minWidth",0),this.maxWidth=a(t,"maxWidth",0),this.minHeight=a(t,"minHeight",0),this.maxHeight=a(t,"maxHeight",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode),this.expandParent=a(e,"mode",this.expandParent),this.minWidth=a(e,"min.width",this.minWidth),this.maxWidth=a(e,"max.width",this.maxWidth),this.minHeight=a(e,"min.height",this.minHeight),this.maxHeight=a(e,"max.height",this.maxHeight)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND.init(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.autoResize=a(i,"autoResize",!0),this.antialias=a(i,"antialias",!0),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",!1),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.preserveDrawingBuffer=a(i,"preserveDrawingBuffer",!1),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3),this.maxLights=a(i,"maxLights",10);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){var n=i(169),s=i(381),r=i(379),o=i(24),a=i(0),h=i(903),l=i(898),u=i(123),c=i(891),d=i(340),f=i(344),p=i(11),g=i(338),v=i(15),y=i(331),m=i(329),x=i(325),w=i(318),b=i(878),T=i(877),S=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new p,this.anims=new s(this),this.textures=new w(this),this.cache=new r(this),this.registry=new u(this),this.input=new g(this,this.config),this.scene=new m(this,this.config.sceneConfig),this.device=d,this.sound=x.create(this),this.loop=new b(this,this.config.fps),this.plugins=new y(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isOver=!0,f(this.boot.bind(this))},boot:function(){v.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),l(this),c(this),n(this.canvas,this.config.parent),this.events.emit("boot"),this.events.once("texturesready",this.texturesReady,this)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit("ready"),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),T(this);var t=this.events;t.on("hidden",this.onHidden,this),t.on("visible",this.onVisible,this),t.on("blur",this.onBlur,this),t.on("focus",this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e);var n=this.renderer;n.preRender(),i.emit("prerender",n,t,e),this.scene.render(n),n.postRender(),i.emit("postrender",n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e),i.emit("prerender"),i.emit("postrender")},onHidden:function(){this.loop.pause(),this.events.emit("pause")},onVisible:function(){this.loop.resume(),this.events.emit("resume")},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},resize:function(t,e){this.config.width=t,this.config.height=e,this.renderer.resize(t,e),this.input.resize(),this.scene.resize(t,e),this.events.emit("resize",t,e)},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit("destroy"),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=S},function(t,e,i){var n=i(0),s=i(11),r=i(15),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){t.exports={EventEmitter:i(905)}},function(t,e){var i,n,s=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var h,l=[],u=!1,c=-1;function d(){u&&h&&(u=!1,h.length?l=h.concat(l):c=-1,l.length&&f())}function f(){if(!u){var t=a(d);u=!0;for(var e=l.length;e;){for(h=l,l=[];++c<e;)h&&h[c].run();c=-1,e=l.length}h=null,u=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new p(t,e)),1!==l.length||u||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=g,s.addListener=g,s.once=g,s.off=g,s.removeListener=g,s.removeAllListeners=g,s.emit=g,s.prependListener=g,s.prependOnceListener=g,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(t,e,i){var n={AddToDOM:i(169),DOMContentLoaded:i(344),ParseXML:i(343),RemoveFromDOM:i(342),RequestAnimationFrame:i(341)};t.exports=n},function(t,e,i){t.exports={BitmapMask:i(394),GeometryMask:i(393)}},function(t,e,i){var n=i(346);t.exports=function(t,e,i,s,r){return void 0===s&&(s=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+n(s)+n(t)+n(e)+n(i)}},function(t,e,i){var n=i(170),s=i(37);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var n=i(119),s=function(t,e,i,s,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:n(t,s,l),g:n(e,r,l),b:n(i,o,l)}};t.exports={RGBWithRGB:s,ColorWithRGB:function(t,e,i,n,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),s(t.r,t.g,t.b,e,i,n,r,o)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),s(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var n=i(176);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],s=0;s<=359;s++)i.push(n(s/359,t,e));return i}},function(t,e,i){var n=i(37),s=i(345);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=s(l,h,t+1/3),o=s(l,h,t),a=s(l,h,t-1/3)}return(new n).setGLTo(r,o,a,1)}},function(t,e){t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e){t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach(function(i){t.style[i+"user-select"]=e}),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},function(t,e,i){t.exports={CanvasInterpolation:i(348),CanvasPool:i(24),Smoothing:i(120),TouchAction:i(917),UserSelect:i(916)}},function(t,e){t.exports=function(t){return t.height*t.originY}},function(t,e){t.exports=function(t){return t.width*t.originX}},function(t,e,i){t.exports={CenterOn:i(411),GetBottom:i(48),GetCenterX:i(75),GetCenterY:i(72),GetLeft:i(46),GetOffsetX:i(920),GetOffsetY:i(919),GetRight:i(44),GetTop:i(42),SetBottom:i(47),SetCenterX:i(74),SetCenterY:i(73),SetLeft:i(45),SetRight:i(43),SetTop:i(41)}},function(t,e,i){var n=i(44),s=i(42),r=i(47),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(46),s=i(42),r=i(47),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)-a),t}},function(t,e,i){var n=i(75),s=i(42),r=i(47),o=i(74);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(44),s=i(42),r=i(45),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(44),r=i(73),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(44),r=i(47),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(46),s=i(42),r=i(43),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(46),r=i(73),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(46),r=i(47),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(44),r=i(43),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(46),r=i(45),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(75),r=i(74),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){t.exports={BottomCenter:i(933),BottomLeft:i(932),BottomRight:i(931),LeftBottom:i(930),LeftCenter:i(929),LeftTop:i(928),RightBottom:i(927),RightCenter:i(926),RightTop:i(925),TopCenter:i(924),TopLeft:i(923),TopRight:i(922)}},function(t,e,i){t.exports={BottomCenter:i(415),BottomLeft:i(414),BottomRight:i(413),Center:i(412),LeftCenter:i(410),QuickSet:i(416),RightCenter:i(409),TopCenter:i(408),TopLeft:i(407),TopRight:i(406)}},function(t,e,i){var n=i(193),s=i(20),r={In:i(935),To:i(934)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={Align:i(936),Bounds:i(921),Canvas:i(918),Color:i(347),Masks:i(909)}},function(t,e,i){var n=i(0),s=i(123),r=i(15),o=new n({Extends:s,initialize:function(t){s.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.events=this.systems.events,this.events.once("destroy",this.destroy,this)},start:function(){this.events.once("shutdown",this.shutdown,this)},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){s.prototype.destroy.call(this),this.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",o,"data"),t.exports=o},function(t,e,i){t.exports={DataManager:i(123),DataManagerPlugin:i(938)}},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t,e){this.active=!1,this.p0=new s(t,e)},getPoint:function(t,e){return void 0===e&&(e=new s),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},function(t,e,i){var n=i(0),s=i(355),r=i(353),o=i(5),a=i(352),h=i(940),l=i(351),u=i(9),c=i(349),d=i(3),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,n,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,n),h=new d(r,o),l=new d(t,e)),this.add(new s(u,a,h,l))},quadraticBezierTo:function(t,e,i,n){var s,r,o=this.getEndPoint();return t instanceof d?(s=t,r=e):(s=new d(i,n),r=new d(t,e)),this.add(new l(o,s,r))},draw:function(t,e){for(var i=0;i<this.curves.length;i++){var n=this.curves[i];n.active&&n.draw(t,e)}return t},ellipseTo:function(t,e,i,n,s,o){var a=new r(0,0,t,e,i,n,s,o),h=this.getEndPoint(this._tmpVec2A),l=a.getStartPoint(this._tmpVec2B);return h.subtract(l),a.x=h.x,a.y=h.y,this.add(a)},fromJSON:function(t){this.curves=[],this.cacheLengths=[],this.startPoint.set(t.x,t.y),this.autoClose=t.autoClose;for(var e=0;e<t.curves.length;e++){var i=t.curves[e];switch(i.type){case"LineCurve":this.add(a.fromJSON(i));break;case"EllipseCurve":this.add(r.fromJSON(i));break;case"SplineCurve":this.add(c.fromJSON(i));break;case"CubicBezierCurve":this.add(s.fromJSON(i));break;case"QuadraticBezierCurve":this.add(l.fromJSON(i))}}return this},getBounds:function(t,e){void 0===t&&(t=new u),void 0===e&&(e=16),t.x=Number.MAX_VALUE,t.y=Number.MAX_VALUE;for(var i=new u,n=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,r=0;r<this.curves.length;r++){var o=this.curves[r];o.active&&(o.getBounds(i,e),t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),n=Math.max(n,i.right),s=Math.max(s,i.bottom))}return t.right=n,t.bottom=s,t},getCurveLengths:function(){if(this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0;i<this.curves.length;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t},getEndPoint:function(t){return void 0===t&&(t=new d),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s<n.length;){if(n[s]>=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n<this.curves.length;n++){var s=this.curves[n];if(s.active)for(var r=s.getResolution(t),o=s.getPoints(r),a=0;a<o.length;a++){var h=o[a];e&&e.equals(h)||(i.push(h),e=h)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e<this.curves.length;e++)t.push(this.curves[e].toJSON());return{type:"Path",x:this.startPoint.x,y:this.startPoint.y,autoClose:this.autoClose,curves:t}},updateArcLengths:function(){this.cacheLengths=[],this.getCurveLengths()},destroy:function(){this.curves.length=0,this.cacheLengths.length=0,this.startPoint=void 0}});o.register("path",function(t,e){return new f(t,e)}),t.exports=f},function(t,e,i){t.exports={Path:i(941),CubicBezier:i(355),Curve:i(70),Ellipse:i(353),Line:i(352),QuadraticBezier:i(351),Spline:i(349)}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},function(t,e){t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},function(t,e){t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},function(t,e,i){t.exports={ARNE16:i(356),C64:i(946),CGA:i(945),JMP:i(944),MSX:i(943)}},function(t,e,i){t.exports={GenerateTexture:i(357),Palettes:i(947)}},function(t,e,i){var n=i(378),s=i(0),r=i(2),o=i(15),a=i(39),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.baseScale=1,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.systems.events.once("destroy",this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on("update",this.update,this),e.once("shutdown",this.shutdown,this)},add:function(t,e,i,s,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===s&&(s=this.scene.sys.game.config.height),void 0===r&&(r=!1),void 0===o&&(o="");var a=new n(t,e,i,s);return a.setName(o),a.setScene(this.scene),a.setRoundPixels(this.roundPixels),a.id=this.getNextID(),this.cameras.push(a),r&&(this.main=a),a},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var n=!1,s=0;s<t.length;s++){var r=t[s];r&&r.id===e&&(n=!0)}if(!n)return e;e<<=1}return 0},getTotal:function(t){void 0===t&&(t=!1);for(var e=0,i=this.cameras,n=0;n<i.length;n++){var s=i[n];(!t||t&&s.visible)&&e++}return e},fromJSON:function(t){Array.isArray(t)||(t=[t]);for(var e=this.scene.sys.game.config.width,i=this.scene.sys.game.config.height,n=0;n<t.length;n++){var s=t[n],o=r(s,"x",0),a=r(s,"y",0),h=r(s,"width",e),l=r(s,"height",i),u=this.add(o,a,h,l);u.name=r(s,"name",""),u.zoom=r(s,"zoom",1),u.rotation=r(s,"rotation",0),u.scrollX=r(s,"scrollX",0),u.scrollY=r(s,"scrollY",0),u.roundPixels=r(s,"roundPixels",!1),u.visible=r(s,"visible",!0);var c=r(s,"backgroundColor",!1);c&&u.setBackgroundColor(c);var d=r(s,"bounds",null);if(d){var f=r(d,"x",0),p=r(d,"y",0),g=r(d,"width",e),v=r(d,"height",i);u.setBounds(f,p,g,v)}}return this},getCamera:function(t){for(var e=this.cameras,i=0;i<e.length;i++)if(e[i].name===t)return e[i];return null},getCamerasBelowPointer:function(t){for(var e=this.cameras,i=t.x,n=t.y,s=[],r=0;r<e.length;r++){var o=e[r];o.visible&&o.inputEnabled&&a(o,i,n)&&s.unshift(o)}return s},remove:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0,n=this.cameras,s=0;s<t.length;s++){var r=n.indexOf(t[s]);-1!==r&&(e&&n[r].destroy(),n.splice(r,1),i++)}return!this.main&&n[0]&&(this.main=n[0]),i},render:function(t,e,i){for(var n=this.scene,s=this.cameras,r=this.baseScale,o=t.config.resolution,a=0;a<this.cameras.length;a++){var h=s[a];h.visible&&h.alpha>0&&(h.preRender(r,o),t.render(n,e,i,h))}},resetAll:function(){for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();return this.cameras=[],this.main=this.add(),this.main},update:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].update(t,e)},resize:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].setSize(t,e)},shutdown:function(){this.main=void 0;for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();this.cameras=[];var e=this.systems.events;e.off("update",this.update,this),e.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});o.register("CameraManager",h,"cameras"),t.exports=h},function(t,e,i){var n=i(23),s=i(0),r=i(174),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,o){void 0===e&&(e=1e3),void 0===i&&(i=r.Linear),void 0===n&&(n=!1),void 0===s&&(s=null),void 0===o&&(o=this.camera.scene);var a=this.camera;return!n&&this.isRunning?a:(this.isRunning=!0,this.duration=e,this.progress=0,this.source=a.zoom,this.destination=t,"string"==typeof i&&r.hasOwnProperty(i)?this.ease=r[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=s,this._onUpdateScope=o,this.camera.emit("camerazoomstart",this.camera,this,e,t),a)},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._elapsed<this.duration?(this.camera.zoom=this.source+(this.destination-this.source)*this.ease(this.progress),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.camera.zoom)):(this.camera.zoom=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.destination),this.effectComplete()))},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit("camerazoomcomplete",this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=o},function(t,e,i){var n=i(23),s=i(0),r=i(3),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new r,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=this.camera.scene),!i&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=s,this.camera.emit("camerashakestart",this.camera,this,t,e),this.camera)},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration){var i=this.intensity,s=this.camera._cw,r=this.camera._ch,o=this.camera.zoom;this._offsetX=(Math.random()*i.x*s*2-i.x*s)*o,this._offsetY=(Math.random()*i.y*r*2-i.y*r)*o,this.camera.roundPixels&&(this._offsetX|=0,this._offsetY|=0)}else this.effectComplete()},effectComplete:function(){this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit("camerashakecomplete",this.camera,this)},reset:function(){this.isRunning=!1,this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.intensity=null}});t.exports=o},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e,i){var n=i(23),s=i(0),r=i(3),o=i(174),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new r,this.current=new r,this.destination=new r,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,a){void 0===i&&(i=1e3),void 0===n&&(n=o.Linear),void 0===s&&(s=!1),void 0===r&&(r=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!s&&this.isRunning?h:(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(h.scrollX,h.scrollY),this.destination.set(t,e),h.getScroll(t,e,this.current),"string"==typeof n&&o.hasOwnProperty(n)?this.ease=o[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=r,this._onUpdateScope=a,this.camera.emit("camerapanstart",this.camera,this,i,t,e),h)},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsed<this.duration){var r=this.ease(i);s.getScroll(this.destination.x,this.destination.y,this.current);var o=this.source.x+(this.current.x-this.source.x)*r,a=this.source.y+(this.current.y-this.source.y)*r;s.setScroll(o,a),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,i,o,a)}else s.centerOn(this.destination.x,this.destination.y),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,i,s.scrollX,s.scrollY),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit("camerapancomplete",this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=a},function(t,e,i){var n=i(23),s=new(i(0))({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,o){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===n&&(n=255),void 0===s&&(s=!1),void 0===r&&(r=null),void 0===o&&(o=this.camera.scene),!s&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=n,this.alpha=1,this._elapsed=0,this._onUpdate=r,this._onUpdateScope=o,this.camera.emit("cameraflashstart",this.camera,this,t,e,i,n),this.camera)},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=1-this.progress:this.effectComplete())},postRenderCanvas:function(t){if(!this.isRunning)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e._cx,e._cy,e._cw,e._ch),!0},postRenderWebGL:function(t,e){if(!this.isRunning)return!1;var i=this.camera,n=this.red/255,s=this.blue/255,r=this.green/255;return t.drawFillRect(i._cx,i._cy,i._cw,i._ch,e(n,r,s,1),this.alpha),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit("cameraflashcomplete",this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=s},function(t,e,i){var n=i(23),s=new(i(0))({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,o,a){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!r&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a;var h=t?"camerafadeoutstart":"camerafadeinstart";return this.camera.emit(h,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=this.direction?this.progress:1-this.progress:this.effectComplete())},postRenderCanvas:function(t){if(!this.isRunning&&!this.isComplete)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e._cx,e._cy,e._cw,e._ch),!0},postRenderWebGL:function(t,e){if(!this.isRunning&&!this.isComplete)return!1;var i=this.camera,n=this.red/255,s=this.blue/255,r=this.green/255;return t.drawFillRect(i._cx,i._cy,i._cw,i._ch,e(n,r,s,1),this.alpha),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.isComplete=!0;var t=this.direction?"camerafadeoutcomplete":"camerafadeincomplete";this.camera.emit(t,this.camera,this)},reset:function(){this.isRunning=!1,this.isComplete=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=s},function(t,e,i){t.exports={Camera:i(378),CameraManager:i(949),Effects:i(370)}},function(t,e,i){var n=i(0),s=i(4),r=new n({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.accelX=0,this.accelY=0;var e=s(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=s(t,"acceleration.x",0),this.accelY=s(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=s(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=s(t,"drag.x",0),this.dragY=s(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var n=s(t,"maxSpeed",null);"number"==typeof n?(this.maxSpeedX=n,this.maxSpeedY=n):(this.maxSpeedX=s(t,"maxSpeed.x",0),this.maxSpeedY=s(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.1&&(e.zoom=.1))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){var n=i(0),s=i(4),r=new n({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.speedX=0,this.speedY=0;var e=s(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=s(t,"speed.x",0),this.speedY=s(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoom<.1&&(e.zoom=.1)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed)}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={FixedKeyControl:i(989),SmoothedKeyControl:i(988)}},function(t,e,i){t.exports={Controls:i(990),Scene2D:i(987)}},function(t,e,i){t.exports={BaseCache:i(380),CacheManager:i(379)}},function(t,e,i){t.exports={Animation:i(384),AnimationFrame:i(382),AnimationManager:i(381)}},function(t,e,i){var n=i(53);t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=0;s<t.length;s++){var r=t[s];r.x=n(r.x,e.left-i,e.right+i),r.y=n(r.y,e.top-i,e.bottom+i)}return t}},function(t,e){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].visible=!t[e].visible;return t}},function(t,e){t.exports=function(t,e,i,n,s){void 0===s&&(s=!1);var r,o=Math.abs(n-i)/t.length;if(s)for(r=0;r<t.length;r++)t[r][e]+=r*o;else for(r=0;r<t.length;r++)t[r][e]=r*o;return t}},function(t,e,i){var n=i(181);t.exports=function(t,e,i,s,r){void 0===r&&(r=!1);var o,a=Math.abs(s-i)/t.length;if(r)for(o=0;o<t.length;o++)t[o][e]+=n(o*a,i,s);else for(o=0;o<t.length;o++)t[o][e]=n(o*a,i,s);return t}},function(t,e,i){var n=i(182);t.exports=function(t,e,i,s,r){void 0===r&&(r=!1);var o,a=Math.abs(s-i)/t.length;if(r)for(o=0;o<t.length;o++)t[o][e]+=n(o*a,i,s);else for(o=0;o<t.length;o++)t[o][e]=n(o*a,i,s);return t}},function(t,e,i){var n=i(122);t.exports=function(t){return n(t)}},function(t,e,i){var n=i(3);t.exports=function(t,e,i,s,r){var o,a,h,l,u,c;if(void 0===s&&(s=0),void 0===r&&(r=new n),t.length>1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h<t.length;h++)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[0].x=e,t[0].y=i}else o=t[0].x,a=t[0].y,t[0].x=e,t[0].y=i;return r.x=o,r.y=a,r}},function(t,e,i){var n=i(25);t.exports=function(t,e,i,s,r){return n(t,"y",e,i,s,r)}},function(t,e,i){var n=i(25);t.exports=function(t,e,i,s,r,o,a){return void 0!==i&&null!==i||(i=e),n(t,"x",e,s,o,a),n(t,"y",i,r,o,a)}},function(t,e,i){var n=i(25);t.exports=function(t,e,i,s,r){return n(t,"x",e,i,s,r)}},function(t,e,i){var n=i(25);t.exports=function(t,e,i,s){return n(t,"visible",e,0,i,s)}},function(t,e){t.exports=function(t,e,i,n,s){for(var r=0;r<t.length;r++)t[r].setTint(e,i,n,s);return t}},function(t,e,i){var n=i(25);t.exports=function(t,e,i,s,r){return n(t,"scaleY",e,i,s,r)}},function(t,e,i){var n=i(25);t.exports=function(t,e,i,s,r){return n(t,"scaleX",e,i,s,r)}},function(t,e,i){var n=i(25);t.exports=function(t,e,i,s,r,o,a){return void 0!==i&&null!==i||(i=e),n(t,"scaleX",e,s,o,a),n(t,"scaleY",i,r,o,a)}},function(t,e,i){var n=i(25);t.exports=function(t,e,i,s,r){return n(t,"rotation",e,i,s,r)}},function(t,e,i){var n=i(25);t.exports=function(t,e,i,s,r,o,a){return void 0!==i&&null!==i||(i=e),n(t,"originX",e,s,o,a),n(t,"originY",i,r,o,a)}},function(t,e){t.exports=function(t,e,i){for(var n=0;n<t.length;n++)t[n].setInteractive(e,i);return t}},function(t,e,i){var n=i(25);t.exports=function(t,e,i,s,r){return n(t,"depth",e,i,s,r)}},function(t,e,i){var n=i(25);t.exports=function(t,e,i,s){return n(t,"blendMode",e,0,i,s)}},function(t,e,i){var n=i(25);t.exports=function(t,e,i,s,r){return n(t,"alpha",e,i,s,r)}},function(t,e,i){var n=i(32);t.exports=function(t,e,i,s,r){return n(t,"scaleY",e,i,s,r)}},function(t,e,i){var n=i(32);t.exports=function(t,e,i,s,r,o,a){return void 0!==i&&null!==i||(i=e),n(t,"scaleX",e,s,o,a),n(t,"scaleY",i,r,o,a)}},function(t,e,i){var n=i(32);t.exports=function(t,e,i,s,r){return n(t,"scaleX",e,i,s,r)}},function(t,e,i){var n=i(183);t.exports=function(t,e,i,s){var r=e.x,o=e.y;if(0===s)return t;for(var a=0;a<t.length;a++)n(t[a],r,o,i,s);return t}},function(t,e,i){var n=i(183),s=i(52);t.exports=function(t,e,i){for(var r=e.x,o=e.y,a=0;a<t.length;a++){var h=t[a];n(h,r,o,i,Math.max(1,s(h.x,h.y,r,o)))}return t}},function(t,e,i){var n=i(32);t.exports=function(t,e,i,s,r){return n(t,"rotation",e,i,s,r)}},function(t,e,i){var n=i(184);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(187);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(188);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(185);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(191);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e){t.exports=function(t,e,i){for(var n=0;n<t.length;n++)t[n].anims.play(e,i);return t}},function(t,e,i){var n=i(385);t.exports=function(t,e,i){var s=n({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),r=n({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),o=n({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);s.pop(),r.pop(),o.pop();for(var a=(s=s.concat(r,o)).length/t.length,h=0,l=0;l<t.length;l++){var u=t[l],c=s[Math.floor(h)];u.x=c.x,u.y=c.y,h+=a}return t}},function(t,e,i){var n=i(388),s=i(387),r=i(386);t.exports=function(t,e,i){void 0===i&&(i=0);var o=n(e,!1,t.length);i>0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a<t.length;a++)t[a].x=o[a].x,t[a].y=o[a].y;return t}},function(t,e,i){var n=i(189);t.exports=function(t,e){for(var i=n(e,t.length),s=0;s<t.length;s++){var r=t[s],o=i[s];r.x=o.x,r.y=o.y}return t}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var s=i,r=(n-i)/t.length,o=e.width/2,a=e.height/2,h=0;h<t.length;h++)t[h].x=e.x+o*Math.cos(s),t[h].y=e.y+a*Math.sin(s),s+=r;return t}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var s=i,r=(n-i)/t.length,o=0;o<t.length;o++)t[o].x=e.x+e.radius*Math.cos(s),t[o].y=e.y+e.radius*Math.sin(s),s+=r;return t}},function(t,e,i){var n=i(32);t.exports=function(t,e,i,s,r){return n(t,"y",e,i,s,r)}},function(t,e,i){var n=i(32);t.exports=function(t,e,i,s,r,o,a){return void 0!==i&&null!==i||(i=e),n(t,"x",e,s,o,a),n(t,"y",i,r,o,a)}},function(t,e,i){var n=i(32);t.exports=function(t,e,i,s,r){return n(t,"x",e,i,s,r)}},function(t,e,i){var n=i(32);t.exports=function(t,e,i,s,r){return n(t,"alpha",e,i,s,r)}},function(t,e){var i=function(t){return(t>>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){var i={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=i},function(t,e){var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.frame.realWidth},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return this.scaleY*this.frame.realHeight},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e,i){var n=i(94),s={_scaleMode:n.DEFAULT,scaleMode:{get:function(){return this._scaleMode},set:function(t){t!==n.LINEAR&&t!==n.NEAREST||(this._scaleMode=t)}},setScaleMode:function(t){return this.scaleMode=t,this}};t.exports=s},function(t,e){var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=Math.round(this.originX*this.width),this._displayOriginY=Math.round(this.originY*this.height),this}};t.exports=i},function(t,e,i){var n=i(9),s=i(396),r=i(3),o={getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getTopRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBounds:function(t){var e,i,s,r,o,a,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),s=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),s=t.x,r=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,s,o,h),t.y=Math.min(i,r,a,l),t.width=Math.max(e,s,o,h)-t.x,t.height=Math.max(i,r,a,l)-t.y,t}};t.exports=o},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e,i){var n=i(416),s=i(193),r=i(2),o=i(1),a=new(i(125))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=r(e,"width",-1),o=r(e,"height",-1),h=r(e,"cellWidth",1),l=r(e,"cellHeight",h),u=r(e,"position",s.TOP_LEFT),c=r(e,"x",0),d=r(e,"y",0),f=0,p=0,g=i*h,v=o*l;a.setPosition(c,d),a.setSize(h,l);for(var y=0;y<t.length;y++)if(n(t[y],a,u),-1===i)p+=l,a.y+=l,p===v&&(p=0,a.x+=h,a.y=d);else if(-1===o)f+=h,a.x+=h,f===g&&(f=0,a.x=c,a.y+=l);else if(f+=h,a.x+=h,f===g&&(f=0,p+=l,a.x=c,a.y+=l,p===v))break;return t}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=i;n<t.length;n++){var s=t[n],r=!0;for(var o in e)s[o]!==e[o]&&(r=!1);if(r)return s}return null}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=i;n<t.length;n++){var s=t[n],r=!0;for(var o in e)s[o]!==e[o]&&(r=!1);if(r)return s}return null}},function(t,e){t.exports=function(t,e,i){for(var n=0;n<t.length;n++){var s=t[n];e.call(i,s)}return t}},function(t,e,i){var n=i(32);t.exports=function(t,e,i,s,r){return n(t,"angle",e,i,s,r)}},function(t,e){if("function"!=typeof window.Uint32Array&&"object"!=typeof window.Uint32Array){var i=function(t){var e=new Array;window[t]=function(t){if("number"==typeof t){Array.call(this,t),this.length=t;for(var e=0;e<this.length;e++)this[e]=0}else{Array.call(this,t.length),this.length=t.length;for(e=0;e<this.length;e++)this[e]=t[e]}},window[t].prototype=e,window[t].constructor=window[t]};i("Float32Array"),i("Uint32Array"),i("Uint16Array"),i("Int16Array"),i("ArrayBuffer")}},function(t,e,i){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var i=Date.now(),n=["ms","moz","webkit","o"],s=0;s<n.length&&!t.requestAnimationFrame;++s)t.requestAnimationFrame=t[n[s]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[n[s]+"CancelAnimationFrame"]||t[n[s]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),n=16+i-e;return n<0&&(n=0),i=e,setTimeout(function(){i=Date.now(),t(performance.now())},n)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}).call(this,i(200))},function(t,e){!function(){if("performance"in window==!1&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==!1){var t=Date.now();performance.timing&&performance.timing.navigationStart&&(t=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-t}}}()},function(t,e){Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)})},function(t,e){window.console||(window.console={},window.console.log=window.console.assert=function(){},window.console.warn=window.console.assert=function(){})},function(t,e){!function(){function t(t){t&&(t.setTargetAtTime||(t.setTargetAtTime=t.setTargetValueAtTime))}window.hasOwnProperty("webkitAudioContext")&&!window.hasOwnProperty("AudioContext")&&(window.AudioContext=webkitAudioContext,AudioContext.prototype.hasOwnProperty("createGain")||(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),AudioContext.prototype.hasOwnProperty("createDelay")||(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode),AudioContext.prototype.hasOwnProperty("createScriptProcessor")||(AudioContext.prototype.createScriptProcessor=AudioContext.prototype.createJavaScriptNode),AudioContext.prototype.hasOwnProperty("createPeriodicWave")||(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable),AudioContext.prototype.internal_createGain=AudioContext.prototype.createGain,AudioContext.prototype.createGain=function(){var e=this.internal_createGain();return t(e.gain),e},AudioContext.prototype.internal_createDelay=AudioContext.prototype.createDelay,AudioContext.prototype.createDelay=function(e){var i=e?this.internal_createDelay(e):this.internal_createDelay();return t(i.delayTime),i},AudioContext.prototype.internal_createBufferSource=AudioContext.prototype.createBufferSource,AudioContext.prototype.createBufferSource=function(){var e=this.internal_createBufferSource();return e.start?(e.internal_start=e.start,e.start=function(t,i,n){void 0!==n?e.internal_start(t||0,i,n):e.internal_start(t||0,i||0)}):e.start=function(t,e,i){e||i?this.noteGrainOn(t||0,e,i):this.noteOn(t||0)},e.stop?(e.internal_stop=e.stop,e.stop=function(t){e.internal_stop(t||0)}):e.stop=function(t){this.noteOff(t||0)},t(e.playbackRate),e},AudioContext.prototype.internal_createDynamicsCompressor=AudioContext.prototype.createDynamicsCompressor,AudioContext.prototype.createDynamicsCompressor=function(){var e=this.internal_createDynamicsCompressor();return t(e.threshold),t(e.knee),t(e.ratio),t(e.reduction),t(e.attack),t(e.release),e},AudioContext.prototype.internal_createBiquadFilter=AudioContext.prototype.createBiquadFilter,AudioContext.prototype.createBiquadFilter=function(){var e=this.internal_createBiquadFilter();return t(e.frequency),t(e.detune),t(e.Q),t(e.gain),e},AudioContext.prototype.hasOwnProperty("createOscillator")&&(AudioContext.prototype.internal_createOscillator=AudioContext.prototype.createOscillator,AudioContext.prototype.createOscillator=function(){var e=this.internal_createOscillator();return e.start?(e.internal_start=e.start,e.start=function(t){e.internal_start(t||0)}):e.start=function(t){this.noteOn(t||0)},e.stop?(e.internal_stop=e.stop,e.stop=function(t){e.internal_stop(t||0)}):e.stop=function(t){this.noteOff(t||0)},e.setPeriodicWave||(e.setPeriodicWave=e.setWaveTable),t(e.frequency),t(e.detune),e})),window.hasOwnProperty("webkitOfflineAudioContext")&&!window.hasOwnProperty("OfflineAudioContext")&&(window.OfflineAudioContext=webkitOfflineAudioContext)}()},function(t,e){Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)})},function(t,e){Array.prototype.forEach||(Array.prototype.forEach=function(t){"use strict";if(void 0===this||null===this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s<i;s++)s in e&&t.call(n,e[s],s,e)})},function(t,e,i){i(1058),i(1057),i(1056),i(1055),i(1054),i(1053),i(1052),i(1051)},function(t,e,i){var n=i(126),s=i(0),r=i(33),o=i(137),a=i(1061),h=i(11),l=i(2),u=i(4),c=i(67),d=i(195),f=i(504),p=i(499),g=i(81),v=new s({Extends:h,initialize:function(t,e){h.call(this),this.scene=t,this.engine=a.create(e),this.localWorld=this.engine.world;var i=u(e,"gravity",null);if(i&&this.setGravity(i.x,i.y,i.scale),this.walls={left:null,right:null,top:null,bottom:null},l(e,"setBounds",!1)){var n=e.setBounds;if("boolean"==typeof n)this.setBounds();else{var s=l(n,"x",0),r=l(n,"y",0),o=l(n,"width",t.sys.game.config.width),c=l(n,"height",t.sys.game.config.height),d=l(n,"thickness",64),f=l(n,"left",!0),p=l(n,"right",!0),g=l(n,"top",!0),v=l(n,"bottom",!0);this.setBounds(s,r,o,c,d,f,p,g,v)}}this.enabled=u(e,"enabled",!0),this.correction=u(e,"correction",1),this.getDelta=u(e,"getDelta",this.update60Hz),this.autoUpdate=u(e,"autoUpdate",!0),this.drawDebug=u(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:l(e,"debugShowBody",!0),debugShowStaticBody:l(e,"debugShowStaticBody",!0),debugShowVelocity:l(e,"debugShowVelocity",!0),bodyDebugColor:l(e,"debugBodyColor",16711935),bodyDebugFillColor:l(e,"bodyDebugFillColor",14919651),staticBodyDebugColor:l(e,"debugBodyColor",255),velocityDebugColor:l(e,"debugVelocityColor",65280),debugShowJoint:l(e,"debugShowJoint",!0),jointDebugColor:l(e,"debugJointColor",0),debugWireframes:l(e,"debugWireframes",!0),debugShowInternalEdges:l(e,"debugShowInternalEdges",!1),debugShowConvexHulls:l(e,"debugShowConvexHulls",!1),debugConvexHullColor:l(e,"debugConvexHullColor",11184810),debugShowSleeping:l(e,"debugShowSleeping",!1)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy()},setEventsProxy:function(){var t=this,e=this.engine;d.on(e,"beforeUpdate",function(e){t.emit("beforeupdate",e)}),d.on(e,"afterUpdate",function(e){t.emit("afterupdate",e)}),d.on(e,"collisionStart",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionstart",e,i,n)}),d.on(e,"collisionActive",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionactive",e,i,n)}),d.on(e,"collisionEnd",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionend",e,i,n)})},setBounds:function(t,e,i,n,s,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),void 0===s&&(s=128),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e,s,n),this.updateWall(o,"right",t+i,e,s,n),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];t?(o&&p.remove(this.localWorld,o),i+=s/2,n+=r/2,this.walls[e]=this.create(i,n,s,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&p.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,s,r){var o=n.rectangle(t,e,i,s,r);return p.add(this.localWorld,o),o},add:function(t){return p.add(this.localWorld,t),this},remove:function(t,e){var i=t.body?t.body:t;return o.removeBody(this.localWorld,i,e),this},removeConstraint:function(t,e){return o.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i<t.length;i++)new f(this,t[i],e);return this},nextGroup:function(t){return c.nextGroup(t)},nextCategory:function(){return c.nextCategory()},pause:function(){return this.enabled=!1,this.emit("pause"),this},resume:function(){return this.enabled=!0,this.emit("resume"),this},update:function(t,e){this.enabled&&this.autoUpdate&&a.update(this.engine,this.getDelta(t,e),this.correction)},step:function(t,e){a.update(this.engine,t,e)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},postUpdate:function(){if(this.drawDebug){this.debugGraphic.clear();var t=o.allBodies(this.localWorld);this.defaults.debugWireframes?(this.defaults.debugShowConvexHulls&&this.renderConvexHulls(t),this.renderWireframes(t)):this.renderBodies(t),this.defaults.debugShowJoint&&this.renderJoints()}},renderConvexHulls:function(t){var e=this.debugGraphic;e.lineStyle(1,this.defaults.debugConvexHullColor),e.beginPath();for(var i=0;i<t.length;i++){var n=t[i];if(n.render.visible&&1!==n.parts.length){e.moveTo(n.vertices[0].x,n.vertices[0].y);for(var s=1;s<n.vertices.length;s++)e.lineTo(n.vertices[s].x,n.vertices[s].y);e.lineTo(n.vertices[0].x,n.vertices[0].y)}}e.strokePath()},renderWireframes:function(t){var e=this.debugGraphic,i=this.defaults.debugShowInternalEdges;e.lineStyle(1,this.defaults.bodyDebugColor),e.beginPath();for(var n=0;n<t.length;n++){var s=t[n];if(s.render.visible)for(var r=s.parts.length>1?1:0;r<s.parts.length;r++){var o=s.parts[r],a=o.vertices.length;e.moveTo(o.vertices[0].x,o.vertices[0].y);for(var h=1;h<a;h++)!o.vertices[h-1].isInternal||i?e.lineTo(o.vertices[h].x,o.vertices[h].y):e.moveTo(o.vertices[h].x,o.vertices[h].y),o.vertices[h].isInternal&&!i&&e.moveTo(o.vertices[(h+1)%a].x,o.vertices[(h+1)%a].y);e.lineTo(o.vertices[0].x,o.vertices[0].y)}}e.strokePath()},renderBodies:function(t){var e,i,n,s,r=this.debugGraphic,o=this.defaults.debugShowInternalEdges||!this.defaults.debugWireframes,a=this.defaults.debugShowSleeping,h=this.defaults.debugWireframes;for(n=0;n<t.length;n++)if((e=t[n]).render.visible)for(s=e.parts.length>1?1:0;s<e.parts.length;s++)if((i=e.parts[s]).render.visible){if(a&&e.isSleeping?(r.lineStyle(1,this.defaults.bodyDebugColor,.5*i.render.opacity),r.fillStyle(this.defaults.bodyDebugColor,.5*i.render.opacity)):(r.lineStyle(1,this.defaults.bodyDebugColor,i.render.opacity),r.fillStyle(this.defaults.bodyDebugColor,i.render.opacity)),i.circleRadius)r.beginPath(),r.arc(i.position.x,i.position.y,i.circleRadius,0,2*Math.PI);else{r.beginPath(),r.moveTo(i.vertices[0].x,i.vertices[0].y);for(var l=i.vertices.length,u=1;u<l;u++)!i.vertices[u-1].isInternal||o?r.lineTo(i.vertices[u].x,i.vertices[u].y):r.moveTo(i.vertices[u].x,i.vertices[u].y),i.vertices[u].isInternal&&!o&&r.moveTo(i.vertices[(u+1)%i.vertices.length].x,i.vertices[(u+1)%i.vertices.length].y);r.lineTo(i.vertices[0].x,i.vertices[0].y),r.closePath()}h?r.strokePath():r.fillPath()}},renderJoints:function(){var t=this.debugGraphic;t.lineStyle(2,this.defaults.jointDebugColor);for(var e=o.allConstraints(this.localWorld),i=0;i<e.length;i++){var n=e[i];if(n.render.visible&&n.pointA&&n.pointB){n.render.lineWidth&&t.lineStyle(n.render.lineWidth,r.colorToNumber(n.render.strokeStyle));var s,a,h=n.bodyA,l=n.bodyB;if(s=h?g.add(h.position,n.pointA):n.pointA,"pin"===n.render.type)t.beginPath(),t.arc(s.x,s.y,3,0,2*Math.PI),t.closePath();else{if(a=l?g.add(l.position,n.pointB):n.pointB,t.beginPath(),t.moveTo(s.x,s.y),"spring"===n.render.type)for(var u,c=g.sub(a,s),d=g.perp(g.normalise(c)),f=Math.ceil(r.clamp(n.length/5,12,20)),p=1;p<f;p+=1)u=p%2==0?1:-1,t.lineTo(s.x+c.x*(p/f)+d.x*u*4,s.y+c.y*(p/f)+d.y*u*4);t.lineTo(a.x,a.y)}n.render.lineWidth&&t.strokePath(),n.render.anchors&&(t.fillStyle(r.colorToNumber(n.render.strokeStyle)),t.beginPath(),t.arc(s.x,s.y,6,0,2*Math.PI),t.arc(a.x,a.y,6,0,2*Math.PI),t.closePath(),t.fillPath())}}},fromPath:function(t,e){void 0===e&&(e=[]);return t.replace(/L?\s*([\-\d\.e]+)[\s,]*([\-\d\.e]+)*/gi,function(t,i,n){e.push({x:parseFloat(i),y:parseFloat(n)})}),e},shutdown:function(){d.off(this.engine),this.removeAllListeners(),p.clear(this.localWorld,!1),a.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=v},function(t,e,i){var n={};t.exports=n;var s=i(499),r=i(222),o=i(1062),a=i(1063),h=i(1088),l=i(1064),u=i(195),c=i(137),d=i(194),f=i(33),p=i(67);n.create=function(t,e){e=f.isElement(t)?e:t,t=f.isElement(t)?t:null,e=e||{},(t||e.render)&&f.warn("Engine.create: engine.render is deprecated (see docs)");var i={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},timing:{timestamp:0,timeScale:1},broadphase:{controller:l}},n=f.extend(i,e);if(t||n.render){var r={element:t,controller:Render};n.render=f.extend(r,n.render)}return n.render&&n.render.controller&&(n.render=n.render.controller.create(n.render)),n.render&&(n.render.engine=n),n.world=e.world||s.create(n.world),n.pairs=a.create(),n.broadphase=n.broadphase.controller.create(n.broadphase),n.metrics=n.metrics||{extended:!1},n.metrics=h.create(n.metrics),n},n.update=function(t,e,i){e=e||1e3/60,i=i||1;var s,l=t.world,f=t.timing,p=t.broadphase,g=[];f.timestamp+=e*f.timeScale;var v={timestamp:f.timestamp};u.trigger(t,"beforeUpdate",v);var y=c.allBodies(l),m=c.allConstraints(l);for(h.reset(t.metrics),t.enableSleeping&&r.update(y,f.timeScale),n._bodiesApplyGravity(y,l.gravity),n._bodiesUpdate(y,e,f.timeScale,i,l.bounds),d.preSolveAll(y),s=0;s<t.constraintIterations;s++)d.solveAll(m,f.timeScale);d.postSolveAll(y),p.controller?(l.isModified&&p.controller.clear(p),p.controller.update(p,y,t,l.isModified),g=p.pairsList):g=y,l.isModified&&c.setModified(l,!1,!1,!0);var x=p.detector(g,t),w=t.pairs,b=f.timestamp;for(a.update(w,x,b),a.removeOld(w,b),t.enableSleeping&&r.afterCollisions(w.list,f.timeScale),w.collisionStart.length>0&&u.trigger(t,"collisionStart",{pairs:w.collisionStart}),o.preSolvePosition(w.list),s=0;s<t.positionIterations;s++)o.solvePosition(w.list,y,f.timeScale);for(o.postSolvePosition(y),d.preSolveAll(y),s=0;s<t.constraintIterations;s++)d.solveAll(m,f.timeScale);for(d.postSolveAll(y),o.preSolveVelocity(w.list),s=0;s<t.velocityIterations;s++)o.solveVelocity(w.list,f.timeScale);return w.collisionActive.length>0&&u.trigger(t,"collisionActive",{pairs:w.collisionActive}),w.collisionEnd.length>0&&u.trigger(t,"collisionEnd",{pairs:w.collisionEnd}),h.update(t.metrics,t),n._bodiesClearForces(y),u.trigger(t,"afterUpdate",v),t},n.merge=function(t,e){if(f.extend(t,e),e.world){t.world=e.world,n.clear(t);for(var i=c.allBodies(t.world),s=0;s<i.length;s++){var o=i[s];r.set(o,!1),o.id=f.nextId()}}},n.clear=function(t){var e=t.world;a.clear(t.pairs);var i=t.broadphase;if(i.controller){var n=c.allBodies(e);i.controller.clear(i),i.controller.update(i,n,t,!0)}},n._bodiesClearForces=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.force.x=0,i.force.y=0,i.torque=0}},n._bodiesApplyGravity=function(t,e){var i=void 0!==e.scale?e.scale:.001;if((0!==e.x||0!==e.y)&&0!==i)for(var n=0;n<t.length;n++){var s=t[n];s.ignoreGravity||s.isStatic||s.isSleeping||(s.force.y+=s.mass*e.y*i,s.force.x+=s.mass*e.x*i)}},n._bodiesUpdate=function(t,e,i,n,s){for(var r=0;r<t.length;r++){var o=t[r];o.isStatic||o.isSleeping||p.update(o,e,i,n)}}},function(t,e,i){var n={};t.exports=n;var s=i(76),r=i(81),o=i(33),a=i(80);n._restingThresh=4,n._restingThreshTangent=6,n._positionDampen=.9,n._positionWarming=.8,n._frictionNormalMultiplier=5,n.preSolvePosition=function(t){var e,i,n;for(e=0;e<t.length;e++)(i=t[e]).isActive&&(n=i.activeContacts.length,i.collision.parentA.totalContacts+=n,i.collision.parentB.totalContacts+=n)},n.solvePosition=function(t,e,i){var s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w=i*n._positionDampen;for(s=0;s<e.length;s++){var b=e[s];b.previousPositionImpulse.x=b.positionImpulse.x,b.previousPositionImpulse.y=b.positionImpulse.y}for(s=0;s<t.length;s++)(a=t[s]).isActive&&!a.isSensor&&(l=(h=a.collision).parentA,u=h.parentB,c=h.normal,p=l.previousPositionImpulse,g=u.previousPositionImpulse,f=h.penetration,y=g.x-p.x+f.x,m=g.y-p.y+f.y,d=(r=c.x)*y+(o=c.y)*m,a.separation=d,x=(d-a.slop)*w,(l.isStatic||u.isStatic)&&(x*=2),l.isStatic||l.isSleeping||(v=x/l.totalContacts,l.positionImpulse.x+=r*v,l.positionImpulse.y+=o*v),u.isStatic||u.isSleeping||(v=x/u.totalContacts,u.positionImpulse.x-=r*v,u.positionImpulse.y-=o*v))},n.postSolvePosition=function(t){for(var e=0;e<t.length;e++){var i=t[e];if(i.totalContacts=0,0!==i.positionImpulse.x||0!==i.positionImpulse.y){for(var o=0;o<i.parts.length;o++){var h=i.parts[o];s.translate(h.vertices,i.positionImpulse),a.update(h.bounds,h.vertices,i.velocity),h.position.x+=i.positionImpulse.x,h.position.y+=i.positionImpulse.y}i.positionPrev.x+=i.positionImpulse.x,i.positionPrev.y+=i.positionImpulse.y,r.dot(i.positionImpulse,i.velocity)<0?(i.positionImpulse.x=0,i.positionImpulse.y=0):(i.positionImpulse.x*=n._positionWarming,i.positionImpulse.y*=n._positionWarming)}}},n.preSolveVelocity=function(t){var e,i,n,s,o,a,h,l,u,c,d,f,p,g,v=r._temp[0],y=r._temp[1];for(e=0;e<t.length;e++)if((n=t[e]).isActive&&!n.isSensor)for(s=n.activeContacts,a=(o=n.collision).parentA,h=o.parentB,l=o.normal,u=o.tangent,i=0;i<s.length;i++)d=(c=s[i]).vertex,f=c.normalImpulse,p=c.tangentImpulse,0===f&&0===p||(v.x=l.x*f+u.x*p,v.y=l.y*f+u.y*p,a.isStatic||a.isSleeping||(g=r.sub(d,a.position,y),a.positionPrev.x+=v.x*a.inverseMass,a.positionPrev.y+=v.y*a.inverseMass,a.anglePrev+=r.cross(g,v)*a.inverseInertia),h.isStatic||h.isSleeping||(g=r.sub(d,h.position,y),h.positionPrev.x-=v.x*h.inverseMass,h.positionPrev.y-=v.y*h.inverseMass,h.anglePrev-=r.cross(g,v)*h.inverseInertia))},n.solveVelocity=function(t,e){for(var i=e*e,s=r._temp[0],a=r._temp[1],h=r._temp[2],l=r._temp[3],u=r._temp[4],c=r._temp[5],d=0;d<t.length;d++){var f=t[d];if(f.isActive&&!f.isSensor){var p=f.collision,g=p.parentA,v=p.parentB,y=p.normal,m=p.tangent,x=f.activeContacts,w=1/x.length;g.velocity.x=g.position.x-g.positionPrev.x,g.velocity.y=g.position.y-g.positionPrev.y,v.velocity.x=v.position.x-v.positionPrev.x,v.velocity.y=v.position.y-v.positionPrev.y,g.angularVelocity=g.angle-g.anglePrev,v.angularVelocity=v.angle-v.anglePrev;for(var b=0;b<x.length;b++){var T=x[b],S=T.vertex,_=r.sub(S,g.position,a),A=r.sub(S,v.position,h),C=r.add(g.velocity,r.mult(r.perp(_),g.angularVelocity),l),M=r.add(v.velocity,r.mult(r.perp(A),v.angularVelocity),u),P=r.sub(C,M,c),E=r.dot(y,P),k=r.dot(m,P),L=Math.abs(k),F=o.sign(k),R=(1+f.restitution)*E,O=o.clamp(f.separation+E,0,1)*n._frictionNormalMultiplier,D=k,B=1/0;L>f.friction*f.frictionStatic*O*i&&(B=L,D=o.clamp(f.friction*F*i,-B,B));var I=r.cross(_,y),Y=r.cross(A,y),X=w/(g.inverseMass+v.inverseMass+g.inverseInertia*I*I+v.inverseInertia*Y*Y);if(R*=X,D*=X,E<0&&E*E>n._restingThresh*i)T.normalImpulse=0;else{var z=T.normalImpulse;T.normalImpulse=Math.min(T.normalImpulse+R,0),R=T.normalImpulse-z}if(k*k>n._restingThreshTangent*i)T.tangentImpulse=0;else{var N=T.tangentImpulse;T.tangentImpulse=o.clamp(T.tangentImpulse+D,-B,B),D=T.tangentImpulse-N}s.x=y.x*R+m.x*D,s.y=y.y*R+m.y*D,g.isStatic||g.isSleeping||(g.positionPrev.x+=s.x*g.inverseMass,g.positionPrev.y+=s.y*g.inverseMass,g.anglePrev+=r.cross(_,s)*g.inverseInertia),v.isStatic||v.isSleeping||(v.positionPrev.x-=s.x*v.inverseMass,v.positionPrev.y-=s.y*v.inverseMass,v.anglePrev-=r.cross(A,s)*v.inverseInertia)}}}}},function(t,e,i){var n={};t.exports=n;var s=i(418),r=i(33);n._pairMaxIdleLife=1e3,n.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},n.update=function(t,e,i){var n,r,o,a,h=t.list,l=t.table,u=t.collisionStart,c=t.collisionEnd,d=t.collisionActive;for(u.length=0,c.length=0,d.length=0,a=0;a<h.length;a++)h[a].confirmedActive=!1;for(a=0;a<e.length;a++)(n=e[a]).collided&&((o=l[r=s.id(n.bodyA,n.bodyB)])?(o.isActive?d.push(o):u.push(o),s.update(o,n,i),o.confirmedActive=!0):(o=s.create(n,i),l[r]=o,u.push(o),h.push(o)));for(a=0;a<h.length;a++)(o=h[a]).isActive&&!o.confirmedActive&&(s.setActive(o,!1,i),c.push(o))},n.removeOld=function(t,e){var i,s,r,o,a=t.list,h=t.table,l=[];for(o=0;o<a.length;o++)(s=(i=a[o]).collision).bodyA.isSleeping||s.bodyB.isSleeping?i.timeUpdated=e:e-i.timeUpdated>n._pairMaxIdleLife&&l.push(o);for(o=0;o<l.length;o++)delete h[(i=a[r=l[o]-o]).id],a.splice(r,1)},n.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},function(t,e,i){var n={};t.exports=n;var s=i(418),r=i(503),o=i(33);n.create=function(t){var e={controller:n,detector:r.collisions,buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return o.extend(e,t)},n.update=function(t,e,i,s){var r,o,a,h,l,u=i.world,c=t.buckets,d=!1,f=i.metrics;for(f.broadphaseTests=0,r=0;r<e.length;r++){var p=e[r];if((!p.isSleeping||s)&&!(p.bounds.max.x<u.bounds.min.x||p.bounds.min.x>u.bounds.max.x||p.bounds.max.y<u.bounds.min.y||p.bounds.min.y>u.bounds.max.y)){var g=n._getRegion(t,p);if(!p.region||g.id!==p.region.id||s){f.broadphaseTests+=1,p.region&&!s||(p.region=g);var v=n._regionUnion(g,p.region);for(o=v.startCol;o<=v.endCol;o++)for(a=v.startRow;a<=v.endRow;a++){h=c[l=n._getBucketId(o,a)];var y=o>=g.startCol&&o<=g.endCol&&a>=g.startRow&&a<=g.endRow,m=o>=p.region.startCol&&o<=p.region.endCol&&a>=p.region.startRow&&a<=p.region.endRow;!y&&m&&m&&h&&n._bucketRemoveBody(t,h,p),(p.region===g||y&&!m||s)&&(h||(h=n._createBucket(c,l)),n._bucketAddBody(t,h,p))}p.region=g,d=!0}}}d&&(t.pairsList=n._createActivePairsList(t))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},n._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),s=Math.max(t.endCol,e.endCol),r=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return n._createRegion(i,s,r,o)},n._getRegion=function(t,e){var i=e.bounds,s=Math.floor(i.min.x/t.bucketWidth),r=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return n._createRegion(s,r,o,a)},n._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},n._getBucketId=function(t,e){return"C"+t+"R"+e},n._createBucket=function(t,e){return t[e]=[]},n._bucketAddBody=function(t,e,i){for(var n=0;n<e.length;n++){var r=e[n];if(!(i.id===r.id||i.isStatic&&r.isStatic)){var o=s.id(i,r),a=t.pairs[o];a?a[2]+=1:t.pairs[o]=[i,r,1]}}e.push(i)},n._bucketRemoveBody=function(t,e,i){e.splice(o.indexOf(e,i),1);for(var n=0;n<e.length;n++){var r=e[n],a=s.id(i,r),h=t.pairs[a];h&&(h[2]-=1)}},n._createActivePairsList=function(t){var e,i,n=[];e=o.keys(t.pairs);for(var s=0;s<e.length;s++)(i=t.pairs[e[s]])[2]>0?n.push(i):delete t.pairs[e[s]];return n}},function(t,e,i){var n={};t.exports=n;var s=i(500),r=i(33);n.name="matter-js",n.version="0.14.2",n.uses=[],n.used=[],n.use=function(){s.use(n,Array.prototype.slice.call(arguments))},n.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(n,t,e)},n.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(n,t,e)}},function(t,e,i){var n=i(427),s=i(0),r=i(419),o=i(19),a=i(2),h=i(186),l=i(61),u=i(3),c=new s({Extends:l,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,s,r,h){o.call(this,t.scene,"Image"),this.anims=new n(this),this.setTexture(s,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var l=a(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=c},function(t,e,i){var n=i(0),s=i(419),r=i(19),o=i(2),a=i(87),h=i(186),l=i(3),u=new n({Extends:a,Mixins:[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity,h],initialize:function(t,e,i,n,s,a){r.call(this,t.scene,"Image"),this.setTexture(n,s),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=o(a,"shape",null);h?this.setBody(h,a):this.setRectangle(this.width,this.height,a),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(137),r=i(194),o=i(33),a=i(67),h=i(126);n.stack=function(t,e,i,n,r,o,h){for(var l,u=s.create({label:"Stack"}),c=t,d=e,f=0,p=0;p<n;p++){for(var g=0,v=0;v<i;v++){var y=h(c,d,v,p,l,f);if(y){var m=y.bounds.max.y-y.bounds.min.y,x=y.bounds.max.x-y.bounds.min.x;m>g&&(g=m),a.translate(y,{x:.5*x,y:.5*m}),c=y.bounds.max.x+r,s.addBody(u,y),l=y,f+=1}else c+=r}d+=g+o,c=t}return u},n.chain=function(t,e,i,n,a,h){for(var l=t.bodies,u=1;u<l.length;u++){var c=l[u-1],d=l[u],f=c.bounds.max.y-c.bounds.min.y,p=c.bounds.max.x-c.bounds.min.x,g=d.bounds.max.y-d.bounds.min.y,v={bodyA:c,pointA:{x:p*e,y:f*i},bodyB:d,pointB:{x:(d.bounds.max.x-d.bounds.min.x)*n,y:g*a}},y=o.extend(v,h);s.addConstraint(t,r.create(y))}return t.label+=" Chain",t},n.mesh=function(t,e,i,n,a){var h,l,u,c,d,f=t.bodies;for(h=0;h<i;h++){for(l=1;l<e;l++)u=f[l-1+h*e],c=f[l+h*e],s.addConstraint(t,r.create(o.extend({bodyA:u,bodyB:c},a)));if(h>0)for(l=0;l<e;l++)u=f[l+(h-1)*e],c=f[l+h*e],s.addConstraint(t,r.create(o.extend({bodyA:u,bodyB:c},a))),n&&l>0&&(d=f[l-1+(h-1)*e],s.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),n&&l<e-1&&(d=f[l+1+(h-1)*e],s.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a))))}return t.label+=" Mesh",t},n.pyramid=function(t,e,i,s,r,o,h){return n.stack(t,e,i,s,r,o,function(e,n,o,l,u,c){var d=Math.min(s,Math.ceil(i/2)),f=u?u.bounds.max.x-u.bounds.min.x:0;if(!(l>d||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*f,y:0}),h(t+(u?o*f:0)+o*r,n,o,l,u,c)})},n.newtonsCradle=function(t,e,i,n,o){for(var a=s.create({label:"Newtons Cradle"}),l=0;l<i;l++){var u=h.circle(t+l*(1.9*n),e+o,n,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),c=r.create({pointA:{x:t+l*(1.9*n),y:e},bodyB:u});s.addBody(a,u),s.addConstraint(a,c)}return a},n.car=function(t,e,i,n,o){var l=a.nextGroup(!0),u=.5*-i+20,c=.5*i-20,d=s.create({label:"Car"}),f=h.rectangle(t,e,i,n,{collisionFilter:{group:l},chamfer:{radius:.5*n},density:2e-4}),p=h.circle(t+u,e+0,o,{collisionFilter:{group:l},friction:.8}),g=h.circle(t+c,e+0,o,{collisionFilter:{group:l},friction:.8}),v=r.create({bodyB:f,pointB:{x:u,y:0},bodyA:p,stiffness:1,length:0}),y=r.create({bodyB:f,pointB:{x:c,y:0},bodyA:g,stiffness:1,length:0});return s.addBody(d,f),s.addBody(d,p),s.addBody(d,g),s.addConstraint(d,v),s.addConstraint(d,y),d},n.softBody=function(t,e,i,s,r,a,l,u,c,d){c=o.extend({inertia:1/0},c),d=o.extend({stiffness:.2,render:{type:"line",anchors:!1}},d);var f=n.stack(t,e,i,s,r,a,function(t,e){return h.circle(t,e,u,c)});return n.mesh(f,i,s,l,d),f.label="Soft Body",f}},function(t,e){function i(t,e,i){i=i||0;var n,s,r,o,a,h,l,u=[0,0];return n=t[1][1]-t[0][1],s=t[0][0]-t[1][0],r=n*t[0][0]+s*t[0][1],o=e[1][1]-e[0][1],a=e[0][0]-e[1][0],h=o*e[0][0]+a*e[0][1],T(l=n*a-o*s,0,i)||(u[0]=(a*r-s*h)/l,u[1]=(n*h-o*r)/l),u}function n(t,e,i,n){var s=e[0]-t[0],r=e[1]-t[1],o=n[0]-i[0],a=n[1]-i[1];if(o*r-a*s==0)return!1;var h=(s*(i[1]-t[1])+r*(t[0]-i[0]))/(o*r-a*s),l=(o*(t[1]-i[1])+a*(i[0]-t[0]))/(a*s-o*r);return h>=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function r(t,e,i){return s(t,e,i)>0}function o(t,e,i){return s(t,e,i)>=0}function a(t,e,i){return s(t,e,i)<0}function h(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=function t(e){var i=[],n=[],s=[],r=[];var o=Number.MAX_VALUE;for(var a=0;a<e.length;++a)if(g(e,a))for(var h=0;h<e.length;++h)if(m(e,a,h)){n=t(w(e,a,h,r)),s=t(w(e,h,a,r));for(var l=0;l<s.length;l++)n.push(s[l]);n.length<o&&(i=n,o=n.length,i.push([f(e,a),f(e,h)]))}return i}(t);return e.length>0?function t(e,i){if(0===i.length)return[e];if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],s=0;s<i.length;s++)for(var r=i[s],o=0;o<n.length;o++){var a=n[o],h=t(a,r);if(h){n.splice(o,1),n.push(h[0],h[1]);break}}return n}var r=i,s=e.indexOf(r[0]),o=e.indexOf(r[1]);return-1!==s&&-1!==o&&[w(e,s,o),w(e,o,s)]}(t,e):[t]},quickDecomp:function t(e,i,n,s,l,u,c){u=u||100;c=c||0;l=l||25;i=void 0!==i?i:[];n=n||[];s=s||[];var v=[0,0],y=[0,0],m=[0,0];var w=0,T=0,S=0,_=0;var A=0,C=0,M=0;var P=[],E=[];var k=e,L=e;if(L.length<3)return i;c++;if(c>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var F=0;F<e.length;++F)if(g(k,F)){n.push(k[F]),w=T=Number.MAX_VALUE;for(var R=0;R<e.length;++R)r(f(k,F-1),f(k,F),f(k,R))&&h(f(k,F-1),f(k,F),f(k,R-1))&&(m=b(f(k,F-1),f(k,F),f(k,R),f(k,R-1)),a(f(k,F+1),f(k,F),m)&&(S=d(k[F],m))<T&&(T=S,y=m,C=R)),r(f(k,F+1),f(k,F),f(k,R+1))&&h(f(k,F+1),f(k,F),f(k,R))&&(m=b(f(k,F+1),f(k,F),f(k,R),f(k,R+1)),r(f(k,F-1),f(k,F),m)&&(S=d(k[F],m))<w&&(w=S,v=m,A=R));if(C===(A+1)%e.length)m[0]=(y[0]+v[0])/2,m[1]=(y[1]+v[1])/2,s.push(m),F<A?(p(P,k,F,A+1),P.push(m),E.push(m),0!==C&&p(E,k,C,k.length),p(E,k,0,F+1)):(0!==F&&p(P,k,F,k.length),p(P,k,0,A+1),P.push(m),E.push(m),p(E,k,C,F+1));else{if(C>A&&(A+=e.length),_=Number.MAX_VALUE,A<C)return i;for(var R=C;R<=A;++R)o(f(k,F-1),f(k,F),f(k,R))&&h(f(k,F+1),f(k,F),f(k,R))&&(S=d(f(k,F),f(k,R)))<_&&x(k,F,R)&&(_=S,M=R%e.length);F<M?(p(P,k,F,M+1),0!==M&&p(E,k,M,L.length),p(E,k,0,F+1)):(0!==F&&p(P,k,F,L.length),p(P,k,0,M+1),p(E,k,M,F+1))}return P.length<E.length?(t(P,i,n,s,l,u,c),t(E,i,n,s,l,u,c)):(t(E,i,n,s,l,u,c),t(P,i,n,s,l,u,c)),i}i.push(e);return i},isSimple:function(t){var e,i=t;for(e=0;e<i.length-1;e++)for(var s=0;s<e-1;s++)if(n(i[e],i[e+1],i[s],i[s+1]))return!1;for(e=1;e<i.length-2;e++)if(n(i[0],i[i.length-1],i[e],i[e+1]))return!1;return!0},removeCollinearPoints:function(t,e){for(var i=0,n=t.length-1;t.length>3&&n>=0;--n)c(f(t,n-1),f(t,n),f(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var n=t[i],s=i-1;s>=0;--s)S(n,t[s],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,n=1;n<t.length;++n)(i[n][1]<i[e][1]||i[n][1]===i[e][1]&&i[n][0]>i[e][0])&&(e=n);return!r(f(t,e-1),f(t,e),f(t,e+1))&&(function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(var n=0;n!==i;n++)t[n]=e[n]}(t),!0)}};var l=[],u=[];function c(t,e,i,n){if(n){var r=l,o=u;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],h=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(h*c))<n}return 0===s(t,e,i)}function d(t,e){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function f(t,e){var i=t.length;return t[e<0?e%i+i:e%i]}function p(t,e,i,n){for(var s=i;s<n;s++)t.push(e[s])}function g(t,e){return a(f(t,e-1),f(t,e),f(t,e+1))}var v=[],y=[];function m(t,e,n){var s,r,a=v,l=y;if(o(f(t,e+1),f(t,e),f(t,n))&&h(f(t,e-1),f(t,e),f(t,n)))return!1;r=d(f(t,e),f(t,n));for(var u=0;u!==t.length;++u)if((u+1)%t.length!==e&&u!==e&&o(f(t,e),f(t,n),f(t,u+1))&&h(f(t,e),f(t,n),f(t,u))&&(a[0]=f(t,e),a[1]=f(t,n),l[0]=f(t,u),l[1]=f(t,u+1),s=i(a,l),d(f(t,e),s)<r))return!1;return!0}function x(t,e,i){for(var s=0;s!==t.length;++s)if(s!==e&&s!==i&&(s+1)%t.length!==e&&(s+1)%t.length!==i&&n(f(t,e),f(t,i),f(t,s),f(t,s+1)))return!1;return!0}function w(t,e,i,n){var s=n||[];if(function(t){t.length=0}(s),e<i)for(var r=e;r<=i;r++)s.push(t[r]);else{for(r=0;r<=i;r++)s.push(t[r]);for(r=e;r<t.length;r++)s.push(t[r])}return s}function b(t,e,i,n,s){s=s||0;var r=e[1]-t[1],o=t[0]-e[0],a=r*t[0]+o*t[1],h=n[1]-i[1],l=i[0]-n[0],u=h*i[0]+l*i[1],c=r*l-h*o;return T(c,0,s)?[0,0]:[(l*a-o*u)/c,(r*u-h*a)/c]}function T(t,e,i){return i=i||0,Math.abs(t-e)<=i}function S(t,e,i){return T(t[0],e[0],i)&&T(t[1],e[1],i)}},function(t,e,i){var n=i(126),s=i(0),r=i(1068),o=i(194),a=i(1104),h=i(1067),l=i(1066),u=i(504),c=i(1090),d=new s({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,s,r){var o=n.rectangle(t,e,i,s,r);return this.world.add(o),o},trapezoid:function(t,e,i,s,r,o){var a=n.trapezoid(t,e,i,s,r,o);return this.world.add(a),a},circle:function(t,e,i,s,r){var o=n.circle(t,e,i,s,r);return this.world.add(o),o},polygon:function(t,e,i,s,r){var o=n.polygon(t,e,i,s,r);return this.world.add(o),o},fromVertices:function(t,e,i,s,r,o,a){var h=n.fromVertices(t,e,i,s,r,o,a);return this.world.add(h),h},imageStack:function(t,e,i,n,s,o,a,l,u){void 0===a&&(a=0),void 0===l&&(l=0),void 0===u&&(u={});var c=this.world,d=this.sys.displayList;u.addToWorld=!1;var f=r.stack(i,n,s,o,a,l,function(i,n){var s=new h(c,i,n,t,e,u);return d.add(s),s.body});return c.add(f),f},stack:function(t,e,i,n,s,o,a){var h=r.stack(t,e,i,n,s,o,a);return this.world.add(h),h},pyramid:function(t,e,i,n,s,o,a){var h=r.pyramid(t,e,i,n,s,o,a);return this.world.add(h),h},chain:function(t,e,i,n,s,o){return r.chain(t,e,i,n,s,o)},mesh:function(t,e,i,n,s){return r.mesh(t,e,i,n,s)},newtonsCradle:function(t,e,i,n,s){var o=r.newtonsCradle(t,e,i,n,s);return this.world.add(o),o},car:function(t,e,i,n,s){var o=r.car(t,e,i,n,s);return this.world.add(o),o},softBody:function(t,e,i,n,s,o,a,h,l,u){var c=r.softBody(t,e,i,n,s,o,a,h,l,u);return this.world.add(c),c},joint:function(t,e,i,n,s){return this.constraint(t,e,i,n,s)},spring:function(t,e,i,n,s){return this.constraint(t,e,i,n,s)},constraint:function(t,e,i,n,s){void 0===n&&(n=1),void 0===s&&(s={}),s.bodyA="body"===t.type?t:t.body,s.bodyB="body"===e.type?e:e.body,s.length=i,s.stiffness=n;var r=o.create(s);return this.world.add(r),r},worldConstraint:function(t,e,i,n){void 0===i&&(i=1),void 0===n&&(n={}),n.bodyB="body"===t.type?t:t.body,n.length=e,n.stiffness=i;var s=o.create(n);return this.world.add(s),s},mouseSpring:function(t){return this.pointerConstraint(t)},pointerConstraint:function(t){void 0===t&&(t={}),t.hasOwnProperty("render")||(t.render={visible:!1});var e=new c(this.scene,this.world,t);return this.world.add(e.constraint),e},image:function(t,e,i,n,s){var r=new h(this.world,t,e,i,n,s);return this.sys.displayList.add(r),r},tileBody:function(t,e){return new u(this.world,t,e)},sprite:function(t,e,i,n,s){var r=new l(this.world,t,e,i,n,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),r},gameObject:function(t,e){return a(this.world,t,e)},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=d},function(t,e,i){var n=i(1077),s=i(0),r=i(224),o=i(1076),a=i(11),h=i(2),l=i(85),u=i(95),c=i(1108),d=i(29),f=i(223),p=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.bodies=new u,this.gravity=h(e,"gravity",0),this.cellSize=h(e,"cellSize",64),this.collisionMap=new o,this.timeScale=h(e,"timeScale",1),this.maxStep=h(e,"maxStep",.05),this.enabled=!0,this.drawDebug=h(e,"debug",!1),this.debugGraphic;var i=h(e,"maxVelocity",100);if(this.defaults={debugShowBody:h(e,"debugShowBody",!0),debugShowVelocity:h(e,"debugShowVelocity",!0),bodyDebugColor:h(e,"debugBodyColor",16711935),velocityDebugColor:h(e,"debugVelocityColor",65280),maxVelocityX:h(e,"maxVelocityX",i),maxVelocityY:h(e,"maxVelocityY",i),minBounceVelocity:h(e,"minBounceVelocity",40),gravityFactor:h(e,"gravityFactor",1),bounciness:h(e,"bounciness",0)},this.walls={left:null,right:null,top:null,bottom:null},this.delta=0,this._lastId=0,h(e,"setBounds",!1)){var n=e.setBounds;if("boolean"==typeof n)this.setBounds();else{var s=h(n,"x",0),r=h(n,"y",0),l=h(n,"width",t.sys.game.config.width),c=h(n,"height",t.sys.game.config.height),d=h(n,"thickness",64),f=h(n,"left",!0),p=h(n,"right",!0),g=h(n,"top",!0),v=h(n,"bottom",!0);this.setBounds(s,r,l,c,d,f,p,g,v)}}this.drawDebug&&this.createDebugGraphic()},setCollisionMap:function(t,e){if("string"==typeof t){var i=this.scene.cache.tilemap.get(t);if(!i||i.format!==d.WELTMEISTER)return console.warn("The specified key does not correspond to a Weltmeister tilemap: "+t),null;for(var n,s=i.data.layer,r=0;r<s.length;r++)if("collision"===s[r].name){n=s[r];break}void 0===e&&(e=n.tilesize),this.collisionMap=new o(e,n.data)}else Array.isArray(t)?this.collisionMap=new o(e,t):console.warn("Invalid Weltmeister collision map data: "+t);return this.collisionMap},setCollisionMapFromTilemapLayer:function(t,e){void 0===e&&(e={});for(var i=h(e,"slopeProperty",null),n=h(e,"slopeMap",null),s=h(e,"defaultCollidingSlope",null),r=h(e,"defaultNonCollidingSlope",0),a=t.layer,u=a.baseTileWidth,c=[],d=0;d<a.height;d++){c[d]=[];for(var f=0;f<a.width;f++){var p=a.data[d][f];p&&p.collides?null!==i&&l(p.properties,i)?c[d][f]=parseInt(p.properties[i],10):null!==n&&l(n,p.index)?c[d][f]=n[p.index]:c[d][f]=null!==s?s:p.index:c[d][f]=r}}return this.collisionMap=new o(u,c),this.collisionMap},setBounds:function(t,e,i,n,s,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),void 0===s&&(s=64),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e,s,n),this.updateWall(o,"right",t+i,e,s,n),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,o){var a=this.walls[e];t?a?a.resetSize(i,n,s,o):(this.walls[e]=this.create(i,n,s,o),this.walls[e].name=e,this.walls[e].gravityFactor=0,this.walls[e].collides=r.FIXED):(a&&this.bodies.remove(a),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},getNextID:function(){return this._lastId++},create:function(t,e,i,s){var r=new n(this,t,e,i,s);return this.bodies.set(r),r},remove:function(t){this.bodies.delete(t)},pause:function(){return this.enabled=!1,this.emit("pause"),this},resume:function(){return this.enabled=!0,this.emit("resume"),this},update:function(t,e){if(this.enabled&&0!==this.bodies.size){var i,n,s=Math.min(e/1e3,this.maxStep)*this.timeScale;this.delta=s;var r=this.bodies.entries,o=r.length,a={},h=this.cellSize;for(i=0;i<o;i++)(n=r[i]).enabled&&n.update(s);for(i=0;i<o;i++)(n=r[i])&&!n.skipHash()&&this.checkHash(n,a,h);if(this.drawDebug){var l=this.debugGraphic;for(l.clear(),i=0;i<o;i++)(n=r[i])&&n.willDrawDebug()&&n.drawDebug(l)}}},checkHash:function(t,e,i){for(var n={},s=Math.floor(t.pos.x/i),r=Math.floor(t.pos.y/i),o=Math.floor((t.pos.x+t.size.x)/i)+1,a=Math.floor((t.pos.y+t.size.y)/i)+1,h=s;h<o;h++)for(var l=r;l<a;l++)if(e[h])if(e[h][l]){for(var u=e[h][l],c=0;c<u.length;c++)t.touches(u[c])&&!n[u[c].id]&&(n[u[c].id]=!0,this.checkBodies(t,u[c]));u.push(t)}else e[h][l]=[t];else e[h]={},e[h][l]=[t]},checkBodies:function(t,e){t.collides===r.FIXED&&e.collides===r.FIXED||(t.checkAgainst&e.type&&t.check(e),e.checkAgainst&t.type&&e.check(t),t.collides&&e.collides&&t.collides+e.collides>r.ACTIVE&&c(this,t,e))},setCollidesNever:function(t){for(var e=0;e<t.length;e++)t[e].collides=r.NEVER;return this},setLite:function(t){for(var e=0;e<t.length;e++)t[e].collides=r.LITE;return this},setPassive:function(t){for(var e=0;e<t.length;e++)t[e].collides=r.PASSIVE;return this},setActive:function(t){for(var e=0;e<t.length;e++)t[e].collides=r.ACTIVE;return this},setFixed:function(t){for(var e=0;e<t.length;e++)t[e].collides=r.FIXED;return this},setTypeNone:function(t){for(var e=0;e<t.length;e++)t[e].type=f.NONE;return this},setTypeA:function(t){for(var e=0;e<t.length;e++)t[e].type=f.A;return this},setTypeB:function(t){for(var e=0;e<t.length;e++)t[e].type=f.B;return this},setAvsB:function(t){for(var e=0;e<t.length;e++)t[e].type=f.A,t[e].checkAgainst=f.B;return this},setBvsA:function(t){for(var e=0;e<t.length;e++)t[e].type=f.B,t[e].checkAgainst=f.A;return this},setCheckAgainstNone:function(t){for(var e=0;e<t.length;e++)t[e].checkAgainst=f.NONE;return this},setCheckAgainstA:function(t){for(var e=0;e<t.length;e++)t[e].checkAgainst=f.A;return this},setCheckAgainstB:function(t){for(var e=0;e<t.length;e++)t[e].checkAgainst=f.B;return this},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners(),this.scene=null,this.bodies.clear(),this.bodies=null,this.collisionMap=null}});t.exports=p},function(t,e,i){var n=i(0),s=i(506),r=i(61),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),this.body.parent=this,this.body.gameObject=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(0),s=i(506),r=i(87),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),this.body.parent=this,this.body.gameObject=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(0),s=i(506),r=new n({Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){this.body=t.create(e,i,n,s),this.body.parent=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=r},function(t,e,i){var n=i(0),s=i(1074),r=i(1073),o=i(1072),a=new n({initialize:function(t){this.world=t,this.sys=t.scene.sys},body:function(t,e,i,n){return new s(this.world,t,e,i,n)},existing:function(t){var e=t.x-t.frame.centerX,i=t.y-t.frame.centerY,n=t.width,s=t.height;return t.body=this.world.create(e,i,n,s),t.body.parent=t,t.body.gameObject=t,t},image:function(t,e,i,n){var s=new r(this.world,t,e,i,n);return this.sys.displayList.add(s),s},sprite:function(t,e,i,n){var s=new o(this.world,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),s},destroy:function(){this.world=null,this.sys=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1122),r=new n({initialize:function(t,e){void 0===t&&(t=32),this.tilesize=t,this.data=Array.isArray(e)?e:[],this.width=Array.isArray(e)?e[0].length:0,this.height=Array.isArray(e)?e.length:0,this.lastSlope=55,this.tiledef=s},trace:function(t,e,i,n,s,r){var o={collision:{x:!1,y:!1,slope:!1},pos:{x:t+i,y:e+n},tile:{x:0,y:0}};if(!this.data)return o;var a=Math.ceil(Math.max(Math.abs(i),Math.abs(n))/this.tilesize);if(a>1)for(var h=i/a,l=n/a,u=0;u<a&&(h||l)&&(this.step(o,t,e,h,l,s,r,i,n,u),t=o.pos.x,e=o.pos.y,o.collision.x&&(h=0,i=0),o.collision.y&&(l=0,n=0),!o.collision.slope);u++);else this.step(o,t,e,i,n,s,r,i,n,0);return o},step:function(t,e,i,n,s,r,o,a,h,l){var u,c,d=0,f=this.tilesize,p=this.width,g=this.height;if(n){var v=n>0?r:0,y=n<0?f:0,m=Math.max(Math.floor(i/f),0),x=Math.min(Math.ceil((i+o)/f),g);u=Math.floor((t.pos.x+v)/f);var w=Math.floor((e+v)/f);if((l>0||u===w||w<0||w>=p)&&(w=-1),u>=0&&u<p)for(c=m;c<x&&!(-1!==w&&(d=this.data[c][w])>1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,w,c));c++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.x=!0,t.tile.x=d,t.pos.x=u*f-v+y,e=t.pos.x,a=0;break}}if(s){var b=s>0?o:0,T=s<0?f:0,S=Math.max(Math.floor(t.pos.x/f),0),_=Math.min(Math.ceil((t.pos.x+r)/f),p);c=Math.floor((t.pos.y+b)/f);var A=Math.floor((i+b)/f);if((l>0||c===A||A<0||A>=g)&&(A=-1),c>=0&&c<g)for(u=S;u<_&&!(-1!==A&&(d=this.data[A][u])>1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,u,A));u++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.y=!0,t.tile.y=d,t.pos.y=c*f-b+T;break}}},checkDef:function(t,e,i,n,s,r,o,a,h,l){var u=this.tiledef[e];if(!u)return!1;var c=this.tilesize,d=(h+u[0])*c,f=(l+u[1])*c,p=(u[2]-u[0])*c,g=(u[3]-u[1])*c,v=u[4],y=i+s+(g<0?o:0)-d,m=n+r+(p>0?a:0)-f;if(p*m-g*y>0){if(s*-g+r*p<0)return v;var x=Math.sqrt(p*p+g*g),w=g/x,b=-p/x,T=y*w+m*b,S=w*T,_=b*T;return S*S+_*_>=s*s+r*r?v||p*(m-r)-g*(y-s)<.5:(t.pos.x=i+s-S,t.pos.y=n+r-_,t.collision.slope={x:p,y:g,nx:w,ny:b},!0)}return!1}});t.exports=r},function(t,e,i){var n=i(0),s=i(224),r=i(1124),o=i(223),a=i(1123),h=new n({initialize:function(t,e,i,n,r){void 0===n&&(n=16),void 0===r&&(r=n),this.world=t,this.gameObject=null,this.enabled=!0,this.parent,this.id=t.getNextID(),this.name="",this.size={x:n,y:r},this.offset={x:0,y:0},this.pos={x:e,y:i},this.last={x:e,y:i},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:t.defaults.maxVelocityX,y:t.defaults.maxVelocityY},this.standing=!1,this.gravityFactor=t.defaults.gravityFactor,this.bounciness=t.defaults.bounciness,this.minBounceVelocity=t.defaults.minBounceVelocity,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER,this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.updateCallback,this.slopeStanding={min:.767944870877505,max:2.3736477827122884}},reset:function(t,e){this.pos={x:t,y:e},this.last={x:t,y:e},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:100,y:100},this.standing=!1,this.gravityFactor=1,this.bounciness=0,this.minBounceVelocity=40,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER},update:function(t){var e=this.pos;this.last.x=e.x,this.last.y=e.y,this.vel.y+=this.world.gravity*t*this.gravityFactor,this.vel.x=r(t,this.vel.x,this.accel.x,this.friction.x,this.maxVel.x),this.vel.y=r(t,this.vel.y,this.accel.y,this.friction.y,this.maxVel.y);var i=this.vel.x*t,n=this.vel.y*t,s=this.world.collisionMap.trace(e.x,e.y,i,n,this.size.x,this.size.y);this.handleMovementTrace(s)&&a(this,s);var o=this.gameObject;o&&(o.x=e.x-this.offset.x+o.displayOriginX*o.scaleX,o.y=e.y-this.offset.y+o.displayOriginY*o.scaleY),this.updateCallback&&this.updateCallback(this)},drawDebug:function(t){var e=this.pos;if(this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.size.x,this.size.y)),this.debugShowVelocity){var i=e.x+this.size.x/2,n=e.y+this.size.y/2;t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.vel.x,n+this.vel.y)}},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},skipHash:function(){return!this.enabled||0===this.type&&0===this.checkAgainst&&0===this.collides},touches:function(t){return!(this.pos.x>=t.pos.x+t.size.x||this.pos.x+this.size.x<=t.pos.x||this.pos.y>=t.pos.y+t.size.y||this.pos.y+this.size.y<=t.pos.y)},resetSize:function(t,e,i,n){return this.pos.x=t,this.pos.y=e,this.size.x=i,this.size.y=n,this},toJSON:function(){return{name:this.name,size:{x:this.size.x,y:this.size.y},pos:{x:this.pos.x,y:this.pos.y},vel:{x:this.vel.x,y:this.vel.y},accel:{x:this.accel.x,y:this.accel.y},friction:{x:this.friction.x,y:this.friction.y},maxVel:{x:this.maxVel.x,y:this.maxVel.y},gravityFactor:this.gravityFactor,bounciness:this.bounciness,minBounceVelocity:this.minBounceVelocity,type:this.type,checkAgainst:this.checkAgainst,collides:this.collides}},fromJSON:function(){},check:function(){},collideWith:function(t,e){this.parent&&this.parent._collideCallback&&this.parent._collideCallback.call(this.parent._callbackScope,this,t,e)},handleMovementTrace:function(){return!0},destroy:function(){this.world.remove(this),this.enabled=!1,this.world=null,this.gameObject=null,this.parent=null}});t.exports=h},,function(t,e,i){t.exports={BitmapMaskPipeline:i(421),ForwardDiffuseLightPipeline:i(420),TextureTintPipeline:i(196)}},function(t,e,i){t.exports={Utils:i(10),WebGLPipeline:i(197),WebGLRenderer:i(423),Pipelines:i(1079),BYTE:0,SHORT:1,UNSIGNED_BYTE:2,UNSIGNED_SHORT:3,FLOAT:4}},function(t,e,i){t.exports={Canvas:i(425),WebGL:i(422)}},function(t,e,i){t.exports={CanvasRenderer:i(426),GetBlendModes:i(424),SetTransform:i(22)}},function(t,e,i){t.exports={Canvas:i(1082),Snapshot:i(1081),WebGL:i(1080)}},function(t,e,i){var n=i(501),s={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.13.1",silent:!0,install:function(t){t.after("Engine.update",function(){s.Engine.update(this)})},Engine:{update:function(t){for(var e=t.world,i=n.Composite.allBodies(e),r=n.Composite.allComposites(e),o=0;o<i.length;o+=1){var a=i[o];a.plugin.wrap&&s.Body.wrap(a,a.plugin.wrap)}for(o=0;o<r.length;o+=1){var h=r[o];h.plugin.wrap&&s.Composite.wrap(h,h.plugin.wrap)}}},Bounds:{wrap:function(t,e){var i=null,n=null;if(void 0!==e.min.x&&void 0!==e.max.x&&(t.min.x>e.max.x?i=e.min.x-t.max.x:t.max.x<e.min.x&&(i=e.max.x-t.min.x)),void 0!==e.min.y&&void 0!==e.max.y&&(t.min.y>e.max.y?n=e.min.y-t.max.y:t.max.y<e.min.y&&(n=e.max.y-t.min.y)),null!==i||null!==n)return{x:i||0,y:n||0}}},Body:{wrap:function(t,e){var i=s.Bounds.wrap(t.bounds,e);return i&&n.Body.translate(t,i),i}},Composite:{bounds:function(t){for(var e=n.Composite.allBodies(t),i=[],s=0;s<e.length;s+=1){var r=e[s];i.push(r.bounds.min,r.bounds.max)}return n.Bounds.create(i)},wrap:function(t,e){var i=s.Bounds.wrap(s.Composite.bounds(t),e);return i&&n.Composite.translate(t,i),i}}};t.exports=s},function(t,e,i){var n=i(501),s={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.13.1",silent:!0,install:function(t){t.after("Body.create",function(){s.Body.init(this)}),t.before("Engine.update",function(t){s.Engine.update(t)})},Body:{init:function(t){t.plugin.attractors=t.plugin.attractors||[]}},Engine:{update:function(t){for(var e=t.world,i=n.Composite.allBodies(e),s=0;s<i.length;s+=1){var r=i[s],o=r.plugin.attractors;if(o&&o.length>0)for(var a=s+1;a<i.length;a+=1)for(var h=i[a],l=0;l<o.length;l+=1){var u=o[l],c=u;n.Common.isFunction(u)&&(c=u(r,h)),c&&n.Body.applyForce(h,h.position,c)}}}},Attractors:{gravityConstant:.001,gravity:function(t,e){var i=n.Vector.sub(e.position,t.position),r=n.Vector.magnitudeSquared(i)||1e-4,o=n.Vector.normalise(i),a=-s.Attractors.gravityConstant*(t.mass*e.mass/r),h=n.Vector.mult(o,a);n.Body.applyForce(t,t.position,n.Vector.neg(h)),n.Body.applyForce(e,e.position,h)}}};t.exports=s},function(t,e,i){var n=i(0),s=i(1070),r=i(2),o=i(4),a=i(1085),h=i(1065),l=i(1084),u=i(96),c=i(500),d=i(15),f=i(1060),p=i(76),g=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this.verts=p,o(this.config,"plugins.attractors",!1)&&(c.register(a),c.use(h,a)),o(this.config,"plugins.wrap",!1)&&(c.register(l),c.use(h,l)),t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.world=new f(this.scene,this.config),this.add=new s(this.world),this.systems.events.once("destroy",this.destroy,this)},start:function(){this.world||(this.world=new f(this.scene,this.config),this.add=new s(this.world));var t=this.systems.events;t.on("update",this.world.update,this.world),t.on("postupdate",this.world.postUpdate,this.world),t.once("shutdown",this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return u(r(e,"matter",{}),r(t,"matter",{}))},enableAttractorPlugin:function(){return c.register(a),c.use(h,a),this},enableWrapPlugin:function(){return c.register(l),c.use(h,l),this},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(t,e){this.world.step(t,e)},shutdown:function(){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("postupdate",this.world.postUpdate,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});d.register("MatterPhysics",g,"matterPhysics"),t.exports=g},function(t,e,i){var n={};t.exports=n;i(80);var s=i(33);n.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||s.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,r,o,a,h,l,u,c,d,f,p,g=[],v=0,y=0,m=0;e=e||15;var x=function(t,e,i){var n=i%2==1&&i>1;if(!d||t!=d.x||e!=d.y){d&&n?(f=d.x,p=d.y):(f=0,p=0);var s={x:f+t,y:p+e};!n&&d||(d=s),g.push(s),y=f+t,m=p+e}},w=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":y=t.x,m=t.y;break;case"H":y=t.x;break;case"V":m=t.y}x(y,m,t.pathSegType)}};for(n._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i<t.pathSegList.numberOfItems;i+=1)l.push(t.pathSegList.getItem(i));for(u=l.concat();v<o;){if((h=l[t.getPathSegAtLength(v)])!=c){for(;u.length&&u[0]!=h;)w(u.shift());c=h}switch(h.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":a=t.getPointAtLength(v),x(a.x,a.y,0)}v+=e}for(i=0,r=u.length;i<r;++i)w(u[i]);return g},n._svgPathToAbsolute=function(t){for(var e,i,n,s,r,o,a=t.pathSegList,h=0,l=0,u=a.numberOfItems,c=0;c<u;++c){var d=a.getItem(c),f=d.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(f))"x"in d&&(h=d.x),"y"in d&&(l=d.y);else switch("x1"in d&&(n=h+d.x1),"x2"in d&&(r=h+d.x2),"y1"in d&&(s=l+d.y1),"y2"in d&&(o=l+d.y2),"x"in d&&(h+=d.x),"y"in d&&(l+=d.y),f){case"m":a.replaceItem(t.createSVGPathSegMovetoAbs(h,l),c);break;case"l":a.replaceItem(t.createSVGPathSegLinetoAbs(h,l),c);break;case"h":a.replaceItem(t.createSVGPathSegLinetoHorizontalAbs(h),c);break;case"v":a.replaceItem(t.createSVGPathSegLinetoVerticalAbs(l),c);break;case"c":a.replaceItem(t.createSVGPathSegCurvetoCubicAbs(h,l,n,s,r,o),c);break;case"s":a.replaceItem(t.createSVGPathSegCurvetoCubicSmoothAbs(h,l,r,o),c);break;case"q":a.replaceItem(t.createSVGPathSegCurvetoQuadraticAbs(h,l,n,s),c);break;case"t":a.replaceItem(t.createSVGPathSegCurvetoQuadraticSmoothAbs(h,l),c);break;case"a":a.replaceItem(t.createSVGPathSegArcAbs(h,l,d.r1,d.r2,d.angle,d.largeArcFlag,d.sweepFlag),c);break;case"z":case"Z":h=e,l=i}"M"!=f&&"m"!=f||(e=h,i=l)}}},function(t,e,i){var n={};t.exports=n;var s=i(137),r=i(33);n.create=function(t){return r.extend({extended:!1,narrowDetections:0,narrowphaseTests:0,narrowReuse:0,narrowReuseCount:0,midphaseTests:0,broadphaseTests:0,narrowEff:1e-4,midEff:1e-4,broadEff:1e-4,collisions:0,buckets:0,bodies:0,pairs:0},!1,t)},n.reset=function(t){t.extended&&(t.narrowDetections=0,t.narrowphaseTests=0,t.narrowReuse=0,t.narrowReuseCount=0,t.midphaseTests=0,t.broadphaseTests=0,t.narrowEff=0,t.midEff=0,t.broadEff=0,t.collisions=0,t.buckets=0,t.pairs=0,t.bodies=0)},n.update=function(t,e){if(t.extended){var i=e.world,n=s.allBodies(i);t.collisions=t.narrowDetections,t.pairs=e.pairs.list.length,t.bodies=n.length,t.midEff=(t.narrowDetections/(t.midphaseTests||1)).toFixed(2),t.narrowEff=(t.narrowDetections/(t.narrowphaseTests||1)).toFixed(2),t.broadEff=(1-t.broadphaseTests/(n.length||1)).toFixed(2),t.narrowReuse=(t.narrowReuseCount/(t.narrowphaseTests||1)).toFixed(2)}}},function(t,e,i){var n={};t.exports=n;var s=i(81),r=i(502),o=i(80),a=i(126),h=i(76);n.collides=function(t,e){for(var i=[],n=0;n<e.length;n++){var s=e[n];if(o.overlaps(s.bounds,t.bounds))for(var a=1===s.parts.length?0:1;a<s.parts.length;a++){var h=s.parts[a];if(o.overlaps(h.bounds,t.bounds)){var l=r.collides(h,t);if(l.collided){i.push(l);break}}}}return i},n.ray=function(t,e,i,r){r=r||1e-100;for(var o=s.angle(e,i),h=s.magnitude(s.sub(e,i)),l=.5*(i.x+e.x),u=.5*(i.y+e.y),c=a.rectangle(l,u,h,r,{angle:o}),d=n.collides(c,t),f=0;f<d.length;f+=1){var p=d[f];p.body=p.bodyB=p.bodyA}return d},n.region=function(t,e,i){for(var n=[],s=0;s<t.length;s++){var r=t[s],a=o.overlaps(r.bounds,e);(a&&!i||!a&&i)&&n.push(r)}return n},n.point=function(t,e){for(var i=[],n=0;n<t.length;n++){var s=t[n];if(o.contains(s.bounds,e))for(var r=1===s.parts.length?0:1;r<s.parts.length;r++){var a=s.parts[r];if(o.contains(a.bounds,e)&&h.contains(a.vertices,e)){i.push(s);break}}}return i}},function(t,e,i){var n=i(80),s=i(0),r=i(137),o=i(194),a=i(503),h=i(2),l=i(96),u=i(222),c=i(3),d=i(76),f=new s({initialize:function(t,e,i){void 0===i&&(i={});this.scene=t,this.world=e;var n=h(i,"camera",null);n?(this.camera=n,delete i.camera):this.camera=t.sys.cameras.main,this.pointer=null,this.active=!0,this.position=new c,this.constraint=o.create(l(i,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},damping:0,length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on("beforeupdate",this.update,this),t.sys.input.on("pointerdown",this.onDown,this),t.sys.input.on("pointerup",this.onUp,this)},onDown:function(t){this.pointer=t},onUp:function(){this.pointer=null},getBodyPart:function(t,e){for(var i=this.constraint,n=t.parts.length>1?1:0;n<t.parts.length;n++){var s=t.parts[n];if(d.contains(s.vertices,e))return i.bodyB=t,i.pointA.x=e.x,i.pointA.y=e.y,i.pointB.x=e.x-t.position.x,i.pointB.y=e.y-t.position.y,i.angleB=t.angle,u.set(t,!1),!0}return!1},update:function(){if(this.active){var t=this.pointer,e=this.constraint;if(t){var i=this.position;if(this.camera.getWorldPoint(t.x,t.y,i),e.bodyB)u.set(e.bodyB,!1),e.pointA.x=i.x,e.pointA.y=i.y;else for(var s=r.allBodies(this.world.localWorld),o=0;o<s.length;o++){var h=s[o];if(!h.ignorePointer&&n.contains(h.bounds,i)&&a.canCollide(h.collisionFilter,e.collisionFilter)&&this.getBodyPart(h,i))break}}else e.bodyB&&(e.bodyB=null)}},destroy:function(){this.world.removeConstraint(this.constraint),this.constraint=null,this.world.off("beforeupdate",this.update),this.scene.sys.input.off("pointerdown",this.onDown,this),this.scene.sys.input.off("pointerup",this.onUp,this)}});t.exports=f},function(t,e,i){var n=i(67),s={setAngularVelocity:function(t){return n.setAngularVelocity(this.body,t),this},setVelocityX:function(t){return this._tempVec2.set(t,this.body.velocity.y),n.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(t){return this._tempVec2.set(this.body.velocity.x,t),n.setVelocity(this.body,this._tempVec2),this},setVelocity:function(t,e){return this._tempVec2.set(t,e),n.setVelocity(this.body,this._tempVec2),this}};t.exports=s},function(t,e,i){var n=i(67),s=i(16),r=i(199),o=i(198),a={x:{get:function(){return this.body.position.x},set:function(t){this._tempVec2.set(t,this.y),n.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(t){this._tempVec2.set(this.x,t),n.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(t){var e=1/this._scaleX;this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,n.scale(this.body,e,this._scaleY),n.scale(this.body,t,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(t){var e=1/this._scaleY;this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,n.scale(this.body,this._scaleX,e),n.scale(this.body,this._scaleX,t)}},angle:{get:function(){return o(this.body.angle*s.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(t){this._rotation=r(t),n.setAngle(this.body,this._rotation)}},setPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._tempVec2.set(t,e),n.setPosition(this.body,this._tempVec2),this},setRotation:function(t){return void 0===t&&(t=0),this._rotation=r(t),n.setAngle(this.body,t),this},setFixedRotation:function(){return n.setInertia(this.body,1/0),this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,n.setAngle(this.body,this.rotation),this},setScale:function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=t);var s=1/this._scaleX,r=1/this._scaleY;return this._scaleX=t,this._scaleY=e,n.scale(this.body,s,r,i),n.scale(this.body,t,e,i),this}};t.exports=a},function(t,e,i){var n=i(195),s={setSleepThreshold:function(t){return void 0===t&&(t=60),this.body.sleepThreshold=t,this},setSleepEvents:function(t,e){return this.setSleepStartEvent(t),this.setSleepEndEvent(e),this},setSleepStartEvent:function(t){if(t){var e=this.world;n.on(this.body,"sleepStart",function(t){e.emit("sleepstart",t,this)})}else n.off(this.body,"sleepStart");return this},setSleepEndEvent:function(t){if(t){var e=this.world;n.on(this.body,"sleepEnd",function(t){e.emit("sleepend",t,this)})}else n.off(this.body,"sleepEnd");return this}};t.exports=s},function(t,e,i){var n=i(126),s=i(67),r=i(80),o=i(33),a=i(2),h=i(81),l=i(76),u={parseBody:function(t,e,i,n,r){for(var h=a(r,"fixtures",[]),l=[],u=0;u<h.length;u++)for(var c=this.parseFixture(h[u]),d=0;d<c.length;d++)l.push(c[d]);var f=o.extend({},!1,r);delete f.fixtures,delete f.type;var p=s.create(f);return s.setParts(p,l),p.render.sprite.xOffset=p.position.x/i,p.render.sprite.yOffset=p.position.y/n,s.setPosition(p,{x:t,y:e}),p},parseFixture:function(t){var e,i=o.extend({},!1,t);if(delete i.circle,delete i.vertices,t.circle){var s=a(t.circle,"x"),r=a(t.circle,"y"),h=a(t.circle,"radius");e=[n.circle(s,r,h,i)]}else t.vertices&&(e=this.parseVertices(t.vertices,i));return e},parseVertices:function(t,e){var i,n,a,u,c,d=[];for(e=e||{},u=0;u<t.length;u+=1)d.push(s.create(o.extend({position:l.centre(t[u]),vertices:t[u]},e)));for(i=0;i<d.length;i++){var f=d[i];for(n=i+1;n<d.length;n++){var p=d[n];if(r.overlaps(f.bounds,p.bounds)){var g=f.vertices,v=p.vertices;for(a=0;a<f.vertices.length;a++)for(c=0;c<p.vertices.length;c++){var y=h.magnitudeSquared(h.sub(g[(a+1)%g.length],v[c])),m=h.magnitudeSquared(h.sub(g[a],v[(c+1)%v.length]));y<5&&m<5&&(g[a].isInternal=!0,v[c].isInternal=!0)}}}}return d}};t.exports=u},function(t,e,i){var n=i(126),s=i(67),r=i(2),o=i(1094),a=i(76),h={setRectangle:function(t,e,i){return this.setBody({type:"rectangle",width:t,height:e},i)},setCircle:function(t,e){return this.setBody({type:"circle",radius:t},e)},setPolygon:function(t,e,i){return this.setBody({type:"polygon",sides:e,radius:t},i)},setTrapezoid:function(t,e,i,n){return this.setBody({type:"trapezoid",width:t,height:e,slope:i},n)},setExistingBody:function(t,e){void 0===e&&(e=!0),this.body&&this.world.remove(this.body),this.body=t;for(var i=0;i<t.parts.length;i++)t.parts[i].gameObject=this;var n=this;return t.destroy=function(){n.world.remove(n.body),n.body.gameObject=null},e&&this.world.add(t),this._originComponent&&this.setOrigin(t.render.sprite.xOffset,t.render.sprite.yOffset),this},setBody:function(t,e){if(!t)return this;var i;"string"==typeof t&&(t={type:t});var h=r(t,"type","rectangle"),l=r(t,"x",this._tempVec2.x),u=r(t,"y",this._tempVec2.y),c=r(t,"width",this.width),d=r(t,"height",this.height);switch(h){case"rectangle":i=n.rectangle(l,u,c,d,e);break;case"circle":var f=r(t,"radius",Math.max(c,d)/2),p=r(t,"maxSides",25);i=n.circle(l,u,f,e,p);break;case"trapezoid":var g=r(t,"slope",.5);i=n.trapezoid(l,u,c,d,g,e);break;case"polygon":var v=r(t,"sides",5),y=r(t,"radius",Math.max(c,d)/2);i=n.polygon(l,u,v,y,e);break;case"fromVertices":case"fromVerts":var m=r(t,"verts",null);if(m)if("string"==typeof m&&(m=a.fromPath(m)),this.body&&!this.body.hasOwnProperty("temp"))s.setVertices(this.body,m),i=this.body;else{var x=r(t,"flagInternal",!1),w=r(t,"removeCollinear",.01),b=r(t,"minimumArea",10);i=n.fromVertices(l,u,m,e,x,w,b)}break;case"fromPhysicsEditor":i=o.parseBody(l,u,c,d,t)}return i&&this.setExistingBody(i,t.addToWorld),this}};t.exports=h},function(t,e){t.exports={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}}},function(t,e,i){var n=i(67),s={setStatic:function(t){return n.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=s},function(t,e,i){var n=i(67),s=i(3),r={setMass:function(t){return n.setMass(this.body,t),this},setDensity:function(t){return n.setDensity(this.body,t),this},centerOfMass:{get:function(){return new s(this.body.render.sprite.xOffset*this.width,this.body.render.sprite.yOffset*this.height)}}};t.exports=r},function(t,e){t.exports={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}}},function(t,e){var i={setFriction:function(t,e,i){return this.body.friction=t,void 0!==e&&(this.body.frictionAir=e),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}};t.exports=i},function(t,e,i){var n=i(67),s={applyForce:function(t){return this._tempVec2.set(this.body.position.x,this.body.position.y),n.applyForce(this.body,this._tempVec2,t),this},applyForceFrom:function(t,e){return n.applyForce(this.body,t,e),this},thrust:function(t){var e=this.body.angle;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(t){var e=this.body.angle-Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(t){var e=this.body.angle+Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(t){var e=this.body.angle-Math.PI;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};t.exports=s},function(t,e){var i={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i<t.length;i++)e|=t[i];else e=t;return this.body.collisionFilter.mask=e,this}};t.exports=i},function(t,e){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},function(t,e,i){var n=i(419),s=i(2),r=i(3);t.exports=function(t,e,i){void 0===i&&(i={});var o=e.x,a=e.y;e.body={temp:!0,position:{x:o,y:a}},[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity].forEach(function(t){for(var i in t)(n=t[i]).get&&"function"==typeof n.get||n.set&&"function"==typeof n.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var n}),e.world=t,e._tempVec2=new r(o,a);var h=s(i,"shape",null);return h||(h="rectangle"),e.setBody(h,i),e}},function(t,e,i){t.exports={Factory:i(1070),Image:i(1067),Matter:i(501),MatterPhysics:i(1086),PolyDecomp:i(1069),Sprite:i(1066),TileBody:i(504),World:i(1060)}},function(t,e){t.exports=function(t,e,i,n){var s,r,o=e.pos.y+e.size.y-i.pos.y;if(n){var a=e===n?i:e;n.vel.y=-n.vel.y*n.bounciness+a.vel.y,s=0,n===e&&Math.abs(n.vel.y-a.vel.y)<n.minBounceVelocity&&(n.standing=!0,s=a.vel.x*t.delta);var h=t.collisionMap.trace(n.pos.x,n.pos.y,s,n===e?-o:o,n.size.x,n.size.y);n.pos.y=h.pos.y,n.pos.x=h.pos.x}else if(t.gravity&&(i.standing||e.vel.y>0))r=t.collisionMap.trace(e.pos.x,e.pos.y,0,-(e.pos.y+e.size.y-i.pos.y),e.size.x,e.size.y),e.pos.y=r.pos.y,e.bounciness>0&&e.vel.y>e.minBounceVelocity?e.vel.y*=-e.bounciness:(e.standing=!0,e.vel.y=0);else{var l=(e.vel.y-i.vel.y)/2;e.vel.y=-l,i.vel.y=l,s=i.vel.x*t.delta,r=t.collisionMap.trace(e.pos.x,e.pos.y,s,-o/2,e.size.x,e.size.y),e.pos.y=r.pos.y;var u=t.collisionMap.trace(i.pos.x,i.pos.y,0,o/2,i.size.x,i.size.y);i.pos.y=u.pos.y}}},function(t,e){t.exports=function(t,e,i,n){var s=e.pos.x+e.size.x-i.pos.x;if(n){var r=e===n?i:e;n.vel.x=-n.vel.x*n.bounciness+r.vel.x;var o=t.collisionMap.trace(n.pos.x,n.pos.y,n===e?-s:s,0,n.size.x,n.size.y);n.pos.x=o.pos.x}else{var a=(e.vel.x-i.vel.x)/2;e.vel.x=-a,i.vel.x=a;var h=t.collisionMap.trace(e.pos.x,e.pos.y,-s/2,0,e.size.x,e.size.y);e.pos.x=Math.floor(h.pos.x);var l=t.collisionMap.trace(i.pos.x,i.pos.y,s/2,0,i.size.x,i.size.y);i.pos.x=Math.ceil(l.pos.x)}}},function(t,e,i){var n=i(224),s=i(1107),r=i(1106);t.exports=function(t,e,i){var o=null;e.collides===n.LITE||i.collides===n.FIXED?o=e:i.collides!==n.LITE&&e.collides!==n.FIXED||(o=i),e.last.x+e.size.x>i.last.x&&e.last.x<i.last.x+i.size.x?(e.last.y<i.last.y?r(t,e,i,o):r(t,i,e,o),e.collideWith(i,"y"),i.collideWith(e,"y"),t.emit("collide",e,i,"y")):e.last.y+e.size.y>i.last.y&&e.last.y<i.last.y+i.size.y&&(e.last.x<i.last.x?s(t,e,i,o):s(t,i,e,o),e.collideWith(i,"x"),i.collideWith(e,"x"),t.emit("collide",e,i,"x"))}},function(t,e,i){var n=i(0),s=i(1075),r=i(2),o=i(96),a=i(15),h=i(1071),l=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.world=new h(this.scene,this.config),this.add=new s(this.world),this.systems.events.once("destroy",this.destroy,this)},start:function(){this.world||(this.world=new h(this.scene,this.config),this.add=new s(this.world));var t=this.systems.events;t.on("update",this.world.update,this.world),t.once("shutdown",this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return o(r(e,"impact",{}),r(t,"impact",{}))},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},shutdown:function(){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});a.register("ImpactPhysics",l,"impactPhysics"),t.exports=l},function(t,e){var i={setVelocityX:function(t){return this.vel.x=t,this},setVelocityY:function(t){return this.vel.y=t,this},setVelocity:function(t,e){return void 0===e&&(e=t),this.vel.x=t,this.vel.y=e,this},setMaxVelocity:function(t,e){return void 0===e&&(e=t),this.maxVel.x=t,this.maxVel.y=e,this}};t.exports=i},function(t,e){var i={setGameObject:function(t,e){return void 0===e&&(e=!0),t?(this.body.gameObject=t,e&&this.syncGameObject()):this.body.gameObject=null,this},syncGameObject:function(){var t=this.body.gameObject;return t&&this.setBodySize(t.width*t.scaleX,t.height*t.scaleY),this}};t.exports=i},function(t,e){t.exports={setOffset:function(t,e,i,n){return this.body.offset.x=t,this.body.offset.y=e,i&&this.setBodySize(i,n),this}}},function(t,e){t.exports={setGravity:function(t){return this.body.gravityFactor=t,this},gravity:{get:function(){return this.body.gravityFactor},set:function(t){this.body.gravityFactor=t}}}},function(t,e){t.exports={setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setFriction:function(t,e){return this.friction.x=t,this.friction.y=e,this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e,i){var n=i(224),s={_collideCallback:null,_callbackScope:null,setCollideCallback:function(t,e){return this._collideCallback=t,e&&(this._callbackScope=e),this},setCollidesNever:function(){return this.body.collides=n.NEVER,this},setLiteCollision:function(){return this.body.collides=n.LITE,this},setPassiveCollision:function(){return this.body.collides=n.PASSIVE,this},setActiveCollision:function(){return this.body.collides=n.ACTIVE,this},setFixedCollision:function(){return this.body.collides=n.FIXED,this},collides:{get:function(){return this.body.collides},set:function(t){this.body.collides=t}}};t.exports=s},function(t,e,i){var n=i(223),s={setAvsB:function(){return this.setTypeA(),this.setCheckAgainstB()},setBvsA:function(){return this.setTypeB(),this.setCheckAgainstA()},setCheckAgainstNone:function(){return this.body.checkAgainst=n.NONE,this},setCheckAgainstA:function(){return this.body.checkAgainst=n.A,this},setCheckAgainstB:function(){return this.body.checkAgainst=n.B,this},checkAgainst:{get:function(){return this.body.checkAgainst},set:function(t){this.body.checkAgainst=t}}};t.exports=s},function(t,e){t.exports={setBounce:function(t){return this.body.bounciness=t,this},setMinBounceVelocity:function(t){return this.body.minBounceVelocity=t,this},bounce:{get:function(){return this.body.bounciness},set:function(t){this.body.bounciness=t}}}},function(t,e,i){var n=i(223),s={getBodyType:function(){return this.body.type},setTypeNone:function(){return this.body.type=n.NONE,this},setTypeA:function(){return this.body.type=n.A,this},setTypeB:function(){return this.body.type=n.B,this}};t.exports=s},function(t,e){var i={setBodySize:function(t,e){return void 0===e&&(e=t),this.body.size.x=Math.round(t),this.body.size.y=Math.round(e),this},setBodyScale:function(t,e){void 0===e&&(e=t);var i=this.body.gameObject;return i?(i.setScale(t,e),this.setBodySize(i.width*i.scaleX,i.height*i.scaleY)):this.setBodySize(this.body.size.x*t,this.body.size.y*e)}};t.exports=i},function(t,e){t.exports={setAccelerationX:function(t){return this.accel.x=t,this},setAccelerationY:function(t){return this.accel.y=t,this},setAcceleration:function(t,e){return this.accel.x=t,this.accel.y=e,this}}},function(t,e){var i=.5,n=1/3,s=2/3;t.exports={2:[0,1,1,0,!0],3:[0,1,1,i,!0],4:[0,i,1,0,!0],5:[0,1,1,s,!0],6:[0,s,1,n,!0],7:[0,n,1,0,!0],8:[i,1,0,0,!0],9:[1,0,i,1,!0],10:[i,1,1,0,!0],11:[0,0,i,1,!0],12:[0,0,1,0,!1],13:[1,1,0,0,!0],14:[1,i,0,0,!0],15:[1,1,0,i,!0],16:[1,n,0,0,!0],17:[1,s,0,n,!0],18:[1,1,0,s,!0],19:[1,1,i,0,!0],20:[i,0,0,1,!0],21:[0,1,i,0,!0],22:[i,0,1,1,!0],23:[1,1,0,1,!1],24:[0,0,1,1,!0],25:[0,0,1,i,!0],26:[0,i,1,1,!0],27:[0,0,1,n,!0],28:[0,n,1,s,!0],29:[0,s,1,1,!0],30:[n,1,0,0,!0],31:[1,0,s,1,!0],32:[s,1,1,0,!0],33:[0,0,n,1,!0],34:[1,0,1,1,!1],35:[1,0,0,1,!0],36:[1,i,0,1,!0],37:[1,0,0,i,!0],38:[1,s,0,1,!0],39:[1,n,0,s,!0],40:[1,0,0,n,!0],41:[s,1,n,0,!0],42:[s,0,n,1,!0],43:[n,1,s,0,!0],44:[n,0,s,1,!0],45:[0,1,0,0,!1],52:[1,1,s,0,!0],53:[n,0,0,1,!0],54:[0,1,n,0,!0],55:[s,0,1,1,!0]}},function(t,e){t.exports=function(t,e){if(t.standing=!1,e.collision.y&&(t.bounciness>0&&Math.abs(t.vel.y)>t.minBounceVelocity?t.vel.y*=-t.bounciness:(t.vel.y>0&&(t.standing=!0),t.vel.y=0)),e.collision.x&&(t.bounciness>0&&Math.abs(t.vel.x)>t.minBounceVelocity?t.vel.x*=-t.bounciness:t.vel.x=0),e.collision.slope){var i=e.collision.slope;if(t.bounciness>0){var n=t.vel.x*i.nx+t.vel.y*i.ny;t.vel.x=(t.vel.x-i.nx*n*2)*t.bounciness,t.vel.y=(t.vel.y-i.ny*n*2)*t.bounciness}else{var s=i.x*i.x+i.y*i.y,r=(t.vel.x*i.x+t.vel.y*i.y)/s;t.vel.x=i.x*r,t.vel.y=i.y*r;var o=Math.atan2(i.x,i.y);o>t.slopeStanding.min&&o<t.slopeStanding.max&&(t.standing=!0)}}t.pos.x=e.pos.x,t.pos.y=e.pos.y}},function(t,e,i){var n=i(23);t.exports=function(t,e,i,s,r){if(i)return n(e+i*t,-r,r);if(s){var o=s*t;return e-o>0?e-o:e+o<0?e+o:0}return n(e,-r,r)}},function(t,e,i){t.exports={Body:i(1077),COLLIDES:i(224),CollisionMap:i(1076),Factory:i(1075),Image:i(1073),ImpactBody:i(1074),ImpactPhysics:i(1109),Sprite:i(1072),TYPE:i(223),World:i(1071)}},function(t,e,i){t.exports={Arcade:i(528),Impact:i(1125),Matter:i(1105)}},function(t,e,i){(function(e){i(1059);var n=i(26),s=i(20),r={Actions:i(417),Animation:i(993),Cache:i(992),Cameras:i(991),Class:i(0),Create:i(948),Curves:i(942),Data:i(939),Display:i(937),DOM:i(908),Events:i(906),Game:i(904),GameObjects:i(876),Geom:i(274),Input:i(616),Loader:i(593),Math:i(570),Physics:i(1126),Plugins:i(498),Renderer:i(1083),Scene:i(328),Scenes:i(496),Sound:i(494),Structs:i(493),Textures:i(492),Tilemaps:i(490),Time:i(441),Tweens:i(439),Utils:i(435)};r=s(!1,r,n),t.exports=r,e.Phaser=r}).call(this,i(200))}])}); \ No newline at end of file diff --git a/public/phaser-harkat/phaser/phaser2.min.js b/public/phaser-harkat/phaser/phaser2.min.js new file mode 100644 index 0000000000000000000000000000000000000000..79611464e920631d74d9f04ac3c73cb1c6b07246 --- /dev/null +++ b/public/phaser-harkat/phaser/phaser2.min.js @@ -0,0 +1,4 @@ +/* Phaser v2.11.1 - http://phaser.io - @photonstorm - (c) 2016 Photon Storm Ltd. */ + +!function(t){if("object"==typeof exports)module.exports=t();else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.p2=t()}}(function(){return function t(e,i,s){function n(o,a){if(!i[o]){if(!e[o]){var h="function"==typeof require&&require;if(!a&&h)return h(o,!0);if(r)return r(o,!0);throw new Error("Cannot find module '"+o+"'")}var l=i[o]={exports:{}};e[o][0].call(l.exports,function(t){var i=e[o][1][t];return n(i||t)},l,l.exports,t,e,i,s)}return i[o].exports}for(var r="function"==typeof require&&require,o=0;o<s.length;o++)n(s[o]);return n}({1:[function(t,e,i){function s(){}var n=t("./Scalar");e.exports=s,s.lineInt=function(t,e,i){i=i||0;var s,r,o,a,h,l,c,u=[0,0];return s=t[1][1]-t[0][1],r=t[0][0]-t[1][0],o=s*t[0][0]+r*t[0][1],a=e[1][1]-e[0][1],h=e[0][0]-e[1][0],l=a*e[0][0]+h*e[0][1],c=s*h-a*r,n.eq(c,0,i)||(u[0]=(h*o-r*l)/c,u[1]=(s*l-a*o)/c),u},s.segmentsIntersect=function(t,e,i,s){var n=e[0]-t[0],r=e[1]-t[1],o=s[0]-i[0],a=s[1]-i[1];if(o*r-a*n==0)return!1;var h=(n*(i[1]-t[1])+r*(t[0]-i[0]))/(o*r-a*n),l=(o*(t[1]-i[1])+a*(i[0]-t[0]))/(a*n-o*r);return h>=0&&h<=1&&l>=0&&l<=1}},{"./Scalar":4}],2:[function(t,e,i){function s(){}e.exports=s,s.area=function(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])},s.left=function(t,e,i){return s.area(t,e,i)>0},s.leftOn=function(t,e,i){return s.area(t,e,i)>=0},s.right=function(t,e,i){return s.area(t,e,i)<0},s.rightOn=function(t,e,i){return s.area(t,e,i)<=0};var n=[],r=[];s.collinear=function(t,e,i,o){if(o){var a=n,h=r;a[0]=e[0]-t[0],a[1]=e[1]-t[1],h[0]=i[0]-e[0],h[1]=i[1]-e[1];var l=a[0]*h[0]+a[1]*h[1],c=Math.sqrt(a[0]*a[0]+a[1]*a[1]),u=Math.sqrt(h[0]*h[0]+h[1]*h[1]);return Math.acos(l/(c*u))<o}return 0==s.area(t,e,i)},s.sqdist=function(t,e){var i=e[0]-t[0],s=e[1]-t[1];return i*i+s*s}},{}],3:[function(t,e,i){function s(){this.vertices=[]}function n(t,e,i,s,n){n=n||0;var r=e[1]-t[1],o=t[0]-e[0],h=r*t[0]+o*t[1],l=s[1]-i[1],c=i[0]-s[0],u=l*i[0]+c*i[1],d=r*c-l*o;return a.eq(d,0,n)?[0,0]:[(c*h-o*u)/d,(r*u-l*h)/d]}var r=t("./Line"),o=t("./Point"),a=t("./Scalar");e.exports=s,s.prototype.at=function(t){var e=this.vertices,i=e.length;return e[t<0?t%i+i:t%i]},s.prototype.first=function(){return this.vertices[0]},s.prototype.last=function(){return this.vertices[this.vertices.length-1]},s.prototype.clear=function(){this.vertices.length=0},s.prototype.append=function(t,e,i){if(void 0===e)throw new Error("From is not given!");if(void 0===i)throw new Error("To is not given!");if(i-1<e)throw new Error("lol1");if(i>t.vertices.length)throw new Error("lol2");if(e<0)throw new Error("lol3");for(var s=e;s<i;s++)this.vertices.push(t.vertices[s])},s.prototype.makeCCW=function(){for(var t=0,e=this.vertices,i=1;i<this.vertices.length;++i)(e[i][1]<e[t][1]||e[i][1]==e[t][1]&&e[i][0]>e[t][0])&&(t=i);o.left(this.at(t-1),this.at(t),this.at(t+1))||this.reverse()},s.prototype.reverse=function(){for(var t=[],e=0,i=this.vertices.length;e!==i;e++)t.push(this.vertices.pop());this.vertices=t},s.prototype.isReflex=function(t){return o.right(this.at(t-1),this.at(t),this.at(t+1))};var h=[],l=[];s.prototype.canSee=function(t,e){var i,s,n=h,a=l;if(o.leftOn(this.at(t+1),this.at(t),this.at(e))&&o.rightOn(this.at(t-1),this.at(t),this.at(e)))return!1;s=o.sqdist(this.at(t),this.at(e));for(var c=0;c!==this.vertices.length;++c)if((c+1)%this.vertices.length!==t&&c!==t&&o.leftOn(this.at(t),this.at(e),this.at(c+1))&&o.rightOn(this.at(t),this.at(e),this.at(c))&&(n[0]=this.at(t),n[1]=this.at(e),a[0]=this.at(c),a[1]=this.at(c+1),i=r.lineInt(n,a),o.sqdist(this.at(t),i)<s))return!1;return!0},s.prototype.copy=function(t,e,i){var n=i||new s;if(n.clear(),t<e)for(r=t;r<=e;r++)n.vertices.push(this.vertices[r]);else{for(r=0;r<=e;r++)n.vertices.push(this.vertices[r]);for(var r=t;r<this.vertices.length;r++)n.vertices.push(this.vertices[r])}return n},s.prototype.getCutEdges=function(){for(var t=[],e=[],i=[],n=new s,r=Number.MAX_VALUE,o=0;o<this.vertices.length;++o)if(this.isReflex(o))for(var a=0;a<this.vertices.length;++a)if(this.canSee(o,a)){e=this.copy(o,a,n).getCutEdges(),i=this.copy(a,o,n).getCutEdges();for(var h=0;h<i.length;h++)e.push(i[h]);e.length<r&&(t=e,r=e.length,t.push([this.at(o),this.at(a)]))}return t},s.prototype.decomp=function(){var t=this.getCutEdges();return t.length>0?this.slice(t):[this]},s.prototype.slice=function(t){if(0==t.length)return[this];if(t instanceof Array&&t.length&&t[0]instanceof Array&&2==t[0].length&&t[0][0]instanceof Array){for(var e=[this],i=0;i<t.length;i++)for(var s=t[i],n=0;n<e.length;n++){var r=e[n].slice(s);if(r){e.splice(n,1),e.push(r[0],r[1]);break}}return e}var s=t,i=this.vertices.indexOf(s[0]),n=this.vertices.indexOf(s[1]);return-1!=i&&-1!=n&&[this.copy(i,n),this.copy(n,i)]},s.prototype.isSimple=function(){for(var t=this.vertices,e=0;e<t.length-1;e++)for(var i=0;i<e-1;i++)if(r.segmentsIntersect(t[e],t[e+1],t[i],t[i+1]))return!1;for(e=1;e<t.length-2;e++)if(r.segmentsIntersect(t[0],t[t.length-1],t[e],t[e+1]))return!1;return!0},s.prototype.quickDecomp=function(t,e,i,r,a,h){a=a||100,h=h||0,r=r||25,t=void 0!==t?t:[],e=e||[],i=i||[];var l=[0,0],c=[0,0],u=[0,0],d=0,p=0,f=0,g=0,m=0,y=0,v=0,x=new s,b=new s,_=this,w=this.vertices;if(w.length<3)return t;if(++h>a)return console.warn("quickDecomp: max level ("+a+") reached."),t;for(var T=0;T<this.vertices.length;++T)if(_.isReflex(T)){e.push(_.vertices[T]),d=p=Number.MAX_VALUE;for(P=0;P<this.vertices.length;++P)o.left(_.at(T-1),_.at(T),_.at(P))&&o.rightOn(_.at(T-1),_.at(T),_.at(P-1))&&(u=n(_.at(T-1),_.at(T),_.at(P),_.at(P-1)),o.right(_.at(T+1),_.at(T),u)&&(f=o.sqdist(_.vertices[T],u))<p&&(p=f,c=u,y=P)),o.left(_.at(T+1),_.at(T),_.at(P+1))&&o.rightOn(_.at(T+1),_.at(T),_.at(P))&&(u=n(_.at(T+1),_.at(T),_.at(P),_.at(P+1)),o.left(_.at(T-1),_.at(T),u)&&(f=o.sqdist(_.vertices[T],u))<d&&(d=f,l=u,m=P));if(y==(m+1)%this.vertices.length)u[0]=(c[0]+l[0])/2,u[1]=(c[1]+l[1])/2,i.push(u),T<m?(x.append(_,T,m+1),x.vertices.push(u),b.vertices.push(u),0!=y&&b.append(_,y,_.vertices.length),b.append(_,0,T+1)):(0!=T&&x.append(_,T,_.vertices.length),x.append(_,0,m+1),x.vertices.push(u),b.vertices.push(u),b.append(_,y,T+1));else{if(y>m&&(m+=this.vertices.length),g=Number.MAX_VALUE,m<y)return t;for(var P=y;P<=m;++P)o.leftOn(_.at(T-1),_.at(T),_.at(P))&&o.rightOn(_.at(T+1),_.at(T),_.at(P))&&(f=o.sqdist(_.at(T),_.at(P)))<g&&(g=f,v=P%this.vertices.length);T<v?(x.append(_,T,v+1),0!=v&&b.append(_,v,w.length),b.append(_,0,T+1)):(0!=T&&x.append(_,T,w.length),x.append(_,0,v+1),b.append(_,v,T+1))}return x.vertices.length<b.vertices.length?(x.quickDecomp(t,e,i,r,a,h),b.quickDecomp(t,e,i,r,a,h)):(b.quickDecomp(t,e,i,r,a,h),x.quickDecomp(t,e,i,r,a,h)),t}return t.push(this),t},s.prototype.removeCollinearPoints=function(t){for(var e=0,i=this.vertices.length-1;this.vertices.length>3&&i>=0;--i)o.collinear(this.at(i-1),this.at(i),this.at(i+1),t)&&(this.vertices.splice(i%this.vertices.length,1),i--,e++);return e}},{"./Line":1,"./Point":2,"./Scalar":4}],4:[function(t,e,i){function s(){}e.exports=s,s.eq=function(t,e,i){return i=i||0,Math.abs(t-e)<i}},{}],5:[function(t,e,i){e.exports={Polygon:t("./Polygon"),Point:t("./Point")}},{"./Point":2,"./Polygon":3}],6:[function(t,e,i){e.exports={name:"p2",version:"0.7.1",description:"A JavaScript 2D physics engine.",author:"Stefan Hedman <schteppe@gmail.com> (http://steffe.se)",keywords:["p2.js","p2","physics","engine","2d"],main:"./src/p2.js",engines:{node:"*"},repository:{type:"git",url:"https://github.com/schteppe/p2.js.git"},bugs:{url:"https://github.com/schteppe/p2.js/issues"},licenses:[{type:"MIT"}],devDependencies:{grunt:"^0.4.5","grunt-contrib-jshint":"^0.11.2","grunt-contrib-nodeunit":"^0.4.1","grunt-contrib-uglify":"~0.4.0","grunt-contrib-watch":"~0.5.0","grunt-browserify":"~2.0.1","grunt-contrib-concat":"^0.4.0"},dependencies:{"poly-decomp":"0.1.1"}}},{}],7:[function(t,e,i){function s(t){this.lowerBound=n.create(),t&&t.lowerBound&&n.copy(this.lowerBound,t.lowerBound),this.upperBound=n.create(),t&&t.upperBound&&n.copy(this.upperBound,t.upperBound)}var n=t("../math/vec2");t("../utils/Utils");e.exports=s;var r=n.create();s.prototype.setFromPoints=function(t,e,i,s){var o=this.lowerBound,a=this.upperBound;"number"!=typeof i&&(i=0),0!==i?n.rotate(o,t[0],i):n.copy(o,t[0]),n.copy(a,o);for(var h=Math.cos(i),l=Math.sin(i),c=1;c<t.length;c++){var u=t[c];if(0!==i){var d=u[0],p=u[1];r[0]=h*d-l*p,r[1]=l*d+h*p,u=r}for(var f=0;f<2;f++)u[f]>a[f]&&(a[f]=u[f]),u[f]<o[f]&&(o[f]=u[f])}e&&(n.add(this.lowerBound,this.lowerBound,e),n.add(this.upperBound,this.upperBound,e)),s&&(this.lowerBound[0]-=s,this.lowerBound[1]-=s,this.upperBound[0]+=s,this.upperBound[1]+=s)},s.prototype.copy=function(t){n.copy(this.lowerBound,t.lowerBound),n.copy(this.upperBound,t.upperBound)},s.prototype.extend=function(t){for(var e=2;e--;){var i=t.lowerBound[e];this.lowerBound[e]>i&&(this.lowerBound[e]=i);var s=t.upperBound[e];this.upperBound[e]<s&&(this.upperBound[e]=s)}},s.prototype.overlaps=function(t){var e=this.lowerBound,i=this.upperBound,s=t.lowerBound,n=t.upperBound;return(s[0]<=i[0]&&i[0]<=n[0]||e[0]<=n[0]&&n[0]<=i[0])&&(s[1]<=i[1]&&i[1]<=n[1]||e[1]<=n[1]&&n[1]<=i[1])},s.prototype.containsPoint=function(t){var e=this.lowerBound,i=this.upperBound;return e[0]<=t[0]&&t[0]<=i[0]&&e[1]<=t[1]&&t[1]<=i[1]},s.prototype.overlapsRay=function(t){var e=1/t.direction[0],i=1/t.direction[1],s=(this.lowerBound[0]-t.from[0])*e,n=(this.upperBound[0]-t.from[0])*e,r=(this.lowerBound[1]-t.from[1])*i,o=(this.upperBound[1]-t.from[1])*i,a=Math.max(Math.max(Math.min(s,n),Math.min(r,o))),h=Math.min(Math.min(Math.max(s,n),Math.max(r,o)));return h<0?-1:a>h?-1:a}},{"../math/vec2":30,"../utils/Utils":57}],8:[function(t,e,i){function s(t){this.type=t,this.result=[],this.world=null,this.boundingVolumeType=s.AABB}var n=t("../math/vec2"),r=t("../objects/Body");e.exports=s,s.AABB=1,s.BOUNDING_CIRCLE=2,s.prototype.setWorld=function(t){this.world=t},s.prototype.getCollisionPairs=function(t){};var o=n.create();s.boundingRadiusCheck=function(t,e){n.sub(o,t.position,e.position);var i=n.squaredLength(o),s=t.boundingRadius+e.boundingRadius;return i<=s*s},s.aabbCheck=function(t,e){return t.getAABB().overlaps(e.getAABB())},s.prototype.boundingVolumeCheck=function(t,e){var i;switch(this.boundingVolumeType){case s.BOUNDING_CIRCLE:i=s.boundingRadiusCheck(t,e);break;case s.AABB:i=s.aabbCheck(t,e);break;default:throw new Error("Bounding volume type not recognized: "+this.boundingVolumeType)}return i},s.canCollide=function(t,e){var i=r.KINEMATIC,s=r.STATIC;return(t.type!==s||e.type!==s)&&(!(t.type===i&&e.type===s||t.type===s&&e.type===i)&&((t.type!==i||e.type!==i)&&((t.sleepState!==r.SLEEPING||e.sleepState!==r.SLEEPING)&&!(t.sleepState===r.SLEEPING&&e.type===s||e.sleepState===r.SLEEPING&&t.type===s))))},s.NAIVE=1,s.SAP=2},{"../math/vec2":30,"../objects/Body":31}],9:[function(t,e,i){function s(){n.call(this,n.NAIVE)}t("../shapes/Circle"),t("../shapes/Plane"),t("../shapes/Shape"),t("../shapes/Particle");var n=t("../collision/Broadphase");t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.getCollisionPairs=function(t){var e=t.bodies,i=this.result;i.length=0;for(var s=0,r=e.length;s!==r;s++)for(var o=e[s],a=0;a<s;a++){var h=e[a];n.canCollide(o,h)&&this.boundingVolumeCheck(o,h)&&i.push(o,h)}return i},s.prototype.aabbQuery=function(t,e,i){i=i||[];for(var s=t.bodies,n=0;n<s.length;n++){var r=s[n];r.aabbNeedsUpdate&&r.updateAABB(),r.aabb.overlaps(e)&&i.push(r)}return i}},{"../collision/Broadphase":8,"../math/vec2":30,"../shapes/Circle":39,"../shapes/Particle":43,"../shapes/Plane":44,"../shapes/Shape":45}],10:[function(t,e,i){function s(){this.contactEquations=[],this.frictionEquations=[],this.enableFriction=!0,this.enabledEquations=!0,this.slipForce=10,this.frictionCoefficient=.3,this.surfaceVelocity=0,this.contactEquationPool=new c({size:32}),this.frictionEquationPool=new u({size:64}),this.restitution=0,this.stiffness=p.DEFAULT_STIFFNESS,this.relaxation=p.DEFAULT_RELAXATION,this.frictionStiffness=p.DEFAULT_STIFFNESS,this.frictionRelaxation=p.DEFAULT_RELAXATION,this.enableFrictionReduction=!0,this.collidingBodiesLastStep=new d,this.contactSkinSize=.01}function n(t,e){o.set(t.vertices[0],.5*-e.length,-e.radius),o.set(t.vertices[1],.5*e.length,-e.radius),o.set(t.vertices[2],.5*e.length,e.radius),o.set(t.vertices[3],.5*-e.length,e.radius)}function r(t,e,i,s){for(var n=H,r=q,l=Y,c=z,u=t,d=e.vertices,p=null,f=0;f!==d.length+1;f++){var g=d[f%d.length],m=d[(f+1)%d.length];o.rotate(n,g,s),o.rotate(r,m,s),h(n,n,i),h(r,r,i),a(l,n,u),a(c,r,u);var y=o.crossLength(l,c);if(null===p&&(p=y),y*p<=0)return!1;p=y}return!0}var o=t("../math/vec2"),a=o.sub,h=o.add,l=o.dot,c=(t("../utils/Utils"),t("../utils/ContactEquationPool")),u=t("../utils/FrictionEquationPool"),d=t("../utils/TupleDictionary"),p=t("../equations/Equation"),f=(t("../equations/ContactEquation"),t("../equations/FrictionEquation"),t("../shapes/Circle")),g=t("../shapes/Convex"),m=t("../shapes/Shape"),y=(t("../objects/Body"),t("../shapes/Box"));e.exports=s;var v=o.fromValues(0,1),x=o.fromValues(0,0),b=o.fromValues(0,0),_=o.fromValues(0,0),w=o.fromValues(0,0),T=o.fromValues(0,0),P=o.fromValues(0,0),C=o.fromValues(0,0),S=o.fromValues(0,0),A=o.fromValues(0,0),E=o.fromValues(0,0),M=o.fromValues(0,0),R=o.fromValues(0,0),L=o.fromValues(0,0),B=o.fromValues(0,0),I=o.fromValues(0,0),O=o.fromValues(0,0),k=o.fromValues(0,0),F=o.fromValues(0,0),D=[],U=o.create(),G=o.create();s.prototype.bodiesOverlap=function(t,e){for(var i=U,s=G,n=0,r=t.shapes.length;n!==r;n++){var o=t.shapes[n];t.toWorldFrame(i,o.position);for(var a=0,h=e.shapes.length;a!==h;a++){var l=e.shapes[a];if(e.toWorldFrame(s,l.position),this[o.type|l.type](t,o,i,o.angle+t.angle,e,l,s,l.angle+e.angle,!0))return!0}}return!1},s.prototype.collidedLastStep=function(t,e){var i=0|t.id,s=0|e.id;return!!this.collidingBodiesLastStep.get(i,s)},s.prototype.reset=function(){this.collidingBodiesLastStep.reset();for(var t=this.contactEquations,e=t.length;e--;){var i=t[e],s=i.bodyA.id,n=i.bodyB.id;this.collidingBodiesLastStep.set(s,n,!0)}for(var r=this.contactEquations,o=this.frictionEquations,a=0;a<r.length;a++)this.contactEquationPool.release(r[a]);for(a=0;a<o.length;a++)this.frictionEquationPool.release(o[a]);this.contactEquations.length=this.frictionEquations.length=0},s.prototype.createContactEquation=function(t,e,i,s){var n=this.contactEquationPool.get();return n.bodyA=t,n.bodyB=e,n.shapeA=i,n.shapeB=s,n.restitution=this.restitution,n.firstImpact=!this.collidedLastStep(t,e),n.stiffness=this.stiffness,n.relaxation=this.relaxation,n.needsUpdate=!0,n.enabled=this.enabledEquations,n.offset=this.contactSkinSize,n},s.prototype.createFrictionEquation=function(t,e,i,s){var n=this.frictionEquationPool.get();return n.bodyA=t,n.bodyB=e,n.shapeA=i,n.shapeB=s,n.setSlipForce(this.slipForce),n.frictionCoefficient=this.frictionCoefficient,n.relativeVelocity=this.surfaceVelocity,n.enabled=this.enabledEquations,n.needsUpdate=!0,n.stiffness=this.frictionStiffness,n.relaxation=this.frictionRelaxation,n.contactEquations.length=0,n},s.prototype.createFrictionFromContact=function(t){var e=this.createFrictionEquation(t.bodyA,t.bodyB,t.shapeA,t.shapeB);return o.copy(e.contactPointA,t.contactPointA),o.copy(e.contactPointB,t.contactPointB),o.rotate90cw(e.t,t.normalA),e.contactEquations.push(t),e},s.prototype.createFrictionFromAverage=function(t){var e=this.contactEquations[this.contactEquations.length-1],i=this.createFrictionEquation(e.bodyA,e.bodyB,e.shapeA,e.shapeB),s=e.bodyA;e.bodyB;o.set(i.contactPointA,0,0),o.set(i.contactPointB,0,0),o.set(i.t,0,0);for(var n=0;n!==t;n++)(e=this.contactEquations[this.contactEquations.length-1-n]).bodyA===s?(o.add(i.t,i.t,e.normalA),o.add(i.contactPointA,i.contactPointA,e.contactPointA),o.add(i.contactPointB,i.contactPointB,e.contactPointB)):(o.sub(i.t,i.t,e.normalA),o.add(i.contactPointA,i.contactPointA,e.contactPointB),o.add(i.contactPointB,i.contactPointB,e.contactPointA)),i.contactEquations.push(e);var r=1/t;return o.scale(i.contactPointA,i.contactPointA,r),o.scale(i.contactPointB,i.contactPointB,r),o.normalize(i.t,i.t),o.rotate90cw(i.t,i.t),i},s.prototype[m.LINE|m.CONVEX]=s.prototype.convexLine=function(t,e,i,s,n,r,o,a,h){return!h&&0},s.prototype[m.LINE|m.BOX]=s.prototype.lineBox=function(t,e,i,s,n,r,o,a,h){return!h&&0};var N=new y({width:1,height:1}),X=o.create();s.prototype[m.CAPSULE|m.CONVEX]=s.prototype[m.CAPSULE|m.BOX]=s.prototype.convexCapsule=function(t,e,i,s,r,a,h,l,c){var u=X;o.set(u,a.length/2,0),o.rotate(u,u,l),o.add(u,u,h);var d=this.circleConvex(r,a,u,l,t,e,i,s,c,a.radius);o.set(u,-a.length/2,0),o.rotate(u,u,l),o.add(u,u,h);var p=this.circleConvex(r,a,u,l,t,e,i,s,c,a.radius);if(c&&(d||p))return!0;var f=N;return n(f,a),this.convexConvex(t,e,i,s,r,f,h,l,c)+d+p},s.prototype[m.CAPSULE|m.LINE]=s.prototype.lineCapsule=function(t,e,i,s,n,r,o,a,h){return!h&&0};var W=o.create(),j=o.create(),V=new y({width:1,height:1});s.prototype[m.CAPSULE|m.CAPSULE]=s.prototype.capsuleCapsule=function(t,e,i,s,r,a,h,l,c){for(var u=W,d=j,p=0,f=0;f<2;f++){o.set(u,(0===f?-1:1)*e.length/2,0),o.rotate(u,u,s),o.add(u,u,i);for(var g=0;g<2;g++){o.set(d,(0===g?-1:1)*a.length/2,0),o.rotate(d,d,l),o.add(d,d,h),this.enableFrictionReduction&&(x=this.enableFriction,this.enableFriction=!1);var m=this.circleCircle(t,e,u,s,r,a,d,l,c,e.radius,a.radius);if(this.enableFrictionReduction&&(this.enableFriction=x),c&&m)return!0;p+=m}}this.enableFrictionReduction&&(x=this.enableFriction,this.enableFriction=!1);var y=V;n(y,e);var v=this.convexCapsule(t,y,i,s,r,a,h,l,c);if(this.enableFrictionReduction&&(this.enableFriction=x),c&&v)return!0;if(p+=v,this.enableFrictionReduction){var x=this.enableFriction;this.enableFriction=!1}n(y,a);var b=this.convexCapsule(r,y,h,l,t,e,i,s,c);return this.enableFrictionReduction&&(this.enableFriction=x),!(!c||!b)||(p+=b,this.enableFrictionReduction&&p&&this.enableFriction&&this.frictionEquations.push(this.createFrictionFromAverage(p)),p)},s.prototype[m.LINE|m.LINE]=s.prototype.lineLine=function(t,e,i,s,n,r,o,a,h){return!h&&0},s.prototype[m.PLANE|m.LINE]=s.prototype.planeLine=function(t,e,i,s,n,r,c,u,d){var p=x,f=b,g=_,m=w,y=T,E=P,M=C,R=S,L=A,B=D,I=0;o.set(p,-r.length/2,0),o.set(f,r.length/2,0),o.rotate(g,p,u),o.rotate(m,f,u),h(g,g,c),h(m,m,c),o.copy(p,g),o.copy(f,m),a(y,f,p),o.normalize(E,y),o.rotate90cw(L,E),o.rotate(R,v,s),B[0]=p,B[1]=f;for(var O=0;O<B.length;O++){var k=B[O];a(M,k,i);var F=l(M,R);if(F<0){if(d)return!0;var U=this.createContactEquation(t,n,e,r);I++,o.copy(U.normalA,R),o.normalize(U.normalA,U.normalA),o.scale(M,R,F),a(U.contactPointA,k,M),a(U.contactPointA,U.contactPointA,t.position),a(U.contactPointB,k,c),h(U.contactPointB,U.contactPointB,c),a(U.contactPointB,U.contactPointB,n.position),this.contactEquations.push(U),this.enableFrictionReduction||this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(U))}}return!d&&(this.enableFrictionReduction||I&&this.enableFriction&&this.frictionEquations.push(this.createFrictionFromAverage(I)),I)},s.prototype[m.PARTICLE|m.CAPSULE]=s.prototype.particleCapsule=function(t,e,i,s,n,r,o,a,h){return this.circleLine(t,e,i,s,n,r,o,a,h,r.radius,0)},s.prototype[m.CIRCLE|m.LINE]=s.prototype.circleLine=function(t,e,i,s,n,r,c,u,d,p,f){var p=p||0,f=void 0!==f?f:e.radius,g=x,m=b,y=_,v=w,I=T,O=P,k=C,F=S,U=A,G=E,N=M,X=R,W=L,j=B,V=D;o.set(F,-r.length/2,0),o.set(U,r.length/2,0),o.rotate(G,F,u),o.rotate(N,U,u),h(G,G,c),h(N,N,c),o.copy(F,G),o.copy(U,N),a(O,U,F),o.normalize(k,O),o.rotate90cw(I,k),a(X,i,F);var H=l(X,I);a(v,F,c),a(W,i,c);var q=f+p;if(Math.abs(H)<q){o.scale(g,I,H),a(y,i,g),o.scale(m,I,l(I,W)),o.normalize(m,m),o.scale(m,m,p),h(y,y,m);var Y=l(k,y),z=l(k,F),K=l(k,U);if(Y>z&&Y<K){if(d)return!0;Z=this.createContactEquation(t,n,e,r);return o.scale(Z.normalA,g,-1),o.normalize(Z.normalA,Z.normalA),o.scale(Z.contactPointA,Z.normalA,f),h(Z.contactPointA,Z.contactPointA,i),a(Z.contactPointA,Z.contactPointA,t.position),a(Z.contactPointB,y,c),h(Z.contactPointB,Z.contactPointB,c),a(Z.contactPointB,Z.contactPointB,n.position),this.contactEquations.push(Z),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(Z)),1}}V[0]=F,V[1]=U;for(var J=0;J<V.length;J++){var Q=V[J];if(a(X,Q,i),o.squaredLength(X)<Math.pow(q,2)){if(d)return!0;var Z=this.createContactEquation(t,n,e,r);return o.copy(Z.normalA,X),o.normalize(Z.normalA,Z.normalA),o.scale(Z.contactPointA,Z.normalA,f),h(Z.contactPointA,Z.contactPointA,i),a(Z.contactPointA,Z.contactPointA,t.position),a(Z.contactPointB,Q,c),o.scale(j,Z.normalA,-p),h(Z.contactPointB,Z.contactPointB,j),h(Z.contactPointB,Z.contactPointB,c),a(Z.contactPointB,Z.contactPointB,n.position),this.contactEquations.push(Z),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(Z)),1}}return 0},s.prototype[m.CIRCLE|m.CAPSULE]=s.prototype.circleCapsule=function(t,e,i,s,n,r,o,a,h){return this.circleLine(t,e,i,s,n,r,o,a,h,r.radius)},s.prototype[m.CIRCLE|m.CONVEX]=s.prototype[m.CIRCLE|m.BOX]=s.prototype.circleConvex=function(t,e,i,s,n,l,c,u,d,p){for(var p="number"==typeof p?p:e.radius,f=x,g=b,m=_,y=w,v=T,P=E,C=M,S=L,A=B,R=I,k=O,F=!1,D=Number.MAX_VALUE,U=l.vertices,G=0;G!==U.length+1;G++){var N=U[G%U.length],X=U[(G+1)%U.length];if(o.rotate(f,N,u),o.rotate(g,X,u),h(f,f,c),h(g,g,c),a(m,g,f),o.normalize(y,m),o.rotate90cw(v,y),o.scale(A,v,-e.radius),h(A,A,i),r(A,l,c,u)){o.sub(R,f,A);var W=Math.abs(o.dot(R,v));W<D&&(o.copy(k,A),D=W,o.scale(S,v,W),o.add(S,S,A),F=!0)}}if(F){if(d)return!0;V=this.createContactEquation(t,n,e,l);return o.sub(V.normalA,k,i),o.normalize(V.normalA,V.normalA),o.scale(V.contactPointA,V.normalA,p),h(V.contactPointA,V.contactPointA,i),a(V.contactPointA,V.contactPointA,t.position),a(V.contactPointB,S,c),h(V.contactPointB,V.contactPointB,c),a(V.contactPointB,V.contactPointB,n.position),this.contactEquations.push(V),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(V)),1}if(p>0)for(G=0;G<U.length;G++){var j=U[G];if(o.rotate(C,j,u),h(C,C,c),a(P,C,i),o.squaredLength(P)<Math.pow(p,2)){if(d)return!0;var V=this.createContactEquation(t,n,e,l);return o.copy(V.normalA,P),o.normalize(V.normalA,V.normalA),o.scale(V.contactPointA,V.normalA,p),h(V.contactPointA,V.contactPointA,i),a(V.contactPointA,V.contactPointA,t.position),a(V.contactPointB,C,c),h(V.contactPointB,V.contactPointB,c),a(V.contactPointB,V.contactPointB,n.position),this.contactEquations.push(V),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(V)),1}}return 0};var H=o.create(),q=o.create(),Y=o.create(),z=o.create();s.prototype[m.PARTICLE|m.CONVEX]=s.prototype[m.PARTICLE|m.BOX]=s.prototype.particleConvex=function(t,e,i,s,n,c,u,d,p){var f=x,g=b,m=_,y=w,v=T,S=P,A=C,M=E,R=L,B=k,I=F,O=Number.MAX_VALUE,D=!1,U=c.vertices;if(!r(i,c,u,d))return 0;if(p)return!0;for(var G=0;G!==U.length+1;G++){var N=U[G%U.length],X=U[(G+1)%U.length];o.rotate(f,N,d),o.rotate(g,X,d),h(f,f,u),h(g,g,u),a(m,g,f),o.normalize(y,m),o.rotate90cw(v,y),a(M,i,f);l(M,v);a(S,f,u),a(A,i,u),o.sub(B,f,i);var W=Math.abs(o.dot(B,v));W<O&&(O=W,o.scale(R,v,W),o.add(R,R,i),o.copy(I,v),D=!0)}if(D){var j=this.createContactEquation(t,n,e,c);return o.scale(j.normalA,I,-1),o.normalize(j.normalA,j.normalA),o.set(j.contactPointA,0,0),h(j.contactPointA,j.contactPointA,i),a(j.contactPointA,j.contactPointA,t.position),a(j.contactPointB,R,u),h(j.contactPointB,j.contactPointB,u),a(j.contactPointB,j.contactPointB,n.position),this.contactEquations.push(j),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(j)),1}return 0},s.prototype[m.CIRCLE]=s.prototype.circleCircle=function(t,e,i,s,n,r,l,c,u,d,p){var f=x,d=d||e.radius,p=p||r.radius;a(f,i,l);var g=d+p;if(o.squaredLength(f)>Math.pow(g,2))return 0;if(u)return!0;var m=this.createContactEquation(t,n,e,r);return a(m.normalA,l,i),o.normalize(m.normalA,m.normalA),o.scale(m.contactPointA,m.normalA,d),o.scale(m.contactPointB,m.normalA,-p),h(m.contactPointA,m.contactPointA,i),a(m.contactPointA,m.contactPointA,t.position),h(m.contactPointB,m.contactPointB,l),a(m.contactPointB,m.contactPointB,n.position),this.contactEquations.push(m),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(m)),1},s.prototype[m.PLANE|m.CONVEX]=s.prototype[m.PLANE|m.BOX]=s.prototype.planeConvex=function(t,e,i,s,n,r,c,u,d){var p=x,f=b,g=_,m=0;o.rotate(f,v,s);for(var y=0;y!==r.vertices.length;y++){var w=r.vertices[y];if(o.rotate(p,w,u),h(p,p,c),a(g,p,i),l(g,f)<=0){if(d)return!0;m++;var T=this.createContactEquation(t,n,e,r);a(g,p,i),o.copy(T.normalA,f);var P=l(g,T.normalA);o.scale(g,T.normalA,P),a(T.contactPointB,p,n.position),a(T.contactPointA,p,g),a(T.contactPointA,T.contactPointA,t.position),this.contactEquations.push(T),this.enableFrictionReduction||this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(T))}}return this.enableFrictionReduction&&this.enableFriction&&m&&this.frictionEquations.push(this.createFrictionFromAverage(m)),m},s.prototype[m.PARTICLE|m.PLANE]=s.prototype.particlePlane=function(t,e,i,s,n,r,h,c,u){var d=x,p=b;c=c||0,a(d,i,h),o.rotate(p,v,c);var f=l(d,p);if(f>0)return 0;if(u)return!0;var g=this.createContactEquation(n,t,r,e);return o.copy(g.normalA,p),o.scale(d,g.normalA,f),a(g.contactPointA,i,d),a(g.contactPointA,g.contactPointA,n.position),a(g.contactPointB,i,t.position),this.contactEquations.push(g),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(g)),1},s.prototype[m.CIRCLE|m.PARTICLE]=s.prototype.circleParticle=function(t,e,i,s,n,r,l,c,u){var d=x;if(a(d,l,i),o.squaredLength(d)>Math.pow(e.radius,2))return 0;if(u)return!0;var p=this.createContactEquation(t,n,e,r);return o.copy(p.normalA,d),o.normalize(p.normalA,p.normalA),o.scale(p.contactPointA,p.normalA,e.radius),h(p.contactPointA,p.contactPointA,i),a(p.contactPointA,p.contactPointA,t.position),a(p.contactPointB,l,n.position),this.contactEquations.push(p),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(p)),1};var K=new f({radius:1}),J=o.create(),Q=o.create();o.create();s.prototype[m.PLANE|m.CAPSULE]=s.prototype.planeCapsule=function(t,e,i,s,n,r,a,l,c){var u=J,d=Q,p=K;o.set(u,-r.length/2,0),o.rotate(u,u,l),h(u,u,a),o.set(d,r.length/2,0),o.rotate(d,d,l),h(d,d,a),p.radius=r.radius;var f;this.enableFrictionReduction&&(f=this.enableFriction,this.enableFriction=!1);var g=this.circlePlane(n,p,u,0,t,e,i,s,c),m=this.circlePlane(n,p,d,0,t,e,i,s,c);if(this.enableFrictionReduction&&(this.enableFriction=f),c)return g||m;var y=g+m;return this.enableFrictionReduction&&y&&this.frictionEquations.push(this.createFrictionFromAverage(y)),y},s.prototype[m.CIRCLE|m.PLANE]=s.prototype.circlePlane=function(t,e,i,s,n,r,c,u,d){var p=t,f=e,g=i,m=n,y=c,w=u;w=w||0;var T=x,P=b,C=_;a(T,g,y),o.rotate(P,v,w);var S=l(P,T);if(S>f.radius)return 0;if(d)return!0;var A=this.createContactEquation(m,p,r,e);return o.copy(A.normalA,P),o.scale(A.contactPointB,A.normalA,-f.radius),h(A.contactPointB,A.contactPointB,g),a(A.contactPointB,A.contactPointB,p.position),o.scale(C,A.normalA,S),a(A.contactPointA,T,C),h(A.contactPointA,A.contactPointA,y),a(A.contactPointA,A.contactPointA,m.position),this.contactEquations.push(A),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(A)),1},s.prototype[m.CONVEX]=s.prototype[m.CONVEX|m.BOX]=s.prototype[m.BOX]=s.prototype.convexConvex=function(t,e,i,n,r,c,u,d,p,f){var g=x,m=b,y=_,v=w,P=T,E=C,M=S,R=A,L=0,f="number"==typeof f?f:0;if(!s.findSeparatingAxis(e,i,n,c,u,d,g))return 0;a(M,u,i),l(g,M)>0&&o.scale(g,g,-1);var B=s.getClosestEdge(e,n,g,!0),I=s.getClosestEdge(c,d,g);if(-1===B||-1===I)return 0;for(var O=0;O<2;O++){var k=B,F=I,D=e,U=c,G=i,N=u,X=n,W=d,j=t,V=r;if(0===O){var H;H=k,k=F,F=H,H=D,D=U,U=H,H=G,G=N,N=H,H=X,X=W,W=H,H=j,j=V,V=H}for(var q=F;q<F+2;q++){var Y=U.vertices[(q+U.vertices.length)%U.vertices.length];o.rotate(m,Y,W),h(m,m,N);for(var z=0,K=k-1;K<k+2;K++){var J=D.vertices[(K+D.vertices.length)%D.vertices.length],Q=D.vertices[(K+1+D.vertices.length)%D.vertices.length];o.rotate(y,J,X),o.rotate(v,Q,X),h(y,y,G),h(v,v,G),a(P,v,y),o.rotate90cw(R,P),o.normalize(R,R),a(M,m,y);$=l(R,M);(K===k&&$<=f||K!==k&&$<=0)&&z++}if(z>=3){if(p)return!0;var Z=this.createContactEquation(j,V,D,U);L++;var J=D.vertices[k%D.vertices.length],Q=D.vertices[(k+1)%D.vertices.length];o.rotate(y,J,X),o.rotate(v,Q,X),h(y,y,G),h(v,v,G),a(P,v,y),o.rotate90cw(Z.normalA,P),o.normalize(Z.normalA,Z.normalA),a(M,m,y);var $=l(Z.normalA,M);o.scale(E,Z.normalA,$),a(Z.contactPointA,m,G),a(Z.contactPointA,Z.contactPointA,E),h(Z.contactPointA,Z.contactPointA,G),a(Z.contactPointA,Z.contactPointA,j.position),a(Z.contactPointB,m,N),h(Z.contactPointB,Z.contactPointB,N),a(Z.contactPointB,Z.contactPointB,V.position),this.contactEquations.push(Z),this.enableFrictionReduction||this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(Z))}}}return this.enableFrictionReduction&&this.enableFriction&&L&&this.frictionEquations.push(this.createFrictionFromAverage(L)),L};var Z=o.fromValues(0,0);s.projectConvexOntoAxis=function(t,e,i,s,n){var r,a,h=null,c=null,u=Z;o.rotate(u,s,-i);for(var d=0;d<t.vertices.length;d++)r=t.vertices[d],a=l(r,u),(null===h||a>h)&&(h=a),(null===c||a<c)&&(c=a);if(c>h){var p=c;c=h,h=p}var f=l(e,s);o.set(n,c+f,h+f)};var $=o.fromValues(0,0),tt=o.fromValues(0,0),et=o.fromValues(0,0),it=o.fromValues(0,0),st=o.fromValues(0,0),nt=o.fromValues(0,0);s.findSeparatingAxis=function(t,e,i,n,r,h,l){var c=null,u=!1,d=!1,p=$,f=tt,g=et,m=it,v=st,x=nt;if(t instanceof y&&n instanceof y)for(P=0;2!==P;P++){var b=t,_=i;1===P&&(b=n,_=h);for(C=0;2!==C;C++){0===C?o.set(m,0,1):1===C&&o.set(m,1,0),0!==_&&o.rotate(m,m,_),s.projectConvexOntoAxis(t,e,i,m,v),s.projectConvexOntoAxis(n,r,h,m,x);var w=v,T=x;v[0]>x[0]&&(T=v,w=x,!0),u=(S=T[0]-w[1])<=0,(null===c||S>c)&&(o.copy(l,m),c=S,d=u)}}else for(var P=0;2!==P;P++){var b=t,_=i;1===P&&(b=n,_=h);for(var C=0;C!==b.vertices.length;C++){o.rotate(f,b.vertices[C],_),o.rotate(g,b.vertices[(C+1)%b.vertices.length],_),a(p,g,f),o.rotate90cw(m,p),o.normalize(m,m),s.projectConvexOntoAxis(t,e,i,m,v),s.projectConvexOntoAxis(n,r,h,m,x);var w=v,T=x;v[0]>x[0]&&(T=v,w=x,!0);var S=T[0]-w[1];u=S<=0,(null===c||S>c)&&(o.copy(l,m),c=S,d=u)}}return d};var rt=o.fromValues(0,0),ot=o.fromValues(0,0),at=o.fromValues(0,0);s.getClosestEdge=function(t,e,i,s){var n=rt,r=ot,h=at;o.rotate(n,i,-e),s&&o.scale(n,n,-1);for(var c=-1,u=t.vertices.length,d=-1,p=0;p!==u;p++){a(r,t.vertices[(p+1)%u],t.vertices[p%u]),o.rotate90cw(h,r),o.normalize(h,h);var f=l(h,n);(-1===c||f>d)&&(c=p%u,d=f)}return c};var ht=o.create(),lt=o.create(),ct=o.create(),ut=o.create(),dt=o.create(),pt=o.create(),ft=o.create();s.prototype[m.CIRCLE|m.HEIGHTFIELD]=s.prototype.circleHeightfield=function(t,e,i,s,n,r,l,c,u,d){var p=r.heights,d=d||e.radius,f=r.elementWidth,g=lt,m=ht,y=dt,v=ft,x=pt,b=ct,_=ut,w=Math.floor((i[0]-d-l[0])/f),T=Math.ceil((i[0]+d-l[0])/f);w<0&&(w=0),T>=p.length&&(T=p.length-1);for(var P=p[w],C=p[T],S=w;S<T;S++)p[S]<C&&(C=p[S]),p[S]>P&&(P=p[S]);if(i[1]-d>P)return!u&&0;for(var A=!1,S=w;S<T;S++){o.set(b,S*f,p[S]),o.set(_,(S+1)*f,p[S+1]),o.add(b,b,l),o.add(_,_,l),o.sub(x,_,b),o.rotate(x,x,Math.PI/2),o.normalize(x,x),o.scale(m,x,-d),o.add(m,m,i),o.sub(g,m,b);var E=o.dot(g,x);if(m[0]>=b[0]&&m[0]<_[0]&&E<=0){if(u)return!0;A=!0,o.scale(g,x,-E),o.add(y,m,g),o.copy(v,x);M=this.createContactEquation(n,t,r,e);o.copy(M.normalA,v),o.scale(M.contactPointB,M.normalA,-d),h(M.contactPointB,M.contactPointB,i),a(M.contactPointB,M.contactPointB,t.position),o.copy(M.contactPointA,y),o.sub(M.contactPointA,M.contactPointA,n.position),this.contactEquations.push(M),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(M))}}if(A=!1,d>0)for(S=w;S<=T;S++)if(o.set(b,S*f,p[S]),o.add(b,b,l),o.sub(g,i,b),o.squaredLength(g)<Math.pow(d,2)){if(u)return!0;A=!0;var M=this.createContactEquation(n,t,r,e);o.copy(M.normalA,g),o.normalize(M.normalA,M.normalA),o.scale(M.contactPointB,M.normalA,-d),h(M.contactPointB,M.contactPointB,i),a(M.contactPointB,M.contactPointB,t.position),a(M.contactPointA,b,l),h(M.contactPointA,M.contactPointA,l),a(M.contactPointA,M.contactPointA,n.position),this.contactEquations.push(M),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(M))}return A?1:0};var gt=o.create(),mt=o.create(),yt=o.create(),vt=new g({vertices:[o.create(),o.create(),o.create(),o.create()]});s.prototype[m.BOX|m.HEIGHTFIELD]=s.prototype[m.CONVEX|m.HEIGHTFIELD]=s.prototype.convexHeightfield=function(t,e,i,s,n,r,a,h,l){var c=r.heights,u=r.elementWidth,d=gt,p=mt,f=yt,g=vt,m=Math.floor((t.aabb.lowerBound[0]-a[0])/u),y=Math.ceil((t.aabb.upperBound[0]-a[0])/u);m<0&&(m=0),y>=c.length&&(y=c.length-1);for(var v=c[m],x=c[y],b=m;b<y;b++)c[b]<x&&(x=c[b]),c[b]>v&&(v=c[b]);if(t.aabb.lowerBound[1]>v)return!l&&0;for(var _=0,b=m;b<y;b++){o.set(d,b*u,c[b]),o.set(p,(b+1)*u,c[b+1]),o.add(d,d,a),o.add(p,p,a);o.set(f,.5*(p[0]+d[0]),.5*(p[1]+d[1]-100)),o.sub(g.vertices[0],p,f),o.sub(g.vertices[1],d,f),o.copy(g.vertices[2],g.vertices[1]),o.copy(g.vertices[3],g.vertices[0]),g.vertices[2][1]-=100,g.vertices[3][1]-=100,_+=this.convexConvex(t,e,i,s,n,g,f,0,l)}return _}},{"../equations/ContactEquation":21,"../equations/Equation":22,"../equations/FrictionEquation":23,"../math/vec2":30,"../objects/Body":31,"../shapes/Box":37,"../shapes/Circle":39,"../shapes/Convex":40,"../shapes/Shape":45,"../utils/ContactEquationPool":48,"../utils/FrictionEquationPool":49,"../utils/TupleDictionary":56,"../utils/Utils":57}],11:[function(t,e,i){function s(t){t=t||{},this.from=t.from?r.fromValues(t.from[0],t.from[1]):r.create(),this.to=t.to?r.fromValues(t.to[0],t.to[1]):r.create(),this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,this.skipBackfaces=!!t.skipBackfaces,this.collisionMask=void 0!==t.collisionMask?t.collisionMask:-1,this.collisionGroup=void 0!==t.collisionGroup?t.collisionGroup:-1,this.mode=void 0!==t.mode?t.mode:s.ANY,this.callback=t.callback||function(t){},this.direction=r.create(),this.length=1,this.update()}function n(t,e,i){r.sub(a,i,t);var s=r.dot(a,e);return r.scale(h,e,s),r.add(h,h,t),r.squaredDistance(i,h)}e.exports=s;var r=t("../math/vec2");t("../collision/RaycastResult"),t("../shapes/Shape"),t("../collision/AABB");s.prototype.constructor=s,s.CLOSEST=1,s.ANY=2,s.ALL=4,s.prototype.update=function(){var t=this.direction;r.sub(t,this.to,this.from),this.length=r.length(t),r.normalize(t,t)},s.prototype.intersectBodies=function(t,e){for(var i=0,s=e.length;!t.shouldStop(this)&&i<s;i++){var n=e[i],r=n.getAABB();(r.overlapsRay(this)>=0||r.containsPoint(this.from))&&this.intersectBody(t,n)}};var o=r.create();s.prototype.intersectBody=function(t,e){var i=this.checkCollisionResponse;if(!i||e.collisionResponse)for(var s=o,n=0,a=e.shapes.length;n<a;n++){var h=e.shapes[n];if((!i||h.collisionResponse)&&(0!=(this.collisionGroup&h.collisionMask)&&0!=(h.collisionGroup&this.collisionMask))){r.rotate(s,h.position,e.angle),r.add(s,s,e.position);var l=h.angle+e.angle;if(this.intersectShape(t,h,l,s,e),t.shouldStop(this))break}}},s.prototype.intersectShape=function(t,e,i,s,r){n(this.from,this.direction,s)>e.boundingRadius*e.boundingRadius||(this._currentBody=r,this._currentShape=e,e.raycast(t,this,s,i),this._currentBody=this._currentShape=null)},s.prototype.getAABB=function(t){var e=this.to,i=this.from;r.set(t.lowerBound,Math.min(e[0],i[0]),Math.min(e[1],i[1])),r.set(t.upperBound,Math.max(e[0],i[0]),Math.max(e[1],i[1]))};r.create();s.prototype.reportIntersection=function(t,e,i,n){this.from,this.to;var o=this._currentShape,a=this._currentBody;if(!(this.skipBackfaces&&r.dot(i,this.direction)>0))switch(this.mode){case s.ALL:t.set(i,o,a,e,n),this.callback(t);break;case s.CLOSEST:(e<t.fraction||!t.hasHit())&&t.set(i,o,a,e,n);break;case s.ANY:t.set(i,o,a,e,n)}};var a=r.create(),h=r.create()},{"../collision/AABB":7,"../collision/RaycastResult":12,"../math/vec2":30,"../shapes/Shape":45}],12:[function(t,e,i){function s(){this.normal=n.create(),this.shape=null,this.body=null,this.faceIndex=-1,this.fraction=-1,this.isStopped=!1}var n=t("../math/vec2"),r=t("../collision/Ray");e.exports=s,s.prototype.reset=function(){n.set(this.normal,0,0),this.shape=null,this.body=null,this.faceIndex=-1,this.fraction=-1,this.isStopped=!1},s.prototype.getHitDistance=function(t){return n.distance(t.from,t.to)*this.fraction},s.prototype.hasHit=function(){return-1!==this.fraction},s.prototype.getHitPoint=function(t,e){n.lerp(t,e.from,e.to,this.fraction)},s.prototype.stop=function(){this.isStopped=!0},s.prototype.shouldStop=function(t){return this.isStopped||-1!==this.fraction&&t.mode===r.ANY},s.prototype.set=function(t,e,i,s,r){n.copy(this.normal,t),this.shape=e,this.body=i,this.fraction=s,this.faceIndex=r}},{"../collision/Ray":11,"../math/vec2":30}],13:[function(t,e,i){function s(){r.call(this,r.SAP),this.axisList=[],this.axisIndex=0;var t=this;this._addBodyHandler=function(e){t.axisList.push(e.body)},this._removeBodyHandler=function(e){var i=t.axisList.indexOf(e.body);-1!==i&&t.axisList.splice(i,1)}}var n=t("../utils/Utils"),r=t("../collision/Broadphase");e.exports=s,(s.prototype=new r).constructor=s,s.prototype.setWorld=function(t){this.axisList.length=0,n.appendArray(this.axisList,t.bodies),t.off("addBody",this._addBodyHandler).off("removeBody",this._removeBodyHandler),t.on("addBody",this._addBodyHandler).on("removeBody",this._removeBodyHandler),this.world=t},s.sortAxisList=function(t,e){e|=0;for(var i=1,s=t.length;i<s;i++){for(var n=t[i],r=i-1;r>=0&&!(t[r].aabb.lowerBound[e]<=n.aabb.lowerBound[e]);r--)t[r+1]=t[r];t[r+1]=n}return t},s.prototype.sortList=function(){var t=this.axisList,e=this.axisIndex;s.sortAxisList(t,e)},s.prototype.getCollisionPairs=function(t){var e=this.axisList,i=this.result,s=this.axisIndex;i.length=0;for(var n=e.length;n--;){var o=e[n];o.aabbNeedsUpdate&&o.updateAABB()}this.sortList();for(var a=0,h=0|e.length;a!==h;a++)for(var l=e[a],c=a+1;c<h;c++){var u=e[c];if(!(u.aabb.lowerBound[s]<=l.aabb.upperBound[s]))break;r.canCollide(l,u)&&this.boundingVolumeCheck(l,u)&&i.push(l,u)}return i},s.prototype.aabbQuery=function(t,e,i){i=i||[],this.sortList();var s=this.axisIndex,n="x";1===s&&(n="y"),2===s&&(n="z");for(var r=this.axisList,o=(e.lowerBound[n],e.upperBound[n],0);o<r.length;o++){var a=r[o];a.aabbNeedsUpdate&&a.updateAABB(),a.aabb.overlaps(e)&&i.push(a)}return i}},{"../collision/Broadphase":8,"../utils/Utils":57}],14:[function(t,e,i){function s(t,e,i,s){this.type=i,s=n.defaults(s,{collideConnected:!0,wakeUpBodies:!0}),this.equations=[],this.bodyA=t,this.bodyB=e,this.collideConnected=s.collideConnected,s.wakeUpBodies&&(t&&t.wakeUp(),e&&e.wakeUp())}e.exports=s;var n=t("../utils/Utils");s.prototype.update=function(){throw new Error("method update() not implmemented in this Constraint subclass!")},s.DISTANCE=1,s.GEAR=2,s.LOCK=3,s.PRISMATIC=4,s.REVOLUTE=5,s.prototype.setStiffness=function(t){for(var e=this.equations,i=0;i!==e.length;i++){var s=e[i];s.stiffness=t,s.needsUpdate=!0}},s.prototype.setRelaxation=function(t){for(var e=this.equations,i=0;i!==e.length;i++){var s=e[i];s.relaxation=t,s.needsUpdate=!0}}},{"../utils/Utils":57}],15:[function(t,e,i){function s(t,e,i){i=a.defaults(i,{localAnchorA:[0,0],localAnchorB:[0,0]}),n.call(this,t,e,n.DISTANCE,i),this.localAnchorA=o.fromValues(i.localAnchorA[0],i.localAnchorA[1]),this.localAnchorB=o.fromValues(i.localAnchorB[0],i.localAnchorB[1]);var s=this.localAnchorA,h=this.localAnchorB;if(this.distance=0,"number"==typeof i.distance)this.distance=i.distance;else{var l=o.create(),c=o.create(),u=o.create();o.rotate(l,s,t.angle),o.rotate(c,h,e.angle),o.add(u,e.position,c),o.sub(u,u,l),o.sub(u,u,t.position),this.distance=o.length(u)}var d;d=void 0===i.maxForce?Number.MAX_VALUE:i.maxForce;var p=new r(t,e,-d,d);this.equations=[p],this.maxForce=d;var u=o.create(),f=o.create(),g=o.create(),m=this;p.computeGq=function(){var t=this.bodyA,e=this.bodyB,i=t.position,n=e.position;return o.rotate(f,s,t.angle),o.rotate(g,h,e.angle),o.add(u,n,g),o.sub(u,u,f),o.sub(u,u,i),o.length(u)-m.distance},this.setMaxForce(d),this.upperLimitEnabled=!1,this.upperLimit=1,this.lowerLimitEnabled=!1,this.lowerLimit=0,this.position=0}var n=t("./Constraint"),r=t("../equations/Equation"),o=t("../math/vec2"),a=t("../utils/Utils");e.exports=s,(s.prototype=new n).constructor=s;var h=o.create(),l=o.create(),c=o.create();s.prototype.update=function(){var t=this.equations[0],e=this.bodyA,i=this.bodyB,s=(this.distance,e.position),n=i.position,r=this.equations[0],a=t.G;o.rotate(l,this.localAnchorA,e.angle),o.rotate(c,this.localAnchorB,i.angle),o.add(h,n,c),o.sub(h,h,l),o.sub(h,h,s),this.position=o.length(h);var u=!1;if(this.upperLimitEnabled&&this.position>this.upperLimit&&(r.maxForce=0,r.minForce=-this.maxForce,this.distance=this.upperLimit,u=!0),this.lowerLimitEnabled&&this.position<this.lowerLimit&&(r.maxForce=this.maxForce,r.minForce=0,this.distance=this.lowerLimit,u=!0),!this.lowerLimitEnabled&&!this.upperLimitEnabled||u){r.enabled=!0,o.normalize(h,h);var d=o.crossLength(l,h),p=o.crossLength(c,h);a[0]=-h[0],a[1]=-h[1],a[2]=-d,a[3]=h[0],a[4]=h[1],a[5]=p}else r.enabled=!1},s.prototype.setMaxForce=function(t){var e=this.equations[0];e.minForce=-t,e.maxForce=t},s.prototype.getMaxForce=function(){return this.equations[0].maxForce}},{"../equations/Equation":22,"../math/vec2":30,"../utils/Utils":57,"./Constraint":14}],16:[function(t,e,i){function s(t,e,i){i=i||{},n.call(this,t,e,n.GEAR,i),this.ratio=void 0!==i.ratio?i.ratio:1,this.angle=void 0!==i.angle?i.angle:e.angle-this.ratio*t.angle,i.angle=this.angle,i.ratio=this.ratio,this.equations=[new r(t,e,i)],void 0!==i.maxTorque&&this.setMaxTorque(i.maxTorque)}var n=t("./Constraint"),r=(t("../equations/Equation"),t("../equations/AngleLockEquation"));t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.update=function(){var t=this.equations[0];t.ratio!==this.ratio&&t.setRatio(this.ratio),t.angle=this.angle},s.prototype.setMaxTorque=function(t){this.equations[0].setMaxTorque(t)},s.prototype.getMaxTorque=function(t){return this.equations[0].maxForce}},{"../equations/AngleLockEquation":20,"../equations/Equation":22,"../math/vec2":30,"./Constraint":14}],17:[function(t,e,i){function s(t,e,i){i=i||{},n.call(this,t,e,n.LOCK,i);var s=void 0===i.maxForce?Number.MAX_VALUE:i.maxForce,a=(i.localAngleB,new o(t,e,-s,s)),h=new o(t,e,-s,s),l=new o(t,e,-s,s),c=r.create(),u=r.create(),d=this;a.computeGq=function(){return r.rotate(c,d.localOffsetB,t.angle),r.sub(u,e.position,t.position),r.sub(u,u,c),u[0]},h.computeGq=function(){return r.rotate(c,d.localOffsetB,t.angle),r.sub(u,e.position,t.position),r.sub(u,u,c),u[1]};var p=r.create(),f=r.create();l.computeGq=function(){return r.rotate(p,d.localOffsetB,e.angle-d.localAngleB),r.scale(p,p,-1),r.sub(u,t.position,e.position),r.add(u,u,p),r.rotate(f,p,-Math.PI/2),r.normalize(f,f),r.dot(u,f)},this.localOffsetB=r.create(),i.localOffsetB?r.copy(this.localOffsetB,i.localOffsetB):(r.sub(this.localOffsetB,e.position,t.position),r.rotate(this.localOffsetB,this.localOffsetB,-t.angle)),this.localAngleB=0,"number"==typeof i.localAngleB?this.localAngleB=i.localAngleB:this.localAngleB=e.angle-t.angle,this.equations.push(a,h,l),this.setMaxForce(s)}var n=t("./Constraint"),r=t("../math/vec2"),o=t("../equations/Equation");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.setMaxForce=function(t){for(var e=this.equations,i=0;i<this.equations.length;i++)e[i].maxForce=t,e[i].minForce=-t},s.prototype.getMaxForce=function(){return this.equations[0].maxForce};var a=r.create(),h=r.create(),l=r.create(),c=r.fromValues(1,0),u=r.fromValues(0,1);s.prototype.update=function(){var t=this.equations[0],e=this.equations[1],i=this.equations[2],s=this.bodyA,n=this.bodyB;r.rotate(a,this.localOffsetB,s.angle),r.rotate(h,this.localOffsetB,n.angle-this.localAngleB),r.scale(h,h,-1),r.rotate(l,h,Math.PI/2),r.normalize(l,l),t.G[0]=-1,t.G[1]=0,t.G[2]=-r.crossLength(a,c),t.G[3]=1,e.G[0]=0,e.G[1]=-1,e.G[2]=-r.crossLength(a,u),e.G[4]=1,i.G[0]=-l[0],i.G[1]=-l[1],i.G[3]=l[0],i.G[4]=l[1],i.G[5]=r.crossLength(h,l)}},{"../equations/Equation":22,"../math/vec2":30,"./Constraint":14}],18:[function(t,e,i){function s(t,e,i){i=i||{},n.call(this,t,e,n.PRISMATIC,i);var s=a.fromValues(0,0),l=a.fromValues(1,0),c=a.fromValues(0,0);i.localAnchorA&&a.copy(s,i.localAnchorA),i.localAxisA&&a.copy(l,i.localAxisA),i.localAnchorB&&a.copy(c,i.localAnchorB),this.localAnchorA=s,this.localAnchorB=c,this.localAxisA=l;var u=this.maxForce=void 0!==i.maxForce?i.maxForce:Number.MAX_VALUE,d=new o(t,e,-u,u),p=new a.create,f=new a.create,g=new a.create,m=new a.create;if(d.computeGq=function(){return a.dot(g,m)},d.updateJacobian=function(){var i=this.G,n=t.position,r=e.position;a.rotate(p,s,t.angle),a.rotate(f,c,e.angle),a.add(g,r,f),a.sub(g,g,n),a.sub(g,g,p),a.rotate(m,l,t.angle+Math.PI/2),i[0]=-m[0],i[1]=-m[1],i[2]=-a.crossLength(p,m)+a.crossLength(m,g),i[3]=m[0],i[4]=m[1],i[5]=a.crossLength(f,m)},this.equations.push(d),!i.disableRotationalLock){var y=new h(t,e,-u,u);this.equations.push(y)}this.position=0,this.velocity=0,this.lowerLimitEnabled=void 0!==i.lowerLimit,this.upperLimitEnabled=void 0!==i.upperLimit,this.lowerLimit=void 0!==i.lowerLimit?i.lowerLimit:0,this.upperLimit=void 0!==i.upperLimit?i.upperLimit:1,this.upperLimitEquation=new r(t,e),this.lowerLimitEquation=new r(t,e),this.upperLimitEquation.minForce=this.lowerLimitEquation.minForce=0,this.upperLimitEquation.maxForce=this.lowerLimitEquation.maxForce=u,this.motorEquation=new o(t,e),this.motorEnabled=!1,this.motorSpeed=0;var v=this,x=this.motorEquation;x.computeGW;x.computeGq=function(){return 0},x.computeGW=function(){var t=this.G,e=this.bodyA,i=this.bodyB,s=e.velocity,n=i.velocity,r=e.angularVelocity,o=i.angularVelocity;return this.gmult(t,s,r,n,o)+v.motorSpeed}}var n=t("./Constraint"),r=t("../equations/ContactEquation"),o=t("../equations/Equation"),a=t("../math/vec2"),h=t("../equations/RotationalLockEquation");e.exports=s,(s.prototype=new n).constructor=s;var l=a.create(),c=a.create(),u=a.create(),d=a.create(),p=a.create(),f=a.create();s.prototype.update=function(){var t=this.equations,e=t[0],i=this.upperLimit,s=this.lowerLimit,n=this.upperLimitEquation,r=this.lowerLimitEquation,o=this.bodyA,h=this.bodyB,g=this.localAxisA,m=this.localAnchorA,y=this.localAnchorB;e.updateJacobian(),a.rotate(l,g,o.angle),a.rotate(d,m,o.angle),a.add(c,d,o.position),a.rotate(p,y,h.angle),a.add(u,p,h.position);var v=this.position=a.dot(u,l)-a.dot(c,l);if(this.motorEnabled){var x=this.motorEquation.G;x[0]=l[0],x[1]=l[1],x[2]=a.crossLength(l,p),x[3]=-l[0],x[4]=-l[1],x[5]=-a.crossLength(l,d)}if(this.upperLimitEnabled&&v>i?(a.scale(n.normalA,l,-1),a.sub(n.contactPointA,c,o.position),a.sub(n.contactPointB,u,h.position),a.scale(f,l,i),a.add(n.contactPointA,n.contactPointA,f),-1===t.indexOf(n)&&t.push(n)):-1!==(b=t.indexOf(n))&&t.splice(b,1),this.lowerLimitEnabled&&v<s)a.scale(r.normalA,l,1),a.sub(r.contactPointA,c,o.position),a.sub(r.contactPointB,u,h.position),a.scale(f,l,s),a.sub(r.contactPointB,r.contactPointB,f),-1===t.indexOf(r)&&t.push(r);else{var b=t.indexOf(r);-1!==b&&t.splice(b,1)}},s.prototype.enableMotor=function(){this.motorEnabled||(this.equations.push(this.motorEquation),this.motorEnabled=!0)},s.prototype.disableMotor=function(){if(this.motorEnabled){var t=this.equations.indexOf(this.motorEquation);this.equations.splice(t,1),this.motorEnabled=!1}},s.prototype.setLimits=function(t,e){"number"==typeof t?(this.lowerLimit=t,this.lowerLimitEnabled=!0):(this.lowerLimit=t,this.lowerLimitEnabled=!1),"number"==typeof e?(this.upperLimit=e,this.upperLimitEnabled=!0):(this.upperLimit=e,this.upperLimitEnabled=!1)}},{"../equations/ContactEquation":21,"../equations/Equation":22,"../equations/RotationalLockEquation":24,"../math/vec2":30,"./Constraint":14}],19:[function(t,e,i){function s(t,e,i){i=i||{},n.call(this,t,e,n.REVOLUTE,i);var s=this.maxForce=void 0!==i.maxForce?i.maxForce:Number.MAX_VALUE;this.pivotA=h.create(),this.pivotB=h.create(),i.worldPivot?(h.sub(this.pivotA,i.worldPivot,t.position),h.sub(this.pivotB,i.worldPivot,e.position),h.rotate(this.pivotA,this.pivotA,-t.angle),h.rotate(this.pivotB,this.pivotB,-e.angle)):(h.copy(this.pivotA,i.localPivotA),h.copy(this.pivotB,i.localPivotB));var f=this.equations=[new r(t,e,-s,s),new r(t,e,-s,s)],g=f[0],m=f[1],y=this;g.computeGq=function(){return h.rotate(l,y.pivotA,t.angle),h.rotate(c,y.pivotB,e.angle),h.add(p,e.position,c),h.sub(p,p,t.position),h.sub(p,p,l),h.dot(p,u)},m.computeGq=function(){return h.rotate(l,y.pivotA,t.angle),h.rotate(c,y.pivotB,e.angle),h.add(p,e.position,c),h.sub(p,p,t.position),h.sub(p,p,l),h.dot(p,d)},m.minForce=g.minForce=-s,m.maxForce=g.maxForce=s,this.motorEquation=new o(t,e),this.motorEnabled=!1,this.angle=0,this.lowerLimitEnabled=!1,this.upperLimitEnabled=!1,this.lowerLimit=0,this.upperLimit=0,this.upperLimitEquation=new a(t,e),this.lowerLimitEquation=new a(t,e),this.upperLimitEquation.minForce=0,this.lowerLimitEquation.maxForce=0}var n=t("./Constraint"),r=t("../equations/Equation"),o=t("../equations/RotationalVelocityEquation"),a=t("../equations/RotationalLockEquation"),h=t("../math/vec2");e.exports=s;var l=h.create(),c=h.create(),u=h.fromValues(1,0),d=h.fromValues(0,1),p=h.create();(s.prototype=new n).constructor=s,s.prototype.setLimits=function(t,e){"number"==typeof t?(this.lowerLimit=t,this.lowerLimitEnabled=!0):(this.lowerLimit=t,this.lowerLimitEnabled=!1),"number"==typeof e?(this.upperLimit=e,this.upperLimitEnabled=!0):(this.upperLimit=e,this.upperLimitEnabled=!1)},s.prototype.update=function(){var t=this.bodyA,e=this.bodyB,i=this.pivotA,s=this.pivotB,n=this.equations,r=(n[0],n[1],n[0]),o=n[1],a=this.upperLimit,p=this.lowerLimit,f=this.upperLimitEquation,g=this.lowerLimitEquation,m=this.angle=e.angle-t.angle;if(this.upperLimitEnabled&&m>a?(f.angle=a,-1===n.indexOf(f)&&n.push(f)):-1!==(y=n.indexOf(f))&&n.splice(y,1),this.lowerLimitEnabled&&m<p)g.angle=p,-1===n.indexOf(g)&&n.push(g);else{var y=n.indexOf(g);-1!==y&&n.splice(y,1)}h.rotate(l,i,t.angle),h.rotate(c,s,e.angle),r.G[0]=-1,r.G[1]=0,r.G[2]=-h.crossLength(l,u),r.G[3]=1,r.G[4]=0,r.G[5]=h.crossLength(c,u),o.G[0]=0,o.G[1]=-1,o.G[2]=-h.crossLength(l,d),o.G[3]=0,o.G[4]=1,o.G[5]=h.crossLength(c,d)},s.prototype.enableMotor=function(){this.motorEnabled||(this.equations.push(this.motorEquation),this.motorEnabled=!0)},s.prototype.disableMotor=function(){if(this.motorEnabled){var t=this.equations.indexOf(this.motorEquation);this.equations.splice(t,1),this.motorEnabled=!1}},s.prototype.setMotorSpeed=function(t){if(this.motorEnabled){var e=this.equations.indexOf(this.motorEquation);this.equations[e].relativeVelocity=t}},s.prototype.getMotorSpeed=function(){return!!this.motorEnabled&&this.motorEquation.relativeVelocity}},{"../equations/Equation":22,"../equations/RotationalLockEquation":24,"../equations/RotationalVelocityEquation":25,"../math/vec2":30,"./Constraint":14}],20:[function(t,e,i){function s(t,e,i){i=i||{},n.call(this,t,e,-Number.MAX_VALUE,Number.MAX_VALUE),this.angle=i.angle||0,this.ratio="number"==typeof i.ratio?i.ratio:1,this.setRatio(this.ratio)}var n=t("./Equation");t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.computeGq=function(){return this.ratio*this.bodyA.angle-this.bodyB.angle+this.angle},s.prototype.setRatio=function(t){var e=this.G;e[2]=t,e[5]=-1,this.ratio=t},s.prototype.setMaxTorque=function(t){this.maxForce=t,this.minForce=-t}},{"../math/vec2":30,"./Equation":22}],21:[function(t,e,i){function s(t,e){n.call(this,t,e,0,Number.MAX_VALUE),this.contactPointA=r.create(),this.penetrationVec=r.create(),this.contactPointB=r.create(),this.normalA=r.create(),this.restitution=0,this.firstImpact=!1,this.shapeA=null,this.shapeB=null}var n=t("./Equation"),r=t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.computeB=function(t,e,i){var s=this.bodyA,n=this.bodyB,o=this.contactPointA,a=this.contactPointB,h=s.position,l=n.position,c=this.penetrationVec,u=this.normalA,d=this.G,p=r.crossLength(o,u),f=r.crossLength(a,u);d[0]=-u[0],d[1]=-u[1],d[2]=-p,d[3]=u[0],d[4]=u[1],d[5]=f,r.add(c,l,a),r.sub(c,c,h),r.sub(c,c,o);var g,m;return this.firstImpact&&0!==this.restitution?(m=0,g=1/e*(1+this.restitution)*this.computeGW()):(m=r.dot(u,c)+this.offset,g=this.computeGW()),-m*t-g*e-i*this.computeGiMf()};var o=r.create(),a=r.create(),h=r.create();s.prototype.getVelocityAlongNormal=function(){return this.bodyA.getVelocityAtPoint(o,this.contactPointA),this.bodyB.getVelocityAtPoint(a,this.contactPointB),r.subtract(h,o,a),r.dot(this.normalA,h)}},{"../math/vec2":30,"./Equation":22}],22:[function(t,e,i){function s(t,e,i,n){this.minForce=void 0===i?-Number.MAX_VALUE:i,this.maxForce=void 0===n?Number.MAX_VALUE:n,this.bodyA=t,this.bodyB=e,this.stiffness=s.DEFAULT_STIFFNESS,this.relaxation=s.DEFAULT_RELAXATION,this.G=new r.ARRAY_TYPE(6);for(var o=0;o<6;o++)this.G[o]=0;this.offset=0,this.a=0,this.b=0,this.epsilon=0,this.timeStep=1/60,this.needsUpdate=!0,this.multiplier=0,this.relativeVelocity=0,this.enabled=!0}e.exports=s;var n=t("../math/vec2"),r=t("../utils/Utils");t("../objects/Body");s.prototype.constructor=s,s.DEFAULT_STIFFNESS=1e6,s.DEFAULT_RELAXATION=4,s.prototype.update=function(){var t=this.stiffness,e=this.relaxation,i=this.timeStep;this.a=4/(i*(1+4*e)),this.b=4*e/(1+4*e),this.epsilon=4/(i*i*t*(1+4*e)),this.needsUpdate=!1},s.prototype.gmult=function(t,e,i,s,n){return t[0]*e[0]+t[1]*e[1]+t[2]*i+t[3]*s[0]+t[4]*s[1]+t[5]*n},s.prototype.computeB=function(t,e,i){var s=this.computeGW();return-this.computeGq()*t-s*e-this.computeGiMf()*i};var o=n.create(),a=n.create();s.prototype.computeGq=function(){var t=this.G,e=this.bodyA,i=this.bodyB,s=(e.position,i.position,e.angle),n=i.angle;return this.gmult(t,o,s,a,n)+this.offset},s.prototype.computeGW=function(){var t=this.G,e=this.bodyA,i=this.bodyB,s=e.velocity,n=i.velocity,r=e.angularVelocity,o=i.angularVelocity;return this.gmult(t,s,r,n,o)+this.relativeVelocity},s.prototype.computeGWlambda=function(){var t=this.G,e=this.bodyA,i=this.bodyB,s=e.vlambda,n=i.vlambda,r=e.wlambda,o=i.wlambda;return this.gmult(t,s,r,n,o)};var h=n.create(),l=n.create();s.prototype.computeGiMf=function(){var t=this.bodyA,e=this.bodyB,i=t.force,s=t.angularForce,r=e.force,o=e.angularForce,a=t.invMassSolve,c=e.invMassSolve,u=t.invInertiaSolve,d=e.invInertiaSolve,p=this.G;return n.scale(h,i,a),n.multiply(h,t.massMultiplier,h),n.scale(l,r,c),n.multiply(l,e.massMultiplier,l),this.gmult(p,h,s*u,l,o*d)},s.prototype.computeGiMGt=function(){var t=this.bodyA,e=this.bodyB,i=t.invMassSolve,s=e.invMassSolve,n=t.invInertiaSolve,r=e.invInertiaSolve,o=this.G;return o[0]*o[0]*i*t.massMultiplier[0]+o[1]*o[1]*i*t.massMultiplier[1]+o[2]*o[2]*n+o[3]*o[3]*s*e.massMultiplier[0]+o[4]*o[4]*s*e.massMultiplier[1]+o[5]*o[5]*r};var c=n.create(),u=n.create(),d=n.create();n.create(),n.create(),n.create();s.prototype.addToWlambda=function(t){var e=this.bodyA,i=this.bodyB,s=c,r=u,o=d,a=e.invMassSolve,h=i.invMassSolve,l=e.invInertiaSolve,p=i.invInertiaSolve,f=this.G;r[0]=f[0],r[1]=f[1],o[0]=f[3],o[1]=f[4],n.scale(s,r,a*t),n.multiply(s,s,e.massMultiplier),n.add(e.vlambda,e.vlambda,s),e.wlambda+=l*f[2]*t,n.scale(s,o,h*t),n.multiply(s,s,i.massMultiplier),n.add(i.vlambda,i.vlambda,s),i.wlambda+=p*f[5]*t},s.prototype.computeInvC=function(t){return 1/(this.computeGiMGt()+t)}},{"../math/vec2":30,"../objects/Body":31,"../utils/Utils":57}],23:[function(t,e,i){function s(t,e,i){r.call(this,t,e,-i,i),this.contactPointA=n.create(),this.contactPointB=n.create(),this.t=n.create(),this.contactEquations=[],this.shapeA=null,this.shapeB=null,this.frictionCoefficient=.3}var n=t("../math/vec2"),r=t("./Equation");t("../utils/Utils");e.exports=s,(s.prototype=new r).constructor=s,s.prototype.setSlipForce=function(t){this.maxForce=t,this.minForce=-t},s.prototype.getSlipForce=function(){return this.maxForce},s.prototype.computeB=function(t,e,i){this.bodyA,this.bodyB;var s=this.contactPointA,r=this.contactPointB,o=this.t,a=this.G;return a[0]=-o[0],a[1]=-o[1],a[2]=-n.crossLength(s,o),a[3]=o[0],a[4]=o[1],a[5]=n.crossLength(r,o),-this.computeGW()*e-i*this.computeGiMf()}},{"../math/vec2":30,"../utils/Utils":57,"./Equation":22}],24:[function(t,e,i){function s(t,e,i){i=i||{},n.call(this,t,e,-Number.MAX_VALUE,Number.MAX_VALUE),this.angle=i.angle||0;var s=this.G;s[2]=1,s[5]=-1}var n=t("./Equation"),r=t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s;var o=r.create(),a=r.create(),h=r.fromValues(1,0),l=r.fromValues(0,1);s.prototype.computeGq=function(){return r.rotate(o,h,this.bodyA.angle+this.angle),r.rotate(a,l,this.bodyB.angle),r.dot(o,a)}},{"../math/vec2":30,"./Equation":22}],25:[function(t,e,i){function s(t,e){n.call(this,t,e,-Number.MAX_VALUE,Number.MAX_VALUE),this.relativeVelocity=1,this.ratio=1}var n=t("./Equation");t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.computeB=function(t,e,i){var s=this.G;s[2]=-1,s[5]=this.ratio;var n=this.computeGiMf();return-this.computeGW()*e-i*n}},{"../math/vec2":30,"./Equation":22}],26:[function(t,e,i){var s=function(){};e.exports=s,s.prototype={constructor:s,on:function(t,e,i){e.context=i||this,void 0===this._listeners&&(this._listeners={});var s=this._listeners;return void 0===s[t]&&(s[t]=[]),-1===s[t].indexOf(e)&&s[t].push(e),this},has:function(t,e){if(void 0===this._listeners)return!1;var i=this._listeners;if(e){if(void 0!==i[t]&&-1!==i[t].indexOf(e))return!0}else if(void 0!==i[t])return!0;return!1},off:function(t,e){if(void 0===this._listeners)return this;var i=this._listeners,s=i[t].indexOf(e);return-1!==s&&i[t].splice(s,1),this},emit:function(t){if(void 0===this._listeners)return this;var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var i=0,s=e.length;i<s;i++){var n=e[i];n.call(n.context,t)}}return this}}},{}],27:[function(t,e,i){function s(t,e,i){if(i=i||{},!(t instanceof n&&e instanceof n))throw new Error("First two arguments must be Material instances.");this.id=s.idCounter++,this.materialA=t,this.materialB=e,this.friction=void 0!==i.friction?Number(i.friction):.3,this.restitution=void 0!==i.restitution?Number(i.restitution):0,this.stiffness=void 0!==i.stiffness?Number(i.stiffness):r.DEFAULT_STIFFNESS,this.relaxation=void 0!==i.relaxation?Number(i.relaxation):r.DEFAULT_RELAXATION,this.frictionStiffness=void 0!==i.frictionStiffness?Number(i.frictionStiffness):r.DEFAULT_STIFFNESS,this.frictionRelaxation=void 0!==i.frictionRelaxation?Number(i.frictionRelaxation):r.DEFAULT_RELAXATION,this.surfaceVelocity=void 0!==i.surfaceVelocity?Number(i.surfaceVelocity):0,this.contactSkinSize=.005}var n=t("./Material"),r=t("../equations/Equation");e.exports=s,s.idCounter=0},{"../equations/Equation":22,"./Material":28}],28:[function(t,e,i){function s(t){this.id=t||s.idCounter++}e.exports=s,s.idCounter=0},{}],29:[function(t,e,i){var s={};s.GetArea=function(t){if(t.length<6)return 0;for(var e=t.length-2,i=0,s=0;s<e;s+=2)i+=(t[s+2]-t[s])*(t[s+1]+t[s+3]);return.5*-(i+=(t[0]-t[e])*(t[e+1]+t[1]))},s.Triangulate=function(t){var e=t.length>>1;if(e<3)return[];for(var i=[],n=[],r=0;r<e;r++)n.push(r);for(var r=0,o=e;o>3;){var a=n[(r+0)%o],h=n[(r+1)%o],l=n[(r+2)%o],c=t[2*a],u=t[2*a+1],d=t[2*h],p=t[2*h+1],f=t[2*l],g=t[2*l+1],m=!1;if(s._convex(c,u,d,p,f,g)){m=!0;for(var y=0;y<o;y++){var v=n[y];if(v!=a&&v!=h&&v!=l&&s._PointInTriangle(t[2*v],t[2*v+1],c,u,d,p,f,g)){m=!1;break}}}if(m)i.push(a,h,l),n.splice((r+1)%o,1),o--,r=0;else if(r++>3*o)break}return i.push(n[0],n[1],n[2]),i},s._PointInTriangle=function(t,e,i,s,n,r,o,a){var h=o-i,l=a-s,c=n-i,u=r-s,d=t-i,p=e-s,f=h*h+l*l,g=h*c+l*u,m=h*d+l*p,y=c*c+u*u,v=c*d+u*p,x=1/(f*y-g*g),b=(y*m-g*v)*x,_=(f*v-g*m)*x;return b>=0&&_>=0&&b+_<1},s._convex=function(t,e,i,s,n,r){return(e-s)*(n-i)+(i-t)*(r-s)>=0},e.exports=s},{}],30:[function(t,e,i){var s=e.exports={},n=t("../utils/Utils");s.crossLength=function(t,e){return t[0]*e[1]-t[1]*e[0]},s.crossVZ=function(t,e,i){return s.rotate(t,e,-Math.PI/2),s.scale(t,t,i),t},s.crossZV=function(t,e,i){return s.rotate(t,i,Math.PI/2),s.scale(t,t,e),t},s.rotate=function(t,e,i){if(0!==i){var s=Math.cos(i),n=Math.sin(i),r=e[0],o=e[1];t[0]=s*r-n*o,t[1]=n*r+s*o}else t[0]=e[0],t[1]=e[1]},s.rotate90cw=function(t,e){var i=e[0],s=e[1];t[0]=s,t[1]=-i},s.toLocalFrame=function(t,e,i,n){s.copy(t,e),s.sub(t,t,i),s.rotate(t,t,-n)},s.toGlobalFrame=function(t,e,i,n){s.copy(t,e),s.rotate(t,t,n),s.add(t,t,i)},s.vectorToLocalFrame=function(t,e,i){s.rotate(t,e,-i)},s.vectorToGlobalFrame=function(t,e,i){s.rotate(t,e,i)},s.centroid=function(t,e,i,n){return s.add(t,e,i),s.add(t,t,n),s.scale(t,t,1/3),t},s.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},s.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},s.fromValues=function(t,e){var i=new n.ARRAY_TYPE(2);return i[0]=t,i[1]=e,i},s.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},s.set=function(t,e,i){return t[0]=e,t[1]=i,t},s.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t},s.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t},s.sub=s.subtract,s.multiply=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t},s.mul=s.multiply,s.divide=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t},s.div=s.divide,s.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},s.distance=function(t,e){var i=e[0]-t[0],s=e[1]-t[1];return Math.sqrt(i*i+s*s)},s.dist=s.distance,s.squaredDistance=function(t,e){var i=e[0]-t[0],s=e[1]-t[1];return i*i+s*s},s.sqrDist=s.squaredDistance,s.length=function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)},s.len=s.length,s.squaredLength=function(t){var e=t[0],i=t[1];return e*e+i*i},s.sqrLen=s.squaredLength,s.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},s.normalize=function(t,e){var i=e[0],s=e[1],n=i*i+s*s;return n>0&&(n=1/Math.sqrt(n),t[0]=e[0]*n,t[1]=e[1]*n),t},s.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},s.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},s.lerp=function(t,e,i,s){var n=e[0],r=e[1];return t[0]=n+s*(i[0]-n),t[1]=r+s*(i[1]-r),t},s.reflect=function(t,e,i){var s=e[0]*i[0]+e[1]*i[1];t[0]=e[0]-2*i[0]*s,t[1]=e[1]-2*i[1]*s},s.getLineSegmentsIntersection=function(t,e,i,n,r){var o=s.getLineSegmentsIntersectionFraction(e,i,n,r);return!(o<0)&&(t[0]=e[0]+o*(i[0]-e[0]),t[1]=e[1]+o*(i[1]-e[1]),!0)},s.getLineSegmentsIntersectionFraction=function(t,e,i,s){var n,r,o=e[0]-t[0],a=e[1]-t[1],h=s[0]-i[0],l=s[1]-i[1];return n=(-a*(t[0]-i[0])+o*(t[1]-i[1]))/(-h*a+o*l),r=(h*(t[1]-i[1])-l*(t[0]-i[0]))/(-h*a+o*l),n>=0&&n<=1&&r>=0&&r<=1?r:-1}},{"../utils/Utils":57}],31:[function(t,e,i){function s(t){t=t||{},c.call(this),this.id=t.id||++s._idCounter,this.world=null,this.shapes=[],this.mass=t.mass||0,this.invMass=0,this.inertia=0,this.invInertia=0,this.invMassSolve=0,this.invInertiaSolve=0,this.fixedRotation=!!t.fixedRotation,this.fixedX=!!t.fixedX,this.fixedY=!!t.fixedY,this.massMultiplier=n.create(),this.position=n.fromValues(0,0),t.position&&n.copy(this.position,t.position),this.interpolatedPosition=n.fromValues(0,0),this.interpolatedAngle=0,this.previousPosition=n.fromValues(0,0),this.previousAngle=0,this.velocity=n.fromValues(0,0),t.velocity&&n.copy(this.velocity,t.velocity),this.vlambda=n.fromValues(0,0),this.wlambda=0,this.angle=t.angle||0,this.angularVelocity=t.angularVelocity||0,this.force=n.create(),t.force&&n.copy(this.force,t.force),this.angularForce=t.angularForce||0,this.damping="number"==typeof t.damping?t.damping:.1,this.angularDamping="number"==typeof t.angularDamping?t.angularDamping:.1,this.type=s.STATIC,void 0!==t.type?this.type=t.type:t.mass?this.type=s.DYNAMIC:this.type=s.STATIC,this.boundingRadius=0,this.aabb=new l,this.aabbNeedsUpdate=!0,this.allowSleep=void 0===t.allowSleep||t.allowSleep,this.wantsToSleep=!1,this.sleepState=s.AWAKE,this.sleepSpeedLimit=void 0!==t.sleepSpeedLimit?t.sleepSpeedLimit:.2,this.sleepTimeLimit=void 0!==t.sleepTimeLimit?t.sleepTimeLimit:1,this.gravityScale=void 0!==t.gravityScale?t.gravityScale:1,this.collisionResponse=void 0===t.collisionResponse||t.collisionResponse,this.idleTime=0,this.timeLastSleepy=0,this.ccdSpeedThreshold=void 0!==t.ccdSpeedThreshold?t.ccdSpeedThreshold:-1,this.ccdIterations=void 0!==t.ccdIterations?t.ccdIterations:10,this.concavePath=null,this._wakeUpAfterNarrowphase=!1,this.updateMassProperties()}var n=t("../math/vec2"),r=t("poly-decomp"),o=t("../shapes/Convex"),a=t("../collision/RaycastResult"),h=t("../collision/Ray"),l=t("../collision/AABB"),c=t("../events/EventEmitter");e.exports=s,s.prototype=new c,s.prototype.constructor=s,s._idCounter=0,s.prototype.updateSolveMassProperties=function(){this.sleepState===s.SLEEPING||this.type===s.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve=0):(this.invMassSolve=this.invMass,this.invInertiaSolve=this.invInertia)},s.prototype.setDensity=function(t){var e=this.getArea();this.mass=e*t,this.updateMassProperties()},s.prototype.getArea=function(){for(var t=0,e=0;e<this.shapes.length;e++)t+=this.shapes[e].area;return t},s.prototype.getAABB=function(){return this.aabbNeedsUpdate&&this.updateAABB(),this.aabb};var u=new l,d=n.create();s.prototype.updateAABB=function(){for(var t=this.shapes,e=t.length,i=d,s=this.angle,r=0;r!==e;r++){var o=t[r],a=o.angle+s;n.rotate(i,o.position,s),n.add(i,i,this.position),o.computeAABB(u,i,a),0===r?this.aabb.copy(u):this.aabb.extend(u)}this.aabbNeedsUpdate=!1},s.prototype.updateBoundingRadius=function(){for(var t=this.shapes,e=t.length,i=0,s=0;s!==e;s++){var r=t[s],o=n.length(r.position),a=r.boundingRadius;o+a>i&&(i=o+a)}this.boundingRadius=i},s.prototype.addShape=function(t,e,i){if(t.body)throw new Error("A shape can only be added to one body.");t.body=this,e?n.copy(t.position,e):n.set(t.position,0,0),t.angle=i||0,this.shapes.push(t),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0},s.prototype.removeShape=function(t){var e=this.shapes.indexOf(t);return-1!==e&&(this.shapes.splice(e,1),this.aabbNeedsUpdate=!0,t.body=null,!0)},s.prototype.updateMassProperties=function(){if(this.type===s.STATIC||this.type===s.KINEMATIC)this.mass=Number.MAX_VALUE,this.invMass=0,this.inertia=Number.MAX_VALUE,this.invInertia=0;else{var t=this.shapes,e=t.length,i=this.mass/e,r=0;if(this.fixedRotation)this.inertia=Number.MAX_VALUE,this.invInertia=0;else{for(var o=0;o<e;o++){var a=t[o],h=n.squaredLength(a.position);r+=a.computeMomentOfInertia(i)+i*h}this.inertia=r,this.invInertia=r>0?1/r:0}this.invMass=1/this.mass,n.set(this.massMultiplier,this.fixedX?0:1,this.fixedY?0:1)}};n.create();s.prototype.applyForce=function(t,e){if(n.add(this.force,this.force,t),e){var i=n.crossLength(e,t);this.angularForce+=i}};var p=n.create(),f=n.create(),g=n.create();s.prototype.applyForceLocal=function(t,e){e=e||g;var i=p,s=f;this.vectorToWorldFrame(i,t),this.vectorToWorldFrame(s,e),this.applyForce(i,s)};var m=n.create();s.prototype.applyImpulse=function(t,e){if(this.type===s.DYNAMIC){var i=m;if(n.scale(i,t,this.invMass),n.multiply(i,this.massMultiplier,i),n.add(this.velocity,i,this.velocity),e){var r=n.crossLength(e,t);r*=this.invInertia,this.angularVelocity+=r}}};var y=n.create(),v=n.create(),x=n.create();s.prototype.applyImpulseLocal=function(t,e){e=e||x;var i=y,s=v;this.vectorToWorldFrame(i,t),this.vectorToWorldFrame(s,e),this.applyImpulse(i,s)},s.prototype.toLocalFrame=function(t,e){n.toLocalFrame(t,e,this.position,this.angle)},s.prototype.toWorldFrame=function(t,e){n.toGlobalFrame(t,e,this.position,this.angle)},s.prototype.vectorToLocalFrame=function(t,e){n.vectorToLocalFrame(t,e,this.angle)},s.prototype.vectorToWorldFrame=function(t,e){n.vectorToGlobalFrame(t,e,this.angle)},s.prototype.fromPolygon=function(t,e){e=e||{};for(h=this.shapes.length;h>=0;--h)this.removeShape(this.shapes[h]);var i=new r.Polygon;if(i.vertices=t,i.makeCCW(),"number"==typeof e.removeCollinearPoints&&i.removeCollinearPoints(e.removeCollinearPoints),void 0===e.skipSimpleCheck&&!i.isSimple())return!1;this.concavePath=i.vertices.slice(0);for(h=0;h<this.concavePath.length;h++){u=[0,0];n.copy(u,this.concavePath[h]),this.concavePath[h]=u}var s;s=e.optimalDecomp?i.decomp():i.quickDecomp();for(var a=n.create(),h=0;h!==s.length;h++){for(var l=new o({vertices:s[h].vertices}),c=0;c!==l.vertices.length;c++){var u=l.vertices[c];n.sub(u,u,l.centerOfMass)}n.scale(a,l.centerOfMass,1),l.updateTriangles(),l.updateCenterOfMass(),l.updateBoundingRadius(),this.addShape(l,a)}return this.adjustCenterOfMass(),this.aabbNeedsUpdate=!0,!0};n.fromValues(0,0);var b=n.fromValues(0,0),_=n.fromValues(0,0),w=n.fromValues(0,0);s.prototype.adjustCenterOfMass=function(){var t=b,e=_,i=w,s=0;n.set(e,0,0);for(o=0;o!==this.shapes.length;o++){r=this.shapes[o];n.scale(t,r.position,r.area),n.add(e,e,t),s+=r.area}n.scale(i,e,1/s);for(o=0;o!==this.shapes.length;o++){var r=this.shapes[o];n.sub(r.position,r.position,i)}n.add(this.position,this.position,i);for(var o=0;this.concavePath&&o<this.concavePath.length;o++)n.sub(this.concavePath[o],this.concavePath[o],i);this.updateMassProperties(),this.updateBoundingRadius()},s.prototype.setZeroForce=function(){n.set(this.force,0,0),this.angularForce=0},s.prototype.resetConstraintVelocity=function(){var t=this,e=t.vlambda;n.set(e,0,0),t.wlambda=0},s.prototype.addConstraintVelocity=function(){var t=this,e=t.velocity;n.add(e,e,t.vlambda),t.angularVelocity+=t.wlambda},s.prototype.applyDamping=function(t){if(this.type===s.DYNAMIC){var e=this.velocity;n.scale(e,e,Math.pow(1-this.damping,t)),this.angularVelocity*=Math.pow(1-this.angularDamping,t)}},s.prototype.wakeUp=function(){var t=this.sleepState;this.sleepState=s.AWAKE,this.idleTime=0,t!==s.AWAKE&&this.emit(s.wakeUpEvent)},s.prototype.sleep=function(){this.sleepState=s.SLEEPING,this.angularVelocity=0,this.angularForce=0,n.set(this.velocity,0,0),n.set(this.force,0,0),this.emit(s.sleepEvent)},s.prototype.sleepTick=function(t,e,i){if(this.allowSleep&&this.type!==s.SLEEPING){this.wantsToSleep=!1;this.sleepState;n.squaredLength(this.velocity)+Math.pow(this.angularVelocity,2)>=Math.pow(this.sleepSpeedLimit,2)?(this.idleTime=0,this.sleepState=s.AWAKE):(this.idleTime+=i,this.sleepState=s.SLEEPY),this.idleTime>this.sleepTimeLimit&&(e?this.wantsToSleep=!0:this.sleep())}},s.prototype.overlaps=function(t){return this.world.overlapKeeper.bodiesAreOverlapping(this,t)};var T=n.create(),P=n.create();s.prototype.integrate=function(t){var e=this.invMass,i=this.force,s=this.position,r=this.velocity;n.copy(this.previousPosition,this.position),this.previousAngle=this.angle,this.fixedRotation||(this.angularVelocity+=this.angularForce*this.invInertia*t),n.scale(T,i,t*e),n.multiply(T,this.massMultiplier,T),n.add(r,T,r),this.integrateToTimeOfImpact(t)||(n.scale(P,r,t),n.add(s,s,P),this.fixedRotation||(this.angle+=this.angularVelocity*t)),this.aabbNeedsUpdate=!0};var C=new a,S=new h({mode:h.ALL}),A=n.create(),E=n.create(),M=n.create(),R=n.create();s.prototype.integrateToTimeOfImpact=function(t){if(this.ccdSpeedThreshold<0||n.squaredLength(this.velocity)<Math.pow(this.ccdSpeedThreshold,2))return!1;n.normalize(A,this.velocity),n.scale(E,this.velocity,t),n.add(E,E,this.position),n.sub(M,E,this.position);var e,i=this.angularVelocity*t,s=n.length(M),r=1,o=this;if(C.reset(),S.callback=function(t){t.body!==o&&(e=t.body,t.getHitPoint(E,S),n.sub(M,E,o.position),r=n.length(M)/s,t.stop())},n.copy(S.from,this.position),n.copy(S.to,E),S.update(),this.world.raycast(C,S),!e)return!1;var a=this.angle;n.copy(R,this.position);for(var h=0,l=0,c=0,u=r;u>=l&&h<this.ccdIterations;)h++,c=(u-l)/2,n.scale(P,M,r),n.add(this.position,R,P),this.angle=a+i*r,this.updateAABB(),this.aabb.overlaps(e.aabb)&&this.world.narrowphase.bodiesOverlap(this,e)?l=c:u=c;return r=c,n.copy(this.position,R),this.angle=a,n.scale(P,M,r),n.add(this.position,this.position,P),this.fixedRotation||(this.angle+=i*r),!0},s.prototype.getVelocityAtPoint=function(t,e){return n.crossVZ(t,e,this.angularVelocity),n.subtract(t,this.velocity,t),t},s.sleepyEvent={type:"sleepy"},s.sleepEvent={type:"sleep"},s.wakeUpEvent={type:"wakeup"},s.DYNAMIC=1,s.STATIC=2,s.KINEMATIC=4,s.AWAKE=0,s.SLEEPY=1,s.SLEEPING=2},{"../collision/AABB":7,"../collision/Ray":11,"../collision/RaycastResult":12,"../events/EventEmitter":26,"../math/vec2":30,"../shapes/Convex":40,"poly-decomp":5}],32:[function(t,e,i){function s(t,e,i){i=i||{},r.call(this,t,e,i),this.localAnchorA=n.fromValues(0,0),this.localAnchorB=n.fromValues(0,0),i.localAnchorA&&n.copy(this.localAnchorA,i.localAnchorA),i.localAnchorB&&n.copy(this.localAnchorB,i.localAnchorB),i.worldAnchorA&&this.setWorldAnchorA(i.worldAnchorA),i.worldAnchorB&&this.setWorldAnchorB(i.worldAnchorB);var s=n.create(),o=n.create();this.getWorldAnchorA(s),this.getWorldAnchorB(o);var a=n.distance(s,o);this.restLength="number"==typeof i.restLength?i.restLength:a}var n=t("../math/vec2"),r=t("./Spring");t("../utils/Utils");e.exports=s,(s.prototype=new r).constructor=s,s.prototype.setWorldAnchorA=function(t){this.bodyA.toLocalFrame(this.localAnchorA,t)},s.prototype.setWorldAnchorB=function(t){this.bodyB.toLocalFrame(this.localAnchorB,t)},s.prototype.getWorldAnchorA=function(t){this.bodyA.toWorldFrame(t,this.localAnchorA)},s.prototype.getWorldAnchorB=function(t){this.bodyB.toWorldFrame(t,this.localAnchorB)};var o=n.create(),a=n.create(),h=n.create(),l=n.create(),c=n.create(),u=n.create(),d=n.create(),p=n.create(),f=n.create();s.prototype.applyForce=function(){var t=this.stiffness,e=this.damping,i=this.restLength,s=this.bodyA,r=this.bodyB,g=o,m=a,y=h,v=l,x=f,b=c,_=u,w=d,T=p;this.getWorldAnchorA(b),this.getWorldAnchorB(_),n.sub(w,b,s.position),n.sub(T,_,r.position),n.sub(g,_,b);var P=n.len(g);n.normalize(m,g),n.sub(y,r.velocity,s.velocity),n.crossZV(x,r.angularVelocity,T),n.add(y,y,x),n.crossZV(x,s.angularVelocity,w),n.sub(y,y,x),n.scale(v,m,-t*(P-i)-e*n.dot(y,m)),n.sub(s.force,s.force,v),n.add(r.force,r.force,v);var C=n.crossLength(w,v),S=n.crossLength(T,v);s.angularForce-=C,r.angularForce+=S}},{"../math/vec2":30,"../utils/Utils":57,"./Spring":34}],33:[function(t,e,i){function s(t,e,i){i=i||{},n.call(this,t,e,i),this.restAngle="number"==typeof i.restAngle?i.restAngle:e.angle-t.angle}t("../math/vec2");var n=t("./Spring");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.applyForce=function(){var t=this.stiffness,e=this.damping,i=this.restAngle,s=this.bodyA,n=this.bodyB,r=-t*(n.angle-s.angle-i)-e*(n.angularVelocity-s.angularVelocity)*0;s.angularForce-=r,n.angularForce+=r}},{"../math/vec2":30,"./Spring":34}],34:[function(t,e,i){function s(t,e,i){i=n.defaults(i,{stiffness:100,damping:1}),this.stiffness=i.stiffness,this.damping=i.damping,this.bodyA=t,this.bodyB=e}t("../math/vec2");var n=t("../utils/Utils");e.exports=s,s.prototype.applyForce=function(){}},{"../math/vec2":30,"../utils/Utils":57}],35:[function(t,e,i){function s(t,e){e=e||{},this.chassisBody=t,this.wheels=[],this.groundBody=new h({mass:0}),this.world=null;var i=this;this.preStepCallback=function(){i.update()}}function n(t,e){e=e||{},this.vehicle=t,this.forwardEquation=new a(t.chassisBody,t.groundBody),this.sideEquation=new a(t.chassisBody,t.groundBody),this.steerValue=0,this.engineForce=0,this.setSideFriction(void 0!==e.sideFriction?e.sideFriction:5),this.localForwardVector=r.fromValues(0,1),e.localForwardVector&&r.copy(this.localForwardVector,e.localForwardVector),this.localPosition=r.fromValues(0,0),e.localPosition&&r.copy(this.localPosition,e.localPosition),o.apply(this,t.chassisBody,t.groundBody),this.equations.push(this.forwardEquation,this.sideEquation),this.setBrakeForce(0)}var r=t("../math/vec2"),o=(t("../utils/Utils"),t("../constraints/Constraint")),a=t("../equations/FrictionEquation"),h=t("../objects/Body");e.exports=s,s.prototype.addToWorld=function(t){this.world=t,t.addBody(this.groundBody),t.on("preStep",this.preStepCallback);for(var e=0;e<this.wheels.length;e++){var i=this.wheels[e];t.addConstraint(i)}},s.prototype.removeFromWorld=function(){var t=this.world;t.removeBody(this.groundBody),t.off("preStep",this.preStepCallback);for(var e=0;e<this.wheels.length;e++){var i=this.wheels[e];t.removeConstraint(i)}this.world=null},s.prototype.addWheel=function(t){var e=new n(this,t);return this.wheels.push(e),e},s.prototype.update=function(){for(var t=0;t<this.wheels.length;t++)this.wheels[t].update()},(n.prototype=new o).setBrakeForce=function(t){this.forwardEquation.setSlipForce(t)},n.prototype.setSideFriction=function(t){this.sideEquation.setSlipForce(t)};var l=r.create(),c=r.create();n.prototype.getSpeed=function(){return this.vehicle.chassisBody.vectorToWorldFrame(c,this.localForwardVector),this.vehicle.chassisBody.getVelocityAtPoint(l,c),r.dot(l,c)};var u=r.create();n.prototype.update=function(){this.vehicle.chassisBody.vectorToWorldFrame(this.forwardEquation.t,this.localForwardVector),r.rotate(this.sideEquation.t,this.localForwardVector,Math.PI/2),this.vehicle.chassisBody.vectorToWorldFrame(this.sideEquation.t,this.sideEquation.t),r.rotate(this.forwardEquation.t,this.forwardEquation.t,this.steerValue),r.rotate(this.sideEquation.t,this.sideEquation.t,this.steerValue),this.vehicle.chassisBody.toWorldFrame(this.forwardEquation.contactPointB,this.localPosition),r.copy(this.sideEquation.contactPointB,this.forwardEquation.contactPointB),this.vehicle.chassisBody.vectorToWorldFrame(this.forwardEquation.contactPointA,this.localPosition),r.copy(this.sideEquation.contactPointA,this.forwardEquation.contactPointA),r.normalize(u,this.forwardEquation.t),r.scale(u,u,this.engineForce),this.vehicle.chassisBody.applyForce(u,this.forwardEquation.contactPointA)}},{"../constraints/Constraint":14,"../equations/FrictionEquation":23,"../math/vec2":30,"../objects/Body":31,"../utils/Utils":57}],36:[function(t,e,i){var s=e.exports={AABB:t("./collision/AABB"),AngleLockEquation:t("./equations/AngleLockEquation"),Body:t("./objects/Body"),Broadphase:t("./collision/Broadphase"),Capsule:t("./shapes/Capsule"),Circle:t("./shapes/Circle"),Constraint:t("./constraints/Constraint"),ContactEquation:t("./equations/ContactEquation"),ContactEquationPool:t("./utils/ContactEquationPool"),ContactMaterial:t("./material/ContactMaterial"),Convex:t("./shapes/Convex"),DistanceConstraint:t("./constraints/DistanceConstraint"),Equation:t("./equations/Equation"),EventEmitter:t("./events/EventEmitter"),FrictionEquation:t("./equations/FrictionEquation"),FrictionEquationPool:t("./utils/FrictionEquationPool"),GearConstraint:t("./constraints/GearConstraint"),GSSolver:t("./solver/GSSolver"),Heightfield:t("./shapes/Heightfield"),Line:t("./shapes/Line"),LockConstraint:t("./constraints/LockConstraint"),Material:t("./material/Material"),Narrowphase:t("./collision/Narrowphase"),NaiveBroadphase:t("./collision/NaiveBroadphase"),Particle:t("./shapes/Particle"),Plane:t("./shapes/Plane"),Pool:t("./utils/Pool"),RevoluteConstraint:t("./constraints/RevoluteConstraint"),PrismaticConstraint:t("./constraints/PrismaticConstraint"),Ray:t("./collision/Ray"),RaycastResult:t("./collision/RaycastResult"),Box:t("./shapes/Box"),RotationalVelocityEquation:t("./equations/RotationalVelocityEquation"),SAPBroadphase:t("./collision/SAPBroadphase"),Shape:t("./shapes/Shape"),Solver:t("./solver/Solver"),Spring:t("./objects/Spring"),TopDownVehicle:t("./objects/TopDownVehicle"),LinearSpring:t("./objects/LinearSpring"),RotationalSpring:t("./objects/RotationalSpring"),Utils:t("./utils/Utils"),World:t("./world/World"),vec2:t("./math/vec2"),version:t("../package.json").version};Object.defineProperty(s,"Rectangle",{get:function(){return console.warn("The Rectangle class has been renamed to Box."),this.Box}})},{"../package.json":6,"./collision/AABB":7,"./collision/Broadphase":8,"./collision/NaiveBroadphase":9,"./collision/Narrowphase":10,"./collision/Ray":11,"./collision/RaycastResult":12,"./collision/SAPBroadphase":13,"./constraints/Constraint":14,"./constraints/DistanceConstraint":15,"./constraints/GearConstraint":16,"./constraints/LockConstraint":17,"./constraints/PrismaticConstraint":18,"./constraints/RevoluteConstraint":19,"./equations/AngleLockEquation":20,"./equations/ContactEquation":21,"./equations/Equation":22,"./equations/FrictionEquation":23,"./equations/RotationalVelocityEquation":25,"./events/EventEmitter":26,"./material/ContactMaterial":27,"./material/Material":28,"./math/vec2":30,"./objects/Body":31,"./objects/LinearSpring":32,"./objects/RotationalSpring":33,"./objects/Spring":34,"./objects/TopDownVehicle":35,"./shapes/Box":37,"./shapes/Capsule":38,"./shapes/Circle":39,"./shapes/Convex":40,"./shapes/Heightfield":41,"./shapes/Line":42,"./shapes/Particle":43,"./shapes/Plane":44,"./shapes/Shape":45,"./solver/GSSolver":46,"./solver/Solver":47,"./utils/ContactEquationPool":48,"./utils/FrictionEquationPool":49,"./utils/Pool":55,"./utils/Utils":57,"./world/World":61}],37:[function(t,e,i){function s(t){"number"==typeof arguments[0]&&"number"==typeof arguments[1]&&(t={width:arguments[0],height:arguments[1]},console.warn("The Rectangle has been renamed to Box and its constructor signature has changed. Please use the following format: new Box({ width: 1, height: 1, ... })")),t=t||{};var e=this.width=t.width||1,i=this.height=t.height||1,s=[n.fromValues(-e/2,-i/2),n.fromValues(e/2,-i/2),n.fromValues(e/2,i/2),n.fromValues(-e/2,i/2)],a=[n.fromValues(1,0),n.fromValues(0,1)];t.vertices=s,t.axes=a,t.type=r.BOX,o.call(this,t)}var n=t("../math/vec2"),r=t("./Shape"),o=t("./Convex");e.exports=s,(s.prototype=new o).constructor=s,s.prototype.computeMomentOfInertia=function(t){var e=this.width,i=this.height;return t*(i*i+e*e)/12},s.prototype.updateBoundingRadius=function(){var t=this.width,e=this.height;this.boundingRadius=Math.sqrt(t*t+e*e)/2};n.create(),n.create(),n.create(),n.create();s.prototype.computeAABB=function(t,e,i){t.setFromPoints(this.vertices,e,i,0)},s.prototype.updateArea=function(){this.area=this.width*this.height}},{"../math/vec2":30,"./Convex":40,"./Shape":45}],38:[function(t,e,i){function s(t){"number"==typeof arguments[0]&&"number"==typeof arguments[1]&&(t={length:arguments[0],radius:arguments[1]},console.warn("The Capsule constructor signature has changed. Please use the following format: new Capsule({ radius: 1, length: 1 })")),t=t||{},this.length=t.length||1,this.radius=t.radius||1,t.type=n.CAPSULE,n.call(this,t)}var n=t("./Shape"),r=t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.computeMomentOfInertia=function(t){var e=this.radius,i=this.length+e,s=2*e;return t*(s*s+i*i)/12},s.prototype.updateBoundingRadius=function(){this.boundingRadius=this.radius+this.length/2},s.prototype.updateArea=function(){this.area=Math.PI*this.radius*this.radius+2*this.radius*this.length};var o=r.create();s.prototype.computeAABB=function(t,e,i){var s=this.radius;r.set(o,this.length/2,0),0!==i&&r.rotate(o,o,i),r.set(t.upperBound,Math.max(o[0]+s,-o[0]+s),Math.max(o[1]+s,-o[1]+s)),r.set(t.lowerBound,Math.min(o[0]-s,-o[0]-s),Math.min(o[1]-s,-o[1]-s)),r.add(t.lowerBound,t.lowerBound,e),r.add(t.upperBound,t.upperBound,e)};var a=r.create(),h=r.create(),l=r.create(),c=r.create(),u=r.fromValues(0,1);s.prototype.raycast=function(t,e,i,s){for(var n=e.from,o=e.to,d=(e.direction,a),p=h,f=l,g=c,m=this.length/2,y=0;y<2;y++){var v=this.radius*(2*y-1);if(r.set(f,-m,v),r.set(g,m,v),r.toGlobalFrame(f,f,i,s),r.toGlobalFrame(g,g,i,s),(T=r.getLineSegmentsIntersectionFraction(n,o,f,g))>=0&&(r.rotate(p,u,s),r.scale(p,p,2*y-1),e.reportIntersection(t,T,p,-1),t.shouldStop(e)))return}for(var x=Math.pow(this.radius,2)+Math.pow(m,2),y=0;y<2;y++){r.set(f,m*(2*y-1),0),r.toGlobalFrame(f,f,i,s);var b=Math.pow(o[0]-n[0],2)+Math.pow(o[1]-n[1],2),_=2*((o[0]-n[0])*(n[0]-f[0])+(o[1]-n[1])*(n[1]-f[1])),w=Math.pow(n[0]-f[0],2)+Math.pow(n[1]-f[1],2)-Math.pow(this.radius,2),T=Math.pow(_,2)-4*b*w;if(!(T<0))if(0===T){if(r.lerp(d,n,o,T),r.squaredDistance(d,i)>x&&(r.sub(p,d,f),r.normalize(p,p),e.reportIntersection(t,T,p,-1),t.shouldStop(e)))return}else{var P=Math.sqrt(T),C=1/(2*b),S=(-_-P)*C,A=(-_+P)*C;if(S>=0&&S<=1&&(r.lerp(d,n,o,S),r.squaredDistance(d,i)>x&&(r.sub(p,d,f),r.normalize(p,p),e.reportIntersection(t,S,p,-1),t.shouldStop(e))))return;if(A>=0&&A<=1&&(r.lerp(d,n,o,A),r.squaredDistance(d,i)>x&&(r.sub(p,d,f),r.normalize(p,p),e.reportIntersection(t,A,p,-1),t.shouldStop(e))))return}}}},{"../math/vec2":30,"./Shape":45}],39:[function(t,e,i){function s(t){"number"==typeof arguments[0]&&(t={radius:arguments[0]},console.warn("The Circle constructor signature has changed. Please use the following format: new Circle({ radius: 1 })")),t=t||{},this.radius=t.radius||1,t.type=n.CIRCLE,n.call(this,t)}var n=t("./Shape"),r=t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.computeMomentOfInertia=function(t){var e=this.radius;return t*e*e/2},s.prototype.updateBoundingRadius=function(){this.boundingRadius=this.radius},s.prototype.updateArea=function(){this.area=Math.PI*this.radius*this.radius},s.prototype.computeAABB=function(t,e,i){var s=this.radius;r.set(t.upperBound,s,s),r.set(t.lowerBound,-s,-s),e&&(r.add(t.lowerBound,t.lowerBound,e),r.add(t.upperBound,t.upperBound,e))};var o=r.create(),a=r.create();s.prototype.raycast=function(t,e,i,s){var n=e.from,h=e.to,l=this.radius,c=Math.pow(h[0]-n[0],2)+Math.pow(h[1]-n[1],2),u=2*((h[0]-n[0])*(n[0]-i[0])+(h[1]-n[1])*(n[1]-i[1])),d=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)-Math.pow(l,2),p=Math.pow(u,2)-4*c*d,f=o,g=a;if(!(p<0))if(0===p)r.lerp(f,n,h,p),r.sub(g,f,i),r.normalize(g,g),e.reportIntersection(t,p,g,-1);else{var m=Math.sqrt(p),y=1/(2*c),v=(-u-m)*y,x=(-u+m)*y;if(v>=0&&v<=1&&(r.lerp(f,n,h,v),r.sub(g,f,i),r.normalize(g,g),e.reportIntersection(t,v,g,-1),t.shouldStop(e)))return;x>=0&&x<=1&&(r.lerp(f,n,h,x),r.sub(g,f,i),r.normalize(g,g),e.reportIntersection(t,x,g,-1))}}},{"../math/vec2":30,"./Shape":45}],40:[function(t,e,i){function s(t){Array.isArray(arguments[0])&&(t={vertices:arguments[0],axes:arguments[1]},console.warn("The Convex constructor signature has changed. Please use the following format: new Convex({ vertices: [...], ... })")),t=t||{},this.vertices=[];for(var e=void 0!==t.vertices?t.vertices:[],i=0;i<e.length;i++){var s=r.create();r.copy(s,e[i]),this.vertices.push(s)}if(this.axes=[],t.axes)for(i=0;i<t.axes.length;i++){var o=r.create();r.copy(o,t.axes[i]),this.axes.push(o)}else for(i=0;i<this.vertices.length;i++){var a=this.vertices[i],h=this.vertices[(i+1)%this.vertices.length],l=r.create();r.sub(l,h,a),r.rotate90cw(l,l),r.normalize(l,l),this.axes.push(l)}if(this.centerOfMass=r.fromValues(0,0),this.triangles=[],this.vertices.length&&(this.updateTriangles(),this.updateCenterOfMass()),this.boundingRadius=0,t.type=n.CONVEX,n.call(this,t),this.updateBoundingRadius(),this.updateArea(),this.area<0)throw new Error("Convex vertices must be given in conter-clockwise winding.")}var n=t("./Shape"),r=t("../math/vec2"),o=t("../math/polyk");t("poly-decomp");e.exports=s,(s.prototype=new n).constructor=s;var a=r.create(),h=r.create();s.prototype.projectOntoLocalAxis=function(t,e){for(var i,s,n=null,o=null,t=a,h=0;h<this.vertices.length;h++)i=this.vertices[h],s=r.dot(i,t),(null===n||s>n)&&(n=s),(null===o||s<o)&&(o=s);if(o>n){var l=o;o=n,n=l}r.set(e,o,n)},s.prototype.projectOntoWorldAxis=function(t,e,i,s){var n=h;this.projectOntoLocalAxis(t,s),0!==i?r.rotate(n,t,i):n=t;var o=r.dot(e,n);r.set(s,s[0]+o,s[1]+o)},s.prototype.updateTriangles=function(){this.triangles.length=0;for(var t=[],e=0;e<this.vertices.length;e++){var i=this.vertices[e];t.push(i[0],i[1])}for(var s=o.Triangulate(t),e=0;e<s.length;e+=3){var n=s[e],r=s[e+1],a=s[e+2];this.triangles.push([n,r,a])}};var l=r.create(),c=r.create(),u=r.create(),d=r.create(),p=r.create();r.create(),r.create(),r.create(),r.create();s.prototype.updateCenterOfMass=function(){var t=this.triangles,e=this.vertices,i=this.centerOfMass,n=l,o=u,a=d,h=p,f=c;r.set(i,0,0);for(var g=0,m=0;m!==t.length;m++){var y=t[m],o=e[y[0]],a=e[y[1]],h=e[y[2]];r.centroid(n,o,a,h);var v=s.triangleArea(o,a,h);g+=v,r.scale(f,n,v),r.add(i,i,f)}r.scale(i,i,1/g)},s.prototype.computeMomentOfInertia=function(t){for(var e=0,i=0,s=this.vertices.length,n=s-1,o=0;o<s;n=o,o++){var a=this.vertices[n],h=this.vertices[o],l=Math.abs(r.crossLength(a,h));e+=l*(r.dot(h,h)+r.dot(h,a)+r.dot(a,a)),i+=l}return t/6*(e/i)},s.prototype.updateBoundingRadius=function(){for(var t=this.vertices,e=0,i=0;i!==t.length;i++){var s=r.squaredLength(t[i]);s>e&&(e=s)}this.boundingRadius=Math.sqrt(e)},s.triangleArea=function(t,e,i){return.5*((e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1]))},s.prototype.updateArea=function(){this.updateTriangles(),this.area=0;for(var t=this.triangles,e=this.vertices,i=0;i!==t.length;i++){var n=t[i],r=e[n[0]],o=e[n[1]],a=e[n[2]],h=s.triangleArea(r,o,a);this.area+=h}},s.prototype.computeAABB=function(t,e,i){t.setFromPoints(this.vertices,e,i,0)};var f=r.create(),g=r.create(),m=r.create();s.prototype.raycast=function(t,e,i,s){var n=f,o=g,a=m,h=this.vertices;r.toLocalFrame(n,e.from,i,s),r.toLocalFrame(o,e.to,i,s);for(var l=h.length,c=0;c<l&&!t.shouldStop(e);c++){var u=h[c],d=h[(c+1)%l],p=r.getLineSegmentsIntersectionFraction(n,o,u,d);p>=0&&(r.sub(a,d,u),r.rotate(a,a,-Math.PI/2+s),r.normalize(a,a),e.reportIntersection(t,p,a,c))}}},{"../math/polyk":29,"../math/vec2":30,"./Shape":45,"poly-decomp":5}],41:[function(t,e,i){function s(t){if(Array.isArray(arguments[0])){if(t={heights:arguments[0]},"object"==typeof arguments[1])for(var e in arguments[1])t[e]=arguments[1][e];console.warn("The Heightfield constructor signature has changed. Please use the following format: new Heightfield({ heights: [...], ... })")}t=t||{},this.heights=t.heights?t.heights.slice(0):[],this.maxValue=t.maxValue||null,this.minValue=t.minValue||null,this.elementWidth=t.elementWidth||.1,void 0!==t.maxValue&&void 0!==t.minValue||this.updateMaxMinValues(),t.type=n.HEIGHTFIELD,n.call(this,t)}var n=t("./Shape"),r=t("../math/vec2");t("../utils/Utils");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.updateMaxMinValues=function(){for(var t=this.heights,e=t[0],i=t[0],s=0;s!==t.length;s++){var n=t[s];n>e&&(e=n),n<i&&(i=n)}this.maxValue=e,this.minValue=i},s.prototype.computeMomentOfInertia=function(t){return Number.MAX_VALUE},s.prototype.updateBoundingRadius=function(){this.boundingRadius=Number.MAX_VALUE},s.prototype.updateArea=function(){for(var t=this.heights,e=0,i=0;i<t.length-1;i++)e+=(t[i]+t[i+1])/2*this.elementWidth;this.area=e};var o=[r.create(),r.create(),r.create(),r.create()];s.prototype.computeAABB=function(t,e,i){r.set(o[0],0,this.maxValue),r.set(o[1],this.elementWidth*this.heights.length,this.maxValue),r.set(o[2],this.elementWidth*this.heights.length,this.minValue),r.set(o[3],0,this.minValue),t.setFromPoints(o,e,i)},s.prototype.getLineSegment=function(t,e,i){var s=this.heights,n=this.elementWidth;r.set(t,i*n,s[i]),r.set(e,(i+1)*n,s[i+1])},s.prototype.getSegmentIndex=function(t){return Math.floor(t[0]/this.elementWidth)},s.prototype.getClampedSegmentIndex=function(t){var e=this.getSegmentIndex(t);return e=Math.min(this.heights.length,Math.max(e,0))};r.create();var a=r.create(),h=r.create(),l=r.create(),c=r.create(),u=r.create();r.fromValues(0,1);s.prototype.raycast=function(t,e,i,s){var n=e.from,o=e.to,d=(e.direction,a),p=h,f=l,g=c,m=u;r.toLocalFrame(g,n,i,s),r.toLocalFrame(m,o,i,s);var y=this.getClampedSegmentIndex(g),v=this.getClampedSegmentIndex(m);if(y>v){var x=y;y=v,v=x}for(var b=0;b<this.heights.length-1;b++){this.getLineSegment(p,f,b);var _=r.getLineSegmentsIntersectionFraction(g,m,p,f);if(_>=0&&(r.sub(d,f,p),r.rotate(d,d,s+Math.PI/2),r.normalize(d,d),e.reportIntersection(t,_,d,-1),t.shouldStop(e)))return}}},{"../math/vec2":30,"../utils/Utils":57,"./Shape":45}],42:[function(t,e,i){function s(t){"number"==typeof arguments[0]&&(t={length:arguments[0]},console.warn("The Line constructor signature has changed. Please use the following format: new Line({ length: 1, ... })")),t=t||{},this.length=t.length||1,t.type=n.LINE,n.call(this,t)}var n=t("./Shape"),r=t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.computeMomentOfInertia=function(t){return t*Math.pow(this.length,2)/12},s.prototype.updateBoundingRadius=function(){this.boundingRadius=this.length/2};var o=[r.create(),r.create()];s.prototype.computeAABB=function(t,e,i){var s=this.length/2;r.set(o[0],-s,0),r.set(o[1],s,0),t.setFromPoints(o,e,i,0)};r.create();var a=r.create(),h=r.create(),l=r.create(),c=r.fromValues(0,1);s.prototype.raycast=function(t,e,i,s){var n=e.from,o=e.to,u=h,d=l,p=this.length/2;r.set(u,-p,0),r.set(d,p,0),r.toGlobalFrame(u,u,i,s),r.toGlobalFrame(d,d,i,s);var f=r.getLineSegmentsIntersectionFraction(u,d,n,o);if(f>=0){var g=a;r.rotate(g,c,s),e.reportIntersection(t,f,g,-1)}}},{"../math/vec2":30,"./Shape":45}],43:[function(t,e,i){function s(t){(t=t||{}).type=n.PARTICLE,n.call(this,t)}var n=t("./Shape"),r=t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.computeMomentOfInertia=function(t){return 0},s.prototype.updateBoundingRadius=function(){this.boundingRadius=0},s.prototype.computeAABB=function(t,e,i){r.copy(t.lowerBound,e),r.copy(t.upperBound,e)}},{"../math/vec2":30,"./Shape":45}],44:[function(t,e,i){function s(t){(t=t||{}).type=n.PLANE,n.call(this,t)}var n=t("./Shape"),r=t("../math/vec2");t("../utils/Utils");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.computeMomentOfInertia=function(t){return 0},s.prototype.updateBoundingRadius=function(){this.boundingRadius=Number.MAX_VALUE},s.prototype.computeAABB=function(t,e,i){var s=i%(2*Math.PI),n=r.set,o=t.lowerBound,a=t.upperBound;n(o,-1e7,-1e7),n(a,1e7,1e7),0===s?a[1]=0:s===Math.PI/2?o[0]=0:s===Math.PI?o[1]=0:s===3*Math.PI/2&&(a[0]=0)},s.prototype.updateArea=function(){this.area=Number.MAX_VALUE};var o=r.create(),a=(r.create(),r.create(),r.create()),h=r.create();s.prototype.raycast=function(t,e,i,s){var n=e.from,l=e.to,c=e.direction,u=o,d=a,p=h;r.set(d,0,1),r.rotate(d,d,s),r.sub(p,n,i);var f=r.dot(p,d);if(r.sub(p,l,i),!(f*r.dot(p,d)>0||r.squaredDistance(n,l)<f*f)){var g=r.dot(d,c);r.sub(u,n,i);var m=-r.dot(d,u)/g/e.length;e.reportIntersection(t,m,d,-1)}}},{"../math/vec2":30,"../utils/Utils":57,"./Shape":45}],45:[function(t,e,i){function s(t){t=t||{},this.body=null,this.position=n.fromValues(0,0),t.position&&n.copy(this.position,t.position),this.angle=t.angle||0,this.type=t.type||0,this.id=s.idCounter++,this.boundingRadius=0,this.collisionGroup=void 0!==t.collisionGroup?t.collisionGroup:1,this.collisionResponse=void 0===t.collisionResponse||t.collisionResponse,this.collisionMask=void 0!==t.collisionMask?t.collisionMask:1,this.material=t.material||null,this.area=0,this.sensor=void 0!==t.sensor&&t.sensor,this.type&&this.updateBoundingRadius(),this.updateArea()}e.exports=s;var n=t("../math/vec2");s.idCounter=0,s.CIRCLE=1,s.PARTICLE=2,s.PLANE=4,s.CONVEX=8,s.LINE=16,s.BOX=32,s.CAPSULE=64,s.HEIGHTFIELD=128,s.prototype.computeMomentOfInertia=function(t){},s.prototype.updateBoundingRadius=function(){},s.prototype.updateArea=function(){},s.prototype.computeAABB=function(t,e,i){},s.prototype.raycast=function(t,e,i,s){}},{"../math/vec2":30}],46:[function(t,e,i){function s(t){o.call(this,t,o.GS),t=t||{},this.iterations=t.iterations||10,this.tolerance=t.tolerance||1e-7,this.arrayStep=30,this.lambda=new a.ARRAY_TYPE(this.arrayStep),this.Bs=new a.ARRAY_TYPE(this.arrayStep),this.invCs=new a.ARRAY_TYPE(this.arrayStep),this.useZeroRHS=!1,this.frictionIterations=void 0!==t.frictionIterations?0:t.frictionIterations,this.usedIterations=0}function n(t){for(var e=t.length;e--;)t[e]=0}var r=t("../math/vec2"),o=t("./Solver"),a=t("../utils/Utils"),h=t("../equations/FrictionEquation");e.exports=s,(s.prototype=new o).constructor=s,s.prototype.solve=function(t,e){this.sortEquations();var i=0,o=this.iterations,l=this.frictionIterations,c=this.equations,u=c.length,d=Math.pow(this.tolerance*u,2),p=e.bodies,f=e.bodies.length,g=(r.add,r.set,this.useZeroRHS),m=this.lambda;if(this.usedIterations=0,u)for(x=0;x!==f;x++)(T=p[x]).updateSolveMassProperties();m.length<u&&(m=this.lambda=new a.ARRAY_TYPE(u+this.arrayStep),this.Bs=new a.ARRAY_TYPE(u+this.arrayStep),this.invCs=new a.ARRAY_TYPE(u+this.arrayStep)),n(m);for(var y=this.invCs,v=this.Bs,m=this.lambda,x=0;x!==c.length;x++)((b=c[x]).timeStep!==t||b.needsUpdate)&&(b.timeStep=t,b.update()),v[x]=b.computeB(b.a,b.b,t),y[x]=b.computeInvC(b.epsilon);var b,_,w;if(0!==u){for(x=0;x!==f;x++){var T=p[x];T.resetConstraintVelocity()}if(l){for(i=0;i!==l;i++){for(_=0,w=0;w!==u;w++){b=c[w];A=s.iterateEquation(w,b,b.epsilon,v,y,m,g,t,i);_+=Math.abs(A)}if(this.usedIterations++,_*_<=d)break}for(s.updateMultipliers(c,m,1/t),w=0;w!==u;w++){var P=c[w];if(P instanceof h){for(var C=0,S=0;S!==P.contactEquations.length;S++)C+=P.contactEquations[S].multiplier;C*=P.frictionCoefficient/P.contactEquations.length,P.maxForce=C,P.minForce=-C}}}for(i=0;i!==o;i++){for(_=0,w=0;w!==u;w++){b=c[w];var A=s.iterateEquation(w,b,b.epsilon,v,y,m,g,t,i);_+=Math.abs(A)}if(this.usedIterations++,_*_<=d)break}for(x=0;x!==f;x++)p[x].addConstraintVelocity();s.updateMultipliers(c,m,1/t)}},s.updateMultipliers=function(t,e,i){for(var s=t.length;s--;)t[s].multiplier=e[s]*i},s.iterateEquation=function(t,e,i,s,n,r,o,a,h){var l=s[t],c=n[t],u=r[t],d=e.computeGWlambda(),p=e.maxForce,f=e.minForce;o&&(l=0);var g=c*(l-d-i*u),m=u+g;return m<f*a?g=f*a-u:m>p*a&&(g=p*a-u),r[t]+=g,e.addToWlambda(g),g}},{"../equations/FrictionEquation":23,"../math/vec2":30,"../utils/Utils":57,"./Solver":47}],47:[function(t,e,i){function s(t,e){t=t||{},n.call(this),this.type=e,this.equations=[],this.equationSortFunction=t.equationSortFunction||!1}t("../utils/Utils");var n=t("../events/EventEmitter");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.solve=function(t,e){throw new Error("Solver.solve should be implemented by subclasses!")};var r={bodies:[]};s.prototype.solveIsland=function(t,e){this.removeAllEquations(),e.equations.length&&(this.addEquations(e.equations),r.bodies.length=0,e.getBodies(r.bodies),r.bodies.length&&this.solve(t,r))},s.prototype.sortEquations=function(){this.equationSortFunction&&this.equations.sort(this.equationSortFunction)},s.prototype.addEquation=function(t){t.enabled&&this.equations.push(t)},s.prototype.addEquations=function(t){for(var e=0,i=t.length;e!==i;e++){var s=t[e];s.enabled&&this.equations.push(s)}},s.prototype.removeEquation=function(t){var e=this.equations.indexOf(t);-1!==e&&this.equations.splice(e,1)},s.prototype.removeAllEquations=function(){this.equations.length=0},s.GS=1,s.ISLAND=2},{"../events/EventEmitter":26,"../utils/Utils":57}],48:[function(t,e,i){function s(){r.apply(this,arguments)}var n=t("../equations/ContactEquation"),r=t("./Pool");e.exports=s,(s.prototype=new r).constructor=s,s.prototype.create=function(){return new n},s.prototype.destroy=function(t){return t.bodyA=t.bodyB=null,this}},{"../equations/ContactEquation":21,"./Pool":55}],49:[function(t,e,i){function s(){r.apply(this,arguments)}var n=t("../equations/FrictionEquation"),r=t("./Pool");e.exports=s,(s.prototype=new r).constructor=s,s.prototype.create=function(){return new n},s.prototype.destroy=function(t){return t.bodyA=t.bodyB=null,this}},{"../equations/FrictionEquation":23,"./Pool":55}],50:[function(t,e,i){function s(){r.apply(this,arguments)}var n=t("../world/IslandNode"),r=t("./Pool");e.exports=s,(s.prototype=new r).constructor=s,s.prototype.create=function(){return new n},s.prototype.destroy=function(t){return t.reset(),this}},{"../world/IslandNode":60,"./Pool":55}],51:[function(t,e,i){function s(){r.apply(this,arguments)}var n=t("../world/Island"),r=t("./Pool");e.exports=s,(s.prototype=new r).constructor=s,s.prototype.create=function(){return new n},s.prototype.destroy=function(t){return t.reset(),this}},{"../world/Island":58,"./Pool":55}],52:[function(t,e,i){function s(){this.overlappingShapesLastState=new n,this.overlappingShapesCurrentState=new n,this.recordPool=new r({size:16}),this.tmpDict=new n,this.tmpArray1=[]}var n=t("./TupleDictionary"),r=(t("./OverlapKeeperRecord"),t("./OverlapKeeperRecordPool"));t("./Utils");e.exports=s,s.prototype.tick=function(){for(var t=this.overlappingShapesLastState,e=this.overlappingShapesCurrentState,i=t.keys.length;i--;){var s=t.keys[i],n=t.getByKey(s);e.getByKey(s);n&&this.recordPool.release(n)}t.reset(),t.copy(e),e.reset()},s.prototype.setOverlapping=function(t,e,i,s){this.overlappingShapesLastState;var n=this.overlappingShapesCurrentState;if(!n.get(e.id,s.id)){var r=this.recordPool.get();r.set(t,e,i,s),n.set(e.id,s.id,r)}},s.prototype.getNewOverlaps=function(t){return this.getDiff(this.overlappingShapesLastState,this.overlappingShapesCurrentState,t)},s.prototype.getEndOverlaps=function(t){return this.getDiff(this.overlappingShapesCurrentState,this.overlappingShapesLastState,t)},s.prototype.bodiesAreOverlapping=function(t,e){for(var i=this.overlappingShapesCurrentState,s=i.keys.length;s--;){var n=i.keys[s],r=i.data[n];if(r.bodyA===t&&r.bodyB===e||r.bodyA===e&&r.bodyB===t)return!0}return!1},s.prototype.getDiff=function(t,e,i){var s=t,n=e;(i=i||[]).length=0;for(var r=n.keys.length;r--;){var o=n.keys[r],a=n.data[o];if(!a)throw new Error("Key "+o+" had no data!");s.data[o]||i.push(a)}return i},s.prototype.isNewOverlap=function(t,e){var i=0|t.id,s=0|e.id,n=this.overlappingShapesLastState,r=this.overlappingShapesCurrentState;return!n.get(i,s)&&!!r.get(i,s)},s.prototype.getNewBodyOverlaps=function(t){this.tmpArray1.length=0;var e=this.getNewOverlaps(this.tmpArray1);return this.getBodyDiff(e,t)},s.prototype.getEndBodyOverlaps=function(t){this.tmpArray1.length=0;var e=this.getEndOverlaps(this.tmpArray1);return this.getBodyDiff(e,t)},s.prototype.getBodyDiff=function(t,e){e=e||[];for(var i=this.tmpDict,s=t.length;s--;){var n=t[s];i.set(0|n.bodyA.id,0|n.bodyB.id,n)}for(s=i.keys.length;s--;)(n=i.getByKey(i.keys[s]))&&e.push(n.bodyA,n.bodyB);return i.reset(),e}},{"./OverlapKeeperRecord":53,"./OverlapKeeperRecordPool":54,"./TupleDictionary":56,"./Utils":57}],53:[function(t,e,i){function s(t,e,i,s){this.shapeA=e,this.shapeB=s,this.bodyA=t,this.bodyB=i}e.exports=s,s.prototype.set=function(t,e,i,n){s.call(this,t,e,i,n)}},{}],54:[function(t,e,i){function s(){r.apply(this,arguments)}var n=t("./OverlapKeeperRecord"),r=t("./Pool");e.exports=s,(s.prototype=new r).constructor=s,s.prototype.create=function(){return new n},s.prototype.destroy=function(t){return t.bodyA=t.bodyB=t.shapeA=t.shapeB=null,this}},{"./OverlapKeeperRecord":53,"./Pool":55}],55:[function(t,e,i){function s(t){t=t||{},this.objects=[],void 0!==t.size&&this.resize(t.size)}e.exports=s,s.prototype.resize=function(t){for(var e=this.objects;e.length>t;)e.pop();for(;e.length<t;)e.push(this.create());return this},s.prototype.get=function(){var t=this.objects;return t.length?t.pop():this.create()},s.prototype.release=function(t){return this.destroy(t),this.objects.push(t),this}},{}],56:[function(t,e,i){function s(){this.data={},this.keys=[]}var n=t("./Utils");e.exports=s,s.prototype.getKey=function(t,e){return t|=0,e|=0,(0|t)==(0|e)?-1:0|((0|t)>(0|e)?t<<16|65535&e:e<<16|65535&t)},s.prototype.getByKey=function(t){return t|=0,this.data[t]},s.prototype.get=function(t,e){return this.data[this.getKey(t,e)]},s.prototype.set=function(t,e,i){if(!i)throw new Error("No data!");var s=this.getKey(t,e);return this.data[s]||this.keys.push(s),this.data[s]=i,s},s.prototype.reset=function(){for(var t=this.data,e=this.keys,i=e.length;i--;)delete t[e[i]];e.length=0},s.prototype.copy=function(t){this.reset(),n.appendArray(this.keys,t.keys);for(var e=t.keys.length;e--;){var i=t.keys[e];this.data[i]=t.data[i]}}},{"./Utils":57}],57:[function(t,e,i){function s(){}e.exports=s,s.appendArray=function(t,e){if(e.length<15e4)t.push.apply(t,e);else for(var i=0,s=e.length;i!==s;++i)t.push(e[i])},s.splice=function(t,e,i){i=i||1;for(var s=e,n=t.length-i;s<n;s++)t[s]=t[s+i];t.length=n},s.ARRAY_TYPE="undefined"!=typeof P2_ARRAY_TYPE?P2_ARRAY_TYPE:"undefined"!=typeof Float32Array?Float32Array:Array,s.extend=function(t,e){for(var i in e)t[i]=e[i]},s.defaults=function(t,e){t=t||{};for(var i in e)i in t||(t[i]=e[i]);return t}},{}],58:[function(t,e,i){function s(){this.equations=[],this.bodies=[]}var n=t("../objects/Body");e.exports=s,s.prototype.reset=function(){this.equations.length=this.bodies.length=0};var r=[];s.prototype.getBodies=function(t){var e=t||[],i=this.equations;r.length=0;for(var s=0;s!==i.length;s++){var n=i[s];-1===r.indexOf(n.bodyA.id)&&(e.push(n.bodyA),r.push(n.bodyA.id)),-1===r.indexOf(n.bodyB.id)&&(e.push(n.bodyB),r.push(n.bodyB.id))}return e},s.prototype.wantsToSleep=function(){for(var t=0;t<this.bodies.length;t++){var e=this.bodies[t];if(e.type===n.DYNAMIC&&!e.wantsToSleep)return!1}return!0},s.prototype.sleep=function(){for(var t=0;t<this.bodies.length;t++)this.bodies[t].sleep();return!0}},{"../objects/Body":31}],59:[function(t,e,i){function s(t){this.nodePool=new n({size:16}),this.islandPool=new r({size:8}),this.equations=[],this.islands=[],this.nodes=[],this.queue=[]}t("../math/vec2"),t("./Island"),t("./IslandNode");var n=t("./../utils/IslandNodePool"),r=t("./../utils/IslandPool"),o=t("../objects/Body");e.exports=s,s.getUnvisitedNode=function(t){for(var e=t.length,i=0;i!==e;i++){var s=t[i];if(!s.visited&&s.body.type===o.DYNAMIC)return s}return!1},s.prototype.visit=function(t,e,i){e.push(t.body);for(var s=t.equations.length,n=0;n!==s;n++){var r=t.equations[n];-1===i.indexOf(r)&&i.push(r)}},s.prototype.bfs=function(t,e,i){var n=this.queue;for(n.length=0,n.push(t),t.visited=!0,this.visit(t,e,i);n.length;)for(var r,a=n.pop();r=s.getUnvisitedNode(a.neighbors);)r.visited=!0,this.visit(r,e,i),r.body.type===o.DYNAMIC&&n.push(r)},s.prototype.split=function(t){for(var e=t.bodies,i=this.nodes,n=this.equations;i.length;)this.nodePool.release(i.pop());for(h=0;h!==e.length;h++){var r=this.nodePool.get();r.body=e[h],i.push(r)}for(var o=0;o!==n.length;o++){var a=n[o],h=e.indexOf(a.bodyA),l=e.indexOf(a.bodyB),c=i[h],u=i[l];c.neighbors.push(u),u.neighbors.push(c),c.equations.push(a),u.equations.push(a)}for(var d=this.islands,h=0;h<d.length;h++)this.islandPool.release(d[h]);d.length=0;for(var p;p=s.getUnvisitedNode(i);){var f=this.islandPool.get();this.bfs(p,f.bodies,f.equations),d.push(f)}return d}},{"../math/vec2":30,"../objects/Body":31,"./../utils/IslandNodePool":50,"./../utils/IslandPool":51,"./Island":58,"./IslandNode":60}],60:[function(t,e,i){function s(t){this.body=t,this.neighbors=[],this.equations=[],this.visited=!1}e.exports=s,s.prototype.reset=function(){this.equations.length=0,this.neighbors.length=0,this.visited=!1,this.body=null}},{}],61:[function(t,e,i){function s(t){u.apply(this),t=t||{},this.springs=[],this.bodies=[],this.disabledBodyCollisionPairs=[],this.solver=t.solver||new n,this.narrowphase=new y(this),this.islandManager=new b,this.gravity=r.fromValues(0,-9.78),t.gravity&&r.copy(this.gravity,t.gravity),this.frictionGravity=r.length(this.gravity)||10,this.useWorldGravityAsFrictionGravity=!0,this.useFrictionGravityOnZeroGravity=!0,this.broadphase=t.broadphase||new m,this.broadphase.setWorld(this),this.constraints=[],this.defaultMaterial=new p,this.defaultContactMaterial=new f(this.defaultMaterial,this.defaultMaterial),this.lastTimeStep=1/60,this.applySpringForces=!0,this.applyDamping=!0,this.applyGravity=!0,this.solveConstraints=!0,this.contactMaterials=[],this.time=0,this.accumulator=0,this.stepping=!1,this.bodiesToBeRemoved=[],this.islandSplit=void 0===t.islandSplit||!!t.islandSplit,this.emitImpactEvent=!0,this._constraintIdCounter=0,this._bodyIdCounter=0,this.postStepEvent={type:"postStep"},this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.addSpringEvent={type:"addSpring",spring:null},this.impactEvent={type:"impact",bodyA:null,bodyB:null,shapeA:null,shapeB:null,contactEquation:null},this.postBroadphaseEvent={type:"postBroadphase",pairs:null},this.sleepMode=s.NO_SLEEPING,this.beginContactEvent={type:"beginContact",shapeA:null,shapeB:null,bodyA:null,bodyB:null,contactEquations:[]},this.endContactEvent={type:"endContact",shapeA:null,shapeB:null,bodyA:null,bodyB:null},this.preSolveEvent={type:"preSolve",contactEquations:null,frictionEquations:null},this.overlappingShapesLastState={keys:[]},this.overlappingShapesCurrentState={keys:[]},this.overlapKeeper=new x}var n=t("../solver/GSSolver"),r=(t("../solver/Solver"),t("../collision/Ray"),t("../math/vec2")),o=t("../shapes/Circle"),a=t("../shapes/Convex"),h=(t("../shapes/Line"),t("../shapes/Plane")),l=t("../shapes/Capsule"),c=t("../shapes/Particle"),u=t("../events/EventEmitter"),d=t("../objects/Body"),p=(t("../shapes/Shape"),t("../objects/LinearSpring"),t("../material/Material")),f=t("../material/ContactMaterial"),g=(t("../constraints/DistanceConstraint"),t("../constraints/Constraint"),t("../constraints/LockConstraint"),t("../constraints/RevoluteConstraint"),t("../constraints/PrismaticConstraint"),t("../constraints/GearConstraint"),t("../../package.json"),t("../collision/Broadphase"),t("../collision/AABB")),m=t("../collision/SAPBroadphase"),y=t("../collision/Narrowphase"),v=t("../utils/Utils"),x=t("../utils/OverlapKeeper"),b=t("./IslandManager");t("../objects/RotationalSpring");e.exports=s,s.prototype=new Object(u.prototype),s.prototype.constructor=s,s.NO_SLEEPING=1,s.BODY_SLEEPING=2,s.ISLAND_SLEEPING=4,s.prototype.addConstraint=function(t){this.constraints.push(t)},s.prototype.addContactMaterial=function(t){this.contactMaterials.push(t)},s.prototype.removeContactMaterial=function(t){var e=this.contactMaterials.indexOf(t);-1!==e&&v.splice(this.contactMaterials,e,1)},s.prototype.getContactMaterial=function(t,e){for(var i=this.contactMaterials,s=0,n=i.length;s!==n;s++){var r=i[s];if(r.materialA.id===t.id&&r.materialB.id===e.id||r.materialA.id===e.id&&r.materialB.id===t.id)return r}return!1},s.prototype.removeConstraint=function(t){var e=this.constraints.indexOf(t);-1!==e&&v.splice(this.constraints,e,1)};r.create(),r.create(),r.create(),r.create(),r.create(),r.create();var _=r.create(),w=r.fromValues(0,0),T=r.fromValues(0,0);r.fromValues(0,0),r.fromValues(0,0);s.prototype.step=function(t,e,i){if(i=i||10,0===(e=e||0))this.internalStep(t),this.time+=t;else{this.accumulator+=e;for(var s=0;this.accumulator>=t&&s<i;)this.internalStep(t),this.time+=t,this.accumulator-=t,s++;for(var n=this.accumulator%t/t,o=0;o!==this.bodies.length;o++){var a=this.bodies[o];r.lerp(a.interpolatedPosition,a.previousPosition,a.position,n),a.interpolatedAngle=a.previousAngle+n*(a.angle-a.previousAngle)}}};var P=[];s.prototype.internalStep=function(t){this.stepping=!0;var e=this.springs.length,i=this.springs,n=this.bodies,o=this.gravity,a=this.solver,h=this.bodies.length,l=this.broadphase,c=this.narrowphase,u=this.constraints,p=_,f=(r.scale,r.add),g=(r.rotate,this.islandManager);if(this.overlapKeeper.tick(),this.lastTimeStep=t,this.useWorldGravityAsFrictionGravity){var m=r.length(this.gravity);0===m&&this.useFrictionGravityOnZeroGravity||(this.frictionGravity=m)}if(this.applyGravity)for(T=0;T!==h;T++){var y=(x=n[T]).force;x.type===d.DYNAMIC&&x.sleepState!==d.SLEEPING&&(r.scale(p,o,x.mass*x.gravityScale),f(y,y,p))}if(this.applySpringForces)for(T=0;T!==e;T++)i[T].applyForce();if(this.applyDamping)for(T=0;T!==h;T++){var x=n[T];x.type===d.DYNAMIC&&x.applyDamping(t)}for(var b=l.getCollisionPairs(this),w=this.disabledBodyCollisionPairs,T=w.length-2;T>=0;T-=2)for(S=b.length-2;S>=0;S-=2)(w[T]===b[S]&&w[T+1]===b[S+1]||w[T+1]===b[S]&&w[T]===b[S+1])&&b.splice(S,2);H=u.length;for(T=0;T!==H;T++){var C=u[T];if(!C.collideConnected)for(var S=b.length-2;S>=0;S-=2)(C.bodyA===b[S]&&C.bodyB===b[S+1]||C.bodyB===b[S]&&C.bodyA===b[S+1])&&b.splice(S,2)}this.postBroadphaseEvent.pairs=b,this.emit(this.postBroadphaseEvent),this.postBroadphaseEvent.pairs=null,c.reset(this);for(var T=0,A=b.length;T!==A;T+=2)for(var E=b[T],M=b[T+1],R=0,L=E.shapes.length;R!==L;R++)for(var B=E.shapes[R],I=B.position,O=B.angle,k=0,F=M.shapes.length;k!==F;k++){var D=M.shapes[k],U=D.position,G=D.angle,N=this.defaultContactMaterial;if(B.material&&D.material){var X=this.getContactMaterial(B.material,D.material);X&&(N=X)}this.runNarrowphase(c,E,B,I,O,M,D,U,G,N,this.frictionGravity)}for(T=0;T!==h;T++)(q=n[T])._wakeUpAfterNarrowphase&&(q.wakeUp(),q._wakeUpAfterNarrowphase=!1);if(this.has("endContact")){this.overlapKeeper.getEndOverlaps(P);for(var W=this.endContactEvent,k=P.length;k--;){var j=P[k];W.shapeA=j.shapeA,W.shapeB=j.shapeB,W.bodyA=j.bodyA,W.bodyB=j.bodyB,this.emit(W)}P.length=0}var V=this.preSolveEvent;V.contactEquations=c.contactEquations,V.frictionEquations=c.frictionEquations,this.emit(V),V.contactEquations=V.frictionEquations=null;var H=u.length;for(T=0;T!==H;T++)u[T].update();if(c.contactEquations.length||c.frictionEquations.length||H)if(this.islandSplit){for(g.equations.length=0,v.appendArray(g.equations,c.contactEquations),v.appendArray(g.equations,c.frictionEquations),T=0;T!==H;T++)v.appendArray(g.equations,u[T].equations);g.split(this);for(T=0;T!==g.islands.length;T++)(K=g.islands[T]).equations.length&&a.solveIsland(t,K)}else{for(a.addEquations(c.contactEquations),a.addEquations(c.frictionEquations),T=0;T!==H;T++)a.addEquations(u[T].equations);this.solveConstraints&&a.solve(t,this),a.removeAllEquations()}for(T=0;T!==h;T++){var q=n[T];q.integrate(t)}for(T=0;T!==h;T++)n[T].setZeroForce();if(this.emitImpactEvent&&this.has("impact"))for(var Y=this.impactEvent,T=0;T!==c.contactEquations.length;T++){var z=c.contactEquations[T];z.firstImpact&&(Y.bodyA=z.bodyA,Y.bodyB=z.bodyB,Y.shapeA=z.shapeA,Y.shapeB=z.shapeB,Y.contactEquation=z,this.emit(Y))}if(this.sleepMode===s.BODY_SLEEPING)for(T=0;T!==h;T++)n[T].sleepTick(this.time,!1,t);else if(this.sleepMode===s.ISLAND_SLEEPING&&this.islandSplit){for(T=0;T!==h;T++)n[T].sleepTick(this.time,!0,t);for(T=0;T<this.islandManager.islands.length;T++){var K=this.islandManager.islands[T];K.wantsToSleep()&&K.sleep()}}this.stepping=!1;for(var J=this.bodiesToBeRemoved,T=0;T!==J.length;T++)this.removeBody(J[T]);J.length=0,this.emit(this.postStepEvent)},s.prototype.runNarrowphase=function(t,e,i,s,n,o,a,h,l,c,u){if(0!=(i.collisionGroup&a.collisionMask)&&0!=(a.collisionGroup&i.collisionMask)){r.rotate(w,s,e.angle),r.rotate(T,h,o.angle),r.add(w,w,e.position),r.add(T,T,o.position);var p=n+e.angle,f=l+o.angle;t.enableFriction=c.friction>0,t.frictionCoefficient=c.friction;var g;g=e.type===d.STATIC||e.type===d.KINEMATIC?o.mass:o.type===d.STATIC||o.type===d.KINEMATIC?e.mass:e.mass*o.mass/(e.mass+o.mass),t.slipForce=c.friction*u*g,t.restitution=c.restitution,t.surfaceVelocity=c.surfaceVelocity,t.frictionStiffness=c.frictionStiffness,t.frictionRelaxation=c.frictionRelaxation,t.stiffness=c.stiffness,t.relaxation=c.relaxation,t.contactSkinSize=c.contactSkinSize,t.enabledEquations=e.collisionResponse&&o.collisionResponse&&i.collisionResponse&&a.collisionResponse;var m=t[i.type|a.type],y=0;if(m){var v=i.sensor||a.sensor,x=t.frictionEquations.length;y=i.type<a.type?m.call(t,e,i,w,p,o,a,T,f,v):m.call(t,o,a,T,f,e,i,w,p,v);var b=t.frictionEquations.length-x;if(y){if(e.allowSleep&&e.type===d.DYNAMIC&&e.sleepState===d.SLEEPING&&o.sleepState===d.AWAKE&&o.type!==d.STATIC&&r.squaredLength(o.velocity)+Math.pow(o.angularVelocity,2)>=2*Math.pow(o.sleepSpeedLimit,2)&&(e._wakeUpAfterNarrowphase=!0),o.allowSleep&&o.type===d.DYNAMIC&&o.sleepState===d.SLEEPING&&e.sleepState===d.AWAKE&&e.type!==d.STATIC&&r.squaredLength(e.velocity)+Math.pow(e.angularVelocity,2)>=2*Math.pow(e.sleepSpeedLimit,2)&&(o._wakeUpAfterNarrowphase=!0),this.overlapKeeper.setOverlapping(e,i,o,a),this.has("beginContact")&&this.overlapKeeper.isNewOverlap(i,a)){var _=this.beginContactEvent;if(_.shapeA=i,_.shapeB=a,_.bodyA=e,_.bodyB=o,_.contactEquations.length=0,"number"==typeof y)for(P=t.contactEquations.length-y;P<t.contactEquations.length;P++)_.contactEquations.push(t.contactEquations[P]);this.emit(_)}if("number"==typeof y&&b>1)for(var P=t.frictionEquations.length-b;P<t.frictionEquations.length;P++){var C=t.frictionEquations[P];C.setSlipForce(C.getSlipForce()/b)}}}}},s.prototype.addSpring=function(t){this.springs.push(t);var e=this.addSpringEvent;e.spring=t,this.emit(e),e.spring=null},s.prototype.removeSpring=function(t){var e=this.springs.indexOf(t);-1!==e&&v.splice(this.springs,e,1)},s.prototype.addBody=function(t){if(-1===this.bodies.indexOf(t)){this.bodies.push(t),t.world=this;var e=this.addBodyEvent;e.body=t,this.emit(e),e.body=null}},s.prototype.removeBody=function(t){if(this.stepping)this.bodiesToBeRemoved.push(t);else{t.world=null;var e=this.bodies.indexOf(t);-1!==e&&(v.splice(this.bodies,e,1),this.removeBodyEvent.body=t,t.resetConstraintVelocity(),this.emit(this.removeBodyEvent),this.removeBodyEvent.body=null)}},s.prototype.getBodyById=function(t){for(var e=this.bodies,i=0;i<e.length;i++){var s=e[i];if(s.id===t)return s}return!1},s.prototype.disableBodyCollision=function(t,e){this.disabledBodyCollisionPairs.push(t,e)},s.prototype.enableBodyCollision=function(t,e){for(var i=this.disabledBodyCollisionPairs,s=0;s<i.length;s+=2)if(i[s]===t&&i[s+1]===e||i[s+1]===t&&i[s]===e)return void i.splice(s,2)},s.prototype.clear=function(){this.time=0,this.solver&&this.solver.equations.length&&this.solver.removeAllEquations();for(var t=this.constraints,e=t.length-1;e>=0;e--)this.removeConstraint(t[e]);for(var i=this.bodies,e=i.length-1;e>=0;e--)this.removeBody(i[e]);for(var n=this.springs,e=n.length-1;e>=0;e--)this.removeSpring(n[e]);for(var r=this.contactMaterials,e=r.length-1;e>=0;e--)this.removeContactMaterial(r[e]);s.apply(this)};var C=r.create(),S=(r.fromValues(0,0),r.fromValues(0,0));s.prototype.hitTest=function(t,e,i){i=i||0;var s=new d({position:t}),n=new c,u=t,p=C,f=S;s.addShape(n);for(var g=this.narrowphase,m=[],y=0,v=e.length;y!==v;y++)for(var x=e[y],b=0,_=x.shapes.length;b!==_;b++){var w=x.shapes[b];r.rotate(p,w.position,x.angle),r.add(p,p,x.position);var T=w.angle+x.angle;(w instanceof o&&g.circleParticle(x,w,p,T,s,n,u,0,!0)||w instanceof a&&g.particleConvex(s,n,u,0,x,w,p,T,!0)||w instanceof h&&g.particlePlane(s,n,u,0,x,w,p,T,!0)||w instanceof l&&g.particleCapsule(s,n,u,0,x,w,p,T,!0)||w instanceof c&&r.squaredLength(r.sub(f,p,t))<i*i)&&m.push(x)}return m},s.prototype.setGlobalStiffness=function(t){for(var e=this.constraints,i=0;i!==e.length;i++)for(var s=e[i],n=0;n!==s.equations.length;n++){var r=s.equations[n];r.stiffness=t,r.needsUpdate=!0}for(var o=this.contactMaterials,i=0;i!==o.length;i++)(s=o[i]).stiffness=s.frictionStiffness=t;(s=this.defaultContactMaterial).stiffness=s.frictionStiffness=t},s.prototype.setGlobalRelaxation=function(t){for(n=0;n!==this.constraints.length;n++)for(var e=this.constraints[n],i=0;i!==e.equations.length;i++){var s=e.equations[i];s.relaxation=t,s.needsUpdate=!0}for(var n=0;n!==this.contactMaterials.length;n++)(e=this.contactMaterials[n]).relaxation=e.frictionRelaxation=t;(e=this.defaultContactMaterial).relaxation=e.frictionRelaxation=t};var A=new g,E=[];s.prototype.raycast=function(t,e){return e.getAABB(A),this.broadphase.aabbQuery(this,A,E),e.intersectBodies(t,E),E.length=0,t.hasHit()}},{"../../package.json":6,"../collision/AABB":7,"../collision/Broadphase":8,"../collision/Narrowphase":10,"../collision/Ray":11,"../collision/SAPBroadphase":13,"../constraints/Constraint":14,"../constraints/DistanceConstraint":15,"../constraints/GearConstraint":16,"../constraints/LockConstraint":17,"../constraints/PrismaticConstraint":18,"../constraints/RevoluteConstraint":19,"../events/EventEmitter":26,"../material/ContactMaterial":27,"../material/Material":28,"../math/vec2":30,"../objects/Body":31,"../objects/LinearSpring":32,"../objects/RotationalSpring":33,"../shapes/Capsule":38,"../shapes/Circle":39,"../shapes/Convex":40,"../shapes/Line":42,"../shapes/Particle":43,"../shapes/Plane":44,"../shapes/Shape":45,"../solver/GSSolver":46,"../solver/Solver":47,"../utils/OverlapKeeper":52,"../utils/Utils":57,"./IslandManager":59}]},{},[36])(36)}),function(){function t(t,e,i,n){var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n===s.scaleModes.LINEAR?t.LINEAR:t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n===s.scaleModes.LINEAR?t.LINEAR:t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,i,0,t.RGBA,t.UNSIGNED_BYTE,null),r}function e(e,i,s,r,o){var a=e.createFramebuffer(),h=e.createRenderbuffer(),l=null,c=0;return e.activeTexture(e.TEXTURE0+o),e.bindFramebuffer(e.FRAMEBUFFER,a),e.bindRenderbuffer(e.RENDERBUFFER,h),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,this.renderBuffer),l=t(e,i,s,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,l,0),(c=e.checkFramebufferStatus(e.FRAMEBUFFER))!==e.FRAMEBUFFER_COMPLETE&&console.error("Incomplete GL framebuffer. ",n[c]),a.width=i,a.height=s,a.targetTexture=l,a.renderBuffer=h,a}var i=this,s=s||{};s.DisplayObject=function(){this.position=new s.Point(0,0),this.scale=new s.Point(1,1),this.pivot=new s.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.renderable=!1,this.parent=null,this.worldAlpha=1,this.worldTransform=new Phaser.Matrix,this.worldPosition=new s.Point(0,0),this.worldScale=new s.Point(1,1),this.worldRotation=0,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new s.Rectangle(0,0,0,0),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cacheIsDirty=!1},s.DisplayObject.prototype={constructor:s.DisplayObject,destroy:function(){if(this.children){for(var t=this.children.length;t--;)this.children[t].destroy();this.children=[]}this.hitArea=null,this.parent=null,this.worldTransform=null,this.filterArea=null,this.renderable=!1,this._bounds=null,this._currentBounds=null,this._mask=null,this._destroyCachedSprite()},updateTransform:function(t){if(!t&&!this.parent&&!this.game)return this;var e=this.parent;t?e=t:this.parent||(e=this.game.world);var i,s,n,r,o,a,h=e.worldTransform,l=this.worldTransform;this.rotation%Phaser.Math.PI2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),i=this._cr*this.scale.x,s=this._sr*this.scale.x,n=-this._sr*this.scale.y,r=this._cr*this.scale.y,o=this.position.x,a=this.position.y,(this.pivot.x||this.pivot.y)&&(o-=this.pivot.x*i+this.pivot.y*n,a-=this.pivot.x*s+this.pivot.y*r),l.a=i*h.a+s*h.c,l.b=i*h.b+s*h.d,l.c=n*h.a+r*h.c,l.d=n*h.b+r*h.d,l.tx=o*h.a+a*h.c+h.tx,l.ty=o*h.b+a*h.d+h.ty):(i=this.scale.x,s=0,n=0,r=this.scale.y,o=this.position.x-this.pivot.x*i,a=this.position.y-this.pivot.y*r,l.a=i*h.a,l.b=i*h.b,l.c=r*h.c,l.d=r*h.d,l.tx=o*h.a+a*h.c+h.tx,l.ty=o*h.b+a*h.d+h.ty),i=l.a,s=l.b,n=l.c;var c=i*(r=l.d)-s*n;if(i||s){var u=Math.sqrt(i*i+s*s);this.worldRotation=s>0?Math.acos(i/u):-Math.acos(i/u),this.worldScale.x=u,this.worldScale.y=c/u}else if(n||r){var d=Math.sqrt(n*n+r*r);this.worldRotation=Phaser.Math.HALF_PI-(r>0?Math.acos(-n/d):-Math.acos(n/d)),this.worldScale.x=c/d,this.worldScale.y=d}else this.worldScale.x=0,this.worldScale.y=0;return this.worldAlpha=this.alpha*e.worldAlpha,this.worldPosition.x=l.tx,this.worldPosition.y=l.ty,this._currentBounds=null,this.transformCallback&&this.transformCallback.call(this.transformCallbackContext,l,h),this},preUpdate:function(){},generateTexture:function(t,e,i){var n=this.getLocalBounds(),r=new Phaser.RenderTexture(this.game,0|n.width,0|n.height,i,e,t);return s.DisplayObject._tempMatrix.tx=-n.x,s.DisplayObject._tempMatrix.ty=-n.y,r.render(this,s.DisplayObject._tempMatrix),r},updateCache:function(){return this._generateCachedSprite(),this},toGlobal:function(t){return this.updateTransform(),this.worldTransform.apply(t)},toLocal:function(t,e){return e&&(t=e.toGlobal(t)),this.updateTransform(),this.worldTransform.applyInverse(t)},_renderCachedSprite:function(t){this._cachedSprite.worldAlpha=this.worldAlpha,t.gl?s.Sprite.prototype._renderWebGL.call(this._cachedSprite,t):s.Sprite.prototype._renderCanvas.call(this._cachedSprite,t)},_generateCachedSprite:function(){this._cacheAsBitmap=!1;var t=this.getLocalBounds();if(t.width=Math.max(1,Math.ceil(t.width)),t.height=Math.max(1,Math.ceil(t.height)),this.updateTransform(),this._cachedSprite)this._cachedSprite.texture.resize(t.width,t.height);else{var e=0;this.texture&&this.texture.baseTexture&&s._enableMultiTextureToggle&&(e=this.texture.baseTexture.textureIndex);var i=new Phaser.RenderTexture(this.game,t.width,t.height,void 0,void 0,void 0,void 0,e);this._cachedSprite=new s.Sprite(i),this._cachedSprite.worldTransform=this.worldTransform}var n=this._filters;this._filters=null,this._cachedSprite.filters=n,s.DisplayObject._tempMatrix.tx=-t.x,s.DisplayObject._tempMatrix.ty=-t.y,this._cachedSprite.texture.render(this,s.DisplayObject._tempMatrix,!0),this._cachedSprite.anchor.x=-t.x/t.width,this._cachedSprite.anchor.y=-t.y/t.height,this._filters=n,this._cacheAsBitmap=!0},_destroyCachedSprite:function(){this._cachedSprite&&(this._cachedSprite.texture.destroy(!0),this._cachedSprite=null)}},s.DisplayObject.prototype.displayObjectUpdateTransform=s.DisplayObject.prototype.updateTransform,Object.defineProperties(s.DisplayObject.prototype,{x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},worldVisible:{get:function(){if(this.visible){var t=this.parent;if(!t)return this.visible;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}return!1}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.isMask=!1),this._mask=t,t&&(this._mask.isMask=!0)}},filters:{get:function(){return this._filters},set:function(t){if(Array.isArray(t)){for(var e=[],i=0;i<t.length;i++)for(var n=t[i].passes,r=0;r<n.length;r++)e.push(n[r]);this._filterBlock={target:this,filterPasses:e}}this._filters=t,this.blendMode&&this.blendMode===s.blendModes.MULTIPLY&&(this.blendMode=s.blendModes.NORMAL)}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){this._cacheAsBitmap!==t&&(t?this._generateCachedSprite():this._destroyCachedSprite(),this._cacheAsBitmap=t)}}}),s.DisplayObjectContainer=function(){s.DisplayObject.call(this),this.children=[],this.ignoreChildInput=!1},s.DisplayObjectContainer.prototype=Object.create(s.DisplayObject.prototype),s.DisplayObjectContainer.prototype.constructor=s.DisplayObjectContainer,s.DisplayObjectContainer.prototype.addChild=function(t){return this.addChildAt(t,this.children.length)},s.DisplayObjectContainer.prototype.addChildAt=function(t,e){if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},s.DisplayObjectContainer.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),s=this.getChildIndex(e);if(i<0||s<0)throw new Error("swapChildren: Both the supplied DisplayObjects must be a child of the caller.");this.children[i]=e,this.children[s]=t}},s.DisplayObjectContainer.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},s.DisplayObjectContainer.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The supplied index is out of bounds");var i=this.getChildIndex(t);this.children.splice(i,1),this.children.splice(e,0,t)},s.DisplayObjectContainer.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject must be a child of the caller");return this.children[t]},s.DisplayObjectContainer.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1!==e)return this.removeChildAt(e)},s.DisplayObjectContainer.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e&&(e.parent=void 0,this.children.splice(t,1)),e},s.DisplayObjectContainer.prototype.bringChildToTop=function(t){if(t.parent===this)return this.setChildIndex(t,this.children.length-1)},s.DisplayObjectContainer.prototype.sendChildToBack=function(t){if(t.parent===this)return this.setChildIndex(t,0)},s.DisplayObjectContainer.prototype.removeChildren=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.children.length);var i=e-t;if(i>0&&i<=e){for(var s=this.children.splice(t,i),n=0;n<s.length;n++)s[n].parent=void 0;return s}if(0===i&&0===this.children.length)return[];throw new Error("removeChildren: Range Error, numeric values are outside the acceptable range")},s.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible&&(this.displayObjectUpdateTransform(),!this._cacheAsBitmap))for(var t=0;t<this.children.length;t++)this.children[t].updateTransform()},s.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform=s.DisplayObjectContainer.prototype.updateTransform,s.DisplayObjectContainer.prototype.getBounds=function(t){var e=t&&t instanceof s.DisplayObject,i=!0;e?i=t instanceof s.DisplayObjectContainer&&t.contains(this):t=this;var n;if(e){var r=t.worldTransform;for(t.worldTransform=Phaser.identityMatrix,n=0;n<t.children.length;n++)t.children[n].updateTransform()}var o,a,h,l=1/0,c=1/0,u=-1/0,d=-1/0,p=!1;for(n=0;n<this.children.length;n++)this.children[n].visible&&(p=!0,l=l<(o=this.children[n].getBounds()).x?l:o.x,c=c<o.y?c:o.y,a=o.width+o.x,h=o.height+o.y,u=u>a?u:a,d=d>h?d:h);var f=this._bounds;if(!p){var g=(f=new s.Rectangle).x,m=f.width+f.x,y=f.y,v=f.height+f.y,x=this.worldTransform,b=x.a,_=x.b,w=x.c,T=x.d,P=x.tx,C=x.ty,S=b*m+w*v+P,A=T*v+_*m+C,E=b*g+w*v+P,M=T*v+_*g+C,R=b*g+w*y+P,L=T*y+_*g+C,B=b*m+w*y+P,I=T*y+_*m+C;u=S,d=A,c=A,l=B<(l=R<(l=E<(l=S)?E:l)?R:l)?B:l,c=I<(c=L<(c=M<c?M:c)?L:c)?I:c,u=B>(u=R>(u=E>u?E:u)?R:u)?B:u,d=I>(d=L>(d=M>d?M:d)?L:d)?I:d}if(f.x=l,f.y=c,f.width=u-l,f.height=d-c,e)for(t.worldTransform=r,n=0;n<t.children.length;n++)t.children[n].updateTransform();if(!i){var O=t.getBounds();f.x-=O.x,f.y-=O.y}return f},s.DisplayObjectContainer.prototype.getLocalBounds=function(){return this.getBounds(this)},s.DisplayObjectContainer.prototype.contains=function(t){return!!t&&(t===this||this.contains(t.parent))},s.DisplayObjectContainer.prototype._renderWebGL=function(t){if(this.visible&&!(this.alpha<=0))if(this._cacheAsBitmap)this._renderCachedSprite(t);else{var e;if(this._mask||this._filters){for(this._filters&&(t.spriteBatch.flush(),t.filterManager.pushFilter(this._filterBlock)),this._mask&&(t.spriteBatch.stop(),t.maskManager.pushMask(this.mask,t),t.spriteBatch.start()),e=0;e<this.children.length;e++)this.children[e]._renderWebGL(t);t.spriteBatch.stop(),this._mask&&t.maskManager.popMask(this._mask,t),this._filters&&t.filterManager.popFilter(),t.spriteBatch.start()}else for(e=0;e<this.children.length;e++)this.children[e]._renderWebGL(t)}},s.DisplayObjectContainer.prototype._renderCanvas=function(t){if(!1!==this.visible&&0!==this.alpha)if(this._cacheAsBitmap)this._renderCachedSprite(t);else{this._mask&&t.maskManager.pushMask(this._mask,t);for(var e=0;e<this.children.length;e++)this.children[e]._renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},Object.defineProperty(s.DisplayObjectContainer.prototype,"width",{get:function(){return this.getLocalBounds().width*this.scale.x},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t}}),Object.defineProperty(s.DisplayObjectContainer.prototype,"height",{get:function(){return this.getLocalBounds().height*this.scale.y},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t}}),s.Sprite=function(t){s.DisplayObjectContainer.call(this),this.anchor=new s.Point(s.Sprite.defaultAnchor.x,s.Sprite.defaultAnchor.y),this.texture=t||s.Texture.emptyTexture,this._width=0,this._height=0,this.tint=16777215,this.cachedTint=-1,this.tintedTexture=null,this.blendMode=s.blendModes.NORMAL,this.shader=null,this.exists=!0,this.texture.baseTexture.hasLoaded&&this.onTextureUpdate(),this.renderable=!0},s.Sprite.defaultAnchor={x:0,y:0},s.Sprite.prototype=Object.create(s.DisplayObjectContainer.prototype),s.Sprite.prototype.constructor=s.Sprite,Object.defineProperty(s.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(t){this.scale.x=t/this.texture.frame.width,this._width=t}}),Object.defineProperty(s.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(t){this.scale.y=t/this.texture.frame.height,this._height=t}}),s.Sprite.prototype.setTexture=function(t,e){e&&this.texture.baseTexture.destroy(),this.texture.baseTexture.skipRender=!1,this.texture=t,this.texture.valid=!0,this.cachedTint=-1},s.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height)},s.Sprite.prototype.getBounds=function(t){var e=this.texture.frame.width,i=this.texture.frame.height,s=e*(1-this.anchor.x),n=e*-this.anchor.x,r=i*(1-this.anchor.y),o=i*-this.anchor.y,a=t||this.worldTransform,h=a.a,l=a.b,c=a.c,u=a.d,d=a.tx,p=a.ty,f=-1/0,g=-1/0,m=1/0,y=1/0;if(0===l&&0===c){if(h<0){h*=-1;v=s;s=-n,n=-v}if(u<0){u*=-1;var v=r;r=-o,o=-v}m=h*n+d,f=h*s+d,y=u*o+p,g=u*r+p}else{var x=h*n+c*o+d,b=u*o+l*n+p,_=h*s+c*o+d,w=u*o+l*s+p,T=h*s+c*r+d,P=u*r+l*s+p,C=h*n+c*r+d,S=u*r+l*n+p;m=C<(m=T<(m=_<(m=x<m?x:m)?_:m)?T:m)?C:m,y=S<(y=P<(y=w<(y=b<y?b:y)?w:y)?P:y)?S:y,f=C>(f=T>(f=_>(f=x>f?x:f)?_:f)?T:f)?C:f,g=S>(g=P>(g=w>(g=b>g?b:g)?w:g)?P:g)?S:g}var A=this._bounds;return A.x=m,A.width=f-m,A.y=y,A.height=g-y,this._currentBounds=A,A},s.Sprite.prototype.getLocalBounds=function(){var t=this.worldTransform;this.worldTransform=Phaser.identityMatrix;for(var e=0;e<this.children.length;e++)this.children[e].updateTransform();var i=this.getBounds();for(this.worldTransform=t,e=0;e<this.children.length;e++)this.children[e].updateTransform();return i},s.Sprite.prototype._renderWebGL=function(t,e){if(this.visible&&!(this.alpha<=0)&&this.renderable){var i=this.worldTransform;if(e&&(i=e),this._mask||this._filters){var s=t.spriteBatch;this._filters&&(s.flush(),t.filterManager.pushFilter(this._filterBlock)),this._mask&&(s.stop(),t.maskManager.pushMask(this.mask,t),s.start()),s.render(this);for(n=0;n<this.children.length;n++)this.children[n]._renderWebGL(t);s.stop(),this._mask&&t.maskManager.popMask(this._mask,t),this._filters&&t.filterManager.popFilter(),s.start()}else{t.spriteBatch.render(this);for(var n=0;n<this.children.length;n++)this.children[n]._renderWebGL(t,i)}}},s.Sprite.prototype._renderCanvas=function(t,e){if(!(!this.visible||0===this.alpha||!this.renderable||this.texture.crop.width<1||this.texture.crop.height<1)){var i=this.worldTransform;if(e&&(i=e),this.blendMode!==t.currentBlendMode&&(t.currentBlendMode=this.blendMode,t.context.globalCompositeOperation=s.blendModesCanvas[t.currentBlendMode]),this._mask&&t.maskManager.pushMask(this._mask,t),this.texture.valid){var n=this.texture.baseTexture.resolution/t.resolution;t.context.globalAlpha=this.worldAlpha,t.smoothProperty&&t.scaleMode!==this.texture.baseTexture.scaleMode&&(t.scaleMode=this.texture.baseTexture.scaleMode,t.context[t.smoothProperty]=t.scaleMode===s.scaleModes.LINEAR);var r=this.texture.trim?this.texture.trim.x-this.anchor.x*this.texture.trim.width:this.anchor.x*-this.texture.frame.width,o=this.texture.trim?this.texture.trim.y-this.anchor.y*this.texture.trim.height:this.anchor.y*-this.texture.frame.height,a=i.tx*t.resolution+t.shakeX,h=i.ty*t.resolution+t.shakeY,l=this.texture.crop.width,c=this.texture.crop.height;if(this.texture.rotated){var u=i.a,d=i.b,p=i.c,f=i.d,g=l;a=i.c*c+a,h=i.d*c+h,i.a=6.123233995736766e-17*u-p,i.b=6.123233995736766e-17*d-f,i.c=u+6.123233995736766e-17*p,i.d=d+6.123233995736766e-17*f,l=c,c=g}if(t.roundPixels?(t.context.setTransform(i.a,i.b,i.c,i.d,0|a,0|h),r|=0,o|=0):t.context.setTransform(i.a,i.b,i.c,i.d,a,h),r/=n,o/=n,l|=0,c|=0,l&&c){if(16777215!==this.tint)(this.texture.requiresReTint||this.cachedTint!==this.tint)&&(this.tintedTexture=s.CanvasTinter.getTintedTexture(this,this.tint),this.cachedTint=this.tint,this.texture.requiresReTint=!1),t.context.drawImage(this.tintedTexture,0,0,l,c,r,o,l/n,c/n);else{var m=this.texture.crop.x,y=this.texture.crop.y;t.context.drawImage(this.texture.baseTexture.source,m,y,l,c,r,o,l/n,c/n)}for(v=0;v<this.children.length;v++)this.children[v]._renderCanvas(t);this._mask&&t.maskManager.popMask(t)}}else{for(var v=0;v<this.children.length;v++)this.children[v]._renderCanvas(t);this._mask&&t.maskManager.popMask(t)}}},s.initDefaultShaders=function(){},s.CompileVertexShader=function(t,e){return s._CompileShader(t,e,t.VERTEX_SHADER)},s.CompileFragmentShader=function(t,e){return s._CompileShader(t,e,t.FRAGMENT_SHADER)},s._CompileShader=function(t,e,i){var s=e;Array.isArray(e)&&(s=e.join("\n"));var n=t.createShader(i);return t.shaderSource(n,s),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)?n:(window.console.log(t.getShaderInfoLog(n)),null)},s.compileProgram=function(t,e,i){var n=s.CompileFragmentShader(t,i),r=s.CompileVertexShader(t,e),o=t.createProgram();return t.attachShader(o,r),t.attachShader(o,n),t.linkProgram(o),t.getProgramParameter(o,t.LINK_STATUS)||(window.console.log(t.getProgramInfoLog(o)),window.console.log("Could not initialise shaders")),o},s.PixiShader=function(t){this._UID=Phaser._UID++,this.gl=t,this.program=null,this.fragmentSrc=null,this.textureCount=0,this.firstRun=!0,this.dirty=!0,this.attributes=[],this.init()},s.PixiShader.prototype.constructor=s.PixiShader,s.PixiShader.prototype.initMultitexShader=function(){var t=this.gl;this.MAX_TEXTURES=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);for(var e="\tif (vTextureIndex == 0.0) { gl_FragColor = texture2D(uSamplerArray[0], vTextureCoord) * vColor;return;}\n",i=1;i<this.MAX_TEXTURES;++i)e+="\tif (vTextureIndex == "+i+".0) {gl_FragColor = texture2D(uSamplerArray["+i+"], vTextureCoord) * vColor;return;}\n";this.fragmentSrc=["// PixiShader Fragment Shader.","precision lowp float;","bool isnan( float val ) { return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true; }","varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureIndex;","uniform sampler2D uSamplerArray["+this.MAX_TEXTURES+"];","const vec4 BLUE = vec4(1.0, 0.0, 1.0, 1.0);","const vec4 RED = vec4(1.0, 0.0, 0.0, 1.0);","void main(void) {",e," if(vTextureIndex >= "+this.MAX_TEXTURES+".0) { gl_FragColor = BLUE;return;}"," if(isnan(vTextureIndex)) { gl_FragColor = RED;return;}","}"];var n=s.compileProgram(t,this.vertexSrc||s.PixiShader.defaultVertexSrc,this.fragmentSrc);t.useProgram(n),this.uSamplerArray=t.getUniformLocation(n,"uSamplerArray[0]"),this.projectionVector=t.getUniformLocation(n,"projectionVector"),this.offsetVector=t.getUniformLocation(n,"offsetVector"),this.dimensions=t.getUniformLocation(n,"dimensions"),this.aVertexPosition=t.getAttribLocation(n,"aVertexPosition"),this.aTextureCoord=t.getAttribLocation(n,"aTextureCoord"),this.colorAttribute=t.getAttribLocation(n,"aColor"),this.aTextureIndex=t.getAttribLocation(n,"aTextureIndex");var r=[],o=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,o),t.texImage2D(t.TEXTURE_2D,0,t.RGB,1,1,0,t.RGB,t.UNSIGNED_BYTE,null);for(var a=0;a<this.MAX_TEXTURES;++a)t.activeTexture(t.TEXTURE0+a),t.bindTexture(t.TEXTURE_2D,o),r.push(a);t.activeTexture(t.TEXTURE0),t.uniform1iv(this.uSamplerArray,r),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aTextureCoord,this.colorAttribute,this.aTextureIndex];for(var h in this.uniforms)this.uniforms[h].uniformLocation=t.getUniformLocation(n,h);this.initUniforms(),this.program=n},s.PixiShader.prototype.initDefaultShader=function(){null===this.fragmentSrc&&(this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureIndex;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"]);var t=this.gl,e=s.compileProgram(t,this.vertexSrc||s.PixiShader.defaultVertexSrc,this.fragmentSrc);t.useProgram(e),this.uSampler=t.getUniformLocation(e,"uSampler"),this.projectionVector=t.getUniformLocation(e,"projectionVector"),this.offsetVector=t.getUniformLocation(e,"offsetVector"),this.dimensions=t.getUniformLocation(e,"dimensions"),this.aVertexPosition=t.getAttribLocation(e,"aVertexPosition"),this.aTextureCoord=t.getAttribLocation(e,"aTextureCoord"),this.colorAttribute=t.getAttribLocation(e,"aColor"),this.aTextureIndex=t.getAttribLocation(e,"aTextureIndex"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aTextureCoord,this.colorAttribute,this.aTextureIndex];for(var i in this.uniforms)this.uniforms[i].uniformLocation=t.getUniformLocation(e,i);this.initUniforms(),this.program=e},s.PixiShader.prototype.init=function(t){s._enableMultiTextureToggle&&!t?this.initMultitexShader():this.initDefaultShader()},s.PixiShader.prototype.initUniforms=function(){this.textureCount=1;var t,e=this.gl;for(var i in this.uniforms){var s=(t=this.uniforms[i]).type;"sampler2D"===s?(t._init=!1,null!==t.value&&this.initSampler2D(t)):"mat2"===s||"mat3"===s||"mat4"===s?(t.glMatrix=!0,t.glValueLength=1,"mat2"===s?t.glFunc=e.uniformMatrix2fv:"mat3"===s?t.glFunc=e.uniformMatrix3fv:"mat4"===s&&(t.glFunc=e.uniformMatrix4fv)):(t.glFunc=e["uniform"+s],t.glValueLength="2f"===s||"2i"===s?2:"3f"===s||"3i"===s?3:"4f"===s||"4i"===s?4:1)}},s.PixiShader.prototype.initSampler2D=function(t){if(t.value&&t.value.baseTexture&&t.value.baseTexture.hasLoaded){var e=this.gl;if(e.activeTexture(e.TEXTURE0+this.textureCount),e.bindTexture(e.TEXTURE_2D,t.value.baseTexture._glTextures[e.id]),t.textureData){var i=t.textureData,s=i.magFilter?i.magFilter:e.LINEAR,n=i.minFilter?i.minFilter:e.LINEAR,r=i.wrapS?i.wrapS:e.CLAMP_TO_EDGE,o=i.wrapT?i.wrapT:e.CLAMP_TO_EDGE,a=i.luminance?e.LUMINANCE:e.RGBA;if(i.repeat&&(r=e.REPEAT,o=e.REPEAT),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!!i.flipY),i.width){var h=i.width?i.width:512,l=i.height?i.height:2,c=i.border?i.border:0;e.texImage2D(e.TEXTURE_2D,0,a,h,l,c,a,e.UNSIGNED_BYTE,null)}else e.texImage2D(e.TEXTURE_2D,0,a,e.RGBA,e.UNSIGNED_BYTE,t.value.baseTexture.source);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,s),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,o)}e.uniform1i(t.uniformLocation,this.textureCount),t._init=!0,this.textureCount++}},s.PixiShader.prototype.syncUniforms=function(){this.textureCount=1;var t,e=this.gl;for(var i in this.uniforms)1===(t=this.uniforms[i]).glValueLength?!0===t.glMatrix?t.glFunc.call(e,t.uniformLocation,t.transpose,t.value):t.glFunc.call(e,t.uniformLocation,t.value):2===t.glValueLength?t.glFunc.call(e,t.uniformLocation,t.value.x,t.value.y):3===t.glValueLength?t.glFunc.call(e,t.uniformLocation,t.value.x,t.value.y,t.value.z):4===t.glValueLength?t.glFunc.call(e,t.uniformLocation,t.value.x,t.value.y,t.value.z,t.value.w):"sampler2D"===t.type&&(t._init?(e.activeTexture(e["TEXTURE"+this.textureCount]),t.value.baseTexture._dirty[e.id]?s.instances[e.id].updateTexture(t.value.baseTexture):e.bindTexture(e.TEXTURE_2D,t.value.baseTexture._glTextures[e.id]),e.uniform1i(t.uniformLocation,this.textureCount),this.textureCount++):this.initSampler2D(t))},s.PixiShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},s.PixiShader.defaultVertexSrc=["// PixiShader Vertex Shader","// With multi-texture rendering","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","attribute float aTextureIndex;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureIndex;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," if (aTextureIndex > 0.0) gl_Position = vec4(0.0);"," gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);"," vTextureIndex = aTextureIndex;","}"],s.PixiFastShader=function(t){if(this._UID=Phaser._UID++,this.gl=t,this.program=null,s._enableMultiTextureToggle){var t=this.gl;this.MAX_TEXTURES=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);for(var e="\tif (vTextureIndex == 0.0) { gl_FragColor = texture2D(uSamplerArray[0], vTextureCoord) * vColor;return;}\n",i=1;i<this.MAX_TEXTURES;++i)e+="\tif (vTextureIndex == "+i+".0) { gl_FragColor = texture2D(uSamplerArray["+i+"], vTextureCoord) * vColor;return;}\n";this.fragmentSrc=["// PixiFastShader Fragment Shader.","precision lowp float;","bool isnan( float val ) { return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true; }","varying vec2 vTextureCoord;","varying float vColor;","varying float vTextureIndex;","uniform sampler2D uSamplerArray["+this.MAX_TEXTURES+"];","const vec4 BLUE = vec4(1.0, 0.0, 1.0, 1.0);","const vec4 RED = vec4(1.0, 0.0, 0.0, 1.0);","void main(void) {",e," if(vTextureIndex >= "+this.MAX_TEXTURES+".0) { gl_FragColor = BLUE;return;}"," if(isnan(vTextureIndex)) {gl_FragColor = RED;return;}","}"]}else this.fragmentSrc=["// PixiFastShader Fragment Shader.","precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","varying float vTextureIndex;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor;","}"];this.vertexSrc=["// PixiFastShader Vertex Shader.","attribute vec2 aVertexPosition;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute float aTextureIndex;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform mat3 uMatrix;","varying vec2 vTextureCoord;","varying float vColor;","varying float vTextureIndex;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," vec2 v;"," vec2 sv = aVertexPosition * aScale;"," v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);"," v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);"," v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;"," gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vTextureIndex = aTextureIndex;"," vColor = aColor;","}"],this.textureCount=0,this.init()},s.PixiFastShader.prototype.constructor=s.PixiFastShader,s.PixiFastShader.prototype.init=function(){var t=this.gl,e=s.compileProgram(t,this.vertexSrc,this.fragmentSrc);if(t.useProgram(e),this.uSampler=s._enableMultiTextureToggle?t.getUniformLocation(e,"uSamplerArray[0]"):t.getUniformLocation(e,"uSampler"),s._enableMultiTextureToggle){var i=[],n=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,t.RGB,1,1,0,t.RGB,t.UNSIGNED_BYTE,null);for(var r=0;r<this.MAX_TEXTURES;++r)t.activeTexture(t.TEXTURE0+r),t.bindTexture(t.TEXTURE_2D,n),i.push(r);t.activeTexture(t.TEXTURE0),t.uniform1iv(this.uSampler,i)}this.projectionVector=t.getUniformLocation(e,"projectionVector"),this.offsetVector=t.getUniformLocation(e,"offsetVector"),this.dimensions=t.getUniformLocation(e,"dimensions"),this.uMatrix=t.getUniformLocation(e,"uMatrix"),this.aVertexPosition=t.getAttribLocation(e,"aVertexPosition"),this.aPositionCoord=t.getAttribLocation(e,"aPositionCoord"),this.aScale=t.getAttribLocation(e,"aScale"),this.aRotation=t.getAttribLocation(e,"aRotation"),this.aTextureCoord=t.getAttribLocation(e,"aTextureCoord"),this.colorAttribute=t.getAttribLocation(e,"aColor"),this.aTextureIndex=t.getAttribLocation(e,"aTextureIndex"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aPositionCoord,this.aScale,this.aRotation,this.aTextureCoord,this.colorAttribute,this.aTextureIndex],this.program=e},s.PixiFastShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},s.StripShader=function(t){if(this._UID=Phaser._UID++,this.gl=t,this.program=null,s._enableMultiTextureToggle){var t=this.gl;this.MAX_TEXTURES=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);for(var e="\tif (vTextureIndex == 0.0) { gl_FragColor = texture2D(uSamplerArray[0], vTextureCoord);return;}\n",i=1;i<this.MAX_TEXTURES;++i)e+="\tif (vTextureIndex == "+i+".0) { gl_FragColor = texture2D(uSamplerArray["+i+"], vTextureCoord) ;return;}\n";this.fragmentSrc=["//StripShader Fragment Shader.","precision mediump float;","bool isnan( float val ) { return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true; }","varying vec2 vTextureCoord;","varying float vTextureIndex;","uniform float alpha;","uniform sampler2D uSamplerArray["+this.MAX_TEXTURES+"];","const vec4 BLUE = vec4(1.0, 0.0, 1.0, 1.0);","const vec4 RED = vec4(1.0, 0.0, 0.0, 1.0);","void main(void) {",e," if(vTextureIndex >= "+this.MAX_TEXTURES+".0) { gl_FragColor = BLUE;return;}"," if(isnan(vTextureIndex)) {gl_FragColor = RED;return;}","}"]}else this.fragmentSrc=["//StripShader Fragment Shader.","precision mediump float;","varying vec2 vTextureCoord;","varying float vTextureIndex;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);","}"];this.vertexSrc=["//StripShader Vertex Shader.","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aTextureIndex;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","varying float vTextureIndex;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vTextureIndex = aTextureIndex;","}"],this.init()},s.StripShader.prototype.constructor=s.StripShader,s.StripShader.prototype.init=function(){var t=this.gl,e=s.compileProgram(t,this.vertexSrc,this.fragmentSrc);if(t.useProgram(e),this.uSampler=s._enableMultiTextureToggle?t.getUniformLocation(e,"uSamplerArray[0]"):t.getUniformLocation(e,"uSampler"),s._enableMultiTextureToggle){var i=[],n=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,t.RGB,1,1,0,t.RGB,t.UNSIGNED_BYTE,null);for(var r=0;r<this.MAX_TEXTURES;++r)t.activeTexture(t.TEXTURE0+r),t.bindTexture(t.TEXTURE_2D,n),i.push(r);t.activeTexture(t.TEXTURE0),t.uniform1iv(this.uSampler,i)}this.projectionVector=t.getUniformLocation(e,"projectionVector"),this.offsetVector=t.getUniformLocation(e,"offsetVector"),this.colorAttribute=t.getAttribLocation(e,"aColor"),this.aTextureIndex=t.getAttribLocation(e,"aTextureIndex"),this.aVertexPosition=t.getAttribLocation(e,"aVertexPosition"),this.aTextureCoord=t.getAttribLocation(e,"aTextureCoord"),this.attributes=[this.aVertexPosition,this.aTextureCoord,this.aTextureIndex],this.translationMatrix=t.getUniformLocation(e,"translationMatrix"),this.alpha=t.getUniformLocation(e,"alpha"),this.program=e},s.StripShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},s.PrimitiveShader=function(t){this._UID=Phaser._UID++,this.gl=t,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform float alpha;","uniform float flipY;","uniform vec3 tint;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"],this.init()},s.PrimitiveShader.prototype.constructor=s.PrimitiveShader,s.PrimitiveShader.prototype.init=function(){var t=this.gl,e=s.compileProgram(t,this.vertexSrc,this.fragmentSrc);t.useProgram(e),this.projectionVector=t.getUniformLocation(e,"projectionVector"),this.offsetVector=t.getUniformLocation(e,"offsetVector"),this.tintColor=t.getUniformLocation(e,"tint"),this.flipY=t.getUniformLocation(e,"flipY"),this.aVertexPosition=t.getAttribLocation(e,"aVertexPosition"),this.colorAttribute=t.getAttribLocation(e,"aColor"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=t.getUniformLocation(e,"translationMatrix"),this.alpha=t.getUniformLocation(e,"alpha"),this.program=e},s.PrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},s.ComplexPrimitiveShader=function(t){this._UID=Phaser._UID++,this.gl=t,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform vec3 tint;","uniform float alpha;","uniform vec3 color;","uniform float flipY;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);"," vColor = vec4(color * alpha * tint, alpha);","}"],this.init()},s.ComplexPrimitiveShader.prototype.constructor=s.ComplexPrimitiveShader,s.ComplexPrimitiveShader.prototype.init=function(){var t=this.gl,e=s.compileProgram(t,this.vertexSrc,this.fragmentSrc);t.useProgram(e),this.projectionVector=t.getUniformLocation(e,"projectionVector"),this.offsetVector=t.getUniformLocation(e,"offsetVector"),this.tintColor=t.getUniformLocation(e,"tint"),this.color=t.getUniformLocation(e,"color"),this.flipY=t.getUniformLocation(e,"flipY"),this.aVertexPosition=t.getAttribLocation(e,"aVertexPosition"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=t.getUniformLocation(e,"translationMatrix"),this.alpha=t.getUniformLocation(e,"alpha"),this.program=e},s.ComplexPrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},s.glContexts=[],s.instances=[],s._enableMultiTextureToggle=!1,s.WebGLRenderer=function(t,e){this.game=t,s.defaultRenderer||(s.defaultRenderer=this),this.extensions={},this.type=Phaser.WEBGL,this.resolution=t.resolution,this.transparent=t.transparent,this.autoResize=!1,this.preserveDrawingBuffer=t.preserveDrawingBuffer,this.clearBeforeRender=t.clearBeforeRender,this.width=t.width,this.height=t.height,this.view=t.canvas,this._contextOptions={alpha:this.transparent,antialias:t.antialias,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:this.preserveDrawingBuffer},this.projection=new s.Point,this.offset=new s.Point,this.shaderManager=new s.WebGLShaderManager,this.spriteBatch=new s.WebGLSpriteBatch(t),this.maskManager=new s.WebGLMaskManager,this.filterManager=new s.WebGLFilterManager,this.stencilManager=new s.WebGLStencilManager,this.blendModeManager=new s.WebGLBlendModeManager,this.renderSession={},this.currentBatchedTextures=[],this.renderSession.game=this.game,this.renderSession.gl=this.gl,this.renderSession.drawCount=0,this.renderSession.shaderManager=this.shaderManager,this.renderSession.maskManager=this.maskManager,this.renderSession.filterManager=this.filterManager,this.renderSession.blendModeManager=this.blendModeManager,this.renderSession.spriteBatch=this.spriteBatch,this.renderSession.stencilManager=this.stencilManager,this.renderSession.renderer=this,this.renderSession.resolution=this.resolution,this.renderSession.roundPixels=e.roundPixels||!1,this.renderSession.maxTextureAvailableSpace=null,this.initContext(),this.mapBlendModes()},s.WebGLRenderer.prototype.constructor=s.WebGLRenderer,s.WebGLRenderer.prototype.initContext=function(){var t=this.view.getContext("webgl",this._contextOptions)||this.view.getContext("experimental-webgl",this._contextOptions);if(this.gl=t,!t)throw new Error("This browser does not support webGL. Try using the canvas renderer");this.maxTextures=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=this.gl.getParameter(t.MAX_TEXTURE_SIZE),this.glContextId=t.id=s.WebGLRenderer.glContextId++,s.glContexts[this.glContextId]=t,s.instances[this.glContextId]=this,t.disable(t.DEPTH_TEST),t.disable(t.CULL_FACE),t.enable(t.BLEND),this.shaderManager.setContext(t),this.spriteBatch.setContext(t),this.maskManager.setContext(t),this.filterManager.setContext(t),this.blendModeManager.setContext(t),this.stencilManager.setContext(t),this.renderSession.gl=this.gl,this.resize(this.width,this.height),this.extensions.compression={};var e=t.getExtension("WEBGL_compressed_texture_etc1")||t.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");e&&(this.extensions.compression.ETC1=e),i&&(this.extensions.compression.PVRTC=i),n&&(this.extensions.compression.S3TC=n)},s.WebGLRenderer.prototype.setTexturePriority=function(t){if(s._enableMultiTextureToggle){for(var e=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},i=this.gl,n=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),r=i.getParameter(i.MAX_TEXTURE_SIZE),o=this.game.cache._cache.image,a=null,h=0;h<this.currentBatchedTextures.length;h++)(a=this.currentBatchedTextures[h])in o?o[a].base.textureIndex=0:console.warn('setTexturePriority: There is no image "%s" in the image cache.',a);var l=r-e(Math.max(this.width,this.height));this.currentBatchedTextures.length=0;for(var c=0;c<t.length;++c)if((a=t[c])in o){var u=o[a].base;(l-=e(Math.max(u.width,u.height)))<=0?(u.textureIndex=0,console.warn('setTexturePriority: Image "%s" was given textureIndex=0 because there is no available texture space (%s).',a,l)):u.textureIndex=1+c%(n-1),this.currentBatchedTextures.push(a)}else console.warn('setTexturePriority: There is no image "%s" in the image cache.',a);return this.renderSession.maxTextureAvailableSpace=l,this.currentBatchedTextures}console.warn("setTexturePriority error: Multi Texture support hasn't been enabled in the Phaser Game Config.")},s.WebGLRenderer.prototype.render=function(t){if(!this.contextLost){var e=this.gl;e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,null),this.game.clearBeforeRender&&(e.clearColor(t._bgColor.r,t._bgColor.g,t._bgColor.b,t._bgColor.a),e.clear(e.COLOR_BUFFER_BIT)),this.offset.x=this.game.camera._shake.x,this.offset.y=this.game.camera._shake.y,this.renderDisplayObject(t,this.projection)}},s.WebGLRenderer.prototype.renderDisplayObject=function(t,e,i,n){this.renderSession.blendModeManager.setBlendMode(s.blendModes.NORMAL),this.renderSession.drawCount=0,this.renderSession.flipY=i?-1:1,this.renderSession.projection=e,this.renderSession.offset=this.offset,this.spriteBatch.begin(this.renderSession),this.filterManager.begin(this.renderSession,i),t._renderWebGL(this.renderSession,n),this.spriteBatch.end()},s.WebGLRenderer.prototype.resize=function(t,e){this.width=t*this.resolution,this.height=e*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px"),this.gl.viewport(0,0,this.width,this.height),this.projection.x=this.width/2/this.resolution,this.projection.y=-this.height/2/this.resolution},s.WebGLRenderer.prototype.updateCompressedTexture=function(t){if(!t.hasLoaded)return!1;var e=this.gl,i=t.source;return t._glTextures[e.id]||(t._glTextures[e.id]=e.createTexture()),e.activeTexture(e.TEXTURE0+t.textureIndex),e.bindTexture(e.TEXTURE_2D,t._glTextures[e.id]),e.compressedTexImage2D(e.TEXTURE_2D,0,i.glExtensionFormat,i.width,i.height,0,i.textureData),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t.scaleMode===s.scaleModes.LINEAR?e.LINEAR:e.NEAREST),t.mipmap&&Phaser.Math.isPowerOfTwo(t.width,t.height)?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t.scaleMode===s.scaleModes.LINEAR?e.LINEAR_MIPMAP_LINEAR:e.NEAREST_MIPMAP_NEAREST),e.generateMipmap(e.TEXTURE_2D)):e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t.scaleMode===s.scaleModes.LINEAR?e.LINEAR:e.NEAREST),t._powerOf2?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(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)),t._dirty[e.id]=!1,!0},s.WebGLRenderer.prototype.updateTexture=function(t){if(!t.hasLoaded)return!1;if(t.source.compressionAlgorithm)return this.updateCompressedTexture(t);var e=this.gl;return t._glTextures[e.id]||(t._glTextures[e.id]=e.createTexture()),e.activeTexture(e.TEXTURE0+t.textureIndex),e.bindTexture(e.TEXTURE_2D,t._glTextures[e.id]),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultipliedAlpha),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t.scaleMode===s.scaleModes.LINEAR?e.LINEAR:e.NEAREST),t.mipmap&&Phaser.Math.isPowerOfTwo(t.width,t.height)?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t.scaleMode===s.scaleModes.LINEAR?e.LINEAR_MIPMAP_LINEAR:e.NEAREST_MIPMAP_NEAREST),e.generateMipmap(e.TEXTURE_2D)):e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t.scaleMode===s.scaleModes.LINEAR?e.LINEAR:e.NEAREST),t._powerOf2?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(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)),t._dirty[e.id]=!1,!0},s.WebGLRenderer.prototype.destroy=function(){s.glContexts[this.glContextId]=null,this.projection=null,this.offset=null,this.shaderManager.destroy(),this.spriteBatch.destroy(),this.maskManager.destroy(),this.filterManager.destroy(),this.shaderManager=null,this.spriteBatch=null,this.maskManager=null,this.filterManager=null,this.gl=null,this.renderSession=null,Phaser.CanvasPool.remove(this),s.instances[this.glContextId]=null,s.WebGLRenderer.glContextId--},s.WebGLRenderer.prototype.mapBlendModes=function(){var t=this.gl;if(!s.blendModesWebGL){var e=[],i=s.blendModes;e[i.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.ADD]=[t.SRC_ALPHA,t.DST_ALPHA],e[i.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA],e[i.SCREEN]=[t.SRC_ALPHA,t.ONE],e[i.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],s.blendModesWebGL=e}},s.WebGLRenderer.prototype.getMaxTextureUnit=function(){var t=this.gl;return t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)},s.enableMultiTexture=function(){s._enableMultiTextureToggle=!0},s.WebGLRenderer.glContextId=0,s.WebGLRenderer.textureArray=[],s.WebGLBlendModeManager=function(){this.currentBlendMode=99999},s.WebGLBlendModeManager.prototype.constructor=s.WebGLBlendModeManager,s.WebGLBlendModeManager.prototype.setContext=function(t){this.gl=t},s.WebGLBlendModeManager.prototype.setBlendMode=function(t){if(this.currentBlendMode===t)return!1;this.currentBlendMode=t;var e=s.blendModesWebGL[this.currentBlendMode];return e&&this.gl.blendFunc(e[0],e[1]),!0},s.WebGLBlendModeManager.prototype.destroy=function(){this.gl=null},s.WebGLMaskManager=function(){},s.WebGLMaskManager.prototype.constructor=s.WebGLMaskManager,s.WebGLMaskManager.prototype.setContext=function(t){this.gl=t},s.WebGLMaskManager.prototype.pushMask=function(t,e){var i=e.gl;t.dirty&&s.WebGLGraphics.updateGraphics(t,i),void 0!==t._webGL[i.id]&&void 0!==t._webGL[i.id].data&&0!==t._webGL[i.id].data.length&&e.stencilManager.pushStencil(t,t._webGL[i.id].data[0],e)},s.WebGLMaskManager.prototype.popMask=function(t,e){var i=this.gl;void 0!==t._webGL[i.id]&&void 0!==t._webGL[i.id].data&&0!==t._webGL[i.id].data.length&&e.stencilManager.popStencil(t,t._webGL[i.id].data[0],e)},s.WebGLMaskManager.prototype.destroy=function(){this.gl=null},s.WebGLStencilManager=function(){this.stencilStack=[],this.reverse=!0,this.count=0},s.WebGLStencilManager.prototype.setContext=function(t){this.gl=t},s.WebGLStencilManager.prototype.pushStencil=function(t,e,i){var s=this.gl;this.bindGraphics(t,e,i),0===this.stencilStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),this.reverse=!0,this.count=0),this.stencilStack.push(e);var n=this.count;s.colorMask(!1,!1,!1,!1),s.stencilFunc(s.ALWAYS,0,255),s.stencilOp(s.KEEP,s.KEEP,s.INVERT),1===e.mode?(s.drawElements(s.TRIANGLE_FAN,e.indices.length-4,s.UNSIGNED_SHORT,0),this.reverse?(s.stencilFunc(s.EQUAL,255-n,255),s.stencilOp(s.KEEP,s.KEEP,s.DECR)):(s.stencilFunc(s.EQUAL,n,255),s.stencilOp(s.KEEP,s.KEEP,s.INCR)),s.drawElements(s.TRIANGLE_FAN,4,s.UNSIGNED_SHORT,2*(e.indices.length-4)),this.reverse?s.stencilFunc(s.EQUAL,255-(n+1),255):s.stencilFunc(s.EQUAL,n+1,255),this.reverse=!this.reverse):(this.reverse?(s.stencilFunc(s.EQUAL,n,255),s.stencilOp(s.KEEP,s.KEEP,s.INCR)):(s.stencilFunc(s.EQUAL,255-n,255),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),s.drawElements(s.TRIANGLE_STRIP,e.indices.length,s.UNSIGNED_SHORT,0),this.reverse?s.stencilFunc(s.EQUAL,n+1,255):s.stencilFunc(s.EQUAL,255-(n+1),255)),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),this.count++},s.WebGLStencilManager.prototype.bindGraphics=function(t,e,i){this._currentGraphics=t;var s,n=this.gl,r=i.projection,o=i.offset;1===e.mode?(s=i.shaderManager.complexPrimitiveShader,i.shaderManager.setShader(s),n.uniform1f(s.flipY,i.flipY),n.uniformMatrix3fv(s.translationMatrix,!1,t.worldTransform.toArray(!0)),n.uniform2f(s.projectionVector,r.x,-r.y),n.uniform2f(s.offsetVector,-o.x,-o.y),n.uniform3fv(s.tintColor,Phaser.Color.hexToRGBArray(t.tint)),n.uniform3fv(s.color,e.color),n.uniform1f(s.alpha,t.worldAlpha*e.alpha),n.bindBuffer(n.ARRAY_BUFFER,e.buffer),n.vertexAttribPointer(s.aVertexPosition,2,n.FLOAT,!1,8,0),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.indexBuffer)):(s=i.shaderManager.primitiveShader,i.shaderManager.setShader(s),n.uniformMatrix3fv(s.translationMatrix,!1,t.worldTransform.toArray(!0)),n.uniform1f(s.flipY,i.flipY),n.uniform2f(s.projectionVector,r.x,-r.y),n.uniform2f(s.offsetVector,-o.x,-o.y),n.uniform3fv(s.tintColor,Phaser.Color.hexToRGBArray(t.tint)),n.uniform1f(s.alpha,t.worldAlpha),n.bindBuffer(n.ARRAY_BUFFER,e.buffer),n.vertexAttribPointer(s.aVertexPosition,2,n.FLOAT,!1,24,0),n.vertexAttribPointer(s.colorAttribute,4,n.FLOAT,!1,24,8),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.indexBuffer))},s.WebGLStencilManager.prototype.popStencil=function(t,e,i){var s=this.gl;if(this.stencilStack.pop(),this.count--,0===this.stencilStack.length)s.disable(s.STENCIL_TEST);else{var n=this.count;this.bindGraphics(t,e,i),s.colorMask(!1,!1,!1,!1),1===e.mode?(this.reverse=!this.reverse,this.reverse?(s.stencilFunc(s.EQUAL,255-(n+1),255),s.stencilOp(s.KEEP,s.KEEP,s.INCR)):(s.stencilFunc(s.EQUAL,n+1,255),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),s.drawElements(s.TRIANGLE_FAN,4,s.UNSIGNED_SHORT,2*(e.indices.length-4)),s.stencilFunc(s.ALWAYS,0,255),s.stencilOp(s.KEEP,s.KEEP,s.INVERT),s.drawElements(s.TRIANGLE_FAN,e.indices.length-4,s.UNSIGNED_SHORT,0),this.reverse?s.stencilFunc(s.EQUAL,n,255):s.stencilFunc(s.EQUAL,255-n,255)):(this.reverse?(s.stencilFunc(s.EQUAL,n+1,255),s.stencilOp(s.KEEP,s.KEEP,s.DECR)):(s.stencilFunc(s.EQUAL,255-(n+1),255),s.stencilOp(s.KEEP,s.KEEP,s.INCR)),s.drawElements(s.TRIANGLE_STRIP,e.indices.length,s.UNSIGNED_SHORT,0),this.reverse?s.stencilFunc(s.EQUAL,n,255):s.stencilFunc(s.EQUAL,255-n,255)),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP)}},s.WebGLStencilManager.prototype.destroy=function(){this.stencilStack=null,this.gl=null},s.WebGLShaderManager=function(){this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var t=0;t<this.maxAttibs;t++)this.attribState[t]=!1;this.stack=[]},s.WebGLShaderManager.prototype.constructor=s.WebGLShaderManager,s.WebGLShaderManager.prototype.setContext=function(t){this.gl=t,this.primitiveShader=new s.PrimitiveShader(t),this.complexPrimitiveShader=new s.ComplexPrimitiveShader(t),this.defaultShader=new s.PixiShader(t),this.fastShader=new s.PixiFastShader(t),this.stripShader=new s.StripShader(t),this.creatureShader=s.CreatureShader?new s.CreatureShader(t):null,this.setShader(this.defaultShader)},s.WebGLShaderManager.prototype.setAttribs=function(t){var e;for(e=0;e<this.tempAttribState.length;e++)this.tempAttribState[e]=!1;for(e=0;e<t.length;e++){var i=t[e];this.tempAttribState[i]=!0}var s=this.gl;for(e=0;e<this.attribState.length;e++)this.attribState[e]!==this.tempAttribState[e]&&(this.attribState[e]=this.tempAttribState[e],this.tempAttribState[e]?s.enableVertexAttribArray(e):s.disableVertexAttribArray(e))},s.WebGLShaderManager.prototype.setShader=function(t){return this._currentId!==t._UID&&(this._currentId=t._UID,this.currentShader=t,this.gl.useProgram(t.program),this.setAttribs(t.attributes),!0)},s.WebGLShaderManager.prototype.destroy=function(){this.attribState=null,this.tempAttribState=null,this.primitiveShader.destroy(),this.complexPrimitiveShader.destroy(),this.defaultShader.destroy(),this.fastShader.destroy(),this.stripShader.destroy(),this.creatureShader&&this.creatureShader.destroy(),this.gl=null},s.WebGLSpriteBatch=function(t){this.game=t,this.vertSize=5,this.size=2e3,this.vertexSize=24;var e=this.vertexSize*this.size*4,i=6*this.size;this.vertices=new ArrayBuffer(e),this.positions=new Float32Array(this.vertices),this.colors=new Uint32Array(this.vertices),this.indices=new Uint16Array(i),this.lastIndexCount=0;for(var s=0,n=0;s<i;s+=6,n+=4)this.indices[s+0]=n+0,this.indices[s+1]=n+1,this.indices[s+2]=n+2,this.indices[s+3]=n+0,this.indices[s+4]=n+2,this.indices[s+5]=n+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.dirty=!0,this.textures=[],this.blendModes=[],this.shaders=[],this.sprites=[],this.defaultShader=null},s.WebGLSpriteBatch.prototype.setContext=function(t){if(this.MAX_TEXTURES=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this.gl=t,s._enableMultiTextureToggle){for(var e="\tif (vTextureIndex == 0.0) {gl_FragColor = texture2D(uSamplerArray[0], vTextureCoord) * vColor;return;}\n",i=1;i<this.MAX_TEXTURES;++i)e+="\tif (vTextureIndex == "+i+".0) {gl_FragColor = texture2D(uSamplerArray["+i+"], vTextureCoord) * vColor;return;}\n";this.defaultShader=new Phaser.Filter(this.game,void 0,["//WebGLSpriteBatch Fragment Shader.","precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureIndex;","uniform sampler2D uSamplerArray["+this.MAX_TEXTURES+"];","void main(void) {",e,"\tgl_FragColor = texture2D(uSamplerArray[0], vTextureCoord) * vColor;","}"])}else this.defaultShader=new Phaser.Filter(this.game,void 0,["//WebGLSpriteBatch Fragment Shader.","precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureIndex;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor;","}"]);this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices,t.DYNAMIC_DRAW),this.currentBlendMode=99999;var n=new s.PixiShader(t);n.fragmentSrc=this.defaultShader.fragmentSrc,n.uniforms={},n.init(),this.defaultShader.shaders[t.id]=n},s.WebGLSpriteBatch.prototype.begin=function(t){this.renderSession=t,this.shader=this.renderSession.shaderManager.defaultShader,this.start()},s.WebGLSpriteBatch.prototype.end=function(){this.flush()},s.WebGLSpriteBatch.prototype.render=function(t,e){var i=t.texture,n=i.baseTexture,r=this.gl;s.WebGLRenderer.textureArray[n.textureIndex]!=n&&(this.flush(),r.activeTexture(r.TEXTURE0+n.textureIndex),r.bindTexture(r.TEXTURE_2D,n._glTextures[r.id]),s.WebGLRenderer.textureArray[n.textureIndex]=n);var o=t.worldTransform;e&&(o=e),this.currentBatchSize>=this.size&&(this.flush(),this.currentBaseTexture=i.baseTexture);var a=i._uvs;if(a){var h,l,c,u,d=t.anchor.x,p=t.anchor.y;if(i.trim){var f=i.trim;h=(l=f.x-d*f.width)+i.crop.width,c=(u=f.y-p*f.height)+i.crop.height}else h=i.frame.width*(1-d),l=i.frame.width*-d,c=i.frame.height*(1-p),u=i.frame.height*-p;var g=this.currentBatchSize*this.vertexSize,m=i.baseTexture.resolution,y=i.baseTexture.textureIndex,v=o.a/m,x=o.b/m,b=o.c/m,_=o.d/m,w=o.tx,T=o.ty,P=i.crop.height;if(i.rotated){var C=o.a,S=o.b,A=o.c,E=o.d,M=l,R=h;w=o.c*P+w,T=o.d*P+T,v=6.123233995736766e-17*C-A,x=6.123233995736766e-17*S-E,b=C+6.123233995736766e-17*A,_=S+6.123233995736766e-17*E,i._updateUvsInverted(),h=c,l=u,c=R,u=M}var L=this.colors,B=this.positions,I=t.tint,O=(I>>16)+(65280&I)+((255&I)<<16)+(255*t.worldAlpha<<24);this.renderSession.roundPixels?(B[g++]=v*l+b*u+w|0,B[g++]=_*u+x*l+T|0,B[g++]=a.x0,B[g++]=a.y0,L[g++]=O,B[g++]=y,B[g++]=v*h+b*u+w|0,B[g++]=_*u+x*h+T|0,B[g++]=a.x1,B[g++]=a.y1,L[g++]=O,B[g++]=y,B[g++]=v*h+b*c+w|0,B[g++]=_*c+x*h+T|0,B[g++]=a.x2,B[g++]=a.y2,L[g++]=O,B[g++]=y,B[g++]=v*l+b*c+w|0,B[g++]=_*c+x*l+T|0,B[g++]=a.x3,B[g++]=a.y3,L[g++]=O,B[g++]=y):(B[g++]=v*l+b*u+w,B[g++]=_*u+x*l+T,B[g++]=a.x0,B[g++]=a.y0,L[g++]=O,B[g++]=y,B[g++]=v*h+b*u+w,B[g++]=_*u+x*h+T,B[g++]=a.x1,B[g++]=a.y1,L[g++]=O,B[g++]=y,B[g++]=v*h+b*c+w,B[g++]=_*c+x*h+T,B[g++]=a.x2,B[g++]=a.y2,L[g++]=O,B[g++]=y,B[g++]=v*l+b*c+w,B[g++]=_*c+x*l+T,B[g++]=a.x3,B[g++]=a.y3,L[g++]=O,B[g++]=y),this.sprites[this.currentBatchSize++]=t}},s.WebGLSpriteBatch.prototype.renderTilingSprite=function(t){var e=t.tilingTexture,i=e.baseTexture,n=this.gl,r=t.texture.baseTexture.textureIndex;s.WebGLRenderer.textureArray[r]!=i&&(this.flush(),n.activeTexture(n.TEXTURE0+r),n.bindTexture(n.TEXTURE_2D,i._glTextures[n.id]),s.WebGLRenderer.textureArray[r]=i),this.currentBatchSize>=this.size&&(this.flush(),this.currentBaseTexture=e.baseTexture),t._uvs||(t._uvs=new s.TextureUvs);var o=t._uvs,a=e.baseTexture.width,h=e.baseTexture.height;t.tilePosition.x%=a*t.tileScaleOffset.x,t.tilePosition.y%=h*t.tileScaleOffset.y;var l=t.tilePosition.x/(a*t.tileScaleOffset.x),c=t.tilePosition.y/(h*t.tileScaleOffset.y),u=t.width/a/(t.tileScale.x*t.tileScaleOffset.x),d=t.height/h/(t.tileScale.y*t.tileScaleOffset.y);o.x0=0-l,o.y0=0-c,o.x1=1*u-l,o.y1=0-c,o.x2=1*u-l,o.y2=1*d-c,o.x3=0-l,o.y3=1*d-c;var p=t.tint,f=(p>>16)+(65280&p)+((255&p)<<16)+(255*t.worldAlpha<<24),g=this.positions,m=this.colors,y=t.width,v=t.height,x=t.anchor.x,b=t.anchor.y,_=y*(1-x),w=y*-x,T=v*(1-b),P=v*-b,C=this.currentBatchSize*this.vertexSize,S=e.baseTexture.resolution,A=t.worldTransform,E=A.a/S,M=A.b/S,R=A.c/S,L=A.d/S,B=A.tx,I=A.ty;g[C++]=E*w+R*P+B,g[C++]=L*P+M*w+I,g[C++]=o.x0,g[C++]=o.y0,m[C++]=f,g[C++]=r,g[C++]=E*_+R*P+B,g[C++]=L*P+M*_+I,g[C++]=o.x1,g[C++]=o.y1,m[C++]=f,g[C++]=r,g[C++]=E*_+R*T+B,g[C++]=L*T+M*_+I,g[C++]=o.x2,g[C++]=o.y2,m[C++]=f,g[C++]=r,g[C++]=E*w+R*T+B,g[C++]=L*T+M*w+I,g[C++]=o.x3,g[C++]=o.y3,m[C++]=f,g[C++]=r,this.sprites[this.currentBatchSize++]=t},s.WebGLSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var t,e=this.gl;if(this.dirty){this.dirty=!1,t=this.defaultShader.shaders[e.id],e.activeTexture(e.TEXTURE0),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var i=this.vertexSize;e.vertexAttribPointer(t.aVertexPosition,2,e.FLOAT,!1,i,0),e.vertexAttribPointer(t.aTextureCoord,2,e.FLOAT,!1,i,8),e.vertexAttribPointer(t.colorAttribute,4,e.UNSIGNED_BYTE,!0,i,16),e.vertexAttribPointer(t.aTextureIndex,1,e.FLOAT,!1,i,20)}if(this.currentBatchSize>.5*this.size)e.bufferSubData(e.ARRAY_BUFFER,0,this.vertices);else{e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer);var n=this.positions.subarray(0,this.currentBatchSize*this.vertexSize);e.bufferSubData(e.ARRAY_BUFFER,0,n)}for(var r,o,a,h,l=0,c=0,u=null,d=this.renderSession.blendModeManager.currentBlendMode,p=null,f=!1,g=!1,m=0,y=this.currentBatchSize;m<y;m++){r=(h=this.sprites[m]).tilingTexture?h.tilingTexture.baseTexture:h.texture.baseTexture,f=d!==(o=h.blendMode),g=p!==(a=h.shader||this.defaultShader);var v=r.skipRender;if(v&&h.children.length>0&&(v=!1),(f||g)&&(this.renderBatch(u,l,c),c=m,l=0,u=r,f&&(d=o,this.renderSession.blendModeManager.setBlendMode(d)),g)){(t=(p=a).shaders[e.id])||((t=new s.PixiShader(e)).fragmentSrc=p.fragmentSrc,t.uniforms=p.uniforms,t.init(),p.shaders[e.id]=t),this.renderSession.shaderManager.setShader(t),t.dirty&&t.syncUniforms();var x=this.renderSession.projection;e.uniform2f(t.projectionVector,x.x,x.y);var b=this.renderSession.offset;e.uniform2f(t.offsetVector,b.x,b.y)}l++}this.renderBatch(u,l,c),this.currentBatchSize=0}},s.WebGLSpriteBatch.prototype.renderBatch=function(t,e,i){if(0!==e){var s=this.gl;if(t._dirty[s.id]){if(!this.renderSession.renderer.updateTexture(t))return}else s.bindTexture(s.TEXTURE_2D,t._glTextures[s.id]);s.drawElements(s.TRIANGLES,6*e,s.UNSIGNED_SHORT,6*i*2),this.renderSession.drawCount++}},s.WebGLSpriteBatch.prototype.stop=function(){this.flush(),this.dirty=!0},s.WebGLSpriteBatch.prototype.start=function(){this.dirty=!0},s.WebGLSpriteBatch.prototype.destroy=function(){this.vertices=null,this.indices=null,this.gl.deleteBuffer(this.vertexBuffer),this.gl.deleteBuffer(this.indexBuffer),this.currentBaseTexture=null,this.gl=null},s.WebGLFastSpriteBatch=function(t){this.vertSize=11,this.maxSize=6e3,this.size=this.maxSize;var e=4*this.size*this.vertSize,i=6*this.maxSize;this.vertices=new Float32Array(e),this.indices=new Uint16Array(i),this.vertexBuffer=null,this.indexBuffer=null,this.lastIndexCount=0;for(var s=0,n=0;s<i;s+=6,n+=4)this.indices[s+0]=n+0,this.indices[s+1]=n+1,this.indices[s+2]=n+2,this.indices[s+3]=n+0,this.indices[s+4]=n+2,this.indices[s+5]=n+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.currentBlendMode=0,this.renderSession=null,this.shader=null,this.matrix=null,this.setContext(t)},s.WebGLFastSpriteBatch.prototype.constructor=s.WebGLFastSpriteBatch,s.WebGLFastSpriteBatch.prototype.setContext=function(t){this.gl=t,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices,t.DYNAMIC_DRAW)},s.WebGLFastSpriteBatch.prototype.begin=function(t,e){this.renderSession=e,this.shader=this.renderSession.shaderManager.fastShader,this.matrix=t.worldTransform.toArray(!0),this.start()},s.WebGLFastSpriteBatch.prototype.end=function(){this.flush()},s.WebGLFastSpriteBatch.prototype.render=function(t){var e=t.children,i=e[0];if(i.texture._uvs){this.currentBaseTexture=i.texture.baseTexture,i.blendMode!==this.renderSession.blendModeManager.currentBlendMode&&(this.flush(),this.renderSession.blendModeManager.setBlendMode(i.blendMode));for(var s=0,n=e.length;s<n;s++)this.renderSprite(e[s]);this.flush()}},s.WebGLFastSpriteBatch.prototype.renderSprite=function(t){var e=t.texture.baseTexture,i=this.gl,n=t.texture.baseTexture.textureIndex;if((s.WebGLRenderer.textureArray[n]==e||!e._glTextures[i.id]||t.texture.baseTexture.skipRender||(this.flush(),i.activeTexture(i.TEXTURE0+n),i.bindTexture(i.TEXTURE_2D,e._glTextures[i.id]),s.WebGLRenderer.textureArray[n]=e,t.texture._uvs))&&t.visible){var r,o,a,h,l,c,u,d,p=this.vertices;if(r=t.texture._uvs,o=t.texture.frame.width,a=t.texture.frame.height,t.texture.trim){var f=t.texture.trim;h=(l=f.x-t.anchor.x*f.width)+t.texture.crop.width,c=(u=f.y-t.anchor.y*f.height)+t.texture.crop.height}else h=o*(1-t.anchor.x),l=o*-t.anchor.x,c=a*(1-t.anchor.y),u=a*-t.anchor.y;d=4*this.currentBatchSize*this.vertSize,p[d++]=l,p[d++]=u,p[d++]=t.position.x,p[d++]=t.position.y,p[d++]=t.scale.x,p[d++]=t.scale.y,p[d++]=t.rotation,p[d++]=r.x0,p[d++]=r.y1,p[d++]=t.alpha,p[d++]=n,p[d++]=h,p[d++]=u,p[d++]=t.position.x,p[d++]=t.position.y,p[d++]=t.scale.x,p[d++]=t.scale.y,p[d++]=t.rotation,p[d++]=r.x1,p[d++]=r.y1,p[d++]=t.alpha,p[d++]=n,p[d++]=h,p[d++]=c,p[d++]=t.position.x,p[d++]=t.position.y,p[d++]=t.scale.x,p[d++]=t.scale.y,p[d++]=t.rotation,p[d++]=r.x2,p[d++]=r.y2,p[d++]=t.alpha,p[d++]=n,p[d++]=l,p[d++]=c,p[d++]=t.position.x,p[d++]=t.position.y,p[d++]=t.scale.x,p[d++]=t.scale.y,p[d++]=t.rotation,p[d++]=r.x3,p[d++]=r.y3,p[d++]=t.alpha,p[d++]=n,++this.currentBatchSize>=this.size&&this.flush()}},s.WebGLFastSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var t=this.gl;if(this.currentBaseTexture._glTextures[t.id]){if(this.currentBatchSize>.5*this.size)t.bufferSubData(t.ARRAY_BUFFER,0,this.vertices);else{var e=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);t.bufferSubData(t.ARRAY_BUFFER,0,e)}t.drawElements(t.TRIANGLES,6*this.currentBatchSize,t.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}else this.renderSession.renderer.updateTexture(this.currentBaseTexture,t)}},s.WebGLFastSpriteBatch.prototype.stop=function(){this.flush()},s.WebGLFastSpriteBatch.prototype.start=function(){var t=this.gl;t.activeTexture(t.TEXTURE0),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.renderSession.projection;t.uniform2f(this.shader.projectionVector,e.x,e.y),t.uniformMatrix3fv(this.shader.uMatrix,!1,this.matrix);var i=4*this.vertSize;t.vertexAttribPointer(this.shader.aVertexPosition,2,t.FLOAT,!1,i,0),t.vertexAttribPointer(this.shader.aPositionCoord,2,t.FLOAT,!1,i,8),t.vertexAttribPointer(this.shader.aScale,2,t.FLOAT,!1,i,16),t.vertexAttribPointer(this.shader.aRotation,1,t.FLOAT,!1,i,24),t.vertexAttribPointer(this.shader.aTextureCoord,2,t.FLOAT,!1,i,28),t.vertexAttribPointer(this.shader.colorAttribute,1,t.FLOAT,!1,i,36),t.vertexAttribPointer(this.shader.aTextureIndex,1,t.FLOAT,!1,i,40)},s.WebGLFilterManager=function(){this.filterStack=[],this.offsetX=0,this.offsetY=0},s.WebGLFilterManager.prototype.constructor=s.WebGLFilterManager,s.WebGLFilterManager.prototype.setContext=function(t){this.gl=t,this.texturePool=[],this.initShaderBuffers()},s.WebGLFilterManager.prototype.begin=function(t,e){this.renderSession=t,this.defaultShader=t.shaderManager.defaultShader;var i=this.renderSession.projection;this.width=2*i.x,this.height=2*-i.y,this.buffer=e},s.WebGLFilterManager.prototype.pushFilter=function(t){var e=this.gl,i=this.renderSession.projection,n=this.renderSession.offset;t._filterArea=t.target.filterArea||t.target.getBounds(),t._previous_stencil_mgr=this.renderSession.stencilManager,this.renderSession.stencilManager=new s.WebGLStencilManager,this.renderSession.stencilManager.setContext(e),e.disable(e.STENCIL_TEST),this.filterStack.push(t);var r=t.filterPasses[0];this.offsetX+=t._filterArea.x,this.offsetY+=t._filterArea.y;var o=this.texturePool.pop();o?o.resize(this.width*this.renderSession.resolution,this.height*this.renderSession.resolution):o=new s.FilterTexture(this.gl,this.width*this.renderSession.resolution,this.height*this.renderSession.resolution),e.bindTexture(e.TEXTURE_2D,o.texture);var a=t._filterArea,h=r.padding;a.x-=h,a.y-=h,a.width+=2*h,a.height+=2*h,a.x<0&&(a.x=0),a.width>this.width&&(a.width=this.width),a.y<0&&(a.y=0),a.height>this.height&&(a.height=this.height),e.bindFramebuffer(e.FRAMEBUFFER,o.frameBuffer),e.viewport(0,0,a.width*this.renderSession.resolution,a.height*this.renderSession.resolution),i.x=a.width/2,i.y=-a.height/2,n.x=-a.x,n.y=-a.y,e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),t._glFilterTexture=o},s.WebGLFilterManager.prototype.popFilter=function(){var t=this.gl,e=this.filterStack.pop(),i=e._filterArea,n=e._glFilterTexture,r=this.renderSession.projection,o=this.renderSession.offset;if(e.filterPasses.length>1){t.viewport(0,0,i.width*this.renderSession.resolution,i.height*this.renderSession.resolution),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray[0]=0,this.vertexArray[1]=i.height,this.vertexArray[2]=i.width,this.vertexArray[3]=i.height,this.vertexArray[4]=0,this.vertexArray[5]=0,this.vertexArray[6]=i.width,this.vertexArray[7]=0,t.bufferSubData(t.ARRAY_BUFFER,0,this.vertexArray),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),this.uvArray[2]=i.width/this.width,this.uvArray[5]=i.height/this.height,this.uvArray[6]=i.width/this.width,this.uvArray[7]=i.height/this.height,t.bufferSubData(t.ARRAY_BUFFER,0,this.uvArray);var a=n,h=this.texturePool.pop();h||(h=new s.FilterTexture(this.gl,this.width*this.renderSession.resolution,this.height*this.renderSession.resolution)),h.resize(this.width*this.renderSession.resolution,this.height*this.renderSession.resolution),t.bindFramebuffer(t.FRAMEBUFFER,h.frameBuffer),t.clear(t.COLOR_BUFFER_BIT),t.disable(t.BLEND);for(var l=0;l<e.filterPasses.length-1;l++){var c=e.filterPasses[l];t.bindFramebuffer(t.FRAMEBUFFER,h.frameBuffer),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,a.texture),this.applyFilterPass(c,i,i.width,i.height);var u=a;a=h,h=u}t.enable(t.BLEND),n=a,this.texturePool.push(h)}var d=e.filterPasses[e.filterPasses.length-1];this.offsetX-=i.x,this.offsetY-=i.y;var p=this.width,f=this.height,g=0,m=0,y=this.buffer;if(0===this.filterStack.length)t.colorMask(!0,!0,!0,!0);else{var v=this.filterStack[this.filterStack.length-1];p=(i=v._filterArea).width,f=i.height,g=i.x,m=i.y,y=v._glFilterTexture.frameBuffer}r.x=p/2,r.y=-f/2,o.x=g,o.y=m;var x=(i=e._filterArea).x-g,b=i.y-m;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray[0]=x,this.vertexArray[1]=b+i.height,this.vertexArray[2]=x+i.width,this.vertexArray[3]=b+i.height,this.vertexArray[4]=x,this.vertexArray[5]=b,this.vertexArray[6]=x+i.width,this.vertexArray[7]=b,t.bufferSubData(t.ARRAY_BUFFER,0,this.vertexArray),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),this.uvArray[2]=i.width/this.width,this.uvArray[5]=i.height/this.height,this.uvArray[6]=i.width/this.width,this.uvArray[7]=i.height/this.height,t.bufferSubData(t.ARRAY_BUFFER,0,this.uvArray),t.viewport(0,0,p*this.renderSession.resolution,f*this.renderSession.resolution),t.bindFramebuffer(t.FRAMEBUFFER,y),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,n.texture),this.renderSession.stencilManager&&this.renderSession.stencilManager.destroy(),this.renderSession.stencilManager=e._previous_stencil_mgr,e._previous_stencil_mgr=null,this.renderSession.stencilManager.count>0?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.applyFilterPass(d,i,p,f),this.texturePool.push(n),e._glFilterTexture=null},s.WebGLFilterManager.prototype.applyFilterPass=function(t,e,i,n){var r=this.gl,o=t.shaders[r.id];o||((o=new s.PixiShader(r)).fragmentSrc=t.fragmentSrc,o.uniforms=t.uniforms,o.init(!0),t.shaders[r.id]=o),this.renderSession.shaderManager.setShader(o),r.uniform2f(o.projectionVector,i/2,-n/2),r.uniform2f(o.offsetVector,0,0),t.uniforms.dimensions&&(t.uniforms.dimensions.value[0]=this.width,t.uniforms.dimensions.value[1]=this.height,t.uniforms.dimensions.value[2]=this.vertexArray[0],t.uniforms.dimensions.value[3]=this.vertexArray[5]),o.syncUniforms(),r.bindBuffer(r.ARRAY_BUFFER,this.vertexBuffer),r.vertexAttribPointer(o.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,this.uvBuffer),r.vertexAttribPointer(o.aTextureCoord,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,this.colorBuffer),r.vertexAttribPointer(o.colorAttribute,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,this.indexBuffer),r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0),this.renderSession.drawCount++},s.WebGLFilterManager.prototype.initShaderBuffers=function(){var t=this.gl;this.vertexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.vertexArray=new Float32Array([0,0,1,0,0,1,1,1]),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertexArray,t.STATIC_DRAW),this.uvArray=new Float32Array([0,0,1,0,0,1,1,1]),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),t.bufferData(t.ARRAY_BUFFER,this.uvArray,t.STATIC_DRAW),this.colorArray=new Float32Array([1,16777215,1,16777215,1,16777215,1,16777215]),t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colorArray,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,1,3,2]),t.STATIC_DRAW)},s.WebGLFilterManager.prototype.destroy=function(){var t=this.gl;this.filterStack=null,this.offsetX=0,this.offsetY=0;for(var e=0;e<this.texturePool.length;e++)this.texturePool[e].destroy();this.texturePool=null,t.deleteBuffer(this.vertexBuffer),t.deleteBuffer(this.uvBuffer),t.deleteBuffer(this.colorBuffer),t.deleteBuffer(this.indexBuffer)};var n={36054:"Incomplete attachment",36055:"Missing attachment",36057:"Incomplete dimensions",36061:"Framebuffer unsupported"};return s.FilterTexture=function(t,i,n,r,o){o="number"==typeof o?o:0,this.gl=t,this.frameBuffer=e(t,i,n,r||s.scaleModes.DEFAULT,o),this.texture=this.frameBuffer.targetTexture,this.width=i,this.height=n,this.renderBuffer=this.frameBuffer.renderBuffer},s.FilterTexture.prototype.constructor=s.FilterTexture,s.FilterTexture.prototype.clear=function(){var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},s.FilterTexture.prototype.resize=function(t,e){if(this.width!==t||this.height!==e){this.width=t,this.height=e;var i=this.gl;i.bindTexture(i.TEXTURE_2D,this.texture),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,e,0,i.RGBA,i.UNSIGNED_BYTE,null),i.bindRenderbuffer(i.RENDERBUFFER,this.renderBuffer),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t,e)}},s.FilterTexture.prototype.destroy=function(){var t=this.gl;t.deleteFramebuffer(this.frameBuffer),t.deleteTexture(this.texture),this.frameBuffer=null,this.texture=null},s.CanvasBuffer=function(t,e){this.width=t,this.height=e,this.canvas=Phaser.CanvasPool.create(this,this.width,this.height),this.context=this.canvas.getContext("2d"),this.canvas.width=t,this.canvas.height=e},s.CanvasBuffer.prototype.constructor=s.CanvasBuffer,s.CanvasBuffer.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.width,this.height)},s.CanvasBuffer.prototype.resize=function(t,e){this.width=this.canvas.width=t,this.height=this.canvas.height=e},s.CanvasBuffer.prototype.destroy=function(){Phaser.CanvasPool.remove(this)},s.CanvasMaskManager=function(){},s.CanvasMaskManager.prototype.constructor=s.CanvasMaskManager,s.CanvasMaskManager.prototype.pushMask=function(t,e){var i=e.context;i.save();var n=t.alpha,r=t.worldTransform,o=e.resolution;i.setTransform(r.a*o,r.b*o,r.c*o,r.d*o,r.tx*o,r.ty*o),s.CanvasGraphics.renderGraphicsMask(t,i),i.clip(),t.worldAlpha=n},s.CanvasMaskManager.prototype.popMask=function(t){t.context.restore()},s.CanvasTinter=function(){},s.CanvasTinter.getTintedTexture=function(t,e){var i=t.tintedTexture||Phaser.CanvasPool.create(this);return s.CanvasTinter.tintMethod(t.texture,e,i),i},s.CanvasTinter.tintWithMultiply=function(t,e,i){var s=i.getContext("2d"),n=t.crop,r=n.width,o=n.height;t.rotated&&(r=o,o=n.width),i.width===r&&i.height===o||(i.width=r,i.height=o),s.clearRect(0,0,r,o),s.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),s.fillRect(0,0,r,o),s.globalCompositeOperation="multiply",s.drawImage(t.baseTexture.source,n.x,n.y,r,o,0,0,r,o),s.globalCompositeOperation="destination-atop",s.drawImage(t.baseTexture.source,n.x,n.y,r,o,0,0,r,o)},s.CanvasTinter.tintWithPerPixel=function(t,e,i){var n=i.getContext("2d"),r=t.crop,o=r.width,a=r.height;t.rotated&&(o=a,a=r.width),i.width===o&&i.height===a||(i.width=o,i.height=a),n.globalCompositeOperation="copy",n.drawImage(t.baseTexture.source,r.x,r.y,o,a,0,0,o,a);for(var h=Phaser.Color.hexToRGBArray(e),l=h[0],c=h[1],u=h[2],d=n.getImageData(0,0,o,a),p=d.data,f=0;f<p.length;f+=4)if(p[f+0]*=l,p[f+1]*=c,p[f+2]*=u,!s.CanvasTinter.canHandleAlpha){var g=p[f+3];p[f+0]/=255/g,p[f+1]/=255/g,p[f+2]/=255/g}n.putImageData(d,0,0)},s.CanvasRenderer=function(t,e){if(this.game=t,s.defaultRenderer||(s.defaultRenderer=this),this.type=Phaser.CANVAS,this.resolution=t.resolution,this.clearBeforeRender=t.clearBeforeRender,this.transparent=t.transparent,this.autoResize=!1,this.width=t.width*this.resolution,this.height=t.height*this.resolution,this.view=t.canvas,this.context=this.view.getContext("2d",{alpha:this.transparent}),!this.context)throw new Error("Failed to create a Canvas 2d context.");this.refresh=!0,this.count=0,this.maskManager=new s.CanvasMaskManager,this.renderSession={context:this.context,maskManager:this.maskManager,scaleMode:null,smoothProperty:Phaser.Canvas.getSmoothingPrefix(this.context),roundPixels:e.roundPixels||!1},this.mapBlendModes(),this.resize(this.width,this.height)},s.CanvasRenderer.prototype.constructor=s.CanvasRenderer,s.CanvasRenderer.prototype.render=function(t){this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=1,this.renderSession.currentBlendMode=0,this.renderSession.shakeX=this.game.camera._shake.x,this.renderSession.shakeY=this.game.camera._shake.y,this.context.globalCompositeOperation="source-over",navigator.isCocoonJS&&this.view.screencanvas&&(this.context.fillStyle="black",this.context.clear()),this.clearBeforeRender&&(this.transparent?this.context.clearRect(0,0,this.width,this.height):t._bgColor&&(this.context.fillStyle=t._bgColor.rgba,this.context.fillRect(0,0,this.width,this.height))),this.renderDisplayObject(t)},s.CanvasRenderer.prototype.setTexturePriority=function(){},s.CanvasRenderer.prototype.destroy=function(t){void 0===t&&(t=!0),t&&this.view.parent&&this.view.parent.removeChild(this.view),this.view=null,this.context=null,this.maskManager=null,this.renderSession=null},s.CanvasRenderer.prototype.resize=function(t,e){this.width=t*this.resolution,this.height=e*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px"),this.renderSession.smoothProperty&&(this.context[this.renderSession.smoothProperty]=this.renderSession.scaleMode===s.scaleModes.LINEAR)},s.CanvasRenderer.prototype.renderDisplayObject=function(t,e,i){this.renderSession.context=e||this.context,this.renderSession.resolution=this.resolution,t._renderCanvas(this.renderSession,i)},s.CanvasRenderer.prototype.mapBlendModes=function(){if(!s.blendModesCanvas){var t=[],e=s.blendModes,i=this.game.device.canUseMultiply;t[e.NORMAL]="source-over",t[e.ADD]="lighter",t[e.MULTIPLY]=i?"multiply":"source-over",t[e.SCREEN]=i?"screen":"source-over",t[e.OVERLAY]=i?"overlay":"source-over",t[e.DARKEN]=i?"darken":"source-over",t[e.LIGHTEN]=i?"lighten":"source-over",t[e.COLOR_DODGE]=i?"color-dodge":"source-over",t[e.COLOR_BURN]=i?"color-burn":"source-over",t[e.HARD_LIGHT]=i?"hard-light":"source-over",t[e.SOFT_LIGHT]=i?"soft-light":"source-over",t[e.DIFFERENCE]=i?"difference":"source-over",t[e.EXCLUSION]=i?"exclusion":"source-over",t[e.HUE]=i?"hue":"source-over",t[e.SATURATION]=i?"saturation":"source-over",t[e.COLOR]=i?"color":"source-over",t[e.LUMINOSITY]=i?"luminosity":"source-over",s.blendModesCanvas=t}},s.BaseTexture=function(t,e,i){this.resolution=i||1,this.width=100,this.height=100,this.scaleMode=e||s.scaleModes.DEFAULT,this.hasLoaded=!1,this.source=t,this.premultipliedAlpha=!0,this._glTextures=[],this.mipmap=!1,this.textureIndex=0,this._dirty=[!0,!0,!0,!0],t&&((this.source.complete||this.source.getContext)&&this.source.width&&this.source.height&&(this.hasLoaded=!0,this.width=this.source.naturalWidth||this.source.width,this.height=this.source.naturalHeight||this.source.height,this.dirty()),this.skipRender=!1,this._powerOf2=!1)},s.BaseTexture.prototype.constructor=s.BaseTexture,s.BaseTexture.prototype.forceLoaded=function(t,e){this.hasLoaded=!0,this.width=t,this.height=e,this.dirty()},s.BaseTexture.prototype.destroy=function(){this.source&&Phaser.CanvasPool.removeByCanvas(this.source),this.source=null,this.unloadFromGPU()},s.BaseTexture.prototype.dirty=function(){for(var t=0;t<this._glTextures.length;t++)this._dirty[t]=!0},s.BaseTexture.prototype.unloadFromGPU=function(){this.dirty();for(var t=this._glTextures.length-1;t>=0;t--){var e=this._glTextures[t],i=s.glContexts[t];i&&e&&i.deleteTexture(e)}this._glTextures.length=0,this.dirty()},s.BaseTexture.fromCanvas=function(t,e,i){return 0===t.width&&(t.width=1),0===t.height&&(t.height=1),i=i||1,new s.BaseTexture(t,e,i)},s.TextureSilentFail=!1,s.Texture=function(t,e,i,n){this.noFrame=!1,e||(this.noFrame=!0,e=new s.Rectangle(0,0,1,1)),t instanceof s.Texture&&(t=t.baseTexture),this.baseTexture=t,this.frame=e,this.trim=n,this.valid=!1,this.isTiling=!1,this.requiresUpdate=!1,this.requiresReTint=!1,this._uvs=null,this.width=0,this.height=0,this.crop=i||new s.Rectangle(0,0,1,1),this.rotated=!1,t.hasLoaded&&(this.noFrame&&(e=new s.Rectangle(0,0,t.width,t.height)),this.setFrame(e))},s.Texture.prototype.constructor=s.Texture,s.Texture.prototype.onBaseTextureLoaded=function(){var t=this.baseTexture;this.noFrame&&(this.frame=new s.Rectangle(0,0,t.width,t.height)),this.setFrame(this.frame)},s.Texture.prototype.destroy=function(t){t&&this.baseTexture.destroy(),this.valid=!1},s.Texture.prototype.setFrame=function(t){if(this.noFrame=!1,this.frame=t,this.width=t.width,this.height=t.height,this.crop.x=t.x,this.crop.y=t.y,this.crop.width=t.width,this.crop.height=t.height,this.trim||!(t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height))this.valid=t&&t.width&&t.height&&this.baseTexture.source&&this.baseTexture.hasLoaded,this.trim&&(this.width=this.trim.width,this.height=this.trim.height,this.frame.width=this.trim.width,this.frame.height=this.trim.height),this.valid&&this._updateUvs();else{if(!s.TextureSilentFail)throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=!1}},s.Texture.prototype._updateUvs=function(){this._uvs||(this._uvs=new s.TextureUvs);var t=this.crop,e=this.baseTexture.width,i=this.baseTexture.height;this._uvs.x0=t.x/e,this._uvs.y0=t.y/i,this._uvs.x1=(t.x+t.width)/e,this._uvs.y1=t.y/i,this._uvs.x2=(t.x+t.width)/e,this._uvs.y2=(t.y+t.height)/i,this._uvs.x3=t.x/e,this._uvs.y3=(t.y+t.height)/i},s.Texture.prototype._updateUvsInverted=function(){this._uvs||(this._uvs=new s.TextureUvs);var t=this.crop,e=this.baseTexture.width,i=this.baseTexture.height;this._uvs.x0=t.x/e,this._uvs.y0=t.y/i,this._uvs.x1=(t.x+t.height)/e,this._uvs.y1=t.y/i,this._uvs.x2=(t.x+t.height)/e,this._uvs.y2=(t.y+t.width)/i,this._uvs.x3=t.x/e,this._uvs.y3=(t.y+t.width)/i},s.Texture.fromCanvas=function(t,e){var i=s.BaseTexture.fromCanvas(t,e);return new s.Texture(i)},s.TextureUvs=function(){this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=s),exports.PIXI=s):"undefined"!=typeof define&&define.amd?define("PIXI",i.PIXI=s):i.PIXI=s,s}.call(this),function(){var t=this,e=e||{VERSION:"2.11.1",GAMES:[],AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,WEBGL_MULTI:4,NONE:0,LEFT:1,RIGHT:2,UP:3,DOWN:4,SPRITE:0,BUTTON:1,IMAGE:2,GRAPHICS:3,TEXT:4,TILESPRITE:5,BITMAPTEXT:6,GROUP:7,RENDERTEXTURE:8,TILEMAP:9,TILEMAPLAYER:10,EMITTER:11,POLYGON:12,BITMAPDATA:13,CANVAS_FILTER:14,WEBGL_FILTER:15,ELLIPSE:16,SPRITEBATCH:17,RETROFONT:18,POINTER:19,ROPE:20,CIRCLE:21,RECTANGLE:22,LINE:23,MATRIX:24,POINT:25,ROUNDEDRECTANGLE:26,CREATURE:27,VIDEO:28,PENDING_ATLAS:-1,HORIZONTAL:0,VERTICAL:1,LANDSCAPE:0,PORTRAIT:1,ANGLE_UP:270,ANGLE_DOWN:90,ANGLE_LEFT:180,ANGLE_RIGHT:0,ANGLE_NORTH_EAST:315,ANGLE_NORTH_WEST:225,ANGLE_SOUTH_EAST:45,ANGLE_SOUTH_WEST:135,TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12,blendModes:{NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},scaleModes:{DEFAULT:0,LINEAR:0,NEAREST:1},PIXI:PIXI||{},_UID:0};if("undefined"!=typeof AudioBufferSourceNode&&(AudioBufferSourceNode.prototype.start||(AudioBufferSourceNode.prototype.start=AudioBufferSourceNode.prototype.noteGrainOn),AudioBufferSourceNode.prototype.stop||(AudioBufferSourceNode.prototype.stop=AudioBufferSourceNode.prototype.noteOff)),Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Function.prototype.bind||(Function.prototype.bind=function(){var t=Array.prototype.slice;return function(e){function i(){var r=n.concat(t.call(arguments));s.apply(this instanceof i?this:e,r)}var s=this,n=t.call(arguments,1);if("function"!=typeof s)throw new TypeError;return i.prototype=function t(e){if(e&&(t.prototype=e),!(this instanceof t))return new t}(s.prototype),i}}()),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Array.prototype.forEach||(Array.prototype.forEach=function(t){"use strict";if(void 0===this||null===this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var s=arguments.length>=2?arguments[1]:void 0,n=0;n<i;n++)n in e&&t.call(s,e[n],n,e)}),"function"!=typeof window.Uint32Array&&"object"!=typeof window.Uint32Array){var i=function(t){var e=new Array;window[t]=function(t){if("number"==typeof t){Array.call(this,t),this.length=t;for(e=0;e<this.length;e++)this[e]=0}else{Array.call(this,t.length),this.length=t.length;for(var e=0;e<this.length;e++)this[e]=t[e]}},window[t].prototype=e,window[t].constructor=window[t]};i("Float32Array"),i("Uint32Array"),i("Uint16Array"),i("Int16Array"),i("ArrayBuffer")}window.console||(window.console={},window.console.log=window.console.assert=function(){},window.console.warn=window.console.assert=function(){}),Object.assign||(Object.assign=function(t,e){"use strict";if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),s=Object.prototype.hasOwnProperty,n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var o in r)s.call(r,o)&&(i[o]=r[o])}return i}),e.Utils={defaults:function(t,e){for(var i=Object.keys(e),s=0,n=i.length;s<n;s++){var r=i[s];void 0===t[r]&&(t[r]=e[r])}return t},reverseString:function(t){return t.split("").reverse().join("")},getProperty:function(t,e){var i=e.split(".");switch(i.length){case 1:return t[e];case 2:return t[i[0]][i[1]];case 3:return t[i[0]][i[1]][i[2]];case 4:return t[i[0]][i[1]][i[2]][i[3]];default:return this._getProperty(t,e)}},setProperties:function(t,e){for(var i in e)this.setProperty(t,i,e[i]);return t},setProperty:function(t,e,i){var s=e.split(".");switch(s.length){case 1:t[e]=i;break;case 2:t[s[0]][s[1]]=i;break;case 3:t[s[0]][s[1]][s[2]]=i;break;case 4:t[s[0]][s[1]][s[2]][s[3]]=i;break;default:this._setProperty(t,e,i)}},_getProperty:function(t,e){for(var i=e.split("."),s=i.length,n=0,r=t;n<s;){var o=i[n];if(null==r)return;r=r[o],n++}return r},_setProperty:function(t,e,i){var s=e.split("."),n=s.length,r=0,o=t,a=s[0];if(1===n)t[e]=i;else{for(;r<n-1;)o=o[a],a=s[++r];o[a]=i}return t},chanceRoll:function(t){return void 0===t&&(t=50),t>0&&100*Math.random()<=t},randomChoice:function(t,e){return Math.random()<.5?t:e},parseDimension:function(t,e){var i=0,s=0;return"string"==typeof t?"%"===t.substr(-1)?(i=parseInt(t,10)/100,s=0===e?window.innerWidth*i:window.innerHeight*i):s=parseInt(t,10):s=t,s},pad:function(t,e,i,s){if(void 0===e)var e=0;if(void 0===i)var i=" ";if(void 0===s)var s=3;var n=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2),o=n-r;t=new Array(o+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t},isPlainObject:function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},extend:function(){var t,i,s,n,r,o,a=arguments[0]||{},h=1,l=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[1]||{},h=2),l===h&&(a=this,--h);h<l;h++)if(null!=(t=arguments[h]))for(i in t)s=a[i],a!==(n=t[i])&&(c&&n&&(e.Utils.isPlainObject(n)||(r=Array.isArray(n)))?(r?(r=!1,o=s&&Array.isArray(s)?s:[]):o=s&&e.Utils.isPlainObject(s)?s:{},a[i]=e.Utils.extend(c,o,n)):void 0!==n&&(a[i]=n));return a},mixinPrototype:function(t,e,i){void 0===i&&(i=!1);for(var s=Object.keys(e),n=0;n<s.length;n++){var r=s[n],o=e[r];!i&&r in t||(!o||"function"!=typeof o.get&&"function"!=typeof o.set?t[r]=o:"function"==typeof o.clone?t[r]=o.clone():Object.defineProperty(t,r,o))}},mixin:function(t,i){if(!t||"object"!=typeof t)return i;for(var s in t){var n=t[s];if(!n.childNodes&&!n.cloneNode){var r=typeof t[s];t[s]&&"object"===r?typeof i[s]===r?i[s]=e.Utils.mixin(t[s],i[s]):i[s]=e.Utils.mixin(t[s],new n.constructor):i[s]=t[s]}}return i}},e.Circle=function(t,i,s){t=t||0,i=i||0,s=s||0,this.x=t,this.y=i,this._diameter=s,this._radius=0,s>0&&(this._radius=.5*s),this.type=e.CIRCLE},e.Circle.prototype={circumference:function(){return Math.PI*this._radius*2},random:function(t){void 0===t&&(t=new e.Point);var i=2*Math.PI*Math.random(),s=Math.random()+Math.random(),n=s>1?2-s:s,r=n*Math.cos(i),o=n*Math.sin(i);return t.x=this.x+r*this.radius,t.y=this.y+o*this.radius,t},getBounds:function(){return new e.Rectangle(this.x-this.radius,this.y-this.radius,this.diameter,this.diameter)},setTo:function(t,e,i){return this.x=t,this.y=e,this._diameter=i,this._radius=.5*i,this},copyFrom:function(t){return this.setTo(t.x,t.y,t.diameter)},copyTo:function(t){return t.x=this.x,t.y=this.y,t.diameter=this._diameter,t},distance:function(t,i){var s=e.Math.distance(this.x,this.y,t.x,t.y);return i?Math.round(s):s},clone:function(t){return void 0===t||null===t?t=new e.Circle(this.x,this.y,this.diameter):t.setTo(this.x,this.y,this.diameter),t},contains:function(t,i){return e.Circle.contains(this,t,i)},circumferencePoint:function(t,i,s){return e.Circle.circumferencePoint(this,t,i,s)},sample:function(t,i,s,n,r){t||(t=60),null==i&&(i=0),null==s&&(s=e.Math.PI2),r||(r=[]);for(var o=0;o<t;)this.circumferencePoint(e.Math.linear(i,s,o/t),n,r[o]||(r[o]=new e.Point)),o+=1;return r},offset:function(t,e){return this.x+=t,this.y+=e,this},offsetPoint:function(t){return this.offset(t.x,t.y)},toString:function(){return"[{Phaser.Circle (x="+this.x+" y="+this.y+" diameter="+this.diameter+" radius="+this.radius+")}]"}},e.Circle.prototype.constructor=e.Circle,Object.defineProperty(e.Circle.prototype,"diameter",{get:function(){return this._diameter},set:function(t){t>0&&(this._diameter=t,this._radius=.5*t)}}),Object.defineProperty(e.Circle.prototype,"radius",{get:function(){return this._radius},set:function(t){t>0&&(this._radius=t,this._diameter=2*t)}}),Object.defineProperty(e.Circle.prototype,"left",{get:function(){return this.x-this._radius},set:function(t){t>this.x?(this._radius=0,this._diameter=0):this.radius=this.x-t}}),Object.defineProperty(e.Circle.prototype,"right",{get:function(){return this.x+this._radius},set:function(t){t<this.x?(this._radius=0,this._diameter=0):this.radius=t-this.x}}),Object.defineProperty(e.Circle.prototype,"top",{get:function(){return this.y-this._radius},set:function(t){t>this.y?(this._radius=0,this._diameter=0):this.radius=this.y-t}}),Object.defineProperty(e.Circle.prototype,"bottom",{get:function(){return this.y+this._radius},set:function(t){t<this.y?(this._radius=0,this._diameter=0):this.radius=t-this.y}}),Object.defineProperty(e.Circle.prototype,"area",{get:function(){return this._radius>0?Math.PI*this._radius*this._radius:0}}),Object.defineProperty(e.Circle.prototype,"empty",{get:function(){return 0===this._diameter},set:function(t){!0===t&&this.setTo(0,0,0)}}),e.Circle.contains=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius},e.Circle.equals=function(t,e){return t.x===e.x&&t.y===e.y&&t.diameter===e.diameter},e.Circle.intersects=function(t,i){return e.Math.distance(t.x,t.y,i.x,i.y)<=t.radius+i.radius},e.Circle.circumferencePoint=function(t,i,s,n){return void 0===s&&(s=!1),void 0===n&&(n=new e.Point),!0===s&&(i=e.Math.degToRad(i)),n.x=t.x+t.radius*Math.cos(i),n.y=t.y+t.radius*Math.sin(i),n},e.Circle.intersectsRectangle=function(t,e){var i=Math.abs(t.x-e.x-e.halfWidth);if(i>e.halfWidth+t.radius)return!1;var s=Math.abs(t.y-e.y-e.halfHeight);if(s>e.halfHeight+t.radius)return!1;if(i<=e.halfWidth||s<=e.halfHeight)return!0;var n=i-e.halfWidth,r=s-e.halfHeight;return n*n+r*r<=t.radius*t.radius},e.Circle.intersectsLine=function(t,i,s){var n=t.x,r=t.y,o=(i.end.y-i.start.y)/(i.end.x-i.start.x),a=i.end.y-o*i.end.x,h=t.radius,l=t.radius,c=a+o*n,u=(n*(l*l)-o*(h*h)*(a-r)+h*l*Math.sqrt(h*h*(o*o)+l*l-c*c-r*r+2*c*r))/(h*h*(o*o)+l*l),d=(n*(l*l)-o*(h*h)*(a-r)-h*l*Math.sqrt(h*h*(o*o)+l*l-c*c-r*r+2*c*r))/(h*h*(o*o)+l*l),p=o*u+a,f=o*d+a,g=new e.Point(u,p),m=new e.Point(d,f),y=i.pointOnSegment(g.x,g.y,.01),v=i.pointOnSegment(m.x,m.y,.01);return y&&v?!s||[g,m]:y?!s||[g]:v?!s||[m]:!!s&&[]},PIXI.Circle=e.Circle,e.Ellipse=function(t,i,s,n){t=t||0,i=i||0,s=s||0,n=n||0,this.x=t,this.y=i,this.width=s,this.height=n,this.type=e.ELLIPSE},e.Ellipse.prototype={setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},getBounds:function(){return new e.Rectangle(this.x-this.width,this.y-this.height,this.width,this.height)},copyFrom:function(t){return this.setTo(t.x,t.y,t.width,t.height)},copyTo:function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},clone:function(t){return void 0===t||null===t?t=new e.Ellipse(this.x,this.y,this.width,this.height):t.setTo(this.x,this.y,this.width,this.height),t},contains:function(t,i){return e.Ellipse.contains(this,t,i)},random:function(t){void 0===t&&(t=new e.Point);var i=Math.random()*Math.PI*2,s=Math.sqrt(Math.random());return t.x=this.centerX+.5*s*Math.cos(i)*this.width,t.y=this.centerY+.5*s*Math.sin(i)*this.height,t},toString:function(){return"[{Phaser.Ellipse (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")}]"}},e.Ellipse.prototype.constructor=e.Ellipse,Object.defineProperty(e.Ellipse.prototype,"left",{get:function(){return this.x},set:function(t){this.x=t}}),Object.defineProperty(e.Ellipse.prototype,"right",{get:function(){return this.x+this.width},set:function(t){t<this.x?this.width=0:this.width=t-this.x}}),Object.defineProperty(e.Ellipse.prototype,"top",{get:function(){return this.y},set:function(t){this.y=t}}),Object.defineProperty(e.Ellipse.prototype,"bottom",{get:function(){return this.y+this.height},set:function(t){t<this.y?this.height=0:this.height=t-this.y}}),Object.defineProperty(e.Ellipse.prototype,"centerX",{get:function(){return this.x+.5*this.width}}),Object.defineProperty(e.Ellipse.prototype,"centerY",{get:function(){return this.y+.5*this.height}}),Object.defineProperty(e.Ellipse.prototype,"empty",{get:function(){return 0===this.width||0===this.height},set:function(t){!0===t&&this.setTo(0,0,0,0)}}),e.Ellipse.contains=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width-.5,n=(i-t.y)/t.height-.5;return s*=s,n*=n,s+n<.25},e.Ellipse.intersectsLine=function(t,i,s){var n=t.x,r=t.y,o=(i.end.y-i.start.y)/(i.end.x-i.start.x),a=i.end.y-o*i.end.x,h=t.width/2,l=t.height/2,c=a+o*n,u=(n*(l*l)-o*(h*h)*(a-r)+h*l*Math.sqrt(h*h*(o*o)+l*l-c*c-r*r+2*c*r))/(h*h*(o*o)+l*l),d=(n*(l*l)-o*(h*h)*(a-r)-h*l*Math.sqrt(h*h*(o*o)+l*l-c*c-r*r+2*c*r))/(h*h*(o*o)+l*l),p=o*u+a,f=o*d+a,g=new e.Point(u,p),m=new e.Point(d,f),y=i.pointOnSegment(g.x,g.y,.01),v=i.pointOnSegment(m.x,m.y,.01);return y&&v?!s||[g,m]:y?!s||[g]:v?!s||[m]:!!s&&[]},PIXI.Ellipse=e.Ellipse,e.Line=function(t,i,s,n){t=t||0,i=i||0,s=s||0,n=n||0,this.start=new e.Point(t,i),this.end=new e.Point(s,n),this.type=e.LINE},e.Line.prototype={setTo:function(t,e,i,s){return this.start.setTo(t,e),this.end.setTo(i,s),this},fromPoints:function(t,e){return this.setTo(t.x,t.y,e.x,e.y),this},fromSprite:function(t,e,i){return void 0===i&&(i=!1),i?this.setTo(t.centerX,t.centerY,e.centerX,e.centerY):this.fromPoints(t,e)},fromAngle:function(t,e,i,s){return this.start.setTo(t,e),this.end.setTo(t+Math.cos(i)*s,e+Math.sin(i)*s),this},rotate:function(t,e){var i=(this.start.x+this.end.x)/2,s=(this.start.y+this.end.y)/2;return this.start.rotate(i,s,t,e),this.end.rotate(i,s,t,e),this},rotateAround:function(t,e,i,s){return this.start.rotate(t,e,i,s),this.end.rotate(t,e,i,s),this},intersects:function(t,i,s){return e.Line.intersectsPoints(this.start,this.end,t.start,t.end,i,s)},reflect:function(t){return e.Line.reflect(this,t)},midPoint:function(t){return void 0===t&&(t=new e.Point),t.x=(this.start.x+this.end.x)/2,t.y=(this.start.y+this.end.y)/2,t},centerOn:function(t,e){var i=t-(this.start.x+this.end.x)/2,s=e-(this.start.y+this.end.y)/2;this.start.add(i,s),this.end.add(i,s)},pointOnLine:function(t,i,s){return e.Math.fuzzyEqual((t-this.start.x)*(this.end.y-this.start.y),(this.end.x-this.start.x)*(i-this.start.y),s||0)},pointOnSegment:function(t,e,i){var s=Math.min(this.start.x,this.end.x),n=Math.max(this.start.x,this.end.x),r=Math.min(this.start.y,this.end.y),o=Math.max(this.start.y,this.end.y);return this.pointOnLine(t,e,i)&&t>=s&&t<=n&&e>=r&&e<=o},random:function(t){void 0===t&&(t=new e.Point);var i=Math.random();return t.x=this.start.x+i*(this.end.x-this.start.x),t.y=this.start.y+i*(this.end.y-this.start.y),t},coordinatesOnLine:function(t,e){void 0===t&&(t=1),void 0===e&&(e=[]);var i=Math.round(this.start.x),s=Math.round(this.start.y),n=Math.round(this.end.x),r=Math.round(this.end.y),o=Math.abs(n-i),a=Math.abs(r-s),h=i<n?1:-1,l=s<r?1:-1,c=o-a;e.push([i,s]);for(var u=1;i!==n||s!==r;){var d=c<<1;d>-a&&(c-=a,i+=h),d<o&&(c+=o,s+=l),u%t==0&&e.push([i,s]),u++}return e},clone:function(t){return void 0===t||null===t?t=new e.Line(this.start.x,this.start.y,this.end.x,this.end.y):t.setTo(this.start.x,this.start.y,this.end.x,this.end.y),t}},Object.defineProperty(e.Line.prototype,"length",{get:function(){return Math.sqrt((this.end.x-this.start.x)*(this.end.x-this.start.x)+(this.end.y-this.start.y)*(this.end.y-this.start.y))}}),Object.defineProperty(e.Line.prototype,"angle",{get:function(){return e.Point.angle(this.end,this.start)}}),Object.defineProperty(e.Line.prototype,"slope",{get:function(){return(this.end.y-this.start.y)/(this.end.x-this.start.x)}}),Object.defineProperty(e.Line.prototype,"perpSlope",{get:function(){return-(this.end.x-this.start.x)/(this.end.y-this.start.y)}}),Object.defineProperty(e.Line.prototype,"x",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(e.Line.prototype,"y",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(e.Line.prototype,"left",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(e.Line.prototype,"right",{get:function(){return Math.max(this.start.x,this.end.x)}}),Object.defineProperty(e.Line.prototype,"top",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(e.Line.prototype,"bottom",{get:function(){return Math.max(this.start.y,this.end.y)}}),Object.defineProperty(e.Line.prototype,"width",{get:function(){return Math.abs(this.start.x-this.end.x)}}),Object.defineProperty(e.Line.prototype,"height",{get:function(){return Math.abs(this.start.y-this.end.y)}}),Object.defineProperty(e.Line.prototype,"normalX",{get:function(){return Math.cos(this.angle-1.5707963267948966)}}),Object.defineProperty(e.Line.prototype,"normalY",{get:function(){return Math.sin(this.angle-1.5707963267948966)}}),Object.defineProperty(e.Line.prototype,"normalAngle",{get:function(){return e.Math.wrap(this.angle-1.5707963267948966,-Math.PI,Math.PI)}}),e.Line.intersectsPoints=function(t,i,s,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=new e.Point);var a=i.y-t.y,h=n.y-s.y,l=t.x-i.x,c=s.x-n.x,u=i.x*t.y-t.x*i.y,d=n.x*s.y-s.x*n.y,p=a*c-h*l;if(0===p)return null;if(o.x=(l*d-c*u)/p,o.y=(h*u-a*d)/p,r){var f=(n.y-s.y)*(i.x-t.x)-(n.x-s.x)*(i.y-t.y),g=((n.x-s.x)*(t.y-s.y)-(n.y-s.y)*(t.x-s.x))/f,m=((i.x-t.x)*(t.y-s.y)-(i.y-t.y)*(t.x-s.x))/f;return g>=0&&g<=1&&m>=0&&m<=1?o:null}return o},e.Line.intersects=function(t,i,s,n){return e.Line.intersectsPoints(t.start,t.end,i.start,i.end,s,n)},e.Line.intersectsRectangle=function(t,e){if(0===t.length||e.empty)return!1;var i=t.start.x,s=t.start.y,n=t.end.x,r=t.end.y,o=e.x,a=e.y,h=e.right,l=e.bottom,c=0;if(i>=o&&i<=h&&s>=a&&s<=l||n>=o&&n<=h&&r>=a&&r<=l)return!0;if(i<o&&n>=o){if((c=s+(r-s)*(o-i)/(n-i))>a&&c<=l)return!0}else if(i>h&&n<=h&&(c=s+(r-s)*(h-i)/(n-i))>=a&&c<=l)return!0;if(s<a&&r>=a){if((c=i+(n-i)*(a-s)/(r-s))>=o&&c<=h)return!0}else if(s>l&&r<=l&&(c=i+(n-i)*(l-s)/(r-s))>=o&&c<=h)return!0;return!1},e.Line.intersectionWithRectangle=function(t,i,s){var n=e.Line.intersectionWithRectangle;s||(s=new e.Point),n.edges||(n.edges=[new e.Line,new e.Line,new e.Line,new e.Line]),n.edgeIntersection||(n.edgeIntersection=new e.Point);var r=n.edges,o=n.edgeIntersection.set(0),a=i.x,h=i.y,l=i.right,c=i.bottom,u=1/0;r[0].setTo(a,h,l,h),r[1].setTo(a,c,l,c),r[2].setTo(a,h,a,c),r[3].setTo(l,h,l,c);for(var d,p=0;d=r[p];p++)if(t.intersects(d,!0,o)){var f=t.start.distance(o);f<u&&(u=f,s.copyFrom(o))}return null!=f?s:null},e.Line.reflect=function(t,e){return 2*e.normalAngle-3.141592653589793-t.angle},e.Matrix=function(t,i,s,n,r,o){void 0!==t&&null!==t||(t=1),void 0!==i&&null!==i||(i=0),void 0!==s&&null!==s||(s=0),void 0!==n&&null!==n||(n=1),void 0!==r&&null!==r||(r=0),void 0!==o&&null!==o||(o=0),this.a=t,this.b=i,this.c=s,this.d=n,this.tx=r,this.ty=o,this.type=e.MATRIX},e.Matrix.prototype={fromArray:function(t){return this.setTo(t[0],t[1],t[3],t[4],t[2],t[5])},setTo:function(t,e,i,s,n,r){return this.a=t,this.b=e,this.c=i,this.d=s,this.tx=n,this.ty=r,this},clone:function(t){return void 0===t||null===t?t=new e.Matrix(this.a,this.b,this.c,this.d,this.tx,this.ty):(t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty),t},copyTo:function(t){return t.copyFrom(this),t},copyFrom:function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},toArray:function(t,e){return void 0===e&&(e=new Float32Array(9)),t?(e[0]=this.a,e[1]=this.b,e[2]=0,e[3]=this.c,e[4]=this.d,e[5]=0,e[6]=this.tx,e[7]=this.ty,e[8]=1):(e[0]=this.a,e[1]=this.c,e[2]=this.tx,e[3]=this.b,e[4]=this.d,e[5]=this.ty,e[6]=0,e[7]=0,e[8]=1),e},apply:function(t,i){return void 0===i&&(i=new e.Point),i.x=this.a*t.x+this.c*t.y+this.tx,i.y=this.b*t.x+this.d*t.y+this.ty,i},applyInverse:function(t,i){void 0===i&&(i=new e.Point);var s=1/(this.a*this.d+this.c*-this.b),n=t.x,r=t.y;return i.x=this.d*s*n+-this.c*s*r+(this.ty*this.c-this.tx*this.d)*s,i.y=this.a*s*r+-this.b*s*n+(-this.ty*this.a+this.tx*this.b)*s,i},translate:function(t,e){return this.tx+=t,this.ty+=e,this},scale:function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},rotate:function(t){var e=Math.cos(t),i=Math.sin(t),s=this.a,n=this.c,r=this.tx;return this.a=s*e-this.b*i,this.b=s*i+this.b*e,this.c=n*e-this.d*i,this.d=n*i+this.d*e,this.tx=r*e-this.ty*i,this.ty=r*i+this.ty*e,this},append:function(t){var e=this.a,i=this.b,s=this.c,n=this.d;return this.a=t.a*e+t.b*s,this.b=t.a*i+t.b*n,this.c=t.c*e+t.d*s,this.d=t.c*i+t.d*n,this.tx=t.tx*e+t.ty*s+this.tx,this.ty=t.tx*i+t.ty*n+this.ty,this},identity:function(){return this.setTo(1,0,0,1,0,0)}},e.identityMatrix=new e.Matrix,e.Point=function(t,i){t=t||0,i=i||0,this.x=t,this.y=i,this.type=e.POINT},e.Point.prototype={copyFrom:function(t){return this.setTo(t.x,t.y)},invert:function(){return this.setTo(this.y,this.x)},setTo:function(t,i){return e.Point.set(this,t,i)},set:function(t,i){return e.Point.set(this,t,i)},setToPolar:function(t,i,s){return null==i&&(i=1),s&&(t=e.Math.degToRad(t)),this.setTo(Math.cos(t)*i,Math.sin(t)*i)},add:function(t,e){return this.x+=t,this.y+=e,this},subtract:function(t,e){return this.x-=t,this.y-=e,this},multiply:function(t,e){return this.x*=t,this.y*=e,this},divide:function(t,e){return this.x/=t,this.y/=e,this},clampX:function(t,i){return this.x=e.Math.clamp(this.x,t,i),this},clampY:function(t,i){return this.y=e.Math.clamp(this.y,t,i),this},clamp:function(t,i){return this.x=e.Math.clamp(this.x,t,i),this.y=e.Math.clamp(this.y,t,i),this},clip:function(t){var e=t.left,i=t.top,s=t.right,n=t.bottom;return this.x<e?this.x=e:this.x>s&&(this.x=s),this.y<i?this.y=i:this.y>n&&(this.y=n),this},clone:function(t){return void 0===t||null===t?t=new e.Point(this.x,this.y):t.setTo(this.x,this.y),t},copyTo:function(t){return t.x=this.x,t.y=this.y,t},distance:function(t,i){return e.Point.distance(this,t,i)},equals:function(t){return t.x===this.x&&t.y===this.y},equalsXY:function(t,e){return this.x===t&&this.y===e},fuzzyEquals:function(t,i){return e.Point.fuzzyEquals(this,t,i)},fuzzyEqualsXY:function(t,i,s){return e.Point.fuzzyEqualsXY(this,t,i,s)},angle:function(t,e){return this.angleXY(t.x,t.y,e)},angleXY:function(t,i,s){var n=Math.atan2(i-this.y,t-this.x);return s?e.Math.radToDeg(n):n},atan:function(t){var i=Math.atan2(this.y,this.x);return t?e.Math.radToDeg(i):i},rotate:function(t,i,s,n,r){return e.Point.rotate(this,t,i,s,n,r)},getMagnitude:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},getMagnitudeSq:function(){return this.x*this.x+this.y*this.y},setMagnitude:function(t){return this.normalize().multiply(t,t)},normalize:function(){if(!this.isZero()){var t=this.getMagnitude();this.x/=t,this.y/=t}return this},limit:function(t){return this.getMagnitudeSq()>t*t&&this.setMagnitude(t),this},expand:function(t){return this.getMagnitudeSq()<t*t&&this.setMagnitude(t),this},isZero:function(){return 0===this.x&&0===this.y},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},perp:function(){return this.setTo(-this.y,this.x)},rperp:function(){return this.setTo(this.y,-this.x)},normalRightHand:function(){return this.setTo(-1*this.y,this.x)},floor:function(){return this.setTo(Math.floor(this.x),Math.floor(this.y))},ceil:function(){return this.setTo(Math.ceil(this.x),Math.ceil(this.y))},round:function(){return this.setTo(Math.round(this.x),Math.round(this.y))},toString:function(){return"[{Point (x="+this.x+" y="+this.y+")}]"}},e.Point.prototype.constructor=e.Point,e.Point.add=function(t,i,s){return void 0===s&&(s=new e.Point),s.x=t.x+i.x,s.y=t.y+i.y,s},e.Point.subtract=function(t,i,s){return void 0===s&&(s=new e.Point),s.x=t.x-i.x,s.y=t.y-i.y,s},e.Point.multiply=function(t,i,s){return void 0===s&&(s=new e.Point),s.x=t.x*i.x,s.y=t.y*i.y,s},e.Point.divide=function(t,i,s){return void 0===s&&(s=new e.Point),s.x=t.x/i.x,s.y=t.y/i.y,s},e.Point.equals=function(t,e){return t.x===e.x&&t.y===e.y},e.Point.equalsXY=function(t,e,i){return t.x===e&&t.y===i},e.Point.fuzzyEquals=function(t,i,s){return e.Math.fuzzyEquals(t.x,i.x,s)&&e.Math.fuzzyEquals(t.y,i.y,s)},e.Point.fuzzyEqualsXY=function(t,i,s,n){return e.Math.fuzzyEquals(t.x,i,n)&&e.Math.fuzzyEquals(t.y,s,n)},e.Point.angle=function(t,e){return Math.atan2(t.y-e.y,t.x-e.x)},e.Point.negative=function(t,i){return void 0===i&&(i=new e.Point),i.setTo(-t.x,-t.y)},e.Point.multiplyAdd=function(t,i,s,n){return void 0===n&&(n=new e.Point),n.setTo(t.x+i.x*s,t.y+i.y*s)},e.Point.interpolate=function(t,i,s,n){return void 0===n&&(n=new e.Point),n.setTo(t.x+(i.x-t.x)*s,t.y+(i.y-t.y)*s)},e.Point.perp=function(t,i){return void 0===i&&(i=new e.Point),i.setTo(-t.y,t.x)},e.Point.rperp=function(t,i){return void 0===i&&(i=new e.Point),i.setTo(t.y,-t.x)},e.Point.distance=function(t,i,s){var n=e.Math.distance(t.x,t.y,i.x,i.y);return s?Math.round(n):n},e.Point.project=function(t,i,s){void 0===s&&(s=new e.Point);var n=t.dot(i)/i.getMagnitudeSq();return 0!==n&&s.setTo(n*i.x,n*i.y),s},e.Point.projectUnit=function(t,i,s){void 0===s&&(s=new e.Point);var n=t.dot(i);return 0!==n&&s.setTo(n*i.x,n*i.y),s},e.Point.normalRightHand=function(t,i){return void 0===i&&(i=new e.Point),i.setTo(-1*t.y,t.x)},e.Point.normalize=function(t,i){void 0===i&&(i=new e.Point);var s=t.getMagnitude();return 0!==s&&i.setTo(t.x/s,t.y/s),i},e.Point.rotate=function(t,i,s,n,r,o){if(r&&(n=e.Math.degToRad(n)),void 0===o){t.subtract(i,s);var a=Math.sin(n),h=Math.cos(n),l=h*t.x-a*t.y,c=a*t.x+h*t.y;t.x=l+i,t.y=c+s}else{var u=n+Math.atan2(t.y-s,t.x-i);t.x=i+o*Math.cos(u),t.y=s+o*Math.sin(u)}return t},e.Point.centroid=function(t,i){if(void 0===i&&(i=new e.Point),"[object Array]"!==Object.prototype.toString.call(t))throw new Error("Phaser.Point. Parameter 'points' must be an array");var s=t.length;if(s<1)throw new Error("Phaser.Point. Parameter 'points' array must not be empty");if(1===s)return i.copyFrom(t[0]),i;for(var n=0;n<s;n++)e.Point.add(i,t[n],i);return i.divide(s,s),i},e.Point.parse=function(t,i,s){i=i||"x",s=s||"y";var n=new e.Point;return t[i]&&(n.x=parseFloat(t[i],10)),t[s]&&(n.y=parseFloat(t[s],10)),n},e.Point.trunc=function(t){return t.x=e.Math.trunc(t.x),t.y=e.Math.trunc(t.y),t},e.Point.isPoint=function(t){return null!=t&&"number"==typeof t.x&&"number"==typeof t.y},e.Point.set=function(t,e,i){return t.x=e||0,t.y=i||(0!==i?t.x:0),t},e.Point.sortClockwise=function(t,e){e||(e=this.centroid(t));var i=e.x,s=e.y;return t.sort(function(t,e){if(t.x-i>=0&&e.x-i<0)return-1;if(t.x-i<0&&e.x-i>=0)return 1;if(t.x-i==0&&e.x-i==0)return t.y-s>=0||e.y-s>=0?t.y>e.y?1:-1:e.y>t.y?1:-1;var n=(t.x-i)*-(e.y-s)-(e.x-i)*-(t.y-s);return n<0?-1:n>0?1:(t.x-i)*(t.x-i)+(t.y-s)*(t.y-s)>(e.x-i)*(e.x-i)+(e.y-s)*(e.y-s)?-1:1})},PIXI.Point=e.Point,e.Polygon=function(){this.area=0,this._points=[],arguments.length>0&&this.setTo.apply(this,arguments),this.closed=!0,this.flattened=!1,this.type=e.POLYGON},e.Polygon.prototype={toNumberArray:function(t){void 0===t&&(t=[]);for(var e=0;e<this._points.length;e++)"number"==typeof this._points[e]?(t.push(this._points[e]),t.push(this._points[e+1]),e++):(t.push(this._points[e].x),t.push(this._points[e].y));return t},flatten:function(){return this._points=this.toNumberArray(),this.flattened=!0,this},clone:function(t){var i=this._points.slice();return void 0===t||null===t?t=new e.Polygon(i):t.setTo(i),t},contains:function(t,e){var i=!1;if(this.flattened)for(var s=-2,n=this._points.length-2;(s+=2)<this._points.length;n=s){var r=this._points[s],o=this._points[s+1],a=this._points[n],h=this._points[n+1];(o<=e&&e<h||h<=e&&e<o)&&t<(a-r)*(e-o)/(h-o)+r&&(i=!i)}else for(var s=-1,n=this._points.length-1;++s<this._points.length;n=s){var r=this._points[s].x,o=this._points[s].y,a=this._points[n].x,h=this._points[n].y;(o<=e&&e<h||h<=e&&e<o)&&t<(a-r)*(e-o)/(h-o)+r&&(i=!i)}return i},setTo:function(t){if(this.area=0,this._points=[],arguments.length>0){Array.isArray(t)||(t=Array.prototype.slice.call(arguments));for(var e=Number.MAX_VALUE,i=0,s=t.length;i<s;i++){if("number"==typeof t[i]){n=new PIXI.Point(t[i],t[i+1]);i++}else if(Array.isArray(t[i]))n=new PIXI.Point(t[i][0],t[i][1]);else var n=new PIXI.Point(t[i].x,t[i].y);this._points.push(n),n.y<e&&(e=n.y)}this.calculateArea(e)}return this},calculateArea:function(t){for(var e,i,s,n,r=0,o=this._points.length;r<o;r++)e=this._points[r],i=r===o-1?this._points[0]:this._points[r+1],s=(e.y-t+(i.y-t))/2,n=e.x-i.x,this.area+=s*n;return this.area}},e.Polygon.prototype.constructor=e.Polygon,Object.defineProperty(e.Polygon.prototype,"points",{get:function(){return this._points}}),PIXI.Polygon=e.Polygon,e.Rectangle=function(t,i,s,n){t=t||0,i=i||0,s=s||0,n=n||0,this.x=t,this.y=i,this.width=s,this.height=n,this.type=e.RECTANGLE},e.Rectangle.prototype={offset:function(t,e){return this.x+=t,this.y+=e,this},offsetPoint:function(t){return this.offset(t.x,t.y)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},scale:function(t,e){return void 0===e&&(e=t),this.width*=t,this.height*=e,this},centerOn:function(t,e){return this.centerX=t,this.centerY=e,this},floor:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y)},floorAll:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.width=Math.floor(this.width),this.height=Math.floor(this.height)},ceil:function(){this.x=Math.ceil(this.x),this.y=Math.ceil(this.y)},ceilAll:function(){this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.width=Math.ceil(this.width),this.height=Math.ceil(this.height)},copyFrom:function(t){return this.setTo(t.x,t.y,t.width,t.height)},copyFromBounds:function(t){return this.setTo(t.left,t.top,t.width,t.height)},copyTo:function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},inflate:function(t,i){return e.Rectangle.inflate(this,t,i)},size:function(t){return e.Rectangle.size(this,t)},resize:function(t,e){return this.width=t,this.height=e,this},clone:function(t){return e.Rectangle.clone(this,t)},contains:function(t,i){return e.Rectangle.contains(this,t,i)},containsRect:function(t){return e.Rectangle.containsRect(t,this)},equals:function(t){return e.Rectangle.equals(this,t)},intersection:function(t,i){return e.Rectangle.intersection(this,t,i)},intersects:function(t){return e.Rectangle.intersects(this,t)},intersectsRaw:function(t,i,s,n,r){return e.Rectangle.intersectsRaw(this,t,i,s,n,r)},union:function(t,i){return e.Rectangle.union(this,t,i)},random:function(t){return void 0===t&&(t=new e.Point),t.x=this.randomX,t.y=this.randomY,t},getPoint:function(t,i){switch(void 0===i&&(i=new e.Point),t){default:case e.TOP_LEFT:return i.set(this.x,this.y);case e.TOP_CENTER:return i.set(this.centerX,this.y);case e.TOP_RIGHT:return i.set(this.right,this.y);case e.LEFT_CENTER:return i.set(this.x,this.centerY);case e.CENTER:return i.set(this.centerX,this.centerY);case e.RIGHT_CENTER:return i.set(this.right,this.centerY);case e.BOTTOM_LEFT:return i.set(this.x,this.bottom);case e.BOTTOM_CENTER:return i.set(this.centerX,this.bottom);case e.BOTTOM_RIGHT:return i.set(this.right,this.bottom)}},sides:function(t,i,s,n){arguments.length||(t=new e.Line,i=new e.Line,s=new e.Line,n=new e.Line);var r=this.x,o=this.y,a=this.right,h=this.bottom;return t.setTo(r,o,a,o),i.setTo(a,o,a,h),s.setTo(r,h,a,h),n.setTo(r,o,r,h),arguments.length?null:[t,i,s,n]},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},Object.defineProperty(e.Rectangle.prototype,"halfWidth",{get:function(){return Math.round(this.width/2)}}),Object.defineProperty(e.Rectangle.prototype,"halfHeight",{get:function(){return Math.round(this.height/2)}}),Object.defineProperty(e.Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}}),Object.defineProperty(e.Rectangle.prototype,"bottomLeft",{get:function(){return new e.Point(this.x,this.bottom)},set:function(t){this.x=t.x,this.bottom=t.y}}),Object.defineProperty(e.Rectangle.prototype,"bottomRight",{get:function(){return new e.Point(this.right,this.bottom)},set:function(t){this.right=t.x,this.bottom=t.y}}),Object.defineProperty(e.Rectangle.prototype,"left",{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}}),Object.defineProperty(e.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}}),Object.defineProperty(e.Rectangle.prototype,"volume",{get:function(){return this.width*this.height}}),Object.defineProperty(e.Rectangle.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height}}),Object.defineProperty(e.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(t){this.x=t-this.halfWidth}}),Object.defineProperty(e.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(t){this.y=t-this.halfHeight}}),Object.defineProperty(e.Rectangle.prototype,"randomX",{get:function(){return this.x+Math.random()*this.width}}),Object.defineProperty(e.Rectangle.prototype,"randomY",{get:function(){return this.y+Math.random()*this.height}}),Object.defineProperty(e.Rectangle.prototype,"top",{get:function(){return this.y},set:function(t){t>=this.bottom?(this.height=0,this.y=t):this.height=this.bottom-t}}),Object.defineProperty(e.Rectangle.prototype,"topLeft",{get:function(){return new e.Point(this.x,this.y)},set:function(t){this.x=t.x,this.y=t.y}}),Object.defineProperty(e.Rectangle.prototype,"topRight",{get:function(){return new e.Point(this.x+this.width,this.y)},set:function(t){this.right=t.x,this.y=t.y}}),Object.defineProperty(e.Rectangle.prototype,"empty",{get:function(){return!this.width||!this.height},set:function(t){!0===t&&this.setTo(0,0,0,0)}}),e.Rectangle.prototype.constructor=e.Rectangle,e.Rectangle.inflate=function(t,e,i){return t.x-=e,t.width+=2*e,t.y-=i,t.height+=2*i,t},e.Rectangle.inflatePoint=function(t,i){return e.Rectangle.inflate(t,i.x,i.y)},e.Rectangle.size=function(t,i){return void 0===i||null===i?i=new e.Point(t.width,t.height):i.setTo(t.width,t.height),i},e.Rectangle.clone=function(t,i){return void 0===i||null===i?i=new e.Rectangle(t.x,t.y,t.width,t.height):i.setTo(t.x,t.y,t.width,t.height),i},e.Rectangle.createFromBounds=function(t,i){return void 0!==i&&null!==i||(i=new e.Rectangle(t.x,t.y,t.width,t.height)),i.copyFromBounds(t)},e.Rectangle.contains=function(t,e,i){return!(t.width<=0||t.height<=0)&&(e>=t.x&&e<t.right&&i>=t.y&&i<t.bottom)},e.Rectangle.containsRaw=function(t,e,i,s,n,r){return n>=t&&n<t+i&&r>=e&&r<e+s},e.Rectangle.containsPoint=function(t,i){return e.Rectangle.contains(t,i.x,i.y)},e.Rectangle.containsRect=function(t,e){return!(t.volume>e.volume)&&(t.x>=e.x&&t.y>=e.y&&t.right<e.right&&t.bottom<e.bottom)},e.Rectangle.equals=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},e.Rectangle.sameDimensions=function(t,e){return t.width===e.width&&t.height===e.height},e.Rectangle.intersection=function(t,i,s){return void 0===s&&(s=new e.Rectangle),e.Rectangle.intersects(t,i)&&(s.x=Math.max(t.x,i.x),s.y=Math.max(t.y,i.y),s.width=Math.min(t.right,i.right)-s.x,s.height=Math.min(t.bottom,i.bottom)-s.y),s},e.Rectangle.intersects=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.right<e.x||t.bottom<e.y||t.x>e.right||t.y>e.bottom)},e.Rectangle.intersectsRaw=function(t,e,i,s,n,r){return void 0===r&&(r=0),!(e>t.right+r||i<t.left-r||s>t.bottom+r||n<t.top-r)},e.Rectangle.union=function(t,i,s){return void 0===s&&(s=new e.Rectangle),s.setTo(Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.right,i.right)-Math.min(t.left,i.left),Math.max(t.bottom,i.bottom)-Math.min(t.top,i.top))},e.Rectangle.aabb=function(t,i){void 0===i&&(i=new e.Rectangle);var s=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return t.forEach(function(t){t.x>s&&(s=t.x),t.x<n&&(n=t.x),t.y>r&&(r=t.y),t.y<o&&(o=t.y)}),i.setTo(n,o,s-n,r-o),i},PIXI.Rectangle=e.Rectangle,e.EmptyRectangle=new e.Rectangle(0,0,0,0),e.RoundedRectangle=function(t,i,s,n,r){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=20),this.x=t,this.y=i,this.width=s,this.height=n,this.radius=r||20,this.type=e.ROUNDEDRECTANGLE},e.RoundedRectangle.prototype={clone:function(){return new e.RoundedRectangle(this.x,this.y,this.width,this.height,this.radius)},contains:function(t,e){if(this.width<=0||this.height<=0)return!1;var i=this.x;if(t>=i&&t<=i+this.width){var s=this.y;if(e>=s&&e<=s+this.height)return!0}return!1}},e.RoundedRectangle.prototype.constructor=e.RoundedRectangle,PIXI.RoundedRectangle=e.RoundedRectangle,e.Camera=function(t,i,s,n,r,o){this.game=t,this.world=t.world,this.id=0,this.view=new e.Rectangle(s,n,r,o),this.bounds=new e.Rectangle(s,n,r,o),this.deadzone=null,this.visible=!0,this.roundPx=!0,this.atLimit={x:!1,y:!1},this.target=null,this.displayObject=null,this.scale=null,this.totalInView=0,this.lerp=new e.Point(1,1),this.onShakeComplete=new e.Signal,this.onFlashComplete=new e.Signal,this.onFadeComplete=new e.Signal,this.fx=null,this._targetPosition=new e.Point,this._edge=0,this._position=new e.Point,this._shake={intensity:0,duration:0,horizontal:!1,vertical:!1,shakeBounds:!0,x:0,y:0},this._fxDuration=0,this._fxType=0,this._fixedView=new e.Rectangle},e.Camera.FOLLOW_LOCKON=0,e.Camera.FOLLOW_PLATFORMER=1,e.Camera.FOLLOW_TOPDOWN=2,e.Camera.FOLLOW_TOPDOWN_TIGHT=3,e.Camera.SHAKE_BOTH=4,e.Camera.SHAKE_HORIZONTAL=5,e.Camera.SHAKE_VERTICAL=6,e.Camera.ENABLE_FX=!0,e.Camera.prototype={boot:function(){this.displayObject=this.game.world,this.scale=this.game.world.scale,this.game.camera=this,e.Graphics&&e.Camera.ENABLE_FX&&(this.fx=new e.Graphics(this.game),this.game.stage.addChild(this.fx))},preUpdate:function(){this.totalInView=0},follow:function(t,i,s,n){void 0===i&&(i=e.Camera.FOLLOW_LOCKON),void 0===s&&(s=1),void 0===n&&(n=1),this.target=t,this.lerp.set(s,n);var r;switch(i){case e.Camera.FOLLOW_PLATFORMER:var o=this.width/8,a=this.height/3;this.deadzone=new e.Rectangle((this.width-o)/2,(this.height-a)/2-.25*a,o,a);break;case e.Camera.FOLLOW_TOPDOWN:r=Math.max(this.width,this.height)/4,this.deadzone=new e.Rectangle((this.width-r)/2,(this.height-r)/2,r,r);break;case e.Camera.FOLLOW_TOPDOWN_TIGHT:r=Math.max(this.width,this.height)/8,this.deadzone=new e.Rectangle((this.width-r)/2,(this.height-r)/2,r,r);break;case e.Camera.FOLLOW_LOCKON:default:this.deadzone=null}},unfollow:function(){this.target=null},focusOn:function(t){this.setPosition(Math.round(t.x-this.view.halfWidth),Math.round(t.y-this.view.halfHeight))},focusOnXY:function(t,e){this.setPosition(Math.round(t-this.view.halfWidth),Math.round(e-this.view.halfHeight))},shake:function(t,i,s,n,r){return void 0===t&&(t=.05),void 0===i&&(i=500),void 0===s&&(s=!0),void 0===n&&(n=e.Camera.SHAKE_BOTH),void 0===r&&(r=!0),!(!s&&this._shake.duration>0)&&(this._shake.intensity=t,this._shake.duration=i,this._shake.shakeBounds=r,this._shake.x=0,this._shake.y=0,this._shake.horizontal=n===e.Camera.SHAKE_BOTH||n===e.Camera.SHAKE_HORIZONTAL,this._shake.vertical=n===e.Camera.SHAKE_BOTH||n===e.Camera.SHAKE_VERTICAL,!0)},flash:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=500),void 0===i&&(i=!1),void 0===s&&(s=1),!(!this.fx||!i&&this._fxDuration>0)&&(this.fx.clear(),this.fx.beginFill(t,s),this.fx.drawRect(0,0,this.width,this.height),this.fx.endFill(),this.fx.alpha=1,this._fxDuration=e,this._fxType=0,!0)},fade:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=500),void 0===i&&(i=!1),void 0===s&&(s=1),!(!this.fx||!i&&this._fxDuration>0)&&(this.fx.clear(),this.fx.beginFill(t,s),this.fx.drawRect(0,0,this.width,this.height),this.fx.endFill(),this.fx.alpha=0,this._fxDuration=e,this._fxType=1,!0)},update:function(){this._fxDuration>0&&this.updateFX(),this._shake.duration>0&&this.updateShake(),this.bounds&&this.checkBounds(),this.roundPx&&(this.view.floor(),this._shake.x=Math.floor(this._shake.x),this._shake.y=Math.floor(this._shake.y)),this.displayObject.position.x=-this.view.x,this.displayObject.position.y=-this.view.y},updateFX:function(){0===this._fxType?(this.fx.alpha-=this.game.time.elapsedMS/this._fxDuration,this.fx.alpha<=0&&(this._fxDuration=0,this.fx.alpha=0,this.onFlashComplete.dispatch())):(this.fx.alpha+=this.game.time.elapsedMS/this._fxDuration,this.fx.alpha>=1&&(this._fxDuration=0,this.fx.alpha=1,this.onFadeComplete.dispatch()))},updateShake:function(){this._shake.duration-=this.game.time.elapsedMS,this._shake.duration<=0?(this.onShakeComplete.dispatch(),this._shake.x=0,this._shake.y=0):(this._shake.horizontal&&(this._shake.x=this.game.rnd.frac()*this._shake.intensity*this.view.width*2-this._shake.intensity*this.view.width),this._shake.vertical&&(this._shake.y=this.game.rnd.frac()*this._shake.intensity*this.view.height*2-this._shake.intensity*this.view.height))},updateTarget:function(){this._targetPosition.x=this.view.x+this.target.worldPosition.x,this._targetPosition.y=this.view.y+this.target.worldPosition.y,this.deadzone?(this._edge=this._targetPosition.x-this.view.x,this._edge<this.deadzone.left?this.view.x=this.game.math.linear(this.view.x,this._targetPosition.x-this.deadzone.left,this.lerp.x):this._edge>this.deadzone.right&&(this.view.x=this.game.math.linear(this.view.x,this._targetPosition.x-this.deadzone.right,this.lerp.x)),this._edge=this._targetPosition.y-this.view.y,this._edge<this.deadzone.top?this.view.y=this.game.math.linear(this.view.y,this._targetPosition.y-this.deadzone.top,this.lerp.y):this._edge>this.deadzone.bottom&&(this.view.y=this.game.math.linear(this.view.y,this._targetPosition.y-this.deadzone.bottom,this.lerp.y))):(this.view.x=this.game.math.linear(this.view.x,this._targetPosition.x-this.view.halfWidth,this.lerp.x),this.view.y=this.game.math.linear(this.view.y,this._targetPosition.y-this.view.halfHeight,this.lerp.y)),this.bounds&&this.checkBounds(),this.roundPx&&this.view.floor(),this.displayObject.position.x=-this.view.x,this.displayObject.position.y=-this.view.y},setBoundsToWorld:function(){this.bounds&&this.bounds.copyFrom(this.game.world.bounds)},checkBounds:function(){this.atLimit.x=!1,this.atLimit.y=!1;var t=this.view.x+this._shake.x,e=this.view.right+this._shake.x,i=this.view.y+this._shake.y,s=this.view.bottom+this._shake.y;t<=this.bounds.x*this.scale.x?(this.atLimit.x=!0,this.view.x=this.bounds.x*this.scale.x,this._shake.shakeBounds||(this._shake.x=0)):e>=this.bounds.right*this.scale.x&&(this.atLimit.x=!0,this.view.x=this.bounds.right*this.scale.x-this.width,this._shake.shakeBounds||(this._shake.x=0)),i<=this.bounds.top*this.scale.y?(this.atLimit.y=!0,this.view.y=this.bounds.top*this.scale.y,this._shake.shakeBounds||(this._shake.y=0)):s>=this.bounds.bottom*this.scale.y&&(this.atLimit.y=!0,this.view.y=this.bounds.bottom*this.scale.y-this.height,this._shake.shakeBounds||(this._shake.y=0))},setPosition:function(t,e){this.view.x=t,this.view.y=e,this.bounds&&this.checkBounds()},setSize:function(t,e){this.view.width=t,this.view.height=e},reset:function(){this.target=null,this.view.x=0,this.view.y=0,this._shake.duration=0,this._shake.x=0,this._shake.y=0,this.resetFX()},resetFX:function(){this.fx&&(this.fx.clear(),this.fx.alpha=0),this._fxDuration=0}},e.Camera.prototype.constructor=e.Camera,Object.defineProperty(e.Camera.prototype,"x",{get:function(){return this.view.x},set:function(t){this.view.x=t,this.bounds&&this.checkBounds()}}),Object.defineProperty(e.Camera.prototype,"y",{get:function(){return this.view.y},set:function(t){this.view.y=t,this.bounds&&this.checkBounds()}}),Object.defineProperty(e.Camera.prototype,"position",{get:function(){return this._position.set(this.view.x,this.view.y),this._position},set:function(t){void 0!==t.x&&(this.view.x=t.x),void 0!==t.y&&(this.view.y=t.y),this.bounds&&this.checkBounds()}}),Object.defineProperty(e.Camera.prototype,"width",{get:function(){return this.view.width},set:function(t){this.view.width=t}}),Object.defineProperty(e.Camera.prototype,"height",{get:function(){return this.view.height},set:function(t){this.view.height=t}}),Object.defineProperty(e.Camera.prototype,"shakeIntensity",{get:function(){return this._shake.intensity},set:function(t){this._shake.intensity=t}}),Object.defineProperty(e.Camera.prototype,"fixedView",{get:function(){return this._fixedView.setTo(0,0,this.view.width,this.view.height),this._fixedView}}),e.State=function(){this.game=null,this.key="",this.add=null,this.make=null,this.camera=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.sound=null,this.scale=null,this.stage=null,this.state=null,this.time=null,this.tweens=null,this.world=null,this.particles=null,this.physics=null,this.rnd=null},e.State.prototype={init:function(){},preload:function(){},loadUpdate:function(){},loadRender:function(){},create:function(){},update:function(){},postUpdate:function(){},preRender:function(){},render:function(){},resize:function(){},paused:function(){},resumed:function(){},pauseUpdate:function(){},shutdown:function(){}},e.State.prototype.constructor=e.State,e.StateManager=function(t,i){this.game=t,this.states={},this._pendingState=null,void 0!==i&&null!==i&&(this._pendingState=i),this._clearWorld=!1,this._clearCache=!1,this._created=!1,this._args=[],this.current="",this.onStateChange=new e.Signal,this.onInitCallback=null,this.onPreloadCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onResizeCallback=null,this.onPreRenderCallback=null,this.onLoadUpdateCallback=null,this.onLoadRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onPauseUpdateCallback=null,this.onShutDownCallback=null},e.StateManager.prototype={boot:function(){this.game.onPause.add(this.pause,this),this.game.onResume.add(this.resume,this),null!==this._pendingState&&"string"!=typeof this._pendingState&&this.add("default",this._pendingState,!0)},add:function(t,i,s){void 0===s&&(s=!1);var n;return i instanceof e.State?n=i:"object"==typeof i?(n=i).game=this.game:"function"==typeof i&&(n=new i(this.game)),this.states[t]=n,s&&(this.game.isBooted?this.start(t):this._pendingState=t),n},remove:function(t){this.current===t&&(this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onPreRenderCallback=null,this.onRenderCallback=null,this.onResizeCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onPauseUpdateCallback=null),delete this.states[t]},start:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.checkState(t)&&(this._pendingState=t,this._clearWorld=e,this._clearCache=i,arguments.length>3&&(this._args=Array.prototype.splice.call(arguments,3)))},restart:function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1),this._pendingState=this.current,this._clearWorld=t,this._clearCache=e,arguments.length>2&&(this._args=Array.prototype.slice.call(arguments,2))},dummy:function(){},preUpdate:function(){if(this._pendingState&&this.game.isBooted){var t=this.current;if(this.clearCurrentState(),this.setCurrentState(this._pendingState),this.onStateChange.dispatch(this.current,t),this.current!==this._pendingState)return;this._pendingState=null,this.onPreloadCallback?(this.game.load.reset(!0),this.onPreloadCallback.call(this.callbackContext,this.game),0===this.game.load.totalQueuedFiles()&&0===this.game.load.totalQueuedPacks()?this.loadComplete():this.game.load.start()):this.loadComplete()}},clearCurrentState:function(){this.current&&(this.onShutDownCallback&&this.onShutDownCallback.call(this.callbackContext,this.game),this.game.tweens.removeAll(),this.game.camera.reset(),this.game.input.reset(!0),this.game.physics.clear(),this.game.time.removeAll(),this.game.scale.reset(this._clearWorld),this.game.debug&&this.game.debug.reset(),this._clearWorld&&(this.game.world.shutdown(),this._clearCache&&this.game.cache.destroy()))},checkState:function(t){var e=this.states[t];return e?!!(e.preload||e.create||e.update||e.render)||(console.warn("Invalid Phaser State object given. Must contain at least one of the required functions: preload, create, update or render"),!1):(console.warn("Phaser.StateManager - No state found with the key: "+t),!1)},link:function(t){var e=this.states[t];e.game=this.game,e.add=this.game.add,e.make=this.game.make,e.camera=this.game.camera,e.cache=this.game.cache,e.input=this.game.input,e.load=this.game.load,e.math=this.game.math,e.sound=this.game.sound,e.scale=this.game.scale,e.state=this,e.stage=this.game.stage,e.time=this.game.time,e.tweens=this.game.tweens,e.world=this.game.world,e.particles=this.game.particles,e.rnd=this.game.rnd,e.physics=this.game.physics,e.key=t},unlink:function(t){var e=this.states[t];e&&(e.game=null,e.add=null,e.make=null,e.camera=null,e.cache=null,e.input=null,e.load=null,e.math=null,e.sound=null,e.scale=null,e.state=null,e.stage=null,e.time=null,e.tweens=null,e.world=null,e.particles=null,e.rnd=null,e.physics=null)},setCurrentState:function(t){var e=this.states[t];this.callbackContext=e,this.link(t),this.onInitCallback=e.init||this.dummy,this.onPreloadCallback=e.preload||null,this.onLoadRenderCallback=e.loadRender||null,this.onLoadUpdateCallback=e.loadUpdate||null,this.onCreateCallback=e.create||null,this.onUpdateCallback=e.update||null,this.onPostUpdateCallback=e.postUpdate||null,this.onPreRenderCallback=e.preRender||null,this.onRenderCallback=e.render||null,this.onResizeCallback=e.resize||null,this.onPausedCallback=e.paused||null,this.onResumedCallback=e.resumed||null,this.onPauseUpdateCallback=e.pauseUpdate||null,this.onShutDownCallback=e.shutdown||this.dummy,""!==this.current&&this.game.physics.reset(),this.current=t,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),t===this._pendingState&&(this._args=[]),this.game._kickstart=!0},getCurrentState:function(){return this.states[this.current]},loadComplete:function(){!1===this._created&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.call(this.callbackContext,this.game)):this._created=!0},loadUpdate:function(){!1===this._created&&this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},pause:function(){this._created&&this.onPausedCallback&&this.onPausedCallback.call(this.callbackContext,this.game)},resume:function(){this._created&&this.onResumedCallback&&this.onResumedCallback.call(this.callbackContext,this.game)},update:function(){this._created?this.onUpdateCallback&&this.onUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},postUpdate:function(){this._created&&this.onPostUpdateCallback&&this.onPostUpdateCallback.call(this.callbackContext,this.game)},pauseUpdate:function(){this._created?this.onPauseUpdateCallback&&this.onPauseUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},preRender:function(t){this._created&&this.onPreRenderCallback&&this.onPreRenderCallback.call(this.callbackContext,this.game,t)},resize:function(t,e){this.onResizeCallback&&this.onResizeCallback.call(this.callbackContext,t,e)},render:function(){this._created?this.onRenderCallback&&(this.game.renderType===e.CANVAS?(this.game.context.save(),this.game.context.setTransform(1,0,0,1,0,0),this.onRenderCallback.call(this.callbackContext,this.game),this.game.context.restore()):this.onRenderCallback.call(this.callbackContext,this.game)):this.onLoadRenderCallback&&this.onLoadRenderCallback.call(this.callbackContext,this.game)},destroy:function(){this._clearWorld=!0,this._clearCache=!0,this.clearCurrentState(),this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onPostUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onPauseUpdateCallback=null,this.game=null,this.states={},this._pendingState=null,this.current=""}},e.StateManager.prototype.constructor=e.StateManager,Object.defineProperty(e.StateManager.prototype,"created",{get:function(){return this._created}}),e.Signal=function(){},e.Signal.prototype={_bindings:null,_prevParams:null,memorize:!1,_shouldPropagate:!0,active:!0,_boundDispatch:!1,validateListener:function(t,e){if("function"!=typeof t)throw new Error("Phaser.Signal: listener is a required param of {fn}() and should be a Function.".replace("{fn}",e))},_registerListener:function(t,i,s,n,r){var o,a=this._indexOfListener(t,s);if(-1!==a){if((o=this._bindings[a]).isOnce()!==i)throw new Error("You cannot add"+(i?"":"Once")+"() then add"+(i?"Once":"")+"() the same listener without removing the relationship first.")}else o=new e.SignalBinding(this,t,i,s,n,r),this._addBinding(o);return this.memorize&&this._prevParams&&o.execute(this._prevParams),o},_addBinding:function(t){this._bindings||(this._bindings=[]);var e=this._bindings.length;do{e--}while(this._bindings[e]&&t._priority<=this._bindings[e]._priority);this._bindings.splice(e+1,0,t)},_indexOfListener:function(t,e){if(!this._bindings)return-1;void 0===e&&(e=null);for(var i,s=this._bindings.length;s--;)if((i=this._bindings[s])._listener===t&&i.context===e)return s;return-1},has:function(t,e){return-1!==this._indexOfListener(t,e)},add:function(t,e,i){this.validateListener(t,"add");var s=[];if(arguments.length>3)for(var n=3;n<arguments.length;n++)s.push(arguments[n]);return this._registerListener(t,!1,e,i,s)},addOnce:function(t,e,i){this.validateListener(t,"addOnce");var s=[];if(arguments.length>3)for(var n=3;n<arguments.length;n++)s.push(arguments[n]);return this._registerListener(t,!0,e,i,s)},remove:function(t,e){this.validateListener(t,"remove");var i=this._indexOfListener(t,e);return-1!==i&&(this._bindings[i]._destroy(),this._bindings.splice(i,1)),t},removeAll:function(t){if(void 0===t&&(t=null),this._bindings){for(var e=this._bindings.length;e--;)t?this._bindings[e].context===t&&(this._bindings[e]._destroy(),this._bindings.splice(e,1)):this._bindings[e]._destroy();t||(this._bindings.length=0)}},getNumListeners:function(){return this._bindings?this._bindings.length:0},halt:function(){this._shouldPropagate=!1},dispatch:function(){if(this.active&&(this._bindings||this.memorize)){var t=Array.prototype.slice.call(arguments);this.memorize&&(this._prevParams=t);var e=this._bindings?this._bindings.length:0;if(e){var i=this._bindings.slice();this._shouldPropagate=!0;do{e--}while(i[e]&&this._shouldPropagate&&!1!==i[e].execute(t))}}},forget:function(){this._prevParams&&(this._prevParams=null)},dispose:function(){this.removeAll(),this._bindings=null,this._prevParams&&(this._prevParams=null)},toString:function(){return"[Phaser.Signal active:"+this.active+" numListeners:"+this.getNumListeners()+"]"}},Object.defineProperty(e.Signal.prototype,"boundDispatch",{get:function(){var t=this;return this._boundDispatch||(this._boundDispatch=function(){return t.dispatch.apply(t,arguments)})}}),e.Signal.prototype.constructor=e.Signal,e.SignalBinding=function(t,e,i,s,n,r){this._listener=e,i&&(this._isOnce=!0),null!=s&&(this.context=s),this._signal=t,n&&(this._priority=n),r&&r.length&&(this._args=r)},e.SignalBinding.prototype={context:null,_isOnce:!1,_priority:0,_args:null,callCount:0,active:!0,params:null,execute:function(t){var e,i;return this.active&&this._listener&&(i=this.params?this.params.concat(t):t,this._args&&(i=i.concat(this._args)),e=this._listener.apply(this.context,i),this.callCount++,this._isOnce&&this.detach()),e},detach:function(){return this.isBound()?this._signal.remove(this._listener,this.context):null},isBound:function(){return!!this._signal&&!!this._listener},isOnce:function(){return this._isOnce},getListener:function(){return this._listener},getSignal:function(){return this._signal},_destroy:function(){delete this._signal,delete this._listener,delete this.context},toString:function(){return"[Phaser.SignalBinding isOnce:"+this._isOnce+", isBound:"+this.isBound()+", active:"+this.active+"]"}},e.SignalBinding.prototype.constructor=e.SignalBinding,e.Filter=function(t,i,s){this.game=t,this.type=e.WEBGL_FILTER,this.passes=[this],this.shaders=[],this.dirty=!0,this.padding=0,this.prevPoint=new e.Point;var n=new Date;if(this.uniforms={resolution:{type:"2f",value:{x:256,y:256}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:0,y:0}},date:{type:"4fv",value:[n.getFullYear(),n.getMonth(),n.getDate(),60*n.getHours()*60+60*n.getMinutes()+n.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}},i)for(var r in i)this.uniforms[r]=i[r];"string"==typeof s&&(s=s.split("\n")),this.fragmentSrc=s||[]},e.Filter.prototype={init:function(){},setResolution:function(t,e){this.uniforms.resolution.value.x=t,this.uniforms.resolution.value.y=e},update:function(t){if(t){var e=t.x/this.game.width,i=1-t.y/this.game.height;e===this.prevPoint.x&&i===this.prevPoint.y||(this.uniforms.mouse.value.x=e.toFixed(2),this.uniforms.mouse.value.y=i.toFixed(2),this.prevPoint.set(e,i))}this.uniforms.time.value=this.game.time.totalElapsedSeconds()},addToWorld:function(t,i,s,n,r,o){void 0===r&&(r=0),void 0===o&&(o=0),void 0!==s&&null!==s?this.width=s:s=this.width,void 0!==n&&null!==n?this.height=n:n=this.height;var a=this.game.add.image(t,i,e.Cache.DEFAULT);return a.width=s,a.height=n,a.anchor.set(r,o),a.filters=[this],a},syncUniforms:function(){for(var t=0;t<this.shaders.length;t++)this.shaders[t].dirty=!0},destroy:function(){this.passes.length=0,this.shaders.length=0,this.fragmentSrc.length=0,this.game=null,this.uniforms=null,this.prevPoint=null}},e.Filter.prototype.constructor=e.Filter,Object.defineProperty(e.Filter.prototype,"width",{get:function(){return this.uniforms.resolution.value.x},set:function(t){this.uniforms.resolution.value.x=t}}),Object.defineProperty(e.Filter.prototype,"height",{get:function(){return this.uniforms.resolution.value.y},set:function(t){this.uniforms.resolution.value.y=t}}),e.Plugin=function(t,e){void 0===e&&(e=null),this.game=t,this.parent=e,this.active=!1,this.visible=!1,this.hasPreUpdate=!1,this.hasUpdate=!1,this.hasPostUpdate=!1,this.hasRender=!1,this.hasPostRender=!1},e.Plugin.prototype={preUpdate:function(){},update:function(){},render:function(){},postRender:function(){},destroy:function(){this.game=null,this.parent=null,this.active=!1,this.visible=!1}},e.Plugin.prototype.constructor=e.Plugin,e.PluginManager=function(t){this.game=t,this.plugins=[],this._len=0,this._i=0},e.PluginManager.prototype={add:function(t){var e=Array.prototype.slice.call(arguments,1),i=!1;return"function"==typeof t?t=new t(this.game,this):(t.game=this.game,t.parent=this),"function"==typeof t.preUpdate&&(t.hasPreUpdate=!0,i=!0),"function"==typeof t.update&&(t.hasUpdate=!0,i=!0),"function"==typeof t.postUpdate&&(t.hasPostUpdate=!0,i=!0),"function"==typeof t.render&&(t.hasRender=!0,i=!0),"function"==typeof t.postRender&&(t.hasPostRender=!0,i=!0),i?((t.hasPreUpdate||t.hasUpdate||t.hasPostUpdate)&&(t.active=!0),(t.hasRender||t.hasPostRender)&&(t.visible=!0),this._len=this.plugins.push(t),"function"==typeof t.init&&t.init.apply(t,e),t):null},remove:function(t,e){for(void 0===e&&(e=!0),this._i=this._len;this._i--;)if(this.plugins[this._i]===t)return e&&t.destroy(),this.plugins.splice(this._i,1),void this._len--},removeAll:function(){for(this._i=this._len;this._i--;)this.plugins[this._i].destroy();this.plugins.length=0,this._len=0},preUpdate:function(){for(this._i=this._len;this._i--;)this.plugins[this._i].active&&this.plugins[this._i].hasPreUpdate&&this.plugins[this._i].preUpdate()},update:function(){for(this._i=this._len;this._i--;)this.plugins[this._i].active&&this.plugins[this._i].hasUpdate&&this.plugins[this._i].update()},postUpdate:function(){for(this._i=this._len;this._i--;)this.plugins[this._i].active&&this.plugins[this._i].hasPostUpdate&&this.plugins[this._i].postUpdate()},render:function(){for(this._i=this._len;this._i--;)this.plugins[this._i].visible&&this.plugins[this._i].hasRender&&this.plugins[this._i].render()},postRender:function(){for(this._i=this._len;this._i--;)this.plugins[this._i].visible&&this.plugins[this._i].hasPostRender&&this.plugins[this._i].postRender()},destroy:function(){this.removeAll(),this.game=null}},e.PluginManager.prototype.constructor=e.PluginManager,e.Stage=function(t){this.game=t,PIXI.DisplayObjectContainer.call(this),this.name="_stage_root",this.disableVisibilityChange=!1,this.exists=!0,this.worldTransform=new e.Matrix,this.stage=this,this.currentRenderOrderID=0,this._hiddenVar="hidden",this._onChange=null,this._bgColor={r:0,g:0,b:0,a:0,color:0,rgba:"#000000"},this.game.transparent||(this._bgColor.a=1),t.config&&this.parseConfig(t.config)},e.Stage.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),e.Stage.prototype.constructor=e.Stage,e.Stage.prototype.parseConfig=function(t){t.disableVisibilityChange&&(this.disableVisibilityChange=t.disableVisibilityChange),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor)},e.Stage.prototype.boot=function(){e.DOM.getOffset(this.game.canvas,this.offset),e.Canvas.setUserSelect(this.game.canvas,"none"),e.Canvas.setTouchAction(this.game.canvas,"none"),this.checkVisibility()},e.Stage.prototype.preUpdate=function(){this.currentRenderOrderID=0;for(var t=0;t<this.children.length;){var e=this.children[t];e.preUpdate(),this===e.parent&&t++}},e.Stage.prototype.update=function(){for(var t=this.children.length;t--;)this.children[t].update()},e.Stage.prototype.postUpdate=function(){this.game.camera.update(),this.game.camera.target&&(this.game.camera.target.postUpdate(),this.updateTransform(),this.game.camera.updateTarget());for(var t=0;t<this.children.length;t++)this.children[t].postUpdate();this.updateTransform()},e.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var t=0;t<this.children.length;t++)this.children[t].updateTransform()},e.Stage.prototype.checkVisibility=function(){void 0!==document.hidden?this._hiddenVar="visibilitychange":void 0!==document.webkitHidden?this._hiddenVar="webkitvisibilitychange":void 0!==document.mozHidden?this._hiddenVar="mozvisibilitychange":void 0!==document.msHidden?this._hiddenVar="msvisibilitychange":this._hiddenVar=null;var t=this;this._onChange=function(e){return t.visibilityChange(e)},this._onChangePause=function(){return t._onChange({type:"pause"})},this._onChangeResume=function(){return t._onChange({type:"resume"})},this._onClick=function(e){void 0===document.hasFocus||document.hasFocus()||t.visibilityChange(e)},this._hiddenVar&&document.addEventListener(this._hiddenVar,this._onChange,!1),window.onblur=this._onChange,window.onfocus=this._onChange,window.onpagehide=this._onChange,window.onpageshow=this._onChange,window.addEventListener("click",this._onClick),this.game.device.cocoonJSApp&&CocoonJS.App&&(CocoonJS.App.onSuspended&&CocoonJS.App.onSuspended.addEventListener(this._onChangePause),CocoonJS.App.onActivated&&CocoonJS.App.onActivated.addEventListener(this._onChangeResume),CocoonJS.App.on&&(CocoonJS.App.on("activated",this._onChangeResume),CocoonJS.App.on("suspended",this._onChangePause)))},e.Stage.prototype.visibilityChange=function(t){switch(t.type){case"blur":case"pagehide":return void this.game.focusLoss(t);case"click":case"focus":case"pageshow":return void this.game.focusGain(t)}this.disableVisibilityChange||(document.hidden||document.mozHidden||document.msHidden||document.webkitHidden||"pause"===t.type?this.game.gamePaused(t):this.game.gameResumed(t))},e.Stage.prototype.setBackgroundColor=function(t){this.game.transparent||(e.Color.valueToColor(t,this._bgColor),e.Color.updateColor(this._bgColor),this._bgColor.r/=255,this._bgColor.g/=255,this._bgColor.b/=255,this._bgColor.a=1)},e.Stage.prototype.destroy=function(){this._hiddenVar&&document.removeEventListener(this._hiddenVar,this._onChange,!1),window.onpagehide=null,window.onpageshow=null,window.onblur=null,window.onfocus=null,window.removeEventListener("click",this._onClick)},e.Stage.prototype.add=function(t,e,i){return t.parent===this?t:(t.body&&t.parent&&t.parent.hash&&t.parent.removeFromHash(t),void 0===i?this.addChild(t):this.addChildAt(t,i),t)},Object.defineProperty(e.Stage.prototype,"backgroundColor",{get:function(){return this._bgColor.color},set:function(t){this.setBackgroundColor(t)}}),Object.defineProperty(e.Stage.prototype,"smoothed",{get:function(){return PIXI.scaleModes.DEFAULT===PIXI.scaleModes.LINEAR},set:function(t){PIXI.scaleModes.DEFAULT=t?PIXI.scaleModes.LINEAR:PIXI.scaleModes.NEAREST}}),e.Group=function(t,i,s,n,r,o){void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===o&&(o=e.Physics.ARCADE),this.game=t,void 0===i&&(i=t.world),this.name=s||"group",this.z=0,PIXI.DisplayObjectContainer.call(this),n?(this.game.stage.addChild(this),this.z=this.game.stage.children.length):i&&(i.addChild(this),this.z=i.children.length),this.type=e.GROUP,this.physicsType=e.GROUP,this.alive=!0,this.exists=!0,this.ignoreDestroy=!1,this.pendingDestroy=!1,this.classType=e.Sprite,this.cursor=null,this.inputEnableChildren=!1,this.updateOnlyExistingChildren=!1,this.onChildInputDown=new e.Signal,this.onChildInputUp=new e.Signal,this.onChildInputOver=new e.Signal,this.onChildInputOut=new e.Signal,this.enableBody=r,this.enableBodyDebug=!1,this.physicsBodyType=o,this.physicsSortDirection=null,this.onDestroy=new e.Signal,this.cursorIndex=0,this.fixedToCamera=!1,this.cameraOffset=new e.Point,this.hash=[],this._sortProperty="z"},e.Group.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),e.Group.prototype.constructor=e.Group,e.Group.RETURN_NONE=0,e.Group.RETURN_TOTAL=1,e.Group.RETURN_CHILD=2,e.Group.RETURN_ALL=3,e.Group.SORT_ASCENDING=-1,e.Group.SORT_DESCENDING=1,e.Group.prototype.add=function(t,e,i){return void 0===e&&(e=!1),t.parent===this?t:(t.body&&t.parent&&t.parent.hash&&t.parent.removeFromHash(t),void 0===i?(t.z=this.children.length,this.addChild(t)):(this.addChildAt(t,i),this.updateZ()),this.enableBody&&t.hasOwnProperty("body")&&null===t.body?this.game.physics.enable(t,this.physicsBodyType):t.body&&this.addToHash(t),!this.inputEnableChildren||t.input&&!t.inputEnabled||(t.inputEnabled=!0),!e&&t.events&&t.events.onAddedToGroup$dispatch(t,this),null===this.cursor&&(this.cursor=t),t)},e.Group.prototype.addAt=function(t,e,i){return this.add(t,i,e)},e.Group.prototype.addToHash=function(t){return t.parent===this&&-1===this.hash.indexOf(t)&&(this.hash.push(t),!0)},e.Group.prototype.removeFromHash=function(t){if(t){var e=this.hash.indexOf(t);if(-1!==e)return this.hash.splice(e,1),!0}return!1},e.Group.prototype.addMultiple=function(t,i){if(t instanceof e.Group)t.moveAll(this,i);else if(Array.isArray(t))for(var s=0;s<t.length;s++)this.add(t[s],i);return t},e.Group.prototype.getAt=function(t){return t<0||t>=this.children.length?-1:this.getChildAt(t)},e.Group.prototype.create=function(t,e,i,s,n,r){void 0===n&&(n=!0);var o=new this.classType(this.game,t,e,i,s);return o.exists=n,o.visible=n,o.alive=n,this.add(o,!1,r)},e.Group.prototype.createMultiple=function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=!1),Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);var o=this,a=[];return e.forEach(function(e){i.forEach(function(i){for(var h=0;h<t;h++){var l=o.create(0,0,e,i,s);n&&n.call(r||l,l,h),a.push(l)}})}),a},e.Group.prototype.updateZ=function(){for(var t=this.children.length;t--;)this.children[t].z=t},e.Group.prototype.align=function(t,i,s,n,r,o){if(void 0===r&&(r=e.TOP_LEFT),void 0===o&&(o=0),0===this.children.length||o>this.children.length||-1===t&&-1===i)return!1;for(var a=new e.Rectangle(0,0,s,n),h=t*s,l=i*n,c=o;c<this.children.length;c++){var u=this.children[c];if(u.alignIn)if(u.alignIn(a,r),-1===t)a.y+=n,a.y===l&&(a.x+=s,a.y=0);else if(-1===i)a.x+=s,a.x===h&&(a.x=0,a.y+=n);else if(a.x+=s,a.x===h&&(a.x=0,a.y+=n,a.y===l))return!0}return!0},e.Group.prototype.resetCursor=function(t){if(void 0===t&&(t=0),t>this.children.length-1&&(t=0),this.cursor)return this.cursorIndex=t,this.cursor=this.children[this.cursorIndex],this.cursor},e.Group.prototype.next=function(){if(this.cursor)return this.cursorIndex>=this.children.length-1?this.cursorIndex=0:this.cursorIndex++,this.cursor=this.children[this.cursorIndex],this.cursor},e.Group.prototype.previous=function(){if(this.cursor)return 0===this.cursorIndex?this.cursorIndex=this.children.length-1:this.cursorIndex--,this.cursor=this.children[this.cursorIndex],this.cursor},e.Group.prototype.swap=function(t,e){this.swapChildren(t,e),this.updateZ()},e.Group.prototype.bringToTop=function(t){return t.parent===this&&this.getIndex(t)<this.children.length&&(this.remove(t,!1,!0),this.add(t,!0)),t},e.Group.prototype.bringChildToTop=e.Group.prototype.bringToTop,e.Group.prototype.sendToBack=function(t){return t.parent===this&&this.getIndex(t)>0&&(this.remove(t,!1,!0),this.addAt(t,0,!0)),t},e.Group.prototype.sendChildToBack=e.Group.prototype.sendToBack,e.Group.prototype.moveUp=function(t){if(t.parent===this&&this.getIndex(t)<this.children.length-1){var e=this.getIndex(t),i=this.getAt(e+1);i&&this.swap(t,i)}return t},e.Group.prototype.moveDown=function(t){if(t.parent===this&&this.getIndex(t)>0){var e=this.getIndex(t),i=this.getAt(e-1);i&&this.swap(t,i)}return t},e.Group.prototype.xy=function(t,e,i){if(t<0||t>this.children.length)return-1;this.getChildAt(t).x=e,this.getChildAt(t).y=i},e.Group.prototype.reverse=function(){this.children.reverse(),this.updateZ()},e.Group.prototype.getIndex=function(t){return this.children.indexOf(t)},e.Group.prototype.getByName=function(t){for(var e=0;e<this.children.length;e++)if(this.children[e].name===t)return this.children[e];return null},e.Group.prototype.replace=function(t,i){var s=this.getIndex(t);if(-1!==s)return i.parent&&(i.parent instanceof e.Group?i.parent.remove(i):i.parent.removeChild(i)),this.remove(t),this.addAt(i,s),t},e.Group.prototype.hasProperty=function(t,e){var i=e.length;return 1===i&&e[0]in t||(2===i&&e[0]in t&&e[1]in t[e[0]]||(3===i&&e[0]in t&&e[1]in t[e[0]]&&e[2]in t[e[0]][e[1]]||4===i&&e[0]in t&&e[1]in t[e[0]]&&e[2]in t[e[0]][e[1]]&&e[3]in t[e[0]][e[1]][e[2]]))},e.Group.prototype.setProperty=function(t,e,i,s,n){if(void 0===n&&(n=!1),s=s||0,!this.hasProperty(t,e)&&(!n||s>0))return!1;var r=e.length;return 1===r?0===s?t[e[0]]=i:1===s?t[e[0]]+=i:2===s?t[e[0]]-=i:3===s?t[e[0]]*=i:4===s&&(t[e[0]]/=i):2===r?0===s?t[e[0]][e[1]]=i:1===s?t[e[0]][e[1]]+=i:2===s?t[e[0]][e[1]]-=i:3===s?t[e[0]][e[1]]*=i:4===s&&(t[e[0]][e[1]]/=i):3===r?0===s?t[e[0]][e[1]][e[2]]=i:1===s?t[e[0]][e[1]][e[2]]+=i:2===s?t[e[0]][e[1]][e[2]]-=i:3===s?t[e[0]][e[1]][e[2]]*=i:4===s&&(t[e[0]][e[1]][e[2]]/=i):4===r&&(0===s?t[e[0]][e[1]][e[2]][e[3]]=i:1===s?t[e[0]][e[1]][e[2]][e[3]]+=i:2===s?t[e[0]][e[1]][e[2]][e[3]]-=i:3===s?t[e[0]][e[1]][e[2]][e[3]]*=i:4===s&&(t[e[0]][e[1]][e[2]][e[3]]/=i)),!0},e.Group.prototype.checkProperty=function(t,i,s,n){if(void 0===n&&(n=!1),this!==t.parent)return!1;var r=e.Utils.getProperty(t,i);return!(void 0===r&&n||r!==s)},e.Group.prototype.set=function(t,e,i,s,n,r,o){if(void 0===o&&(o=!1),e=e.split("."),void 0===s&&(s=!1),void 0===n&&(n=!1),(!1===s||s&&t.alive)&&(!1===n||n&&t.visible))return this.setProperty(t,e,i,r,o)},e.Group.prototype.setAll=function(t,e,i,s,n,r){void 0===i&&(i=!1),void 0===s&&(s=!1),void 0===r&&(r=!1),t=t.split("."),n=n||0;for(var o=0;o<this.children.length;o++)(!i||i&&this.children[o].alive)&&(!s||s&&this.children[o].visible)&&this.setProperty(this.children[o],t,e,n,r)},e.Group.prototype.setAllChildren=function(t,i,s,n,r,o){void 0===s&&(s=!1),void 0===n&&(n=!1),void 0===o&&(o=!1),r=r||0;for(var a=0;a<this.children.length;a++)(!s||s&&this.children[a].alive)&&(!n||n&&this.children[a].visible)&&(this.children[a]instanceof e.Group?this.children[a].setAllChildren(t,i,s,n,r,o):this.setProperty(this.children[a],t.split("."),i,r,o))},e.Group.prototype.checkAll=function(t,e,i,s,n){void 0===i&&(i=!1),void 0===s&&(s=!1),void 0===n&&(n=!1);for(var r=0;r<this.children.length;r++){var o=this.children[r];if((!i||i&&o.alive)&&(!s||s&&o.visible)&&!this.checkProperty(o,t,e,n))return!1}return!0},e.Group.prototype.checkAny=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!1);for(var n=0;n<this.children.length;n++){var r=this.children[n];if((!i||i&&r.alive)&&(!s||s&&r.visible)&&this.checkProperty(r,t,e))return!0}return!1},e.Group.prototype.addAll=function(t,e,i,s){this.setAll(t,e,i,s,1)},e.Group.prototype.subAll=function(t,e,i,s){this.setAll(t,e,i,s,2)},e.Group.prototype.multiplyAll=function(t,e,i,s){this.setAll(t,e,i,s,3)},e.Group.prototype.divideAll=function(t,e,i,s){this.setAll(t,e,i,s,4)},e.Group.prototype.kill=function(){this.alive=!1,this.exists=!1,this.visible=!1},e.Group.prototype.killAll=function(){this.callAllExists("kill",!0)},e.Group.prototype.revive=function(){this.alive=!0,this.exists=!0,this.visible=!0},e.Group.prototype.reviveAll=function(){this.callAllExists("revive",!1)},e.Group.prototype.resetAll=function(t,e,i,s,n){this.forEach(this.resetChild,this,n,t,e,i,s)},e.Group.prototype.callAllExists=function(t,e){var i;if(arguments.length>2){i=[];for(s=2;s<arguments.length;s++)i.push(arguments[s])}for(var s=0;s<this.children.length;s++)this.children[s].exists===e&&this.children[s][t]&&this.children[s][t].apply(this.children[s],i)},e.Group.prototype.callbackFromArray=function(t,e,i){if(1===i){if(t[e[0]])return t[e[0]]}else if(2===i){if(t[e[0]][e[1]])return t[e[0]][e[1]]}else if(3===i){if(t[e[0]][e[1]][e[2]])return t[e[0]][e[1]][e[2]]}else if(4===i){if(t[e[0]][e[1]][e[2]][e[3]])return t[e[0]][e[1]][e[2]][e[3]]}else if(t[e])return t[e];return!1},e.Group.prototype.callAll=function(t,e){if(void 0!==t){var i=(t=t.split(".")).length;if(void 0===e||null===e||""===e)e=null;else if("string"==typeof e)var s=(e=e.split(".")).length;var n;if(arguments.length>2){n=[];for(a=2;a<arguments.length;a++)n.push(arguments[a])}for(var r=null,o=null,a=0;a<this.children.length;a++)r=this.callbackFromArray(this.children[a],t,i),e&&r?(o=this.callbackFromArray(this.children[a],e,s),r&&r.apply(o,n)):r&&r.apply(this.children[a],n)}},e.Group.prototype.preUpdate=function(){if(this.pendingDestroy)return this.destroy(),!1;if(!this.exists||!this.parent.exists)return this.renderOrderID=-1,!1;for(var t=0;t<this.children.length;){var e=this.children[t];e.preUpdate(),this===e.parent&&t++}return!0},e.Group.prototype.update=function(){for(var t=this.children.length;t--;){var e=this.children.length;t>=e&&(t=e-1);var i=this.children[t];this.updateOnlyExistingChildren&&!i.exists||i.update()}},e.Group.prototype.postUpdate=function(){this.fixedToCamera&&(this.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var t=0;t<this.children.length;t++)this.children[t].postUpdate()},e.Group.prototype.filter=function(t,i){for(var s=-1,n=this.children.length,r=[];++s<n;){var o=this.children[s];(!i||i&&o.exists)&&t(o,s,this.children)&&r.push(o)}return new e.ArraySet(r)},e.Group.prototype.forEach=function(t,e,i){if(void 0===i&&(i=!1),arguments.length<=3)for(n=0;n<this.children.length;n++)(!i||i&&this.children[n].exists)&&t.call(e,this.children[n]);else{for(var s=[null],n=3;n<arguments.length;n++)s.push(arguments[n]);for(n=0;n<this.children.length;n++)(!i||i&&this.children[n].exists)&&(s[0]=this.children[n],t.apply(e,s))}},e.Group.prototype.forEachExists=function(t,i){var s;if(arguments.length>2){s=[null];for(var n=2;n<arguments.length;n++)s.push(arguments[n])}this.iterate("exists",!0,e.Group.RETURN_TOTAL,t,i,s)},e.Group.prototype.forEachAlive=function(t,i){var s;if(arguments.length>2){s=[null];for(var n=2;n<arguments.length;n++)s.push(arguments[n])}this.iterate("alive",!0,e.Group.RETURN_TOTAL,t,i,s)},e.Group.prototype.forEachDead=function(t,i){var s;if(arguments.length>2){s=[null];for(var n=2;n<arguments.length;n++)s.push(arguments[n])}this.iterate("alive",!1,e.Group.RETURN_TOTAL,t,i,s)},e.Group.prototype.sort=function(t,i){this.children.length<2||(void 0===t&&(t="z"),void 0===i&&(i=e.Group.SORT_ASCENDING),this._sortProperty=t,i===e.Group.SORT_ASCENDING?this.children.sort(this.ascendingSortHandler.bind(this)):this.children.sort(this.descendingSortHandler.bind(this)),this.updateZ())},e.Group.prototype.customSort=function(t,e){this.children.length<2||(this.children.sort(t.bind(e)),this.updateZ())},e.Group.prototype.ascendingSortHandler=function(t,e){return t[this._sortProperty]<e[this._sortProperty]?-1:t[this._sortProperty]>e[this._sortProperty]?1:t.z<e.z?-1:1},e.Group.prototype.descendingSortHandler=function(t,e){return t[this._sortProperty]<e[this._sortProperty]?1:t[this._sortProperty]>e[this._sortProperty]?-1:0},e.Group.prototype.iterate=function(t,i,s,n,r,o){if(0===this.children.length){if(s===e.Group.RETURN_TOTAL)return 0;if(s===e.Group.RETURN_ALL)return[]}var a=0;if(s===e.Group.RETURN_ALL)var h=[];for(var l=0;l<this.children.length;l++)if(this.children[l][t]===i){if(a++,n&&(o?(o[0]=this.children[l],n.apply(r,o)):n.call(r,this.children[l])),s===e.Group.RETURN_CHILD)return this.children[l];s===e.Group.RETURN_ALL&&h.push(this.children[l])}return s===e.Group.RETURN_TOTAL?a:s===e.Group.RETURN_ALL?h:null},e.Group.prototype.getFirst=function(t,i){return this.iterate(t,i,e.Group.RETURN_CHILD)},e.Group.prototype.getFirstExists=function(t,e,i,s,n,r){void 0===e&&(e=!1),"boolean"!=typeof t&&(t=!0);var o=this.getFirst("exists",t);return null===o&&e?this.create(i,s,n,r):this.resetChild(o,i,s,n,r)},e.Group.prototype.getFirstAlive=function(t,e,i,s,n){void 0===t&&(t=!1);var r=this.getFirst("alive",!0);return null===r&&t?this.create(e,i,s,n):this.resetChild(r,e,i,s,n)},e.Group.prototype.getFirstDead=function(t,e,i,s,n){void 0===t&&(t=!1);var r=this.getFirst("alive",!1);return null===r&&t?this.create(e,i,s,n):this.resetChild(r,e,i,s,n)},e.Group.prototype.resetChild=function(t,e,i,s,n){return null===t?null:(void 0===e&&(e=null),void 0===i&&(i=null),null!==e&&null!==i&&t.reset(e,i),void 0!==s&&t.loadTexture(s,n),t)},e.Group.prototype.getTop=function(){if(this.children.length>0)return this.children[this.children.length-1]},e.Group.prototype.getBottom=function(){if(this.children.length>0)return this.children[0]},e.Group.prototype.getClosestTo=function(t,i,s){for(var n=Number.MAX_VALUE,r=0,o=null,a=0;a<this.children.length;a++){var h=this.children[a];h.exists&&(r=Math.abs(e.Point.distance(t,h)))<n&&(!i||i.call(s,h,r))&&(n=r,o=h)}return o},e.Group.prototype.getFurthestFrom=function(t,i,s){for(var n=0,r=0,o=null,a=0;a<this.children.length;a++){var h=this.children[a];h.exists&&(r=Math.abs(e.Point.distance(t,h)))>n&&(!i||i.call(s,h,r))&&(n=r,o=h)}return o},e.Group.prototype.count=function(t,i){return this.iterate(t,i,e.Group.RETURN_TOTAL)},e.Group.prototype.countLiving=function(){return this.count("alive",!0)},e.Group.prototype.countDead=function(){return this.count("alive",!1)},e.Group.prototype.getRandom=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=this.children.length),0===i?null:e.ArrayUtils.getRandomItem(this.children,t,i)},e.Group.prototype.getRandomExists=function(t,e){var i=this.getAll("exists",!0,t,e);return this.game.rnd.pick(i)},e.Group.prototype.getAll=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=this.children.length);for(var n=[],r=i;r<s;r++){var o=this.children[r];t?o[t]===e&&n.push(o):n.push(o)}return n},e.Group.prototype.remove=function(t,e,i){if(void 0===e&&(e=!1),void 0===i&&(i=!1),0===this.children.length||-1===this.children.indexOf(t))return!1;i||!t.events||t.destroyPhase||t.events.onRemovedFromGroup$dispatch(t,this);var s=this.removeChild(t);return this.removeFromHash(t),this.updateZ(),this.cursor===t&&this.next(),e&&s&&s.destroy(!0),!0},e.Group.prototype.moveAll=function(t,i){if(void 0===i&&(i=!1),this.children.length>0&&t instanceof e.Group){do{t.add(this.children[0],i)}while(this.children.length>0);this.hash=[],this.cursor=null}return t},e.Group.prototype.removeAll=function(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=!1),void 0===i&&(i=!1),0!==this.children.length){do{!e&&this.children[0].events&&this.children[0].events.onRemovedFromGroup$dispatch(this.children[0],this);var s=this.removeChild(this.children[0]);this.removeFromHash(s),t&&s&&s.destroy(!0,i)}while(this.children.length>0);this.hash=[],this.cursor=null}},e.Group.prototype.removeBetween=function(t,e,i,s){if(void 0===e&&(e=this.children.length-1),void 0===i&&(i=!1),void 0===s&&(s=!1),0!==this.children.length){if(t>e||t<0||e>this.children.length)return!1;for(var n=e;n>=t;){!s&&this.children[n].events&&this.children[n].events.onRemovedFromGroup$dispatch(this.children[n],this);var r=this.removeChild(this.children[n]);this.removeFromHash(r),i&&r&&r.destroy(!0),this.cursor===this.children[n]&&(this.cursor=null),n--}this.updateZ()}},e.Group.prototype.scatter=function(t,e){null==t&&(t=this.game.world.bounds),this.forEach(function(e){e.position.set(t.randomX,t.randomY)},null,e)},e.Group.prototype.shuffle=function(){e.ArrayUtils.shuffle(this.children),this.updateZ()},e.Group.prototype.destroy=function(t,e){null===this.game||this.ignoreDestroy||(void 0===t&&(t=!0),void 0===e&&(e=!1),this.onDestroy.dispatch(this,t,e),this.removeAll(t),this.cursor=null,this.filters=null,this.pendingDestroy=!1,e||(this.parent&&this.parent.removeChild(this),this.game=null,this.exists=!1))},Object.defineProperty(e.Group.prototype,"total",{get:function(){return this.iterate("exists",!0,e.Group.RETURN_TOTAL)}}),Object.defineProperty(e.Group.prototype,"length",{get:function(){return this.children.length}}),Object.defineProperty(e.Group.prototype,"angle",{get:function(){return e.Math.radToDeg(this.rotation)},set:function(t){this.rotation=e.Math.degToRad(t)}}),Object.defineProperty(e.Group.prototype,"centerX",{get:function(){return this.getBounds(this.parent).centerX},set:function(t){var e=this.getBounds(this.parent),i=this.x-e.x;this.x=t+i-e.halfWidth}}),Object.defineProperty(e.Group.prototype,"centerY",{get:function(){return this.getBounds(this.parent).centerY},set:function(t){var e=this.getBounds(this.parent),i=this.y-e.y;this.y=t+i-e.halfHeight}}),Object.defineProperty(e.Group.prototype,"left",{get:function(){return this.getBounds(this.parent).left},set:function(t){var e=this.getBounds(this.parent),i=this.x-e.x;this.x=t+i}}),Object.defineProperty(e.Group.prototype,"right",{get:function(){return this.getBounds(this.parent).right},set:function(t){var e=this.getBounds(this.parent),i=this.x-e.x;this.x=t+i-e.width}}),Object.defineProperty(e.Group.prototype,"top",{get:function(){return this.getBounds(this.parent).top},set:function(t){var e=this.getBounds(this.parent),i=this.y-e.y;this.y=t+i}}),Object.defineProperty(e.Group.prototype,"bottom",{get:function(){return this.getBounds(this.parent).bottom},set:function(t){var e=this.getBounds(this.parent),i=this.y-e.y;this.y=t+i-e.height}}),e.World=function(t){e.Group.call(this,t,null,"__world",!1),this.bounds=new e.Rectangle(0,0,t.width,t.height),this.camera=null,this._definedSize=!1,this._width=t.width,this._height=t.height,this.game.state.onStateChange.add(this.stateChange,this)},e.World.prototype=Object.create(e.Group.prototype),e.World.prototype.constructor=e.World,e.World.prototype.boot=function(){this.camera=new e.Camera(this.game,0,0,0,this.game.width,this.game.height),this.game.stage.addChild(this),this.camera.boot()},e.World.prototype.stateChange=function(){this.x=0,this.y=0,this.camera.reset()},e.World.prototype.setBounds=function(t,e,i,s){this._definedSize=!0,this._width=i,this._height=s,this.bounds.setTo(t,e,i,s),this.x=t,this.y=e,this.camera.bounds&&this.camera.bounds.setTo(t,e,Math.max(i,this.game.width),Math.max(s,this.game.height)),this.game.physics.setBoundsToWorld()},e.World.prototype.resize=function(t,e){this._definedSize&&(t<this._width&&(t=this._width),e<this._height&&(e=this._height)),this.bounds.width=t,this.bounds.height=e,this.game.camera.setBoundsToWorld(),this.game.physics.setBoundsToWorld()},e.World.prototype.shutdown=function(){this.destroy(!0,!0)},e.World.prototype.wrap=function(t,e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=!1),void 0===s&&(s=!0),void 0===n&&(n=!0),i?(t.getBounds(),s&&(t.x+t._currentBounds.width<this.bounds.x?t.x=this.bounds.right:t.x>this.bounds.right&&(t.x=this.bounds.left)),n&&(t.y+t._currentBounds.height<this.bounds.top?t.y=this.bounds.bottom:t.y>this.bounds.bottom&&(t.y=this.bounds.top))):(s&&t.x+e<this.bounds.x?t.x=this.bounds.right+e:s&&t.x-e>this.bounds.right&&(t.x=this.bounds.left-e),n&&t.y+e<this.bounds.top?t.y=this.bounds.bottom+e:n&&t.y-e>this.bounds.bottom&&(t.y=this.bounds.top-e))},e.World.prototype.wrapAll=function(t,e,i,s,n,r){t.forEach(this.wrap,this,e,i,s,n,r)},Object.defineProperty(e.World.prototype,"width",{get:function(){return this.bounds.width},set:function(t){t<this.game.width&&(t=this.game.width),this.bounds.width=t,this._width=t,this._definedSize=!0}}),Object.defineProperty(e.World.prototype,"height",{get:function(){return this.bounds.height},set:function(t){t<this.game.height&&(t=this.game.height),this.bounds.height=t,this._height=t,this._definedSize=!0}}),Object.defineProperty(e.World.prototype,"centerX",{get:function(){return this.bounds.halfWidth+this.bounds.x}}),Object.defineProperty(e.World.prototype,"centerY",{get:function(){return this.bounds.halfHeight+this.bounds.y}}),Object.defineProperty(e.World.prototype,"randomX",{get:function(){return this.bounds.x<0?this.game.rnd.between(this.bounds.x,this.bounds.width-Math.abs(this.bounds.x)):this.game.rnd.between(this.bounds.x,this.bounds.width)}}),Object.defineProperty(e.World.prototype,"randomY",{get:function(){return this.bounds.y<0?this.game.rnd.between(this.bounds.y,this.bounds.height-Math.abs(this.bounds.y)):this.game.rnd.between(this.bounds.y,this.bounds.height)}}),e.Game=function(t,i,s,n,r,o,a,h){return this.id=e.GAMES.push(this)-1,this.config=null,this.physicsConfig=h,this.parent="",this.width=800,this.height=600,this.resolution=1,this._width=800,this._height=600,this.transparent=!1,this.antialias=!0,this.multiTexture=!1,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!0,this.renderer=null,this.renderType=e.AUTO,this.state=null,this.isBooted=!1,this.isRunning=!1,this.raf=null,this.add=null,this.make=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.net=null,this.scale=null,this.sound=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.physics=null,this.plugins=null,this.rnd=null,this.device=e.Device,this.camera=null,this.canvas=null,this.context=null,this.debug=null,this.particles=null,this.create=null,this.lockRender=!1,this.pendingDestroy=!1,this.stepping=!1,this.pendingStep=!1,this.stepCount=0,this.onPause=null,this.onResume=null,this.onBlur=null,this.onFocus=null,this._paused=!1,this._codePaused=!1,this.currentUpdateID=0,this.updatesThisFrame=1,this.rendersThisFrame=1,this._deltaTime=0,this._lastCount=0,this._spiraling=0,this._kickstart=!0,this.fpsProblemNotifier=new e.Signal,this.forceSingleUpdate=!0,this.forceSingleRender=!0,this.dropFrames=!1,this._nextFpsNotification=0,1===arguments.length&&"object"==typeof arguments[0]?this.parseConfig(arguments[0]):(this.config={enableDebug:!0},void 0!==t&&(this._width=t),void 0!==i&&(this._height=i),void 0!==s&&(this.renderType=s),void 0!==n&&(this.parent=n),void 0!==o&&(this.transparent=o),void 0!==a&&(this.antialias=a),this.rnd=new e.RandomDataGenerator([(Date.now()*Math.random()).toString()]),this.state=new e.StateManager(this,r)),this.device.whenReady(this.boot,this),this},e.Game.prototype={parseConfig:function(t){this.config=t,void 0===t.enableDebug&&(this.config.enableDebug=!0),t.width&&(this._width=t.width),t.height&&(this._height=t.height),t.renderer&&(this.renderType=t.renderer),t.parent&&(this.parent=t.parent),void 0!==t.transparent&&(this.transparent=t.transparent),void 0!==t.antialias&&(this.antialias=t.antialias),void 0!==t.clearBeforeRender&&(this.clearBeforeRender=t.clearBeforeRender),void 0!==t.multiTexture&&(this.multiTexture=t.multiTexture),t.resolution&&(this.resolution=t.resolution),void 0!==t.preserveDrawingBuffer&&(this.preserveDrawingBuffer=t.preserveDrawingBuffer),t.physicsConfig&&(this.physicsConfig=t.physicsConfig);var i=[(Date.now()*Math.random()).toString()];t.seed&&(i=t.seed),this.rnd=new e.RandomDataGenerator(i);var s=null;t.state&&(s=t.state),this.state=new e.StateManager(this,s)},boot:function(){this.isBooted||(this.onPause=new e.Signal,this.onResume=new e.Signal,this.onBlur=new e.Signal,this.onFocus=new e.Signal,this.isBooted=!0,PIXI.game=this,this.math=e.Math,this.scale=new e.ScaleManager(this,this._width,this._height),this.stage=new e.Stage(this),this.setUpRenderer(),this.world=new e.World(this),this.add=new e.GameObjectFactory(this),this.make=new e.GameObjectCreator(this),this.cache=new e.Cache(this),this.load=new e.Loader(this),this.time=new e.Time(this),this.tweens=new e.TweenManager(this),this.input=new e.Input(this),this.sound=new e.SoundManager(this),this.physics=new e.Physics(this,this.physicsConfig),this.particles=new e.Particles(this),this.create=new e.Create(this),this.plugins=new e.PluginManager(this),this.net=new e.Net(this),this.time.boot(),this.stage.boot(),this.world.boot(),this.scale.boot(),this.input.boot(this.config),this.sound.boot(),this.state.boot(),this.config.enableDebug?(this.debug=new e.Utils.Debug(this),this.debug.boot()):this.debug={preUpdate:function(){},update:function(){},reset:function(){},isDisabled:!0},this.showDebugHeader(),this.isRunning=!0,this.config&&this.config.forceSetTimeOut?this.raf=new e.RequestAnimationFrame(this,this.config.forceSetTimeOut):this.raf=new e.RequestAnimationFrame(this,!1),this._kickstart=!0,this.focusWindow(),this.config.disableStart||(this.cache.isReady?this.raf.start():this.cache.onReady.addOnce(function(){this.raf.start()},this)))},showDebugHeader:function(){if(!window.PhaserGlobal||!window.PhaserGlobal.hideBanner){var t=e.VERSION,i="Canvas",s="HTML Audio",n=1;if(this.renderType===e.WEBGL?(i="WebGL",n++):this.renderType===e.HEADLESS&&(i="Headless"),this.device.webAudio&&(s="WebAudio",n++),this.device.ie)window.console&&console.log("Phaser v"+t+" | Pixi.js | "+i+" | "+s+" | http://phaser.io");else{for(var r=["%c %c %c Phaser CE v"+t+" | Pixi.js | "+i+" | "+s+" %c %c %c http://phaser.io %c♥%c♥%c♥","background: #fb8cb3","background: #d44a52","color: #ffffff; background: #871905;","background: #d44a52","background: #fb8cb3","background: #ffffff"],o=0;o<3;o++)o<n?r.push("color: #ff2424; background: #fff"):r.push("color: #959595; background: #fff");console.log.apply(console,r)}}},setUpRenderer:function(){if(!this.device.canvas)throw new Error("Phaser.Game - Cannot create Canvas 2d context, aborting.");if(this.config.canvas?this.canvas=this.config.canvas:this.canvas=e.Canvas.create(this,this.width,this.height,this.config.canvasID,!0),this.config.canvasStyle?this.canvas.style=this.config.canvasStyle:this.canvas.style["-webkit-full-screen"]="width: 100%; height: 100%",this.config.crisp&&e.Canvas.setImageRenderingCrisp(this.canvas),this.renderType===e.WEBGL||this.renderType===e.WEBGL_MULTI||this.renderType===e.AUTO&&this.device.webGL){(this.multiTexture||this.renderType===e.WEBGL_MULTI)&&(PIXI.enableMultiTexture(),this.multiTexture=!0);try{this.renderer=new PIXI.WebGLRenderer(this,this.config),this.renderType=e.WEBGL,this.context=null,this.canvas.addEventListener("webglcontextlost",this.contextLost.bind(this),!1),this.canvas.addEventListener("webglcontextrestored",this.contextRestored.bind(this),!1)}catch(t){if(PIXI.defaultRenderer=null,this.renderer=null,this.multiTexture=!1,PIXI._enableMultiTextureToggle=!1,this.renderType===e.WEBGL)throw t}}this.renderer||(this.renderer=new PIXI.CanvasRenderer(this,this.config),this.context=this.renderer.context,this.renderType===e.AUTO&&(this.renderType=e.CANVAS)),this.device.cocoonJS&&(this.canvas.screencanvas=this.renderType===e.CANVAS),this.renderType!==e.HEADLESS&&(this.stage.smoothed=this.antialias,e.Canvas.addToDOM(this.canvas,this.parent,!1),e.Canvas.setTouchAction(this.canvas))},contextLost:function(t){t.preventDefault(),this.renderer.contextLost=!0},contextRestored:function(){this.renderer.initContext(),this.cache.clearGLTextures(),this.renderer.contextLost=!1},update:function(t){if(this.pendingDestroy)this.destroy();else{if(this.time.update(t),this._kickstart)return this.updateLogic(this.time.desiredFpsMult),this.updateRender(this.time.slowMotion*this.time.desiredFps),void(this._kickstart=!1);if(this._spiraling>1&&!this.forceSingleUpdate)this.time.time>this._nextFpsNotification&&(this._nextFpsNotification=this.time.time+1e4,this.fpsProblemNotifier.dispatch()),this._deltaTime=0,this._spiraling=0,this.dropFrames?this.rendersThisFrame=0:(this.updateRender(this.time.slowMotion*this.time.desiredFps),this.rendersThisFrame=1);else{var e=1e3*this.time.slowMotion/this.time.desiredFps;this._deltaTime+=Math.max(Math.min(3*e,this.time.elapsed),0);var i=0;for(this.updatesThisFrame=Math.floor(this._deltaTime/e),this.forceSingleUpdate&&(this.updatesThisFrame=Math.min(1,this.updatesThisFrame)),this.forceSingleRender?this.rendersThisFrame=1:this.rendersThisFrame=Math.min(1,this.updatesThisFrame);this._deltaTime>=e&&(this._deltaTime-=e,this.currentUpdateID=i,this.updateLogic(this.time.desiredFpsMult),i++,!this.forceSingleUpdate||1!==i);)this.time.refresh();i>this._lastCount?this._spiraling++:i<this._lastCount&&(this._spiraling=0),this._lastCount=i,this.rendersThisFrame>0&&this.updateRender(this._deltaTime/e)}}},updateLogic:function(t){this._paused||this.pendingStep?(this.scale.pauseUpdate(),this.state.pauseUpdate(t),this.debug.preUpdate(),this.input.pauseUpdate()):(this.stepping&&(this.pendingStep=!0),this.time.countUpdate(),this.scale.preUpdate(),this.debug.preUpdate(),this.camera.preUpdate(),this.physics.preUpdate(),this.state.preUpdate(t),this.plugins.preUpdate(t),this.stage.preUpdate(),this.state.update(),this.stage.update(),this.tweens.update(),this.sound.update(),this.input.update(),this.physics.update(),this.plugins.update(),this.stage.postUpdate(),this.state.postUpdate(),this.plugins.postUpdate()),this.stage.updateTransform()},updateRender:function(t){this.lockRender||this.renderType===e.HEADLESS||(this.time.countRender(),this.state.preRender(t),this.renderer.render(this.stage),this.plugins.render(t),this.state.render(t),this.plugins.postRender(t))},enableStep:function(){this.stepping=!0,this.pendingStep=!1,this.stepCount=0},disableStep:function(){this.stepping=!1,this.pendingStep=!1},step:function(){this.pendingStep=!1,this.stepCount++},destroy:function(){this.raf.stop(),this.debug.destroy&&this.debug.destroy(),this.state.destroy(),this.sound.destroy(),this.scale.destroy(),this.stage.destroy(),this.input.destroy(),this.physics.destroy(),this.plugins.destroy(),this.tweens.destroy(),this.debug=null,this.state=null,this.sound=null,this.scale=null,this.stage=null,this.input=null,this.physics=null,this.plugins=null,this.tweens=null,this.cache=null,this.load=null,this.time=null,this.world=null,this.isBooted=!1,this.renderer.destroy(!1),e.Canvas.removeFromDOM(this.canvas),PIXI.game===this&&(PIXI.game=null),PIXI.defaultRenderer=null,e.GAMES[this.id]=null},gamePaused:function(t){this._paused||(this._paused=!0,this.time.gamePaused(),this.sound.muteOnPause&&this.sound.setMute(),this.onPause.dispatch(t),this.device.cordova&&this.device.iOS&&(this.lockRender=!0))},gameResumed:function(t){this._paused&&!this._codePaused&&(this._paused=!1,this.time.gameResumed(),this.input.reset(),this.sound.muteOnPause&&this.sound.unsetMute(),this.onResume.dispatch(t),this.device.cordova&&this.device.iOS&&(this.lockRender=!1))},focusLoss:function(t){this.onBlur.dispatch(t),this.stage.disableVisibilityChange||this.gamePaused(t)},focusGain:function(t){this.focusWindow(),this.onFocus.dispatch(t),this.stage.disableVisibilityChange||this.gameResumed(t)},focusWindow:function(){window.focus&&(!window.PhaserGlobal||window.PhaserGlobal&&!window.PhaserGlobal.stopFocus)&&window.focus()}},e.Game.prototype.constructor=e.Game,Object.defineProperty(e.Game.prototype,"paused",{get:function(){return this._paused},set:function(t){!0===t?(!1===this._paused&&(this._paused=!0,this.sound.muteOnPause&&this.sound.setMute(),this.time.gamePaused(),this.onPause.dispatch(this)),this._codePaused=!0):(this._paused&&(this._paused=!1,this.input.reset(),this.sound.unsetMute(),this.time.gameResumed(),this.onResume.dispatch(this)),this._codePaused=!1)}}),e.Input=function(t){this.game=t,this.hitCanvas=null,this.hitContext=null,this.moveCallbacks=[],this.customCandidateHandler=null,this.customCandidateHandlerContext=null,this.pollRate=0,this.enabled=!0,this.multiInputOverride=e.Input.MOUSE_TOUCH_COMBINE,this.position=null,this.speed=null,this.circle=null,this.scale=null,this.maxPointers=-1,this.tapRate=200,this.doubleTapRate=300,this.holdRate=2e3,this.justPressedRate=200,this.justReleasedRate=200,this.recordPointerHistory=!1,this.recordRate=100,this.recordLimit=100,this.touchLockCallbacks=[],this.pointer1=null,this.pointer2=null,this.pointer3=null,this.pointer4=null,this.pointer5=null,this.pointer6=null,this.pointer7=null,this.pointer8=null,this.pointer9=null,this.pointer10=null,this.pointers=[],this.activePointer=null,this.mousePointer=null,this.mouse=null,this.keyboard=null,this.touch=null,this.mspointer=null,this.gamepad=null,this.resetLocked=!1,this.onDown=null,this.onUp=null,this.onTap=null,this.onHold=null,this.minPriorityID=0,this.interactiveItems=new e.ArraySet,this._localPoint=new e.Point,this._pollCounter=0,this._oldPosition=null,this._x=0,this._y=0},e.Input.MOUSE_OVERRIDES_TOUCH=0,e.Input.TOUCH_OVERRIDES_MOUSE=1,e.Input.MOUSE_TOUCH_COMBINE=2,e.Input.MAX_POINTERS=10,e.Input.prototype={boot:function(t){"maxPointers"in t&&(this.maxPointers=t.maxPointers),this.mousePointer=new e.Pointer(this.game,0,e.PointerMode.CURSOR),this.addPointer(),this.addPointer(),this.mouse=new e.Mouse(this.game),this.touch=new e.Touch(this.game),this.mspointer=new e.MSPointer(this.game),this.mouseWheel=new e.MouseWheel(this.game),this.pointerLock=new e.PointerLock(this.game),e.Keyboard&&(this.keyboard=new e.Keyboard(this.game)),e.Gamepad&&(this.gamepad=new e.Gamepad(this.game)),this.onDown=new e.Signal,this.onUp=new e.Signal,this.onTap=new e.Signal,this.onHold=new e.Signal,this.scale=new e.Point(1,1),this.speed=new e.Point,this.position=new e.Point,this._oldPosition=new e.Point,this.circle=new e.Circle(0,0,45),this.activePointer=this.mousePointer,this.hitCanvas=e.CanvasPool.create(this,1,1),this.hitContext=this.hitCanvas.getContext("2d"),this.game.device.mspointer&&!1!==t.mspointer?this.mspointer.start():this.game.device.touch&&!1!==t.touch&&this.touch.start(),this.mspointer.active||!1===t.mouse||this.mouse.start(),this.mousePointer.active=!0,!1!==t.mouseWheel&&this.mouseWheel.start(),!1!==t.pointerLock&&this.pointerLock.start(),this.keyboard&&!1!==t.keyboard&&this.keyboard.start();var i=this;this._onClickTrampoline=function(t){i.onClickTrampoline(t)},this.game.canvas.addEventListener("click",this._onClickTrampoline,!1)},destroy:function(){this.mouse.stop(),this.mouseWheel.stop(),this.touch.stop(),this.mspointer.stop(),this.pointerLock.stop(),this.keyboard&&this.keyboard.stop(),this.gamepad&&this.gamepad.stop(),this.moveCallbacks=[],e.CanvasPool.remove(this),this.game.canvas.removeEventListener("click",this._onClickTrampoline)},setInteractiveCandidateHandler:function(t,e){this.customCandidateHandler=t,this.customCandidateHandlerContext=e},addMoveCallback:function(t,e){this.moveCallbacks.push({callback:t,context:e})},addTouchLockCallback:function(t,e,i){void 0===i&&(i=!1),this.touchLockCallbacks.push({callback:t,context:e,onEnd:i})},removeTouchLockCallback:function(t,e){for(var i=this.touchLockCallbacks.length;i--;)if(this.touchLockCallbacks[i].callback===t&&this.touchLockCallbacks[i].context===e)return this.touchLockCallbacks.splice(i,1),!0;return!1},executeTouchLockCallbacks:function(t,e){for(var i=this.touchLockCallbacks.length;i--;){var s=this.touchLockCallbacks[i];s.onEnd===t&&s.callback.call(s.context,this,e)&&this.touchLockCallbacks.splice(i,1)}},deleteMoveCallback:function(t,e){for(var i=this.moveCallbacks.length;i--;)if(this.moveCallbacks[i].callback===t&&this.moveCallbacks[i].context===e)return void this.moveCallbacks.splice(i,1)},addPointer:function(){if(this.pointers.length>=e.Input.MAX_POINTERS)return console.warn("Phaser.Input.addPointer: Maximum limit of "+e.Input.MAX_POINTERS+" pointers reached."),null;var t=this.pointers.length+1,i=new e.Pointer(this.game,t,e.PointerMode.CONTACT);return this.pointers.push(i),this["pointer"+t]=i,i},update:function(){if(this.keyboard&&this.keyboard.update(),this.pollRate>0&&this._pollCounter<this.pollRate)this._pollCounter++;else{this.speed.x=this.position.x-this._oldPosition.x,this.speed.y=this.position.y-this._oldPosition.y,this._oldPosition.copyFrom(this.position),this.mousePointer.update(),this.gamepad&&this.gamepad.active&&this.gamepad.update();for(var t=0;t<this.pointers.length;t++)this.pointers[t].update();this._pollCounter=0}},pauseUpdate:function(){this.gamepad&&this.gamepad.active&&this.gamepad.update()},reset:function(t){if(this.game.isBooted&&!this.resetLocked){void 0===t&&(t=!1),this.mousePointer.reset(),this.keyboard&&this.keyboard.reset(t);for(var i=0;i<this.pointers.length;i++)this.pointers[i].reset();"none"!==this.game.canvas.style.cursor&&(this.game.canvas.style.cursor=""),t&&(this.onDown.dispose(),this.onUp.dispose(),this.onTap.dispose(),this.onHold.dispose(),this.onDown=new e.Signal,this.onUp=new e.Signal,this.onTap=new e.Signal,this.onHold=new e.Signal,this.moveCallbacks=[]),this._pollCounter=0}},resetSpeed:function(t,e){this._oldPosition.setTo(t,e),this.speed.setTo(0,0)},startPointer:function(t){if(this.maxPointers>=0&&this.countActivePointers(this.maxPointers)>=this.maxPointers)return null;if(!this.pointer1.active)return this.pointer1.start(t);if(!this.pointer2.active)return this.pointer2.start(t);for(var e=2;e<this.pointers.length;e++){var i=this.pointers[e];if(!i.active)return i.start(t)}return null},updatePointer:function(t){if(this.pointer1.active&&this.pointer1.identifier===t.identifier)return this.pointer1.move(t);if(this.pointer2.active&&this.pointer2.identifier===t.identifier)return this.pointer2.move(t);for(var e=2;e<this.pointers.length;e++){var i=this.pointers[e];if(i.active&&i.identifier===t.identifier)return i.move(t)}return null},stopPointer:function(t){if(this.pointer1.active&&this.pointer1.identifier===t.identifier)return this.pointer1.stop(t);if(this.pointer2.active&&this.pointer2.identifier===t.identifier)return this.pointer2.stop(t);for(var e=2;e<this.pointers.length;e++){var i=this.pointers[e];if(i.active&&i.identifier===t.identifier)return i.stop(t)}return null},countActivePointers:function(t){void 0===t&&(t=this.pointers.length);for(var e=t,i=0;i<this.pointers.length&&e>0;i++)this.pointers[i].active&&e--;return t-e},getPointer:function(t){void 0===t&&(t=!1);for(var e=0;e<this.pointers.length;e++){var i=this.pointers[e];if(i.active===t)return i}return null},getPointerFromIdentifier:function(t){for(var e=0;e<this.pointers.length;e++){var i=this.pointers[e];if(i.identifier===t)return i}return null},getPointerFromId:function(t){for(var e=0;e<this.pointers.length;e++){var i=this.pointers[e];if(i.pointerId===t)return i}return null},getLocalPosition:function(t,i,s){void 0===s&&(s=new e.Point);var n=t.worldTransform,r=1/(n.a*n.d+n.c*-n.b);return s.setTo(n.d*r*i.x+-n.c*r*i.y+(n.ty*n.c-n.tx*n.d)*r,n.a*r*i.y+-n.b*r*i.x+(-n.ty*n.a+n.tx*n.b)*r)},hitTest:function(t,i,s){if(!t.worldVisible)return!1;if(this.getLocalPosition(t,i,this._localPoint),s.copyFrom(this._localPoint),t.hitArea&&t.hitArea.contains)return t.hitArea.contains(this._localPoint.x,this._localPoint.y);if(e.Creature&&t instanceof e.Creature){var n=Math.abs(t.width),r=Math.abs(t.height),o=t.x-n*t.anchorX;if(this.game.camera.x+i.x>=o&&this.game.camera.x+i.x<o+n){a=t.y-r*t.anchorY;if(this.game.camera.y+i.y>=a&&this.game.camera.y+i.y<a+r)return!0}}else if(t instanceof e.TileSprite){var n=t.width,r=t.height,o=-n*t.anchor.x;if(this._localPoint.x>=o&&this._localPoint.x<o+n){a=-r*t.anchor.y;if(this._localPoint.y>=a&&this._localPoint.y<a+r)return!0}}else if(t instanceof PIXI.Sprite){var n=t.texture.frame.width/t.texture.baseTexture.resolution,r=t.texture.frame.height/t.texture.baseTexture.resolution,o=-n*t.anchor.x;if(this._localPoint.x>=o&&this._localPoint.x<o+n){var a=-r*t.anchor.y;if(this._localPoint.y>=a&&this._localPoint.y<a+r)return!0}}else if(t instanceof e.Graphics)for(l=0;l<t.graphicsData.length;l++){var h=t.graphicsData[l];if(h.fill&&(h.shape&&h.shape.contains(this._localPoint.x,this._localPoint.y)))return!0}for(var l=0;l<t.children.length;l++)if(this.hitTest(t.children[l],i,s))return!0;return!1},onClickTrampoline:function(){this.activePointer.processClickTrampolines()}},e.Input.prototype.constructor=e.Input,Object.defineProperty(e.Input.prototype,"x",{get:function(){return this._x},set:function(t){this._x=Math.floor(t)}}),Object.defineProperty(e.Input.prototype,"y",{get:function(){return this._y},set:function(t){this._y=Math.floor(t)}}),Object.defineProperty(e.Input.prototype,"pollLocked",{get:function(){return this.pollRate>0&&this._pollCounter<this.pollRate}}),Object.defineProperty(e.Input.prototype,"totalInactivePointers",{get:function(){return this.pointers.length-this.countActivePointers()}}),Object.defineProperty(e.Input.prototype,"totalActivePointers",{get:function(){return this.countActivePointers()}}),Object.defineProperty(e.Input.prototype,"worldX",{get:function(){return this.game.camera.view.x+this.x}}),Object.defineProperty(e.Input.prototype,"worldY",{get:function(){return this.game.camera.view.y+this.y}}),e.Mouse=function(t){this.game=t,this.input=t.input,this.callbackContext=this.game,this.mouseDownCallback=null,this.mouseUpCallback=null,this.mouseOutCallback=null,this.mouseOverCallback=null,this.capture=!1,this.active=!1,this.enabled=!0,this.stopOnGameOut=!1,this.event=null,this._onMouseDown=null,this._onMouseMove=null,this._onMouseUp=null,this._onMouseOut=null,this._onMouseOver=null},e.Mouse.NO_BUTTON=-1,e.Mouse.LEFT_BUTTON=0,e.Mouse.MIDDLE_BUTTON=1,e.Mouse.RIGHT_BUTTON=2,e.Mouse.BACK_BUTTON=3,e.Mouse.FORWARD_BUTTON=4,e.Mouse.WHEEL_UP=1,e.Mouse.WHEEL_DOWN=-1,e.Mouse.prototype={start:function(){var t=this.game.device;if(t.isAndroidStockBrowser()&&this.input.touch.active)return!1;if(null!==this._onMouseDown)return!1;var e=this;this._onMouseDown=function(t){return e.onMouseDown(t)},this._onMouseMove=function(t){return e.onMouseMove(t)},this._onMouseUp=function(t){return e.onMouseUp(t)},this._onMouseUpGlobal=function(t){return e.onMouseUpGlobal(t)},this._onMouseOutGlobal=function(t){return e.onMouseOutGlobal(t)},this._onMouseOut=function(t){return e.onMouseOut(t)},this._onMouseOver=function(t){return e.onMouseOver(t)};var i=this.game.canvas;return i.addEventListener("mousedown",this._onMouseDown,!0),i.addEventListener("mousemove",this._onMouseMove,!0),i.addEventListener("mouseup",this._onMouseUp,!0),t.cocoonJS||(window.addEventListener("mouseup",this._onMouseUpGlobal,!0),window.addEventListener("mouseout",this._onMouseOutGlobal,!0),i.addEventListener("mouseover",this._onMouseOver,!0),i.addEventListener("mouseout",this._onMouseOut,!0)),this.active=!0,!0},onMouseDown:function(t){this.event=t,this.capture&&t.preventDefault(),this.mouseDownCallback&&this.mouseDownCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled&&(t.identifier=0,this.input.mousePointer.start(t))},onMouseMove:function(t){this.event=t,this.capture&&t.preventDefault(),this.mouseMoveCallback&&this.mouseMoveCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled&&(t.identifier=0,this.input.mousePointer.move(t))},onMouseUp:function(t){this.event=t,this.capture&&t.preventDefault(),this.mouseUpCallback&&this.mouseUpCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled&&(t.identifier=0,this.input.mousePointer.stop(t))},onMouseUpGlobal:function(t){this.input.mousePointer.withinGame||(this.mouseUpCallback&&this.mouseUpCallback.call(this.callbackContext,t),t.identifier=0,this.input.mousePointer.stop(t))},onMouseOutGlobal:function(t){this.event=t,this.capture&&t.preventDefault(),this.input.mousePointer.withinGame=!1,this.input.enabled&&this.enabled&&(this.input.mousePointer.stop(t),this.input.mousePointer.resetButtons())},onMouseOut:function(t){if(this.event=t,this.capture&&t.preventDefault(),this.input.mousePointer.withinGame=!1,this.mouseOutCallback&&this.mouseOutCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled){this.stopOnGameOut&&(t.identifier=0,this.input.mousePointer.stop(t));for(var e=this.input.interactiveItems.list,i=e.length;i--;){var s=e[i];s.enabled&&s._pointerOutHandler(this.input.mousePointer)}}},onMouseOver:function(t){this.event=t,this.capture&&t.preventDefault(),this.input.mousePointer.withinGame=!0,this.mouseOverCallback&&this.mouseOverCallback.call(this.callbackContext,t)},releasePointerLock:function(){return console.warn("Deprecated. Please use `input.pointerLock.exit()` instead."),this.input.pointerLock.exit()},requestPointerLock:function(){return console.warn("Deprecated. Please use `input.pointerLock.request()` instead."),this.input.pointerLock.request()},stop:function(){var t=this.game.canvas;t.removeEventListener("mousedown",this._onMouseDown,!0),t.removeEventListener("mousemove",this._onMouseMove,!0),t.removeEventListener("mouseup",this._onMouseUp,!0),t.removeEventListener("mouseover",this._onMouseOver,!0),t.removeEventListener("mouseout",this._onMouseOut,!0),window.removeEventListener("mouseup",this._onMouseUpGlobal,!0),window.removeEventListener("mouseout",this._onMouseOutGlobal,!0),this.active=!1}},e.Mouse.prototype.constructor=e.Mouse,Object.defineProperty(e.Mouse.prototype,"locked",{get:function(){return this.input.pointerLock.locked}}),Object.defineProperty(e.Mouse.prototype,"pointerLock",{get:function(){return this.input.pointerLock.onChange}}),Object.defineProperty(e.Mouse.prototype,"mouseWheelCallback",{get:function(){return this.input.mouseWheel.callback},set:function(t){this.input.mouseWheel.callback=t}}),Object.defineProperty(e.Mouse.prototype,"wheelDelta",{get:function(){return this.input.mouseWheel.delta}}),e.MouseWheel=function(t){this.game=t,this.input=t.input,this.element=t.canvas,this.preventDefault=!0,this.active=!1,this.callback=null,this.callbackContext=t,this.delta=0,this.wheelEventName=t.device.wheelEvent,this.boundOnWheelHandler=this.onWheelHandler.bind(this),this.eventProxy=null},e.MouseWheel.UP=1,e.MouseWheel.DOWN=-1,e.MouseWheel.prototype.start=function(){return!(!this.wheelEventName||this.active)&&(this.element.addEventListener(this.wheelEventName,this.boundOnWheelHandler,!0),"mousewheel"===this.wheelEventName?this.eventProxy=new e.WheelEventProxy(-.025,1):"DOMMouseScroll"===this.wheelEventName&&(this.eventProxy=new e.WheelEventProxy(1,1)),this.active=!0,!0)},e.MouseWheel.prototype.stop=function(){this.active&&(this.element.removeEventListener(this.wheelEventName,this.boundOnWheelHandler,!0),this.active=!1)},e.MouseWheel.prototype.onWheelHandler=function(t){this.eventProxy&&(t=this.eventProxy.bindEvent(t)),this.preventDefault&&t.preventDefault(),this.delta=e.Math.clamp(-t.deltaY,-1,1),this.callback&&this.callback.call(this.callbackContext,t)},e.MSPointer=function(t){this.game=t,this.input=t.input,this.callbackContext=this.game,this.pointerDownCallback=null,this.pointerMoveCallback=null,this.pointerUpCallback=null,this.capture=!1,this.event=null,this.active=!1,this.enabled=!0,this._onMSPointerDown=null,this._onMSPointerMove=null,this._onMSPointerUp=null,this._onMSPointerUpGlobal=null,this._onMSPointerOut=null,this._onMSPointerOver=null},e.MSPointer.prototype={start:function(){if(!this.game.device.mspointer)return!1;if(null!==this._onMSPointerDown)return!1;var t=this;this._onMSPointerDown=function(e){return t.onPointerDown(e)},this._onMSPointerMove=function(e){return t.onPointerMove(e)},this._onMSPointerUp=function(e){return t.onPointerUp(e)},this._onMSPointerUpGlobal=function(e){return t.onPointerUpGlobal(e)},this._onMSPointerOut=function(e){return t.onPointerOut(e)},this._onMSPointerOver=function(e){return t.onPointerOver(e)};var e=this.game.canvas;return e.addEventListener("MSPointerDown",this._onMSPointerDown,!1),e.addEventListener("MSPointerMove",this._onMSPointerMove,!1),e.addEventListener("MSPointerUp",this._onMSPointerUp,!1),e.addEventListener("pointerdown",this._onMSPointerDown,!1),e.addEventListener("pointermove",this._onMSPointerMove,!1),e.addEventListener("pointerup",this._onMSPointerUp,!1),e.style["-ms-content-zooming"]="none",e.style["-ms-touch-action"]="none",this.game.device.cocoonJS||(window.addEventListener("MSPointerUp",this._onMSPointerUpGlobal,!0),e.addEventListener("MSPointerOver",this._onMSPointerOver,!0),e.addEventListener("MSPointerOut",this._onMSPointerOut,!0),window.addEventListener("pointerup",this._onMSPointerUpGlobal,!0),e.addEventListener("pointerover",this._onMSPointerOver,!0),e.addEventListener("pointerout",this._onMSPointerOut,!0)),this.active=!0,!0},onPointerDown:function(t){this.game.input.executeTouchLockCallbacks(!1,t),this.event=t,this.capture&&t.preventDefault(),this.pointerDownCallback&&this.pointerDownCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled&&(t.identifier=t.pointerId,"mouse"===t.pointerType||4===t.pointerType?this.input.mousePointer.start(t):this.input.startPointer(t))},onPointerMove:function(t){this.event=t,this.capture&&t.preventDefault(),this.pointerMoveCallback&&this.pointerMoveCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled&&(t.identifier=t.pointerId,"mouse"===t.pointerType||4===t.pointerType?this.input.mousePointer.move(t):this.input.updatePointer(t))},onPointerUp:function(t){this.game.input.executeTouchLockCallbacks(!0,t),this.event=t,this.capture&&t.preventDefault(),this.pointerUpCallback&&this.pointerUpCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled&&(t.identifier=t.pointerId,"mouse"===t.pointerType||4===t.pointerType?this.input.mousePointer.stop(t):this.input.stopPointer(t))},onPointerUpGlobal:function(t){if("mouse"!==t.pointerType&&4!==t.pointerType||this.input.mousePointer.withinGame){var e=this.input.getPointerFromIdentifier(t.identifier);e&&e.withinGame&&this.onPointerUp(t)}else this.onPointerUp(t)},onPointerOut:function(t){if(this.event=t,this.capture&&t.preventDefault(),"mouse"===t.pointerType||4===t.pointerType)this.input.mousePointer.withinGame=!1;else{var e=this.input.getPointerFromIdentifier(t.identifier);e&&(e.withinGame=!1)}this.input.mouse.mouseOutCallback&&this.input.mouse.mouseOutCallback.call(this.input.mouse.callbackContext,t),this.input.enabled&&this.enabled&&this.input.mouse.stopOnGameOut&&(t.identifier=0,e?e.stop(t):this.input.mousePointer.stop(t))},onPointerOver:function(t){if(this.event=t,this.capture&&t.preventDefault(),"mouse"===t.pointerType||4===t.pointerType)this.input.mousePointer.withinGame=!0;else{var e=this.input.getPointerFromIdentifier(t.identifier);e&&(e.withinGame=!0)}this.input.mouse.mouseOverCallback&&this.input.mouse.mouseOverCallback.call(this.input.mouse.callbackContext,t)},stop:function(){var t=this.game.canvas;t.removeEventListener("MSPointerDown",this._onMSPointerDown,!1),t.removeEventListener("MSPointerMove",this._onMSPointerMove,!1),t.removeEventListener("MSPointerUp",this._onMSPointerUp,!1),t.removeEventListener("pointerdown",this._onMSPointerDown,!1),t.removeEventListener("pointermove",this._onMSPointerMove,!1),t.removeEventListener("pointerup",this._onMSPointerUp,!1),window.removeEventListener("MSPointerUp",this._onMSPointerUpGlobal,!0),t.removeEventListener("MSPointerOver",this._onMSPointerOver,!0),t.removeEventListener("MSPointerOut",this._onMSPointerOut,!0),window.removeEventListener("pointerup",this._onMSPointerUpGlobal,!0),t.removeEventListener("pointerover",this._onMSPointerOver,!0),t.removeEventListener("pointerout",this._onMSPointerOut,!0),this.active=!1}},e.MSPointer.prototype.constructor=e.MSPointer,e.DeviceButton=function(t,i){this.parent=t,this.game=t.game,this.event=null,this.isDown=!1,this.isUp=!0,this.timeDown=0,this.timeUp=0,this.repeats=0,this.altKey=!1,this.shiftKey=!1,this.ctrlKey=!1,this.value=0,this.buttonCode=i,this.onDown=new e.Signal,this.onUp=new e.Signal,this.onFloat=new e.Signal},e.DeviceButton.prototype={start:function(t,e){this.isDown||(this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.time,this.repeats=0,this.event=t,this.value=e,t&&(this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.ctrlKey=t.ctrlKey),this.onDown.dispatch(this,e))},stop:function(t,e){this.isUp||(this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.time,this.event=t,this.value=e,t&&(this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.ctrlKey=t.ctrlKey),this.onUp.dispatch(this,e))},startStop:function(t,e,i){t?this.start(e,i):this.stop(e,i)},padFloat:function(t){this.isDown=!1,this.isUp=!1,this.value=t,this.onFloat.dispatch(this,t)},justPressed:function(t){return t=t||250,this.isDown&&this.timeDown+t>this.game.time.time},justReleased:function(t){return t=t||250,this.isUp&&this.timeUp+t>this.game.time.time},reset:function(){this.isDown=!1,this.isUp=!0,this.timeDown=this.game.time.time,this.repeats=0,this.altKey=!1,this.shiftKey=!1,this.ctrlKey=!1},destroy:function(){this.onDown.dispose(),this.onUp.dispose(),this.onFloat.dispose(),this.parent=null,this.game=null}},e.DeviceButton.prototype.constructor=e.DeviceButton,Object.defineProperty(e.DeviceButton.prototype,"duration",{get:function(){return this.isUp?-1:this.game.time.time-this.timeDown}}),e.Pointer=function(t,i,s){this.game=t,this.id=i,this.type=e.POINTER,this.exists=!0,this.identifier=0,this.pointerId=null,this.pointerMode=s||e.PointerMode.CURSOR|e.PointerMode.CONTACT,this.target=null,this.button=null,this.leftButton=new e.DeviceButton(this,e.Pointer.LEFT_BUTTON),this.middleButton=new e.DeviceButton(this,e.Pointer.MIDDLE_BUTTON),this.rightButton=new e.DeviceButton(this,e.Pointer.RIGHT_BUTTON),this.backButton=new e.DeviceButton(this,e.Pointer.BACK_BUTTON),this.forwardButton=new e.DeviceButton(this,e.Pointer.FORWARD_BUTTON),this.eraserButton=new e.DeviceButton(this,e.Pointer.ERASER_BUTTON),this._holdSent=!1,this._history=[],this._nextDrop=0,this._stateReset=!1,this.withinGame=!1,this.clientX=-1,this.clientY=-1,this.pageX=-1,this.pageY=-1,this.screenX=-1,this.screenY=-1,this.rawMovementX=0,this.rawMovementY=0,this.movementX=0,this.movementY=0,this.x=-1,this.y=-1,this.isMouse=0===i,this.isDown=!1,this.isUp=!0,this.timeDown=0,this.timeUp=0,this.previousTapTime=0,this.totalTouches=0,this.msSinceLastClick=Number.MAX_VALUE,this.targetObject=null,this.interactiveCandidates=[],this.active=!1,this.dirty=!1,this.position=new e.Point,this.positionDown=new e.Point,this.positionUp=new e.Point,this.circle=new e.Circle(0,0,44),this._clickTrampolines=null,this._trampolineTargetObject=null},e.Pointer.NO_BUTTON=0,e.Pointer.LEFT_BUTTON=1,e.Pointer.RIGHT_BUTTON=2,e.Pointer.MIDDLE_BUTTON=4,e.Pointer.BACK_BUTTON=8,e.Pointer.FORWARD_BUTTON=16,e.Pointer.ERASER_BUTTON=32,e.Pointer.prototype={resetButtons:function(){this.isDown=!1,this.isUp=!0,this.isMouse&&(this.leftButton.reset(),this.middleButton.reset(),this.rightButton.reset(),this.backButton.reset(),this.forwardButton.reset(),this.eraserButton.reset())},processButtonsDown:function(t,i){t===e.Mouse.LEFT_BUTTON&&this.leftButton.start(i),t===e.Mouse.RIGHT_BUTTON&&this.rightButton.start(i),t===e.Mouse.MIDDLE_BUTTON&&this.middleButton.start(i),t===e.Mouse.BACK_BUTTON&&this.backButton.start(i),t===e.Mouse.FORWARD_BUTTON&&this.forwardButton.start(i)},processButtonsUp:function(t,i){t===e.Mouse.LEFT_BUTTON&&this.leftButton.stop(i),t===e.Mouse.RIGHT_BUTTON&&this.rightButton.stop(i),t===e.Mouse.MIDDLE_BUTTON&&this.middleButton.stop(i),t===e.Mouse.BACK_BUTTON&&this.backButton.stop(i),t===e.Mouse.FORWARD_BUTTON&&this.forwardButton.stop(i)},processButtonsUpDown:function(t,i){var s="down"===i.type.toLowerCase().substr(-4),n="move"===i.type.toLowerCase().substr(-4);void 0!==t?(s&&1===t&&i.ctrlKey&&(t=2),this.leftButton.startStop(e.Pointer.LEFT_BUTTON&t,i),this.rightButton.startStop(e.Pointer.RIGHT_BUTTON&t,i),this.middleButton.startStop(e.Pointer.MIDDLE_BUTTON&t,i),this.backButton.startStop(e.Pointer.BACK_BUTTON&t,i),this.forwardButton.startStop(e.Pointer.FORWARD_BUTTON&t,i),this.eraserButton.startStop(e.Pointer.ERASER_BUTTON&t,i)):void 0!==i.button?s&&i.ctrlKey&&0===i.button?this.rightButton.start(i):s?this.processButtonsDown(i.button,i):n||this.processButtonsUp(i.button,i):s?i.ctrlKey?this.rightButton.start(i):this.leftButton.start(i):(this.leftButton.stop(i),this.rightButton.stop(i))},updateButtons:function(t){this.button=t.button,this.processButtonsUpDown(t.buttons,t),this.isUp=!0,this.isDown=!1,(this.leftButton.isDown||this.rightButton.isDown||this.middleButton.isDown||this.backButton.isDown||this.forwardButton.isDown||this.eraserButton.isDown)&&(this.isUp=!1,this.isDown=!0)},start:function(t){var i=this.game.input;return t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.isMouse?this.updateButtons(t):(this.isDown=!0,this.isUp=!1),this.active=!0,this.withinGame=!0,this.dirty=!1,this._history=[],this._clickTrampolines=null,this._trampolineTargetObject=null,this.msSinceLastClick=this.game.time.time-this.timeDown,this.timeDown=this.game.time.time,this._holdSent=!1,this.move(t,!0),this.positionDown.setTo(this.x,this.y),(i.multiInputOverride===e.Input.MOUSE_OVERRIDES_TOUCH||i.multiInputOverride===e.Input.MOUSE_TOUCH_COMBINE||i.multiInputOverride===e.Input.TOUCH_OVERRIDES_MOUSE&&0===i.totalActivePointers)&&(i.x=this.x,i.y=this.y,i.position.setTo(this.x,this.y),i.onDown.dispatch(this,t),i.resetSpeed(this.x,this.y)),this._stateReset=!1,this.totalTouches++,null!==this.targetObject&&this.targetObject._touchedHandler(this),this},update:function(){var t=this.game.input;this.active&&(this.dirty&&(t.interactiveItems.total>0&&this.processInteractiveObjects(!1),this.dirty=!1),!1===this._holdSent&&this.duration>=t.holdRate&&((t.multiInputOverride===e.Input.MOUSE_OVERRIDES_TOUCH||t.multiInputOverride===e.Input.MOUSE_TOUCH_COMBINE||t.multiInputOverride===e.Input.TOUCH_OVERRIDES_MOUSE&&0===t.totalActivePointers)&&t.onHold.dispatch(this),this._holdSent=!0),t.recordPointerHistory&&this.game.time.time>=this._nextDrop&&(this._nextDrop=this.game.time.time+t.recordRate,this._history.push({x:this.position.x,y:this.position.y}),this._history.length>t.recordLimit&&this._history.shift()))},move:function(t,i){var s=this.game.input;if(!s.pollLocked){void 0===i&&(i=!1),void 0!==t.button&&(this.button=t.button),this.isMouse&&this.updateButtons(t),this.clientX=t.clientX,this.clientY=t.clientY,this.pageX=t.pageX,this.pageY=t.pageY,this.screenX=t.screenX,this.screenY=t.screenY,this.isMouse&&s.mouse.locked&&!i&&(this.rawMovementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.rawMovementY=t.movementY||t.mozMovementY||t.webkitMovementY||0,this.movementX+=this.rawMovementX,this.movementY+=this.rawMovementY),this.x=(this.pageX-this.game.scale.offset.x)*s.scale.x,this.y=(this.pageY-this.game.scale.offset.y)*s.scale.y,this.position.setTo(this.x,this.y),this.circle.x=this.x,this.circle.y=this.y,(s.multiInputOverride===e.Input.MOUSE_OVERRIDES_TOUCH||s.multiInputOverride===e.Input.MOUSE_TOUCH_COMBINE||s.multiInputOverride===e.Input.TOUCH_OVERRIDES_MOUSE&&0===s.totalActivePointers)&&(s.activePointer=this,s.x=this.x,s.y=this.y,s.position.setTo(s.x,s.y),s.circle.x=s.x,s.circle.y=s.y),this.withinGame=this.game.scale.bounds.contains(this.pageX,this.pageY);for(var n=s.moveCallbacks.length;n--;)s.moveCallbacks[n].callback.call(s.moveCallbacks[n].context,this,this.x,this.y,i,t);return null===this.targetObject||this.game.paused&&!this.targetObject.noPause||!0!==this.targetObject.isDragged?s.interactiveItems.total>0&&this.processInteractiveObjects(i):!1===this.targetObject.update(this)&&(this.targetObject=null),this}},processInteractiveObjects:function(t){var e=0,i=-1,s=null,n=this.game.input.interactiveItems.first;for(this.interactiveCandidates=[];n;)n.checked=!1,!n.validForInput(i,e,!1)||this.game.paused&&!n.sprite.noPause||(n.checked=!0,(t&&n.checkPointerDown(this,!0)||!t&&n.checkPointerOver(this,!0))&&(e=n.sprite.renderOrderID,i=n.priorityID,s=n,this.interactiveCandidates.push(n))),n=this.game.input.interactiveItems.next;for(n=this.game.input.interactiveItems.first;n;)!n.checked&&n.validForInput(i,e,!0)&&(t&&n.checkPointerDown(this,!1)||!t&&n.checkPointerOver(this,!1))&&(e=n.sprite.renderOrderID,i=n.priorityID,s=n,this.interactiveCandidates.push(n)),n=this.game.input.interactiveItems.next;return this.game.input.customCandidateHandler&&(s=this.game.input.customCandidateHandler.call(this.game.input.customCandidateHandlerContext,this,this.interactiveCandidates,s)),this.swapTarget(s,!1),null!==this.targetObject},swapTarget:function(t,e){void 0===e&&(e=!1),null===t?this.targetObject&&(this.targetObject._pointerOutHandler(this,e),this.targetObject=null):null===this.targetObject?(this.targetObject=t,t._pointerOverHandler(this,e)):this.targetObject===t?!1===t.update(this)&&(this.targetObject=null):(this.targetObject._pointerOutHandler(this,e),this.targetObject=t,this.targetObject._pointerOverHandler(this,e))},leave:function(t){this.withinGame=!1,this.move(t,!1)},stop:function(t){var i=this.game.input;{if(!this._stateReset||!this.withinGame){if(this.timeUp=this.game.time.time,(i.multiInputOverride===e.Input.MOUSE_OVERRIDES_TOUCH||i.multiInputOverride===e.Input.MOUSE_TOUCH_COMBINE||i.multiInputOverride===e.Input.TOUCH_OVERRIDES_MOUSE&&0===i.totalActivePointers)&&(i.onUp.dispatch(this,t),this.duration>=0&&this.duration<=i.tapRate)){var s=this.timeUp-this.previousTapTime<i.doubleTapRate;i.onTap.dispatch(this,s,t),this.previousTapTime=this.timeUp}return this.isMouse?this.updateButtons(t):(this.isDown=!1,this.isUp=!0),this.id>0&&(this.active=!1),this.withinGame=this.game.scale.bounds.contains(t.pageX,t.pageY),this.pointerId=null,this.identifier=null,this.positionUp.setTo(this.x,this.y),!1===this.isMouse&&i.currentPointers--,i.interactiveItems.callAll("_releasedHandler",this),this._clickTrampolines&&(this._trampolineTargetObject=this.targetObject),this.targetObject=null,this}t.preventDefault()}},justPressed:function(t){return t=t||this.game.input.justPressedRate,!0===this.isDown&&this.timeDown+t>this.game.time.time},justReleased:function(t){return t=t||this.game.input.justReleasedRate,this.isUp&&this.timeUp+t>this.game.time.time},addClickTrampoline:function(t,e,i,s){if(this.isDown){for(var n=this._clickTrampolines=this._clickTrampolines||[],r=0;r<n.length;r++)if(n[r].name===t){n.splice(r,1);break}n.push({name:t,targetObject:this.targetObject,callback:e,callbackContext:i,callbackArgs:s})}},processClickTrampolines:function(){var t=this._clickTrampolines;if(t){for(var e=0;e<t.length;e++){var i=t[e];i.targetObject===this._trampolineTargetObject&&i.callback.apply(i.callbackContext,i.callbackArgs)}this._clickTrampolines=null,this._trampolineTargetObject=null}},reset:function(){!1===this.isMouse&&(this.active=!1),this.pointerId=null,this.identifier=null,this.dirty=!1,this.totalTouches=0,this._holdSent=!1,this._history.length=0,this._stateReset=!0,this.resetButtons(),this.targetObject&&this.targetObject._releasedHandler(this),this.targetObject=null},resetMovement:function(){this.movementX=0,this.movementY=0}},e.Pointer.prototype.constructor=e.Pointer,Object.defineProperty(e.Pointer.prototype,"duration",{get:function(){return this.isUp?-1:this.game.time.time-this.timeDown}}),Object.defineProperty(e.Pointer.prototype,"worldX",{get:function(){return this.game.world.camera.x+this.x}}),Object.defineProperty(e.Pointer.prototype,"worldY",{get:function(){return this.game.world.camera.y+this.y}}),e.PointerMode={CURSOR:1,CONTACT:2},e.PointerModes={},e.PointerModes[e.PointerMode.CURSOR]="CURSOR",e.PointerModes[e.PointerMode.CONTACT]="CONTACT",e.Touch=function(t){this.game=t,this.active=!1,this.enabled=!0,this.callbackContext=this.game,this.touchStartCallback=null,this.touchMoveCallback=null,this.touchEndCallback=null,this.touchEnterCallback=null,this.touchLeaveCallback=null,this.touchCancelCallback=null,this.preventDefault=!0,this.event=null,this._onTouchStart=null,this._onTouchMove=null,this._onTouchEnd=null,this._onTouchEnter=null,this._onTouchLeave=null,this._onTouchCancel=null,this._onTouchMove=null},e.Touch.prototype={start:function(){if(!this.game.device.touch)return!1;if(null!==this._onTouchStart)return!1;var t=this;return this._onTouchStart=function(e){return t.onTouchStart(e)},this._onTouchMove=function(e){return t.onTouchMove(e)},this._onTouchEnd=function(e){return t.onTouchEnd(e)},this._onTouchEnter=function(e){return t.onTouchEnter(e)},this._onTouchLeave=function(e){return t.onTouchLeave(e)},this._onTouchCancel=function(e){return t.onTouchCancel(e)},this.game.canvas.addEventListener("touchstart",this._onTouchStart,!1),this.game.canvas.addEventListener("touchmove",this._onTouchMove,!1),this.game.canvas.addEventListener("touchend",this._onTouchEnd,!1),this.game.canvas.addEventListener("touchcancel",this._onTouchCancel,!1),this.game.device.cocoonJS||(this.game.canvas.addEventListener("touchenter",this._onTouchEnter,!1),this.game.canvas.addEventListener("touchleave",this._onTouchLeave,!1)),this.active=!0,!0},consumeDocumentTouches:function(){this._documentTouchMove=function(t){t.preventDefault()},document.addEventListener("touchmove",this._documentTouchMove,!1)},onTouchStart:function(t){if(this.game.input.executeTouchLockCallbacks(!1,t),this.event=t,this.game.input.enabled&&this.enabled){this.touchStartCallback&&this.touchStartCallback.call(this.callbackContext,t),this.preventDefault&&t.preventDefault();for(var e=0;e<t.changedTouches.length;e++)this.game.input.startPointer(t.changedTouches[e])}},onTouchCancel:function(t){if(this.event=t,this.touchCancelCallback&&this.touchCancelCallback.call(this.callbackContext,t),this.game.input.enabled&&this.enabled){this.preventDefault&&t.preventDefault();for(var e=0;e<t.changedTouches.length;e++)this.game.input.stopPointer(t.changedTouches[e])}},onTouchEnter:function(t){this.event=t,this.touchEnterCallback&&this.touchEnterCallback.call(this.callbackContext,t),this.game.input.enabled&&this.enabled&&this.preventDefault&&t.preventDefault()},onTouchLeave:function(t){this.event=t,this.touchLeaveCallback&&this.touchLeaveCallback.call(this.callbackContext,t),this.preventDefault&&t.preventDefault()},onTouchMove:function(t){this.event=t,this.touchMoveCallback&&this.touchMoveCallback.call(this.callbackContext,t),this.preventDefault&&t.preventDefault();for(var e=0;e<t.changedTouches.length;e++)this.game.input.updatePointer(t.changedTouches[e])},onTouchEnd:function(t){this.game.input.executeTouchLockCallbacks(!0,t),this.event=t,this.touchEndCallback&&this.touchEndCallback.call(this.callbackContext,t),this.preventDefault&&t.preventDefault();for(var e=0;e<t.changedTouches.length;e++)this.game.input.stopPointer(t.changedTouches[e])},stop:function(){this.game.device.touch&&(this.game.canvas.removeEventListener("touchstart",this._onTouchStart),this.game.canvas.removeEventListener("touchmove",this._onTouchMove),this.game.canvas.removeEventListener("touchend",this._onTouchEnd),this.game.canvas.removeEventListener("touchenter",this._onTouchEnter),this.game.canvas.removeEventListener("touchleave",this._onTouchLeave),this.game.canvas.removeEventListener("touchcancel",this._onTouchCancel),this.active=!1)}},e.Touch.prototype.constructor=e.Touch,e.InputHandler=function(t){this.sprite=t,this.game=t.game,this.enabled=!1,this.checked=!1,this.priorityID=0,this.useHandCursor=!1,this._setHandCursor=!1,this.isDragged=!1,this.allowHorizontalDrag=!0,this.allowVerticalDrag=!0,this.bringToTop=!1,this.snapOffset=null,this.snapOnDrag=!1,this.snapOnRelease=!1,this.snapX=0,this.snapY=0,this.snapOffsetX=0,this.snapOffsetY=0,this.pixelPerfectOver=!1,this.pixelPerfectClick=!1,this.pixelPerfectAlpha=255,this.draggable=!1,this.boundsRect=null,this.boundsSprite=null,this.scaleLayer=!1,this.dragOffset=new e.Point,this.dragFromCenter=!1,this.dragStopBlocksInputUp=!1,this.dragStartPoint=new e.Point,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this.downPoint=new e.Point,this.snapPoint=new e.Point,this._dragPoint=new e.Point,this._dragPhase=!1,this._pendingDrag=!1,this._dragTimePass=!1,this._dragDistancePass=!1,this._wasEnabled=!1,this._tempPoint=new e.Point,this._pointerData=[],this._pointerData.push({id:0,x:0,y:0,camX:0,camY:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1})},e.InputHandler.prototype={start:function(t,i){if(t=t||0,void 0===i&&(i=!1),!1===this.enabled){this.game.input.interactiveItems.add(this),this.useHandCursor=i,this.priorityID=t;for(var s=0;s<10;s++)this._pointerData[s]={id:s,x:0,y:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1};this.snapOffset=new e.Point,this.enabled=!0,this._wasEnabled=!0}return this.sprite.events.onAddedToGroup.add(this.addedToGroup,this),this.sprite.events.onRemovedFromGroup.add(this.removedFromGroup,this),this.sprite},addedToGroup:function(){this._dragPhase||this._wasEnabled&&!this.enabled&&this.start()},removedFromGroup:function(){this._dragPhase||(this.enabled?(this._wasEnabled=!0,this.stop()):this._wasEnabled=!1)},reset:function(){this.enabled=!1;for(var t=0;t<10;t++)this._pointerData[t]={id:t,x:0,y:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1}},stop:function(){!1!==this.enabled&&(this.enabled=!1,this.game.input.interactiveItems.remove(this))},destroy:function(){this.sprite&&(this._setHandCursor&&(this.game.canvas.style.cursor="",this._setHandCursor=!1),this.enabled=!1,this.game.input.interactiveItems.remove(this),this._pointerData.length=0,this.boundsRect=null,this.boundsSprite=null,this.sprite=null)},validForInput:function(t,e,i){return void 0===i&&(i=!0),!(!this.enabled||0===this.sprite.scale.x||0===this.sprite.scale.y||this.priorityID<this.game.input.minPriorityID||this.sprite.parent&&this.sprite.parent.ignoreChildInput)&&(!(!i&&(this.pixelPerfectClick||this.pixelPerfectOver))&&(this.priorityID>t||this.priorityID===t&&this.sprite.renderOrderID>e))},isPixelPerfect:function(){return this.pixelPerfectClick||this.pixelPerfectOver},pointerX:function(t){return t=t||0,this._pointerData[t].x},pointerY:function(t){return t=t||0,this._pointerData[t].y},pointerDown:function(t){return t=t||0,this._pointerData[t].isDown},pointerUp:function(t){return t=t||0,this._pointerData[t].isUp},pointerTimeDown:function(t){return t=t||0,this._pointerData[t].timeDown},pointerTimeUp:function(t){return t=t||0,this._pointerData[t].timeUp},pointerOver:function(t){if(!this.enabled)return!1;if(void 0===t){for(var e=0;e<10;e++)if(this._pointerData[e].isOver)return!0;return!1}return this._pointerData[t].isOver},pointerOut:function(t){if(!this.enabled)return!1;if(void 0!==t)return this._pointerData[t].isOut;for(var e=0;e<10;e++)if(this._pointerData[e].isOut)return!0},pointerTimeOver:function(t){return t=t||0,this._pointerData[t].timeOver},pointerTimeOut:function(t){return t=t||0,this._pointerData[t].timeOut},pointerDragged:function(t){return t=t||0,this._pointerData[t].isDragged},checkPointerDown:function(t,e){return!!(t.isDown&&this.enabled&&this.sprite&&this.sprite.parent&&this.sprite.visible&&this.sprite.parent.visible&&0!==this.sprite.worldScale.x&&0!==this.sprite.worldScale.y)&&(!!this.game.input.hitTest(this.sprite,t,this._tempPoint)&&(void 0===e&&(e=!1),!(!e&&this.pixelPerfectClick)||this.checkPixel(this._tempPoint.x,this._tempPoint.y)))},checkPointerOver:function(t,e){return!!(this.enabled&&this.sprite&&this.sprite.parent&&this.sprite.visible&&this.sprite.parent.visible&&0!==this.sprite.worldScale.x&&0!==this.sprite.worldScale.y)&&(!!this.game.input.hitTest(this.sprite,t,this._tempPoint)&&(void 0===e&&(e=!1),!(!e&&this.pixelPerfectOver)||this.checkPixel(this._tempPoint.x,this._tempPoint.y)))},checkPixel:function(t,e,i){if(this.sprite.texture.baseTexture.source){if(null===t&&null===e){this.game.input.getLocalPosition(this.sprite,i,this._tempPoint);var t=this._tempPoint.x,e=this._tempPoint.y}if(0!==this.sprite.anchor.x&&(t-=-this.sprite.texture.frame.width*this.sprite.anchor.x),0!==this.sprite.anchor.y&&(e-=-this.sprite.texture.frame.height*this.sprite.anchor.y),t+=this.sprite.texture.frame.x,e+=this.sprite.texture.frame.y,this.sprite.texture.trim&&(t-=this.sprite.texture.trim.x,e-=this.sprite.texture.trim.y,t<this.sprite.texture.crop.x||t>this.sprite.texture.crop.right||e<this.sprite.texture.crop.y||e>this.sprite.texture.crop.bottom))return this._dx=t,this._dy=e,!1;if(this._dx=t,this._dy=e,this.game.input.hitContext.clearRect(0,0,1,1),this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source,t,e,1,1,0,0,1,1),this.game.input.hitContext.getImageData(0,0,1,1).data[3]>=this.pixelPerfectAlpha)return!0}return!1},update:function(t){if(null!==this.sprite&&void 0!==this.sprite.parent)return this.enabled&&this.sprite.visible&&this.sprite.parent.visible?this._pendingDrag?(this._dragDistancePass||(this._dragDistancePass=e.Math.distance(t.x,t.y,this.downPoint.x,this.downPoint.y)>=this.dragDistanceThreshold),this._dragDistancePass&&this._dragTimePass&&this.startDrag(t),!0):this.draggable&&this._draggedPointerID===t.id?this.updateDrag(t,!1):this._pointerData[t.id].isOver?this.checkPointerOver(t)?(this._pointerData[t.id].x=t.x-this.sprite.x,this._pointerData[t.id].y=t.y-this.sprite.y,!0):(this._pointerOutHandler(t),!1):void 0:(this._pointerOutHandler(t),!1)},_pointerOverHandler:function(t,e){if(null!==this.sprite){var i=this._pointerData[t.id];if(!1===i.isOver||t.dirty){var s=!1===i.isOver;i.isOver=!0,i.isOut=!1,i.timeOver=this.game.time.time,i.x=t.x-this.sprite.x,i.y=t.y-this.sprite.y,this.useHandCursor&&!1===i.isDragged&&(this.game.canvas.style.cursor="pointer",this._setHandCursor=!0),!e&&s&&this.sprite&&this.sprite.events&&this.sprite.events.onInputOver$dispatch(this.sprite,t),this.sprite.parent&&this.sprite.parent.onChildInputOver&&this.sprite.parent.onChildInputOver.dispatch(this.sprite,t)}}},_pointerOutHandler:function(t,e){if(null!==this.sprite){var i=this._pointerData[t.id];i.isOver=!1,i.isOut=!0,i.timeOut=this.game.time.time,this.useHandCursor&&!1===i.isDragged&&(this.game.canvas.style.cursor="",this._setHandCursor=!1),!e&&this.sprite&&this.sprite.events&&(this.sprite.events.onInputOut$dispatch(this.sprite,t),this.sprite&&this.sprite.parent&&this.sprite.parent.onChildInputOut&&this.sprite.parent.onChildInputOut.dispatch(this.sprite,t))}},_touchedHandler:function(t){if(null!==this.sprite){var e=this._pointerData[t.id];if(!e.isDown&&e.isOver){if(this.pixelPerfectClick&&!this.checkPixel(null,null,t))return;if(e.isDown=!0,e.isUp=!1,e.timeDown=this.game.time.time,this.downPoint.set(t.x,t.y),t.dirty=!0,this.sprite&&this.sprite.events&&(this.sprite.events.onInputDown$dispatch(this.sprite,t),this.sprite&&this.sprite.parent&&this.sprite.parent.onChildInputDown&&this.sprite.parent.onChildInputDown.dispatch(this.sprite,t),null===this.sprite))return;this.draggable&&!1===this.isDragged&&(0===this.dragTimeThreshold&&0===this.dragDistanceThreshold?this.startDrag(t):(this._pendingDrag=!0,this._dragDistancePass=0===this.dragDistanceThreshold,this.dragTimeThreshold>0?(this._dragTimePass=!1,this.game.time.events.add(this.dragTimeThreshold,this.dragTimeElapsed,this,t)):this._dragTimePass=!0)),this.bringToTop&&this.sprite.bringToTop()}}},dragTimeElapsed:function(t){this._dragTimePass=!0,this._pendingDrag&&this.sprite&&this._dragDistancePass&&this.startDrag(t)},_releasedHandler:function(t){if(null!==this.sprite){var e=this._pointerData[t.id];if(e.isDown&&t.isUp){e.isDown=!1,e.isUp=!0,e.timeUp=this.game.time.time,e.downDuration=e.timeUp-e.timeDown;var i=this.checkPointerOver(t);this.sprite&&this.sprite.events&&(this.dragStopBlocksInputUp&&(!this.dragStopBlocksInputUp||this.draggable&&this.isDragged&&this._draggedPointerID===t.id)||this.sprite.events.onInputUp$dispatch(this.sprite,t,i),this.sprite&&this.sprite.parent&&this.sprite.parent.onChildInputUp&&this.sprite.parent.onChildInputUp.dispatch(this.sprite,t,i),i&&(i=this.checkPointerOver(t))),e.isOver=i,!i&&this.useHandCursor&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1),t.dirty=!0,this._pendingDrag=!1,this.draggable&&this.isDragged&&this._draggedPointerID===t.id&&this.stopDrag(t)}}},updateDrag:function(t,e){var i=this.game.camera,s=this.dragOffset,n=this._dragPoint,r=this._pointerData[t.id],o=this.snapPoint,a=this.sprite;if(void 0===e&&(e=!1),t.isUp)return this.stopDrag(t),!1;var h=this.globalToLocal(t);if(a.fixedToCamera)var l=i.scale.x*h.x+n.x+s.x,c=i.scale.y*h.y+n.y+s.y;else var l=h.x+n.x+s.x,c=h.y+n.y+s.y;if(a.fixedToCamera){var u=a.cameraOffset,d=u.x,p=u.y;this.allowHorizontalDrag&&(u.x=l-i.x),this.allowVerticalDrag&&(u.y=c-i.y),this.boundsRect&&this.checkBoundsRect(),this.boundsSprite&&this.checkBoundsSprite(),this.snapOnDrag&&(u.x=Math.round((u.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,u.y=Math.round((u.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY,o.set(u.x,u.y));var f=u.x-d,g=u.y-p}else{var m=i.x-r.camX,y=i.y-r.camY,d=a.x,p=a.y;this.allowHorizontalDrag&&(a.x=l+m),this.allowVerticalDrag&&(a.y=c+y),this.boundsRect&&this.checkBoundsRect(),this.boundsSprite&&this.checkBoundsSprite(),this.snapOnDrag&&(a.x=Math.round((a.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,a.y=Math.round((a.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY,o.set(a.x,a.y));var f=a.x-d,g=a.y-p}return this.sprite.events.onDragUpdate.dispatch(a,t,l,c,o,e,f,g),!0},justOver:function(t,e){return t=t||0,e=e||500,this._pointerData[t].isOver&&this.overDuration(t)<e},justOut:function(t,e){return t=t||0,e=e||500,this._pointerData[t].isOut&&this.game.time.time-this._pointerData[t].timeOut<e},justPressed:function(t,e){return t=t||0,e=e||500,this._pointerData[t].isDown&&this.downDuration(t)<e},justReleased:function(t,e){return t=t||0,e=e||500,this._pointerData[t].isUp&&this.game.time.time-this._pointerData[t].timeUp<e},overDuration:function(t){return t=t||0,this._pointerData[t].isOver?this.game.time.time-this._pointerData[t].timeOver:-1},downDuration:function(t){return t=t||0,this._pointerData[t].isDown?this.game.time.time-this._pointerData[t].timeDown:-1},enableDrag:function(t,i,s,n,r,o){void 0===t&&(t=!1),void 0===i&&(i=!1),void 0===s&&(s=!1),void 0===n&&(n=255),void 0===r&&(r=null),void 0===o&&(o=null),this._dragPoint=new e.Point,this.draggable=!0,this.bringToTop=i,this.dragOffset=new e.Point,this.dragFromCenter=t,this.pixelPerfectClick=s,this.pixelPerfectAlpha=n,r&&(this.boundsRect=r),o&&(this.boundsSprite=o)},disableDrag:function(){if(this._pointerData)for(var t=0;t<10;t++)this._pointerData[t].isDragged=!1;this.draggable=!1,this.isDragged=!1,this._draggedPointerID=-1,this._pendingDrag=!1},startDrag:function(t){var i=this.sprite.x,s=this.sprite.y,n=this.globalToLocal(t);if(this.isDragged=!0,this._draggedPointerID=t.id,this._pointerData[t.id].camX=this.game.camera.x,this._pointerData[t.id].camY=this.game.camera.y,this._pointerData[t.id].isDragged=!0,this.sprite.fixedToCamera){if(this.dragFromCenter){var r=this.sprite.getBounds(),o=this.globalToLocal(new e.Point(r.centerX,r.centerY));this.sprite.cameraOffset.x=n.x+(this.sprite.cameraOffset.x-o.x),this.sprite.cameraOffset.y=n.y+(this.sprite.cameraOffset.y-o.y)}this._dragPoint.setTo(this.sprite.cameraOffset.x-t.x,this.sprite.cameraOffset.y-t.y)}else{if(this.dragFromCenter){var r=this.sprite.getBounds(),o=this.globalToLocal(new e.Point(r.centerX,r.centerY));this.sprite.x=n.x+(this.sprite.x-o.x),this.sprite.y=n.y+(this.sprite.y-o.y)}this._dragPoint.setTo(this.sprite.x-n.x,this.sprite.y-n.y)}this.updateDrag(t,!0),this.bringToTop&&(this._dragPhase=!0,this.sprite.bringToTop()),this.dragStartPoint.set(i,s),this.sprite.events.onDragStart$dispatch(this.sprite,t,i,s),this._pendingDrag=!1},globalToLocalX:function(t){return this.scaleLayer&&(t-=this.game.scale.grid.boundsFluid.x,t*=this.game.scale.grid.scaleFluidInversed.x),t},globalToLocalY:function(t){return this.scaleLayer&&(t-=this.game.scale.grid.boundsFluid.y,t*=this.game.scale.grid.scaleFluidInversed.y),t},globalToLocal:function(t){return this.sprite.parent?this.game.input.getLocalPosition(this.sprite.parent,{x:t.x,y:t.y}):t},stopDrag:function(t){this.isDragged=!1,this._draggedPointerID=-1,this._pointerData[t.id].isDragged=!1,this._dragPhase=!1,this._pendingDrag=!1,this.snapOnRelease&&(this.sprite.fixedToCamera?(this.sprite.cameraOffset.x=Math.round((this.sprite.cameraOffset.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.cameraOffset.y=Math.round((this.sprite.cameraOffset.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY):(this.sprite.x=Math.round((this.sprite.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.y=Math.round((this.sprite.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY)),this.sprite.events.onDragStop$dispatch(this.sprite,t),!1===this.checkPointerOver(t)&&this._pointerOutHandler(t)},setDragLock:function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0),this.allowHorizontalDrag=t,this.allowVerticalDrag=e},enableSnap:function(t,e,i,s,n,r){void 0===i&&(i=!0),void 0===s&&(s=!1),void 0===n&&(n=0),void 0===r&&(r=0),this.snapX=t,this.snapY=e,this.snapOffsetX=n,this.snapOffsetY=r,this.snapOnDrag=i,this.snapOnRelease=s},disableSnap:function(){this.snapOnDrag=!1,this.snapOnRelease=!1},checkBoundsRect:function(){this.sprite.fixedToCamera?(this.sprite.cameraOffset.x<this.boundsRect.left?this.sprite.cameraOffset.x=this.boundsRect.left:this.sprite.cameraOffset.x+this.sprite.width>this.boundsRect.right&&(this.sprite.cameraOffset.x=this.boundsRect.right-this.sprite.width),this.sprite.cameraOffset.y<this.boundsRect.top?this.sprite.cameraOffset.y=this.boundsRect.top:this.sprite.cameraOffset.y+this.sprite.height>this.boundsRect.bottom&&(this.sprite.cameraOffset.y=this.boundsRect.bottom-this.sprite.height)):(this.sprite.left<this.boundsRect.left?this.sprite.x=this.boundsRect.x+this.sprite.offsetX:this.sprite.right>this.boundsRect.right&&(this.sprite.x=this.boundsRect.right-(this.sprite.width-this.sprite.offsetX)),this.sprite.top<this.boundsRect.top?this.sprite.y=this.boundsRect.top+this.sprite.offsetY:this.sprite.bottom>this.boundsRect.bottom&&(this.sprite.y=this.boundsRect.bottom-(this.sprite.height-this.sprite.offsetY)))},checkBoundsSprite:function(){this.sprite.fixedToCamera&&this.boundsSprite.fixedToCamera?(this.sprite.cameraOffset.x<this.boundsSprite.cameraOffset.x?this.sprite.cameraOffset.x=this.boundsSprite.cameraOffset.x:this.sprite.cameraOffset.x+this.sprite.width>this.boundsSprite.cameraOffset.x+this.boundsSprite.width&&(this.sprite.cameraOffset.x=this.boundsSprite.cameraOffset.x+this.boundsSprite.width-this.sprite.width),this.sprite.cameraOffset.y<this.boundsSprite.cameraOffset.y?this.sprite.cameraOffset.y=this.boundsSprite.cameraOffset.y:this.sprite.cameraOffset.y+this.sprite.height>this.boundsSprite.cameraOffset.y+this.boundsSprite.height&&(this.sprite.cameraOffset.y=this.boundsSprite.cameraOffset.y+this.boundsSprite.height-this.sprite.height)):(this.sprite.left<this.boundsSprite.left?this.sprite.x=this.boundsSprite.left+this.sprite.offsetX:this.sprite.right>this.boundsSprite.right&&(this.sprite.x=this.boundsSprite.right-(this.sprite.width-this.sprite.offsetX)),this.sprite.top<this.boundsSprite.top?this.sprite.y=this.boundsSprite.top+this.sprite.offsetY:this.sprite.bottom>this.boundsSprite.bottom&&(this.sprite.y=this.boundsSprite.bottom-(this.sprite.height-this.sprite.offsetY)))}},e.InputHandler.prototype.constructor=e.InputHandler,e.PointerLock=function(t){this.game=t,this.input=t.input,this.element=t.canvas,this.active=!1,this.locked=!1,this.onChange=new e.Signal,this.onError=new e.Signal,this.boundOnChangeHandler=this.onChangeHandler.bind(this),this.boundOnErrorHandler=this.onErrorHandler.bind(this);var i=t.device;this.pointerLockElement=i.pointerLockElement,this.pointerlockchange=i.pointerlockchange,this.pointerlockerror=i.pointerlockerror},e.PointerLock.prototype.start=function(){return!(!this.game.device.pointerLock||this.active)&&(this.element.requestPointerLock||(this.element.requestPointerLock=this.element.mozRequestPointerLock||this.element.webkitRequestPointerLock),document.exitPointerLock||(document.exitPointerLock=document.mozExitPointerLock||document.webkitExitPointerLock),document.addEventListener(this.pointerlockchange,this.boundOnChangeHandler,!0),document.addEventListener(this.pointerlockerror,this.boundOnErrorHandler,!0),this.active=!0,!0)},e.PointerLock.prototype.stop=function(){document.removeEventListener(this.pointerlockchange,this.boundOnChangeHandler,!0),document.removeEventListener(this.pointerlockerror,this.boundOnErrorHandler,!0),this.active=!1},e.PointerLock.prototype.request=function(){this.active&&!this.locked&&this.element.requestPointerLock()},e.PointerLock.prototype.exit=function(){document.exitPointerLock()},e.PointerLock.prototype.onChangeHandler=function(t){this.locked=document[this.pointerLockElement]===this.element,this.onChange.dispatch(this.locked,t)},e.PointerLock.prototype.onErrorHandler=function(t){this.onError.dispatch(t)},e.Gamepad=function(t){this.game=t,this._gamepadIndexMap={},this._rawPads=[],this._active=!1,this.enabled=!0,this._gamepadSupportAvailable=!!navigator.webkitGetGamepads||!!navigator.webkitGamepads||-1!==navigator.userAgent.indexOf("Firefox/")||!!navigator.getGamepads,this._prevRawGamepadTypes=[],this._prevTimestamps=[],this.callbackContext=this,this.onConnectCallback=null,this.onDisconnectCallback=null,this.onDownCallback=null,this.onUpCallback=null,this.onAxisCallback=null,this.onFloatCallback=null,this._ongamepadconnected=null,this._gamepaddisconnected=null,this._gamepads=[new e.SinglePad(t,this),new e.SinglePad(t,this),new e.SinglePad(t,this),new e.SinglePad(t,this)]},e.Gamepad.prototype={addCallbacks:function(t,e){void 0!==e&&(this.onConnectCallback="function"==typeof e.onConnect?e.onConnect:this.onConnectCallback,this.onDisconnectCallback="function"==typeof e.onDisconnect?e.onDisconnect:this.onDisconnectCallback,this.onDownCallback="function"==typeof e.onDown?e.onDown:this.onDownCallback,this.onUpCallback="function"==typeof e.onUp?e.onUp:this.onUpCallback,this.onAxisCallback="function"==typeof e.onAxis?e.onAxis:this.onAxisCallback,this.onFloatCallback="function"==typeof e.onFloat?e.onFloat:this.onFloatCallback,this.callbackContext=t)},start:function(){if(!this._active){this._active=!0;var t=this;this._onGamepadConnected=function(e){return t.onGamepadConnected(e)},this._onGamepadDisconnected=function(e){return t.onGamepadDisconnected(e)},window.addEventListener("gamepadconnected",this._onGamepadConnected,!1),window.addEventListener("gamepaddisconnected",this._onGamepadDisconnected,!1)}},onGamepadConnected:function(t){var e=t.gamepad;this._rawPads.push(e),this._gamepads[e.index].connect(e)},onGamepadDisconnected:function(t){var e=t.gamepad;for(var i in this._rawPads)this._rawPads[i].index===e.index&&this._rawPads.splice(i,1);this._gamepads[e.index].disconnect()},update:function(){this._pollGamepads(),this.pad1.pollStatus(),this.pad2.pollStatus(),this.pad3.pollStatus(),this.pad4.pollStatus()},_pollGamepads:function(){if(this._active){if(navigator.getGamepads)t=navigator.getGamepads();else if(navigator.webkitGetGamepads)t=navigator.webkitGetGamepads();else if(navigator.webkitGamepads)var t=navigator.webkitGamepads();if(t){this._rawPads=[];for(var e=!1,i=0;i<t.length&&(typeof t[i]!==this._prevRawGamepadTypes[i]&&(e=!0,this._prevRawGamepadTypes[i]=typeof t[i]),t[i]&&this._rawPads.push(t[i]),3!==i);i++);for(var s=0;s<this._gamepads.length;s++)this._gamepads[s]._rawPad=this._rawPads[s];if(e){for(var n,r={rawIndices:{},padIndices:{}},o=0;o<this._gamepads.length;o++)if((n=this._gamepads[o]).connected)for(var a=0;a<this._rawPads.length;a++)this._rawPads[a].index===n.index&&(r.rawIndices[n.index]=!0,r.padIndices[o]=!0);for(var h=0;h<this._gamepads.length;h++)if(n=this._gamepads[h],!r.padIndices[h]){this._rawPads.length<1&&n.disconnect();for(var l=0;l<this._rawPads.length&&!r.padIndices[h];l++){var c=this._rawPads[l];if(c){if(r.rawIndices[c.index]){n.disconnect();continue}n.connect(c),r.rawIndices[c.index]=!0,r.padIndices[h]=!0}else n.disconnect()}}}}}},setDeadZones:function(t){for(var e=0;e<this._gamepads.length;e++)this._gamepads[e].deadZone=t},stop:function(){this._active=!1,window.removeEventListener("gamepadconnected",this._onGamepadConnected),window.removeEventListener("gamepaddisconnected",this._onGamepadDisconnected)},reset:function(){this.update();for(var t=0;t<this._gamepads.length;t++)this._gamepads[t].reset()},justPressed:function(t,e){for(var i=0;i<this._gamepads.length;i++)if(!0===this._gamepads[i].justPressed(t,e))return!0;return!1},justReleased:function(t,e){for(var i=0;i<this._gamepads.length;i++)if(!0===this._gamepads[i].justReleased(t,e))return!0;return!1},isDown:function(t){for(var e=0;e<this._gamepads.length;e++)if(!0===this._gamepads[e].isDown(t))return!0;return!1},destroy:function(){this.stop();for(var t=0;t<this._gamepads.length;t++)this._gamepads[t].destroy()}},e.Gamepad.prototype.constructor=e.Gamepad,Object.defineProperty(e.Gamepad.prototype,"active",{get:function(){return this._active}}),Object.defineProperty(e.Gamepad.prototype,"supported",{get:function(){return this._gamepadSupportAvailable}}),Object.defineProperty(e.Gamepad.prototype,"padsConnected",{get:function(){return this._rawPads.length}}),Object.defineProperty(e.Gamepad.prototype,"pad1",{get:function(){return this._gamepads[0]}}),Object.defineProperty(e.Gamepad.prototype,"pad2",{get:function(){return this._gamepads[1]}}),Object.defineProperty(e.Gamepad.prototype,"pad3",{get:function(){return this._gamepads[2]}}),Object.defineProperty(e.Gamepad.prototype,"pad4",{get:function(){return this._gamepads[3]}}),e.Gamepad.BUTTON_0=0,e.Gamepad.BUTTON_1=1,e.Gamepad.BUTTON_2=2,e.Gamepad.BUTTON_3=3,e.Gamepad.BUTTON_4=4,e.Gamepad.BUTTON_5=5,e.Gamepad.BUTTON_6=6,e.Gamepad.BUTTON_7=7,e.Gamepad.BUTTON_8=8,e.Gamepad.BUTTON_9=9,e.Gamepad.BUTTON_10=10,e.Gamepad.BUTTON_11=11,e.Gamepad.BUTTON_12=12,e.Gamepad.BUTTON_13=13,e.Gamepad.BUTTON_14=14,e.Gamepad.BUTTON_15=15,e.Gamepad.AXIS_0=0,e.Gamepad.AXIS_1=1,e.Gamepad.AXIS_2=2,e.Gamepad.AXIS_3=3,e.Gamepad.AXIS_4=4,e.Gamepad.AXIS_5=5,e.Gamepad.AXIS_6=6,e.Gamepad.AXIS_7=7,e.Gamepad.AXIS_8=8,e.Gamepad.AXIS_9=9,e.Gamepad.XBOX360_A=0,e.Gamepad.XBOX360_B=1,e.Gamepad.XBOX360_X=2,e.Gamepad.XBOX360_Y=3,e.Gamepad.XBOX360_LEFT_BUMPER=4,e.Gamepad.XBOX360_RIGHT_BUMPER=5,e.Gamepad.XBOX360_LEFT_TRIGGER=6,e.Gamepad.XBOX360_RIGHT_TRIGGER=7,e.Gamepad.XBOX360_BACK=8,e.Gamepad.XBOX360_START=9,e.Gamepad.XBOX360_STICK_LEFT_BUTTON=10,e.Gamepad.XBOX360_STICK_RIGHT_BUTTON=11,e.Gamepad.XBOX360_DPAD_LEFT=14,e.Gamepad.XBOX360_DPAD_RIGHT=15,e.Gamepad.XBOX360_DPAD_UP=12,e.Gamepad.XBOX360_DPAD_DOWN=13,e.Gamepad.XBOX360_STICK_LEFT_X=0,e.Gamepad.XBOX360_STICK_LEFT_Y=1,e.Gamepad.XBOX360_STICK_RIGHT_X=2,e.Gamepad.XBOX360_STICK_RIGHT_Y=3,e.Gamepad.PS3XC_X=0,e.Gamepad.PS3XC_CIRCLE=1,e.Gamepad.PS3XC_SQUARE=2,e.Gamepad.PS3XC_TRIANGLE=3,e.Gamepad.PS3XC_L1=4,e.Gamepad.PS3XC_R1=5,e.Gamepad.PS3XC_L2=6,e.Gamepad.PS3XC_R2=7,e.Gamepad.PS3XC_SELECT=8,e.Gamepad.PS3XC_START=9,e.Gamepad.PS3XC_STICK_LEFT_BUTTON=10,e.Gamepad.PS3XC_STICK_RIGHT_BUTTON=11,e.Gamepad.PS3XC_DPAD_UP=12,e.Gamepad.PS3XC_DPAD_DOWN=13,e.Gamepad.PS3XC_DPAD_LEFT=14,e.Gamepad.PS3XC_DPAD_RIGHT=15,e.Gamepad.PS3XC_STICK_LEFT_X=0,e.Gamepad.PS3XC_STICK_LEFT_Y=1,e.Gamepad.PS3XC_STICK_RIGHT_X=2,e.Gamepad.PS3XC_STICK_RIGHT_Y=3,e.SinglePad=function(t,e){this.game=t,this.index=null,this.connected=!1,this.callbackContext=this,this.onConnectCallback=null,this.onDisconnectCallback=null,this.onDownCallback=null,this.onUpCallback=null,this.onAxisCallback=null,this.onFloatCallback=null,this.deadZone=.26,this._padParent=e,this._rawPad=null,this._prevTimestamp=null,this._buttons=[],this._buttonsLen=0,this._axes=[],this._axesLen=0},e.SinglePad.prototype={addCallbacks:function(t,e){void 0!==e&&(this.onConnectCallback="function"==typeof e.onConnect?e.onConnect:this.onConnectCallback,this.onDisconnectCallback="function"==typeof e.onDisconnect?e.onDisconnect:this.onDisconnectCallback,this.onDownCallback="function"==typeof e.onDown?e.onDown:this.onDownCallback,this.onUpCallback="function"==typeof e.onUp?e.onUp:this.onUpCallback,this.onAxisCallback="function"==typeof e.onAxis?e.onAxis:this.onAxisCallback,this.onFloatCallback="function"==typeof e.onFloat?e.onFloat:this.onFloatCallback,this.callbackContext=t)},getButton:function(t){return this._buttons[t]?this._buttons[t]:null},pollStatus:function(){if(this.connected&&this.game.input.enabled&&this.game.input.gamepad.enabled&&(!this._rawPad.timestamp||this._rawPad.timestamp!==this._prevTimestamp)){for(var t=0;t<this._buttonsLen;t++){var e=isNaN(this._rawPad.buttons[t])?this._rawPad.buttons[t].value:this._rawPad.buttons[t];e!==this._buttons[t].value&&(1===e?this.processButtonDown(t,e):0===e?this.processButtonUp(t,e):this.processButtonFloat(t,e))}for(var i=0;i<this._axesLen;i++){var s=this._rawPad.axes[i];s>0&&s>this.deadZone||s<0&&s<-this.deadZone?this.processAxisChange(i,s):this.processAxisChange(i,0)}this._prevTimestamp=this._rawPad.timestamp}},connect:function(t){var i=!this.connected;this.connected=!0,this.index=t.index,this._rawPad=t,this._buttons=[],this._buttonsLen=t.buttons.length,this._axes=[],this._axesLen=t.axes.length;for(var s=0;s<this._axesLen;s++)this._axes[s]=t.axes[s];for(var n in t.buttons)n=parseInt(n,10),this._buttons[n]=new e.DeviceButton(this,n);i&&this._padParent.onConnectCallback&&this._padParent.onConnectCallback.call(this._padParent.callbackContext,this.index),i&&this.onConnectCallback&&this.onConnectCallback.call(this.callbackContext)},disconnect:function(){var t=this.connected,e=this.index;this.connected=!1,this.index=null,this._rawPad=void 0;for(var i=0;i<this._buttonsLen;i++)this._buttons[i].destroy();this._buttons=[],this._buttonsLen=0,this._axes=[],this._axesLen=0,t&&this._padParent.onDisconnectCallback&&this._padParent.onDisconnectCallback.call(this._padParent.callbackContext,e),t&&this.onDisconnectCallback&&this.onDisconnectCallback.call(this.callbackContext)},destroy:function(){this._rawPad=void 0;for(var t=0;t<this._buttonsLen;t++)this._buttons[t].destroy();this._buttons=[],this._buttonsLen=0,this._axes=[],this._axesLen=0,this.onConnectCallback=null,this.onDisconnectCallback=null,this.onDownCallback=null,this.onUpCallback=null,this.onAxisCallback=null,this.onFloatCallback=null},processAxisChange:function(t,e){this._axes[t]!==e&&(this._axes[t]=e,this._padParent.onAxisCallback&&this._padParent.onAxisCallback.call(this._padParent.callbackContext,this,t,e),this.onAxisCallback&&this.onAxisCallback.call(this.callbackContext,this,t,e))},processButtonDown:function(t,e){this._buttons[t]&&this._buttons[t].start(null,e),this._padParent.onDownCallback&&this._padParent.onDownCallback.call(this._padParent.callbackContext,t,e,this.index),this.onDownCallback&&this.onDownCallback.call(this.callbackContext,t,e)},processButtonUp:function(t,e){this._padParent.onUpCallback&&this._padParent.onUpCallback.call(this._padParent.callbackContext,t,e,this.index),this.onUpCallback&&this.onUpCallback.call(this.callbackContext,t,e),this._buttons[t]&&this._buttons[t].stop(null,e)},processButtonFloat:function(t,e){this._padParent.onFloatCallback&&this._padParent.onFloatCallback.call(this._padParent.callbackContext,t,e,this.index),this.onFloatCallback&&this.onFloatCallback.call(this.callbackContext,t,e),this._buttons[t]&&this._buttons[t].padFloat(e)},axis:function(t){return!!this._axes[t]&&this._axes[t]},isDown:function(t){return!!this._buttons[t]&&this._buttons[t].isDown},isUp:function(t){return!!this._buttons[t]&&this._buttons[t].isUp},justReleased:function(t,e){if(this._buttons[t])return this._buttons[t].justReleased(e)},justPressed:function(t,e){if(this._buttons[t])return this._buttons[t].justPressed(e)},buttonValue:function(t){return this._buttons[t]?this._buttons[t].value:null},reset:function(){for(var t=0;t<this._axes.length;t++)this._axes[t]=0}},e.SinglePad.prototype.constructor=e.SinglePad,e.Key=function(t,i){this.game=t,this._enabled=!0,this.event=null,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.timeDown=0,this.duration=0,this.timeUp=-2500,this.durationUp=-2500,this.repeats=0,this.keyCode=i,this.onDown=new e.Signal,this.onHoldCallback=null,this.onHoldContext=null,this.onUp=new e.Signal,this._justDown=!1,this._justUp=!1},e.Key.prototype={update:function(){this._enabled&&(this.isDown?(this.duration=this.game.time.time-this.timeDown,this.repeats++,this.onHoldCallback&&this.onHoldCallback.call(this.onHoldContext,this)):this.durationUp=this.game.time.time-this.timeUp)},processKeyDown:function(t){this._enabled&&(this.event=t,this.isDown||(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.time,this.duration=0,this.durationUp=this.game.time.time-this.timeUp,this.repeats=0,this._justDown=!0,this.onDown.dispatch(this)))},processKeyUp:function(t){this._enabled&&(this.event=t,this.isUp||(this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.time,this.duration=this.game.time.time-this.timeDown,this.durationUp=0,this._justUp=!0,this.onUp.dispatch(this)))},reset:function(t){void 0===t&&(t=!0),this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.time,this.duration=0,this.durationUp=-2500,this._enabled=!0,this._justDown=!1,this._justUp=!1,t&&(this.onDown.removeAll(),this.onUp.removeAll(),this.onHoldCallback=null,this.onHoldContext=null)},downDuration:function(t){return void 0===t&&(t=50),this.isDown&&this.duration<t},upDuration:function(t){return void 0===t&&(t=50),!this.isDown&&this.game.time.time-this.timeUp<t},justPressed:function(){return this.isDown&&0===this.duration},justReleased:function(){return!this.isDown&&0===this.durationUp}},Object.defineProperty(e.Key.prototype,"justDown",{get:function(){var t=this._justDown;return this._justDown=!1,t}}),Object.defineProperty(e.Key.prototype,"justUp",{get:function(){var t=this._justUp;return this._justUp=!1,t}}),Object.defineProperty(e.Key.prototype,"enabled",{get:function(){return this._enabled},set:function(t){(t=!!t)!==this._enabled&&(t||this.reset(!1),this._enabled=t)}}),e.Key.prototype.constructor=e.Key,e.Keyboard=function(t){this.game=t,this.active=!1,this.enabled=!0,this.event=null,this.pressEvent=null,this.callbackContext=this,this.onDownCallback=null,this.onPressCallback=null,this.onUpCallback=null,this._keys=[],this._capture=[],this._onKeyDown=null,this._onKeyPress=null,this._onKeyUp=null,this._i=0,this._k=0},e.Keyboard.prototype={addCallbacks:function(t,e,i,s){this.callbackContext=t,void 0!==e&&null!==e&&(this.onDownCallback=e),void 0!==i&&null!==i&&(this.onUpCallback=i),void 0!==s&&null!==s&&(this.onPressCallback=s)},removeCallbacks:function(){this.callbackContext=this,this.onDownCallback=null,this.onUpCallback=null,this.onPressCallback=null},addKey:function(t){return this._keys[t]||(this._keys[t]=new e.Key(this.game,t),this.addKeyCapture(t)),this._keys[t]},addKeys:function(t){var e={};for(var i in t)e[i]=this.addKey(t[i]);return e},removeKey:function(t){this._keys[t]&&(this._keys[t]=null,this.removeKeyCapture(t))},createCursorKeys:function(){return this.addKeys({up:e.KeyCode.UP,down:e.KeyCode.DOWN,left:e.KeyCode.LEFT,right:e.KeyCode.RIGHT})},start:function(){if(this.game.device.cocoonJS)return!1;if(this.active)return!1;var t=this;return this._onKeyDown=function(e){return t.processKeyDown(e)},this._onKeyUp=function(e){return t.processKeyUp(e)},this._onKeyPress=function(e){return t.processKeyPress(e)},window.addEventListener("keydown",this._onKeyDown,!1),window.addEventListener("keyup",this._onKeyUp,!1),window.addEventListener("keypress",this._onKeyPress,!1),this.active=!0,!0},stop:function(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),window.removeEventListener("keypress",this._onKeyPress),this._onKeyDown=null,this._onKeyUp=null,this._onKeyPress=null,this.active=!1},destroy:function(){this.stop(),this.clearCaptures(),this._keys.length=0,this._i=0},addKeyCapture:function(t){if("object"==typeof t)for(var e in t)this._capture[t[e]]=!0;else this._capture[t]=!0},removeKeyCapture:function(t){delete this._capture[t]},clearCaptures:function(){this._capture={}},update:function(){for(this._i=this._keys.length;this._i--;)this._keys[this._i]&&this._keys[this._i].update()},processKeyDown:function(t){if(this.event=t,this.game.input.enabled&&this.enabled){var i=t.keyCode;this._capture[i]&&t.preventDefault(),this._keys[i]||(this._keys[i]=new e.Key(this.game,i)),this._keys[i].processKeyDown(t),this._k=i,this.onDownCallback&&this.onDownCallback.call(this.callbackContext,t)}},processKeyPress:function(t){this.pressEvent=t,this.game.input.enabled&&this.enabled&&this.onPressCallback&&this.onPressCallback.call(this.callbackContext,String.fromCharCode(t.charCode),t)},processKeyUp:function(t){if(this.event=t,this.game.input.enabled&&this.enabled){var i=t.keyCode;this._capture[i]&&t.preventDefault(),this._keys[i]||(this._keys[i]=new e.Key(this.game,i)),this._keys[i].processKeyUp(t),this.onUpCallback&&this.onUpCallback.call(this.callbackContext,t)}},reset:function(t){void 0===t&&(t=!0),this.event=null;for(var e=this._keys.length;e--;)this._keys[e]&&this._keys[e].reset(t)},downDuration:function(t,e){return this._keys[t]?this._keys[t].downDuration(e):null},upDuration:function(t,e){return this._keys[t]?this._keys[t].upDuration(e):null},justPressed:function(t){return this._keys[t]?this._keys[t].justPressed():null},justReleased:function(t){return this._keys[t]?this._keys[t].justReleased():null},isDown:function(t){return this._keys[t]?this._keys[t].isDown:null}},Object.defineProperty(e.Keyboard.prototype,"lastChar",{get:function(){return this.event&&32===this.event.charCode?"":this.pressEvent?String.fromCharCode(this.pressEvent.charCode):null}}),Object.defineProperty(e.Keyboard.prototype,"lastKey",{get:function(){return this._keys[this._k]}}),e.Keyboard.prototype.constructor=e.Keyboard,e.KeyCode={A:"A".charCodeAt(0),B:"B".charCodeAt(0),C:"C".charCodeAt(0),D:"D".charCodeAt(0),E:"E".charCodeAt(0),F:"F".charCodeAt(0),G:"G".charCodeAt(0),H:"H".charCodeAt(0),I:"I".charCodeAt(0),J:"J".charCodeAt(0),K:"K".charCodeAt(0),L:"L".charCodeAt(0),M:"M".charCodeAt(0),N:"N".charCodeAt(0),O:"O".charCodeAt(0),P:"P".charCodeAt(0),Q:"Q".charCodeAt(0),R:"R".charCodeAt(0),S:"S".charCodeAt(0),T:"T".charCodeAt(0),U:"U".charCodeAt(0),V:"V".charCodeAt(0),W:"W".charCodeAt(0),X:"X".charCodeAt(0),Y:"Y".charCodeAt(0),Z:"Z".charCodeAt(0),ZERO:"0".charCodeAt(0),ONE:"1".charCodeAt(0),TWO:"2".charCodeAt(0),THREE:"3".charCodeAt(0),FOUR:"4".charCodeAt(0),FIVE:"5".charCodeAt(0),SIX:"6".charCodeAt(0),SEVEN:"7".charCodeAt(0),EIGHT:"8".charCodeAt(0),NINE:"9".charCodeAt(0),NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_ADD:107,NUMPAD_ENTER:108,NUMPAD_SUBTRACT:109,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,COLON:186,EQUALS:187,COMMA:188,UNDERSCORE:189,PERIOD:190,QUESTION_MARK:191,TILDE:192,OPEN_BRACKET:219,BACKWARD_SLASH:220,CLOSED_BRACKET:221,QUOTES:222,BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CONTROL:17,ALT:18,CAPS_LOCK:20,ESC:27,SPACEBAR:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PLUS:43,MINUS:44,INSERT:45,DELETE:46,HELP:47,NUM_LOCK:144};for(var s in e.KeyCode)e.KeyCode.hasOwnProperty(s)&&!s.match(/[a-z]/)&&(e.Keyboard[s]=e.KeyCode[s]);e.Component=function(){},e.Component.Angle=function(){},e.Component.Angle.prototype={angle:{get:function(){return e.Math.wrapAngle(e.Math.radToDeg(this.rotation))},set:function(t){this.rotation=e.Math.degToRad(e.Math.wrapAngle(t))}}},e.Component.Animation=function(){},e.Component.Animation.prototype={play:function(t,e,i,s){if(this.animations)return this.animations.play(t,e,i,s)}},e.Component.AutoCull=function(){},e.Component.AutoCull.prototype={autoCull:!1,inCamera:{get:function(){return this.autoCull||this.checkWorldBounds||(this._bounds.copyFrom(this.getBounds()),this._bounds.x+=this.game.camera.view.x,this._bounds.y+=this.game.camera.view.y),this.game.world.camera.view.intersects(this._bounds)}}},e.Component.Bounds=function(){},e.Component.Bounds.prototype={offsetX:{get:function(){return this.anchor.x*this.width}},offsetY:{get:function(){return this.anchor.y*this.height}},centerX:{get:function(){return this.x-this.offsetX+.5*this.width},set:function(t){this.x=t+this.offsetX-.5*this.width}},centerY:{get:function(){return this.y-this.offsetY+.5*this.height},set:function(t){this.y=t+this.offsetY-.5*this.height}},left:{get:function(){return this.x-this.offsetX},set:function(t){this.x=t+this.offsetX}},right:{get:function(){return this.x+this.width-this.offsetX},set:function(t){this.x=t-this.width+this.offsetX}},top:{get:function(){return this.y-this.offsetY},set:function(t){this.y=t+this.offsetY}},bottom:{get:function(){return this.y+this.height-this.offsetY},set:function(t){this.y=t-this.height+this.offsetY}},alignIn:function(t,i,s,n){switch(void 0===s&&(s=0),void 0===n&&(n=0),i){default:case e.TOP_LEFT:this.left=t.left-s,this.top=t.top-n;break;case e.TOP_CENTER:this.centerX=t.centerX+s,this.top=t.top-n;break;case e.TOP_RIGHT:this.right=t.right+s,this.top=t.top-n;break;case e.LEFT_CENTER:this.left=t.left-s,this.centerY=t.centerY+n;break;case e.CENTER:this.centerX=t.centerX+s,this.centerY=t.centerY+n;break;case e.RIGHT_CENTER:this.right=t.right+s,this.centerY=t.centerY+n;break;case e.BOTTOM_LEFT:this.left=t.left-s,this.bottom=t.bottom+n;break;case e.BOTTOM_CENTER:this.centerX=t.centerX+s,this.bottom=t.bottom+n;break;case e.BOTTOM_RIGHT:this.right=t.right+s,this.bottom=t.bottom+n}return this},alignTo:function(t,i,s,n){switch(void 0===s&&(s=0),void 0===n&&(n=0),i){default:case e.TOP_LEFT:this.left=t.left-s,this.bottom=t.top-n;break;case e.TOP_CENTER:this.centerX=t.centerX+s,this.bottom=t.top-n;break;case e.TOP_RIGHT:this.right=t.right+s,this.bottom=t.top-n;break;case e.LEFT_TOP:this.right=t.left-s,this.top=t.top-n;break;case e.LEFT_CENTER:this.right=t.left-s,this.centerY=t.centerY+n;break;case e.LEFT_BOTTOM:this.right=t.left-s,this.bottom=t.bottom+n;break;case e.RIGHT_TOP:this.left=t.right+s,this.top=t.top-n;break;case e.RIGHT_CENTER:this.left=t.right+s,this.centerY=t.centerY+n;break;case e.RIGHT_BOTTOM:this.left=t.right+s,this.bottom=t.bottom+n;break;case e.BOTTOM_LEFT:this.left=t.left-s,this.top=t.bottom+n;break;case e.BOTTOM_CENTER:this.centerX=t.centerX+s,this.top=t.bottom+n;break;case e.BOTTOM_RIGHT:this.right=t.right+s,this.top=t.bottom+n}return this}},e.Group.prototype.alignIn=e.Component.Bounds.prototype.alignIn,e.Group.prototype.alignTo=e.Component.Bounds.prototype.alignTo,e.Component.BringToTop=function(){},e.Component.BringToTop.prototype.bringToTop=function(){return this.parent&&this.parent.bringChildToTop&&this.parent.bringChildToTop(this),this},e.Component.BringToTop.prototype.sendToBack=function(){return this.parent&&this.parent.sendChildToBack&&this.parent.sendChildToBack(this),this},e.Component.BringToTop.prototype.moveUp=function(){return this.parent&&this.parent.moveUp(this),this},e.Component.BringToTop.prototype.moveDown=function(){return this.parent&&this.parent.moveDown(this),this},e.Component.Core=function(){},e.Component.Core.skipTypeChecks=!1,e.Component.Core.install=function(t){e.Utils.mixinPrototype(this,e.Component.Core.prototype),this.components={};for(var i=0;i<t.length;i++){var s=t[i],n=!1;"Destroy"===s&&(n=!0),e.Utils.mixinPrototype(this,e.Component[s].prototype,n),this.components[s]=!0}},e.Component.Core.init=function(t,i,s,n,r){if(!e.Component.Core.skipTypeChecks){if(!(t instanceof e.Game))throw new Error("The value passed as the `game` argument ("+t+") is not an instance of Phaser.Game.");"number"!=typeof i&&(console.warn("The `x` argument value (%s) should be a number.",i),i=0),"number"!=typeof s&&(console.warn("The `y` argument value (%s) should be a number.",s),s=0)}this.game=t,this.key=n,this.data={},this.position.set(i,s),this.world=new e.Point(i,s),this.previousPosition=new e.Point(i,s),this.events=new e.Events(this),this._bounds=new e.Rectangle,this.components.PhysicsBody&&(this.body=this.body),this.components.Animation&&(this.animations=new e.AnimationManager(this)),this.components.LoadTexture&&null!==n&&this.loadTexture(n,r),this.components.FixedToCamera&&(this.cameraOffset=new e.Point(i,s))},e.Component.Core.preUpdate=function(){return this.pendingDestroy?(this.destroy(),!1):(this.previousPosition.set(this.world.x,this.world.y),this.previousRotation=this.rotation,this.exists&&this.parent.exists?(this.world.setTo(this.game.camera.x+this.worldTransform.tx,this.game.camera.y+this.worldTransform.ty),this.visible&&(this.renderOrderID=this.game.stage.currentRenderOrderID++),this.animations&&this.animations.update(),this.body&&this.body.preUpdate(),this.preUpdateChildren(),!0):(this.renderOrderID=-1,!1))},e.Component.Core.prototype={game:null,name:"",data:{},components:{},z:0,events:void 0,animations:void 0,key:"",world:null,debug:!1,previousPosition:null,previousRotation:0,renderOrderID:0,fresh:!0,pendingDestroy:!1,_bounds:null,_exists:!0,exists:{get:function(){return this._exists},set:function(t){t?(this._exists=!0,this.body&&this.body.type===e.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._exists=!1,this.body&&this.body.type===e.Physics.P2JS&&this.body.removeFromWorld(),this.visible=!1)}},preUpdateChildren:function(){for(var t=0;t<this.children.length;){var e=this.children[t];e.preUpdate(),this===e.parent&&t++}},update:function(){},postUpdate:function(){this.customRender&&this.key.render(),this.components.PhysicsBody&&e.Component.PhysicsBody.postUpdate.call(this),this.components.FixedToCamera&&e.Component.FixedToCamera.postUpdate.call(this);for(var t=0;t<this.children.length;t++)this.children[t].postUpdate()}},e.Component.Crop=function(){},e.Component.Crop.prototype={cropRect:null,_crop:null,crop:function(t,i){void 0===i&&(i=!1),t?(i&&null!==this.cropRect?this.cropRect.setTo(t.x,t.y,t.width,t.height):i&&null===this.cropRect?this.cropRect=new e.Rectangle(t.x,t.y,t.width,t.height):this.cropRect=t,this.updateCrop()):(this._crop=null,this.cropRect=null,this.resetFrame())},updateCrop:function(){if(this.cropRect){var t=this.texture.crop.x,i=this.texture.crop.y,s=this.texture.crop.width,n=this.texture.crop.height;this._crop=e.Rectangle.clone(this.cropRect,this._crop),this._crop.x+=this._frame.x,this._crop.y+=this._frame.y;var r=Math.max(this._frame.x,this._crop.x),o=Math.max(this._frame.y,this._crop.y),a=Math.min(this._frame.right,this._crop.right)-r,h=Math.min(this._frame.bottom,this._crop.bottom)-o;this.texture.crop.x=r,this.texture.crop.y=o,this.texture.crop.width=a,this.texture.crop.height=h,this.texture.frame.width=Math.min(a,this.cropRect.width),this.texture.frame.height=Math.min(h,this.cropRect.height),this.texture.width=this.texture.frame.width,this.texture.height=this.texture.frame.height,this.texture._updateUvs(),16777215===this.tint||t===r&&i===o&&s===a&&n===h||(this.texture.requiresReTint=!0)}}},e.Component.Delta=function(){},e.Component.Delta.prototype={deltaX:{get:function(){return this.world.x-this.previousPosition.x}},deltaY:{get:function(){return this.world.y-this.previousPosition.y}},deltaZ:{get:function(){return this.rotation-this.previousRotation}}},e.Component.Destroy=function(){},e.Component.Destroy.prototype={destroyPhase:!1,destroy:function(t,i){if(null!==this.game&&!this.destroyPhase){void 0===t&&(t=!0),void 0===i&&(i=!1),this.destroyPhase=!0,this.events&&this.events.onDestroy$dispatch(this),this.parent&&(this.parent instanceof e.Group?this.parent.remove(this):this.parent.removeChild(this)),this.input&&this.input.destroy(),this.animations&&this.animations.destroy(),this.body&&this.body.destroy(),this.events&&this.events.destroy(),this.game.tweens.removeFrom(this);var s=this.children.length;if(t)for(;s--;)this.children[s].destroy(t);else for(;s--;)this.removeChild(this.children[s]);this._crop&&(this._crop=null,this.cropRect=null),this._frame&&(this._frame=null),e.Video&&this.key instanceof e.Video&&this.key.onChangeSource.remove(this.resizeFrame,this),e.BitmapText&&this._glyphs&&(this._glyphs=[]),this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null,this.data={},this.renderable=!1,this.transformCallback&&(this.transformCallback=null,this.transformCallbackContext=null),this.hitArea=null,this.parent=null,this.stage=null,this.worldTransform=null,this.filterArea=null,this._bounds=null,this._currentBounds=null,this._mask=null,this._destroyCachedSprite(),i&&this.texture.destroy(!0),this.destroyPhase=!1,this.pendingDestroy=!1}}},e.Events=function(t){this.parent=t},e.Events.prototype={destroy:function(){this._parent=null,this._onDestroy&&this._onDestroy.dispose(),this._onAddedToGroup&&this._onAddedToGroup.dispose(),this._onRemovedFromGroup&&this._onRemovedFromGroup.dispose(),this._onKilled&&this._onKilled.dispose(),this._onRevived&&this._onRevived.dispose(),this._onEnterBounds&&this._onEnterBounds.dispose(),this._onOutOfBounds&&this._onOutOfBounds.dispose(),this._onInputOver&&this._onInputOver.dispose(),this._onInputOut&&this._onInputOut.dispose(),this._onInputDown&&this._onInputDown.dispose(),this._onInputUp&&this._onInputUp.dispose(),this._onDragStart&&this._onDragStart.dispose(),this._onDragUpdate&&this._onDragUpdate.dispose(),this._onDragStop&&this._onDragStop.dispose(),this._onAnimationStart&&this._onAnimationStart.dispose(),this._onAnimationComplete&&this._onAnimationComplete.dispose(),this._onAnimationLoop&&this._onAnimationLoop.dispose()},onAddedToGroup:null,onRemovedFromGroup:null,onDestroy:null,onKilled:null,onRevived:null,onOutOfBounds:null,onEnterBounds:null,onInputOver:null,onInputOut:null,onInputDown:null,onInputUp:null,onDragStart:null,onDragUpdate:null,onDragStop:null,onAnimationStart:null,onAnimationComplete:null,onAnimationLoop:null},e.Events.prototype.constructor=e.Events;for(var n in e.Events.prototype)e.Events.prototype.hasOwnProperty(n)&&0===n.indexOf("on")&&null===e.Events.prototype[n]&&function(t,i){"use strict";Object.defineProperty(e.Events.prototype,t,{get:function(){return this[i]||(this[i]=new e.Signal)}}),e.Events.prototype[t+"$dispatch"]=function(){return this[i]?this[i].dispatch.apply(this[i],arguments):null}}(n,"_"+n);e.Component.FixedToCamera=function(){},e.Component.FixedToCamera.postUpdate=function(){this.fixedToCamera&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y)},e.Component.FixedToCamera.prototype={_fixedToCamera:!1,fixedToCamera:{get:function(){return this._fixedToCamera},set:function(t){t?(this._fixedToCamera=!0,this.cameraOffset.set(this.x,this.y)):this._fixedToCamera=!1}},cameraOffset:new e.Point},e.Component.Health=function(){},e.Component.Health.prototype={health:1,maxHealth:100,damage:function(t){return this.alive&&(this.health-=t,this.health<=0&&this.kill()),this},setHealth:function(t){return this.health=t,this.health>this.maxHealth&&(this.health=this.maxHealth),this},heal:function(t){return this.alive&&(this.health+=t,this.health>this.maxHealth&&(this.health=this.maxHealth)),this}},e.Component.InCamera=function(){},e.Component.InCamera.prototype={inCamera:{get:function(){return this.game.world.camera.view.intersects(this._bounds)}}},e.Component.InputEnabled=function(){},e.Component.InputEnabled.prototype={input:null,inputEnabled:{get:function(){return this.input&&this.input.enabled},set:function(t){t?null===this.input?(this.input=new e.InputHandler(this),this.input.start()):this.input&&!this.input.enabled&&this.input.start():this.input&&this.input.enabled&&this.input.stop()}}},e.Component.InWorld=function(){},e.Component.InWorld.preUpdate=function(){if(this.pendingDestroy)return this.destroy(),!1;if(this.autoCull||this.checkWorldBounds){if(this._bounds.copyFrom(this.getBounds()),this._bounds.x+=this.game.camera.view.x,this._bounds.y+=this.game.camera.view.y,this.autoCull)if(this.game.world.camera.view.intersects(this._bounds))this.renderable=!0,this.game.world.camera.totalInView++;else if(this.renderable=!1,this.outOfCameraBoundsKill)return this.kill(),!1;if(this.checkWorldBounds)if(this._outOfBoundsFired&&this.game.world.bounds.intersects(this._bounds))this._outOfBoundsFired=!1,this.events.onEnterBounds$dispatch(this);else if(!this._outOfBoundsFired&&!this.game.world.bounds.intersects(this._bounds)&&(this._outOfBoundsFired=!0,this.events.onOutOfBounds$dispatch(this),this.outOfBoundsKill))return this.kill(),!1}return!0},e.Component.InWorld.prototype={checkWorldBounds:!1,outOfBoundsKill:!1,outOfCameraBoundsKill:!1,_outOfBoundsFired:!1,inWorld:{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}},e.Component.LifeSpan=function(){},e.Component.LifeSpan.preUpdate=function(){return this.pendingDestroy?(this.destroy(),!1):!(this.lifespan>0&&(this.lifespan-=this.game.time.physicsElapsedMS,this.lifespan<=0))||(this.kill(),!1)},e.Component.LifeSpan.prototype={alive:!0,lifespan:0,revive:function(t){return void 0===t&&(t=100),this.alive=!0,this.exists=!0,this.visible=!0,"function"==typeof this.setHealth&&this.setHealth(t),this.events&&this.events.onRevived$dispatch(this),this},kill:function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled$dispatch(this),this}},e.Component.LoadTexture=function(){},e.Component.LoadTexture.prototype={customRender:!1,_frame:null,loadTexture:function(t,i,s){t===e.PENDING_ATLAS?(t=i,i=0):i=i||0,(s||void 0===s)&&this.animations&&this.animations.stop(),this.key=t,this.customRender=!1;var n=this.game.cache,r=!0,o=!this.texture.baseTexture.scaleMode;if(e.RenderTexture&&t instanceof e.RenderTexture)this.key=t.key,this.setTexture(t);else if(e.BitmapData&&t instanceof e.BitmapData)this.customRender=!0,this.setTexture(t.texture),r=n.hasFrameData(t.key,e.Cache.BITMAPDATA)?!this.animations.loadFrameData(n.getFrameData(t.key,e.Cache.BITMAPDATA),i):!this.animations.loadFrameData(t.frameData,0);else if(e.Video&&t instanceof e.Video){this.customRender=!0;var a=t.texture.valid;this.setTexture(t.texture),this.setFrame(t.texture.frame.clone()),t.onChangeSource.add(this.resizeFrame,this),this.texture.valid=a}else if(e.Tilemap&&t instanceof e.TilemapLayer)this.setTexture(PIXI.Texture.fromCanvas(t.canvas));else if(t instanceof PIXI.Texture)this.setTexture(t);else{var h=n.getImage(t,!0);this.key=h.key,this.setTexture(new PIXI.Texture(h.base)),this.texture.baseTexture.skipRender="__default"===t,r=!this.animations.loadFrameData(h.frameData,i)}r&&(this._frame=e.Rectangle.clone(this.texture.frame)),o||(this.texture.baseTexture.scaleMode=1)},setFrame:function(t){this._frame=t,this.texture.frame.x=t.x,this.texture.frame.y=t.y,this.texture.frame.width=t.width,this.texture.frame.height=t.height,this.texture.crop.x=t.x,this.texture.crop.y=t.y,this.texture.crop.width=t.width,this.texture.crop.height=t.height,t.trimmed?(this.texture.trim?(this.texture.trim.x=t.spriteSourceSizeX,this.texture.trim.y=t.spriteSourceSizeY,this.texture.trim.width=t.sourceSizeW,this.texture.trim.height=t.sourceSizeH):this.texture.trim={x:t.spriteSourceSizeX,y:t.spriteSourceSizeY,width:t.sourceSizeW,height:t.sourceSizeH},this.texture.width=t.sourceSizeW,this.texture.height=t.sourceSizeH,this.texture.frame.width=t.sourceSizeW,this.texture.frame.height=t.sourceSizeH):!t.trimmed&&this.texture.trim&&(this.texture.trim=null),t.rotated&&(this.texture.rotated=!0),this.cropRect&&this.updateCrop(),this.texture.requiresReTint=!0,this.texture._updateUvs(),this.tilingTexture&&(this.refreshTexture=!0)},resizeFrame:function(t,e,i){this.texture.frame.resize(e,i),this.texture.setFrame(this.texture.frame)},resetFrame:function(){this._frame&&this.setFrame(this._frame)},frame:{get:function(){return this.animations.frame},set:function(t){this.animations.frame=t}},frameName:{get:function(){return this.animations.frameName},set:function(t){this.animations.frameName=t}}},e.Component.Overlap=function(){},e.Component.Overlap.prototype={overlap:function(t){return e.Rectangle.intersects(this.getBounds(),t.getBounds())}},e.Component.PhysicsBody=function(){},e.Component.PhysicsBody.preUpdate=function(){return this.pendingDestroy?(this.destroy(),!1):this.fresh&&this.exists?(this.world.setTo(this.parent.position.x+this.position.x,this.parent.position.y+this.position.y),this.worldTransform.tx=this.world.x,this.worldTransform.ty=this.world.y,this.previousPosition.set(this.world.x,this.world.y),this.previousRotation=this.rotation,this.body&&this.body.preUpdate(),this.fresh=!1,this.preUpdateChildren(),!1):(this.previousPosition.set(this.world.x,this.world.y),this.previousRotation=this.rotation,!(!this._exists||!this.parent.exists)||(this.renderOrderID=-1,!1))},e.Component.PhysicsBody.postUpdate=function(){this.exists&&this.body&&this.body.postUpdate()},e.Component.PhysicsBody.prototype={body:null,x:{get:function(){return this.position.x},set:function(t){this.position.x=t,this.body&&!this.body.dirty&&(this.body._reset=!0)}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t,this.body&&!this.body.dirty&&(this.body._reset=!0)}}},e.Component.Reset=function(){},e.Component.Reset.prototype.reset=function(t,e,i){return void 0===i&&(i=1),this.world.set(t,e),this.position.set(t,e),this.fresh=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this.components.InWorld&&(this._outOfBoundsFired=!1),this.components.LifeSpan&&(this.alive=!0,this.health=i),this.components.PhysicsBody&&this.body&&this.body.reset(t,e,!1,!1),this},e.Component.ScaleMinMax=function(){},e.Component.ScaleMinMax.prototype={transformCallback:null,transformCallbackContext:this,scaleMin:null,scaleMax:null,checkTransform:function(t){this.scaleMin&&(t.a<this.scaleMin.x&&(t.a=this.scaleMin.x),t.d<this.scaleMin.y&&(t.d=this.scaleMin.y)),this.scaleMax&&(t.a>this.scaleMax.x&&(t.a=this.scaleMax.x),t.d>this.scaleMax.y&&(t.d=this.scaleMax.y))},setScaleMinMax:function(t,i,s,n){void 0===i?i=s=n=t:void 0===s&&(s=n=i,i=t),null===t?this.scaleMin=null:this.scaleMin?this.scaleMin.set(t,i):this.scaleMin=new e.Point(t,i),null===s?this.scaleMax=null:this.scaleMax?this.scaleMax.set(s,n):this.scaleMax=new e.Point(s,n),null===this.scaleMin?this.transformCallback=null:(this.transformCallback=this.checkTransform,this.transformCallbackContext=this)}},e.Component.Smoothed=function(){},e.Component.Smoothed.prototype={smoothed:{get:function(){return!this.texture.baseTexture.scaleMode},set:function(t){t?this.texture&&(this.texture.baseTexture.scaleMode=0,this.texture.baseTexture.dirty()):this.texture&&(this.texture.baseTexture.scaleMode=1,this.texture.baseTexture.dirty())}}},e.GameObjectFactory=function(t){this.game=t,this.world=this.game.world},e.GameObjectFactory.prototype={existing:function(t){return this.world.add(t)},weapon:function(t,i,s,n,r){var o=this.game.plugins.add(e.Weapon);return r&&(o.bulletClass=r),o.createBullets(t,i,s,n),o},image:function(t,i,s,n,r){return void 0===r&&(r=this.world),r.add(new e.Image(this.game,t,i,s,n))},sprite:function(t,i,s,n,r){return void 0===r&&(r=this.world),r.add(new e.Sprite(this.game,t,i,s,n))},creature:function(t,i,s,n,r){void 0===r&&(r=this.world);var o=new e.Creature(this.game,t,i,s,n);return r.add(o),o},tween:function(t){return this.game.tweens.create(t)},group:function(t,i,s,n,r){return new e.Group(this.game,t,i,s,n,r)},physicsGroup:function(t,i,s,n){return new e.Group(this.game,i,s,n,!0,t)},spriteBatch:function(t,i,s){return void 0===t&&(t=null),void 0===i&&(i="group"),void 0===s&&(s=!1),new e.SpriteBatch(this.game,t,i,s)},audio:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},sound:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},audioSprite:function(t){return this.game.sound.addSprite(t)},tileSprite:function(t,i,s,n,r,o,a){return void 0===a&&(a=this.world),a.add(new e.TileSprite(this.game,t,i,s,n,r,o))},rope:function(t,i,s,n,r,o){return void 0===o&&(o=this.world),o.add(new e.Rope(this.game,t,i,s,n,r))},text:function(t,i,s,n,r){return void 0===r&&(r=this.world),r.add(new e.Text(this.game,t,i,s,n))},button:function(t,i,s,n,r,o,a,h,l,c){return void 0===c&&(c=this.world),c.add(new e.Button(this.game,t,i,s,n,r,o,a,h,l))},graphics:function(t,i,s){return void 0===s&&(s=this.world),s.add(new e.Graphics(this.game,t,i))},emitter:function(t,i,s){return this.game.particles.add(new e.Particles.Arcade.Emitter(this.game,t,i,s))},retroFont:function(t,i,s,n,r,o,a,h,l){return new e.RetroFont(this.game,t,i,s,n,r,o,a,h,l)},bitmapText:function(t,i,s,n,r,o){return void 0===o&&(o=this.world),o.add(new e.BitmapText(this.game,t,i,s,n,r))},tilemap:function(t,i,s,n,r){return new e.Tilemap(this.game,t,i,s,n,r)},renderTexture:function(t,i,s,n){void 0!==s&&""!==s||(s=this.game.rnd.uuid()),void 0===n&&(n=!1);var r=new e.RenderTexture(this.game,t,i,s);return n&&this.game.cache.addRenderTexture(s,r),r},video:function(t,i){return new e.Video(this.game,t,i)},bitmapData:function(t,i,s,n){void 0===n&&(n=!1),void 0!==s&&""!==s||(s=this.game.rnd.uuid());var r=new e.BitmapData(this.game,s,t,i);return n&&this.game.cache.addBitmapData(s,r),r},filter:function(t){var i=Array.prototype.slice.call(arguments,1);return(t=new e.Filter[t](this.game)).init.apply(t,i),t},plugin:function(){return this.game.plugins.add.apply(this.game.plugins,arguments)}},e.GameObjectFactory.prototype.constructor=e.GameObjectFactory,e.GameObjectCreator=function(t){this.game=t,this.world=this.game.world},e.GameObjectCreator.prototype={image:function(t,i,s,n){return new e.Image(this.game,t,i,s,n)},sprite:function(t,i,s,n){return new e.Sprite(this.game,t,i,s,n)},tween:function(t){return new e.Tween(t,this.game,this.game.tweens)},group:function(t,i,s,n,r){return new e.Group(this.game,t||null,i,s,n,r)},spriteBatch:function(t,i,s){return void 0===i&&(i="group"),void 0===s&&(s=!1),new e.SpriteBatch(this.game,t,i,s)},audio:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},audioSprite:function(t){return this.game.sound.addSprite(t)},sound:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},tileSprite:function(t,i,s,n,r,o){return new e.TileSprite(this.game,t,i,s,n,r,o)},rope:function(t,i,s,n,r){return new e.Rope(this.game,t,i,s,n,r)},text:function(t,i,s,n){return new e.Text(this.game,t,i,s,n)},button:function(t,i,s,n,r,o,a,h,l){return new e.Button(this.game,t,i,s,n,r,o,a,h,l)},graphics:function(t,i){return new e.Graphics(this.game,t,i)},emitter:function(t,i,s){return new e.Particles.Arcade.Emitter(this.game,t,i,s)},retroFont:function(t,i,s,n,r,o,a,h,l){return new e.RetroFont(this.game,t,i,s,n,r,o,a,h,l)},bitmapText:function(t,i,s,n,r,o){return new e.BitmapText(this.game,t,i,s,n,r,o)},tilemap:function(t,i,s,n,r){return new e.Tilemap(this.game,t,i,s,n,r)},renderTexture:function(t,i,s,n){void 0!==s&&""!==s||(s=this.game.rnd.uuid()),void 0===n&&(n=!1);var r=new e.RenderTexture(this.game,t,i,s);return n&&this.game.cache.addRenderTexture(s,r),r},bitmapData:function(t,i,s,n){void 0===n&&(n=!1),void 0!==s&&""!==s||(s=this.game.rnd.uuid());var r=new e.BitmapData(this.game,s,t,i);return n&&this.game.cache.addBitmapData(s,r),r},filter:function(t){var i=Array.prototype.slice.call(arguments,1);return(t=new e.Filter[t](this.game)).init.apply(t,i),t}},e.GameObjectCreator.prototype.constructor=e.GameObjectCreator,e.Sprite=function(t,i,s,n,r){i=i||0,s=s||0,n=n||null,r=r||null,this.type=e.SPRITE,this.physicsType=e.SPRITE,PIXI.Sprite.call(this,e.Cache.DEFAULT),e.Component.Core.init.call(this,t,i,s,n,r)},e.Sprite.prototype=Object.create(PIXI.Sprite.prototype),e.Sprite.prototype.constructor=e.Sprite,e.Component.Core.install.call(e.Sprite.prototype,["Angle","Animation","AutoCull","Bounds","BringToTop","Crop","Delta","Destroy","FixedToCamera","Health","InCamera","InputEnabled","InWorld","LifeSpan","LoadTexture","Overlap","PhysicsBody","Reset","ScaleMinMax","Smoothed"]),e.Sprite.prototype.preUpdatePhysics=e.Component.PhysicsBody.preUpdate,e.Sprite.prototype.preUpdateLifeSpan=e.Component.LifeSpan.preUpdate,e.Sprite.prototype.preUpdateInWorld=e.Component.InWorld.preUpdate,e.Sprite.prototype.preUpdateCore=e.Component.Core.preUpdate,e.Sprite.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},e.Image=function(t,i,s,n,r){i=i||0,s=s||0,n=n||null,r=r||null,this.type=e.IMAGE,PIXI.Sprite.call(this,e.Cache.DEFAULT),e.Component.Core.init.call(this,t,i,s,n,r)},e.Image.prototype=Object.create(PIXI.Sprite.prototype),e.Image.prototype.constructor=e.Image,e.Component.Core.install.call(e.Image.prototype,["Angle","Animation","AutoCull","Bounds","BringToTop","Crop","Destroy","FixedToCamera","InputEnabled","LifeSpan","LoadTexture","Overlap","Reset","ScaleMinMax","Smoothed"]),e.Image.prototype.preUpdateLifeSpan=e.Component.LifeSpan.preUpdate,e.Image.prototype.preUpdateInWorld=e.Component.InWorld.preUpdate,e.Image.prototype.preUpdateCore=e.Component.Core.preUpdate,e.Image.prototype.preUpdate=function(){return!(!this.preUpdateInWorld()||!this.preUpdateLifeSpan())&&this.preUpdateCore()},e.Button=function(t,i,s,n,r,o,a,h,l,c){i=i||0,s=s||0,n=n||null,r=r||null,o=o||this,e.Image.call(this,t,i,s,n,h),this.type=e.BUTTON,this.physicsType=e.SPRITE,this._onOverFrame=null,this._onOutFrame=null,this._onDownFrame=null,this._onUpFrame=null,this.onOverSound=null,this.onOutSound=null,this.onDownSound=null,this.onUpSound=null,this.onOverSoundMarker="",this.onOutSoundMarker="",this.onDownSoundMarker="",this.onUpSoundMarker="",this.onInputOver=new e.Signal,this.onInputOut=new e.Signal,this.onInputDown=new e.Signal,this.onInputUp=new e.Signal,this.onOverMouseOnly=!0,this.justReleasedPreventsOver=e.PointerMode.CONTACT,this.freezeFrames=!1,this.forceOut=!1,this.inputEnabled=!0,this.input.start(0,!0),this.input.useHandCursor=!0,this.setFrames(a,h,l,c),null!==r&&this.onInputUp.add(r,o),this.events.onInputOver.add(this.onInputOverHandler,this),this.events.onInputOut.add(this.onInputOutHandler,this),this.events.onInputDown.add(this.onInputDownHandler,this),this.events.onInputUp.add(this.onInputUpHandler,this)},e.Button.prototype=Object.create(e.Image.prototype),e.Button.prototype.constructor=e.Button;return e.Button.prototype.clearFrames=function(){this.setFrames(null,null,null,null)},e.Button.prototype.setStateFrame=function(t,e,i){var s="_on"+t+"Frame";null!==e?(this[s]=e,i&&this.changeStateFrame(t)):this[s]=null},e.Button.prototype.changeStateFrame=function(t){if(this.freezeFrames)return!1;var e=this["_on"+t+"Frame"];return"string"==typeof e?(this.frameName=e,!0):"number"==typeof e&&(this.frame=e,!0)},e.Button.prototype.setFrames=function(t,e,i,s){this.setStateFrame("Over",t,this.input.pointerOver()),this.setStateFrame("Out",e,!this.input.pointerOver()),this.setStateFrame("Down",i,this.input.pointerDown()),this.setStateFrame("Up",s,this.input.pointerUp())},e.Button.prototype.setStateSound=function(t,i,s){var n="on"+t+"Sound",r="on"+t+"SoundMarker";i instanceof e.Sound||i instanceof e.AudioSprite?(this[n]=i,this[r]="string"==typeof s?s:""):(this[n]=null,this[r]="")},e.Button.prototype.playStateSound=function(t){var e=this["on"+t+"Sound"];if(e){var i=this["on"+t+"SoundMarker"];return e.play(i),!0}return!1},e.Button.prototype.setSounds=function(t,e,i,s,n,r,o,a){this.setStateSound("Over",t,e),this.setStateSound("Out",n,r),this.setStateSound("Down",i,s),this.setStateSound("Up",o,a)},e.Button.prototype.setOverSound=function(t,e){this.setStateSound("Over",t,e)},e.Button.prototype.setOutSound=function(t,e){this.setStateSound("Out",t,e)},e.Button.prototype.setDownSound=function(t,e){this.setStateSound("Down",t,e)},e.Button.prototype.setUpSound=function(t,e){this.setStateSound("Up",t,e)},e.Button.prototype.onInputOverHandler=function(t,e){e.justReleased()&&(this.justReleasedPreventsOver&e.pointerMode)===e.pointerMode||(this.changeStateFrame("Over"),this.onOverMouseOnly&&!e.isMouse||(this.playStateSound("Over"),this.onInputOver&&this.onInputOver.dispatch(this,e)))},e.Button.prototype.onInputOutHandler=function(t,e){this.changeStateFrame("Out"),this.playStateSound("Out"),this.onInputOut&&this.onInputOut.dispatch(this,e)},e.Button.prototype.onInputDownHandler=function(t,e){this.changeStateFrame("Down"),this.playStateSound("Down"),this.onInputDown&&this.onInputDown.dispatch(this,e)},e.Button.prototype.onInputUpHandler=function(t,e,i){this.playStateSound("Up"),this.onInputUp&&this.onInputUp.dispatch(this,e,i),this.freezeFrames||(!0===this.forceOut||(this.forceOut&e.pointerMode)===e.pointerMode?this.changeStateFrame("Out"):this.changeStateFrame("Up")||(i?this.changeStateFrame("Over"):this.changeStateFrame("Out")))},e.SpriteBatch=function(t,i,s,n){void 0!==i&&null!==i||(i=t.world),e.Group.call(this,t,i,s,n),this.type=e.SPRITEBATCH,this.fastSpriteBatch=null,this.ready=!1},e.SpriteBatch.prototype=Object.create(e.Group.prototype),e.SpriteBatch.prototype.constructor=e.SpriteBatch,e.SpriteBatch.prototype._renderWebGL=function(t){!this.visible||this.alpha<=0||!this.children.length||(this.ready||(this.fastSpriteBatch=new PIXI.WebGLFastSpriteBatch(t.gl),this.ready=!0),this.fastSpriteBatch.gl!==t.gl&&this.fastSpriteBatch.setContext(t.gl),t.spriteBatch.stop(),t.shaderManager.setShader(t.shaderManager.fastShader),this.fastSpriteBatch.begin(this,t),this.fastSpriteBatch.render(this),t.spriteBatch.start())},e.SpriteBatch.prototype._renderCanvas=function(t){if(this.visible&&!(this.alpha<=0)&&this.children.length){var e=t.context;e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var i=this.worldTransform,s=!0,n=0;n<this.children.length;n++){var r=this.children[n];if(r.visible){var o=r.texture,a=o.frame;if(e.globalAlpha=this.worldAlpha*r.alpha,r.rotation%(2*Math.PI)==0)s&&(e.setTransform(i.a,i.b,i.c,i.d,i.tx,i.ty),s=!1),e.drawImage(o.baseTexture.source,a.x,a.y,a.width,a.height,r.anchor.x*(-a.width*r.scale.x)+r.position.x+.5+t.shakeX|0,r.anchor.y*(-a.height*r.scale.y)+r.position.y+.5+t.shakeY|0,a.width*r.scale.x,a.height*r.scale.y);else{s||(s=!0),r.displayObjectUpdateTransform();var h=r.worldTransform,l=h.tx*t.resolution+t.shakeX,c=h.ty*t.resolution+t.shakeY;t.roundPixels?e.setTransform(h.a,h.b,h.c,h.d,0|l,0|c):e.setTransform(h.a,h.b,h.c,h.d,l,c),e.drawImage(o.baseTexture.source,a.x,a.y,a.width,a.height,r.anchor.x*-a.width+.5|0,r.anchor.y*-a.height+.5|0,a.width,a.height)}}}}},e.BitmapData=function(t,i,s,n,r){void 0!==s&&0!==s||(s=256),void 0!==n&&0!==n||(n=256),void 0===r&&(r=!1),this.game=t,this.key=i,this.width=s,this.height=n,this.canvas=e.Canvas.create(this,s,n,null,r),this.context=this.canvas.getContext("2d",{alpha:!0}),this.ctx=this.context,this.smoothProperty=t.renderType===e.CANVAS?t.renderer.renderSession.smoothProperty:e.Canvas.getSmoothingPrefix(this.context),this.imageData=this.context.getImageData(0,0,s,n),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data),this.baseTexture=new PIXI.BaseTexture(this.canvas,null,this.game.resolution),this.texture=new PIXI.Texture(this.baseTexture),this.frameData=new e.FrameData,this.textureFrame=this.frameData.addFrame(new e.Frame(0,0,0,s,n,"bitmapData")),this.texture.frame=this.textureFrame,this.type=e.BITMAPDATA,this.disableTextureUpload=!1,this.dirty=!1,this.cls=this.clear,this._image=null,this._pos=new e.Point,this._size=new e.Point,this._scale=new e.Point,this._rotate=0,this._alpha={prev:1,current:1},this._anchor=new e.Point,this._tempR=0,this._tempG=0,this._tempB=0,this._circle=new e.Circle,this._swapCanvas=void 0},e.BitmapData.prototype={move:function(t,e,i){return 0!==t&&this.moveH(t,i),0!==e&&this.moveV(e,i),this},moveH:function(t,i){void 0===i&&(i=!0),void 0===this._swapCanvas&&(this._swapCanvas=e.CanvasPool.create(this,this.width,this.height));var s=this._swapCanvas.getContext("2d"),n=this.height,r=this.canvas;if(s.clearRect(0,0,this.width,this.height),t<0){t=Math.abs(t);o=this.width-t;i&&s.drawImage(r,0,0,t,n,o,0,t,n),s.drawImage(r,t,0,o,n,0,0,o,n)}else{var o=this.width-t;i&&s.drawImage(r,o,0,t,n,0,0,t,n),s.drawImage(r,0,0,o,n,t,0,o,n)}return this.clear(),this.copy(this._swapCanvas)},moveV:function(t,i){void 0===i&&(i=!0),void 0===this._swapCanvas&&(this._swapCanvas=e.CanvasPool.create(this,this.width,this.height));var s=this._swapCanvas.getContext("2d"),n=this.width,r=this.canvas;if(s.clearRect(0,0,this.width,this.height),t<0){t=Math.abs(t);o=this.height-t;i&&s.drawImage(r,0,0,n,t,0,o,n,t),s.drawImage(r,0,t,n,o,0,0,n,o)}else{var o=this.height-t;i&&s.drawImage(r,0,o,n,t,0,0,n,t),s.drawImage(r,0,0,n,o,0,t,n,o)}return this.clear(),this.copy(this._swapCanvas)},add:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)t[e].loadTexture&&t[e].loadTexture(this);else t.loadTexture(this);return this},load:function(t){if("string"==typeof t&&(t=this.game.cache.getImage(t)),t)return this.resize(t.width,t.height),this.cls(),this.draw(t),this.update(),this},clear:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),this.context.clearRect(t,e,i,s),this.dirty=!0,this},fill:function(t,e,i,s){return void 0===s&&(s=1),this.context.fillStyle="rgba("+t+","+e+","+i+","+s+")",this.context.fillRect(0,0,this.width,this.height),this.dirty=!0,this},generateTexture:function(t,e,i){var s=this.game.cache,n=new Image;if(e&&(n.onload=function(){var r=s.addImage(t,"",n),o=new PIXI.Texture(r.base);e.call(i||null,o),n.onload=null}),n.src=this.canvas.toDataURL("image/png"),!e){var r=s.addImage(t,"",n);return new PIXI.Texture(r.base)}return null},resize:function(t,e){return t===this.width&&e===this.height||(this.width=t,this.height=e,this.canvas.width=t,this.canvas.height=e,void 0!==this._swapCanvas&&(this._swapCanvas.width=t,this._swapCanvas.height=e),this.baseTexture.width=t,this.baseTexture.height=e,this.textureFrame.width=t,this.textureFrame.height=e,this.texture.width=t,this.texture.height=e,this.texture.crop.width=t,this.texture.crop.height=e,this.update(),this.dirty=!0),this},update:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=Math.max(1,this.width)),void 0===s&&(s=Math.max(1,this.height)),this.imageData=this.context.getImageData(t,e,i,s),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this},processPixelRGB:function(t,i,s,n,r,o){void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=this.width),void 0===o&&(o=this.height);for(var a=s+r,h=n+o,l=e.Color.createColor(),c={r:0,g:0,b:0,a:0},u=!1,d=n;d<h;d++)for(var p=s;p<a;p++)e.Color.unpackPixel(this.getPixel32(p,d),l),!1!==(c=t.call(i,l,p,d))&&null!==c&&void 0!==c&&(this.setPixel32(p,d,c.r,c.g,c.b,c.a,!1),u=!0);return u&&(this.context.putImageData(this.imageData,0,0),this.dirty=!0),this},processPixel:function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height);for(var o=i+n,a=s+r,h=0,l=0,c=!1,u=s;u<a;u++)for(var d=i;d<o;d++)h=this.getPixel32(d,u),(l=t.call(e,h,d,u))!==h&&(this.pixels[u*this.width+d]=l,c=!0);return c&&(this.context.putImageData(this.imageData,0,0),this.dirty=!0),this},replaceRGB:function(t,i,s,n,r,o,a,h,l){var c=0,u=0,d=this.width,p=this.height,f=e.Color.packPixel(t,i,s,n);void 0!==l&&l instanceof e.Rectangle&&(c=l.x,u=l.y,d=l.width,p=l.height);for(var g=0;g<p;g++)for(var m=0;m<d;m++)this.getPixel32(c+m,u+g)===f&&this.setPixel32(c+m,u+g,r,o,a,h,!1);return this.context.putImageData(this.imageData,0,0),this.dirty=!0,this},setHSL:function(t,i,s,n){var r=t||0===t,o=i||0===i,a=s||0===s;if(r||o||a){void 0===n&&(n=new e.Rectangle(0,0,this.width,this.height));for(var h=e.Color.createColor(),l=n.y;l<n.bottom;l++)for(var c=n.x;c<n.right;c++)e.Color.unpackPixel(this.getPixel32(c,l),h,!0),r&&(h.h=t),o&&(h.s=i),a&&(h.l=s),e.Color.HSLtoRGB(h.h,h.s,h.l,h),this.setPixel32(c,l,h.r,h.g,h.b,h.a,!1);return this.context.putImageData(this.imageData,0,0),this.dirty=!0,this}},shiftHSL:function(t,i,s,n){if(void 0!==t&&null!==t||(t=!1),void 0!==i&&null!==i||(i=!1),void 0!==s&&null!==s||(s=!1),t||i||s){void 0===n&&(n=new e.Rectangle(0,0,this.width,this.height));for(var r=e.Color.createColor(),o=n.y;o<n.bottom;o++)for(var a=n.x;a<n.right;a++)e.Color.unpackPixel(this.getPixel32(a,o),r,!0),t&&(r.h=this.game.math.wrap(r.h+t,0,1)),i&&(r.s=this.game.math.clamp(r.s+i,0,1)),s&&(r.l=this.game.math.clamp(r.l+s,0,1)),e.Color.HSLtoRGB(r.h,r.s,r.l,r),this.setPixel32(a,o,r.r,r.g,r.b,r.a,!1);return this.context.putImageData(this.imageData,0,0),this.dirty=!0,this}},setPixel32:function(t,i,s,n,r,o,a){return void 0===a&&(a=!0),t>=0&&t<=this.width&&i>=0&&i<=this.height&&(e.Device.LITTLE_ENDIAN?this.pixels[i*this.width+t]=o<<24|r<<16|n<<8|s:this.pixels[i*this.width+t]=s<<24|n<<16|r<<8|o,a&&(this.context.putImageData(this.imageData,0,0),this.dirty=!0)),this},setPixel:function(t,e,i,s,n,r){return this.setPixel32(t,e,i,s,n,255,r)},getPixel:function(t,i,s){s||(s=e.Color.createColor());var n=~~(t+i*this.width);return n*=4,s.r=this.data[n],s.g=this.data[++n],s.b=this.data[++n],s.a=this.data[++n],s},getPixel32:function(t,e){if(t>=0&&t<=this.width&&e>=0&&e<=this.height)return this.pixels[e*this.width+t]},getPixelRGB:function(t,i,s,n,r){return e.Color.unpackPixel(this.getPixel32(t,i),s,n,r)},getPixels:function(t){return this.context.getImageData(t.x,t.y,t.width,t.height)},getFirstPixel:function(t){void 0===t&&(t=0);var i=e.Color.createColor(),s=0,n=0,r=1,o=!1;1===t?(r=-1,n=this.height):3===t&&(r=-1,s=this.width);do{e.Color.unpackPixel(this.getPixel32(s,n),i),0===t||1===t?++s===this.width&&(s=0,((n+=r)>=this.height||n<=0)&&(o=!0)):2!==t&&3!==t||++n===this.height&&(n=0,((s+=r)>=this.width||s<=0)&&(o=!0))}while(0===i.a&&!o);return i.x=s,i.y=n,i},getBounds:function(t){return void 0===t&&(t=new e.Rectangle),t.x=this.getFirstPixel(2).x,t.x===this.width?t.setTo(0,0,0,0):(t.y=this.getFirstPixel(0).y,t.width=this.getFirstPixel(3).x-t.x+1,t.height=this.getFirstPixel(1).y-t.y+1,t)},addToWorld:function(t,e,i,s,n,r){n=n||1,r=r||1;var o=this.game.add.image(t,e,this);return o.anchor.set(i,s),o.scale.set(n,r),o},copy:function(t,i,s,n,r,o,a,h,l,c,u,d,p,f,g,m,y){if(void 0!==t&&null!==t||(t=this),t instanceof e.RenderTexture&&(t=t.getCanvas()),this._image=t,t instanceof e.Sprite||t instanceof e.Image||t instanceof e.Text||t instanceof PIXI.Sprite)this._pos.set(t.texture.crop.x,t.texture.crop.y),this._size.set(t.texture.crop.width,t.texture.crop.height),this._scale.set(t.scale.x,t.scale.y),this._anchor.set(t.anchor.x,t.anchor.y),this._rotate=t.rotation,this._alpha.current=t.alpha,t.texture instanceof e.RenderTexture?this._image=t.texture.getCanvas():this._image=t.texture.baseTexture.source,void 0!==o&&null!==o||(o=t.x),void 0!==a&&null!==a||(a=t.y),t.texture.trim&&(o+=t.texture.trim.x-t.anchor.x*t.texture.trim.width,a+=t.texture.trim.y-t.anchor.y*t.texture.trim.height),16777215!==t.tint&&(t.cachedTint!==t.tint&&(t.cachedTint=t.tint,t.tintedTexture=PIXI.CanvasTinter.getTintedTexture(t,t.tint)),this._image=t.tintedTexture,this._pos.set(0));else{if(this._pos.set(0),this._scale.set(1),this._anchor.set(0),this._rotate=0,this._alpha.current=1,t instanceof e.BitmapData)this._image=t.canvas;else if("string"==typeof t){if(null===(t=this.game.cache.getImage(t)))return this;this._image=t}this._size.set(this._image.width,this._image.height)}if(void 0!==i&&null!==i||(i=0),void 0!==s&&null!==s||(s=0),n&&(this._size.x=n),r&&(this._size.y=r),void 0!==o&&null!==o||(o=i),void 0!==a&&null!==a||(a=s),void 0!==h&&null!==h||(h=this._size.x),void 0!==l&&null!==l||(l=this._size.y),"number"==typeof c&&(this._rotate=c),"number"==typeof u&&(this._anchor.x=u),"number"==typeof d&&(this._anchor.y=d),"number"==typeof p&&(this._scale.x=p),"number"==typeof f&&(this._scale.y=f),"number"==typeof g&&(this._alpha.current=g),void 0===m&&(m=null),void 0===y&&(y=!1),this._alpha.current<=0||0===this._scale.x||0===this._scale.y||0===this._size.x||0===this._size.y)return this;var v=this.context;return this._alpha.prev=v.globalAlpha,v.save(),v.globalAlpha=this._alpha.current,m&&(this.op=m),y&&(o|=0,a|=0),v.translate(o,a),v.scale(this._scale.x,this._scale.y),v.rotate(this._rotate),v.drawImage(this._image,this._pos.x+i,this._pos.y+s,this._size.x,this._size.y,-h*this._anchor.x,-l*this._anchor.y,h,l),v.restore(),v.globalAlpha=this._alpha.prev,this.dirty=!0,this},copyTransform:function(t,i,s){if(void 0===i&&(i=null),void 0===s&&(s=!1),!t.hasOwnProperty("worldTransform")||!t.worldVisible||0===t.worldAlpha)return this;var n=t.worldTransform;if(this._pos.set(t.texture.crop.x,t.texture.crop.y),this._size.set(t.texture.crop.width,t.texture.crop.height),0===n.a||0===n.d||0===this._size.x||0===this._size.y)return this;t.texture instanceof e.RenderTexture?this._image=t.texture.getCanvas():this._image=t.texture.baseTexture.source;var r=n.tx,o=n.ty;t.texture.trim&&(r+=t.texture.trim.x-t.anchor.x*t.texture.trim.width,o+=t.texture.trim.y-t.anchor.y*t.texture.trim.height),16777215!==t.tint&&(t.cachedTint!==t.tint&&(t.cachedTint=t.tint,t.tintedTexture=PIXI.CanvasTinter.getTintedTexture(t,t.tint)),this._image=t.tintedTexture,this._pos.set(0)),s&&(r|=0,o|=0);var a=this.context;return this._alpha.prev=a.globalAlpha,a.save(),a.globalAlpha=this._alpha.current,i&&(this.op=i),a[this.smoothProperty]=t.texture.baseTexture.scaleMode===PIXI.scaleModes.LINEAR,a.setTransform(n.a,n.b,n.c,n.d,r,o),a.drawImage(this._image,this._pos.x,this._pos.y,this._size.x,this._size.y,-this._size.x*t.anchor.x,-this._size.y*t.anchor.y,this._size.x,this._size.y),a.restore(),a.globalAlpha=this._alpha.prev,this.dirty=!0,this},copyRect:function(t,e,i,s,n,r,o){return this.copy(t,e.x,e.y,e.width,e.height,i,s,e.width,e.height,0,0,0,1,1,n,r,o)},draw:function(t,e,i,s,n,r,o){return this.copy(t,null,null,null,null,e,i,s,n,null,null,null,null,null,null,r,o)},drawGroup:function(t,e,i){return t.total>0&&t.forEachExists(this.drawGroupProxy,this,e,i),this},drawGroupProxy:function(t,i,s){if(t.hasOwnProperty("texture")&&this.copyTransform(t,i,s),t.type===e.GROUP&&t.exists)this.drawGroup(t,i,s);else if(t.hasOwnProperty("children")&&t.children.length>0)for(var n=0;n<t.children.length;n++)t.children[n].exists&&this.copyTransform(t.children[n],i,s)},drawFull:function(t,i,s){if(!1===t.worldVisible||0===t.worldAlpha||t.hasOwnProperty("exists")&&!1===t.exists)return this;if(t.type!==e.GROUP&&t.type!==e.EMITTER&&t.type!==e.BITMAPTEXT)if(t.type===e.GRAPHICS){var n=t.getBounds();this.ctx.save(),this.ctx.translate(n.x,n.y),PIXI.CanvasGraphics.renderGraphics(t,this.ctx),this.ctx.restore()}else this.copy(t,null,null,null,null,t.worldPosition.x,t.worldPosition.y,null,null,t.worldRotation,null,null,t.worldScale.x,t.worldScale.y,t.worldAlpha,i,s);if(t.children)for(var r=0;r<t.children.length;r++)this.drawFull(t.children[r],i,s);return this},shadow:function(t,e,i,s){var n=this.context;return void 0===t||null===t?n.shadowColor="rgba(0,0,0,0)":(n.shadowColor=t,n.shadowBlur=0===e?0:e||5,n.shadowOffsetX=0===i?0:i||10,n.shadowOffsetY=0===s?0:s||10),this},alphaMask:function(t,e,i,s){return void 0===s||null===s?this.draw(e).blendSourceAtop():this.draw(e,s.x,s.y,s.width,s.height).blendSourceAtop(),void 0===i||null===i?this.draw(t).blendReset():this.draw(t,i.x,i.y,i.width,i.height).blendReset(),this},extract:function(t,e,i,s,n,r,o,a,h){return void 0===n&&(n=255),void 0===r&&(r=!1),void 0===o&&(o=e),void 0===a&&(a=i),void 0===h&&(h=s),r&&t.resize(this.width,this.height),this.processPixelRGB(function(r,l,c){return r.r===e&&r.g===i&&r.b===s&&t.setPixel32(l,c,o,a,h,n,!1),!1},this),t.context.putImageData(t.imageData,0,0),t.dirty=!0,t},rect:function(t,e,i,s,n){return void 0!==n&&(this.context.fillStyle=n),this.context.fillRect(t,e,i,s),this},text:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s="14px Courier"),void 0===n&&(n="rgb(255,255,255)"),void 0===r&&(r=!0);var o=this.context,a=o.font;return o.font=s,r&&(o.fillStyle="rgb(0,0,0)",o.fillText(t,e+1,i+1)),o.fillStyle=n,o.fillText(t,e,i),o.font=a,this},circle:function(t,e,i,s){var n=this.context;return void 0!==s&&(n.fillStyle=s),n.beginPath(),n.arc(t,e,i,0,2*Math.PI,!1),n.closePath(),n.fill(),this},line:function(t,e,i,s,n,r){void 0===n&&(n="#fff"),void 0===r&&(r=1);var o=this.context;return o.beginPath(),o.moveTo(t,e),o.lineTo(i,s),o.lineWidth=r,o.strokeStyle=n,o.stroke(),o.closePath(),this},polygon:function(t,e,i,s){void 0===s&&(s="#fff"),void 0===i&&(i=0);var n=this.context;e&&(n.fillStyle=e),i&&(n.lineWidth=i,n.strokeStyle=s),n.beginPath(),n.moveTo(t[0].x,t[0].y);for(var r=1,o=t.length;r<o;r++){var a=t[r];n.lineTo(a.x,a.y)}return n.closePath(),e&&n.fill(),i&&n.stroke(),this},textureLine:function(t,i,s){if(void 0===s&&(s="repeat-x"),"string"!=typeof i||(i=this.game.cache.getImage(i))){var n=t.length;"no-repeat"===s&&n>i.width&&(n=i.width);var r=this.context;return r.fillStyle=r.createPattern(i,s),this._circle=new e.Circle(t.start.x,t.start.y,i.height),this._circle.circumferencePoint(t.angle-1.5707963267948966,!1,this._pos),r.save(),r.translate(this._pos.x,this._pos.y),r.rotate(t.angle),r.fillRect(0,0,n,i.height),r.restore(),this.dirty=!0,this}},render:function(){return!this.disableTextureUpload&&this.dirty&&(this.baseTexture.dirty(),this.dirty=!1),this},destroy:function(){this.frameData.destroy(),this.texture.destroy(!0),e.CanvasPool.remove(this)},blendReset:function(){return this.op="source-over",this},blendSourceOver:function(){return this.op="source-over",this},blendSourceIn:function(){return this.op="source-in",this},blendSourceOut:function(){return this.op="source-out",this},blendSourceAtop:function(){return this.op="source-atop",this},blendDestinationOver:function(){return this.op="destination-over",this},blendDestinationIn:function(){return this.op="destination-in",this},blendDestinationOut:function(){return this.op="destination-out",this},blendDestinationAtop:function(){return this.op="destination-atop",this},blendXor:function(){return this.op="xor",this},blendAdd:function(){return this.op="lighter",this},blendMultiply:function(){return this.op="multiply",this},blendScreen:function(){return this.op="screen",this},blendOverlay:function(){return this.op="overlay",this},blendDarken:function(){return this.op="darken",this},blendLighten:function(){return this.op="lighten",this},blendColorDodge:function(){return this.op="color-dodge",this},blendColorBurn:function(){return this.op="color-burn",this},blendHardLight:function(){return this.op="hard-light",this},blendSoftLight:function(){return this.op="soft-light",this},blendDifference:function(){return this.op="difference",this},blendExclusion:function(){return this.op="exclusion",this},blendHue:function(){return this.op="hue",this},blendSaturation:function(){return this.op="saturation",this},blendColor:function(){return this.op="color",this},blendLuminosity:function(){return this.op="luminosity",this},copyBitmapData:function(t,e,i){t.update();for(var s,n=0;n<t.height;n++){s=(i+n)*this.width+e;for(var r=0;r<t.width;r++)this.pixels[s+r]=t.pixels[n*t.width+r]}return this}},Object.defineProperty(e.BitmapData.prototype,"smoothed",{get:function(){e.Canvas.getSmoothingEnabled(this.context)},set:function(t){e.Canvas.setSmoothingEnabled(this.context,t)}}),Object.defineProperty(e.BitmapData.prototype,"op",{get:function(){return this.context.globalCompositeOperation},set:function(t){this.context.globalCompositeOperation=t}}),e.BitmapData.getTransform=function(t,e,i,s,n,r){return"number"!=typeof t&&(t=0),"number"!=typeof e&&(e=0),"number"!=typeof i&&(i=1),"number"!=typeof s&&(s=1),"number"!=typeof n&&(n=0),"number"!=typeof r&&(r=0),{sx:i,sy:s,scaleX:i,scaleY:s,skewX:n,skewY:r,translateX:t,translateY:e,tx:t,ty:e}},e.BitmapData.prototype.constructor=e.BitmapData,e.EarCut={},e.EarCut.Triangulate=function(t,i,s){s=s||2;var n=i&&i.length,r=n?i[0]*s:t.length,o=e.EarCut.linkedList(t,0,r,s,!0),a=[];if(!o)return a;var h,l,c,u,d,p,f;if(n&&(o=e.EarCut.eliminateHoles(t,i,o,s)),t.length>80*s){h=c=t[0],l=u=t[1];for(var g=s;g<r;g+=s)d=t[g],p=t[g+1],d<h&&(h=d),p<l&&(l=p),d>c&&(c=d),p>u&&(u=p);f=Math.max(c-h,u-l)}return e.EarCut.earcutLinked(o,a,s,h,l,f),a},e.EarCut.linkedList=function(t,i,s,n,r){var o,a,h,l=0;for(o=i,a=s-n;o<s;o+=n)l+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;if(r===l>0)for(o=i;o<s;o+=n)h=e.EarCut.insertNode(o,t[o],t[o+1],h);else for(o=s-n;o>=i;o-=n)h=e.EarCut.insertNode(o,t[o],t[o+1],h);return h},e.EarCut.filterPoints=function(t,i){if(!t)return t;i||(i=t);var s,n=t;do{if(s=!1,n.steiner||!e.EarCut.equals(n,n.next)&&0!==e.EarCut.area(n.prev,n,n.next))n=n.next;else{if(e.EarCut.removeNode(n),(n=i=n.prev)===n.next)return null;s=!0}}while(s||n!==i);return i},e.EarCut.earcutLinked=function(t,i,s,n,r,o,a){if(t){!a&&o&&e.EarCut.indexCurve(t,n,r,o);for(var h,l,c=t;t.prev!==t.next;)if(h=t.prev,l=t.next,o?e.EarCut.isEarHashed(t,n,r,o):e.EarCut.isEar(t))i.push(h.i/s),i.push(t.i/s),i.push(l.i/s),e.EarCut.removeNode(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?(t=e.EarCut.cureLocalIntersections(t,i,s),e.EarCut.earcutLinked(t,i,s,n,r,o,2)):2===a&&e.EarCut.splitEarcut(t,i,s,n,r,o):e.EarCut.earcutLinked(e.EarCut.filterPoints(t),i,s,n,r,o,1);break}}},e.EarCut.isEar=function(t){var i=t.prev,s=t,n=t.next;if(e.EarCut.area(i,s,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(e.EarCut.pointInTriangle(i.x,i.y,s.x,s.y,n.x,n.y,r.x,r.y)&&e.EarCut.area(r.prev,r,r.next)>=0)return!1;r=r.next}return!0},e.EarCut.isEarHashed=function(t,i,s,n){var r=t.prev,o=t,a=t.next;if(e.EarCut.area(r,o,a)>=0)return!1;for(var h=r.x<o.x?r.x<a.x?r.x:a.x:o.x<a.x?o.x:a.x,l=r.y<o.y?r.y<a.y?r.y:a.y:o.y<a.y?o.y:a.y,c=r.x>o.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,u=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,d=e.EarCut.zOrder(h,l,i,s,n),p=e.EarCut.zOrder(c,u,i,s,n),f=t.nextZ;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&e.EarCut.pointInTriangle(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&e.EarCut.area(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=d;){if(f!==t.prev&&f!==t.next&&e.EarCut.pointInTriangle(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&e.EarCut.area(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0},e.EarCut.cureLocalIntersections=function(t,i,s){var n=t;do{var r=n.prev,o=n.next.next;e.EarCut.intersects(r,n,n.next,o)&&e.EarCut.locallyInside(r,o)&&e.EarCut.locallyInside(o,r)&&(i.push(r.i/s),i.push(n.i/s),i.push(o.i/s),e.EarCut.removeNode(n),e.EarCut.removeNode(n.next),n=t=o),n=n.next}while(n!==t);return n},e.EarCut.splitEarcut=function(t,i,s,n,r,o){var a=t;do{for(var h=a.next.next;h!==a.prev;){if(a.i!==h.i&&e.EarCut.isValidDiagonal(a,h)){var l=e.EarCut.splitPolygon(a,h);return a=e.EarCut.filterPoints(a,a.next),l=e.EarCut.filterPoints(l,l.next),e.EarCut.earcutLinked(a,i,s,n,r,o),void e.EarCut.earcutLinked(l,i,s,n,r,o)}h=h.next}a=a.next}while(a!==t)},e.EarCut.eliminateHoles=function(t,i,s,n){var r,o,a,h,l,c=[];for(r=0,o=i.length;r<o;r++)a=i[r]*n,h=r<o-1?i[r+1]*n:t.length,(l=e.EarCut.linkedList(t,a,h,n,!1))===l.next&&(l.steiner=!0),c.push(e.EarCut.getLeftmost(l));for(c.sort(e.EarCut.compareX),r=0;r<c.length;r++)e.EarCut.eliminateHole(c[r],s),s=e.EarCut.filterPoints(s,s.next);return s},e.EarCut.compareX=function(t,e){return t.x-e.x},e.EarCut.eliminateHole=function(t,i){if(i=e.EarCut.findHoleBridge(t,i)){var s=e.EarCut.splitPolygon(i,t);e.EarCut.filterPoints(s,s.next)}},e.EarCut.findHoleBridge=function(t,i){var s,n=i,r=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y){var h=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);h<=r&&h>a&&(a=h,s=n.x<n.next.x?n:n.next)}n=n.next}while(n!==i);if(!s)return null;if(t.x===s.x)return s.prev;var l,c=s,u=1/0;for(n=s.next;n!==c;)r>=n.x&&n.x>=s.x&&e.EarCut.pointInTriangle(o<s.y?r:a,o,s.x,s.y,o<s.y?a:r,o,n.x,n.y)&&((l=Math.abs(o-n.y)/(r-n.x))<u||l===u&&n.x>s.x)&&e.EarCut.locallyInside(n,t)&&(s=n,u=l),n=n.next;return s},e.EarCut.indexCurve=function(t,i,s,n){var r=t;do{null===r.z&&(r.z=e.EarCut.zOrder(r.x,r.y,i,s,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,e.EarCut.sortLinked(r)},e.EarCut.sortLinked=function(t){var e,i,s,n,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,s=i,a=0,e=0;e<l&&(a++,s=s.nextZ);e++);for(h=l;a>0||h>0&&s;)0===a?(n=s,s=s.nextZ,h--):0!==h&&s?i.z<=s.z?(n=i,i=i.nextZ,a--):(n=s,s=s.nextZ,h--):(n=i,i=i.nextZ,a--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;i=s}r.nextZ=null,l*=2}while(o>1);return t},e.EarCut.zOrder=function(t,e,i,s,n){return t=32767*(t-i)/n,e=32767*(e-s)/n,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},e.EarCut.getLeftmost=function(t){var e=t,i=t;do{e.x<i.x&&(i=e),e=e.next}while(e!==t);return i},e.EarCut.pointInTriangle=function(t,e,i,s,n,r,o,a){return(n-o)*(e-a)-(t-o)*(r-a)>=0&&(t-o)*(s-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(n-o)*(s-a)>=0},e.EarCut.isValidDiagonal=function(t,i){return e.EarCut.equals(t,i)||t.next.i!==i.i&&t.prev.i!==i.i&&!e.EarCut.intersectsPolygon(t,i)&&e.EarCut.locallyInside(t,i)&&e.EarCut.locallyInside(i,t)&&e.EarCut.middleInside(t,i)},e.EarCut.area=function(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)},e.EarCut.equals=function(t,e){return t.x===e.x&&t.y===e.y},e.EarCut.intersects=function(t,i,s,n){return e.EarCut.area(t,i,s)>0!=e.EarCut.area(t,i,n)>0&&e.EarCut.area(s,n,t)>0!=e.EarCut.area(s,n,i)>0},e.EarCut.intersectsPolygon=function(t,i){var s=t;do{if(s.i!==t.i&&s.next.i!==t.i&&s.i!==i.i&&s.next.i!==i.i&&e.EarCut.intersects(s,s.next,t,i))return!0;s=s.next}while(s!==t);return!1},e.EarCut.locallyInside=function(t,i){return e.EarCut.area(t.prev,t,t.next)<0?e.EarCut.area(t,i,t.next)>=0&&e.EarCut.area(t,t.prev,i)>=0:e.EarCut.area(t,i,t.prev)<0||e.EarCut.area(t,t.next,i)<0},e.EarCut.middleInside=function(t,e){var i=t,s=!1,n=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&n<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s},e.EarCut.splitPolygon=function(t,i){var s=new e.EarCut.Node(t.i,t.x,t.y),n=new e.EarCut.Node(i.i,i.x,i.y),r=t.next,o=i.prev;return t.next=i,i.prev=t,s.next=r,r.prev=s,n.next=s,s.prev=n,o.next=n,n.prev=o,n},e.EarCut.insertNode=function(t,i,s,n){var r=new e.EarCut.Node(t,i,s);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r},e.EarCut.removeNode=function(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)},e.EarCut.Node=function(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1},PIXI.WebGLGraphics=function(){},PIXI.WebGLGraphics.stencilBufferLimit=6,PIXI.WebGLGraphics.renderGraphics=function(t,i){var s,n=i.gl,r=i.projection,o=i.offset,a=i.shaderManager.primitiveShader;t.dirty&&PIXI.WebGLGraphics.updateGraphics(t,n);var h=t._webGL[n.id];if(h)for(var l=0;l<h.data.length;l++)1===h.data[l].mode?(s=h.data[l],i.stencilManager.pushStencil(t,s,i),n.drawElements(n.TRIANGLE_FAN,4,n.UNSIGNED_SHORT,2*(s.indices.length-4)),i.stencilManager.popStencil(t,s,i)):(s=h.data[l],i.shaderManager.setShader(a),a=i.shaderManager.primitiveShader,n.uniformMatrix3fv(a.translationMatrix,!1,t.worldTransform.toArray(!0)),n.uniform1f(a.flipY,1),n.uniform2f(a.projectionVector,r.x,-r.y),n.uniform2f(a.offsetVector,-o.x,-o.y),n.uniform3fv(a.tintColor,e.Color.hexToRGBArray(t.tint)),n.uniform1f(a.alpha,t.worldAlpha),n.bindBuffer(n.ARRAY_BUFFER,s.buffer),n.vertexAttribPointer(a.aVertexPosition,2,n.FLOAT,!1,24,0),n.vertexAttribPointer(a.colorAttribute,4,n.FLOAT,!1,24,8),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,s.indexBuffer),n.drawElements(n.TRIANGLE_STRIP,s.indices.length,n.UNSIGNED_SHORT,0))},PIXI.WebGLGraphics.updateGraphics=function(t,i){var s=t._webGL[i.id];s||(s=t._webGL[i.id]={lastIndex:0,data:[],gl:i}),t.dirty=!1;var n;if(t.clearDirty){for(t.clearDirty=!1,n=0;n<s.data.length;n++){var r=s.data[n];r.reset(),PIXI.WebGLGraphics.graphicsDataPool.push(r)}s.data=[],s.lastIndex=0}var o;for(n=s.lastIndex;n<t.graphicsData.length;n++){var a=t.graphicsData[n];a.type===e.POLYGON?(a.points=a.shape.points.slice(),a.shape.closed&&(a.points[0]===a.points[a.points.length-2]&&a.points[1]===a.points[a.points.length-1]||a.points.push(a.points[0],a.points[1])),a.fill&&a.points.length>=PIXI.WebGLGraphics.stencilBufferLimit&&(a.points.length<2*PIXI.WebGLGraphics.stencilBufferLimit?(o=PIXI.WebGLGraphics.switchMode(s,0),PIXI.WebGLGraphics.buildPoly(a,o)||(o=PIXI.WebGLGraphics.switchMode(s,1),PIXI.WebGLGraphics.buildComplexPoly(a,o))):(o=PIXI.WebGLGraphics.switchMode(s,1),PIXI.WebGLGraphics.buildComplexPoly(a,o))),a.lineWidth>0&&(o=PIXI.WebGLGraphics.switchMode(s,0),PIXI.WebGLGraphics.buildLine(a,o))):(o=PIXI.WebGLGraphics.switchMode(s,0),a.type===e.RECTANGLE?PIXI.WebGLGraphics.buildRectangle(a,o):a.type===e.CIRCLE||a.type===e.ELLIPSE?PIXI.WebGLGraphics.buildCircle(a,o):a.type===e.ROUNDEDRECTANGLE&&PIXI.WebGLGraphics.buildRoundedRectangle(a,o)),s.lastIndex++}for(n=0;n<s.data.length;n++)(o=s.data[n]).dirty&&o.upload()},PIXI.WebGLGraphics.switchMode=function(t,e){var i;return t.data.length?(i=t.data[t.data.length-1]).mode===e&&1!==e||((i=PIXI.WebGLGraphics.graphicsDataPool.pop()||new PIXI.WebGLGraphicsData(t.gl)).mode=e,t.data.push(i)):((i=PIXI.WebGLGraphics.graphicsDataPool.pop()||new PIXI.WebGLGraphicsData(t.gl)).mode=e,t.data.push(i)),i.dirty=!0,i},PIXI.WebGLGraphics.buildRectangle=function(t,i){var s=t.shape,n=s.x,r=s.y,o=s.width,a=s.height;if(t.fill){var h=e.Color.hexToRGBArray(t.fillColor),l=t.fillAlpha,c=h[0]*l,u=h[1]*l,d=h[2]*l,p=i.points,f=i.indices,g=p.length/6;p.push(n,r),p.push(c,u,d,l),p.push(n+o,r),p.push(c,u,d,l),p.push(n,r+a),p.push(c,u,d,l),p.push(n+o,r+a),p.push(c,u,d,l),f.push(g,g,g+1,g+2,g+3,g+3)}if(t.lineWidth){var m=t.points;t.points=[n,r,n+o,r,n+o,r+a,n,r+a,n,r],PIXI.WebGLGraphics.buildLine(t,i),t.points=m}},PIXI.WebGLGraphics.buildRoundedRectangle=function(t,i){var s=t.shape,n=s.x,r=s.y,o=s.width,a=s.height,h=s.radius,l=[];if(l.push(n,r+h),l=l.concat(PIXI.WebGLGraphics.quadraticBezierCurve(n,r+a-h,n,r+a,n+h,r+a)),l=l.concat(PIXI.WebGLGraphics.quadraticBezierCurve(n+o-h,r+a,n+o,r+a,n+o,r+a-h)),l=l.concat(PIXI.WebGLGraphics.quadraticBezierCurve(n+o,r+h,n+o,r,n+o-h,r)),l=l.concat(PIXI.WebGLGraphics.quadraticBezierCurve(n+h,r,n,r,n,r+h)),t.fill){var c=e.Color.hexToRGBArray(t.fillColor),u=t.fillAlpha,d=c[0]*u,p=c[1]*u,f=c[2]*u,g=i.points,m=i.indices,y=g.length/6,v=e.EarCut.Triangulate(l,null,2),x=0;for(x=0;x<v.length;x+=3)m.push(v[x]+y),m.push(v[x]+y),m.push(v[x+1]+y),m.push(v[x+2]+y),m.push(v[x+2]+y);for(x=0;x<l.length;x++)g.push(l[x],l[++x],d,p,f,u)}if(t.lineWidth){var b=t.points;t.points=l,PIXI.WebGLGraphics.buildLine(t,i),t.points=b}},PIXI.WebGLGraphics.quadraticBezierCurve=function(t,e,i,s,n,r){function o(t,e,i){return t+(e-t)*i}for(var a,h,l,c,u,d,p=[],f=0,g=0;g<=20;g++)a=o(t,i,f=g/20),h=o(e,s,f),l=o(i,n,f),c=o(s,r,f),u=o(a,l,f),d=o(h,c,f),p.push(u,d);return p},PIXI.WebGLGraphics.buildCircle=function(t,i){var s,n,r=t.shape,o=r.x,a=r.y;t.type===e.CIRCLE?(s=r.radius,n=r.radius):(s=r.width,n=r.height);var h=2*Math.PI/40,l=0;if(t.fill){var c=e.Color.hexToRGBArray(t.fillColor),u=t.fillAlpha,d=c[0]*u,p=c[1]*u,f=c[2]*u,g=i.points,m=i.indices,y=g.length/6;for(m.push(y),l=0;l<41;l++)g.push(o,a,d,p,f,u),g.push(o+Math.sin(h*l)*s,a+Math.cos(h*l)*n,d,p,f,u),m.push(y++,y++);m.push(y-1)}if(t.lineWidth){var v=t.points;for(t.points=[],l=0;l<41;l++)t.points.push(o+Math.sin(h*l)*s,a+Math.cos(h*l)*n);PIXI.WebGLGraphics.buildLine(t,i),t.points=v}},PIXI.WebGLGraphics.buildLine=function(t,i){var s=0,n=t.points;if(0!==n.length){if(t.lineWidth%2)for(s=0;s<n.length;s++)n[s]+=.5;var r=new PIXI.Point(n[0],n[1]),o=new PIXI.Point(n[n.length-2],n[n.length-1]);if(r.x===o.x&&r.y===o.y){(n=n.slice()).pop(),n.pop();var a=(o=new PIXI.Point(n[n.length-2],n[n.length-1])).x+.5*(r.x-o.x),h=o.y+.5*(r.y-o.y);n.unshift(a,h),n.push(a,h)}var l,c,u,d,p,f,g,m,y,v,x,b,_,w,T,P,C,S,A,E,M,R,L=i.points,B=i.indices,I=n.length/2,O=n.length,k=L.length/6,F=t.lineWidth/2,D=e.Color.hexToRGBArray(t.lineColor),U=t.lineAlpha,G=D[0]*U,N=D[1]*U,X=D[2]*U;for(u=n[0],d=n[1],p=n[2],y=-(d-(f=n[3])),v=u-p,y/=R=Math.sqrt(y*y+v*v),v/=R,y*=F,v*=F,L.push(u-y,d-v,G,N,X,U),L.push(u+y,d+v,G,N,X,U),s=1;s<I-1;s++)u=n[2*(s-1)],d=n[2*(s-1)+1],p=n[2*s],f=n[2*s+1],g=n[2*(s+1)],m=n[2*(s+1)+1],y=-(d-f),v=u-p,y/=R=Math.sqrt(y*y+v*v),v/=R,y*=F,v*=F,x=-(f-m),b=p-g,x/=R=Math.sqrt(x*x+b*b),b/=R,C=(-y+u)*(-v+f)-(-y+p)*(-v+d),E=(-(x*=F)+g)*(-(b*=F)+f)-(-x+p)*(-b+m),M=(T=-v+d-(-v+f))*(A=-x+p-(-x+g))-(S=-b+m-(-b+f))*(P=-y+p-(-y+u)),Math.abs(M)<.1?(M+=10.1,L.push(p-y,f-v,G,N,X,U),L.push(p+y,f+v,G,N,X,U)):((l=(P*E-A*C)/M)-p)*(l-p)+((c=(S*C-T*E)/M)-f)+(c-f)>19600?(_=y-x,w=v-b,_/=R=Math.sqrt(_*_+w*w),w/=R,_*=F,w*=F,L.push(p-_,f-w),L.push(G,N,X,U),L.push(p+_,f+w),L.push(G,N,X,U),L.push(p-_,f-w),L.push(G,N,X,U),O++):(L.push(l,c),L.push(G,N,X,U),L.push(p-(l-p),f-(c-f)),L.push(G,N,X,U));for(u=n[2*(I-2)],d=n[2*(I-2)+1],p=n[2*(I-1)],y=-(d-(f=n[2*(I-1)+1])),v=u-p,y/=R=Math.sqrt(y*y+v*v),v/=R,y*=F,v*=F,L.push(p-y,f-v),L.push(G,N,X,U),L.push(p+y,f+v),L.push(G,N,X,U),B.push(k),s=0;s<O;s++)B.push(k++);B.push(k-1)}},PIXI.WebGLGraphics.buildComplexPoly=function(t,i){var s=t.points.slice();if(!(s.length<6)){var n=i.indices;i.points=s,i.alpha=t.fillAlpha,i.color=e.Color.hexToRGBArray(t.fillColor);for(var r,o,a=1/0,h=-1/0,l=1/0,c=-1/0,u=0;u<s.length;u+=2)r=s[u],o=s[u+1],a=r<a?r:a,h=r>h?r:h,l=o<l?o:l,c=o>c?o:c;s.push(a,l,h,l,h,c,a,c);var d=s.length/2;for(u=0;u<d;u++)n.push(u)}},PIXI.WebGLGraphics.buildPoly=function(t,i){var s=t.points;if(!(s.length<6)){var n=i.points,r=i.indices,o=s.length/2,a=e.Color.hexToRGBArray(t.fillColor),h=t.fillAlpha,l=a[0]*h,c=a[1]*h,u=a[2]*h,d=e.EarCut.Triangulate(s,null,2);if(!d)return!1;var p=n.length/6,f=0;for(f=0;f<d.length;f+=3)r.push(d[f]+p),r.push(d[f]+p),r.push(d[f+1]+p),r.push(d[f+2]+p),r.push(d[f+2]+p);for(f=0;f<o;f++)n.push(s[2*f],s[2*f+1],l,c,u,h);return!0}},PIXI.WebGLGraphics.graphicsDataPool=[],PIXI.WebGLGraphicsData=function(t){this.gl=t,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0},PIXI.WebGLGraphicsData.prototype.reset=function(){this.points=[],this.indices=[]},PIXI.WebGLGraphicsData.prototype.upload=function(){var t=this.gl;this.glPoints=new Float32Array(this.points),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.bufferData(t.ARRAY_BUFFER,this.glPoints,t.STATIC_DRAW),this.glIndicies=new Uint16Array(this.indices),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.glIndicies,t.STATIC_DRAW),this.dirty=!1},PIXI.CanvasGraphics=function(){},PIXI.CanvasGraphics.renderGraphics=function(t,i){var s=t.worldAlpha;t.dirty&&(this.updateGraphicsTint(t),t.dirty=!1);for(var n=0;n<t.graphicsData.length;n++){var r=t.graphicsData[n],o=r.shape,a=r._fillTint,h=r._lineTint;if(i.lineWidth=r.lineWidth,r.type===e.POLYGON){i.beginPath();var l=o.points;i.moveTo(l[0],l[1]);for(var c=1;c<l.length/2;c++)i.lineTo(l[2*c],l[2*c+1]);o.closed&&i.lineTo(l[0],l[1]),l[0]===l[l.length-2]&&l[1]===l[l.length-1]&&i.closePath(),r.fill&&(i.globalAlpha=r.fillAlpha*s,i.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),i.fill()),r.lineWidth&&(i.globalAlpha=r.lineAlpha*s,i.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),i.stroke())}else if(r.type===e.RECTANGLE)(r.fillColor||0===r.fillColor)&&(i.globalAlpha=r.fillAlpha*s,i.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),i.fillRect(o.x,o.y,o.width,o.height)),r.lineWidth&&(i.globalAlpha=r.lineAlpha*s,i.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),i.strokeRect(o.x,o.y,o.width,o.height));else if(r.type===e.CIRCLE)i.beginPath(),i.arc(o.x,o.y,o.radius,0,2*Math.PI),i.closePath(),r.fill&&(i.globalAlpha=r.fillAlpha*s,i.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),i.fill()),r.lineWidth&&(i.globalAlpha=r.lineAlpha*s,i.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),i.stroke());else if(r.type===e.ELLIPSE){var u=2*o.width,d=2*o.height,p=o.x-u/2,f=o.y-d/2;i.beginPath();var g=u/2*.5522848,m=d/2*.5522848,y=p+u,v=f+d,x=p+u/2,b=f+d/2;i.moveTo(p,b),i.bezierCurveTo(p,b-m,x-g,f,x,f),i.bezierCurveTo(x+g,f,y,b-m,y,b),i.bezierCurveTo(y,b+m,x+g,v,x,v),i.bezierCurveTo(x-g,v,p,b+m,p,b),i.closePath(),r.fill&&(i.globalAlpha=r.fillAlpha*s,i.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),i.fill()),r.lineWidth&&(i.globalAlpha=r.lineAlpha*s,i.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),i.stroke())}else if(r.type===e.ROUNDEDRECTANGLE){var _=o.x,w=o.y,T=o.width,P=o.height,C=o.radius,S=Math.min(T,P)/2|0;C=C>S?S:C,i.beginPath(),i.moveTo(_,w+C),i.lineTo(_,w+P-C),i.quadraticCurveTo(_,w+P,_+C,w+P),i.lineTo(_+T-C,w+P),i.quadraticCurveTo(_+T,w+P,_+T,w+P-C),i.lineTo(_+T,w+C),i.quadraticCurveTo(_+T,w,_+T-C,w),i.lineTo(_+C,w),i.quadraticCurveTo(_,w,_,w+C),i.closePath(),(r.fillColor||0===r.fillColor)&&(i.globalAlpha=r.fillAlpha*s,i.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),i.fill()),r.lineWidth&&(i.globalAlpha=r.lineAlpha*s,i.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),i.stroke())}}},PIXI.CanvasGraphics.renderGraphicsMask=function(t,i){var s=t.graphicsData.length;if(0!==s){i.beginPath();for(var n=0;n<s;n++){var r=t.graphicsData[n],o=r.shape;if(r.type===e.POLYGON){var a=o.points;i.moveTo(a[0],a[1]);for(var h=1;h<a.length/2;h++)i.lineTo(a[2*h],a[2*h+1]);a[0]===a[a.length-2]&&a[1]===a[a.length-1]&&i.closePath()}else if(r.type===e.RECTANGLE)i.rect(o.x,o.y,o.width,o.height),i.closePath();else if(r.type===e.CIRCLE)i.arc(o.x,o.y,o.radius,0,2*Math.PI),i.closePath();else if(r.type===e.ELLIPSE){var l=2*o.width,c=2*o.height,u=o.x-l/2,d=o.y-c/2,p=l/2*.5522848,f=c/2*.5522848,g=u+l,m=d+c,y=u+l/2,v=d+c/2;i.moveTo(u,v),i.bezierCurveTo(u,v-f,y-p,d,y,d),i.bezierCurveTo(y+p,d,g,v-f,g,v),i.bezierCurveTo(g,v+f,y+p,m,y,m),i.bezierCurveTo(y-p,m,u,v+f,u,v),i.closePath()}else if(r.type===e.ROUNDEDRECTANGLE){var x=o.x,b=o.y,_=o.width,w=o.height,T=o.radius,P=Math.min(_,w)/2|0;T=T>P?P:T,i.moveTo(x,b+T),i.lineTo(x,b+w-T),i.quadraticCurveTo(x,b+w,x+T,b+w),i.lineTo(x+_-T,b+w),i.quadraticCurveTo(x+_,b+w,x+_,b+w-T),i.lineTo(x+_,b+T),i.quadraticCurveTo(x+_,b,x+_-T,b),i.lineTo(x+T,b),i.quadraticCurveTo(x,b,x,b+T),i.closePath()}}}},PIXI.CanvasGraphics.updateGraphicsTint=function(t){if(16777215!==t.tint)for(var e=(t.tint>>16&255)/255,i=(t.tint>>8&255)/255,s=(255&t.tint)/255,n=0;n<t.graphicsData.length;n++){var r=t.graphicsData[n],o=0|r.fillColor,a=0|r.lineColor;r._fillTint=((o>>16&255)/255*e*255<<16)+((o>>8&255)/255*i*255<<8)+(255&o)/255*s*255,r._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*i*255<<8)+(255&a)/255*s*255}},e.GraphicsData=function(t,e,i,s,n,r,o){this.lineWidth=t,this.lineColor=e,this.lineAlpha=i,this._lineTint=e,this.fillColor=s,this.fillAlpha=n,this._fillTint=s,this.fill=r,this.shape=o,this.type=o.type},e.GraphicsData.prototype.constructor=e.GraphicsData,e.GraphicsData.prototype.clone=function(){return new e.GraphicsData(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.fill,this.shape)},e.Graphics=function(t,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.type=e.GRAPHICS,this.physicsType=e.SPRITE,this.anchor=new e.Point,PIXI.DisplayObjectContainer.call(this),this.renderable=!0,this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this.blendMode=PIXI.blendModes.NORMAL,this.currentPath=null,this._webGL=[],this.isMask=!1,this.boundsPadding=0,this._localBounds=new e.Rectangle(0,0,1,1),this.dirty=!0,this._boundsDirty=!1,this.webGLDirty=!1,this.cachedSpriteDirty=!1,e.Component.Core.init.call(this,t,i,s,"",null)},e.Graphics.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),e.Graphics.prototype.constructor=e.Graphics,e.Component.Core.install.call(e.Graphics.prototype,["Angle","AutoCull","Bounds","Destroy","FixedToCamera","InputEnabled","InWorld","LifeSpan","PhysicsBody","Reset"]),e.Graphics.prototype.preUpdatePhysics=e.Component.PhysicsBody.preUpdate,e.Graphics.prototype.preUpdateLifeSpan=e.Component.LifeSpan.preUpdate,e.Graphics.prototype.preUpdateInWorld=e.Component.InWorld.preUpdate,e.Graphics.prototype.preUpdateCore=e.Component.Core.preUpdate,e.Graphics.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},e.Graphics.prototype.postUpdate=function(){e.Component.PhysicsBody.postUpdate.call(this),e.Component.FixedToCamera.postUpdate.call(this),this._boundsDirty&&(this.updateLocalBounds(),this._boundsDirty=!1);for(var t=0;t<this.children.length;t++)this.children[t].postUpdate()},e.Graphics.prototype.destroy=function(t){this.clear(),e.Component.Destroy.prototype.destroy.call(this,t)},e.Graphics.prototype.drawTriangle=function(t,i){void 0===i&&(i=!1);var s=new e.Polygon(t);if(i){var n=new e.Point(this.game.camera.x-t[0].x,this.game.camera.y-t[0].y),r=new e.Point(t[1].x-t[0].x,t[1].y-t[0].y),o=new e.Point(t[1].x-t[2].x,t[1].y-t[2].y).cross(r);n.dot(o)>0&&this.drawPolygon(s)}else this.drawPolygon(s)},e.Graphics.prototype.drawTriangles=function(t,i,s){void 0===s&&(s=!1);var n,r=new e.Point,o=new e.Point,a=new e.Point,h=[];if(i)if(t[0]instanceof e.Point)for(n=0;n<i.length/3;n++)h.push(t[i[3*n]]),h.push(t[i[3*n+1]]),h.push(t[i[3*n+2]]),3===h.length&&(this.drawTriangle(h,s),h=[]);else for(n=0;n<i.length;n++)r.x=t[2*i[n]],r.y=t[2*i[n]+1],h.push(r.copyTo({})),3===h.length&&(this.drawTriangle(h,s),h=[]);else if(t[0]instanceof e.Point)for(n=0;n<t.length/3;n++)this.drawTriangle([t[3*n],t[3*n+1],t[3*n+2]],s);else for(n=0;n<t.length/6;n++)r.x=t[6*n+0],r.y=t[6*n+1],o.x=t[6*n+2],o.y=t[6*n+3],a.x=t[6*n+4],a.y=t[6*n+5],this.drawTriangle([r,o,a],s)},e.Graphics.prototype.lineStyle=function(t,i,s){return this.lineWidth=t||0,this.lineColor=i||0,this.lineAlpha=void 0===s?1:s,this.currentPath&&(this.currentPath.shape.points.length?this.drawShape(new e.Polygon(this.currentPath.shape.points.slice(-2))):(this.currentPath.lineWidth=this.lineWidth,this.currentPath.lineColor=this.lineColor,this.currentPath.lineAlpha=this.lineAlpha)),this},e.Graphics.prototype.moveTo=function(t,i){return this.drawShape(new e.Polygon([t,i])),this},e.Graphics.prototype.lineTo=function(t,e){return this.currentPath||this.moveTo(0,0),this.currentPath.shape.points.push(t,e),this.dirty=!0,this._boundsDirty=!0,this},e.Graphics.prototype.quadraticCurveTo=function(t,e,i,s){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var n,r,o=this.currentPath.shape.points;0===o.length&&this.moveTo(0,0);for(var a=o[o.length-2],h=o[o.length-1],l=0,c=1;c<=20;++c)n=a+(t-a)*(l=c/20),r=h+(e-h)*l,o.push(n+(t+(i-t)*l-n)*l,r+(e+(s-e)*l-r)*l);return this.dirty=!0,this._boundsDirty=!0,this},e.Graphics.prototype.bezierCurveTo=function(t,e,i,s,n,r){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var o,a,h,l,c,u=this.currentPath.shape.points,d=u[u.length-2],p=u[u.length-1],f=0,g=1;g<=20;++g)h=(a=(o=1-(f=g/20))*o)*o,c=(l=f*f)*f,u.push(h*d+3*a*f*t+3*o*l*i+c*n,h*p+3*a*f*e+3*o*l*s+c*r);return this.dirty=!0,this._boundsDirty=!0,this},e.Graphics.prototype.arcTo=function(t,e,i,s,n){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var r=this.currentPath.shape.points,o=r[r.length-2],a=r[r.length-1]-e,h=o-t,l=s-e,c=i-t,u=Math.abs(a*c-h*l);if(u<1e-8||0===n)r[r.length-2]===t&&r[r.length-1]===e||r.push(t,e);else{var d=a*a+h*h,p=l*l+c*c,f=a*l+h*c,g=n*Math.sqrt(d)/u,m=n*Math.sqrt(p)/u,y=g*f/d,v=m*f/p,x=g*c+m*h,b=g*l+m*a,_=h*(m+y),w=a*(m+y),T=c*(g+v),P=l*(g+v),C=Math.atan2(w-b,_-x),S=Math.atan2(P-b,T-x);this.arc(x+t,b+e,n,C,S,h*l>c*a)}return this.dirty=!0,this._boundsDirty=!0,this},e.Graphics.prototype.arc=function(t,e,i,s,n,r,o){if(s===n)return this;void 0===r&&(r=!1),void 0===o&&(o=40),!r&&n<=s?n+=2*Math.PI:r&&s<=n&&(s+=2*Math.PI);var a=r?-1*(s-n):n-s,h=Math.ceil(Math.abs(a)/(2*Math.PI))*o;if(0===a)return this;var l=t+Math.cos(s)*i,c=e+Math.sin(s)*i;r&&this.filling?this.moveTo(t,e):this.moveTo(l,c);for(var u=this.currentPath.shape.points,d=a/(2*h),p=2*d,f=Math.cos(d),g=Math.sin(d),m=h-1,y=m%1/m,v=0;v<=m;v++){var x=d+s+p*(v+y*v),b=Math.cos(x),_=-Math.sin(x);u.push((f*b+g*_)*i+t,(f*-_+g*b)*i+e)}return this.dirty=!0,this._boundsDirty=!0,this},e.Graphics.prototype.beginFill=function(t,e){return this.filling=!0,this.fillColor=t||0,this.fillAlpha=void 0===e?1:e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},e.Graphics.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},e.Graphics.prototype.drawRect=function(t,i,s,n){return this.drawShape(new e.Rectangle(t,i,s,n)),this},e.Graphics.prototype.drawRoundedRect=function(t,i,s,n,r){return this.drawShape(new e.RoundedRectangle(t,i,s,n,r)),this},e.Graphics.prototype.drawCircle=function(t,i,s){return this.drawShape(new e.Circle(t,i,s)),this},e.Graphics.prototype.drawEllipse=function(t,i,s,n){return this.drawShape({x:t,y:i,width:s,height:n,type:e.ELLIPSE}),this},e.Graphics.prototype.drawPolygon=function(t){t instanceof e.Polygon&&(t=t.points);var i=t;if(!Array.isArray(i)){i=new Array(arguments.length);for(var s=0;s<i.length;++s)i[s]=arguments[s]}return this.drawShape(new e.Polygon(i)),this},e.Graphics.prototype.clear=function(){return this.lineWidth=0,this.filling=!1,this.dirty=!0,this._boundsDirty=!0,this.clearDirty=!0,this.graphicsData=[],this.updateLocalBounds(),this},e.Graphics.prototype.generateTexture=function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=PIXI.scaleModes.DEFAULT),void 0===i&&(i=0);var s=this.getBounds();s.width+=i,s.height+=i;var n=new PIXI.CanvasBuffer(s.width*t,s.height*t),r=PIXI.Texture.fromCanvas(n.canvas,e);return r.baseTexture.resolution=t,n.context.scale(t,t),n.context.translate(-s.x,-s.y),PIXI.CanvasGraphics.renderGraphics(this,n.context),r},e.Graphics.prototype._renderWebGL=function(t){if(!1!==this.visible&&0!==this.alpha&&!0!==this.isMask){if(this._cacheAsBitmap)return(this.dirty||this.cachedSpriteDirty)&&(this._generateCachedSprite(),this.updateCachedSpriteTexture(),this.cachedSpriteDirty=!1,this.dirty=!1),this._cachedSprite.worldAlpha=this.worldAlpha,void PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite,t);if(t.spriteBatch.stop(),t.blendModeManager.setBlendMode(this.blendMode),this._mask&&t.maskManager.pushMask(this._mask,t),this._filters&&t.filterManager.pushFilter(this._filterBlock),this.blendMode!==t.spriteBatch.currentBlendMode){t.spriteBatch.currentBlendMode=this.blendMode;var e=PIXI.blendModesWebGL[t.spriteBatch.currentBlendMode];t.spriteBatch.gl.blendFunc(e[0],e[1])}if(this.webGLDirty&&(this.dirty=!0,this.webGLDirty=!1),PIXI.WebGLGraphics.renderGraphics(this,t),this.children.length){t.spriteBatch.start();for(var i=0;i<this.children.length;i++)this.children[i]._renderWebGL(t);t.spriteBatch.stop()}this._filters&&t.filterManager.popFilter(),this._mask&&t.maskManager.popMask(this.mask,t),t.drawCount++,t.spriteBatch.start()}},e.Graphics.prototype._renderCanvas=function(t){if(!1!==this.visible&&0!==this.alpha&&!0!==this.isMask){if(this._prevTint!==this.tint&&(this.dirty=!0,this._prevTint=this.tint),this._cacheAsBitmap)return(this.dirty||this.cachedSpriteDirty)&&(this._generateCachedSprite(),this.updateCachedSpriteTexture(),this.cachedSpriteDirty=!1,this.dirty=!1),this._cachedSprite.alpha=this.alpha,void PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite,t);var e=t.context,i=this.worldTransform;this.blendMode!==t.currentBlendMode&&(t.currentBlendMode=this.blendMode,e.globalCompositeOperation=PIXI.blendModesCanvas[t.currentBlendMode]),this._mask&&t.maskManager.pushMask(this._mask,t);var s=t.resolution,n=i.tx*t.resolution+t.shakeX,r=i.ty*t.resolution+t.shakeY;e.setTransform(i.a*s,i.b*s,i.c*s,i.d*s,n,r),PIXI.CanvasGraphics.renderGraphics(this,e);for(var o=0;o<this.children.length;o++)this.children[o]._renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},e.Graphics.prototype.getBounds=function(t){if(this._currentBounds)return this._currentBounds;if(this.isMask)return e.EmptyRectangle;this.dirty&&(this.updateLocalBounds(),this.webGLDirty=!0,this.cachedSpriteDirty=!0,this.dirty=!1);var i=this._localBounds,s=i.x,n=i.width+i.x,r=i.y,o=i.height+i.y,a=t||this.worldTransform,h=a.a,l=a.b,c=a.c,u=a.d,d=a.tx,p=a.ty,f=h*n+c*o+d,g=u*o+l*n+p,m=h*s+c*o+d,y=u*o+l*s+p,v=h*s+c*r+d,x=u*r+l*s+p,b=h*n+c*r+d,_=u*r+l*n+p,w=f,T=g,P=f,C=g;return P=m<P?m:P,P=v<P?v:P,P=b<P?b:P,C=y<C?y:C,C=x<C?x:C,C=_<C?_:C,w=m>w?m:w,w=v>w?v:w,w=b>w?b:w,T=y>T?y:T,T=x>T?x:T,T=_>T?_:T,this._bounds.x=P,this._bounds.width=w-P,this._bounds.y=C,this._bounds.height=T-C,this._currentBounds=this._bounds,this._currentBounds},e.Graphics.prototype.getLocalBounds=function(){var t=this.worldTransform;this.worldTransform=e.identityMatrix;for(var i=0;i<this.children.length;i++)this.children[i].updateTransform();var s=this.getBounds();for(this.worldTransform=t,i=0;i<this.children.length;i++)this.children[i].updateTransform();return s},e.Graphics.prototype.containsPoint=function(t,i){void 0===i&&(i=new e.Point),this.worldTransform.applyInverse(t,i);for(var s=this.graphicsData,n=0;n<s.length;n++){var r=s[n];if(r.fill&&(r.shape&&r.shape.contains(i.x,i.y)))return!0}return!1},e.Graphics.prototype.updateLocalBounds=function(){var t=1/0,i=-1/0,s=1/0,n=-1/0;if(this.graphicsData.length)for(var r,o,a,h,l,c,u=0;u<this.graphicsData.length;u++){var d=this.graphicsData[u],p=d.type,f=d.lineWidth;if(r=d.shape,p===e.RECTANGLE||p===e.ROUNDEDRECTANGLE)a=r.x-f/2,h=r.y-f/2,l=r.width+f,c=r.height+f,t=a<t?a:t,i=a+l>i?a+l:i,s=h<s?h:s,n=h+c>n?h+c:n;else if(p===e.CIRCLE)a=r.x,h=r.y,l=r.radius+f/2,c=r.radius+f/2,t=a-l<t?a-l:t,i=a+l>i?a+l:i,s=h-c<s?h-c:s,n=h+c>n?h+c:n;else if(p===e.ELLIPSE)a=r.x,h=r.y,l=r.width+f/2,c=r.height+f/2,t=a-l<t?a-l:t,i=a+l>i?a+l:i,s=h-c<s?h-c:s,n=h+c>n?h+c:n;else{o=r.points;for(var g=0;g<o.length;g++)o[g]instanceof e.Point?(a=o[g].x,h=o[g].y):(a=o[g],h=o[g+1],g<o.length-1&&g++),t=a-f<t?a-f:t,i=a+f>i?a+f:i,s=h-f<s?h-f:s,n=h+f>n?h+f:n}}else t=0,i=0,s=0,n=0;var m=this.boundsPadding;this._localBounds.x=t-m,this._localBounds.width=i-t+2*m,this._localBounds.y=s-m,this._localBounds.height=n-s+2*m},e.Graphics.prototype._generateCachedSprite=function(){var t=this.getLocalBounds();if(this._cachedSprite)this._cachedSprite.buffer.resize(t.width,t.height);else{var e=new PIXI.CanvasBuffer(t.width,t.height),i=PIXI.Texture.fromCanvas(e.canvas);this._cachedSprite=new PIXI.Sprite(i),this._cachedSprite.buffer=e,this._cachedSprite.worldTransform=this.worldTransform}this._cachedSprite.anchor.x=-t.x/t.width,this._cachedSprite.anchor.y=-t.y/t.height,this._cachedSprite.buffer.context.translate(-t.x,-t.y),this.worldAlpha=1,PIXI.CanvasGraphics.renderGraphics(this,this._cachedSprite.buffer.context),this._cachedSprite.alpha=this.alpha},e.Graphics.prototype.updateCachedSpriteTexture=function(){var t=this._cachedSprite,e=t.texture,i=t.buffer.canvas;e.baseTexture.width=i.width,e.baseTexture.height=i.height,e.crop.width=e.frame.width=i.width,e.crop.height=e.frame.height=i.height,t._width=i.width,t._height=i.height,e.baseTexture.dirty()},e.Graphics.prototype.destroyCachedSprite=function(){this._cachedSprite.texture.destroy(!0),this._cachedSprite=null},e.Graphics.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null,t instanceof e.Polygon&&(t=t.clone()).flatten();var i=new e.GraphicsData(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,t);return this.graphicsData.push(i),i.type===e.POLYGON&&(i.shape.closed=this.filling,this.currentPath=i),this.dirty=!0,this._boundsDirty=!0,i},Object.defineProperty(e.Graphics.prototype,"cacheAsBitmap",{get:function(){return this._cacheAsBitmap},set:function(t){this._cacheAsBitmap=t,this._cacheAsBitmap?this._generateCachedSprite():this.destroyCachedSprite(),this.dirty=!0,this.webGLDirty=!0}}),e.RenderTexture=function(t,i,s,n,r,o,a,h){if(void 0===i&&(i=100),void 0===s&&(s=100),void 0===n&&(n=""),void 0===r&&(r=e.scaleModes.DEFAULT),void 0===o&&(o=1),void 0===a&&(a=PIXI.defaultRenderer),void 0===h&&(h=0),this.game=t,this.key=n,this.type=e.RENDERTEXTURE,this._tempMatrix=new e.Matrix,this.width=i,this.height=s,this.resolution=o,this.frame=new e.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution),this.crop=this.frame.clone(),this.baseTexture=new PIXI.BaseTexture,this.baseTexture.width=this.width*this.resolution,this.baseTexture.height=this.height*this.resolution,this.baseTexture._glTextures=[],this.baseTexture.resolution=this.resolution,this.baseTexture.scaleMode=r,this.baseTexture.hasLoaded=!0,PIXI.Texture.call(this,this.baseTexture,this.frame.clone()),this.renderer=a,this.renderer.type===e.WEBGL){var l=this.renderer.gl;this.baseTexture.textureIndex=h,this.baseTexture._dirty[l.id]=!1,this.textureBuffer=new PIXI.FilterTexture(l,this.width,this.height,this.baseTexture.scaleMode,h),this.baseTexture._glTextures[l.id]=this.textureBuffer.texture,this.projection=new e.Point(.5*this.width,.5*-this.height)}else this.textureBuffer=new PIXI.CanvasBuffer(this.width*this.resolution,this.height*this.resolution),this.baseTexture.source=this.textureBuffer.canvas;this.valid=!0,this.tempMatrix=new e.Matrix,this._updateUvs()},e.RenderTexture.prototype=Object.create(PIXI.Texture.prototype),e.RenderTexture.prototype.constructor=e.RenderTexture,e.RenderTexture.prototype.renderXY=function(t,i,s,n){t.updateTransform(),this._tempMatrix.copyFrom(t.worldTransform),this._tempMatrix.tx=i,this._tempMatrix.ty=s,this.renderer.type===e.WEBGL?this._renderWebGL(t,this._tempMatrix,n):this._renderCanvas(t,this._tempMatrix,n)},e.RenderTexture.prototype.renderRawXY=function(t,i,s,n){this._tempMatrix.identity().translate(i,s),this.renderer.type===e.WEBGL?this._renderWebGL(t,this._tempMatrix,n):this._renderCanvas(t,this._tempMatrix,n)},e.RenderTexture.prototype.render=function(t,i,s){void 0===i||null===i?this._tempMatrix.copyFrom(t.worldTransform):this._tempMatrix.copyFrom(i),this.renderer.type===e.WEBGL?this._renderWebGL(t,this._tempMatrix,s):this._renderCanvas(t,this._tempMatrix,s)},e.RenderTexture.prototype.resize=function(t,i,s){t===this.width&&i===this.height||(this.valid=t>0&&i>0,this.width=t,this.height=i,this.frame.width=this.crop.width=t*this.resolution,this.frame.height=this.crop.height=i*this.resolution,s&&(this.baseTexture.width=this.width*this.resolution,this.baseTexture.height=this.height*this.resolution),this.renderer.type===e.WEBGL&&(this.projection.x=this.width/2,this.projection.y=-this.height/2),this.valid&&this.textureBuffer.resize(this.width,this.height))},e.RenderTexture.prototype.clear=function(){this.valid&&(this.renderer.type===e.WEBGL&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear())},e.RenderTexture.prototype._renderWebGL=function(t,e,i){if(this.valid&&0!==t.alpha){var s=t.worldTransform;s.identity(),s.translate(0,2*this.projection.y),e&&s.append(e),s.scale(1,-1);for(var n=0;n<t.children.length;n++)t.children[n].updateTransform();var r=this.renderer.gl;r.viewport(0,0,this.width*this.resolution,this.height*this.resolution),r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer),i&&this.textureBuffer.clear(),this.renderer.spriteBatch.dirty=!0,this.renderer.renderDisplayObject(t,this.projection,this.textureBuffer.frameBuffer,e),this.renderer.spriteBatch.dirty=!0,r.bindFramebuffer(r.FRAMEBUFFER,null)}},e.RenderTexture.prototype._renderCanvas=function(t,e,i){if(this.valid&&0!==t.alpha){var s=t.worldTransform;s.identity(),e&&s.append(e);for(var n=0;n<t.children.length;n++)t.children[n].updateTransform();i&&this.textureBuffer.clear();var r=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(t,this.textureBuffer.context,e),this.renderer.resolution=r}},e.RenderTexture.prototype.getImage=function(){var t=new Image;return t.src=this.getBase64(),t},e.RenderTexture.prototype.getBase64=function(){return this.getCanvas().toDataURL()},e.RenderTexture.prototype.getCanvas=function(){if(this.renderer.type===e.WEBGL){var t=this.renderer.gl,i=this.textureBuffer.width,s=this.textureBuffer.height,n=new Uint8Array(4*i*s);t.bindFramebuffer(t.FRAMEBUFFER,this.textureBuffer.frameBuffer),t.readPixels(0,0,i,s,t.RGBA,t.UNSIGNED_BYTE,n),t.bindFramebuffer(t.FRAMEBUFFER,null);var r=new PIXI.CanvasBuffer(i,s),o=r.context.getImageData(0,0,i,s);return o.data.set(n),r.context.putImageData(o,0,0),r.canvas}return this.textureBuffer.canvas},e.Text=function(t,i,s,n,r){i=i||0,s=s||0,n=void 0===n||null===n?"":n.toString(),this.canvas=e.CanvasPool.create(this),e.Sprite.call(this,t,i,s,PIXI.Texture.fromCanvas(this.canvas)),this.type=e.TEXT,this.physicsType=e.SPRITE,this.padding=new e.Point,this.textBounds=null,this.context=this.canvas.getContext("2d"),this.colors=[],this.strokeColors=[],this.fontStyles=[],this.fontWeights=[],this.autoRound=!1,this.useAdvancedWrap=!1,this.splitRegExp=/(?:\r\n|\r|\n)/,this.characterLimitSize=-1,this.characterLimitSuffix="",this._testString="|MÉq",this._res=t.renderer.resolution,this._text=n,this._fontComponents=null,this._lineSpacing=0,this._charCount=0,this._width=0,this._height=0,this.style={},this.setStyle(r||{}),""!==n&&this.updateText()},e.Text.prototype=Object.create(e.Sprite.prototype),e.Text.prototype.constructor=e.Text,e.Text.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},e.Text.prototype.update=function(){},e.Text.prototype.destroy=function(t){this.texture.destroy(!0),e.Component.Destroy.prototype.destroy.call(this,t)},e.Text.prototype.setShadow=function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="rgba(0, 0, 0, 1)"),void 0===s&&(s=0),void 0===n&&(n=!0),void 0===r&&(r=!0),this.style.shadowOffsetX=t,this.style.shadowOffsetY=e,this.style.shadowColor=i,this.style.shadowBlur=s,this.style.shadowStroke=n,this.style.shadowFill=r,this.dirty=!0,this},e.Text.prototype.setStyle=function(t,e){void 0===e&&(e=!1);var i=Object.assign({},t);i.font=t.font||"bold 20pt Arial",i.backgroundColor=t.backgroundColor||null,i.fill=t.fill||"black",i.align=(t.align||"left").toLowerCase(),i.boundsAlignH=(t.boundsAlignH||"left").toLowerCase(),i.boundsAlignV=(t.boundsAlignV||"top").toLowerCase(),i.stroke=t.stroke||"black",i.strokeThickness=Number(t.strokeThickness)||0,i.wordWrap=t.wordWrap||!1,i.wordWrapWidth=t.wordWrapWidth||100,i.maxLines=t.maxLines||0,i.shadowOffsetX=t.shadowOffsetX||0,i.shadowOffsetY=t.shadowOffsetY||0,i.shadowColor=t.shadowColor||"rgba(0,0,0,0)",i.shadowBlur=t.shadowBlur||0,i.tabs=t.tabs||0;var s=this.fontToComponents(i.font);return i.fontStyle&&(s.fontStyle=i.fontStyle),i.fontVariant&&(s.fontVariant=i.fontVariant),i.fontWeight&&(s.fontWeight=i.fontWeight),i.fontSize&&("number"==typeof i.fontSize&&(i.fontSize=i.fontSize+"px"),s.fontSize=i.fontSize),this._fontComponents=s,i.font=this.componentsToFont(this._fontComponents),this.style=i,this.dirty=!0,e&&this.updateText(),this},e.Text.prototype.updateText=function(){this.texture.baseTexture.resolution=this._res,this.context.font=this.style.font;var t=this.text;this.characterLimitSize>-1&&this.characterLimitSize<t.length&&(t=this.text.substring(0,this.characterLimitSize)+this.characterLimitSuffix),this.style.wordWrap&&(t=this.runWordWrap(this.text));var e=t.split(this.splitRegExp),i=this.style.tabs,s=[],n=0,r=this.determineFontProperties(this.style.font),o=e.length;this.style.maxLines>0&&this.style.maxLines<e.length&&(o=this.style.maxLines),this._charCount=0;for(var a=0;a<o;a++){if(0===i){l=this.style.strokeThickness+this.padding.x;this.colors.length>0||this.strokeColors.length>0||this.fontWeights.length>0||this.fontStyles.length>0?l+=this.measureLine(e[a]):l+=this.context.measureText(e[a]).width,this.style.wordWrap&&(l-=this.context.measureText(" ").width)}else{var h=e[a].split(/(?:\t)/),l=this.padding.x+this.style.strokeThickness;if(Array.isArray(i))for(var c=0,u=0;u<h.length;u++){var d=0;d=this.colors.length>0||this.strokeColors.length>0||this.fontWeights.length>0||this.fontStyles.length>0?this.measureLine(h[u]):Math.ceil(this.context.measureText(h[u]).width),u>0&&(c+=i[u-1]),l=c+d}else for(u=0;u<h.length;u++)this.colors.length>0||this.strokeColors.length>0||this.fontWeights.length>0||this.fontStyles.length>0?l+=this.measureLine(h[u]):l+=Math.ceil(this.context.measureText(h[u]).width),l+=this.game.math.snapToCeil(l,i)-l}s[a]=Math.ceil(l),n=Math.max(n,s[a])}this.canvas.width=n*this._res;var p=r.fontSize+this.style.strokeThickness+this.padding.y,f=p*o,g=this._lineSpacing;g<0&&Math.abs(g)>p&&(g=-p),0!==g&&(f+=g>0?g*e.length:g*(e.length-1)),this.canvas.height=f*this._res,this.context.scale(this._res,this._res),navigator.isCocoonJS&&this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.style.backgroundColor&&(this.context.fillStyle=this.style.backgroundColor,this.context.fillRect(0,0,this.canvas.width,this.canvas.height)),this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.textBaseline="alphabetic",this.context.lineWidth=this.style.strokeThickness,this.context.lineCap="round",this.context.lineJoin="round";var m,y;for(this._charCount=0,a=0;a<o;a++)m=this.style.strokeThickness/2,y=this.style.strokeThickness/2+a*p+r.ascent,a>0&&(y+=g*a),"right"===this.style.align?m+=n-s[a]:"center"===this.style.align&&(m+=(n-s[a])/2),this.autoRound&&(m=Math.round(m),y=Math.round(y)),this.colors.length>0||this.strokeColors.length>0||this.fontWeights.length>0||this.fontStyles.length>0?this.updateLine(e[a],m,y):(this.style.stroke&&this.style.strokeThickness&&(this.updateShadow(this.style.shadowStroke),0===i?this.context.strokeText(e[a],m,y):this.renderTabLine(e[a],m,y,!1)),this.style.fill&&(this.updateShadow(this.style.shadowFill),0===i?this.context.fillText(e[a],m,y):this.renderTabLine(e[a],m,y,!0)));this.updateTexture(),this.dirty=!1},e.Text.prototype.renderTabLine=function(t,e,i,s){var n=t.split(/(?:\t)/),r=this.style.tabs,o=0;if(Array.isArray(r))for(var a=0,h=0;h<n.length;h++)h>0&&(a+=r[h-1]),o=e+a,s?this.context.fillText(n[h],o,i):this.context.strokeText(n[h],o,i);else for(h=0;h<n.length;h++){var l=Math.ceil(this.context.measureText(n[h]).width);o=this.game.math.snapToCeil(e,r),s?this.context.fillText(n[h],o,i):this.context.strokeText(n[h],o,i),e=o+l}},e.Text.prototype.updateShadow=function(t){t?(this.context.shadowOffsetX=this.style.shadowOffsetX,this.context.shadowOffsetY=this.style.shadowOffsetY,this.context.shadowColor=this.style.shadowColor,this.context.shadowBlur=this.style.shadowBlur):(this.context.shadowOffsetX=0,this.context.shadowOffsetY=0,this.context.shadowColor=0,this.context.shadowBlur=0)},e.Text.prototype.measureLine=function(t){for(var e=0,i=0;i<t.length;i++){var s=t[i];if(this.fontWeights.length>0||this.fontStyles.length>0){var n=this.fontToComponents(this.context.font);this.fontStyles[this._charCount]&&(n.fontStyle=this.fontStyles[this._charCount]),this.fontWeights[this._charCount]&&(n.fontWeight=this.fontWeights[this._charCount]),this.context.font=this.componentsToFont(n)}this.style.stroke&&this.style.strokeThickness&&(this.strokeColors[this._charCount]&&(this.context.strokeStyle=this.strokeColors[this._charCount]),this.updateShadow(this.style.shadowStroke)),this.style.fill&&(this.colors[this._charCount]&&(this.context.fillStyle=this.colors[this._charCount]),this.updateShadow(this.style.shadowFill)),e+=this.context.measureText(s).width,this._charCount++}return Math.ceil(e)},e.Text.prototype.updateLine=function(t,e,i){for(var s=0;s<t.length;s++){var n=t[s];if(this.fontWeights.length>0||this.fontStyles.length>0){var r=this.fontToComponents(this.context.font);this.fontStyles[this._charCount]&&(r.fontStyle=this.fontStyles[this._charCount]),this.fontWeights[this._charCount]&&(r.fontWeight=this.fontWeights[this._charCount]),this.context.font=this.componentsToFont(r)}this.style.stroke&&this.style.strokeThickness&&(this.strokeColors[this._charCount]&&(this.context.strokeStyle=this.strokeColors[this._charCount]),this.updateShadow(this.style.shadowStroke),this.context.strokeText(n,e,i)),this.style.fill&&(this.colors[this._charCount]&&(this.context.fillStyle=this.colors[this._charCount]),this.updateShadow(this.style.shadowFill),this.context.fillText(n,e,i)),e+=this.context.measureText(n).width,this._charCount++}},e.Text.prototype.clearColors=function(){return this.colors=[],this.strokeColors=[],this.dirty=!0,this},e.Text.prototype.clearFontValues=function(){return this.fontStyles=[],this.fontWeights=[],this.dirty=!0,this},e.Text.prototype.addColor=function(t,e){return this.colors[e]=t,this.dirty=!0,this},e.Text.prototype.addStrokeColor=function(t,e){return this.strokeColors[e]=t,this.dirty=!0,this},e.Text.prototype.addFontStyle=function(t,e){return this.fontStyles[e]=t,this.dirty=!0,this},e.Text.prototype.addFontWeight=function(t,e){return this.fontWeights[e]=t,this.dirty=!0,this},e.Text.prototype.precalculateWordWrap=function(t){return this.texture.baseTexture.resolution=this._res,this.context.font=this.style.font,this.runWordWrap(t).split(/(?:\r\n|\r|\n)/)},e.Text.prototype.runWordWrap=function(t){return this.useAdvancedWrap?this.advancedWordWrap(t):this.basicWordWrap(t)},e.Text.prototype.advancedWordWrap=function(t){for(var e=this.context,i=this.style.wordWrapWidth,s="",n=t.replace(/ +/gi," ").split(/\r?\n/gi),r=n.length,o=0;o<r;o++){var a=n[o],h="";if(a=a.replace(/^ *|\s*$/gi,""),e.measureText(a).width<i)s+=a+"\n";else{for(var l=i,c=a.split(" "),u=0;u<c.length;u++){var d=c[u],p=d+" ",f=e.measureText(p).width;if(f>l){if(0===u){for(var g=p;g.length&&(g=g.slice(0,-1),!((f=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var m=d.substr(g.length);c[u]=m,h+=g}var y=c[u].length?u:u+1,v=c.slice(y).join(" ").replace(/[ \n]*$/gi,"");n[o+1]=v+" "+(n[o+1]||""),r=n.length;break}h+=p,l-=f}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s=s.replace(/[\s|\n]*$/gi,"")},e.Text.prototype.basicWordWrap=function(t){for(var e="",i=t.split("\n"),s=0;s<i.length;s++){for(var n=this.style.wordWrapWidth,r=i[s].split(" "),o=0;o<r.length;o++){var a=this.context.measureText(r[o]).width,h=a+this.context.measureText(" ").width;h>n?(o>0&&(e+="\n"),e+=r[o]+" ",n=this.style.wordWrapWidth-a):(n-=h,e+=r[o]+" ")}s<i.length-1&&(e+="\n")}return e},e.Text.prototype.updateFont=function(t){var e=this.componentsToFont(t);this.style.font!==e&&(this.style.font=e,this.dirty=!0,this.parent&&this.updateTransform())},e.Text.prototype.fontToComponents=function(t){var e=t.match(/^\s*(?:\b(normal|italic|oblique|inherit)?\b)\s*(?:\b(normal|small-caps|inherit)?\b)\s*(?:\b(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit)?\b)\s*(?:\b(xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller|0|\d*(?:[.]\d*)?(?:%|[a-z]{2,5}))?\b)\s*(.*)\s*$/);if(e){var i=e[5].trim();return/^(?:inherit|serif|sans-serif|cursive|fantasy|monospace)$/.exec(i)||/['",]/.exec(i)||(i="'"+i+"'"),{font:t,fontStyle:e[1]||"normal",fontVariant:e[2]||"normal",fontWeight:e[3]||"normal",fontSize:e[4]||"medium",fontFamily:i}}return console.warn("Phaser.Text - unparsable CSS font: "+t),{font:t}},e.Text.prototype.componentsToFont=function(t){var e,i=[];return(e=t.fontStyle)&&"normal"!==e&&i.push(e),(e=t.fontVariant)&&"normal"!==e&&i.push(e),(e=t.fontWeight)&&"normal"!==e&&i.push(e),(e=t.fontSize)&&"medium"!==e&&i.push(e),(e=t.fontFamily)&&i.push(e),i.length||i.push(t.font),i.join(" ")},e.Text.prototype.setText=function(t,e){return void 0===e&&(e=!1),(t=t.toString()||"")===this._text?this:(this.text=t,e?this.updateText():this.dirty=!0,this)},e.Text.prototype.parseList=function(t){if(!Array.isArray(t))return this;for(var e="",i=0;i<t.length;i++)Array.isArray(t[i])?(e+=t[i].join("\t"),i<t.length-1&&(e+="\n")):(e+=t[i],i<t.length-1&&(e+="\t"));return this.text=e,this.dirty=!0,this},e.Text.prototype.setTextBounds=function(t,i,s,n){return void 0===t?this.textBounds=null:(this.textBounds?this.textBounds.setTo(t,i,s,n):this.textBounds=new e.Rectangle(t,i,s,n),this.style.wordWrapWidth>s&&(this.style.wordWrapWidth=s)),this.updateTexture(),this},e.Text.prototype.updateTexture=function(){var t=this.texture.baseTexture,e=this.texture.crop,i=this.texture.frame,s=this.canvas.width,n=this.canvas.height;if(t.width=s,t.height=n,e.width=s,e.height=n,i.width=s,i.height=n,this.texture.width=s,this.texture.height=n,this._width=s,this._height=n,this.textBounds){var r=this.textBounds.x,o=this.textBounds.y;"right"===this.style.boundsAlignH?r+=this.textBounds.width-this.canvas.width/this.resolution:"center"===this.style.boundsAlignH&&(r+=this.textBounds.halfWidth-this.canvas.width/this.resolution/2),"bottom"===this.style.boundsAlignV?o+=this.textBounds.height-this.canvas.height/this.resolution:"middle"===this.style.boundsAlignV&&(o+=this.textBounds.halfHeight-this.canvas.height/this.resolution/2),this.pivot.x=-r,this.pivot.y=-o}this.renderable=0!==s&&0!==n,this.texture.requiresReTint=!0,this.texture.baseTexture.dirty()},e.Text.prototype._renderWebGL=function(t){this.dirty&&(this.updateText(),this.dirty=!1),PIXI.Sprite.prototype._renderWebGL.call(this,t)},e.Text.prototype._renderCanvas=function(t){this.dirty&&(this.updateText(),this.dirty=!1),PIXI.Sprite.prototype._renderCanvas.call(this,t)},e.Text.prototype.determineFontProperties=function(t){var i=e.Text.fontPropertiesCache[t],s=this.testString||"|MÉq";if(!i){i={};var n=e.Text.fontPropertiesCanvas,r=e.Text.fontPropertiesContext;r.font=t;var o=Math.ceil(r.measureText(s).width),a=Math.ceil(r.measureText(s).width),h=2*a;if(a=1.4*a|0,n.width=o,n.height=h,r.fillStyle="#f00",r.fillRect(0,0,o,h),r.font=t,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(s,0,a),!r.getImageData(0,0,o,h))return i.ascent=a,i.descent=a+6,i.fontSize=i.ascent+i.descent,e.Text.fontPropertiesCache[t]=i,i;var l,c,u=r.getImageData(0,0,o,h).data,d=u.length,p=4*o,f=0,g=!1;for(l=0;l<a;l++){for(c=0;c<p;c+=4)if(255!==u[f+c]){g=!0;break}if(g)break;f+=p}for(i.ascent=a-l,f=d-p,g=!1,l=h;l>a;l--){for(c=0;c<p;c+=4)if(255!==u[f+c]){g=!0;break}if(g)break;f-=p}i.descent=l-a,i.descent+=6,i.fontSize=i.ascent+i.descent,e.Text.fontPropertiesCache[t]=i}return i},e.Text.prototype.getBounds=function(t){return this.dirty&&(this.updateText(),this.dirty=!1),PIXI.Sprite.prototype.getBounds.call(this,t)},e.Text.prototype.setCharacterLimit=function(t,e){this.characterLimitSuffix=void 0===e?"":e,this.characterLimitSize=t,this.updateText()},Object.defineProperty(e.Text.prototype,"text",{get:function(){return this._text},set:function(t){t!==this._text&&(this._text=t.toString()||"",this.dirty=!0,this.parent&&this.updateTransform())}}),Object.defineProperty(e.Text.prototype,"cssFont",{get:function(){return this.componentsToFont(this._fontComponents)},set:function(t){t=t||"bold 20pt Arial",this._fontComponents=this.fontToComponents(t),this.updateFont(this._fontComponents)}}),Object.defineProperty(e.Text.prototype,"font",{get:function(){return this._fontComponents.fontFamily},set:function(t){t=(t=t||"Arial").trim(),/^(?:inherit|serif|sans-serif|cursive|fantasy|monospace)$/.exec(t)||/['",]/.exec(t)||(t="'"+t+"'"),this._fontComponents.fontFamily=t,this.updateFont(this._fontComponents)}}),Object.defineProperty(e.Text.prototype,"fontSize",{get:function(){var t=this._fontComponents.fontSize;return t&&/(?:^0$|px$)/.exec(t)?parseInt(t,10):t},set:function(t){"number"==typeof(t=t||"0")&&(t+="px"),this._fontComponents.fontSize=t,this.updateFont(this._fontComponents)}}),Object.defineProperty(e.Text.prototype,"fontWeight",{get:function(){return this._fontComponents.fontWeight||"normal"},set:function(t){t=t||"normal",this._fontComponents.fontWeight=t,this.updateFont(this._fontComponents)}}),Object.defineProperty(e.Text.prototype,"fontStyle",{get:function(){return this._fontComponents.fontStyle||"normal"},set:function(t){t=t||"normal",this._fontComponents.fontStyle=t,this.updateFont(this._fontComponents)}}),Object.defineProperty(e.Text.prototype,"fontVariant",{get:function(){return this._fontComponents.fontVariant||"normal"},set:function(t){t=t||"normal",this._fontComponents.fontVariant=t,this.updateFont(this._fontComponents)}}),Object.defineProperty(e.Text.prototype,"fill",{get:function(){return this.style.fill},set:function(t){t!==this.style.fill&&(this.style.fill=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"align",{get:function(){return this.style.align},set:function(t){(t=t.toLowerCase())!==this.style.align&&(this.style.align=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"resolution",{get:function(){return this._res},set:function(t){t!==this._res&&(this._res=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"tabs",{get:function(){return this.style.tabs},set:function(t){t!==this.style.tabs&&(this.style.tabs=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"boundsAlignH",{get:function(){return this.style.boundsAlignH},set:function(t){(t=t.toLowerCase())!==this.style.boundsAlignH&&(this.style.boundsAlignH=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"boundsAlignV",{get:function(){return this.style.boundsAlignV},set:function(t){(t=t.toLowerCase())!==this.style.boundsAlignV&&(this.style.boundsAlignV=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"stroke",{get:function(){return this.style.stroke},set:function(t){t!==this.style.stroke&&(this.style.stroke=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"strokeThickness",{get:function(){return this.style.strokeThickness},set:function(t){t!==this.style.strokeThickness&&(this.style.strokeThickness=Number(t),this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"wordWrap",{get:function(){return this.style.wordWrap},set:function(t){t!==this.style.wordWrap&&(this.style.wordWrap=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"wordWrapWidth",{get:function(){return this.style.wordWrapWidth},set:function(t){t!==this.style.wordWrapWidth&&(this.style.wordWrapWidth=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"lineSpacing",{get:function(){return this._lineSpacing},set:function(t){t!==this._lineSpacing&&(this._lineSpacing=parseFloat(t),this.dirty=!0,this.parent&&this.updateTransform())}}),Object.defineProperty(e.Text.prototype,"shadowOffsetX",{get:function(){return this.style.shadowOffsetX},set:function(t){t!==this.style.shadowOffsetX&&(this.style.shadowOffsetX=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"shadowOffsetY",{get:function(){return this.style.shadowOffsetY},set:function(t){t!==this.style.shadowOffsetY&&(this.style.shadowOffsetY=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"shadowColor",{get:function(){return this.style.shadowColor},set:function(t){t!==this.style.shadowColor&&(this.style.shadowColor=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"shadowBlur",{get:function(){return this.style.shadowBlur},set:function(t){t!==this.style.shadowBlur&&(this.style.shadowBlur=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"shadowStroke",{get:function(){return this.style.shadowStroke},set:function(t){t!==this.style.shadowStroke&&(this.style.shadowStroke=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"shadowFill",{get:function(){return this.style.shadowFill},set:function(t){t!==this.style.shadowFill&&(this.style.shadowFill=t,this.dirty=!0)}}),Object.defineProperty(e.Text.prototype,"width",{get:function(){return this.dirty&&(this.updateText(),this.dirty=!1),this.scale.x*(this.texture.frame.width/this.resolution)},set:function(t){this.scale.x=t/this.texture.frame.width,this._width=t}}),Object.defineProperty(e.Text.prototype,"height",{get:function(){return this.dirty&&(this.updateText(),this.dirty=!1),this.scale.y*(this.texture.frame.height/this.resolution)},set:function(t){this.scale.y=t/this.texture.frame.height,this._height=t}}),Object.defineProperty(e.Text.prototype,"testString",{get:function(){return this._testString},set:function(t){this._testString=t,this.updateText()}}),e.Text.fontPropertiesCache={},e.Text.fontPropertiesCanvas=document.createElement("canvas"),e.Text.fontPropertiesContext=e.Text.fontPropertiesCanvas.getContext("2d"),e.BitmapText=function(t,i,s,n,r,o,a){i=i||0,s=s||0,n=n||"",r=r||"",o=o||32,a=a||"left",PIXI.DisplayObjectContainer.call(this),this.type=e.BITMAPTEXT,this.physicsType=e.SPRITE,this.textWidth=0,this.textHeight=0,this.anchor=new e.Point,this._prevAnchor=new e.Point,this._glyphs=[],this._maxWidth=0,this._text=r.toString()||"",this._data=t.cache.getBitmapFont(n),this._font=n,this._fontSize=o,this._align=a,this._tint=16777215,this.updateText(),this.dirty=!1,e.Component.Core.init.call(this,t,i,s,"",null)},e.BitmapText.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),e.BitmapText.prototype.constructor=e.BitmapText,e.Component.Core.install.call(e.BitmapText.prototype,["Angle","AutoCull","Bounds","Destroy","FixedToCamera","InputEnabled","InWorld","LifeSpan","PhysicsBody","Reset"]),e.BitmapText.prototype.preUpdatePhysics=e.Component.PhysicsBody.preUpdate,e.BitmapText.prototype.preUpdateLifeSpan=e.Component.LifeSpan.preUpdate,e.BitmapText.prototype.preUpdateInWorld=e.Component.InWorld.preUpdate,e.BitmapText.prototype.preUpdateCore=e.Component.Core.preUpdate,e.BitmapText.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},e.BitmapText.prototype.postUpdate=function(){e.Component.PhysicsBody.postUpdate.call(this),e.Component.FixedToCamera.postUpdate.call(this),this.body&&this.body.type===e.Physics.ARCADE&&(this.textWidth===this.body.sourceWidth&&this.textHeight===this.body.sourceHeight||this.body.setSize(this.textWidth,this.textHeight))},e.BitmapText.prototype.setText=function(t){this.text=t},e.BitmapText.prototype.scanLine=function(t,e,i){for(var s=0,n=0,r=-1,o=0,a=null,h=this._maxWidth>0?this._maxWidth:null,l=[],c=0;c<i.length;c++){var u=c===i.length-1;if(/(?:\r\n|\r|\n)/.test(i.charAt(c)))return{width:n,text:i.substr(0,c),end:u,chars:l};var d=i.charCodeAt(c),p=t.chars[d],f=0;void 0===p&&(d=32,p=t.chars[d]);var g=a&&p.kerning[a]?p.kerning[a]:0;if(/(\s)/.test(i.charAt(c))&&(r=c,o=n),f=(g+p.texture.width+p.xOffset)*e,h&&n+f>=h&&r>-1)return{width:o||n,text:i.substr(0,c-(c-r)),end:!1,chars:l};n+=(p.xAdvance+g)*e,l.push(s+(p.xOffset+g)*e),s+=(p.xAdvance+g)*e,a=d}return{width:n,text:i,end:u,chars:l}},e.BitmapText.prototype.cleanText=function(t,e){void 0===e&&(e="");var i=this._data.font;if(!i)return"";for(var s=/\r\n|\n\r|\n|\r/g,n=t.replace(s,"\n").split("\n"),r=0;r<n.length;r++){for(var o="",a=n[r],h=0;h<a.length;h++)o=i.chars[a.charCodeAt(h)]?o.concat(a[h]):o.concat(e);n[r]=o}return n.join("\n")},e.BitmapText.prototype.updateText=function(){var t=this._data.font;if(t){var e=this.text,i=this._fontSize/t.size,s=[],n=0;this.textWidth=0;do{(c=this.scanLine(t,i,e)).y=n,s.push(c),c.width>this.textWidth&&(this.textWidth=c.width),n+=t.lineHeight*i,e=e.substr(c.text.length+1)}while(!1===c.end);this.textHeight=n;for(var r=0,o=0,a=this.textWidth*this.anchor.x,h=this.textHeight*this.anchor.y,l=0;l<s.length;l++){var c=s[l];"right"===this._align?o=this.textWidth-c.width:"center"===this._align&&(o=(this.textWidth-c.width)/2);for(var u=0;u<c.text.length;u++){var d=c.text.charCodeAt(u),p=t.chars[d];void 0===p&&(d=32,p=t.chars[d]);var f=this._glyphs[r];f?f.texture=p.texture:((f=new PIXI.Sprite(p.texture)).name=c.text[u],this._glyphs.push(f)),f.position.x=c.chars[u]+o-a,f.position.y=c.y+p.yOffset*i-h,f.scale.set(i),f.tint=this.tint,f.texture.requiresReTint=!0,f.cachedTint=16777215,f.parent||this.addChild(f),r++}}for(l=r;l<this._glyphs.length;l++)this.removeChild(this._glyphs[l])}},e.BitmapText.prototype.purgeGlyphs=function(){for(var t=this._glyphs.length,e=[],i=0;i<this._glyphs.length;i++)this._glyphs[i].parent!==this?this._glyphs[i].destroy():e.push(this._glyphs[i]);return this._glyphs=[],this._glyphs=e,this.updateText(),t-e.length},e.BitmapText.prototype.updateTransform=function(){!this.dirty&&this.anchor.equals(this._prevAnchor)||(this.updateText(),this.dirty=!1,this._prevAnchor.copyFrom(this.anchor)),PIXI.DisplayObjectContainer.prototype.updateTransform.call(this)},Object.defineProperty(e.BitmapText.prototype,"align",{get:function(){return this._align},set:function(t){t===this._align||"left"!==t&&"center"!==t&&"right"!==t||(this._align=t,this.updateText())}}),Object.defineProperty(e.BitmapText.prototype,"tint",{get:function(){return this._tint},set:function(t){t!==this._tint&&(this._tint=t,this.updateText())}}),Object.defineProperty(e.BitmapText.prototype,"font",{get:function(){return this._font},set:function(t){t!==this._font&&(this._font=t.trim(),this._data=this.game.cache.getBitmapFont(this._font),this.updateText())}}),Object.defineProperty(e.BitmapText.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){(t=parseInt(t,10))!==this._fontSize&&t>0&&(this._fontSize=t,this.updateText())}}),Object.defineProperty(e.BitmapText.prototype,"text",{get:function(){return this._text},set:function(t){t!==this._text&&(this._text=t.toString()||"",this.updateText())}}),Object.defineProperty(e.BitmapText.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){t!==this._maxWidth&&(this._maxWidth=t,this.updateText())}}),Object.defineProperty(e.BitmapText.prototype,"smoothed",{get:function(){return!this._data.base.scaleMode},set:function(t){this._data.base.scaleMode=t?0:1,this._data.base.dirty()}}),e.RetroFont=function(t,i,s,n,r,o,a,h,l,c){if(!t.cache.checkImageKey(i))return!1;void 0!==o&&null!==o||(o=t.cache.getImage(i).width/s),this.characterWidth=s,this.characterHeight=n,this.characterSpacingX=a||0,this.characterSpacingY=h||0,this.characterPerRow=o,this.offsetX=l||0,this.offsetY=c||0,this.align="left",this.multiLine=!1,this.autoUpperCase=!0,this.customSpacingX=0,this.customSpacingY=0,this.fixedWidth=0,this.fontSet=t.cache.getImage(i),this._text="",this.grabData=[],this.frameData=new e.FrameData;for(var u=this.offsetX,d=this.offsetY,p=0,f=0;f<r.length;f++){var g=this.frameData.addFrame(new e.Frame(f,u,d,this.characterWidth,this.characterHeight));this.grabData[r.charCodeAt(f)]=g.index,++p===this.characterPerRow?(p=0,u=this.offsetX,d+=this.characterHeight+this.characterSpacingY):u+=this.characterWidth+this.characterSpacingX}t.cache.updateFrameData(i,this.frameData),this.stamp=new e.Image(t,0,0,i,0),e.RenderTexture.call(this,t,100,100,"",e.scaleModes.NEAREST),this.type=e.RETROFONT},e.RetroFont.prototype=Object.create(e.RenderTexture.prototype),e.RetroFont.prototype.constructor=e.RetroFont,e.RetroFont.ALIGN_LEFT="left",e.RetroFont.ALIGN_RIGHT="right",e.RetroFont.ALIGN_CENTER="center",e.RetroFont.TEXT_SET1=" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",e.RetroFont.TEXT_SET2=" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",e.RetroFont.TEXT_SET3="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",e.RetroFont.TEXT_SET4="ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",e.RetroFont.TEXT_SET5="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",e.RetroFont.TEXT_SET6="ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",e.RetroFont.TEXT_SET7="AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",e.RetroFont.TEXT_SET8="0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",e.RetroFont.TEXT_SET9="ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",e.RetroFont.TEXT_SET10="ABCDEFGHIJKLMNOPQRSTUVWXYZ",e.RetroFont.TEXT_SET11="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789",e.RetroFont.prototype.setFixedWidth=function(t,e){void 0===e&&(e="left"),this.fixedWidth=t,this.align=e},e.RetroFont.prototype.setText=function(t,e,i,s,n,r){this.multiLine=e||!1,this.customSpacingX=i||0,this.customSpacingY=s||0,this.align=n||"left",this.autoUpperCase=!r,t.length>0&&(this.text=t)},e.RetroFont.prototype.buildRetroFontText=function(){var t=0,i=0;if(this.clear(),this.multiLine){var s=this._text.split("\n");this.fixedWidth>0?this.resize(this.fixedWidth,s.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY,!0):this.resize(this.getLongestLine()*(this.characterWidth+this.customSpacingX),s.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY,!0);for(var n=0;n<s.length;n++)t=0,this.align===e.RetroFont.ALIGN_RIGHT?t=this.width-s[n].length*(this.characterWidth+this.customSpacingX):this.align===e.RetroFont.ALIGN_CENTER&&(t=this.width/2-s[n].length*(this.characterWidth+this.customSpacingX)/2,t+=this.customSpacingX/2),t<0&&(t=0),this.pasteLine(s[n],t,i,this.customSpacingX),i+=this.characterHeight+this.customSpacingY}else this.fixedWidth>0?this.resize(this.fixedWidth,this.characterHeight,!0):this.resize(this._text.length*(this.characterWidth+this.customSpacingX),this.characterHeight,!0),t=0,this.align===e.RetroFont.ALIGN_RIGHT?t=this.width-this._text.length*(this.characterWidth+this.customSpacingX):this.align===e.RetroFont.ALIGN_CENTER&&(t=this.width/2-this._text.length*(this.characterWidth+this.customSpacingX)/2,t+=this.customSpacingX/2),t<0&&(t=0),this.pasteLine(this._text,t,0,this.customSpacingX);this.requiresReTint=!0},e.RetroFont.prototype.pasteLine=function(t,e,i,s){for(var n=0;n<t.length;n++)if(" "===t.charAt(n))e+=this.characterWidth+s;else if(this.grabData[t.charCodeAt(n)]>=0&&(this.stamp.frame=this.grabData[t.charCodeAt(n)],this.renderXY(this.stamp,e,i,!1),(e+=this.characterWidth+s)>this.width))break},e.RetroFont.prototype.getLongestLine=function(){var t=0;if(this._text.length>0)for(var e=this._text.split("\n"),i=0;i<e.length;i++)e[i].length>t&&(t=e[i].length);return t},e.RetroFont.prototype.removeUnsupportedCharacters=function(t){for(var e="",i=0;i<this._text.length;i++){var s=this._text[i],n=s.charCodeAt(0);(this.grabData[n]>=0||!t&&"\n"===s)&&(e=e.concat(s))}return e},e.RetroFont.prototype.updateOffset=function(t,e){if(this.offsetX!==t||this.offsetY!==e){for(var i=t-this.offsetX,s=e-this.offsetY,n=this.game.cache.getFrameData(this.stamp.key).getFrames(),r=n.length;r--;)n[r].x+=i,n[r].y+=s;this.buildRetroFontText()}},Object.defineProperty(e.RetroFont.prototype,"text",{get:function(){return this._text},set:function(t){var e;(e=this.autoUpperCase?t.toUpperCase():t)!==this._text&&(this._text=e,this.removeUnsupportedCharacters(this.multiLine),this.buildRetroFontText())}}),Object.defineProperty(e.RetroFont.prototype,"smoothed",{get:function(){return this.stamp.smoothed},set:function(t){this.stamp.smoothed=t,this.buildRetroFontText()}}),e.Rope=function(t,i,s,n,r,o){this.points=o||[],this._hasUpdateAnimation=!1,this._updateAnimationCallback=null,i=i||0,s=s||0,n=n||null,r=r||null,this.type=e.ROPE,PIXI.DisplayObjectContainer.call(this),this.texture=e.Cache.DEFAULT,this.uvs=new Float32Array([0,1,1,1,1,0,0,1]),this.vertices=new Float32Array([0,0,100,0,100,100,0,100]),this.colors=new Float32Array([1,1,1,1]),this.indices=new Uint16Array([0,1,2,3]),o&&(this.vertices=new Float32Array(4*o.length),this.uvs=new Float32Array(4*o.length),this.colors=new Float32Array(2*o.length),this.indices=new Uint16Array(2*o.length)),this.dirty=!0,this.canvasPadding=0,this.drawMode=e.Rope.TRIANGLE_STRIP,e.Component.Core.init.call(this,t,i,s,n,r),this.refresh()},e.Rope.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),e.Rope.prototype.constructor=e.Rope,e.Component.Core.install.call(e.Rope.prototype,["Angle","Animation","AutoCull","Bounds","BringToTop","Crop","Delta","Destroy","FixedToCamera","InWorld","LifeSpan","LoadTexture","Overlap","PhysicsBody","Reset","ScaleMinMax","Smoothed"]),e.Rope.prototype.preUpdatePhysics=e.Component.PhysicsBody.preUpdate,e.Rope.prototype.preUpdateLifeSpan=e.Component.LifeSpan.preUpdate,e.Rope.prototype.preUpdateInWorld=e.Component.InWorld.preUpdate,e.Rope.prototype.preUpdateCore=e.Component.Core.preUpdate,e.Rope.TRIANGLE_STRIP=0,e.Rope.TRIANGLES=1,e.Rope.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},e.Rope.prototype.update=function(){this._hasUpdateAnimation&&this.updateAnimation.call(this)},e.Rope.prototype.reset=function(t,i){return e.Component.Reset.prototype.reset.call(this,t,i),this},e.Rope.prototype.refresh=function(){var t=this.points;if(!(t.length<1)){var e=this.uvs,i=this.indices,s=this.colors;this.count-=.2,e[0]=0,e[1]=0,e[2]=0,e[3]=1,s[0]=1,s[1]=1,i[0]=0,i[1]=1;for(var n,r,o=t.length,a=1;a<o;a++)r=a/(o-1),e[n=4*a]=r,e[n+1]=0,e[n+2]=r,e[n+3]=1,s[n=2*a]=1,s[n+1]=1,i[n=2*a]=n,i[n+1]=n+1}},e.Rope.prototype.updateTransform=function(){var t=this.points;if(!(t.length<1)){var e,i=t[0],s={x:0,y:0};this.count-=.2;for(var n,r,o,a,h=this.vertices,l=t.length,c=0;c<l;c++)n=t[c],r=4*c,e=c<t.length-1?t[c+1]:n,s.y=-(e.x-i.x),s.x=e.y-i.y,10*(1-c/(l-1))>1&&1,o=Math.sqrt(s.x*s.x+s.y*s.y),a=this.texture.height/2,s.x/=o,s.y/=o,s.x*=a,s.y*=a,h[r]=n.x+s.x,h[r+1]=n.y+s.y,h[r+2]=n.x-s.x,h[r+3]=n.y-s.y,i=n;PIXI.DisplayObjectContainer.prototype.updateTransform.call(this)}},e.Rope.prototype.setTexture=function(t){this.texture=t},e.Rope.prototype._renderWebGL=function(t){!this.visible||this.alpha<=0||(t.spriteBatch.stop(),this._vertexBuffer||this._initWebGL(t),t.shaderManager.setShader(t.shaderManager.stripShader),this._renderStrip(t),t.spriteBatch.start())},e.Rope.prototype._initWebGL=function(t){var e=t.gl;this._vertexBuffer=e.createBuffer(),this._indexBuffer=e.createBuffer(),this._uvBuffer=e.createBuffer(),this._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertices,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this._uvBuffer),e.bufferData(e.ARRAY_BUFFER,this.uvs,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this._colorBuffer),e.bufferData(e.ARRAY_BUFFER,this.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,e.STATIC_DRAW)},e.Rope.prototype._renderStrip=function(t){var i=t.gl,s=t.projection,n=t.offset,r=t.shaderManager.stripShader,o=this.drawMode===e.Rope.TRIANGLE_STRIP?i.TRIANGLE_STRIP:i.TRIANGLES;t.blendModeManager.setBlendMode(this.blendMode),i.uniformMatrix3fv(r.translationMatrix,!1,this.worldTransform.toArray(!0)),i.uniform2f(r.projectionVector,s.x,-s.y),i.uniform2f(r.offsetVector,-n.x,-n.y),i.uniform1f(r.alpha,this.worldAlpha),this.dirty?(this.dirty=!1,i.bindBuffer(i.ARRAY_BUFFER,this._vertexBuffer),i.bufferData(i.ARRAY_BUFFER,this.vertices,i.STATIC_DRAW),i.vertexAttribPointer(r.aVertexPosition,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,this._uvBuffer),i.bufferData(i.ARRAY_BUFFER,this.uvs,i.STATIC_DRAW),i.vertexAttribPointer(r.aTextureCoord,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),this.texture.baseTexture._dirty[i.id]?t.renderer.updateTexture(this.texture.baseTexture):i.bindTexture(i.TEXTURE_2D,this.texture.baseTexture._glTextures[i.id]),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,this._indexBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,this.indices,i.STATIC_DRAW)):(i.bindBuffer(i.ARRAY_BUFFER,this._vertexBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,this.vertices),i.vertexAttribPointer(r.aVertexPosition,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,this._uvBuffer),i.vertexAttribPointer(r.aTextureCoord,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),this.texture.baseTexture._dirty[i.id]?t.renderer.updateTexture(this.texture.baseTexture):i.bindTexture(i.TEXTURE_2D,this.texture.baseTexture._glTextures[i.id]),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,this._indexBuffer)),i.drawElements(o,this.indices.length,i.UNSIGNED_SHORT,0)},e.Rope.prototype._renderCanvas=function(t){var i=t.context,s=this.worldTransform,n=s.tx*t.resolution+t.shakeX,r=s.ty*t.resolution+t.shakeY;t.roundPixels?i.setTransform(s.a,s.b,s.c,s.d,0|n,0|r):i.setTransform(s.a,s.b,s.c,s.d,n,r),this.drawMode===e.Rope.TRIANGLE_STRIP?this._renderCanvasTriangleStrip(i):this._renderCanvasTriangles(i)},e.Rope.prototype._renderCanvasTriangleStrip=function(t){var e=this.vertices,i=this.uvs,s=e.length/2;this.count++;for(var n=0;n<s-2;n++){var r=2*n;this._renderCanvasDrawTriangle(t,e,i,r,r+2,r+4)}},e.Rope.prototype._renderCanvasTriangles=function(t){var e=this.vertices,i=this.uvs,s=this.indices,n=s.length;this.count++;for(var r=0;r<n;r+=3){var o=2*s[r],a=2*s[r+1],h=2*s[r+2];this._renderCanvasDrawTriangle(t,e,i,o,a,h)}},e.Rope.prototype._renderCanvasDrawTriangle=function(t,e,i,s,n,r){var o=this.texture.baseTexture.source,a=this.texture.width,h=this.texture.height,l=e[s],c=e[n],u=e[r],d=e[s+1],p=e[n+1],f=e[r+1],g=i[s]*a,m=i[n]*a,y=i[r]*a,v=i[s+1]*h,x=i[n+1]*h,b=i[r+1]*h;if(this.canvasPadding>0){var _=this.canvasPadding/this.worldTransform.a,w=this.canvasPadding/this.worldTransform.d,T=(l+c+u)/3,P=(d+p+f)/3,C=l-T,S=d-P,A=Math.sqrt(C*C+S*S);l=T+C/A*(A+_),d=P+S/A*(A+w),S=p-P,c=T+(C=c-T)/(A=Math.sqrt(C*C+S*S))*(A+_),p=P+S/A*(A+w),S=f-P,u=T+(C=u-T)/(A=Math.sqrt(C*C+S*S))*(A+_),f=P+S/A*(A+w)}t.save(),t.beginPath(),t.moveTo(l,d),t.lineTo(c,p),t.lineTo(u,f),t.closePath(),t.clip();var E=g*x+v*y+m*b-x*y-v*m-g*b,M=l*x+v*u+c*b-x*u-v*c-l*b,R=g*c+l*y+m*u-c*y-l*m-g*u,L=g*x*u+v*c*y+l*m*b-l*x*y-v*m*u-g*c*b,B=d*x+v*f+p*b-x*f-v*p-d*b,I=g*p+d*y+m*f-p*y-d*m-g*f,O=g*x*f+v*p*y+d*m*b-d*x*y-v*m*f-g*p*b;t.transform(M/E,B/E,R/E,I/E,L/E,O/E),t.drawImage(o,0,0),t.restore()},e.Rope.prototype.renderStripFlat=function(t){var e=this.context,i=t.vertices,s=i.length/2;this.count++,e.beginPath();for(var n=1;n<s-2;n++){var r=2*n,o=i[r],a=i[r+2],h=i[r+4],l=i[r+1],c=i[r+3],u=i[r+5];e.moveTo(o,l),e.lineTo(a,c),e.lineTo(h,u)}e.fillStyle="#FF0000",e.fill(),e.closePath()},e.Rope.prototype.getBounds=function(t){for(var i=t||this.worldTransform,s=i.a,n=i.b,r=i.c,o=i.d,a=i.tx,h=i.ty,l=-1/0,c=-1/0,u=1/0,d=1/0,p=this.vertices,f=0;f<p.length;f+=2){var g=p[f],m=p[f+1],y=s*g+r*m+a,v=o*m+n*g+h;u=y<u?y:u,d=v<d?v:d,l=y>l?y:l,c=v>c?v:c}if(u===-1/0||c===1/0)return e.EmptyRectangle;var x=this._bounds;return x.x=u,x.width=l-u,x.y=d,x.height=c-d,this._currentBounds=x,x},Object.defineProperty(e.Rope.prototype,"updateAnimation",{get:function(){return this._updateAnimation},set:function(t){t&&"function"==typeof t?(this._hasUpdateAnimation=!0,this._updateAnimation=t):(this._hasUpdateAnimation=!1,this._updateAnimation=null)}}),Object.defineProperty(e.Rope.prototype,"segments",{get:function(){for(var t,i,s,n,r,o,a,h,l=[],c=0;c<this.points.length;c++)t=4*c,i=this.vertices[t]*this.scale.x,s=this.vertices[t+1]*this.scale.y,n=this.vertices[t+4]*this.scale.x,r=this.vertices[t+3]*this.scale.y,o=e.Math.difference(i,n),a=e.Math.difference(s,r),i+=this.world.x,s+=this.world.y,h=new e.Rectangle(i,s,o,a),l.push(h);return l}}),e.TileSprite=function(t,i,s,n,r,o,a){i=i||0,s=s||0,n=n||256,r=r||256,o=o||null,a=a||null,PIXI.Sprite.call(this,new PIXI.Texture(e.Cache.DEFAULT.baseTexture),n,r),this.type=e.TILESPRITE,this.physicsType=e.SPRITE,this._scroll=new e.Point,this.tileScale=new e.Point(1,1),this.tileScaleOffset=new e.Point(1,1),this.tilePosition=new e.Point,this.textureDebug=!1,this.canvasBuffer=null,this.tilingTexture=null,this.tilePattern=null,this.refreshTexture=!0,this.frameWidth=0,this.frameHeight=0,this._width=n,this._height=r,e.Component.Core.init.call(this,t,i,s,o,a)},e.TileSprite.prototype=Object.create(PIXI.Sprite.prototype),e.TileSprite.prototype.constructor=e.TileSprite,e.Component.Core.install.call(e.TileSprite.prototype,["Angle","Animation","AutoCull","Bounds","BringToTop","Destroy","FixedToCamera","Health","InCamera","InputEnabled","InWorld","LifeSpan","LoadTexture","Overlap","PhysicsBody","Reset","Smoothed"]),e.TileSprite.prototype.preUpdatePhysics=e.Component.PhysicsBody.preUpdate,e.TileSprite.prototype.preUpdateLifeSpan=e.Component.LifeSpan.preUpdate,e.TileSprite.prototype.preUpdateInWorld=e.Component.InWorld.preUpdate,e.TileSprite.prototype.preUpdateCore=e.Component.Core.preUpdate,e.TileSprite.prototype.preUpdate=function(){return 0!==this._scroll.x&&(this.tilePosition.x+=this._scroll.x*this.game.time.physicsElapsed),0!==this._scroll.y&&(this.tilePosition.y+=this._scroll.y*this.game.time.physicsElapsed),!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},e.TileSprite.prototype.autoScroll=function(t,e){return this._scroll.set(t,e),this},e.TileSprite.prototype.stopScroll=function(){return this._scroll.set(0,0),this},e.TileSprite.prototype.destroy=function(t){e.Component.Destroy.prototype.destroy.call(this,t),PIXI.Sprite.prototype.destroy.call(this),this.canvasBuffer&&(this.canvasBuffer.destroy(),this.canvasBuffer=null),this.tileScale=null,this.tileScaleOffset=null,this.tilePosition=null,this.tilingTexture&&(this.tilingTexture.destroy(!0),this.tilingTexture=null)},e.TileSprite.prototype.reset=function(t,i){return e.Component.Reset.prototype.reset.call(this,t,i),this.tilePosition.x=0,this.tilePosition.y=0,this},e.TileSprite.prototype.setTexture=function(t){return this.texture!==t&&(this.texture=t,this.refreshTexture=!0,this.cachedTint=16777215),this},e.TileSprite.prototype._renderWebGL=function(t){if(this.visible&&this.renderable&&0!==this.alpha){if(this._mask&&(t.spriteBatch.stop(),t.maskManager.pushMask(this.mask,t),t.spriteBatch.start()),this._filters&&(t.spriteBatch.flush(),t.filterManager.pushFilter(this._filterBlock)),this.refreshTexture){if(this.generateTilingTexture(!0,t),!this.tilingTexture)return;this.tilingTexture.needsUpdate&&(this.tilingTexture.baseTexture.textureIndex=this.texture.baseTexture.textureIndex,t.renderer.updateTexture(this.tilingTexture.baseTexture),this.tilingTexture.needsUpdate=!1)}t.spriteBatch.renderTilingSprite(this);for(var e=0;e<this.children.length;e++)this.children[e]._renderWebGL(t);var i=!1;this._filters&&(i=!0,t.spriteBatch.stop(),t.filterManager.popFilter()),this._mask&&(i||t.spriteBatch.stop(),t.maskManager.popMask(this._mask,t)),i&&t.spriteBatch.start()}},e.TileSprite.prototype._renderCanvas=function(t){if(this.visible&&this.renderable&&0!==this.alpha){var e=t.context;this._mask&&t.maskManager.pushMask(this._mask,t),e.globalAlpha=this.worldAlpha;var i=this.worldTransform,s=t.resolution,n=i.tx*s+t.shakeX,r=i.ty*s+t.shakeY;if(e.setTransform(i.a*s,i.b*s,i.c*s,i.d*s,n,r),16777215===this.tint||!this.texture.requiresReTint&&this.cachedTint===this.tint||(this.tintedTexture=PIXI.CanvasTinter.getTintedTexture(this,this.tint),this.cachedTint=this.tint,this.texture.requiresReTint=!1,this.refreshTexture=!0),this.refreshTexture){if(this.generateTilingTexture(!1,t),!this.tilingTexture)return;this.tilePattern=e.createPattern(this.tilingTexture.baseTexture.source,"repeat")}var o=t.currentBlendMode;this.blendMode!==t.currentBlendMode&&(t.currentBlendMode=this.blendMode,e.globalCompositeOperation=PIXI.blendModesCanvas[t.currentBlendMode]);var a=this.tilePosition,h=this.tileScale;a.x%=this.tilingTexture.baseTexture.width,a.y%=this.tilingTexture.baseTexture.height,e.scale(h.x,h.y),e.translate(a.x+this.anchor.x*-this._width,a.y+this.anchor.y*-this._height),e.fillStyle=this.tilePattern,n=-a.x,r=-a.y;var l=this._width/h.x,c=this._height/h.y;t.roundPixels&&(n|=0,r|=0,l|=0,c|=0),e.fillRect(n,r,l,c),e.scale(1/h.x,1/h.y),e.translate(-a.x+this.anchor.x*this._width,-a.y+this.anchor.y*this._height),this._mask&&t.maskManager.popMask(t);for(var u=0;u<this.children.length;u++)this.children[u]._renderCanvas(t);o!==this.blendMode&&(t.currentBlendMode=o,e.globalCompositeOperation=PIXI.blendModesCanvas[o])}},e.TileSprite.prototype.onTextureUpdate=function(){},e.TileSprite.prototype.generateTilingTexture=function(t){if(this.texture.baseTexture.hasLoaded){var i=this.texture,s=i.frame,n=this._frame.sourceSizeW||this._frame.width,r=this._frame.sourceSizeH||this._frame.height,o=0,a=0;this._frame.trimmed&&(o=this._frame.spriteSourceSizeX,a=this._frame.spriteSourceSizeY),t&&(n=e.Math.getNextPowerOfTwo(n),r=e.Math.getNextPowerOfTwo(r)),this.canvasBuffer?(this.canvasBuffer.resize(n,r),this.tilingTexture.baseTexture.width=n,this.tilingTexture.baseTexture.height=r,this.tilingTexture.needsUpdate=!0):(this.canvasBuffer=new PIXI.CanvasBuffer(n,r),this.tilingTexture=PIXI.Texture.fromCanvas(this.canvasBuffer.canvas),this.tilingTexture.isTiling=!0,this.tilingTexture.needsUpdate=!0),this.textureDebug&&(this.canvasBuffer.context.strokeStyle="#00ff00",this.canvasBuffer.context.strokeRect(0,0,n,r));var h=i.crop.width,l=i.crop.height;h===n&&l===r||(h=n,l=r);var c=this.tintedTexture?this.tintedTexture:i.baseTexture.source;this.canvasBuffer.context.drawImage(c,i.crop.x,i.crop.y,i.crop.width,i.crop.height,o,a,h,l),this.tileScaleOffset.x=s.width/n,this.tileScaleOffset.y=s.height/r,this.refreshTexture=!1,this.tilingTexture.baseTexture._powerOf2=!0}},e.TileSprite.prototype.getBounds=function(){var t=this._width,e=this._height,i=t*(1-this.anchor.x),s=t*-this.anchor.x,n=e*(1-this.anchor.y),r=e*-this.anchor.y,o=this.worldTransform,a=o.a,h=o.b,l=o.c,c=o.d,u=o.tx,d=o.ty,p=a*s+l*r+u,f=c*r+h*s+d,g=a*i+l*r+u,m=c*r+h*i+d,y=a*i+l*n+u,v=c*n+h*i+d,x=a*s+l*n+u,b=c*n+h*s+d,_=-1/0,w=-1/0,T=1/0,P=1/0;T=x<(T=y<(T=g<(T=p<T?p:T)?g:T)?y:T)?x:T,P=b<(P=v<(P=m<(P=f<P?f:P)?m:P)?v:P)?b:P,_=x>(_=y>(_=g>(_=p>_?p:_)?g:_)?y:_)?x:_,w=b>(w=v>(w=m>(w=f>w?f:w)?m:w)?v:w)?b:w;var C=this._bounds;return C.x=T,C.width=_-T,C.y=P,C.height=w-P,this._currentBounds=C,C},Object.defineProperty(e.TileSprite.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t}}),Object.defineProperty(e.TileSprite.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t}}),e.CanvasPool={create:function(t,i,s){var n,r=e.CanvasPool.getFirst();if(-1===r){var o={parent:t,canvas:document.createElement("canvas")};e.CanvasPool.pool.push(o),n=o.canvas}else e.CanvasPool.pool[r].parent=t,n=e.CanvasPool.pool[r].canvas;return void 0!==i&&(n.width=i,n.height=s),n},getFirst:function(){for(var t=e.CanvasPool.pool,i=0;i<t.length;i++)if(!t[i].parent)return i;return-1},remove:function(t){for(var i=e.CanvasPool.pool,s=0;s<i.length;s++)i[s].parent===t&&(i[s].parent=null,i[s].canvas.width=1,i[s].canvas.height=1)},removeByCanvas:function(t){for(var i=e.CanvasPool.pool,s=0;s<i.length;s++)i[s].canvas===t&&(i[s].parent=null,i[s].canvas.width=1,i[s].canvas.height=1)},getTotal:function(){for(var t=e.CanvasPool.pool,i=0,s=0;s<t.length;s++)t[s].parent&&i++;return i},getFree:function(){for(var t=e.CanvasPool.pool,i=0,s=0;s<t.length;s++)t[s].parent||i++;return i},log:function(){console.log("CanvasPool: %s used, %s free, %s total",this.getTotal(),this.getFree(),this.pool.length)}},e.CanvasPool.pool=[],Object.defineProperty(e.CanvasPool,"length",{get:function(){return this.pool.length}}),e.Device=function(){this.deviceReadyAt=0,this.initialized=!1,this.desktop=!1,this.iOS=!1,this.iOSVersion=0,this.cocoonJS=!1,this.cocoonJSApp=!1,this.cordova=!1,this.node=!1,this.nodeWebkit=!1,this.electron=!1,this.ejecta=!1,this.crosswalk=!1,this.android=!1,this.chromeOS=!1,this.linux=!1,this.macOS=!1,this.windows=!1,this.windowsPhone=!1,this.canvas=!1,this.canvasBitBltShift=null,this.canHandleAlpha=!1,this.canUseMultiply=!1,this.webGL=!1,this.file=!1,this.fileSystem=!1,this.localStorage=!1,this.worker=!1,this.css3D=!1,this.pointerLock=!1,this.typedArray=!1,this.vibration=!1,this.getUserMedia=!0,this.quirksMode=!1,this.touch=!1,this.mspointer=!1,this.wheelEvent=null,this.arora=!1,this.chrome=!1,this.chromeVersion=0,this.epiphany=!1,this.firefox=!1,this.firefoxVersion=0,this.ie=!1,this.ieVersion=0,this.trident=!1,this.tridentVersion=0,this.edge=!1,this.mobileSafari=!1,this.midori=!1,this.opera=!1,this.safari=!1,this.safariVersion=0,this.webApp=!1,this.silk=!1,this.audioData=!1,this.webAudio=!1,this.ogg=!1,this.opus=!1,this.mp3=!1,this.wav=!1,this.m4a=!1,this.webm=!1,this.dolby=!1,this.oggVideo=!1,this.h264Video=!1,this.mp4Video=!1,this.webmVideo=!1,this.vp9Video=!1,this.hlsVideo=!1,this.iPhone=!1,this.iPhone4=!1,this.iPad=!1,this.pixelRatio=0,this.littleEndian=!1,this.LITTLE_ENDIAN=!1,this.support32bit=!1,this.fullscreen=!1,this.requestFullscreen="",this.cancelFullscreen="",this.fullscreenKeyboard=!1},e.Device=new e.Device,e.Device.onInitialized=new e.Signal,e.Device.whenReady=function(t,e,i){var s=this._readyCheck;if(this.deviceReadyAt||!s)t.call(e,this);else if(s._monitor||i)s._queue=s._queue||[],s._queue.push([t,e]);else{s._monitor=s.bind(this),s._queue=s._queue||[],s._queue.push([t,e]);var n=void 0!==window.cordova,r=navigator.isCocoonJS;"complete"===document.readyState||"interactive"===document.readyState?window.setTimeout(s._monitor,0):n&&!r?document.addEventListener("deviceready",s._monitor,!1):(document.addEventListener("DOMContentLoaded",s._monitor,!1),window.addEventListener("load",s._monitor,!1))}},e.Device._readyCheck=function(){var t=this._readyCheck;if(document.body){if(!this.deviceReadyAt){this.deviceReadyAt=Date.now(),document.removeEventListener("deviceready",t._monitor),document.removeEventListener("DOMContentLoaded",t._monitor),window.removeEventListener("load",t._monitor),this._initialize(),this.initialized=!0,this.onInitialized.dispatch(this);for(var e;e=t._queue.shift();){var i=e[0],s=e[1];i.call(s,this)}this._readyCheck=null,this._initialize=null,this.onInitialized=null}}else window.setTimeout(t._monitor,20)},e.Device._initialize=function(){function t(){var t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t);return e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null}function i(){if(void 0===Uint8ClampedArray)return!1;var t=e.CanvasPool.create(this,1,1).getContext("2d");if(!t)return!1;var i=t.createImageData(1,1);return e.CanvasPool.remove(this),i.data instanceof Uint8ClampedArray}var s=this;!function(){var t=navigator.userAgent;/Playstation Vita/.test(t)?s.vita=!0:/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?s.kindle=!0:/Android/.test(t)?s.android=!0:/CrOS/.test(t)?s.chromeOS=!0:/iP[ao]d|iPhone/i.test(t)?(s.iOS=!0,navigator.appVersion.match(/OS (\d+)/),s.iOSVersion=parseInt(RegExp.$1,10)):/Linux/.test(t)?s.linux=!0:/Mac OS/.test(t)?s.macOS=!0:/Windows/.test(t)&&(s.windows=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(s.android=!1,s.iOS=!1,s.macOS=!1,s.windows=!0,s.windowsPhone=!0);var e=/Silk/.test(t);(s.windows||s.macOS||s.linux&&!e||s.chromeOS)&&(s.desktop=!0),(s.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(s.desktop=!1)}(),function(){var t=navigator.userAgent;if(/Arora/.test(t)?s.arora=!0:/Edge\/\d+/.test(t)?s.edge=!0:/Chrome\/(\d+)/.test(t)&&!s.windowsPhone?(s.chrome=!0,s.chromeVersion=parseInt(RegExp.$1,10)):/Epiphany/.test(t)?s.epiphany=!0:/Firefox\D+(\d+)/.test(t)?(s.firefox=!0,s.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(t)&&s.iOS?s.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(t)?(s.ie=!0,s.ieVersion=parseInt(RegExp.$1,10)):/Midori/.test(t)?s.midori=!0:/Opera/.test(t)?s.opera=!0:/Safari\/(\d+)/.test(t)&&!s.windowsPhone?(s.safari=!0,/Version\/(\d+)\./.test(t)&&(s.safariVersion=parseInt(RegExp.$1,10))):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(t)&&(s.ie=!0,s.trident=!0,s.tridentVersion=parseInt(RegExp.$1,10),s.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(t)&&(s.silk=!0),navigator.standalone&&(s.webApp=!0),void 0!==window.cordova&&(s.cordova=!0),"undefined"!=typeof process&&"undefined"!=typeof require&&(s.node=!0),s.node&&"object"==typeof process.versions&&(s.nodeWebkit=!!process.versions["node-webkit"],s.electron=!!process.versions.electron),navigator.isCocoonJS&&(s.cocoonJS=!0),s.cocoonJS)try{s.cocoonJSApp="undefined"!=typeof CocoonJS}catch(t){s.cocoonJSApp=!1}void 0!==window.ejecta&&(s.ejecta=!0),/Crosswalk/.test(t)&&(s.crosswalk=!0)}(),function(){s.audioData=!!window.Audio,s.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio");try{if(t.canPlayType&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(s.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(s.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(s.mp3=!0),t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(s.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(s.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(s.webm=!0),""!==t.canPlayType('audio/mp4;codecs="ec-3"')))if(s.edge)s.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var e=parseInt(RegExp.$1,10),i=parseInt(RegExp.$2,10);(10===e&&i>=11||e>10)&&(s.dolby=!0)}}catch(t){}}(),function(){var t=document.createElement("video");try{t.canPlayType&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(s.oggVideo=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(s.h264Video=!0,s.mp4Video=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(s.webmVideo=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(s.vp9Video=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(s.hlsVideo=!0))}catch(t){}}(),function(){var t,e=document.createElement("p"),i={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(e,null);for(var n in i)void 0!==e.style[n]&&(e.style[n]="translate3d(1px,1px,1px)",t=window.getComputedStyle(e).getPropertyValue(i[n]));document.body.removeChild(e),s.css3D=void 0!==t&&t.length>0&&"none"!==t}(),s.pixelRatio=window.devicePixelRatio||1,s.iPhone=-1!==navigator.userAgent.toLowerCase().indexOf("iphone"),s.iPhone4=2===s.pixelRatio&&s.iPhone,s.iPad=-1!==navigator.userAgent.toLowerCase().indexOf("ipad"),"undefined"!=typeof Int8Array?s.typedArray=!0:s.typedArray=!1,"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(s.littleEndian=t(),s.LITTLE_ENDIAN=s.littleEndian),s.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==s.littleEndian&&i(),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(s.vibration=!0),function(){s.canvas=!!window.CanvasRenderingContext2D||s.cocoonJS;try{s.localStorage=!!localStorage.getItem}catch(t){s.localStorage=!1}s.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),s.fileSystem=!!window.requestFileSystem,s.webGL=!!window.WebGLRenderingContext,s.worker=!!window.Worker,s.pointerLockElement="pointerLockElement"in document&&"pointerLockElement"||"mozPointerLockElement"in document&&"mozPointerLockElement"||"webkitPointerLockElement"in document&&"webkitPointerLockElement",s.pointerlockchange="onpointerlockchange"in document&&"pointerlockchange"||"onmozpointerlockchange"in document&&"mozpointerlockchange"||"onwebkitpointerlockchange"in document&&"webkitpointerlockchange",s.pointerlockerror="onpointerlockerror"in document&&"pointerlockerror"||"onmozpointerlockerror"in document&&"mozpointerlockerror"||"onwebkitpointerlockerror"in document&&"webkitpointerlockerror",s.pointerLock=!!s.pointerLockElement,s.quirksMode="CSS1Compat"!==document.compatMode,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,s.getUserMedia=s.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(s.getUserMedia=!1),!s.iOS&&(s.ie||s.firefox||s.chrome)&&(s.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(s.canvasBitBltShift=!1)}(),function(){var t=e.CanvasPool.create(this,6,1),i=t.getContext("2d");i.fillStyle="rgba(10, 20, 30, 0.5)",i.fillRect(0,0,1,1);var n=i.getImageData(0,0,1,1);if(n){i.putImageData(n,1,0);var r=i.getImageData(1,0,1,1);s.canHandleAlpha=r.data[0]===n.data[0]&&r.data[1]===n.data[1]&&r.data[2]===n.data[2]&&r.data[3]===n.data[3]}i.globalCompositeOperation="multiply",s.canUseMultiply="multiply"===i.globalCompositeOperation,e.CanvasPool.removeByCanvas(t),PIXI.CanvasTinter.tintMethod=s.canUseMultiply?PIXI.CanvasTinter.tintWithMultiply:PIXI.CanvasTinter.tintWithPerPixel}(),function(){for(var t=["requestFullscreen","requestFullScreen","webkitRequestFullscreen","webkitRequestFullScreen","msRequestFullscreen","msRequestFullScreen","mozRequestFullScreen","mozRequestFullscreen"],e=document.createElement("div"),i=0;i<t.length;i++)if(e[t[i]]){s.fullscreen=!0,s.requestFullscreen=t[i];break}var n=["cancelFullScreen","exitFullscreen","webkitCancelFullScreen","webkitExitFullscreen","msCancelFullScreen","msExitFullscreen","mozCancelFullScreen","mozExitFullscreen"];if(s.fullscreen)for(i=0;i<n.length;i++)if(document[n[i]]){s.cancelFullscreen=n[i];break}window.Element&&Element.ALLOW_KEYBOARD_INPUT&&(s.fullscreenKeyboard=!0)}(),("ontouchstart"in document.documentElement||window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>=1)&&(s.touch=!0),(window.PointerEvent||window.MSPointerEvent||window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&(s.mspointer=!0),s.cocoonJS||("onwheel"in window||s.ie&&"WheelEvent"in window?s.wheelEvent="wheel":"onmousewheel"in window?s.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(s.wheelEvent="DOMMouseScroll"))},e.Device.canPlayAudio=function(t){return!("mp3"!==t||!this.mp3)||(!("ogg"!==t||!this.ogg&&!this.opus)||(!("m4a"!==t||!this.m4a)||(!("opus"!==t||!this.opus)||(!("wav"!==t||!this.wav)||(!("webm"!==t||!this.webm)||!("mp4"!==t||!this.dolby))))))},e.Device.canPlayVideo=function(t){return!("webm"!==t||!this.webmVideo&&!this.vp9Video)||(!("mp4"!==t||!this.mp4Video&&!this.h264Video)||(!("ogg"!==t&&"ogv"!==t||!this.oggVideo)||!("mpeg"!==t||!this.hlsVideo)))},e.Device.needsTouchUnlock=function(){return!!(!this.cocoonJS&&(this.iOS||this.android)||window.PhaserGlobal&&window.PhaserGlobal.fakeiOSTouchLock)},e.Device.isAndroidStockBrowser=function(){var t=window.navigator.userAgent.match(/Android.*AppleWebKit\/([\d.]+)/);return t&&t[1]<537},e.Canvas={create:function(t,i,s,n,r){i=i||256,s=s||256;var o=r?document.createElement("canvas"):e.CanvasPool.create(t,i,s);return"string"==typeof n&&""!==n&&(o.id=n),o.width=i,o.height=s,o.style.display="block",o},setBackgroundColor:function(t,e){return e=e||"rgb(0,0,0)",t.style.backgroundColor=e,t},setTouchAction:function(t,e){return e=e||"none",t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t},setUserSelect:function(t,e){return e=e||"none",t.style["-webkit-touch-callout"]=e,t.style["-webkit-user-select"]=e,t.style["-khtml-user-select"]=e,t.style["-moz-user-select"]=e,t.style["-ms-user-select"]=e,t.style["user-select"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t},addToDOM:function(t,e,i){var s;return void 0===i&&(i=!0),e&&("string"==typeof e?s=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(s=e)),s||(s=document.body),i&&s.style&&(s.style.overflow="hidden"),s.appendChild(t),t},removeFromDOM:function(t){t.parentNode&&t.parentNode.removeChild(t)},setTransform:function(t,e,i,s,n,r,o){return t.setTransform(s,r,o,n,e,i),t},setSmoothingEnabled:function(t,i){var s=e.Canvas.getSmoothingPrefix(t);return s&&(t[s]=i),t},getSmoothingPrefix:function(t){var e=["i","webkitI","msI","mozI","oI"];for(var i in e){var s=e[i]+"mageSmoothingEnabled";if(s in t)return s}return null},getSmoothingEnabled:function(t){var i=e.Canvas.getSmoothingPrefix(t);if(i)return t[i]},setImageRenderingCrisp:function(t){for(var e=["-webkit-optimize-contrast","-moz-crisp-edges","crisp-edges","pixelated"],i=0;i<e.length;i++)t.style["image-rendering"]=e[i];return t.style.msInterpolationMode="nearest-neighbor",t},setImageRenderingBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}},e.RequestAnimationFrame=function(t,e){void 0===e&&(e=!1),this.game=t,this.isRunning=!1,this.forceSetTimeOut=e;for(var i=["ms","moz","webkit","o"],s=0;s<i.length&&!window.requestAnimationFrame;s++)window.requestAnimationFrame=window[i[s]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[i[s]+"CancelAnimationFrame"]||window[i[s]+"CancelRequestAnimationFrame"];this._isSetTimeOut=!1,this._onLoop=null,this._timeOutID=null},e.RequestAnimationFrame.prototype={start:function(){this.isRunning=!0;var t=this;!window.requestAnimationFrame||this.forceSetTimeOut?(this._isSetTimeOut=!0,this._onLoop=function(){return t.updateSetTimeout()},this._timeOutID=window.setTimeout(this._onLoop,0)):(this._isSetTimeOut=!1,this._onLoop=function(e){return t.updateRAF(e)},this._timeOutID=window.requestAnimationFrame(this._onLoop))},updateRAF:function(t){this.isRunning&&(this.game.update(Math.floor(t)),this._timeOutID=window.requestAnimationFrame(this._onLoop))},updateSetTimeout:function(){this.isRunning&&(this.game.update(Date.now()),this._timeOutID=window.setTimeout(this._onLoop,this.game.time.timeToCall))},stop:function(){this._isSetTimeOut?clearTimeout(this._timeOutID):window.cancelAnimationFrame(this._timeOutID),this.isRunning=!1},isSetTimeOut:function(){return this._isSetTimeOut},isRAF:function(){return!1===this._isSetTimeOut}},e.RequestAnimationFrame.prototype.constructor=e.RequestAnimationFrame,e.Math={PI2:2*Math.PI,HALF_PI:.5*Math.PI,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,degToRad:function(t){return t*e.Math.DEG_TO_RAD},radToDeg:function(t){return t*e.Math.RAD_TO_DEG},getNextPowerOfTwo:function(t){if(t>0&&0==(t&t-1))return t;for(var e=1;e<t;)e<<=1;return e},isPowerOfTwo:function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)},random:function(t,e){if(void 0===t&&(t=0),void 0===e&&(e=1),t===e)return t;if(t>e){var i=t;t=e,e=i}return Math.random()*(e-t)+t},between:function(t,e){if(void 0===t&&(t=0),void 0===e&&(e=1),t===e)return t;if(t>e){var i=t;t=e,e=i}return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t},fuzzyEqual:function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)<i},fuzzyLessThan:function(t,e,i){return void 0===i&&(i=1e-4),t<e+i},fuzzyGreaterThan:function(t,e,i){return void 0===i&&(i=1e-4),t>e-i},fuzzyCeil:function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)},fuzzyFloor:function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)},average:function(){for(var t=0,e=arguments.length,i=0;i<e;i++)t+=+arguments[i];return t/e},shear:function(t){return t%1},snapTo:function(t,e,i){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),i+t)},snapToFloor:function(t,e,i){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),i+t)},snapToCeil:function(t,e,i){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),i+t)},roundTo:function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s},floorTo:function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s},ceilTo:function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s},trunc:function(t){return isFinite(t)?t-t%1||(t<0?-0:0===t?t:0):t},rotateToAngle:function(t,i,s){return void 0===s&&(s=.05),t===i?t:(Math.abs(i-t)<=s||Math.abs(i-t)>=e.Math.PI2-s?t=i:(Math.abs(i-t)>Math.PI&&(i<t?i+=e.Math.PI2:i-=e.Math.PI2),i>t?t+=s:i<t&&(t-=s)),t)},getShortestAngle:function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)},angleBetween:function(t,e,i,s){return Math.atan2(s-e,i-t)},angleBetweenY:function(t,e,i,s){return Math.atan2(i-t,s-e)},angleBetweenPoints:function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},angleBetweenPointsY:function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)},reverseAngle:function(t){return this.normalizeAngle(t+Math.PI,!0)},normalizeAngle:function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI},maxAdd:function(t,e,i){return Math.min(t+e,i)},minSub:function(t,e,i){return Math.max(t-e,i)},wrap:function(t,e,i){var s=i-e;if(s<=0)return 0;var n=(t-e)%s;return n<0&&(n+=s),n+e},wrapValue:function(t,e,i){return t=Math.abs(t),e=Math.abs(e),i=Math.abs(i),(t+e)%i},isOdd:function(t){return!!(1&t)},isEven:function(t){return!(1&t)},min:function(){if(1===arguments.length&&"object"==typeof arguments[0])t=arguments[0];else var t=arguments;for(var e=1,i=0,s=t.length;e<s;e++)t[e]<t[i]&&(i=e);return t[i]},max:function(){if(1===arguments.length&&"object"==typeof arguments[0])t=arguments[0];else var t=arguments;for(var e=1,i=0,s=t.length;e<s;e++)t[e]>t[i]&&(i=e);return t[i]},minProperty:function(t){if(2===arguments.length&&"object"==typeof arguments[1])e=arguments[1];else var e=arguments.slice(1);for(var i=1,s=0,n=e.length;i<n;i++)e[i][t]<e[s][t]&&(s=i);return e[s][t]},maxProperty:function(t){if(2===arguments.length&&"object"==typeof arguments[1])e=arguments[1];else var e=arguments.slice(1);for(var i=1,s=0,n=e.length;i<n;i++)e[i][t]>e[s][t]&&(s=i);return e[s][t]},wrapAngle:function(t,e){return e?this.wrap(t,-Math.PI,Math.PI):this.wrap(t,-180,180)},linearInterpolation:function(t,e){var i=t.length-1,s=i*e,n=Math.floor(s);return e<0?this.linear(t[0],t[1],s):e>1?this.linear(t[i],t[i-1],i-s):this.linear(t[n],t[n+1>i?i:n+1],s-n)},bezierInterpolation:function(t,e){for(var i=0,s=t.length-1,n=0;n<=s;n++)i+=Math.pow(1-e,s-n)*Math.pow(e,n)*t[n]*this.bernstein(s,n);return i},catmullRomInterpolation:function(t,e){var i=t.length-1,s=i*e,n=Math.floor(s);return t[0]===t[i]?(e<0&&(n=Math.floor(s=i*(1+e))),this.catmullRom(t[(n-1+i)%i],t[n],t[(n+1)%i],t[(n+2)%i],s-n)):e<0?t[0]-(this.catmullRom(t[0],t[0],t[1],t[1],-s)-t[0]):e>1?t[i]-(this.catmullRom(t[i],t[i],t[i-1],t[i-1],s-i)-t[i]):this.catmullRom(t[n?n-1:0],t[n],t[i<n+1?i:n+1],t[i<n+2?i:n+2],s-n)},linear:function(t,e,i){return(e-t)*i+t},bernstein:function(t,e){return this.factorial(t)/this.factorial(e)/this.factorial(t-e)},factorial:function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e},catmullRom:function(t,e,i,s,n){var r=.5*(i-t),o=.5*(s-e),a=n*n;return(2*e-2*i+r+o)*(n*a)+(-3*e+3*i-2*r-o)*a+r*n+e},difference:function(t,e){return Math.abs(t-e)},roundAwayFromZero:function(t){return t>0?Math.ceil(t):Math.floor(t)},sinCosGenerator:function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1);for(var n=e,r=i,o=s*Math.PI/t,a=[],h=[],l=0;l<t;l++)n+=(r-=n*o)*o,a[l]=r,h[l]=n;return{sin:h,cos:a,length:t}},hypot:function(t,e){return Math.sqrt(t*t+e*e)},distance:function(t,e,i,s){var n=t-i,r=e-s;return Math.sqrt(n*n+r*r)},distanceSq:function(t,e,i,s){var n=t-i,r=e-s;return n*n+r*r},distancePow:function(t,e,i,s,n){return void 0===n&&(n=2),Math.sqrt(Math.pow(i-t,n)+Math.pow(s-e,n))},clamp:function(t,e,i){return t<e?e:i<t?i:t},clampBottom:function(t,e){return t<e?e:t},within:function(t,e,i){return Math.abs(t-e)<=i},mapLinear:function(t,e,i,s,n){return s+(t-e)*(n-s)/(i-e)},smoothstep:function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*(3-2*t)},smootherstep:function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)},sign:function(t){return t<0?-1:t>0?1:0},percent:function(t,e,i){return void 0===i&&(i=0),t>e||i>e?1:t<i||i>t?0:(t-i)/e}},e.RandomDataGenerator=function(t){void 0===t&&(t=[]),this.c=1,this.s0=0,this.s1=0,this.s2=0,"string"==typeof t?this.state(t):this.sow(t)},e.RandomDataGenerator.prototype={rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},sow:function(t){if(this.s0=this.hash(" "),this.s1=this.hash(this.s0),this.s2=this.hash(this.s1),this.c=1,t)for(var e=0;e<t.length&&null!=t[e];e++){var i=t[e];this.s0-=this.hash(i),this.s0+=~~(this.s0<0),this.s1-=this.hash(i),this.s1+=~~(this.s1<0),this.s2-=this.hash(i),this.s2+=~~(this.s2<0)}},hash:function(t){var e,i,s;for(s=4022871197,t=t.toString(),i=0;i<t.length;i++)e=.02519603282416938*(s+=t.charCodeAt(i)),e-=s=e>>>0,s=(e*=s)>>>0,s+=4294967296*(e-=s);return 2.3283064365386963e-10*(s>>>0)},integer:function(){return 4294967296*this.rnd.apply(this)},frac:function(){return this.rnd.apply(this)+1.1102230246251565e-16*(2097152*this.rnd.apply(this)|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},between:function(t,e){return this.integerInRange(t,e)},realInRange:function(t,e){return this.frac()*(e-t)+t},normal:function(){return 1-2*this.frac()},uuid:function(){var t="",e="";for(e=t="";t++<36;e+=~t%5|3*t&4?(15^t?8^this.frac()*(20^t?16:4):4).toString(16):"-");return e},pick:function(t){return t[this.integerInRange(0,t.length-1)]},sign:function(){return this.pick([-1,1])},weightedPick:function(t){return t[~~(Math.pow(this.frac(),2)*(t.length-1)+.5)]},timestamp:function(t,e){return this.realInRange(t||9466848e5,e||1577862e6)},angle:function(){return this.integerInRange(-180,180)},state:function(t){return"string"==typeof t&&t.match(/^!rnd/)&&(t=t.split(","),this.c=parseFloat(t[1]),this.s0=parseFloat(t[2]),this.s1=parseFloat(t[3]),this.s2=parseFloat(t[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")}},e.RandomDataGenerator.prototype.constructor=e.RandomDataGenerator,e.QuadTree=function(t,e,i,s,n,r,o){this.maxObjects=10,this.maxLevels=4,this.level=0,this.bounds={},this.objects=[],this.nodes=[],this._empty=[],this.reset(t,e,i,s,n,r,o)},e.QuadTree.prototype={reset:function(t,e,i,s,n,r,o){this.maxObjects=n||10,this.maxLevels=r||4,this.level=o||0,this.bounds={x:Math.round(t),y:Math.round(e),width:i,height:s,subWidth:Math.floor(i/2),subHeight:Math.floor(s/2),right:Math.round(t)+Math.floor(i/2),bottom:Math.round(e)+Math.floor(s/2)},this.objects.length=0,this.nodes.length=0},populate:function(t){t.forEach(this.populateHandler,this,!0)},populateHandler:function(t){t.body&&t.exists&&this.insert(t.body)},split:function(){this.nodes[0]=new e.QuadTree(this.bounds.right,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level+1),this.nodes[1]=new e.QuadTree(this.bounds.x,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level+1),this.nodes[2]=new e.QuadTree(this.bounds.x,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level+1),this.nodes[3]=new e.QuadTree(this.bounds.right,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level+1)},insert:function(t){var e,i=0;if(null==this.nodes[0]||-1===(e=this.getIndex(t))){if(this.objects.push(t),this.objects.length>this.maxObjects&&this.level<this.maxLevels)for(null==this.nodes[0]&&this.split();i<this.objects.length;)-1!==(e=this.getIndex(this.objects[i]))?this.nodes[e].insert(this.objects.splice(i,1)[0]):i++}else this.nodes[e].insert(t)},getIndex:function(t){var e=-1;return t.x<this.bounds.right&&t.right<this.bounds.right?t.y<this.bounds.bottom&&t.bottom<this.bounds.bottom?e=1:t.y>this.bounds.bottom&&(e=2):t.x>this.bounds.right&&(t.y<this.bounds.bottom&&t.bottom<this.bounds.bottom?e=0:t.y>this.bounds.bottom&&(e=3)),e},retrieve:function(t){if(t instanceof e.Rectangle)var i=this.objects,s=this.getIndex(t);else{if(!t.body)return this._empty;var i=this.objects,s=this.getIndex(t.body)}return this.nodes[0]&&(i=-1!==s?i.concat(this.nodes[s].retrieve(t)):(i=(i=(i=i.concat(this.nodes[0].retrieve(t))).concat(this.nodes[1].retrieve(t))).concat(this.nodes[2].retrieve(t))).concat(this.nodes[3].retrieve(t))),i},clear:function(){this.objects.length=0;for(var t=this.nodes.length;t--;)this.nodes[t].clear(),this.nodes.splice(t,1);this.nodes.length=0}},e.QuadTree.prototype.constructor=e.QuadTree,e.Net=function(t){this.game=t},e.Net.prototype={getHostName:function(){return window.location&&window.location.hostname?window.location.hostname:null},checkDomainName:function(t){return-1!==window.location.hostname.indexOf(t)},updateQueryString:function(t,e,i,s){void 0===i&&(i=!1),void 0!==s&&""!==s||(s=window.location.href);var n="",r=new RegExp("([?|&])"+t+"=.*?(&|#|$)(.*)","gi");if(r.test(s))n=void 0!==e&&null!==e?s.replace(r,"$1"+t+"="+e+"$2$3"):s.replace(r,"$1$3").replace(/(&|\?)$/,"");else if(void 0!==e&&null!==e){var o=-1!==s.indexOf("?")?"&":"?",a=s.split("#");s=a[0]+o+t+"="+e,a[1]&&(s+="#"+a[1]),n=s}else n=s;if(!i)return n;window.location.href=n},getQueryString:function(t){void 0===t&&(t="");var e={},i=location.search.substring(1).split("&");for(var s in i){var n=i[s].split("=");if(n.length>1){if(t&&t===this.decodeURI(n[0]))return this.decodeURI(n[1]);e[this.decodeURI(n[0])]=this.decodeURI(n[1])}}return e},decodeURI:function(t){return decodeURIComponent(t.replace(/\+/g," "))}},e.Net.prototype.constructor=e.Net,e.TweenManager=function(t){this.game=t,this.frameBased=!1,this._tweens=[],this._add=[],this.easeMap={Power0:e.Easing.Power0,Power1:e.Easing.Power1,Power2:e.Easing.Power2,Power3:e.Easing.Power3,Power4:e.Easing.Power4,Linear:e.Easing.Linear.None,Quad:e.Easing.Quadratic.Out,Cubic:e.Easing.Cubic.Out,Quart:e.Easing.Quartic.Out,Quint:e.Easing.Quintic.Out,Sine:e.Easing.Sinusoidal.Out,Expo:e.Easing.Exponential.Out,Circ:e.Easing.Circular.Out,Elastic:e.Easing.Elastic.Out,Back:e.Easing.Back.Out,Bounce:e.Easing.Bounce.Out,"Quad.easeIn":e.Easing.Quadratic.In,"Cubic.easeIn":e.Easing.Cubic.In,"Quart.easeIn":e.Easing.Quartic.In,"Quint.easeIn":e.Easing.Quintic.In,"Sine.easeIn":e.Easing.Sinusoidal.In,"Expo.easeIn":e.Easing.Exponential.In,"Circ.easeIn":e.Easing.Circular.In,"Elastic.easeIn":e.Easing.Elastic.In,"Back.easeIn":e.Easing.Back.In,"Bounce.easeIn":e.Easing.Bounce.In,"Quad.easeOut":e.Easing.Quadratic.Out,"Cubic.easeOut":e.Easing.Cubic.Out,"Quart.easeOut":e.Easing.Quartic.Out,"Quint.easeOut":e.Easing.Quintic.Out,"Sine.easeOut":e.Easing.Sinusoidal.Out,"Expo.easeOut":e.Easing.Exponential.Out,"Circ.easeOut":e.Easing.Circular.Out,"Elastic.easeOut":e.Easing.Elastic.Out,"Back.easeOut":e.Easing.Back.Out,"Bounce.easeOut":e.Easing.Bounce.Out,"Quad.easeInOut":e.Easing.Quadratic.InOut,"Cubic.easeInOut":e.Easing.Cubic.InOut,"Quart.easeInOut":e.Easing.Quartic.InOut,"Quint.easeInOut":e.Easing.Quintic.InOut,"Sine.easeInOut":e.Easing.Sinusoidal.InOut,"Expo.easeInOut":e.Easing.Exponential.InOut,"Circ.easeInOut":e.Easing.Circular.InOut,"Elastic.easeInOut":e.Easing.Elastic.InOut,"Back.easeInOut":e.Easing.Back.InOut,"Bounce.easeInOut":e.Easing.Bounce.InOut},this.game.onPause.add(this._pauseAll,this),this.game.onResume.add(this._resumeAll,this)},e.TweenManager.prototype={getAll:function(){return this._tweens},removeAll:function(){for(var t=0;t<this._tweens.length;t++)this._tweens[t].pendingDelete=!0;this._add=[]},removeFrom:function(t,i){void 0===i&&(i=!0);if(Array.isArray(t))for(s=0,n=t.length;s<n;s++)this.removeFrom(t[s]);else if(t.type===e.GROUP&&i)for(var s=0,n=t.children.length;s<n;s++)this.removeFrom(t.children[s]);else{for(s=0,n=this._tweens.length;s<n;s++)t===this._tweens[s].target&&this.remove(this._tweens[s]);for(s=0,n=this._add.length;s<n;s++)t===this._add[s].target&&this.remove(this._add[s])}},add:function(t){t._manager=this,this._add.push(t)},create:function(t){return new e.Tween(t,this.game,this)},remove:function(t){var e=this._tweens.indexOf(t);-1!==e?this._tweens[e].pendingDelete=!0:-1!==(e=this._add.indexOf(t))&&(this._add[e].pendingDelete=!0)},update:function(){var t=this._add.length,e=this._tweens.length;if(0===e&&0===t)return!1;for(var i=0;i<e;)this._tweens[i].update(this.game.time.time)?i++:(this._tweens.splice(i,1),e--);return t>0&&(this._tweens=this._tweens.concat(this._add),this._add.length=0),!0},isTweening:function(t,e){return e||(e=!1),this._tweens.some(function(i){return i.target===t&&(!e||i.isRunning&&!i.pendingDelete)})},_pauseAll:function(){for(var t=this._tweens.length-1;t>=0;t--)this._tweens[t]._pause()},_resumeAll:function(){for(var t=this._tweens.length-1;t>=0;t--)this._tweens[t]._resume()},pauseAll:function(){for(var t=this._tweens.length-1;t>=0;t--)this._tweens[t].pause()},resumeAll:function(){for(var t=this._tweens.length-1;t>=0;t--)this._tweens[t].resume(!0)},destroy:function(){this.game.onPause.remove(this._pauseAll,this),this.game.onResume.remove(this._resumeAll,this),this.game=null,this._add=null,this._tweens=null}},e.TweenManager.prototype.constructor=e.TweenManager,e.Tween=function(t,i,s){this.game=i,this.target=t,this.manager=s,this.timeline=[],this.reverse=!1,this.timeScale=1,this.repeatCounter=0,this.pendingDelete=!1,this.onStart=new e.Signal,this.onLoop=new e.Signal,this.onRepeat=new e.Signal,this.onChildComplete=new e.Signal,this.onComplete=new e.Signal,this.isRunning=!1,this.current=0,this.properties={},this.chainedTween=null,this.isPaused=!1,this.frameBased=s.frameBased,this._onUpdateCallback=null,this._onUpdateCallbackContext=null,this._pausedTime=0,this._codePaused=!1,this._hasStarted=!1},e.Tween.updateColor=function(t){e.Color.updateColor(t.target)},e.Tween.prototype={to:function(t,i,s,n,r,o,a){return(void 0===i||i<=0)&&(i=1e3),void 0!==s&&null!==s||(s=e.Easing.Default),void 0===n&&(n=!1),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=!1),"string"==typeof s&&this.manager.easeMap[s]&&(s=this.manager.easeMap[s]),this.isRunning?(console.warn("Phaser.Tween.to cannot be called after Tween.start"),this):(this.timeline.push(new e.TweenData(this).to(t,i,s,r,o,a)),n&&this.start(),this)},from:function(t,i,s,n,r,o,a){return void 0===i&&(i=1e3),void 0!==s&&null!==s||(s=e.Easing.Default),void 0===n&&(n=!1),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=!1),"string"==typeof s&&this.manager.easeMap[s]&&(s=this.manager.easeMap[s]),this.isRunning?(console.warn("Phaser.Tween.from cannot be called after Tween.start"),this):(this.timeline.push(new e.TweenData(this).from(t,i,s,r,o,a)),n&&this.start(),this)},start:function(t){if(void 0===t&&(t=0),this.pendingDelete)return console.warn("Phaser.Tween.start cannot be called after Tween.stop"),this;if(null===this.game||null===this.target||0===this.timeline.length||this.isRunning)return this;for(i=0;i<this.timeline.length;i++)for(var e in this.timeline[i].vEnd)this.properties[e]=this.target[e]||0,Array.isArray(this.properties[e])||(this.properties[e]*=1);for(var i=0;i<this.timeline.length;i++)this.timeline[i].loadValues();return this.manager.add(this),this.isRunning=!0,(t<0||t>this.timeline.length-1)&&(t=0),this.current=t,this.timeline[this.current].start(),this},stop:function(t){return void 0===t&&(t=!1),this.isRunning=!1,this._onUpdateCallback=null,this._onUpdateCallbackContext=null,t&&(this.onComplete.dispatch(this.target,this),this._hasStarted=!1,this.chainedTween&&this.chainedTween.start()),this.manager.remove(this),this},updateTweenData:function(t,e,i){if(0===this.timeline.length)return this;if(void 0===i&&(i=0),-1===i)for(var s=0;s<this.timeline.length;s++)this.timeline[s][t]=e;else this.timeline[i][t]=e;return this},delay:function(t,e){return this.updateTweenData("delay",t,e)},repeat:function(t,e,i){return void 0===e&&(e=0),this.updateTweenData("repeatCounter",t,i),this.updateTweenData("repeatTotal",t,i),this.updateTweenData("repeatDelay",e,i)},repeatDelay:function(t,e){return this.updateTweenData("repeatDelay",t,e)},yoyo:function(t,e,i){return void 0===e&&(e=0),this.updateTweenData("yoyo",t,i),this.updateTweenData("yoyoDelay",e,i)},yoyoDelay:function(t,e){return this.updateTweenData("yoyoDelay",t,e)},easing:function(t,e){return"string"==typeof t&&this.manager.easeMap[t]&&(t=this.manager.easeMap[t]),this.updateTweenData("easingFunction",t,e)},interpolation:function(t,i,s){return void 0===i&&(i=e.Math),this.updateTweenData("interpolationFunction",t,s),this.updateTweenData("interpolationContext",i,s)},repeatAll:function(t){return void 0===t&&(t=0),this.repeatCounter=t,this},chain:function(){for(var t=arguments.length;t--;)t>0?arguments[t-1].chainedTween=arguments[t]:this.chainedTween=arguments[t];return this},loop:function(t){return void 0===t&&(t=!0),this.repeatCounter=t?-1:0,this},onUpdateCallback:function(t,e){return this._onUpdateCallback=t,this._onUpdateCallbackContext=e,this},pause:function(){this.isPaused=!0,this._codePaused=!0,this._pausedTime=this.game.time.time},_pause:function(){this._codePaused||(this.isPaused=!0,this._pausedTime=this.game.time.time)},resume:function(){if(this.isPaused){this.isPaused=!1,this._codePaused=!1;for(var t=0;t<this.timeline.length;t++)this.timeline[t].isRunning||(this.timeline[t].startTime+=this.game.time.time-this._pausedTime)}},_resume:function(){this._codePaused||this.resume()},update:function(t){if(this.pendingDelete||!this.target)return!1;if(this.isPaused)return!0;var i=this.timeline[this.current].update(t);if(i===e.TweenData.PENDING)return!0;if(i===e.TweenData.RUNNING)return this._hasStarted||(this.onStart.dispatch(this.target,this),this._hasStarted=!0),null!==this._onUpdateCallback&&this._onUpdateCallback.call(this._onUpdateCallbackContext,this,this.timeline[this.current].value,this.timeline[this.current]),this.isRunning;if(i===e.TweenData.LOOPED)return-1===this.timeline[this.current].repeatCounter?this.onLoop.dispatch(this.target,this):this.onRepeat.dispatch(this.target,this),!0;if(i===e.TweenData.COMPLETE){var s=!1;return this.reverse?--this.current<0&&(this.current=this.timeline.length-1,s=!0):++this.current===this.timeline.length&&(this.current=0,s=!0),s?-1===this.repeatCounter?(this.timeline[this.current].start(),this.onLoop.dispatch(this.target,this),!0):this.repeatCounter>0?(this.repeatCounter--,this.timeline[this.current].start(),this.onRepeat.dispatch(this.target,this),!0):(this.isRunning=!1,this.onComplete.dispatch(this.target,this),this._hasStarted=!1,this.chainedTween&&this.chainedTween.start(),!1):(this.onChildComplete.dispatch(this.target,this),this.timeline[this.current].start(),!0)}},generateData:function(t,e){if(null===this.game||null===this.target)return null;void 0===t&&(t=60),void 0===e&&(e=[]);for(s=0;s<this.timeline.length;s++)for(var i in this.timeline[s].vEnd)this.properties[i]=this.target[i]||0,Array.isArray(this.properties[i])||(this.properties[i]*=1);for(s=0;s<this.timeline.length;s++)this.timeline[s].loadValues();for(var s=0;s<this.timeline.length;s++)e=e.concat(this.timeline[s].generateData(t));return e}},Object.defineProperty(e.Tween.prototype,"totalDuration",{get:function(){for(var t=0,e=0;e<this.timeline.length;e++)t+=this.timeline[e].duration;return t}}),e.Tween.prototype.constructor=e.Tween,e.TweenData=function(t){this.parent=t,this.game=t.game,this.vStart={},this.vStartCache={},this.vEnd={},this.vEndCache={},this.duration=1e3,this.percent=0,this.value=0,this.repeatCounter=0,this.repeatDelay=0,this.repeatTotal=0,this.interpolate=!1,this.yoyo=!1,this.yoyoDelay=0,this.inReverse=!1,this.delay=0,this.dt=0,this.startTime=null,this.easingFunction=e.Easing.Default,this.interpolationFunction=e.Math.linearInterpolation,this.interpolationContext=e.Math,this.isRunning=!1,this.isFrom=!1},e.TweenData.PENDING=0,e.TweenData.RUNNING=1,e.TweenData.LOOPED=2,e.TweenData.COMPLETE=3,e.TweenData.prototype={to:function(t,e,i,s,n,r){return this.vEnd=t,this.duration=e,this.easingFunction=i,this.delay=s,this.repeatTotal=n,this.yoyo=r,this.isFrom=!1,this},from:function(t,e,i,s,n,r){return this.vEnd=t,this.duration=e,this.easingFunction=i,this.delay=s,this.repeatTotal=n,this.yoyo=r,this.isFrom=!0,this},start:function(){if(this.startTime=this.game.time.time+this.delay,this.parent.reverse?this.dt=this.duration:this.dt=0,this.delay>0?this.isRunning=!1:this.isRunning=!0,this.isFrom)for(var t in this.vStartCache)this.vStart[t]=this.vEndCache[t],this.vEnd[t]=this.vStartCache[t],this.parent.target[t]=this.vStart[t];return this.value=0,this.repeatCounter=this.repeatTotal,this},loadValues:function(){for(var t in this.parent.properties){if(this.vStart[t]=this.parent.properties[t],Array.isArray(this.vEnd[t])){if(0===this.vEnd[t].length)continue;0===this.percent&&(this.vEnd[t]=[this.vStart[t]].concat(this.vEnd[t]))}void 0!==this.vEnd[t]?("string"==typeof this.vEnd[t]&&(this.vEnd[t]=this.vStart[t]+parseFloat(this.vEnd[t],10)),this.parent.properties[t]=this.vEnd[t]):this.vEnd[t]=this.vStart[t],this.vStartCache[t]=this.vStart[t],this.vEndCache[t]=this.vEnd[t]}return this},update:function(t){if(this.isRunning){if(t<this.startTime)return e.TweenData.RUNNING}else{if(!(t>=this.startTime))return e.TweenData.PENDING;this.isRunning=!0}var i=this.parent.frameBased?this.game.time.physicsElapsedMS:this.game.time.elapsedMS;this.parent.reverse?(this.dt-=i*this.parent.timeScale,this.dt=Math.max(this.dt,0)):(this.dt+=i*this.parent.timeScale,this.dt=Math.min(this.dt,this.duration)),this.percent=this.dt/this.duration,this.value=this.easingFunction(this.percent);for(var s in this.vEnd){var n=this.vStart[s],r=this.vEnd[s];Array.isArray(r)?this.parent.target[s]=this.interpolationFunction.call(this.interpolationContext,r,this.value):this.parent.target[s]=n+(r-n)*this.value}return!this.parent.reverse&&1===this.percent||this.parent.reverse&&0===this.percent?this.repeat():e.TweenData.RUNNING},generateData:function(t){this.parent.reverse?this.dt=this.duration:this.dt=0;var e=[],i=!1,s=1/t*1e3;do{this.parent.reverse?(this.dt-=s,this.dt=Math.max(this.dt,0)):(this.dt+=s,this.dt=Math.min(this.dt,this.duration)),this.percent=this.dt/this.duration,this.value=this.easingFunction(this.percent);var n={};for(var r in this.vEnd){var o=this.vStart[r],a=this.vEnd[r];Array.isArray(a)?n[r]=this.interpolationFunction.call(this.interpolationContext,a,this.value):n[r]=o+(a-o)*this.value}e.push(n),(!this.parent.reverse&&1===this.percent||this.parent.reverse&&0===this.percent)&&(i=!0)}while(!i);if(this.yoyo){var h=e.slice();h.reverse(),e=e.concat(h)}return e},repeat:function(){if(this.yoyo){if(this.inReverse&&0===this.repeatCounter){for(var t in this.vStartCache)this.vStart[t]=this.vStartCache[t],this.vEnd[t]=this.vEndCache[t];return this.inReverse=!1,e.TweenData.COMPLETE}this.inReverse=!this.inReverse}else if(0===this.repeatCounter)return e.TweenData.COMPLETE;if(this.inReverse)for(var t in this.vStartCache)this.vStart[t]=this.vEndCache[t],this.vEnd[t]=this.vStartCache[t];else{for(var t in this.vStartCache)this.vStart[t]=this.vStartCache[t],this.vEnd[t]=this.vEndCache[t];this.repeatCounter>0&&this.repeatCounter--}return this.startTime=this.game.time.time,this.yoyo&&this.inReverse?this.startTime+=this.yoyoDelay:this.inReverse||(this.startTime+=this.repeatDelay),this.parent.reverse?this.dt=this.duration:this.dt=0,e.TweenData.LOOPED}},e.TweenData.prototype.constructor=e.TweenData,e.Easing={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)},Out:function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)},InOut:function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},Out:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},InOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-e.Easing.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*e.Easing.Bounce.In(2*t):.5*e.Easing.Bounce.Out(2*t-1)+.5}}},e.Easing.Default=e.Easing.Linear.None,e.Easing.Power0=e.Easing.Linear.None,e.Easing.Power1=e.Easing.Quadratic.Out,e.Easing.Power2=e.Easing.Cubic.Out,e.Easing.Power3=e.Easing.Quartic.Out,e.Easing.Power4=e.Easing.Quintic.Out,e.Time=function(t){this.game=t,this.time=0,this.prevTime=0,this.now=0,this.elapsed=0,this.elapsedMS=0,this.physicsElapsed=1/60,this.physicsElapsedMS=1/60*1e3,this.desiredFpsMult=1/60,this._desiredFps=60,this.suggestedFps=this.desiredFps,this.slowMotion=1,this.advancedTiming=!1,this.frames=0,this.updates=0,this.renders=0,this.fps=0,this.ups=0,this.rps=0,this.fpsMin=1e3,this.fpsMax=0,this.msMin=1e3,this.msMax=0,this.pauseDuration=0,this.timeToCall=0,this.timeExpected=0,this.events=new e.Timer(this.game,!1),this._frameCount=0,this._elapsedAccumulator=0,this._started=0,this._timeLastSecond=0,this._pauseStarted=0,this._justResumed=!1,this._timers=[]},e.Time.prototype={boot:function(){this._started=Date.now(),this.time=Date.now(),this.events.start(),this.timeExpected=this.time},add:function(t){return this._timers.push(t),t},create:function(t){void 0===t&&(t=!0);var i=new e.Timer(this.game,t);return this._timers.push(i),i},removeAll:function(){for(var t=0;t<this._timers.length;t++)this._timers[t].destroy();this._timers=[],this.events.removeAll()},refresh:function(){var t=this.time;this.time=Date.now(),this.elapsedMS=this.time-t},update:function(t){var e=this.time;this.time=Date.now(),this.elapsedMS=this.time-e,this.prevTime=this.now,this.now=t,this.elapsed=this.now-this.prevTime,this.game.raf._isSetTimeOut&&(this.timeToCall=Math.floor(Math.max(0,1e3/this._desiredFps-(this.timeExpected-t))),this.timeExpected=t+this.timeToCall),this.advancedTiming&&this.updateAdvancedTiming(),this.game.paused||(this.events.update(this.time),this._timers.length&&this.updateTimers())},updateTimers:function(){for(var t=0,e=this._timers.length;t<e;)this._timers[t].update(this.time)?t++:(this._timers.splice(t,1),e--)},updateAdvancedTiming:function(){if(this._frameCount++,this._elapsedAccumulator+=this.elapsed,this._frameCount>=2*this._desiredFps&&(this.suggestedFps=5*Math.floor(200/(this._elapsedAccumulator/this._frameCount)),this._frameCount=0,this._elapsedAccumulator=0),this.msMin=Math.min(this.msMin,this.elapsed),this.msMax=Math.max(this.msMax,this.elapsed),this.frames++,this.now>this._timeLastSecond+1e3){var t=this.now-this._timeLastSecond;this.fps=Math.round(1e3*this.frames/t),this.ups=Math.round(1e3*this.updates/t),this.rps=Math.round(1e3*this.renders/t),this.fpsMin=Math.min(this.fpsMin,this.fps),this.fpsMax=Math.max(this.fpsMax,this.fps),this._timeLastSecond=this.now,this.frames=0,this.updates=0,this.renders=0}},countUpdate:function(){this.advancedTiming&&this.updates++},countRender:function(){this.advancedTiming&&this.renders++},gamePaused:function(){this._pauseStarted=Date.now(),this.events.pause();for(var t=this._timers.length;t--;)this._timers[t]._pause()},gameResumed:function(){this.time=Date.now(),this.pauseDuration=this.time-this._pauseStarted,this.events.resume();for(var t=this._timers.length;t--;)this._timers[t]._resume()},totalElapsedSeconds:function(){return.001*(this.time-this._started)},elapsedSince:function(t){return this.time-t},elapsedSecondsSince:function(t){return.001*(this.time-t)},reset:function(){this._started=this.time,this.removeAll()}},Object.defineProperty(e.Time.prototype,"desiredFps",{get:function(){return this._desiredFps},set:function(t){this._desiredFps=t,this.physicsElapsed=1/t,this.physicsElapsedMS=1e3*this.physicsElapsed,this.desiredFpsMult=1/t}}),e.Time.prototype.constructor=e.Time,e.Timer=function(t,i){void 0===i&&(i=!0),this.game=t,this.running=!1,this.autoDestroy=i,this.expired=!1,this.elapsed=0,this.events=[],this.onComplete=new e.Signal,this.nextTick=0,this.timeCap=1e3,this.paused=!1,this._codePaused=!1,this._started=0,this._pauseStarted=0,this._pauseTotal=0,this._now=Date.now(),this._len=0,this._marked=0,this._i=0,this._diff=0,this._newTick=0},e.Timer.MINUTE=6e4,e.Timer.SECOND=1e3,e.Timer.HALF=500,e.Timer.QUARTER=250,e.Timer.prototype={create:function(t,i,s,n,r,o){var a=t=Math.round(t);0===this._now?a+=this.game.time.time:a+=this._now;var h=new e.TimerEvent(this,t,a,s,i,n,r,o);return this.events.push(h),this.order(),this.expired=!1,h},add:function(t,e,i){return this.create(t,!1,0,e,i,Array.prototype.slice.call(arguments,3))},repeat:function(t,e,i,s){return this.create(t,!1,e,i,s,Array.prototype.slice.call(arguments,4))},loop:function(t,e,i){return this.create(t,!0,0,e,i,Array.prototype.slice.call(arguments,3))},start:function(t){if(!this.running){this._started=this.game.time.time+(t||0),this.running=!0;for(var e=0;e<this.events.length;e++)this.events[e].tick=this.events[e].delay+this._started}},stop:function(t){this.running=!1,void 0===t&&(t=!0),t&&(this.events.length=0)},remove:function(t){for(var e=0;e<this.events.length;e++)if(this.events[e]===t)return this.events[e].pendingDelete=!0,!0;return!1},order:function(){this.events.length>0&&(this.events.sort(this.sortHandler),this.nextTick=this.events[0].tick)},sortHandler:function(t,e){return t.tick<e.tick?-1:t.tick>e.tick?1:0},clearPendingEvents:function(){for(this._i=this.events.length;this._i--;)this.events[this._i].pendingDelete&&this.events.splice(this._i,1);this._len=this.events.length,this._i=0},update:function(t){if(this.paused)return!0;if(this.elapsed=t-this._now,this._now=t,this.elapsed>this.timeCap&&this.adjustEvents(t-this.elapsed),this._marked=0,this.clearPendingEvents(),this.running&&this._now>=this.nextTick&&this._len>0){for(;this._i<this._len&&this.running;){var e=this.events[this._i];if(!(this._now>=e.tick)||e.pendingDelete)break;this._newTick=this._now+e.delay-(this._now-e.tick),this._newTick<0&&(this._newTick=this._now+e.delay),!0===e.loop?(e.tick=this._newTick,e.callback.apply(e.callbackContext,e.args)):e.repeatCount>0?(e.repeatCount--,e.tick=this._newTick,e.callback.apply(e.callbackContext,e.args)):(this._marked++,e.pendingDelete=!0,e.callback.apply(e.callbackContext,e.args)),this._i++}this.events.length>this._marked?this.order():(this.expired=!0,this.onComplete.dispatch(this))}return!this.expired||!this.autoDestroy},pause:function(){this.running&&(this._codePaused=!0,this.paused||(this._pauseStarted=this.game.time.time,this.paused=!0))},_pause:function(){!this.paused&&this.running&&(this._pauseStarted=this.game.time.time,this.paused=!0)},adjustEvents:function(t){for(var e=0;e<this.events.length;e++)if(!this.events[e].pendingDelete){var i=this.events[e].tick-t;i<0&&(i=0),this.events[e].tick=this._now+i}var s=this.nextTick-t;this.nextTick=s<0?this._now:this._now+s},resume:function(){if(this.paused){var t=this.game.time.time;this._pauseTotal+=t-this._now,this._now=t,this.adjustEvents(this._pauseStarted),this.paused=!1,this._codePaused=!1}},_resume:function(){this._codePaused||this.resume()},removeAll:function(){this.onComplete.removeAll(),this.events.length=0,this._len=0,this._i=0},destroy:function(){this.onComplete.removeAll(),this.running=!1,this.expired=!0,this.events=[],this._len=0,this._i=0}},Object.defineProperty(e.Timer.prototype,"next",{get:function(){return this.nextTick}}),Object.defineProperty(e.Timer.prototype,"duration",{get:function(){return this.running&&this.nextTick>this._now?this.nextTick-this._now:0}}),Object.defineProperty(e.Timer.prototype,"length",{get:function(){return this.events.length}}),Object.defineProperty(e.Timer.prototype,"ms",{get:function(){return this.running?this._now-this._started-this._pauseTotal:0}}),Object.defineProperty(e.Timer.prototype,"seconds",{get:function(){return this.running?.001*this.ms:0}}),e.Timer.prototype.constructor=e.Timer,e.TimerEvent=function(t,e,i,s,n,r,o,a){this.timer=t,this.delay=e,this.tick=i,this.repeatCount=s-1,this.loop=n,this.callback=r,this.callbackContext=o,this.args=a,this.pendingDelete=!1},e.TimerEvent.prototype.constructor=e.TimerEvent,e.AnimationManager=function(t){this.sprite=t,this.game=t.game,this.currentFrame=null,this.currentAnim=null,this.updateIfVisible=!0,this.isLoaded=!1,this._frameData=null,this._anims={},this._outputFrames=[]},e.AnimationManager.prototype={loadFrameData:function(t,e){if(void 0===t)return!1;if(this.isLoaded)for(var i in this._anims)this._anims[i].updateFrameData(t);return this._frameData=t,void 0===e||null===e?this.frame=0:"string"==typeof e?this.frameName=e:this.frame=e,this.isLoaded=!0,!0},copyFrameData:function(t,e){if(this._frameData=t.clone(),this.isLoaded)for(var i in this._anims)this._anims[i].updateFrameData(this._frameData);return void 0===e||null===e?this.frame=0:"string"==typeof e?this.frameName=e:this.frame=e,this.isLoaded=!0,!0},add:function(t,i,s,n,r){return i=i||[],s=s||60,void 0===n&&(n=!1),void 0===r&&(r=!(!i||"number"!=typeof i[0])),this._outputFrames=[],this._frameData.getFrameIndexes(i,r,this._outputFrames),this._anims[t]=new e.Animation(this.game,this.sprite,t,this._frameData,this._outputFrames,s,n),this.currentAnim=this._anims[t],this.sprite.tilingTexture&&(this.sprite.refreshTexture=!0),this._anims[t]},validateFrames:function(t,e){void 0===e&&(e=!0);for(var i=0;i<t.length;i++)if(!0===e){if(t[i]>this._frameData.total)return!1}else if(!1===this._frameData.checkFrameName(t[i]))return!1;return!0},play:function(t,e,i,s){if(this._anims[t])return this.currentAnim===this._anims[t]?!1===this.currentAnim.isPlaying?(this.currentAnim.paused=!1,this.currentAnim.play(e,i,s)):this.currentAnim:(this.currentAnim&&this.currentAnim.isPlaying&&this.currentAnim.stop(),this.currentAnim=this._anims[t],this.currentAnim.paused=!1,this.currentFrame=this.currentAnim.currentFrame,this.currentAnim.play(e,i,s))},stop:function(t,e){void 0===e&&(e=!1),!this.currentAnim||"string"==typeof t&&t!==this.currentAnim.name||this.currentAnim.stop(e)},update:function(){return!(this.updateIfVisible&&!this.sprite.visible)&&(!(!this.currentAnim||!this.currentAnim.update())&&(this.currentFrame=this.currentAnim.currentFrame,!0))},next:function(t){this.currentAnim&&(this.currentAnim.next(t),this.currentFrame=this.currentAnim.currentFrame)},previous:function(t){this.currentAnim&&(this.currentAnim.previous(t),this.currentFrame=this.currentAnim.currentFrame)},getAnimation:function(t){return"string"==typeof t&&this._anims[t]?this._anims[t]:null},refreshFrame:function(){},destroy:function(){t=null;for(var t in this._anims)this._anims.hasOwnProperty(t)&&this._anims[t].destroy();this._anims={},this._outputFrames=[],this._frameData=null,this.currentAnim=null,this.currentFrame=null,this.sprite=null,this.game=null}},e.AnimationManager.prototype.constructor=e.AnimationManager,Object.defineProperty(e.AnimationManager.prototype,"frameData",{get:function(){return this._frameData}}),Object.defineProperty(e.AnimationManager.prototype,"frameTotal",{get:function(){return this._frameData.total}}),Object.defineProperty(e.AnimationManager.prototype,"paused",{get:function(){return this.currentAnim.isPaused},set:function(t){this.currentAnim.paused=t}}),Object.defineProperty(e.AnimationManager.prototype,"name",{get:function(){if(this.currentAnim)return this.currentAnim.name}}),Object.defineProperty(e.AnimationManager.prototype,"frame",{get:function(){if(this.currentFrame)return this.currentFrame.index},set:function(t){var e;"number"==typeof t&&this._frameData&&(e=this._frameData.getFrame(t))&&(this.currentFrame=e,this.sprite.setFrame(this.currentFrame))}}),Object.defineProperty(e.AnimationManager.prototype,"frameName",{get:function(){if(this.currentFrame)return this.currentFrame.name},set:function(t){var e;"string"==typeof t&&this._frameData&&(e=this._frameData.getFrameByName(t))?(this.currentFrame=e,this._frameIndex=this.currentFrame.index,this.sprite.setFrame(this.currentFrame)):console.warn("Cannot set frameName: "+t)}}),e.Animation=function(t,i,s,n,r,o,a){void 0===a&&(a=!1),this.game=t,this._parent=i,this._frameData=n,this.name=s,this._frames=[],this._frames=this._frames.concat(r),this.delay=1e3/o,this.loop=a,this.loopCount=0,this.killOnComplete=!1,this.isFinished=!1,this.isPlaying=!1,this.isPaused=!1,this._pauseStartTime=0,this._frameIndex=0,this._frameDiff=0,this._frameSkip=1,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart=new e.Signal,this.onUpdate=null,this.onComplete=new e.Signal,this.onLoop=new e.Signal,this.isReversed=!1,this.game.onPause.add(this.onPause,this),this.game.onResume.add(this.onResume,this)},e.Animation.prototype={play:function(t,e,i){return"number"==typeof t&&(this.delay=1e3/t),"boolean"==typeof e&&(this.loop=e),void 0!==i&&(this.killOnComplete=i),this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.time,this._timeNextFrame=this.game.time.time+this.delay,this._frameIndex=this.isReversed?this._frames.length-1:0,this.updateCurrentFrame(!1,!0),this._parent.events.onAnimationStart$dispatch(this._parent,this),this.onStart.dispatch(this._parent,this),this._parent.animations.currentAnim=this,this._parent.animations.currentFrame=this.currentFrame,this},restart:function(){this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.time,this._timeNextFrame=this.game.time.time+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this._parent.setFrame(this.currentFrame),this._parent.animations.currentAnim=this,this._parent.animations.currentFrame=this.currentFrame,this.onStart.dispatch(this._parent,this)},reverse:function(){return this.reversed=!this.reversed,this},reverseOnce:function(){return this.onComplete.addOnce(this.reverse,this),this.reverse()},setFrame:function(t,e){var i;if(void 0===e&&(e=!1),"string"==typeof t)for(s=0;s<this._frames.length;s++)this._frameData.getFrame(this._frames[s]).name===t&&(i=s);else if("number"==typeof t)if(e)i=t;else for(var s=0;s<this._frames.length;s++)this._frames[s]===t&&(i=s);if(i){var n=this.isReversed?-1:1;this._frameIndex=i-n,this._timeNextFrame=this.game.time.time,this.update()}},stop:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1),this.isPlaying=!1,this.isFinished=!0,this.paused=!1,t&&(this.currentFrame=this._frameData.getFrame(this._frames[0]),this._parent.setFrame(this.currentFrame)),e&&(this._parent.events.onAnimationComplete$dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this))},onPause:function(){this.isPlaying&&(this._frameDiff=this._timeNextFrame-this.game.time.time)},onResume:function(){this.isPlaying&&(this._timeNextFrame=this.game.time.time+this._frameDiff)},update:function(){return!this.isPaused&&(!!(this.isPlaying&&this.game.time.time>=this._timeNextFrame)&&(this._frameSkip=1,this._frameDiff=this.game.time.time-this._timeNextFrame,this._timeLastFrame=this.game.time.time,this._frameDiff>this.delay?(this._frameSkip=Math.floor(this._frameDiff/this.delay),this._frameDiff-=this._frameSkip*this.delay):this._frameDiff=0,this._timeNextFrame=this.game.time.time+(this.delay-this._frameDiff),this.isReversed?this._frameIndex-=this._frameSkip:this._frameIndex+=this._frameSkip,!this.isReversed&&this._frameIndex>=this._frames.length||this.isReversed&&this._frameIndex<=-1?this.loop?(this._frameIndex=Math.abs(this._frameIndex)%this._frames.length,this.isReversed&&(this._frameIndex=this._frames.length-1-this._frameIndex),this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&this._parent.setFrame(this.currentFrame),this.loopCount++,this._parent.events.onAnimationLoop$dispatch(this._parent,this),this.onLoop.dispatch(this._parent,this),!this.onUpdate||(this.onUpdate.dispatch(this,this.currentFrame),!!this._frameData)):(this.complete(),!1):this.updateCurrentFrame(!0)))},updateCurrentFrame:function(t,e){if(void 0===e&&(e=!1),!this._frameData)return!1;var i=this.currentFrame.index;return this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(e||!e&&i!==this.currentFrame.index)&&this._parent.setFrame(this.currentFrame),!this.onUpdate||!t||(this.onUpdate.dispatch(this,this.currentFrame),!!this._frameData)},next:function(t){void 0===t&&(t=1);var e=this._frameIndex+t;e>=this._frames.length&&(this.loop?e%=this._frames.length:e=this._frames.length-1),e!==this._frameIndex&&(this._frameIndex=e,this.updateCurrentFrame(!0))},previous:function(t){void 0===t&&(t=1);var e=this._frameIndex-t;e<0&&(this.loop?e=this._frames.length+e:e++),e!==this._frameIndex&&(this._frameIndex=e,this.updateCurrentFrame(!0))},updateFrameData:function(t){this._frameData=t,this.currentFrame=this._frameData?this._frameData.getFrame(this._frames[this._frameIndex%this._frames.length]):null},destroy:function(){this._frameData&&(this.game.onPause.remove(this.onPause,this),this.game.onResume.remove(this.onResume,this),this.game=null,this._parent=null,this._frames=null,this._frameData=null,this.currentFrame=null,this.isPlaying=!1,this.onStart.dispose(),this.onLoop.dispose(),this.onComplete.dispose(),this.onUpdate&&this.onUpdate.dispose())},complete:function(){this._frameIndex=this._frames.length-1,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.updateCurrentFrame(!1),this.isPlaying=!1,this.isFinished=!0,this.paused=!1,this._parent.events.onAnimationComplete$dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this),this.killOnComplete&&this._parent.kill()}},e.Animation.prototype.constructor=e.Animation,Object.defineProperty(e.Animation.prototype,"paused",{get:function(){return this.isPaused},set:function(t){this.isPaused=t,t?this._pauseStartTime=this.game.time.time:this.isPlaying&&(this._timeNextFrame=this.game.time.time+this.delay)}}),Object.defineProperty(e.Animation.prototype,"reversed",{get:function(){return this.isReversed},set:function(t){this.isReversed=t}}),Object.defineProperty(e.Animation.prototype,"frameTotal",{get:function(){return this._frames.length}}),Object.defineProperty(e.Animation.prototype,"frame",{get:function(){return null!==this.currentFrame?this.currentFrame.index:this._frameIndex},set:function(t){this.currentFrame=this._frameData.getFrame(this._frames[t]),null!==this.currentFrame&&(this._frameIndex=t,this._parent.setFrame(this.currentFrame),this.onUpdate&&this.onUpdate.dispatch(this,this.currentFrame))}}),Object.defineProperty(e.Animation.prototype,"speed",{get:function(){return 1e3/this.delay},set:function(t){t>0&&(this.delay=1e3/t)}}),Object.defineProperty(e.Animation.prototype,"enableUpdate",{get:function(){return null!==this.onUpdate},set:function(t){t&&null===this.onUpdate?this.onUpdate=new e.Signal:t||null===this.onUpdate||(this.onUpdate.dispose(),this.onUpdate=null)}}),e.Animation.generateFrameNames=function(t,i,s,n,r){void 0===n&&(n="");var o=[],a="";if(i<s)for(h=i;h<=s;h++)a=t+(a="number"==typeof r?e.Utils.pad(h.toString(),r,"0",1):h.toString())+n,o.push(a);else for(var h=i;h>=s;h--)a=t+(a="number"==typeof r?e.Utils.pad(h.toString(),r,"0",1):h.toString())+n,o.push(a);return o},e.Frame=function(t,i,s,n,r,o){this.index=t,this.x=i,this.y=s,this.width=n,this.height=r,0!==this.width&&0!==this.height||console.warn('Phaser.Frame: Frame "'+this.name+'" has a width or height of zero'),this.name=o,this.centerX=Math.floor(n/2),this.centerY=Math.floor(r/2),this.distance=e.Math.distance(0,0,n,r),this.rotated=!1,this.trimmed=!1,this.sourceSizeW=n,this.sourceSizeH=r,this.spriteSourceSizeX=0,this.spriteSourceSizeY=0,this.spriteSourceSizeW=0,this.spriteSourceSizeH=0,this.right=this.x+this.width,this.bottom=this.y+this.height},e.Frame.prototype={resize:function(t,i){this.width=t,this.height=i,this.centerX=Math.floor(t/2),this.centerY=Math.floor(i/2),this.distance=e.Math.distance(0,0,t,i),this.sourceSizeW=t,this.sourceSizeH=i,this.right=this.x+t,this.bottom=this.y+i},setTrim:function(t,e,i,s,n,r,o){this.trimmed=t,t&&(this.sourceSizeW=e,this.sourceSizeH=i,this.centerX=Math.floor(e/2),this.centerY=Math.floor(i/2),this.spriteSourceSizeX=s,this.spriteSourceSizeY=n,this.spriteSourceSizeW=r,this.spriteSourceSizeH=o)},clone:function(){var t=new e.Frame(this.index,this.x,this.y,this.width,this.height,this.name);for(var i in this)this.hasOwnProperty(i)&&(t[i]=this[i]);return t},getRect:function(t){return void 0===t?t=new e.Rectangle(this.x,this.y,this.width,this.height):t.setTo(this.x,this.y,this.width,this.height),t}},e.Frame.prototype.constructor=e.Frame,e.FrameData=function(){this._frames=[],this._frameNames=[]},e.FrameData.prototype={addFrame:function(t){return t.index=this._frames.length,this._frames.push(t),""!==t.name&&(this._frameNames[t.name]=t.index),t},getFrame:function(t){return t>=this._frames.length&&(t=0),this._frames[t]},getFrameByName:function(t){return"number"==typeof this._frameNames[t]?this._frames[this._frameNames[t]]:null},checkFrameName:function(t){return null!=this._frameNames[t]},clone:function(){for(var t=new e.FrameData,i=0;i<this._frames.length;i++)t._frames.push(this._frames[i].clone());for(var s in this._frameNames)this._frameNames.hasOwnProperty(s)&&t._frameNames.push(this._frameNames[s]);return t},getFrameRange:function(t,e,i){void 0===i&&(i=[]);for(var s=t;s<=e;s++)i.push(this._frames[s]);return i},getFrames:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=[]),void 0===t||0===t.length)for(s=0;s<this._frames.length;s++)i.push(this._frames[s]);else for(var s=0;s<t.length;s++)e?i.push(this.getFrame(t[s])):i.push(this.getFrameByName(t[s]));return i},getFrameIndexes:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=[]),void 0===t||0===t.length)for(s=0;s<this._frames.length;s++)i.push(this._frames[s].index);else for(var s=0;s<t.length;s++)e&&this._frames[t[s]]?i.push(this._frames[t[s]].index):this.getFrameByName(t[s])&&i.push(this.getFrameByName(t[s]).index);return i},destroy:function(){this._frames=null,this._frameNames=null}},e.FrameData.prototype.constructor=e.FrameData,Object.defineProperty(e.FrameData.prototype,"total",{get:function(){return this._frames.length}}),e.AnimationParser={spriteSheet:function(t,i,s,n,r,o,a,h){void 0===r&&(r=-1),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0);var l=i;if("string"==typeof i?l=t.cache.getImage(i):i=l.name,null===l)return null;if(s<=0||n<=0)return console.warn("Phaser.AnimationParser.spriteSheet: '%s' frameWidth (%s) or frameHeight (%s) must be positive",i,s,n),null;var c=l.width,u=l.height;if(0===c||0===u)return console.warn("Phaser.AnimationParser.spriteSheet: '%s' width (%s) or height (%s) is zero",i,c,u),null;if(c<s||u<n)return console.warn("Phaser.AnimationParser.spriteSheet: '%s' width (%s) or height (%s) is less than the given frameWidth (%s) or frameHeight (%s)",i,c,u,s,n),null;var d=Math.floor((c-o)/(s+a)),p=Math.floor((u-o)/(n+a)),f=d*p,g=f,m=f-1,y=0,v=m;if(h>f||h<-f)return console.warn("Phaser.AnimationParser.spriteSheet: '%s' skipFrames = %s is larger than the frame total %s",i,h,f),null;if(r>-1&&(v=(f=r)-1),d<1&&console.warn("Phaser.AnimationParser.spriteSheet: image '%s' has width %d, but it should be at least %d (frameWidth=%s, margin=%s, spacing=%s)",i,c,s+o+a,s,o,a),p<1&&console.warn("Phaser.AnimationParser.spriteSheet: image '%s' has height %d, but it should be at least %d (frameHeight=%s, margin=%s, spacing=%s)",i,u,n+o+a,n,o,a),0===g)return console.warn("Phaser.AnimationParser.spriteSheet: '%s' zero frames were produced",i),null;if(h>0?v=(y=h)+(f=Math.min(f,g-h))-1:h<0&&(y=(v=m+h)-(f=Math.min(f,g+h))+1),y<0)return console.warn("First frame index %s is outside of range [0, %d]",y,m),null;if(v>m)return console.warn("Last frame index %s is outside of range [0, %d]",v,m),null;for(var x=new e.FrameData,b=o,_=o,w=0,T=0;T<g&&!(T>v);T++)T>=y&&x.addFrame(new e.Frame(w++,b,_,s,n,"")),(b+=s+a)+s>c&&(b=o,_+=n+a);return x},JSONData:function(t,i){if(!i.frames)return console.warn("Phaser.AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array"),void console.log(i);for(var s,n=new e.FrameData,r=i.frames,o=0;o<r.length;o++)s=n.addFrame(new e.Frame(o,r[o].frame.x,r[o].frame.y,r[o].frame.w,r[o].frame.h,r[o].filename)),r[o].trimmed&&s.setTrim(r[o].trimmed,r[o].sourceSize.w,r[o].sourceSize.h,r[o].spriteSourceSize.x,r[o].spriteSourceSize.y,r[o].spriteSourceSize.w,r[o].spriteSourceSize.h),r[o].rotated&&(s.rotated=!0);return n},JSONDataPyxel:function(t,i){if(["layers","tilewidth","tileheight","tileswide","tileshigh"].forEach(function(t){if(!i[t])return console.warn('Phaser.AnimationParser.JSONDataPyxel: Invalid Pyxel Tilemap JSON given, missing "'+t+'" key.'),void console.log(i)}),1!==i.layers.length)return console.warn("Phaser.AnimationParser.JSONDataPyxel: Too many layers, this parser only supports flat Tilemaps."),void console.log(i);for(var s=new e.FrameData,n=i.tileheight,r=i.tilewidth,o=i.layers[0].tiles,a=0;a<o.length;a++)s.addFrame(new e.Frame(a,o[a].x,o[a].y,r,n,"frame_"+a)).setTrim(!1);return s},JSONDataHash:function(t,i){if(!i.frames)return console.warn("Phaser.AnimationParser.JSONDataHash: Invalid Texture Atlas JSON given, missing 'frames' object"),void console.log(i);var s,n=new e.FrameData,r=i.frames,o=0;for(var a in r)s=n.addFrame(new e.Frame(o,r[a].frame.x,r[a].frame.y,r[a].frame.w,r[a].frame.h,a)),r[a].trimmed&&s.setTrim(r[a].trimmed,r[a].sourceSize.w,r[a].sourceSize.h,r[a].spriteSourceSize.x,r[a].spriteSourceSize.y,r[a].spriteSourceSize.w,r[a].spriteSourceSize.h),r[a].rotated&&(s.rotated=!0),o++;return n},XMLData:function(t,i){if(i.getElementsByTagName("TextureAtlas")){for(var s,n,r,o,a,h,l,c,u,d,p,f=new e.FrameData,g=i.getElementsByTagName("SubTexture"),m=0;m<g.length;m++)n=(r=g[m].attributes).name.value,o=parseInt(r.x.value,10),a=parseInt(r.y.value,10),h=parseInt(r.width.value,10),l=parseInt(r.height.value,10),c=null,u=null,r.frameX&&(c=Math.abs(parseInt(r.frameX.value,10)),u=Math.abs(parseInt(r.frameY.value,10)),d=parseInt(r.frameWidth.value,10),p=parseInt(r.frameHeight.value,10)),s=f.addFrame(new e.Frame(m,o,a,h,l,n)),null===c&&null===u||s.setTrim(!0,h,l,c,u,d,p);return f}console.warn("Phaser.AnimationParser.XMLData: Invalid Texture Atlas XML given, missing <TextureAtlas> tag")}},e.Cache=function(t){this.game=t,this.autoResolveURL=!1,this._cache={canvas:{},image:{},texture:{},sound:{},video:{},text:{},json:{},xml:{},physics:{},tilemap:{},binary:{},bitmapData:{},bitmapFont:{},shader:{},renderTexture:{},compressedTexture:{}},this._urlMap={},this._urlResolver=new Image,this._urlTemp=null,this.onSoundUnlock=new e.Signal,this._cacheMap=[],this._cacheMap[e.Cache.CANVAS]=this._cache.canvas,this._cacheMap[e.Cache.IMAGE]=this._cache.image,this._cacheMap[e.Cache.TEXTURE]=this._cache.texture,this._cacheMap[e.Cache.SOUND]=this._cache.sound,this._cacheMap[e.Cache.TEXT]=this._cache.text,this._cacheMap[e.Cache.PHYSICS]=this._cache.physics,this._cacheMap[e.Cache.TILEMAP]=this._cache.tilemap,this._cacheMap[e.Cache.BINARY]=this._cache.binary,this._cacheMap[e.Cache.BITMAPDATA]=this._cache.bitmapData,this._cacheMap[e.Cache.BITMAPFONT]=this._cache.bitmapFont,this._cacheMap[e.Cache.JSON]=this._cache.json,this._cacheMap[e.Cache.XML]=this._cache.xml,this._cacheMap[e.Cache.VIDEO]=this._cache.video,this._cacheMap[e.Cache.SHADER]=this._cache.shader,this._cacheMap[e.Cache.RENDER_TEXTURE]=this._cache.renderTexture,this._pendingCount=0,this.onReady=new e.Signal,this._addImages()},e.Cache.CANVAS=1,e.Cache.IMAGE=2,e.Cache.TEXTURE=3,e.Cache.SOUND=4,e.Cache.TEXT=5,e.Cache.PHYSICS=6,e.Cache.TILEMAP=7,e.Cache.BINARY=8,e.Cache.BITMAPDATA=9,e.Cache.BITMAPFONT=10,e.Cache.JSON=11,e.Cache.XML=12,e.Cache.VIDEO=13,e.Cache.SHADER=14,e.Cache.RENDER_TEXTURE=15,e.Cache.DEFAULT=null,e.Cache.DEFAULT_KEY="__default",e.Cache.DEFAULT_SRC="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg==",e.Cache.MISSING=null,e.Cache.MISSING_KEY="__missing",e.Cache.MISSING_SRC="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg==",e.Cache.READY_TIMEOUT=1e3,e.Cache.prototype={addCompressedTextureMetaData:function(t,i,s,n){this.checkImageKey(t)&&this.removeImage(t);var r=s in e.LoaderParser?e.LoaderParser[s](n):n,o={key:t,url:i,data:r,base:new PIXI.BaseTexture(r,null,this.game.resolution),frame:new e.Frame(0,0,0,r.width,r.height,t),frameData:new e.FrameData,fileFormat:s};return o.frameData.addFrame(new e.Frame(0,0,0,r.width,r.height,i)),this._cache.image[t]=o,this._resolveURL(i,o),o},addCanvas:function(t,e,i){void 0===i&&(i=e.getContext("2d")),this._cache.canvas[t]={canvas:e,context:i}},addImage:function(t,i,s){this.checkImageKey(t)&&this.removeImage(t),!1===s.complete&&console.warn('Phaser.Cache.addImage: Image "'+t+"\" hasn't been retrieved yet");var n={key:t,url:i,data:s,base:new PIXI.BaseTexture(s,null,this.game.resolution),frame:new e.Frame(0,0,0,s.width,s.height,t),frameData:new e.FrameData};return n.frameData.addFrame(new e.Frame(0,0,0,s.width,s.height,i)),this._cache.image[t]=n,this._resolveURL(i,n),"__default"===t?e.Cache.DEFAULT=new PIXI.Texture(n.base):"__missing"===t&&(e.Cache.MISSING=new PIXI.Texture(n.base)),n},addImageAsync:function(t,e,i){var s=this,n=new Image;n.onload=function(){i.call(this,s.addImage(t,null,n)),s._removePending(),n.onload=null},this._addPending(),n.src=e},addDefaultImage:function(){this.addImageAsync(e.Cache.DEFAULT_KEY,e.Cache.DEFAULT_SRC,function(t){t.base.skipRender=!0,e.Cache.DEFAULT=new PIXI.Texture(t.base)})},addMissingImage:function(){this.addImageAsync(e.Cache.MISSING_KEY,e.Cache.MISSING_SRC,function(t){e.Cache.MISSING=new PIXI.Texture(t.base)})},addSound:function(t,e,i,s,n){void 0===s&&(s=!0,n=!1),void 0===n&&(s=!1,n=!0);var r=!1;n&&(r=!0),this._cache.sound[t]={url:e,data:i,isDecoding:!1,decoded:r,webAudio:s,audioTag:n,locked:this.game.sound.touchLocked},this._resolveURL(e,this._cache.sound[t])},addText:function(t,e,i){this._cache.text[t]={url:e,data:i},this._resolveURL(e,this._cache.text[t])},addPhysicsData:function(t,e,i,s){this._cache.physics[t]={url:e,data:i,format:s},this._resolveURL(e,this._cache.physics[t])},addTilemap:function(t,e,i,s){this._cache.tilemap[t]={url:e,data:i,format:s},this._resolveURL(e,this._cache.tilemap[t])},addBinary:function(t,e){this._cache.binary[t]=e},addBitmapData:function(t,i,s){return i.key=t,void 0===s&&(s=new e.FrameData).addFrame(i.textureFrame),this._cache.bitmapData[t]={data:i,frameData:s},i},addBitmapFont:function(t,i,s,n,r,o,a){var h={url:i,data:s,font:null,base:new PIXI.BaseTexture(s,null,this.game.resolution)};void 0===o&&(o=0),void 0===a&&(a=0),h.font="json"===r?e.LoaderParser.jsonBitmapFont(n,h.base,o,a,!1,this.game.resolution):e.LoaderParser.xmlBitmapFont(n,h.base,o,a,!1,this.game.resolution),this._cache.bitmapFont[t]=h,this._resolveURL(i,h)},addBitmapFontFromAtlas:function(t,i,s,n,r,o,a){var h=this.getFrameByName(i,s);if(h){var l={font:null,base:this.getBaseTexture(i),frame:h};void 0===o&&(o=0),void 0===a&&(a=0);var c;"json"===r?(c=this.getJSON(n),l.font=e.LoaderParser.jsonBitmapFont(c,l.base,o,a,h,this.game.resolution)):(c=this.getXML(n),l.font=e.LoaderParser.xmlBitmapFont(c,l.base,o,a,h,this.game.resolution)),this._cache.bitmapFont[t]=l}},addJSON:function(t,e,i){this._cache.json[t]={url:e,data:i},this._resolveURL(e,this._cache.json[t])},addXML:function(t,e,i){this._cache.xml[t]={url:e,data:i},this._resolveURL(e,this._cache.xml[t])},addVideo:function(t,e,i,s){this._cache.video[t]={url:e,data:i,isBlob:s,locked:!0},this._resolveURL(e,this._cache.video[t])},addShader:function(t,e,i){this._cache.shader[t]={url:e,data:i},this._resolveURL(e,this._cache.shader[t])},addRenderTexture:function(t,i){this._cache.renderTexture[t]={texture:i,frame:new e.Frame(0,0,0,i.width,i.height,"","")}},addSpriteSheet:function(t,i,s,n,r,o,a,h,l){void 0===o&&(o=-1),void 0===a&&(a=0),void 0===h&&(h=0);var c={key:t,url:i,data:s,frameWidth:n,frameHeight:r,margin:a,spacing:h,base:new PIXI.BaseTexture(s,null,this.game.resolution),frameData:e.AnimationParser.spriteSheet(this.game,s,n,r,o,a,h,l)};this._cache.image[t]=c,this._resolveURL(i,c)},addTextureAtlas:function(t,i,s,n,r){var o={key:t,url:i,data:s,base:new PIXI.BaseTexture(s,null,this.game.resolution)};r===e.Loader.TEXTURE_ATLAS_XML_STARLING?o.frameData=e.AnimationParser.XMLData(this.game,n,t):r===e.Loader.TEXTURE_ATLAS_JSON_PYXEL?o.frameData=e.AnimationParser.JSONDataPyxel(this.game,n,t):Array.isArray(n.frames)?o.frameData=e.AnimationParser.JSONData(this.game,n,t):o.frameData=e.AnimationParser.JSONDataHash(this.game,n,t),this._cache.image[t]=o,this._resolveURL(i,o)},reloadSound:function(t){var e=this,i=this.getSound(t);i&&(i.data.src=i.url,i.data.addEventListener("canplaythrough",function(){return e.reloadSoundComplete(t)},!1),i.data.load())},reloadSoundComplete:function(t){var e=this.getSound(t);e&&(e.locked=!1,this.onSoundUnlock.dispatch(t))},updateSound:function(t,e,i){var s=this.getSound(t);s&&(s[e]=i)},decodedSound:function(t,e){var i=this.getSound(t);i.data=e,i.decoded=!0,i.isDecoding=!1},isSoundDecoded:function(t){var i=this.getItem(t,e.Cache.SOUND,"isSoundDecoded");if(i)return i.decoded},isSoundReady:function(t){var i=this.getItem(t,e.Cache.SOUND,"isSoundDecoded");if(i)return i.decoded&&!this.game.sound.touchLocked},checkKey:function(t,e){return!!this._cacheMap[t][e]},checkURL:function(t){return!!this._urlMap[this._resolveURL(t)]},checkCanvasKey:function(t){return this.checkKey(e.Cache.CANVAS,t)},checkImageKey:function(t){return this.checkKey(e.Cache.IMAGE,t)},checkTextureKey:function(t){return this.checkKey(e.Cache.TEXTURE,t)},checkSoundKey:function(t){return this.checkKey(e.Cache.SOUND,t)},checkTextKey:function(t){return this.checkKey(e.Cache.TEXT,t)},checkPhysicsKey:function(t){return this.checkKey(e.Cache.PHYSICS,t)},checkTilemapKey:function(t){return this.checkKey(e.Cache.TILEMAP,t)},checkBinaryKey:function(t){return this.checkKey(e.Cache.BINARY,t)},checkBitmapDataKey:function(t){return this.checkKey(e.Cache.BITMAPDATA,t)},checkBitmapFontKey:function(t){return this.checkKey(e.Cache.BITMAPFONT,t)},checkJSONKey:function(t){return this.checkKey(e.Cache.JSON,t)},checkXMLKey:function(t){return this.checkKey(e.Cache.XML,t)},checkVideoKey:function(t){return this.checkKey(e.Cache.VIDEO,t)},checkShaderKey:function(t){return this.checkKey(e.Cache.SHADER,t)},checkRenderTextureKey:function(t){return this.checkKey(e.Cache.RENDER_TEXTURE,t)},getItem:function(t,e,i,s){return this.checkKey(e,t)?void 0===s?this._cacheMap[e][t]:this._cacheMap[e][t][s]:(i&&console.warn("Phaser.Cache."+i+': Key "'+t+'" not found in Cache.'),null)},getCanvas:function(t){return this.getItem(t,e.Cache.CANVAS,"getCanvas","canvas")},getImage:function(t,i){void 0!==t&&null!==t||(t="__default"),void 0===i&&(i=!1);var s=this.getItem(t,e.Cache.IMAGE,"getImage");return null===s&&(s=this.getItem("__missing",e.Cache.IMAGE,"getImage")),i?s:s.data},getTextureFrame:function(t){return this.getItem(t,e.Cache.TEXTURE,"getTextureFrame","frame")},getSound:function(t){return this.getItem(t,e.Cache.SOUND,"getSound")},getSoundData:function(t){return this.getItem(t,e.Cache.SOUND,"getSoundData","data")},getText:function(t){return this.getItem(t,e.Cache.TEXT,"getText","data")},getPhysicsData:function(t,i,s){var n=this.getItem(t,e.Cache.PHYSICS,"getPhysicsData","data");if(null===n||void 0===i||null===i)return n;if(n[i]){var r=n[i];if(!r||!s)return r;for(var o in r)if((o=r[o]).fixtureKey===s)return o;console.warn('Phaser.Cache.getPhysicsData: Could not find given fixtureKey: "'+s+" in "+t+'"')}else console.warn('Phaser.Cache.getPhysicsData: Invalid key/object: "'+t+" / "+i+'"');return null},getTilemapData:function(t){return this.getItem(t,e.Cache.TILEMAP,"getTilemapData")},getBinary:function(t){return this.getItem(t,e.Cache.BINARY,"getBinary")},getBitmapData:function(t){return this.getItem(t,e.Cache.BITMAPDATA,"getBitmapData","data")},getBitmapFont:function(t){return this.getItem(t,e.Cache.BITMAPFONT,"getBitmapFont")},getJSON:function(t,i){var s=this.getItem(t,e.Cache.JSON,"getJSON","data");return s?i?e.Utils.extend(!0,Array.isArray(s)?[]:{},s):s:null},getXML:function(t){return this.getItem(t,e.Cache.XML,"getXML","data")},getVideo:function(t){return this.getItem(t,e.Cache.VIDEO,"getVideo")},getShader:function(t){return this.getItem(t,e.Cache.SHADER,"getShader","data")},getRenderTexture:function(t){return this.getItem(t,e.Cache.RENDER_TEXTURE,"getRenderTexture")},getBaseTexture:function(t,i){return void 0===i&&(i=e.Cache.IMAGE),this.getItem(t,i,"getBaseTexture","base")},getFrame:function(t,i){return void 0===i&&(i=e.Cache.IMAGE),this.getItem(t,i,"getFrame","frame")},getFrameCount:function(t,e){var i=this.getFrameData(t,e);return i?i.total:0},getFrameData:function(t,i){return void 0===i&&(i=e.Cache.IMAGE),this.getItem(t,i,"getFrameData","frameData")},hasFrameData:function(t,i){return void 0===i&&(i=e.Cache.IMAGE),null!==this.getItem(t,i,"","frameData")},updateFrameData:function(t,i,s){void 0===s&&(s=e.Cache.IMAGE),this._cacheMap[s][t]&&(this._cacheMap[s][t].frameData=i)},getFrameByIndex:function(t,e,i){var s=this.getFrameData(t,i);return s?s.getFrame(e):null},getFrameByName:function(t,e,i){var s=this.getFrameData(t,i);return s?s.getFrameByName(e):null},getURL:function(t){return(t=this._resolveURL(t))?this._urlMap[t]:(console.warn('Phaser.Cache.getUrl: Invalid url: "'+t+'" or Cache.autoResolveURL was false'),null)},getKeys:function(t){void 0===t&&(t=e.Cache.IMAGE);var i=[];if(this._cacheMap[t])for(var s in this._cacheMap[t])"__default"!==s&&"__missing"!==s&&i.push(s);return i},removeCanvas:function(t){delete this._cache.canvas[t]},removeImage:function(t,e){void 0===e&&(e=!0);var i=this.getImage(t,!0);e&&i.base&&i.base.destroy(),delete this._cache.image[t]},removeSound:function(t){delete this._cache.sound[t]},removeText:function(t){delete this._cache.text[t]},removePhysics:function(t){delete this._cache.physics[t]},removeTilemap:function(t){delete this._cache.tilemap[t]},removeBinary:function(t){delete this._cache.binary[t]},removeBitmapData:function(t){delete this._cache.bitmapData[t]},removeBitmapFont:function(t){delete this._cache.bitmapFont[t]},removeJSON:function(t){delete this._cache.json[t]},removeXML:function(t){delete this._cache.xml[t]},removeVideo:function(t){delete this._cache.video[t]},removeShader:function(t){delete this._cache.shader[t]},removeRenderTexture:function(t){delete this._cache.renderTexture[t]},removeSpriteSheet:function(t){delete this._cache.spriteSheet[t]},removeTextureAtlas:function(t){delete this._cache.image[t]},clearGLTextures:function(){for(var t in this._cache.image)this._cache.image[t].base._glTextures=[]},_resolveURL:function(t,e){return this.autoResolveURL?(this._urlResolver.src=this.game.load.baseURL+t,this._urlTemp=this._urlResolver.src,this._urlResolver.src="",e&&(this._urlMap[this._urlTemp]=e),this._urlTemp):null},destroy:function(){for(var t=0;t<this._cacheMap.length;t++){var e=this._cacheMap[t];for(var i in e)"__default"!==i&&"__missing"!==i&&(this.destroyItem(e[i]),delete e[i])}this._urlMap=null,this._urlResolver=null,this._urlTemp=null},destroyItem:function(t){t.destroy?t.destroy():(t.base&&t.base.destroy&&t.base.destroy(),t.data&&t.data.destroy&&t.data.destroy(),t.frameData&&t.frameData.destroy&&t.frameData.destroy(),t.texture&&t.texture.destroy&&t.texture.destroy(!0))},_addImages:function(){this._pendingCount=0,this.addDefaultImage(),this.addMissingImage();var t=this,i=e.Cache.READY_TIMEOUT;e.Cache.READY_TIMEOUT>0?setTimeout(function(){t.isReady||(console.warn("Phaser.Cache: Still waiting for images after %s ms.",i),t._ready())},e.Cache.READY_TIMEOUT):this._ready()},_addPending:function(){this._pendingCount+=1},_removePending:function(){this._pendingCount-=1,this._checkReady()},_checkReady:function(){this.isReady&&this._ready()},_ready:function(){this._pendingCount=0,this.onReady.dispatch(this)}},e.Cache.prototype.constructor=e.Cache,Object.defineProperty(e.Cache.prototype,"isReady",{get:function(){return this._pendingCount<=0}}),e.Loader=function(t){this.game=t,this.cache=t.cache,this.resetLocked=!1,this.isLoading=!1,this.hasLoaded=!1,this.preloadSprite=null,this.crossOrigin=!1,this.baseURL="",this.path="",this.headers={requestedWith:!1,json:"application/json",xml:"application/xml"},this.onLoadStart=new e.Signal,this.onBeforeLoadComplete=new e.Signal,this.onLoadComplete=new e.Signal,this.onPackComplete=new e.Signal,this.onFileStart=new e.Signal,this.onFileComplete=new e.Signal,this.onFileError=new e.Signal,this.enableParallel=!0,this.maxParallelDownloads=4,this._withSyncPointDepth=0,this._fileList=[],this._flightQueue=[],this._processingHead=0,this._fileLoadStarted=!1,this._totalPackCount=0,this._totalFileCount=0,this._loadedPackCount=0,this._loadedFileCount=0},e.Loader.TEXTURE_ATLAS_JSON_ARRAY=0,e.Loader.TEXTURE_ATLAS_JSON_HASH=1,e.Loader.TEXTURE_ATLAS_XML_STARLING=2,e.Loader.PHYSICS_LIME_CORONA_JSON=3,e.Loader.PHYSICS_PHASER_JSON=4,e.Loader.TEXTURE_ATLAS_JSON_PYXEL=5,e.Loader.prototype={setPreloadSprite:function(t,i){i=i||0,this.preloadSprite={sprite:t,direction:i,width:t.width,height:t.height,rect:null},this.preloadSprite.rect=0===i?new e.Rectangle(0,0,1,t.height):new e.Rectangle(0,0,t.width,1),t.crop(this.preloadSprite.rect),t.visible=!0},resize:function(){this.preloadSprite&&this.preloadSprite.height!==this.preloadSprite.sprite.height&&(this.preloadSprite.rect.height=this.preloadSprite.sprite.height)},checkKeyExists:function(t,e){return this.getAssetIndex(t,e)>-1},getAssetIndex:function(t,e){for(var i=-1,s=0;s<this._fileList.length;s++){var n=this._fileList[s];if(n.type===t&&n.key===e&&(i=s,!n.loaded&&!n.loading))break}return i},getAsset:function(t,e){var i=this.getAssetIndex(t,e);return i>-1&&{index:i,file:this._fileList[i]}},reset:function(t,e){void 0===e&&(e=!1),this.resetLocked||(t&&(this.preloadSprite=null),this.isLoading=!1,this._processingHead=0,this._fileList.length=0,this._flightQueue.length=0,this._fileLoadStarted=!1,this._totalFileCount=0,this._totalPackCount=0,this._loadedPackCount=0,this._loadedFileCount=0,e&&(this.onLoadStart.removeAll(),this.onLoadComplete.removeAll(),this.onPackComplete.removeAll(),this.onFileStart.removeAll(),this.onFileComplete.removeAll(),this.onFileError.removeAll()))},addToFileList:function(t,e,i,s,n,r){if(void 0===n&&(n=!1),void 0===e||""===e)return console.warn("Phaser.Loader: Invalid or no key given of type "+t),this;if(void 0===i||null===i){if(!r)return console.warn("Phaser.Loader: No URL given for file type: "+t+" key: "+e),this;i=e+r}var o={type:t,key:e,path:this.path,url:i,syncPoint:this._withSyncPointDepth>0,data:null,loading:!1,loaded:!1,error:!1};if(s)for(var a in s)o[a]=s[a];var h=this.getAssetIndex(t,e);if(n&&h>-1){var l=this._fileList[h];l.loading||l.loaded?(this._fileList.push(o),this._totalFileCount++):this._fileList[h]=o}else-1===h&&(this._fileList.push(o),this._totalFileCount++);return this},replaceInFileList:function(t,e,i,s){return this.addToFileList(t,e,i,s,!0)},pack:function(t,e,i,s){if(void 0===e&&(e=null),void 0===i&&(i=null),void 0===s&&(s=null),!e&&!i)return console.warn("Phaser.Loader.pack - Both url and data are null. One must be set."),this;var n={type:"packfile",key:t,url:e,path:this.path,syncPoint:!0,data:null,loading:!1,loaded:!1,error:!1,callbackContext:s};i&&("string"==typeof i&&(i=JSON.parse(i)),n.data=i||{},n.loaded=!0);for(var r=0;r<this._fileList.length+1;r++){var o=this._fileList[r];if(!o||!o.loaded&&!o.loading&&"packfile"!==o.type){this._fileList.splice(r,0,n),this._totalPackCount++;break}}return this},image:function(t,e,i){return"object"==typeof e?this.texture(t,e,i):this.addToFileList("image",t,e,void 0,i,".png")},imageFromBitmapData:function(t,e,i){return this.image(t,e.canvas.toDataURL("image/png"),i)},imageFromGrid:function(t,e,i,s,n,r){return this.imageFromBitmapData(t,this.game.create.grid(t,e,i,s,n,r,!1))},imageFromTexture:function(t,e,i,s,n){return this.imageFromBitmapData(t,this.game.create.texture(t,e,i,s,n,!1))},texture:function(t,i,s){if(this.game.renderType===e.WEBGL){var n,r=this.game.renderer.extensions.compression;for(n in i)if(n.toUpperCase()in r)return this.addToFileList("texture",t,i[n],void 0,s,".pvr")}return i.truecolor&&this.addToFileList("image",t,i.truecolor,void 0,s,".png"),this},images:function(t,e){if(Array.isArray(e))for(i=0;i<t.length;i++)this.image(t[i],e[i]);else for(var i=0;i<t.length;i++)this.image(t[i]);return this},text:function(t,e,i){return this.addToFileList("text",t,e,void 0,i,".txt")},json:function(t,e,i){return this.addToFileList("json",t,e,void 0,i,".json")},shader:function(t,e,i){return this.addToFileList("shader",t,e,void 0,i,".frag")},xml:function(t,e,i){return this.addToFileList("xml",t,e,void 0,i,".xml")},script:function(t,e,i,s){return void 0===i&&(i=!1),!1!==i&&void 0===s&&(s=this),this.addToFileList("script",t,e,{syncPoint:!0,callback:i,callbackContext:s},!1,".js")},binary:function(t,e,i,s){return void 0===i&&(i=!1),!1!==i&&void 0===s&&(s=i),this.addToFileList("binary",t,e,{callback:i,callbackContext:s},!1,".bin")},spritesheet:function(t,e,i,s,n,r,o,a){return void 0===n&&(n=-1),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=0),this.addToFileList("spritesheet",t,e,{frameWidth:i,frameHeight:s,frameMax:n,margin:r,spacing:o,skipFrames:a},!1,".png")},audio:function(t,e,i){return this.game.sound.noAudio?this:(void 0===i&&(i=!0),"string"==typeof e&&(e=[e]),this.addToFileList("audio",t,e,{buffer:null,autoDecode:i}))},audioSprite:function(t,e,i,s,n){return this.game.sound.noAudio?this:(void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=!0),this.audio(t,e,n),i?this.json(t+"-audioatlas",i):s?("string"==typeof s&&(s=JSON.parse(s)),this.cache.addJSON(t+"-audioatlas","",s)):console.warn("Phaser.Loader.audiosprite - You must specify either a jsonURL or provide a jsonData object"),this)},audiosprite:function(t,e,i,s,n){return this.audioSprite(t,e,i,s,n)},video:function(t,e,i,s){return void 0===i&&(i=this.game.device.firefox?"loadeddata":"canplaythrough"),void 0===s&&(s=!1),"string"==typeof e&&(e=[e]),this.addToFileList("video",t,e,{buffer:null,asBlob:s,loadEvent:i})},tilemap:function(t,i,s,n){if(void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=e.Tilemap.CSV),i||s||(i=n===e.Tilemap.CSV?t+".csv":t+".json"),s){switch(n){case e.Tilemap.CSV:break;case e.Tilemap.TILED_JSON:"string"==typeof s&&(s=JSON.parse(s))}this.cache.addTilemap(t,null,s,n)}else this.addToFileList("tilemap",t,i,{format:n});return this},physics:function(t,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=e.Physics.LIME_CORONA_JSON),i||s||(i=t+".json"),s?("string"==typeof s&&(s=JSON.parse(s)),this.cache.addPhysicsData(t,null,s,n)):this.addToFileList("physics",t,i,{format:n}),this},bitmapFont:function(t,e,i,s,n,r){if(void 0!==e&&null!==e||(e=t+".png"),void 0===i&&(i=null),void 0===s&&(s=null),null===i&&null===s&&(i=t+".xml"),void 0===n&&(n=0),void 0===r&&(r=0),i)this.addToFileList("bitmapfont",t,e,{atlasURL:i,xSpacing:n,ySpacing:r});else if("string"==typeof s){var o,a;try{o=JSON.parse(s)}catch(t){a=this.parseXml(s)}if(!a&&!o)throw new Error("Phaser.Loader. Invalid Bitmap Font atlas given");this.addToFileList("bitmapfont",t,e,{atlasURL:null,atlasData:o||a,atlasType:o?"json":"xml",xSpacing:n,ySpacing:r})}return this},atlasJSONArray:function(t,i,s,n){return this.atlas(t,i,s,n,e.Loader.TEXTURE_ATLAS_JSON_ARRAY)},atlasJSONHash:function(t,i,s,n){return this.atlas(t,i,s,n,e.Loader.TEXTURE_ATLAS_JSON_HASH)},atlasXML:function(t,i,s,n){return void 0===s&&(s=null),void 0===n&&(n=null),s||n||(s=t+".xml"),this.atlas(t,i,s,n,e.Loader.TEXTURE_ATLAS_XML_STARLING)},atlas:function(t,i,s,n,r){if(void 0!==i&&null!==i||(i=t+".png"),void 0===s&&(s=null),void 0===n&&(n=null),void 0===r&&(r=e.Loader.TEXTURE_ATLAS_JSON_ARRAY),s||n||(s=r===e.Loader.TEXTURE_ATLAS_XML_STARLING?t+".xml":t+".json"),s)this.addToFileList("textureatlas",t,i,{atlasURL:s,format:r});else{switch(r){case e.Loader.TEXTURE_ATLAS_JSON_ARRAY:"string"==typeof n&&(n=JSON.parse(n));break;case e.Loader.TEXTURE_ATLAS_XML_STARLING:if("string"==typeof n){var o=this.parseXml(n);if(!o)throw new Error("Phaser.Loader. Invalid Texture Atlas XML given");n=o}}this.addToFileList("textureatlas",t,i,{atlasURL:null,atlasData:n,format:r})}return this},withSyncPoint:function(t,e){this._withSyncPointDepth++;try{t.call(e||this,this)}finally{this._withSyncPointDepth--}return this},addSyncPoint:function(t,e){var i=this.getAsset(t,e);return i&&(i.file.syncPoint=!0),this},removeFile:function(t,e){var i=this.getAsset(t,e);i&&(i.loaded||i.loading||this._fileList.splice(i.index,1))},removeAll:function(){this._fileList.length=0,this._flightQueue.length=0},start:function(){this.isLoading||(this.hasLoaded=!1,this.isLoading=!0,this.updateProgress(),this.processLoadQueue())},processLoadQueue:function(){if(!this.isLoading)return console.warn("Phaser.Loader - active loading canceled / reset"),void this.finishedLoading(!0);for(i=0;i<this._flightQueue.length;i++)((s=this._flightQueue[i]).loaded||s.error)&&(this._flightQueue.splice(i,1),i--,s.loading=!1,s.requestUrl=null,s.requestObject=null,s.error&&this.onFileError.dispatch(s.key,s),"packfile"!==s.type?(this._loadedFileCount++,this.onFileComplete.dispatch(this.progress,s.key,!s.error,this._loadedFileCount,this._totalFileCount)):"packfile"===s.type&&s.error&&(this._loadedPackCount++,this.onPackComplete.dispatch(s.key,!s.error,this._loadedPackCount,this._totalPackCount)));for(var t=!1,e=this.enableParallel?Math.max(1,this.maxParallelDownloads):1,i=this._processingHead;i<this._fileList.length;i++){var s=this._fileList[i];if("packfile"===s.type&&!s.error&&s.loaded&&i===this._processingHead&&(this.processPack(s),this._loadedPackCount++,this.onPackComplete.dispatch(s.key,!s.error,this._loadedPackCount,this._totalPackCount)),s.loaded||s.error?i===this._processingHead&&(this._processingHead=i+1):!s.loading&&this._flightQueue.length<e&&("packfile"!==s.type||s.data?t||(this._fileLoadStarted||(this._fileLoadStarted=!0,this.onLoadStart.dispatch()),this._flightQueue.push(s),s.loading=!0,this.onFileStart.dispatch(this.progress,s.key,s.url),this.loadFile(s)):(this._flightQueue.push(s),s.loading=!0,this.loadFile(s))),!s.loaded&&s.syncPoint&&(t=!0),this._flightQueue.length>=e||t&&this._loadedPackCount===this._totalPackCount)break}if(this.updateProgress(),this._processingHead>=this._fileList.length)this.finishedLoading();else if(!this._flightQueue.length){console.warn("Phaser.Loader - aborting: processing queue empty, loading may have stalled");var n=this;setTimeout(function(){n.finishedLoading(!0)},2e3)}},finishedLoading:function(t){this.hasLoaded||(this.hasLoaded=!0,this.isLoading=!1,t||this._fileLoadStarted||(this._fileLoadStarted=!0,this.onLoadStart.dispatch()),this.game.state.loadUpdate(),this.onBeforeLoadComplete.dispatch(),this.reset(),this.onLoadComplete.dispatch(),this.game.state&&this.game.state.loadComplete())},asyncComplete:function(t,e){void 0===e&&(e=""),t.loaded=!0,t.error=!!e,e&&(t.errorMessage=e,console.warn("Phaser.Loader - "+t.type+"["+t.key+"]: "+e)),this.processLoadQueue()},processPack:function(t){var i=t.data[t.key];if(i)for(var s=0;s<i.length;s++){var n=i[s];switch(n.type){case"image":this.image(n.key,n.url,n.overwrite);break;case"text":this.text(n.key,n.url,n.overwrite);break;case"json":this.json(n.key,n.url,n.overwrite);break;case"xml":this.xml(n.key,n.url,n.overwrite);break;case"script":this.script(n.key,n.url,n.callback,t.callbackContext||this);break;case"binary":this.binary(n.key,n.url,n.callback,t.callbackContext||this);break;case"spritesheet":this.spritesheet(n.key,n.url,n.frameWidth,n.frameHeight,n.frameMax,n.margin,n.spacing,n.skipFrames);break;case"video":this.video(n.key,n.urls);break;case"audio":this.audio(n.key,n.urls,n.autoDecode);break;case"audiosprite":this.audiosprite(n.key,n.urls,n.jsonURL,n.jsonData,n.autoDecode);break;case"tilemap":this.tilemap(n.key,n.url,n.data,e.Tilemap[n.format]);break;case"physics":this.physics(n.key,n.url,n.data,e.Loader[n.format]);break;case"bitmapFont":this.bitmapFont(n.key,n.textureURL,n.atlasURL,n.atlasData,n.xSpacing,n.ySpacing);break;case"atlasJSONArray":this.atlasJSONArray(n.key,n.textureURL,n.atlasURL,n.atlasData);break;case"atlasJSONHash":this.atlasJSONHash(n.key,n.textureURL,n.atlasURL,n.atlasData);break;case"atlasXML":this.atlasXML(n.key,n.textureURL,n.atlasURL,n.atlasData);break;case"atlas":this.atlas(n.key,n.textureURL,n.atlasURL,n.atlasData,e.Loader[n.format]);break;case"shader":this.shader(n.key,n.url,n.overwrite)}}else console.warn("Phaser.Loader - "+t.key+": pack has data, but not for pack key")},transformUrl:function(t,e){return!!t&&(t.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t:this.baseURL+e.path+t)},loadFile:function(t){switch(t.type){case"packfile":this.xhrLoad(t,this.transformUrl(t.url,t),"text",this.fileComplete);break;case"image":case"spritesheet":case"textureatlas":case"bitmapfont":this.loadImageTag(t);break;case"audio":t.url=this.getAudioURL(t.url),t.url?this.game.sound.usingWebAudio?this.xhrLoad(t,this.transformUrl(t.url,t),"arraybuffer",this.fileComplete):this.game.sound.usingAudioTag&&this.loadAudioTag(t):this.fileError(t,null,"No supported audio URL specified or device does not have audio playback support");break;case"video":t.url=this.getVideoURL(t.url),t.url?t.asBlob?this.xhrLoad(t,this.transformUrl(t.url,t),"blob",this.fileComplete):this.loadVideoTag(t):this.fileError(t,null,"No supported video URL specified or device does not have video playback support");break;case"json":this.xhrLoad(t,this.transformUrl(t.url,t),"text",this.jsonLoadComplete);break;case"xml":this.xhrLoad(t,this.transformUrl(t.url,t),"text",this.xmlLoadComplete);break;case"tilemap":t.format===e.Tilemap.TILED_JSON?this.xhrLoad(t,this.transformUrl(t.url,t),"text",this.jsonLoadComplete):t.format===e.Tilemap.CSV?this.xhrLoad(t,this.transformUrl(t.url,t),"text",this.csvLoadComplete):this.asyncComplete(t,"invalid Tilemap format: "+t.format);break;case"text":case"script":case"shader":case"physics":this.xhrLoad(t,this.transformUrl(t.url,t),"text",this.fileComplete);break;case"texture":"truecolor"===t.key.split("_").pop()?this.loadImageTag(t):this.xhrLoad(t,this.transformUrl(t.url,t),"arraybuffer",this.fileComplete);break;case"binary":this.xhrLoad(t,this.transformUrl(t.url,t),"arraybuffer",this.fileComplete)}},loadImageTag:function(t){var e=this;t.data=new Image,t.data.name=t.key,this.crossOrigin&&(t.data.crossOrigin=this.crossOrigin),t.data.onload=function(){t.data.onload&&(t.data.onload=null,t.data.onerror=null,e.fileComplete(t))},t.data.onerror=function(){t.data.onload&&(t.data.onload=null,t.data.onerror=null,e.fileError(t))},t.data.src=this.transformUrl(t.url,t),!this.game.device.firefox&&t.data.complete&&t.data.width&&t.data.height&&(t.data.onload=null,t.data.onerror=null,this.fileComplete(t))},loadVideoTag:function(t){var i=this;t.data=document.createElement("video"),t.data.name=t.key,t.data.controls=!1,t.data.autoplay=!1;var s=function(){t.data.removeEventListener(t.loadEvent,s,!1),t.data.onerror=null,t.data.canplay=!0,e.GAMES[i.game.id].load.fileComplete(t)};t.data.onerror=function(){t.data.removeEventListener(t.loadEvent,s,!1),t.data.onerror=null,t.data.canplay=!1,i.fileError(t)},t.data.addEventListener(t.loadEvent,s,!1),t.data.src=this.transformUrl(t.url,t),t.data.load()},loadAudioTag:function(t){var e=this;if(this.game.sound.touchLocked)t.data=new Audio,t.data.name=t.key,t.data.preload="auto",t.data.src=this.transformUrl(t.url,t),this.fileComplete(t);else{t.data=new Audio,t.data.name=t.key;var i=function(){t.data.removeEventListener("canplaythrough",i,!1),t.data.onerror=null,e.fileComplete(t)};t.data.onerror=function(){t.data.removeEventListener("canplaythrough",i,!1),t.data.onerror=null,e.fileError(t)},t.data.preload="auto",t.data.src=this.transformUrl(t.url,t),t.data.addEventListener("canplaythrough",i,!1),t.data.load()}},xhrLoad:function(t,e,i,s,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType=i,!1!==this.headers.requestedWith&&r.setRequestHeader("X-Requested-With",this.headers.requestedWith),this.headers[t.type]&&r.setRequestHeader("Accept",this.headers[t.type]),n=n||this.fileError;var o=this;r.onload=function(){try{return 4===r.readyState&&r.status>=400&&r.status<=599?n.call(o,t,r):s.call(o,t,r)}catch(e){o.hasLoaded?window.console&&console.error(e):o.asyncComplete(t,e.message||"Exception")}},r.onerror=function(){try{return n.call(o,t,r)}catch(e){o.hasLoaded?window.console&&console.error(e):o.asyncComplete(t,e.message||"Exception")}},t.requestObject=r,t.requestUrl=e,r.send()},getVideoURL:function(t){for(var e=0;e<t.length;e++){var i,s=t[e];if(s.uri){if(i=s.type,s=s.uri,this.game.device.canPlayVideo(i))return s}else{if(0===s.indexOf("blob:")||0===s.indexOf("data:"))return s;if(s.indexOf("?")>=0&&(s=s.substr(0,s.indexOf("?"))),i=s.substr((Math.max(0,s.lastIndexOf("."))||1/0)+1).toLowerCase(),this.game.device.canPlayVideo(i))return t[e]}}return null},getAudioURL:function(t){if(this.game.sound.noAudio)return null;for(var e=0;e<t.length;e++){var i,s=t[e];if(s.uri){if(i=s.type,s=s.uri,this.game.device.canPlayAudio(i))return s}else{if(0===s.indexOf("blob:")||0===s.indexOf("data:"))return s;if(s.indexOf("?")>=0&&(s=s.substr(0,s.indexOf("?"))),i=s.substr((Math.max(0,s.lastIndexOf("."))||1/0)+1).toLowerCase(),this.game.device.canPlayAudio(i))return t[e]}}return null},fileError:function(t,e,i){var s="error loading asset from URL "+(t.requestUrl||this.transformUrl(t.url,t));!i&&e&&(i=e.status),i&&(s=s+" ("+i+")"),this.asyncComplete(t,s)},fileComplete:function(t,i){var s=!0;switch(t.type){case"packfile":r=JSON.parse(i.responseText);t.data=r||{};break;case"texture":var n=/\.([^.]+)$/.exec(t.url.split("?",1)[0])[1].toLowerCase();null!==t.data?this.cache.addCompressedTextureMetaData(t.key,t.url,n,t.data):this.cache.addCompressedTextureMetaData(t.key,t.url,n,i.response);break;case"image":this.cache.addImage(t.key,t.url,t.data);break;case"spritesheet":this.cache.addSpriteSheet(t.key,t.url,t.data,t.frameWidth,t.frameHeight,t.frameMax,t.margin,t.spacing,t.skipFrames);break;case"textureatlas":if(null==t.atlasURL)this.cache.addTextureAtlas(t.key,t.url,t.data,t.atlasData,t.format);else if(s=!1,t.format===e.Loader.TEXTURE_ATLAS_JSON_ARRAY||t.format===e.Loader.TEXTURE_ATLAS_JSON_HASH||t.format===e.Loader.TEXTURE_ATLAS_JSON_PYXEL)this.xhrLoad(t,this.transformUrl(t.atlasURL,t),"text",this.jsonLoadComplete);else{if(t.format!==e.Loader.TEXTURE_ATLAS_XML_STARLING)throw new Error("Phaser.Loader. Invalid Texture Atlas format: "+t.format);this.xhrLoad(t,this.transformUrl(t.atlasURL,t),"text",this.xmlLoadComplete)}break;case"bitmapfont":t.atlasURL?(s=!1,this.xhrLoad(t,this.transformUrl(t.atlasURL,t),"text",function(t,e){var i;try{i=JSON.parse(e.responseText)}catch(t){}i?(t.atlasType="json",this.jsonLoadComplete(t,e)):(t.atlasType="xml",this.xmlLoadComplete(t,e))})):this.cache.addBitmapFont(t.key,t.url,t.data,t.atlasData,t.atlasType,t.xSpacing,t.ySpacing);break;case"video":if(t.asBlob)try{t.data=i.response}catch(e){throw new Error("Phaser.Loader. Unable to parse video file as Blob: "+t.key)}this.cache.addVideo(t.key,t.url,t.data,t.asBlob);break;case"audio":this.game.sound.usingWebAudio?(t.data=i.response,this.cache.addSound(t.key,t.url,t.data,!0,!1),t.autoDecode&&this.game.sound.decode(t.key)):this.cache.addSound(t.key,t.url,t.data,!1,!0);break;case"text":t.data=i.responseText,this.cache.addText(t.key,t.url,t.data);break;case"shader":t.data=i.responseText,this.cache.addShader(t.key,t.url,t.data);break;case"physics":var r=JSON.parse(i.responseText);this.cache.addPhysicsData(t.key,t.url,r,t.format);break;case"script":t.data=document.createElement("script"),t.data.language="javascript",t.data.type="text/javascript",t.data.defer=!1,t.data.text=i.responseText,document.head.appendChild(t.data),t.callback&&(t.data=t.callback.call(t.callbackContext,t.key,i.responseText));break;case"binary":t.callback?t.data=t.callback.call(t.callbackContext,t.key,i.response):t.data=i.response,this.cache.addBinary(t.key,t.data)}s&&this.asyncComplete(t)},jsonLoadComplete:function(t,e){var i=JSON.parse(e.responseText);"tilemap"===t.type?this.cache.addTilemap(t.key,t.url,i,t.format):"bitmapfont"===t.type?this.cache.addBitmapFont(t.key,t.url,t.data,i,t.atlasType,t.xSpacing,t.ySpacing):"json"===t.type?this.cache.addJSON(t.key,t.url,i):this.cache.addTextureAtlas(t.key,t.url,t.data,i,t.format),this.asyncComplete(t)},csvLoadComplete:function(t,e){var i=e.responseText;this.cache.addTilemap(t.key,t.url,i,t.format),this.asyncComplete(t)},xmlLoadComplete:function(t,e){var i=e.responseText,s=this.parseXml(i);if(!s){var n=e.responseType||e.contentType;return console.warn("Phaser.Loader - "+t.key+": invalid XML ("+n+")"),void this.asyncComplete(t,"invalid XML")}"bitmapfont"===t.type?this.cache.addBitmapFont(t.key,t.url,t.data,s,t.atlasType,t.xSpacing,t.ySpacing):"textureatlas"===t.type?this.cache.addTextureAtlas(t.key,t.url,t.data,s,t.format):"xml"===t.type&&this.cache.addXML(t.key,t.url,s),this.asyncComplete(t)},parseXml:function(t){var e;try{if(window.DOMParser){var i=new DOMParser;e=i.parseFromString(t,"text/xml")}else(e=new ActiveXObject("Microsoft.XMLDOM")).async="false",e.loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null},updateProgress:function(){this.preloadSprite&&(0===this.preloadSprite.direction?this.preloadSprite.rect.width=Math.floor(this.preloadSprite.width/100*this.progress):this.preloadSprite.rect.height=Math.floor(this.preloadSprite.height/100*this.progress),this.preloadSprite.sprite?this.preloadSprite.sprite.updateCrop():this.preloadSprite=null)},totalLoadedFiles:function(){return this._loadedFileCount},totalQueuedFiles:function(){return this._totalFileCount-this._loadedFileCount},totalLoadedPacks:function(){return this._totalPackCount},totalQueuedPacks:function(){return this._totalPackCount-this._loadedPackCount}},Object.defineProperty(e.Loader.prototype,"progressFloat",{get:function(){var t=this._loadedFileCount/this._totalFileCount*100;return e.Math.clamp(t||0,0,100)}}),Object.defineProperty(e.Loader.prototype,"progress",{get:function(){return Math.round(this.progressFloat)}}),e.Loader.prototype.constructor=e.Loader,e.LoaderParser={bitmapFont:function(t,e,i,s,n,r){return this.xmlBitmapFont(t,e,i,s,n,r)},xmlBitmapFont:function(t,e,i,s,n,r){null==r&&(r=1);var o={},a=t.getElementsByTagName("info")[0],h=t.getElementsByTagName("common")[0];o.font=a.getAttribute("face"),o.size=parseInt(a.getAttribute("size"),10),o.lineHeight=parseInt(h.getAttribute("lineHeight"),10)+s,o.chars={};for(var l=t.getElementsByTagName("char"),c=n?n.x:0,u=n?n.y:0,d=0;d<l.length;d++){var p=parseInt(l[d].getAttribute("id"),10),f=o.chars[p]={x:parseInt(l[d].getAttribute("x"),10),y:parseInt(l[d].getAttribute("y"),10),width:parseInt(l[d].getAttribute("width"),10),height:parseInt(l[d].getAttribute("height"),10),xOffset:parseInt(l[d].getAttribute("xoffset"),10)/r,yOffset:parseInt(l[d].getAttribute("yoffset"),10)/r,xAdvance:(parseInt(l[d].getAttribute("xadvance"),10)+i)/r,kerning:{}};if(n&&n.trimmed){if(f.x+f.width>n.spriteSourceSizeX+n.spriteSourceSizeW&&(f.width-=f.x+f.width-n.spriteSourceSizeX-n.spriteSourceSizeW),f.y+f.height>n.spriteSourceSizeY+n.spriteSourceSizeH&&(f.height-=f.y+f.height-n.spriteSourceSizeY-n.spriteSourceSizeH),f.x<n.spriteSourceSizeX){g=n.spriteSourceSizeX-f.x;f.x=0,f.width-=g,f.xOffset+=g}if(f.y<n.spriteSourceSizeY){var g=n.spriteSourceSizeY-f.y;f.y=0,f.height-=g,f.yOffset+=g}}f.x+=c,f.y+=u}var m=t.getElementsByTagName("kerning");for(d=0;d<m.length;d++){var y=parseInt(m[d].getAttribute("first"),10),v=parseInt(m[d].getAttribute("second"),10),x=parseInt(m[d].getAttribute("amount"),10)/r;o.chars[v].kerning[y]=x}return this.finalizeBitmapFont(e,o)},jsonBitmapFont:function(t,e,i,s,n,r){null==r&&(r=1);var o={font:t.font.info._face,size:parseInt(t.font.info._size,10),lineHeight:parseInt(t.font.common._lineHeight,10)+s,chars:{}},a=n?n.x:0,h=n?n.y:0;return t.font.chars.char.forEach(function(t){var e=parseInt(t._id,10),s=o.chars[e]={x:parseInt(t._x,10),y:parseInt(t._y,10),width:parseInt(t._width,10),height:parseInt(t._height,10),xOffset:parseInt(t._xoffset,10)/r,yOffset:parseInt(t._yoffset,10)/r,xAdvance:(parseInt(t._xadvance,10)+i)/r,kerning:{}};if(n&&n.trimmed){if(s.x+s.width>n.spriteSourceSizeX+n.spriteSourceSizeW&&(s.width-=s.x+s.width-n.spriteSourceSizeX-n.spriteSourceSizeW),s.y+s.height>n.spriteSourceSizeY+n.spriteSourceSizeH&&(s.height-=s.y+s.height-n.spriteSourceSizeY-n.spriteSourceSizeH),s.x<n.spriteSourceSizeX){l=n.spriteSourceSizeX-s.x;s.x=0,s.width-=l,s.xOffset+=l}if(s.y<n.spriteSourceSizeY){var l=n.spriteSourceSizeY-s.y;s.y=0,s.height-=l,s.yOffset+=l}}s.x+=a,s.y+=h}),t.font.kernings&&t.font.kernings.kerning&&t.font.kernings.kerning.forEach(function(t){o.chars[t._second].kerning[t._first]=parseInt(t._amount,10)/r}),this.finalizeBitmapFont(e,o)},finalizeBitmapFont:function(t,i){return Object.keys(i.chars).forEach(function(s){var n=i.chars[s];n.texture=new PIXI.Texture(t,new e.Rectangle(n.x,n.y,n.width,n.height))}),i},pvr:function(t){var e,i=new Uint32Array(t.slice(0,52)),s=new Uint8Array(t),n=null,r=i[3]<<32|i[2],o=0;if(55727696===i[0]&&[0,1,2,3,6,7,9,11].indexOf(r)>=0){switch(r>=0&&r<=3?e="PVRTC":r>=7&&r<=11?e="S3TC":6===r&&(e="ETC1"),r){case 0:o=35841;break;case 1:o=35843;break;case 2:o=35840;break;case 3:o=35842;break;case 6:o=36196;break;case 7:o=33777;break;case 9:o=33778;break;case 11:o=33779;break;default:o=-1}n={complete:!0,fileFormat:"PVR",compressionAlgorithm:e,flags:i[1],pixelFormat:r,colorSpace:i[4],channelType:i[5],height:i[6],width:i[7],depth:i[8],numberOfSurfaces:i[9],numberOfFaces:i[10],numberOfMipmaps:i[11],metaDataSize:i[12],textureData:s.subarray(52+i[12],s.byteLength),glExtensionFormat:o}}return n},dds:function(t){var e=new Uint8Array(t),i=new Uint32Array(t),s=null;return 68===e[0]&&68===e[1]&&83===e[2]&&32===e[3]&&("DX10"===(s={complete:!0,fileFormat:"DDS",compressionAlgorithm:"S3TC",size:i[1],flags:i[2],height:i[3],width:i[4],pitch:i[5],depth:i[6],mipmapCount:i[7],formatSize:i[19],formatFlag:i[19],formatFourCC:[String.fromCharCode(e[84]),String.fromCharCode(e[85]),String.fromCharCode(e[86]),String.fromCharCode(e[87])].join(""),formatBitCount:i[21],formatRBitMask:i[22],formatGBitMask:i[23],formatBBitMask:i[24],formatABitMask:i[25],caps1:i[26],caps2:i[27],caps3:i[28],caps4:i[29],reserved2:i[30],DXGIFormat:null,resourceDimension:null,miscFlag:null,arraySize:null,textureData:e.subarray(i[1]+4,e.byteLength)}).formatFourCC?(s.DXGIFormat=i[31],s.resourceDimension=i[32],s.miscFlag=i[33],s.arraySize=i[34],s.miscFlag=i[35]):"DXT5"===s.formatFourCC?s.glExtensionFormat=33779:"DXT3"===s.formatFourCC&&(s.glExtensionFormat=33778)),s},ktx:function(t){var e=new Uint8Array(t),i=new Uint32Array(t),s=null,n=16+i[15]/4|0,r=i[n],o=i[7],a=0;if(171===e[0]&&75===e[1]&&84===e[2]&&88===e[3]&&32===e[4]&&49===e[5]&&49===e[6]&&187===e[7]&&13===e[8]&&10===e[9]&&26===e[10]&&10===e[11]&&[36196,35840,35841,35842,35843,33776,33777,33778,33779].indexOf(o)>=0){switch(o){case 36196:a="ETC1";break;case 35840:case 35841:case 35842:case 35843:a="PVRTC";break;case 33776:case 33777:case 33778:case 33779:a="S3TC"}s={complete:!0,fileFormat:"KTX",compressionAlgorithm:a,endianness:i[3],glType:i[4],glTypeSize:i[5],glFormat:i[6],glInternalFormat:i[7],glBaseInternalFormat:i[8],width:i[9],height:i[10],pixelDepth:i[11],numberOfArrayElements:i[12],numberOfFaces:i[13],numberOfMipmapLevels:i[14],bytesOfKeyValueData:i[15],keyAndValueByteSize:i[16],imageSize:r,textureData:e.subarray(4*(n+1),r+100)}}return s},pkm:function(t){var e=new Uint8Array(t),i=null;return 80===e[0]&&75===e[1]&&77===e[2]&&32===e[3]&&(i={complete:!0,fileFormat:"PKM",compressionAlgorithm:"ETC1",format:65535&(e[6]<<8|e[7]),width:65535&(e[8]<<8|e[9]),height:65535&(e[10]<<8|e[11]),originalWidth:65535&(e[12]<<8|e[13]),originalHeight:65535&(e[14]<<8|e[15]),textureData:e.subarray(16,e.length)}),i}},e.AudioSprite=function(t,e){this.game=t,this.key=e,this.config=this.game.cache.getJSON(e+"-audioatlas"),this.autoplayKey=null,this.autoplay=!1,this.sounds={};for(var i in this.config.spritemap){var s=this.config.spritemap[i],n=this.game.add.sound(this.key);n.addMarker(i,s.start,s.end-s.start,null,s.loop),this.sounds[i]=n}this.config.autoplay&&(this.autoplayKey=this.config.autoplay,this.play(this.autoplayKey),this.autoplay=this.sounds[this.autoplayKey])},e.AudioSprite.prototype={play:function(t,e){return void 0===e&&(e=1),this.sounds[t].play(t,null,e)},stop:function(t){if(t)this.sounds[t].stop();else for(var e in this.sounds)this.sounds[e].stop()},get:function(t){return this.sounds[t]}},e.AudioSprite.prototype.constructor=e.AudioSprite,e.Sound=function(t,i,s,n,r){void 0===s&&(s=1),void 0===n&&(n=!1),void 0===r&&(r=t.sound.connectToMaster),this.game=t,this.name=i,this.key=i,this.loop=n,this.markers={},this.context=null,this.autoplay=!1,this.totalDuration=0,this.startTime=0,this.currentTime=0,this.duration=0,this.durationMS=0,this.position=0,this.stopTime=0,this.paused=!1,this.pausedPosition=0,this.pausedTime=0,this.isPlaying=!1,this.currentMarker="",this.fadeTween=null,this.pendingPlayback=!1,this.override=!1,this.allowMultiple=!1,this.playOnce=!1,this.usingWebAudio=this.game.sound.usingWebAudio,this.usingAudioTag=this.game.sound.usingAudioTag,this.externalNode=null,this.masterGainNode=null,this.gainNode=null,this._sound=null,this._globalVolume=1,this._markedToDelete=!1,this._removeFromSoundManager=!1,this._sourceId=0,this.usingWebAudio?(this.context=this.game.sound.context,this.masterGainNode=this.game.sound.masterGain,void 0===this.context.createGain?this.gainNode=this.context.createGainNode():this.gainNode=this.context.createGain(),this.gainNode.gain.value=s,r&&this.gainNode.connect(this.masterGainNode)):this.usingAudioTag&&(this.game.cache.getSound(i)&&this.game.cache.isSoundReady(i)?(this._sound=this.game.cache.getSoundData(i),this.totalDuration=0,this._sound.duration&&(this.totalDuration=this._sound.duration)):this.game.cache.onSoundUnlock.add(this.soundHasUnlocked,this)),this.onDecoded=new e.Signal,this.onPlay=new e.Signal,this.onPause=new e.Signal,this.onResume=new e.Signal,this.onLoop=new e.Signal,this.onStop=new e.Signal,this.onMute=new e.Signal,this.onMarkerComplete=new e.Signal,this.onFadeComplete=new e.Signal,this._volume=s,this._buffer=null,this._muted=!1,this._tempMarker=0,this._tempPosition=0,this._tempVolume=0,this._tempPause=0,this._muteVolume=0,this._tempLoop=0,this._paused=!1,this._onDecodedEventDispatched=!1},e.Sound.prototype={soundHasUnlocked:function(t){t===this.key&&(this._sound=this.game.cache.getSoundData(this.key),this.totalDuration=this._sound.duration)},addMarker:function(t,e,i,s,n){void 0!==i&&null!==i||(i=1),void 0!==s&&null!==s||(s=1),void 0===n&&(n=!1),this.markers[t]={name:t,start:e,stop:e+i,volume:s,duration:i,durationMS:1e3*i,loop:n}},removeMarker:function(t){delete this.markers[t]},onEndedHandler:function(){this._removeOnEndedHandler(),this.isPlaying=!1,this.currentTime=this.durationMS,this.stop(),this.playOnce&&(this._markedToDelete=!0,this._removeFromSoundManager=!0),this._markedToDelete&&(this._disconnectSource(),this._removeFromSoundManager?this.game.sound.remove(this):(this.markers={},this.context=null,this._buffer=null,this.externalNode=null,this.onDecoded.dispose(),this.onPlay.dispose(),this.onPause.dispose(),this.onResume.dispose(),this.onLoop.dispose(),this.onStop.dispose(),this.onMute.dispose(),this.onMarkerComplete.dispose()))},update:function(){this.game.cache.checkSoundKey(this.key)?(this.isDecoded&&!this._onDecodedEventDispatched&&(this.onDecoded.dispatch(this),this._onDecodedEventDispatched=!0),this.pendingPlayback&&this.game.cache.isSoundReady(this.key)&&(this.pendingPlayback=!1,this.play(this._tempMarker,this._tempPosition,this._tempVolume,this._tempLoop)),this.isPlaying&&(this.currentTime=this.game.time.time-this.startTime,this.currentTime>=this.durationMS&&(this.usingWebAudio?this.loop?(this.onLoop.dispatch(this),this.isPlaying=!1,""===this.currentMarker?(this.currentTime=0,this.startTime=this.game.time.time,this.isPlaying=!0):(this.onMarkerComplete.dispatch(this.currentMarker,this),this.play(this.currentMarker,0,this.volume,!0,!0))):""!==this.currentMarker&&this.stop():this.loop?(this.onLoop.dispatch(this),""===this.currentMarker&&(this.currentTime=0,this.startTime=this.game.time.time),this.isPlaying=!1,this.play(this.currentMarker,0,this.volume,!0,!0)):this.stop()))):this.destroy()},loopFull:function(t){return this.play(null,0,t,!0)},play:function(t,e,i,s,n){if(void 0!==t&&!1!==t&&null!==t||(t=""),void 0===n&&(n=!0),this.isPlaying&&!this.allowMultiple&&!n&&!this.override)return this;if(this._sound&&this.isPlaying&&!this.allowMultiple&&(this.override||n)&&(this.usingWebAudio?this._stopSourceAndDisconnect():this.usingAudioTag&&(this._sound.pause(),this._sound.currentTime=0),this.isPlaying=!1),""===t&&Object.keys(this.markers).length>0)return this;if(""!==t){if(!this.markers[t])return console.warn("Phaser.Sound.play: audio marker "+t+" doesn't exist"),this;this.currentMarker=t,this.position=this.markers[t].start,this.volume=this.markers[t].volume,this.loop=this.markers[t].loop,this.duration=this.markers[t].duration,this.durationMS=this.markers[t].durationMS,void 0!==i&&(this.volume=i),void 0!==s&&(this.loop=s),this._tempMarker=t,this._tempPosition=this.position,this._tempVolume=this.volume,this._tempLoop=this.loop}else e=e||0,void 0===i&&(i=this._volume),void 0===s&&(s=this.loop),this.position=Math.max(0,e),this.volume=i,this.loop=s,this.duration=0,this.durationMS=0,this._tempMarker=t,this._tempPosition=e,this._tempVolume=i,this._tempLoop=s;return this.usingWebAudio?this.game.cache.isSoundDecoded(this.key)?(this._createSourceAndConnect(),this.loop&&""===t&&(this._sound.loop=!0),this.loop||""!==t||this._addOnEndedHandler(),this.totalDuration=this._sound.buffer.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=Math.ceil(1e3*this.totalDuration)),this.loop&&""===t?this._startSource(0,0):this._startSource(0,this.position,this.duration),this.isPlaying=!0,this.paused=!1,this.startTime=this.game.time.time,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):(this.pendingPlayback=!0,this.game.cache.getSound(this.key)&&!1===this.game.cache.getSound(this.key).isDecoding&&this.game.sound.decode(this.key,this)):this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).locked?(this.game.cache.reloadSound(this.key),this.pendingPlayback=!0):this._sound&&(this.game.device.cocoonJS||4===this._sound.readyState)?(this._sound.play(),this._sound.loop=this.loop,this.totalDuration=this._sound.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this._sound.currentTime=this.position,this._sound.muted=this._muted,this._muted||this.game.sound.mute?this._sound.volume=0:this._sound.volume=this._volume,this.isPlaying=!0,this.paused=!1,this.startTime=this.game.time.time,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):this.pendingPlayback=!0,this.playOnce&&(this.loop&&console.warn("Phaser.Sound.play: audio clip "+this.name+" cannot be deleted while looping."),this._markedToDelete=!0,this._removeFromSoundManager=!0),this},restart:function(t,e,i,s){t=t||"",e=e||0,i=i||1,void 0===s&&(s=!1),this.play(t,e,i,s,!0)},pause:function(){this.isPlaying&&(this.paused=!0,this.pausedPosition=this.currentTime,this.pausedTime=this.game.time.time,this._tempPause=this._sound.currentTime,this.onPause.dispatch(this),this.stop())},resume:function(){if(this.paused){if(this.usingWebAudio){var t=Math.max(0,this.position+this.pausedPosition/1e3);this._createSourceAndConnect(),""===this.currentMarker&&(this.loop?this._sound.loop=!0:this._addOnEndedHandler());var e=this.duration-this.pausedPosition/1e3;this.loop&&""===this.currentMarker?this._startSource(0,t):this._startSource(0,t,e)}else this._sound.currentTime=this._tempPause,this._sound.play();this.isPlaying=!0,this.paused=!1,this.startTime+=this.game.time.time-this.pausedTime,this.onResume.dispatch(this)}},stop:function(){if(this.isPlaying&&this._sound&&(this.usingWebAudio?this._stopSourceAndDisconnect():this.usingAudioTag&&(this._sound.pause(),this._sound.currentTime=0)),this.pendingPlayback=!1,this.isPlaying=!1,!this.paused){var t=this.currentMarker;""!==this.currentMarker&&this.onMarkerComplete.dispatch(this.currentMarker,this),this.currentMarker="",null!==this.fadeTween&&this.fadeTween.stop(),this.onStop.dispatch(this,t)}},fadeIn:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=this.currentMarker),this.paused||(this.play(i,0,0,e),this.fadeTo(t,1))},fadeOut:function(t){this.fadeTo(t,0)},fadeTo:function(t,i){this.isPlaying&&!this.paused&&i!==this.volume&&(void 0===t&&(t=1e3),void 0!==i?(this.fadeTween=this.game.add.tween(this).to({volume:i},t,e.Easing.Linear.None,!0),this.fadeTween.onComplete.add(this.fadeComplete,this)):console.warn("Phaser.Sound.fadeTo: No Volume Specified."))},fadeComplete:function(){this.onFadeComplete.dispatch(this,this.volume),0===this.volume&&this.stop()},updateGlobalVolume:function(t){this.usingAudioTag&&this._sound&&(this._globalVolume=t,this._sound.volume=this._globalVolume*this._volume)},destroy:function(t){void 0===t&&(t=!0),this._markedToDelete=!0,this._removeFromSoundManager=t,this.stop(),t?this.game.sound.remove(this):(this.markers={},this.context=null,this._buffer=null,this.externalNode=null,this.onDecoded.dispose(),this.onPlay.dispose(),this.onPause.dispose(),this.onResume.dispose(),this.onLoop.dispose(),this.onStop.dispose(),this.onMute.dispose(),this.onMarkerComplete.dispose())},_createSourceAndConnect:function(){this._sound=this.context.createBufferSource(),this._sound.connect(this.externalNode||this.gainNode),this._buffer=this.game.cache.getSoundData(this.key),this._sound.buffer=this._buffer,this._sourceId++},_disconnectSource:function(){this._sound.disconnect(this.externalNode||this.gainNode)},_startSource:function(t,e,i){this._sound.start(t||0,e,i)},_stopSourceAndDisconnect:function(){this._removeOnEndedHandler();try{this._sound.stop(0)}catch(t){}this._disconnectSource(),this._sound=null},_addOnEndedHandler:function(){this._sound.onended=this.onEndedHandler.bind(this)},_removeOnEndedHandler:function(){this._sound.onended=null}},e.Sound.prototype.constructor=e.Sound,Object.defineProperty(e.Sound.prototype,"isDecoding",{get:function(){return this.game.cache.getSound(this.key).isDecoding}}),Object.defineProperty(e.Sound.prototype,"isDecoded",{get:function(){return this.game.cache.isSoundDecoded(this.key)}}),Object.defineProperty(e.Sound.prototype,"mute",{get:function(){return this._muted||this.game.sound.mute},set:function(t){(t=t||!1)!==this._muted&&(t?(this._muted=!0,this._muteVolume=this._tempVolume,this.usingWebAudio?this.gainNode.gain.value=0:this.usingAudioTag&&this._sound&&(this._sound.volume=0)):(this._muted=!1,this.usingWebAudio?this.gainNode.gain.value=this._muteVolume:this.usingAudioTag&&this._sound&&(this._sound.volume=this._muteVolume)),this.onMute.dispatch(this))}}),Object.defineProperty(e.Sound.prototype,"volume",{get:function(){return this._volume},set:function(t){this.usingAudioTag&&(t=this.game.math.clamp(t,0,1)),this._muted?this._muteVolume=t:(this._tempVolume=t,this._volume=t,this.usingWebAudio?this.gainNode.gain.value=t:this.usingAudioTag&&this._sound&&(this._sound.volume=this._globalVolume*t))}}),Object.defineProperty(e.Sound.prototype,"sourceId",{get:function(){return this._sound?this._sourceId:null}}),e.SoundManager=function(t){this.game=t,this.onSoundDecode=new e.Signal,this.onVolumeChange=new e.Signal,this.onMute=new e.Signal,this.onUnMute=new e.Signal,this.onTouchUnlock=new e.Signal,this.context=null,this.usingWebAudio=!1,this.usingAudioTag=!1,this.noAudio=!1,this.connectToMaster=!0,this.touchLocked=!1,this.channels=32,this.muteOnPause=!0,this._codeMuted=!1,this._muted=!1,this._unlockSource=null,this._volume=1,this._sounds=[],this._watchList=new e.ArraySet,this._watching=!1,this._watchCallback=null,this._watchContext=null,this._resumeWebAudioOnClick=this._resumeWebAudioOnClick.bind(this)},e.SoundManager.prototype={boot:function(){var t=this.game.device,e=window.PhaserGlobal;if(t.iOS&&!1===t.webAudio&&(this.channels=1),e){if(!0===e.disableAudio)return this.noAudio=!0,void(this.touchLocked=!1);if(!0===e.disableWebAudio)return this.usingAudioTag=!0,void(this.touchLocked=!1)}if(e&&e.audioContext)this.context=e.audioContext;else{var i=window.AudioContext||window.webkitAudioContext;if(i)try{this.context=new i}catch(t){this.context=null,this.usingWebAudio=!1,this.touchLocked=!1,console.warn(t)}}if(null===this.context){if(void 0===window.Audio)return void(this.noAudio=!0);this.usingAudioTag=!0}else this.usingWebAudio=!0,void 0===this.context.createGain?this.masterGain=this.context.createGainNode():this.masterGain=this.context.createGain(),this.masterGain.gain.value=1,this.masterGain.connect(this.context.destination),"suspended"===this.context.state&&this.game.canvas.addEventListener("click",this._resumeWebAudioOnClick);this.noAudio||t.needsTouchUnlock()&&this.setTouchLock(),this.usingWebAudio&&t.chrome&&t.chromeVersion<=65&&console.log('A "GainNode.gain.value setter smoothing is deprecated" notice in Chrome is normal. <https://github.com/photonstorm/phaser-ce/issues/385>')},setTouchLock:function(){this.noAudio||window.PhaserGlobal&&!0===window.PhaserGlobal.disableAudio||(this.game.input.addTouchLockCallback(this.unlock,this,!0),this.touchLocked=!0)},setTouchUnlock:function(){this.touchLocked=!1,this._unlockSource=null,this.onTouchUnlock.dispatch()},resumeWebAudio:function(){if(this.usingWebAudio&&"suspended"===this.context.state)return this.context.resume()},unlock:function(){if(this.noAudio||!this.touchLocked||null!==this._unlockSource)return!0;if(this.usingAudioTag)this.setTouchUnlock();else if(this.usingWebAudio){var t=this.context.createBuffer(1,1,22050);this._unlockSource=this.context.createBufferSource(),this._unlockSource.buffer=t,this._unlockSource.connect(this.context.destination);var e=this;this._unlockSource.onended=function(){e.setTouchUnlock(),e.resumeWebAudio()},void 0===this._unlockSource.start?this._unlockSource.noteOn(0):this._unlockSource.start(0),this.resumeWebAudio()}return!0},stopAll:function(){if(!this.noAudio)for(var t=0;t<this._sounds.length;t++)this._sounds[t]&&this._sounds[t].stop()},pauseAll:function(){if(!this.noAudio)for(var t=0;t<this._sounds.length;t++)this._sounds[t]&&this._sounds[t].pause()},resumeAll:function(){if(!this.noAudio)for(var t=0;t<this._sounds.length;t++)this._sounds[t]&&this._sounds[t].resume()},decode:function(t,e){e=e||null;var i=this.game.cache.getSoundData(t);if(i&&!1===this.game.cache.isSoundDecoded(t)){this.game.cache.updateSound(t,"isDecoding",!0);var s=this;try{this.context.decodeAudioData(i,function(i){i&&(s.game.cache.decodedSound(t,i),s.onSoundDecode.dispatch(t,e))})}catch(t){}}},setDecodedCallback:function(t,i,s){"string"==typeof t&&(t=[t]),this._watchList.reset();for(var n=0;n<t.length;n++)t[n]instanceof e.Sound?this.game.cache.isSoundDecoded(t[n].key)||this._watchList.add(t[n].key):this.game.cache.isSoundDecoded(t[n])||this._watchList.add(t[n]);0===this._watchList.total?(this._watching=!1,i.call(s)):(this._watching=!0,this._watchCallback=i,this._watchContext=s)},update:function(){if(!this.noAudio){for(var t=0;t<this._sounds.length;t++)this._sounds[t].update();if(this._watching){for(var e=this._watchList.first;e;)this.game.cache.isSoundDecoded(e)&&this._watchList.remove(e),e=this._watchList.next;0===this._watchList.total&&(this._watching=!1,this._watchCallback.call(this._watchContext))}}},add:function(t,i,s,n){void 0===i&&(i=1),void 0===s&&(s=!1),void 0===n&&(n=this.connectToMaster);var r=new e.Sound(this.game,t,i,s,n);return this._sounds.push(r),r},addSprite:function(t){return new e.AudioSprite(this.game,t)},remove:function(t){for(var e=this._sounds.length;e--;)if(this._sounds[e]===t)return this._sounds[e].destroy(!1),this._sounds.splice(e,1),!0;return!1},removeAll:function(){this.stopAll();for(var t=0;t<this._sounds.length;t++)this._sounds[t]&&this._sounds[t].destroy();this._sounds.length=0},removeByKey:function(t){for(var e=this._sounds.length,i=0;e--;)this._sounds[e].key===t&&(this._sounds[e].destroy(!1),this._sounds.splice(e,1),i++);return i},play:function(t,e,i){if(!this.noAudio){var s=this.add(t,e,i);return s.play(),s}},setMute:function(){if(!this._muted){this._muted=!0,this.usingWebAudio&&(this._muteVolume=this.masterGain.gain.value,this.masterGain.gain.value=0);for(var t=0;t<this._sounds.length;t++)this._sounds[t].usingAudioTag&&(this._sounds[t].mute=!0);this.onMute.dispatch()}},unsetMute:function(){if(this._muted&&!this._codeMuted){this._muted=!1,this.usingWebAudio&&(this.masterGain.gain.value=this._muteVolume);for(var t=0;t<this._sounds.length;t++)this._sounds[t].usingAudioTag&&(this._sounds[t].mute=!1);this.onUnMute.dispatch()}},destroy:function(){this.removeAll(),this.onSoundDecode.dispose(),this.game.canvas.removeEventListener("click",this._resumeWebAudioOnClick),this.context&&(window.PhaserGlobal?window.PhaserGlobal.audioContext=this.context:this.context.close&&this.context.close())},_resumeWebAudioOnClick:function(){this.resumeWebAudio(),this.game.canvas.removeEventListener("click",this._resumeWebAudioOnClick)}},e.SoundManager.prototype.constructor=e.SoundManager,Object.defineProperty(e.SoundManager.prototype,"mute",{get:function(){return this._muted},set:function(t){if(t=t||!1){if(this._muted)return;this._codeMuted=!0,this.setMute()}else{if(!this._muted)return;this._codeMuted=!1,this.unsetMute()}}}),Object.defineProperty(e.SoundManager.prototype,"volume",{get:function(){return this._volume},set:function(t){if(t<0?t=0:t>1&&(t=1),this._volume!==t){if(this._volume=t,this.usingWebAudio)this.masterGain.gain.value=t;else for(var e=0;e<this._sounds.length;e++)this._sounds[e].usingAudioTag&&this._sounds[e].updateGlobalVolume(t);this.onVolumeChange.dispatch(t)}}}),e.ScaleManager=function(t,i,s){this.game=t,this.dom=e.DOM,this.grid=null,this.width=0,this.height=0,this.minWidth=null,this.maxWidth=null,this.minHeight=null,this.maxHeight=null,this.offset=new e.Point,this.forceLandscape=!1,this.forcePortrait=!1,this.incorrectOrientation=!1,this._pageAlignHorizontally=!1,this._pageAlignVertically=!1,this.onOrientationChange=new e.Signal,this.enterIncorrectOrientation=new e.Signal,this.leaveIncorrectOrientation=new e.Signal,this.hasPhaserSetFullScreen=!1,this.fullScreenTarget=null,this._createdFullScreenTarget=null,this.onFullScreenInit=new e.Signal,this.onFullScreenChange=new e.Signal,this.onFullScreenError=new e.Signal,this.screenOrientation=this.dom.getScreenOrientation(),this.scaleFactor=new e.Point(1,1),this.scaleFactorInversed=new e.Point(1,1),this.margin={left:0,top:0,right:0,bottom:0,x:0,y:0},this.bounds=new e.Rectangle,this.aspectRatio=0,this.sourceAspectRatio=0,this.event=null,this.windowConstraints={right:"layout",bottom:""},this.compatibility={supportsFullScreen:!1,orientationFallback:null,noMargins:!1,scrollTo:null,forceMinimumDocumentHeight:!1,canExpandParent:!0,clickTrampoline:""},this._scaleMode=e.ScaleManager.NO_SCALE,this._fullScreenScaleMode=e.ScaleManager.NO_SCALE,this.parentIsWindow=!1,this.parentNode=null,this.parentScaleFactor=new e.Point(1,1),this.trackParentInterval=2e3,this.onSizeChange=new e.Signal,this.onResize=null,this.onResizeContext=null,this._pendingScaleMode=null,this._fullScreenRestore=null,this._gameSize=new e.Rectangle,this._userScaleFactor=new e.Point(1,1),this._userScaleTrim=new e.Point(0,0),this._lastUpdate=0,this._updateThrottle=0,this._updateThrottleReset=100,this._parentBounds=new e.Rectangle,this._tempBounds=new e.Rectangle,this._lastReportedCanvasSize=new e.Rectangle,this._lastReportedGameSize=new e.Rectangle,this._booted=!1,t.config&&this.parseConfig(t.config),this.setupScale(i,s)},e.ScaleManager.EXACT_FIT=0,e.ScaleManager.NO_SCALE=1,e.ScaleManager.SHOW_ALL=2,e.ScaleManager.RESIZE=3,e.ScaleManager.USER_SCALE=4,e.ScaleManager.MODES=["EXACT_FIT","NO_SCALE","SHOW_ALL","RESIZE","USER_SCALE"],e.ScaleManager.prototype={boot:function(){var t=this.compatibility;t.supportsFullScreen=this.game.device.fullscreen&&!this.game.device.cocoonJS,this.game.device.iPad||this.game.device.webApp||this.game.device.desktop||(this.game.device.android&&!this.game.device.chrome?t.scrollTo=new e.Point(0,1):t.scrollTo=new e.Point(0,0)),this.game.device.desktop?(t.orientationFallback="screen",t.clickTrampoline="when-not-mouse"):(t.orientationFallback="",t.clickTrampoline="");var i=this;this._orientationChange=function(t){return i.orientationChange(t)},this._windowResize=function(t){return i.windowResize(t)},window.addEventListener("orientationchange",this._orientationChange,!1),window.addEventListener("resize",this._windowResize,!1),this.compatibility.supportsFullScreen&&(this._fullScreenChange=function(t){return i.fullScreenChange(t)},this._fullScreenError=function(t){return i.fullScreenError(t)},document.addEventListener("webkitfullscreenchange",this._fullScreenChange,!1),document.addEventListener("mozfullscreenchange",this._fullScreenChange,!1),document.addEventListener("MSFullscreenChange",this._fullScreenChange,!1),document.addEventListener("fullscreenchange",this._fullScreenChange,!1),document.addEventListener("webkitfullscreenerror",this._fullScreenError,!1),document.addEventListener("mozfullscreenerror",this._fullScreenError,!1),document.addEventListener("MSFullscreenError",this._fullScreenError,!1),document.addEventListener("fullscreenerror",this._fullScreenError,!1)),this.game.onResume.add(this._gameResumed,this),this.dom.getOffset(this.game.canvas,this.offset),this.bounds.setTo(this.offset.x,this.offset.y,this.width,this.height),this.setGameSize(this.game.width,this.game.height),this.screenOrientation=this.dom.getScreenOrientation(this.compatibility.orientationFallback),e.FlexGrid&&(this.grid=new e.FlexGrid(this,this.width,this.height)),this._booted=!0,null!==this._pendingScaleMode&&(this.scaleMode=this._pendingScaleMode,this._pendingScaleMode=null)},parseConfig:function(t){void 0!==t.scaleMode&&(this._booted?this.scaleMode=t.scaleMode:this._pendingScaleMode=t.scaleMode),void 0!==t.fullScreenScaleMode&&(this.fullScreenScaleMode=t.fullScreenScaleMode),t.fullScreenTarget&&(this.fullScreenTarget=t.fullScreenTarget),this.pageAlignHorizontally=t.alignH||!1,this.pageAlignVertically=t.alignV||!1,t.scaleH&&t.scaleV&&this.setUserScale(t.scaleH,t.scaleV,t.trimH,t.trimV)},setupScale:function(t,i){var s,n=new e.Rectangle;""!==this.game.parent&&("string"==typeof this.game.parent?s=document.getElementById(this.game.parent):this.game.parent&&1===this.game.parent.nodeType&&(s=this.game.parent)),s?(this.parentNode=s,this.parentIsWindow=!1,this.getParentBounds(this._parentBounds,this.parentNode),n.width=this._parentBounds.width,n.height=this._parentBounds.height,this.offset.set(this._parentBounds.x,this._parentBounds.y)):(this.parentNode=null,this.parentIsWindow=!0,n.width=this.dom.visualBounds.width,n.height=this.dom.visualBounds.height,this.offset.set(0,0));var r=0,o=0;"number"==typeof t?r=t:(this.parentScaleFactor.x=parseInt(t,10)/100,r=n.width*this.parentScaleFactor.x),"number"==typeof i?o=i:(this.parentScaleFactor.y=parseInt(i,10)/100,o=n.height*this.parentScaleFactor.y),r=Math.floor(r),o=Math.floor(o),this._gameSize.setTo(0,0,r,o),this.updateDimensions(r,o,!1)},_gameResumed:function(){this.queueUpdate(!0)},setGameSize:function(t,i){this._gameSize.setTo(0,0,t,i),this.currentScaleMode!==e.ScaleManager.RESIZE&&this.updateDimensions(t,i,!0),this.queueUpdate(!0)},setUserScale:function(t,e,i,s,n,r){this._userScaleFactor.setTo(t,e),this._userScaleTrim.setTo(0|i,0|s),void 0===n&&(n=!0),void 0===r&&(r=!0),n&&this.queueUpdate(r)},setResizeCallback:function(t,e){this.onResize=t,this.onResizeContext=e},signalSizeChange:function(){if(!e.Rectangle.sameDimensions(this,this._lastReportedCanvasSize)||!e.Rectangle.sameDimensions(this.game,this._lastReportedGameSize)){var t=this.width,i=this.height;this._lastReportedCanvasSize.setTo(0,0,t,i),this._lastReportedGameSize.setTo(0,0,this.game.width,this.game.height),this.grid&&this.grid.onResize(t,i),this.onSizeChange.dispatch(this,t,i),this.currentScaleMode===e.ScaleManager.RESIZE&&(this.game.state.resize(t,i),this.game.load.resize(t,i))}},setMinMax:function(t,e,i,s){this.minWidth=t,this.minHeight=e,void 0!==i&&(this.maxWidth=i),void 0!==s&&(this.maxHeight=s)},preUpdate:function(){if(!(this.game.time.time<this._lastUpdate+this._updateThrottle)){var t=this._updateThrottle;this._updateThrottleReset=t>=400?0:100,this.dom.getOffset(this.game.canvas,this.offset);var i=this._parentBounds.width,s=this._parentBounds.height,n=this.getParentBounds(this._parentBounds),r=n.width!==i||n.height!==s,o=this.updateOrientationState();(r||o)&&(this.onResize&&this.onResize.call(this.onResizeContext,this,n),this.updateLayout(),this.signalSizeChange());var a=2*this._updateThrottle;this._updateThrottle<t&&(a=Math.min(t,this._updateThrottleReset)),this._updateThrottle=e.Math.clamp(a,25,this.trackParentInterval),this._lastUpdate=this.game.time.time}},pauseUpdate:function(){this.preUpdate(),this._updateThrottle=this.trackParentInterval},updateDimensions:function(t,e,i){this.width=t*this.parentScaleFactor.x,this.height=e*this.parentScaleFactor.y,this.game.width=this.width,this.game.height=this.height,this.sourceAspectRatio=this.width/this.height,this.updateScalingAndBounds(),i&&(this.game.renderer.resize(this.width,this.height),this.game.camera.setSize(this.width,this.height),this.game.world.resize(this.width,this.height))},updateScalingAndBounds:function(){this.scaleFactor.x=this.game.width/this.width,this.scaleFactor.y=this.game.height/this.height,this.scaleFactorInversed.x=this.width/this.game.width,this.scaleFactorInversed.y=this.height/this.game.height,this.aspectRatio=this.width/this.height,this.game.canvas&&this.dom.getOffset(this.game.canvas,this.offset),this.bounds.setTo(this.offset.x,this.offset.y,this.width,this.height),this.game.input&&this.game.input.scale&&this.game.input.scale.setTo(this.scaleFactor.x,this.scaleFactor.y)},forceOrientation:function(t,e){void 0===e&&(e=!1),!0!==t||!0!==e?(this.forceLandscape=t,this.forcePortrait=e,this.queueUpdate(!0)):console.warn("Phaser.ScaleManager: forceLandscape and forcePortrait cannot both be true.")},classifyOrientation:function(t){return"portrait-primary"===t||"portrait-secondary"===t?"portrait":"landscape-primary"===t||"landscape-secondary"===t?"landscape":null},updateOrientationState:function(){var t=this.screenOrientation,e=this.incorrectOrientation;this.screenOrientation=this.dom.getScreenOrientation(this.compatibility.orientationFallback),this.incorrectOrientation=this.forceLandscape&&!this.isLandscape||this.forcePortrait&&!this.isPortrait;var i=t!==this.screenOrientation,s=e!==this.incorrectOrientation;return s&&(this.incorrectOrientation?this.enterIncorrectOrientation.dispatch():this.leaveIncorrectOrientation.dispatch()),(i||s)&&this.onOrientationChange.dispatch(this,t,e),i||s},orientationChange:function(t){this.event=t,this.queueUpdate(!0)},windowResize:function(t){this.event=t,this.queueUpdate(!0)},scrollTop:function(){var t=this.compatibility.scrollTo;t&&window.scrollTo(t.x,t.y)},refresh:function(){this.scrollTop(),this.queueUpdate(!0)},updateLayout:function(){var t=this.currentScaleMode;if(t!==e.ScaleManager.RESIZE){if(this.scrollTop(),this.compatibility.forceMinimumDocumentHeight&&(document.documentElement.style.minHeight=window.innerHeight+"px"),this.incorrectOrientation?this.setMaximum():t===e.ScaleManager.EXACT_FIT?this.setExactFit():t===e.ScaleManager.SHOW_ALL?!this.isFullScreen&&this.boundingParent&&this.compatibility.canExpandParent?(this.setShowAll(!0),this.resetCanvas(),this.setShowAll()):this.setShowAll():t===e.ScaleManager.NO_SCALE?(this.width=this.game.width,this.height=this.game.height):t===e.ScaleManager.USER_SCALE&&(this.width=this.game.width*this._userScaleFactor.x-this._userScaleTrim.x,this.height=this.game.height*this._userScaleFactor.y-this._userScaleTrim.y),!this.compatibility.canExpandParent&&(t===e.ScaleManager.SHOW_ALL||t===e.ScaleManager.USER_SCALE)){var i=this.getParentBounds(this._tempBounds);this.width=Math.min(this.width,i.width),this.height=Math.min(this.height,i.height)}this.width=0|this.width,this.height=0|this.height,this.reflowCanvas()}else this.reflowGame()},getParentBounds:function(t,i){var s=t||new e.Rectangle,n=i||this.boundingParent,r=this.dom.visualBounds,o=this.dom.layoutBounds;if(n){var a=n.getBoundingClientRect(),h=n.offsetParent?n.offsetParent.getBoundingClientRect():n.getBoundingClientRect();s.setTo(a.left-h.left,a.top-h.top,a.width,a.height);var l=this.windowConstraints;if(l.right){c="layout"===l.right?o:r;s.right=Math.min(s.right,c.width)}if(l.bottom){var c="layout"===l.bottom?o:r;s.bottom=Math.min(s.bottom,c.height)}}else s.setTo(0,0,r.width,r.height);return s.setTo(Math.round(s.x),Math.round(s.y),Math.round(s.width),Math.round(s.height)),s},align:function(t,e){null!=t&&(this.pageAlignHorizontally=t),null!=e&&(this.pageAlignVertically=e)},alignCanvas:function(t,e){var i=this.getParentBounds(this._tempBounds),s=this.game.canvas,n=this.margin;if(t){n.left=n.right=0;h=s.getBoundingClientRect();if(this.width<i.width&&!this.incorrectOrientation){var r=h.left-i.x,o=i.width/2-this.width/2,a=(o=Math.max(o,0))-r;n.left=Math.round(a)}s.style.marginLeft=n.left+"px",0!==n.left&&(n.right=-(i.width-h.width-n.left),s.style.marginRight=n.right+"px")}if(e){n.top=n.bottom=0;var h=s.getBoundingClientRect();if(this.height<i.height&&!this.incorrectOrientation){var r=h.top-i.y,o=i.height/2-this.height/2,a=(o=Math.max(o,0))-r;n.top=Math.round(a)}s.style.marginTop=n.top+"px",0!==n.top&&(n.bottom=-(i.height-h.height-n.top),s.style.marginBottom=n.bottom+"px")}n.x=n.left,n.y=n.top},reflowGame:function(){this.resetCanvas("","");var t=this.getParentBounds(this._tempBounds);this.updateDimensions(t.width,t.height,!0)},reflowCanvas:function(){this.incorrectOrientation||(this.width=e.Math.clamp(this.width,this.minWidth||0,this.maxWidth||this.width),this.height=e.Math.clamp(this.height,this.minHeight||0,this.maxHeight||this.height)),this.resetCanvas(),this.compatibility.noMargins||(this.isFullScreen&&this._createdFullScreenTarget?this.alignCanvas(!0,!0):this.alignCanvas(this.pageAlignHorizontally,this.pageAlignVertically)),this.updateScalingAndBounds()},resetCanvas:function(t,e){void 0===t&&(t=this.width+"px"),void 0===e&&(e=this.height+"px");var i=this.game.canvas;this.compatibility.noMargins||(i.style.marginLeft="",i.style.marginTop="",i.style.marginRight="",i.style.marginBottom=""),i.style.width=t,i.style.height=e},queueUpdate:function(t){t&&(this._parentBounds.width=0,this._parentBounds.height=0),this._updateThrottle=this._updateThrottleReset},reset:function(t){t&&this.grid&&this.grid.reset()},setMaximum:function(){this.width=this.dom.visualBounds.width,this.height=this.dom.visualBounds.height},setShowAll:function(t){var e,i=this.getParentBounds(this._tempBounds),s=i.width,n=i.height;e=t?Math.max(n/this.game.height,s/this.game.width):Math.min(n/this.game.height,s/this.game.width),this.width=Math.round(this.game.width*e),this.height=Math.round(this.game.height*e)},setExactFit:function(){var t=this.getParentBounds(this._tempBounds);this.width=t.width,this.height=t.height,this.isFullScreen||(this.maxWidth&&(this.width=Math.min(this.width,this.maxWidth)),this.maxHeight&&(this.height=Math.min(this.height,this.maxHeight)))},createFullScreenTarget:function(){var t=document.createElement("div");return t.style.margin="0",t.style.padding="0",t.style.background="#000",t},startFullScreen:function(t,i){if(this.isFullScreen)return!1;{if(this.compatibility.supportsFullScreen){if("when-not-mouse"===this.compatibility.clickTrampoline){var s=this.game.input;if(s.activePointer&&s.activePointer!==s.mousePointer&&(i||!1!==i))return void s.activePointer.addClickTrampoline("startFullScreen",this.startFullScreen,this,[t,!1])}void 0!==t&&this.game.renderType===e.CANVAS&&(this.game.stage.smoothed=t);var n=this.fullScreenTarget;n||(this.cleanupCreatedTarget(),this._createdFullScreenTarget=this.createFullScreenTarget(),n=this._createdFullScreenTarget);var r={targetElement:n};if(this.hasPhaserSetFullScreen=!0,this.onFullScreenInit.dispatch(this,r),this._createdFullScreenTarget){var o=this.game.canvas;o.parentNode.insertBefore(n,o),n.appendChild(o)}return this.game.device.fullscreenKeyboard?n[this.game.device.requestFullscreen](Element.ALLOW_KEYBOARD_INPUT):n[this.game.device.requestFullscreen](),!0}var a=this;setTimeout(function(){a.fullScreenError()},10)}},stopFullScreen:function(){return!(!this.isFullScreen||!this.compatibility.supportsFullScreen)&&(this.hasPhaserSetFullScreen=!1,document[this.game.device.cancelFullscreen](),!0)},cleanupCreatedTarget:function(){var t=this._createdFullScreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.game.canvas,t),e.removeChild(t)}this._createdFullScreenTarget=null},prepScreenMode:function(t){var i=!!this._createdFullScreenTarget,s=this._createdFullScreenTarget||this.fullScreenTarget;t?(i||this.fullScreenScaleMode===e.ScaleManager.EXACT_FIT)&&s!==this.game.canvas&&(this._fullScreenRestore={targetWidth:s.style.width,targetHeight:s.style.height},s.style.width="100%",s.style.height="100%"):(this._fullScreenRestore&&(s.style.width=this._fullScreenRestore.targetWidth,s.style.height=this._fullScreenRestore.targetHeight,this._fullScreenRestore=null),this.updateDimensions(this._gameSize.width,this._gameSize.height,!0),this.resetCanvas())},fullScreenChange:function(t){this.event=t,this.isFullScreen?(this.prepScreenMode(!0),this.updateLayout(),this.queueUpdate(!0)):(this.prepScreenMode(!1),this.cleanupCreatedTarget(),this.updateLayout(),this.queueUpdate(!0)),this.onFullScreenChange.dispatch(this,this.width,this.height)},fullScreenError:function(t){this.event=t,this.cleanupCreatedTarget(),console.warn("Phaser.ScaleManager: requestFullscreen failed or device does not support the Fullscreen API"),this.onFullScreenError.dispatch(this)},scaleSprite:function(t,e,i,s){if(void 0===e&&(e=this.width),void 0===i&&(i=this.height),void 0===s&&(s=!1),!t||!t.scale)return t;if(t.scale.x=1,t.scale.y=1,t.width<=0||t.height<=0||e<=0||i<=0)return t;var n=e,r=t.height*e/t.width,o=t.width*i/t.height,a=i,h=o>e;return(h=h?s:!s)?(t.width=Math.floor(n),t.height=Math.floor(r)):(t.width=Math.floor(o),t.height=Math.floor(a)),t},destroy:function(){this.game.onResume.remove(this._gameResumed,this),window.removeEventListener("orientationchange",this._orientationChange,!1),window.removeEventListener("resize",this._windowResize,!1),this.compatibility.supportsFullScreen&&(document.removeEventListener("webkitfullscreenchange",this._fullScreenChange,!1),document.removeEventListener("mozfullscreenchange",this._fullScreenChange,!1),document.removeEventListener("MSFullscreenChange",this._fullScreenChange,!1),document.removeEventListener("fullscreenchange",this._fullScreenChange,!1),document.removeEventListener("webkitfullscreenerror",this._fullScreenError,!1),document.removeEventListener("mozfullscreenerror",this._fullScreenError,!1),document.removeEventListener("MSFullscreenError",this._fullScreenError,!1),document.removeEventListener("fullscreenerror",this._fullScreenError,!1))}},e.ScaleManager.prototype.constructor=e.ScaleManager,Object.defineProperty(e.ScaleManager.prototype,"boundingParent",{get:function(){return this.parentIsWindow||this.isFullScreen&&this.hasPhaserSetFullScreen&&!this._createdFullScreenTarget?null:this.game.canvas&&this.game.canvas.parentNode||null}}),Object.defineProperty(e.ScaleManager.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){return t!==this._scaleMode&&(this.isFullScreen||(this.updateDimensions(this._gameSize.width,this._gameSize.height,!0),this.queueUpdate(!0)),this._scaleMode=t),this._scaleMode}}),Object.defineProperty(e.ScaleManager.prototype,"fullScreenScaleMode",{get:function(){return this._fullScreenScaleMode},set:function(t){return t!==this._fullScreenScaleMode&&(this.isFullScreen?(this.prepScreenMode(!1),this._fullScreenScaleMode=t,this.prepScreenMode(!0),this.queueUpdate(!0)):this._fullScreenScaleMode=t),this._fullScreenScaleMode}}),Object.defineProperty(e.ScaleManager.prototype,"currentScaleMode",{get:function(){return this.isFullScreen?this._fullScreenScaleMode:this._scaleMode}}),Object.defineProperty(e.ScaleManager.prototype,"pageAlignHorizontally",{get:function(){return this._pageAlignHorizontally},set:function(t){t!==this._pageAlignHorizontally&&(this._pageAlignHorizontally=t,this.queueUpdate(!0))}}),Object.defineProperty(e.ScaleManager.prototype,"pageAlignVertically",{get:function(){return this._pageAlignVertically},set:function(t){t!==this._pageAlignVertically&&(this._pageAlignVertically=t,this.queueUpdate(!0))}}),Object.defineProperty(e.ScaleManager.prototype,"isFullScreen",{get:function(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}}),Object.defineProperty(e.ScaleManager.prototype,"isPortrait",{get:function(){return"portrait"===this.classifyOrientation(this.screenOrientation)}}),Object.defineProperty(e.ScaleManager.prototype,"isLandscape",{get:function(){return"landscape"===this.classifyOrientation(this.screenOrientation)}}),Object.defineProperty(e.ScaleManager.prototype,"isGamePortrait",{get:function(){return this.height>this.width}}),Object.defineProperty(e.ScaleManager.prototype,"isGameLandscape",{get:function(){return this.width>this.height}}),e.Utils.Debug=function(t){this.game=t,this.sprite=null,this.bmd=null,this.canvas=null,this.context=null,this.font="14px monospace",this.columnWidth=100,this.lineHeight=16,this.lineWidth=1,this.renderShadow=!0,this.currentColor=null,this.currentX=0,this.currentY=0,this.currentAlpha=1,this.dirty=!1,this.isDisabled=!1,this._line=null,this._rect=null},e.Utils.Debug.GEOM_AUTO=0,e.Utils.Debug.GEOM_RECTANGLE=1,e.Utils.Debug.GEOM_CIRCLE=2,e.Utils.Debug.GEOM_POINT=3,e.Utils.Debug.GEOM_LINE=4,e.Utils.Debug.GEOM_ELLIPSE=5,e.Utils.Debug.prototype={boot:function(){this.game.renderType===e.CANVAS?this.context=this.game.context:(this.bmd=new e.BitmapData(this.game,"__DEBUG",this.game.width,this.game.height,!0),this.sprite=this.game.make.image(0,0,this.bmd),this.game.stage.addChild(this.sprite),this.game.scale.onSizeChange.add(this.resize,this),this.canvas=e.CanvasPool.create(this,this.game.width,this.game.height),this.context=this.canvas.getContext("2d")),this._line=new e.Line,this._rect=new e.Rectangle},resize:function(){this.bmd.resize(this.game.width,this.game.height),this.canvas.width=this.game.width,this.canvas.height=this.game.height},preUpdate:function(){this.dirty&&this.sprite&&(this.bmd.clear(),this.bmd.draw(this.canvas,0,0),this.context.clearRect(0,0,this.game.width,this.game.height),this.dirty=!1)},reset:function(){this.context&&this.context.clearRect(0,0,this.game.width,this.game.height),this.sprite&&this.bmd.clear()},start:function(t,e,i,s){"number"!=typeof t&&(t=0),"number"!=typeof e&&(e=0),i=i||"rgb(255,255,255)",void 0===s&&(s=0),this.currentX=t,this.currentY=e,this.currentColor=i,this.columnWidth=s,this.dirty=!0,this.context.save(),this.context.setTransform(1,0,0,1,0,0),this.context.strokeStyle=i,this.context.fillStyle=i,this.context.font=this.font,this.context.globalAlpha=this.currentAlpha},stop:function(){this.context.restore()},line:function(){for(var t=this.currentX,e=0;e<arguments.length;e++)this.renderShadow&&(this.context.fillStyle="rgb(0,0,0)",this.context.fillText(arguments[e],t+1,this.currentY+1),this.context.fillStyle=this.currentColor),this.context.fillText(arguments[e],t,this.currentY),t+=this.columnWidth;this.currentY+=this.lineHeight},sound:function(t,e,i){var s=this.game.sound;this.start(t,e,i),s.noAudio?this.line("Audio is disabled"):(this.line("Volume: "+s.volume.toFixed(2)+(s.mute?" (Mute)":"")),this.line("Mute on pause: "+s.muteOnPause),this.line("Using: "+(s.usingWebAudio?"Web Audio - "+s.context.state:"Audio Tag")),this.line("Touch locked: "+s.touchLocked),this.line("Sounds: "+s._sounds.length)),this.stop()},soundInfo:function(t,e,i,s){this.start(e,i,s),this.line("Sound: "+t.key+" Touch locked: "+t.game.sound.touchLocked),this.line("Is Ready?: "+this.game.cache.isSoundReady(t.key)+" Pending Playback: "+t.pendingPlayback),this.line("Decoded: "+t.isDecoded+" Decoding: "+t.isDecoding),this.line("Playing: "+t.isPlaying+" Loop: "+t.loop),this.line("Time: "+(t.currentTime/1e3).toFixed(3)+"s Total: "+t.totalDuration.toFixed(3)+"s"),this.line("Volume: "+t.volume.toFixed(2)+(t.mute?" (Mute)":"")),this.line("Using: "+(t.usingWebAudio?"Web Audio":"Audio Tag")+" "+(t.usingWebAudio?"Source: "+(t.sourceId||"none"):"")),""!==t.currentMarker&&(this.line("Marker: "+t.currentMarker+" Duration: "+t.duration.toFixed(3)+"s ("+t.durationMS+"ms)"),this.line("Start: "+t.markers[t.currentMarker].start+" Stop: "+t.markers[t.currentMarker].stop),this.line("Position: "+t.position)),this.stop()},camera:function(t,e,i){var s=t.deadzone,n=t.target,r=t.view;s&&(this._rect.setTo(r.x+s.x,r.y+s.y,s.width,s.height),this.rectangle(this._rect,e,i)),n&&(this._line.setTo(r.centerX,r.centerY,n.x,n.y),this.geom(this._line,e,i),this.geom(n,e,!1,3))},cameraInfo:function(t,e,i,s){var n=t.bounds,r=t.deadzone,o=t.target,a=t.view;this.start(e,i,s),this.line("Camera ("+t.width+" x "+t.height+")"),this.line("x: "+t.x+" y: "+t.y),this.line("Bounds: "+(n?"x: "+n.x+" y: "+n.y+" w: "+n.width+" h: "+n.height:"none")),this.line("View: x: "+a.x+" y: "+a.y+" w: "+a.width+" h: "+a.height),this.line("Deadzone: "+(r?"x: "+r.x+" y: "+r.y+" w: "+r.width+" h: "+r.height:r)),this.line("Total in view: "+t.totalInView),this.line("At limit: x: "+t.atLimit.x+" y: "+t.atLimit.y),this.line("Target: "+(o?o.name||o:"none")),this.stop()},timer:function(t,e,i,s){this.start(e,i,s),this.line("Timer (running: "+t.running+" expired: "+t.expired+")"),this.line("Next Tick: "+t.next+" Duration: "+t.duration),this.line("Paused: "+t.paused+" Length: "+t.length),this.stop()},pointer:function(t,e,i,s,n,r){if(null!=t&&(void 0===e&&(e=!1),i=i||"rgba(0,255,0,0.5)",s=s||"rgba(255,255,0,0.5)",r=r||"rgba(255,0,0,0.5)",!0!==e||!0!==t.isUp)){this.start(t.x,t.y-150,n),this.context.beginPath(),this.context.arc(t.x,t.y,t.circle.radius,0,2*Math.PI),t.active?this.context.fillStyle=t.isDown?i:s:this.context.fillStyle=r,this.context.fill(),this.context.closePath(),this.context.beginPath(),this.context.moveTo(t.positionDown.x,t.positionDown.y),this.context.lineTo(t.position.x,t.position.y),this.context.lineWidth=2,this.context.stroke(),this.context.closePath();var o=t.movementX,a=t.movementY;(o||a)&&(this.context.beginPath(),this.context.moveTo(o+t.position.x,a+t.position.y),this.context.lineTo(t.position.x,t.position.y),this.context.lineWidth=2,this.context.stroke(),this.context.closePath()),this.line("ID: "+t.id+" Active: "+t.active),this.line("World X: "+t.worldX.toFixed(1)+" World Y: "+t.worldY.toFixed(1)),this.line("Screen X: "+t.x.toFixed(1)+" Screen Y: "+t.y.toFixed(1)+" In: "+t.withinGame),this.line("Movement: X: "+o+" Y: "+a),this.line("Duration: "+t.duration+" ms"),this.line("is Down: "+t.isDown+" is Up: "+t.isUp),t.isMouse&&this.line("Buttons: "+this._pointerButtonIcon(t.leftButton)+" "+this._pointerButtonIcon(t.middleButton)+" "+this._pointerButtonIcon(t.rightButton)),this.stop()}},_pointerButtonIcon:function(t){return t.isDown?"x":t.isUp?"o":"-"},spriteInputInfo:function(t,e,i,s){this.start(e,i,s),this.line("Sprite Input: ("+t.width+" x "+t.height+")"),this.line("x: "+t.input.pointerX().toFixed(1)+" y: "+t.input.pointerY().toFixed(1)),this.line("over: "+t.input.pointerOver()+" duration: "+t.input.overDuration().toFixed(0)),this.line("down: "+t.input.pointerDown()+" duration: "+t.input.downDuration().toFixed(0)),this.line("just over: "+t.input.justOver()+" just out: "+t.input.justOut()),this.stop()},key:function(t,e,i,s){this.start(e,i,s,150),this.line("Key:",t.keyCode,"isDown:",t.isDown),this.line("justDown:",t.justDown,"justUp:",t.justUp),this.line("Time Down:",t.timeDown.toFixed(0),"duration:",t.duration.toFixed(0)),this.stop()},inputInfo:function(t,i,s,n){var r=this.game.input;if(void 0===n&&(n=!0),this.start(t,i,s),this.line("Input"),this.line("X: "+r.x+" Y: "+r.y),this.line("World X: "+r.worldX+" World Y: "+r.worldY),this.line("Scale X: "+r.scale.x.toFixed(2)+" Scale Y: "+r.scale.x.toFixed(2)),this.line("Screen X: "+r.activePointer.screenX.toFixed(1)+" Screen Y: "+r.activePointer.screenY.toFixed(1)),n){this.line("Sources:"),this.line(" "+this._inputHandler(r.mouse,"mouse")),this.line(" "+this._inputHandler(r.mspointer,"mspointer")),this.line(" "+this._inputHandler(r.touch,"touch"));var o=r.pointers,a=r.mousePointer,h=e.PointerModes;this.line("Pointers: (Max: "+r.maxPointers+")"),this.line(" "+(a.isDown?"x":"o")+" "+h[a.pointerMode]);for(var l=0;l<o.length;l++){var c=o[l];this.line(" "+(c.active?"+":"-")+" "+h[c.pointerMode])}this.stop()}else this.stop()},_inputHandler:function(t,e){return this._inputHandlerStatusIcon(t)+" "+e+" "+this._inputHandlerCaptureIcon(t)},_inputHandlerStatusIcon:function(t){return t.active?t.enabled?"+":"-":" "},_inputHandlerCaptureIcon:function(t){return t.active&&(t.capture||t.preventDefault)?"*":" "},spriteBounds:function(t,e,i){var s=t.getBounds();s.x+=this.game.camera.x,s.y+=this.game.camera.y,this.rectangle(s,e,i)},ropeSegments:function(t,e,i){var s=this;t.segments.forEach(function(t){s.rectangle(t,e,i)},this)},spriteInfo:function(t,e,i,s){this.start(e,i,s),this.line("Sprite: "+(t.name||"")+" ("+t.width+" x "+t.height+") anchor: "+t.anchor.x+" x "+t.anchor.y),this.line("x: "+t.x.toFixed(1)+" y: "+t.y.toFixed(1)),this.line("angle: "+t.angle.toFixed(1)+" rotation: "+t.rotation.toFixed(1)),this.line("visible: "+t.visible+" in camera: "+t.inCamera),this.line("bounds x: "+t._bounds.x.toFixed(1)+" y: "+t._bounds.y.toFixed(1)+" w: "+t._bounds.width.toFixed(1)+" h: "+t._bounds.height.toFixed(1)),this.line("parent: "+(t.parent?t.parent.name||"(DisplayObject)":"(none)")),this.stop()},spriteCoords:function(t,e,i,s){this.start(e,i,s,100),t.name&&this.line(t.name),this.line("x:",t.x.toFixed(2),"y:",t.y.toFixed(2)),this.line("pos x:",t.position.x.toFixed(2),"pos y:",t.position.y.toFixed(2)),this.line("world x:",t.world.x.toFixed(2),"world y:",t.world.y.toFixed(2)),this.stop()},lineInfo:function(t,e,i,s){this.start(e,i,s,80),this.line("start.x:",t.start.x.toFixed(2),"start.y:",t.start.y.toFixed(2)),this.line("end.x:",t.end.x.toFixed(2),"end.y:",t.end.y.toFixed(2)),this.line("length:",t.length.toFixed(2),"angle:",t.angle),this.stop()},pixel:function(t,e,i,s){s=s||2,this.start(),this.context.fillStyle=i,this.context.fillRect(t,e,s,s),this.stop()},geom:function(t,i,s,n){void 0===s&&(s=!0),void 0===n&&(n=0),i=i||"rgba(0,255,0,0.4)",this.start(),this.context.fillStyle=i,this.context.strokeStyle=i,this.context.lineWidth=this.lineWidth;var r=e.Utils.Debug;n===r.GEOM_RECTANGLE||t instanceof e.Rectangle?s?this.context.fillRect(t.x-this.game.camera.x,t.y-this.game.camera.y,t.width,t.height):this.context.strokeRect(t.x-this.game.camera.x,t.y-this.game.camera.y,t.width,t.height):n===r.GEOM_CIRCLE||t instanceof e.Circle?(this.context.beginPath(),this.context.arc(t.x-this.game.camera.x,t.y-this.game.camera.y,t.radius,0,2*Math.PI,!1),this.context.closePath(),s?this.context.fill():this.context.stroke()):n===r.GEOM_POINT||t instanceof e.Point?this.context.fillRect(t.x-this.game.camera.x,t.y-this.game.camera.y,4,4):n===r.GEOM_LINE||t instanceof e.Line?(this.context.beginPath(),this.context.moveTo(t.start.x+.5-this.game.camera.x,t.start.y+.5-this.game.camera.y),this.context.lineTo(t.end.x+.5-this.game.camera.x,t.end.y+.5-this.game.camera.y),this.context.closePath(),this.context.stroke()):(n===r.GEOM_ELLIPSE||t instanceof e.Ellipse)&&(this.context.beginPath(),this.context.ellipse(t.centerX-this.game.camera.x,t.centerY-this.game.camera.y,t.width/2,t.height/2,0,2*Math.PI,!1),this.context.closePath(),s?this.context.fill():this.context.stroke()),this.stop()},rectangle:function(t,e,i){void 0===i&&(i=!0),e=e||"rgba(0, 255, 0, 0.4)",this.start(),i?(this.context.fillStyle=e,this.context.fillRect(t.x-this.game.camera.x,t.y-this.game.camera.y,t.width,t.height)):(this.context.lineWidth=this.lineWidth,this.context.strokeStyle=e,this.context.strokeRect(t.x-this.game.camera.x,t.y-this.game.camera.y,t.width,t.height)),this.stop()},text:function(t,e,i,s,n){s=s||"rgb(255,255,255)",n=n||this.font,this.start(),this.context.font=n,this.renderShadow&&(this.context.fillStyle="rgb(0,0,0)",this.context.fillText(t,e+1,i+1)),this.context.fillStyle=s,this.context.fillText(t,e,i),this.stop()},quadTree:function(t,e){e=e||"rgba(255,0,0,0.3)",this.start();var i=t.bounds;if(0===t.nodes.length){this.context.strokeStyle=e,this.context.strokeRect(i.x,i.y,i.width,i.height),this.text("size: "+t.objects.length,i.x+4,i.y+16,"rgb(0,200,0)","12px Courier"),this.context.strokeStyle="rgb(0,255,0)";for(s=0;s<t.objects.length;s++)this.context.strokeRect(t.objects[s].x,t.objects[s].y,t.objects[s].width,t.objects[s].height)}else for(var s=0;s<t.nodes.length;s++)this.quadTree(t.nodes[s]);this.stop()},body:function(t,i,s){t.body&&(this.start(),t.body.type===e.Physics.ARCADE?e.Physics.Arcade.Body.render(this.context,t.body,i,s,this.lineWidth):t.body.type===e.Physics.NINJA?e.Physics.Ninja.Body.render(this.context,t.body,i,s):t.body.type===e.Physics.BOX2D&&e.Physics.Box2D.renderBody(this.context,t.body,i),this.stop())},bodyInfo:function(t,i,s,n){t.body&&(this.start(i,s,n,210),t.body.type===e.Physics.ARCADE?e.Physics.Arcade.Body.renderBodyInfo(this,t.body):t.body.type===e.Physics.BOX2D&&this.game.physics.box2d.renderBodyInfo(this,t.body),this.stop())},box2dWorld:function(){this.start(),this.context.translate(-this.game.camera.view.x,-this.game.camera.view.y,0),this.game.physics.box2d.renderDebugDraw(this.context),this.stop()},box2dBody:function(t,i){this.start(),e.Physics.Box2D.renderBody(this.context,t,i),this.stop()},displayList:function(t){if(void 0===t&&(t=this.game.world),t.hasOwnProperty("renderOrderID")?console.log("["+t.renderOrderID+"]",t):console.log("[]",t),t.children&&t.children.length>0)for(var e=0;e<t.children.length;e++)this.game.debug.displayList(t.children[e])},renderer:function(t,e,i){var s=this.game.renderer,n=s.renderSession;if(this.start(t,e,i),this.line((s.gl?"WebGL":"Canvas")+" Renderer ("+s.width+" x "+s.height+")"),this.line("autoResize: "+s.autoResize),this.line("clearBeforeRender: "+s.clearBeforeRender),this.line("resolution: "+s.resolution),this.line("transparent: "+s.transparent),this.line("renderSession:"),s.gl){this.line(" currentBatchedTextures: ("+s.currentBatchedTextures.length+")");for(var r=0;r<s.currentBatchedTextures.length;r++)this.line(" "+s.currentBatchedTextures[r]);this.line(" drawCount: "+n.drawCount),this.line(" maxTextures: "+s.maxTextures),this.line(" maxTextureSize: "+s.maxTextureSize),this.line(" maxTextureAvailableSpace: "+n.maxTextureAvailableSpace),this.line(" roundPixels: "+n.roundPixels)}else this.line(" roundPixels: "+n.roundPixels),this.line(" scaleMode: "+(0===n.scaleMode?"LINEAR":1===n.scaleMode?"NEAREST":n.scaleMode));this.stop()},canvasPool:function(t,i,s,n){var r=e.CanvasPool;this.start(t,i,s,n||100),this.line("Canvas Pool"),this.line("Used:",r.getTotal()),this.line("Free:",r.getFree()),this.line("Total:",r.length),this.stop()},physicsGroup:function(t,e,i,s){t.forEach(this.body,this,s,e,i)},phaser:function(t,i,s){this.text("Phaser v"+e.VERSION+" "+(this.game.renderType===e.WEBGL?"WebGL":"Canvas")+" "+(this.game.device.webAudio?"WebAudio":"HTML Audio"),t,i,s,this.font)},scale:function(t,i,s){this.start(t,i,s);var n=this.game.scale,r=n.scaleFactorInversed,o=n._parentBounds,t=" x ";this.line("Game: "+this.game.width+t+this.game.height),this.line("Canvas: "+n.width+t+n.height+" ("+r.x.toFixed(2)+t+r.y.toFixed(2)+") ["+n.aspectRatio.toFixed(2)+"]"),this.line("Mode: "+e.ScaleManager.MODES[n.currentScaleMode]+(n.currentScaleMode===e.ScaleManager.USER_SCALE?" ("+n._userScaleFactor.x+t+n._userScaleFactor.y+")":"")),this.line("Parent: "+(n.parentIsWindow?"window":n.parentNode)+(o.empty?"":" ("+o.width+t+o.height+")")),this.line("Screen: "+n.classifyOrientation(n.screenOrientation)+(n.incorrectOrientation?" (incorrect)":"")),this.stop()},loader:function(t,i,s,n){var r=e.Utils.pad;this.start(i,s,n),t.hasLoaded?this.line("Complete"+(t.resetLocked?" [locked]":"")):t.isLoading?this.line("Loading"):this.line("Not started"),t.hasLoaded&&!t.resetLocked||(this.line("Progress: "+r(t.progress,3)+"%"),this.line("Files: "+t._loadedFileCount+" of "+t._totalFileCount),this.line("Packs: "+t._loadedPackCount+" of "+t._loadedPackCount)),this.stop()},device:function(t,e,i){var s=this.game.device;this.start(t,e,i),this.line("Device"),this.line("Pointer Events: "+s.mspointer),this.line("Touch: "+s.touch),this.line("Web Audio: "+s.webAudio),this.line("WebGL: "+s.webGL),this.stop()},destroy:function(){e.CanvasPool.remove(this)}},e.Utils.Debug.prototype.constructor=e.Utils.Debug,e.DOM={getOffset:function(t,i){i=i||new e.Point;var s=t.getBoundingClientRect(),n=e.DOM.scrollY,r=e.DOM.scrollX,o=document.documentElement.clientTop,a=document.documentElement.clientLeft;return i.x=s.left+r-a,i.y=s.top+n-o,i},getBounds:function(t,e){return void 0===e&&(e=0),!(!(t=t&&!t.nodeType?t[0]:t)||1!==t.nodeType)&&this.calibrate(t.getBoundingClientRect(),e)},calibrate:function(t,e){e=+e||0;var i={width:0,height:0,left:0,right:0,top:0,bottom:0};return i.width=(i.right=t.right+e)-(i.left=t.left-e),i.height=(i.bottom=t.bottom+e)-(i.top=t.top-e),i},getAspectRatio:function(t){var e=(t=null==t?this.visualBounds:1===t.nodeType?this.getBounds(t):t).width,i=t.height;return"function"==typeof e&&(e=e.call(t)),"function"==typeof i&&(i=i.call(t)),e/i},inLayoutViewport:function(t,e){var i=this.getBounds(t,e);return!!i&&i.bottom>=0&&i.right>=0&&i.top<=this.layoutBounds.width&&i.left<=this.layoutBounds.height},getScreenOrientation:function(t){var e=window.screen,i=e.orientation||e.mozOrientation||e.msOrientation;if(i&&"string"==typeof i.type)return i.type;if("string"==typeof i)return i;var s="portrait-primary",n="landscape-primary";if("screen"===t)return e.height>e.width?s:n;if("viewport"===t)return this.visualBounds.height>this.visualBounds.width?s:n;if("window.orientation"===t&&"number"==typeof window.orientation)return 0===window.orientation||180===window.orientation?s:n;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return s;if(window.matchMedia("(orientation: landscape)").matches)return n}return this.visualBounds.height>this.visualBounds.width?s:n},visualBounds:new e.Rectangle,layoutBounds:new e.Rectangle,documentBounds:new e.Rectangle},e.Device.whenReady(function(t){var i=window&&"pageXOffset"in window?function(){return window.pageXOffset}:function(){return document.documentElement.scrollLeft},s=window&&"pageYOffset"in window?function(){return window.pageYOffset}:function(){return document.documentElement.scrollTop};if(Object.defineProperty(e.DOM,"scrollX",{get:i}),Object.defineProperty(e.DOM,"scrollY",{get:s}),Object.defineProperty(e.DOM.visualBounds,"x",{get:i}),Object.defineProperty(e.DOM.visualBounds,"y",{get:s}),Object.defineProperty(e.DOM.layoutBounds,"x",{value:0}),Object.defineProperty(e.DOM.layoutBounds,"y",{value:0}),t.desktop&&document.documentElement.clientWidth<=window.innerWidth&&document.documentElement.clientHeight<=window.innerHeight){var n=function(){return Math.max(window.innerWidth,document.documentElement.clientWidth)},r=function(){return Math.max(window.innerHeight,document.documentElement.clientHeight)};Object.defineProperty(e.DOM.visualBounds,"width",{get:n}),Object.defineProperty(e.DOM.visualBounds,"height",{get:r}),Object.defineProperty(e.DOM.layoutBounds,"width",{get:n}),Object.defineProperty(e.DOM.layoutBounds,"height",{get:r})}else Object.defineProperty(e.DOM.visualBounds,"width",{get:function(){return window.innerWidth}}),Object.defineProperty(e.DOM.visualBounds,"height",{get:function(){return window.innerHeight}}),Object.defineProperty(e.DOM.layoutBounds,"width",{get:function(){var t=document.documentElement.clientWidth,e=window.innerWidth;return t<e?e:t}}),Object.defineProperty(e.DOM.layoutBounds,"height",{get:function(){var t=document.documentElement.clientHeight,e=window.innerHeight;return t<e?e:t}});Object.defineProperty(e.DOM.documentBounds,"x",{value:0}),Object.defineProperty(e.DOM.documentBounds,"y",{value:0}),Object.defineProperty(e.DOM.documentBounds,"width",{get:function(){var t=document.documentElement;return Math.max(t.clientWidth,t.offsetWidth,t.scrollWidth)}}),Object.defineProperty(e.DOM.documentBounds,"height",{get:function(){var t=document.documentElement;return Math.max(t.clientHeight,t.offsetHeight,t.scrollHeight)}})},null,!0),e.ArraySet=function(t){this.position=0,this.list=t||[]},e.ArraySet.prototype={add:function(t){return this.exists(t)||this.list.push(t),t},getIndex:function(t){return this.list.indexOf(t)},getByKey:function(t,e){for(var i=this.list.length;i--;)if(this.list[i][t]===e)return this.list[i];return null},exists:function(t){return this.list.indexOf(t)>-1},reset:function(){this.list.length=0},remove:function(t){var e=this.list.indexOf(t);if(e>-1)return this.list.splice(e,1),t},setAll:function(t,e){for(var i=this.list.length;i--;)this.list[i]&&(this.list[i][t]=e)},callAll:function(t){for(var e=Array.prototype.slice.call(arguments,1),i=this.list.length;i--;)this.list[i]&&this.list[i][t]&&this.list[i][t].apply(this.list[i],e)},removeAll:function(t){void 0===t&&(t=!1);for(var e=this.list.length;e--;)if(this.list[e]){var i=this.remove(this.list[e]);t&&i.destroy()}this.position=0,this.list=[]}},Object.defineProperty(e.ArraySet.prototype,"total",{get:function(){return this.list.length}}),Object.defineProperty(e.ArraySet.prototype,"first",{get:function(){return this.position=0,this.list.length>0?this.list[0]:null}}),Object.defineProperty(e.ArraySet.prototype,"next",{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}}),e.ArraySet.prototype.constructor=e.ArraySet,e.ArrayUtils={getRandomItem:function(t,e,i){if(null===t)return null;void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]},removeRandomItem:function(t,e,i){if(null==t)return null;void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);if(s<t.length){var n=t.splice(s,1);return void 0===n[0]?null:n[0]}return null},remove:function(t,e,i){var s=t.length;if(!(e>=s||0===i)){null==i&&(i=1);for(var n=s-i,r=e;r<n;++r)t[r]=t[r+i];t.length=n}},shuffle:function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t},transposeMatrix:function(t){for(var e=t.length,i=t[0].length,s=new Array(i),n=0;n<i;n++){s[n]=new Array(e);for(var r=e-1;r>-1;r--)s[n][r]=t[r][n]}return s},rotateMatrix:function(t,i){if("string"!=typeof i&&(i=(i%360+360)%360),90===i||-270===i||"rotateLeft"===i)t=(t=e.ArrayUtils.transposeMatrix(t)).reverse();else if(-90===i||270===i||"rotateRight"===i)t=t.reverse(),t=e.ArrayUtils.transposeMatrix(t);else if(180===Math.abs(i)||"rotate180"===i){for(var s=0;s<t.length;s++)t[s].reverse();t=t.reverse()}return t},findClosest:function(t,e){if(!e.length)return NaN;if(1===e.length||t<e[0])return e[0];for(var i=1;e[i]<t;)i++;var s=e[i-1],n=i<e.length?e[i]:Number.POSITIVE_INFINITY;return n-t<=t-s?n:s},rotateRight:function(t){var e=t.pop();return t.unshift(e),e},rotateLeft:function(t){var e=t.shift();return t.push(e),e},numberArray:function(t,e){void 0!==e&&null!==e||(e=t,t=0);for(var i=[],s=t;s<=e;s++)i.push(s);return i},numberArrayStep:function(t,i,s){void 0!==t&&null!==t||(t=0),void 0!==i&&null!==i||(i=t,t=0),void 0===s&&(s=1);for(var n=[],r=Math.max(e.Math.roundAwayFromZero((i-t)/(s||1)),0),o=0;o<r;o++)n.push(t),t+=s;return n}},e.LinkedList=function(){this.next=null,this.prev=null,this.first=null,this.last=null,this.total=0},e.LinkedList.prototype={add:function(t){return 0===this.total&&null===this.first&&null===this.last?(this.first=t,this.last=t,this.next=t,t.prev=this,this.total++,t):(this.last.next=t,t.prev=this.last,this.last=t,this.total++,t)},reset:function(){this.first=null,this.last=null,this.next=null,this.prev=null,this.total=0},remove:function(t){if(1===this.total)return this.reset(),void(t.next=t.prev=null);t===this.first?this.first=this.first.next:t===this.last&&(this.last=this.last.prev),t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.next=t.prev=null,null===this.first&&(this.last=null),this.total--},callAll:function(t){if(this.first&&this.last){var e=this.first;do{e&&e[t]&&e[t].call(e),e=e.next}while(e!==this.last.next)}}},e.LinkedList.prototype.constructor=e.LinkedList,e.Create=function(t){this.game=t,this.bmd=null,this.canvas=null,this.ctx=null,this.palettes=[{0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"},{0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"},{0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"},{0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"},{0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}]},e.Create.PALETTE_ARNE=0,e.Create.PALETTE_JMP=1,e.Create.PALETTE_CGA=2,e.Create.PALETTE_C64=3,e.Create.PALETTE_JAPANESE_MACHINE=4,e.Create.prototype={texture:function(t,e,i,s,n,r,o,a){void 0===i&&(i=8),void 0===s&&(s=i),void 0===n&&(n=0),void 0===r&&(r=!0);var h=e[0].length*i,l=e.length*s;null===this.bmd&&(this.bmd=this.game.make.bitmapData(),this.canvas=this.bmd.canvas,this.ctx=this.bmd.context),this.bmd.resize(h,l),this.bmd.clear();for(var c=0;c<e.length;c++)for(var u=e[c],d=0;d<u.length;d++){var p=u[d];"."!==p&&" "!==p&&(this.ctx.fillStyle=this.palettes[n][p],this.ctx.fillRect(d*i,c*s,i,s))}return r?this.bmd.generateTexture(t,o,a):this.copy()},grid:function(t,e,i,s,n,r,o,a,h){void 0===o&&(o=!0),null===this.bmd&&(this.bmd=this.game.make.bitmapData(),this.canvas=this.bmd.canvas,this.ctx=this.bmd.context),this.bmd.resize(e,i),this.ctx.fillStyle=r;for(var l=0;l<i;l+=n)this.ctx.fillRect(0,l,e,1);for(var c=0;c<e;c+=s)this.ctx.fillRect(c,0,1,i);return o?this.bmd.generateTexture(t,a,h):this.copy()},copy:function(t,e,i,s,n,r,o){return null==t&&(t=this.game.make.bitmapData()),t.resize(this.bmd.width,this.bmd.height),t.draw(this.bmd,e,i,s,n,r,o)}},e.Create.prototype.constructor=e.Create,e.FlexGrid=function(t,i,s){this.game=t.game,this.manager=t,this.width=i,this.height=s,this.boundsCustom=new e.Rectangle(0,0,i,s),this.boundsFluid=new e.Rectangle(0,0,i,s),this.boundsFull=new e.Rectangle(0,0,i,s),this.boundsNone=new e.Rectangle(0,0,i,s),this.positionCustom=new e.Point(0,0),this.positionFluid=new e.Point(0,0),this.positionFull=new e.Point(0,0),this.positionNone=new e.Point(0,0),this.scaleCustom=new e.Point(1,1),this.scaleFluid=new e.Point(1,1),this.scaleFluidInversed=new e.Point(1,1),this.scaleFull=new e.Point(1,1),this.scaleNone=new e.Point(1,1),this.customWidth=0,this.customHeight=0,this.customOffsetX=0,this.customOffsetY=0,this.ratioH=i/s,this.ratioV=s/i,this.multiplier=0,this.layers=[]},e.FlexGrid.prototype={setSize:function(t,i){this.width=t,this.height=i,this.ratioH=t/i,this.ratioV=i/t,this.scaleNone=new e.Point(1,1),this.boundsNone.width=this.width,this.boundsNone.height=this.height,this.refresh()},createCustomLayer:function(t,i,s,n){void 0===n&&(n=!0),this.customWidth=t,this.customHeight=i,this.boundsCustom.width=t,this.boundsCustom.height=i;var r=new e.FlexLayer(this,this.positionCustom,this.boundsCustom,this.scaleCustom);return n&&this.game.world.add(r),this.layers.push(r),s&&r.addMultiple(s),r},createFluidLayer:function(t,i){void 0===i&&(i=!0);var s=new e.FlexLayer(this,this.positionFluid,this.boundsFluid,this.scaleFluid);return i&&this.game.world.add(s),this.layers.push(s),t&&s.addMultiple(t),s},createFullLayer:function(t){var i=new e.FlexLayer(this,this.positionFull,this.boundsFull,this.scaleFluid);return this.game.world.add(i),this.layers.push(i),void 0!==t&&i.addMultiple(t),i},createFixedLayer:function(t){var i=new e.FlexLayer(this,this.positionNone,this.boundsNone,this.scaleNone);return this.game.world.add(i),this.layers.push(i),void 0!==t&&i.addMultiple(t),i},reset:function(){for(var t=this.layers.length;t--;)this.layers[t].persist||(this.layers[t].position=null,this.layers[t].scale=null,this.layers.slice(t,1))},onResize:function(t,e){this.ratioH=t/e,this.ratioV=e/t,this.refresh(t,e)},refresh:function(){this.multiplier=Math.min(this.manager.height/this.height,this.manager.width/this.width),this.boundsFluid.width=Math.round(this.width*this.multiplier),this.boundsFluid.height=Math.round(this.height*this.multiplier),this.scaleFluid.set(this.boundsFluid.width/this.width,this.boundsFluid.height/this.height),this.scaleFluidInversed.set(this.width/this.boundsFluid.width,this.height/this.boundsFluid.height),this.scaleFull.set(this.boundsFull.width/this.width,this.boundsFull.height/this.height),this.boundsFull.width=Math.round(this.manager.width*this.scaleFluidInversed.x),this.boundsFull.height=Math.round(this.manager.height*this.scaleFluidInversed.y),this.boundsFluid.centerOn(this.manager.bounds.centerX,this.manager.bounds.centerY),this.boundsNone.centerOn(this.manager.bounds.centerX,this.manager.bounds.centerY),this.positionFluid.set(this.boundsFluid.x,this.boundsFluid.y),this.positionNone.set(this.boundsNone.x,this.boundsNone.y)},fitSprite:function(t){this.manager.scaleSprite(t),t.x=this.manager.bounds.centerX,t.y=this.manager.bounds.centerY},debug:function(){this.game.debug.text(this.boundsFluid.width+" x "+this.boundsFluid.height,this.boundsFluid.x+4,this.boundsFluid.y+16),this.game.debug.geom(this.boundsFluid,"rgba(255,0,0,0.9",!1)}},e.FlexGrid.prototype.constructor=e.FlexGrid,e.FlexLayer=function(t,i,s,n){e.Group.call(this,t.game,null,"__flexLayer"+t.game.rnd.uuid(),!1),this.manager=t.manager,this.grid=t,this.persist=!1,this.position=i,this.bounds=s,this.scale=n,this.topLeft=s.topLeft,this.topMiddle=new e.Point(s.halfWidth,0),this.topRight=s.topRight,this.bottomLeft=s.bottomLeft,this.bottomMiddle=new e.Point(s.halfWidth,s.bottom),this.bottomRight=s.bottomRight},e.FlexLayer.prototype=Object.create(e.Group.prototype),e.FlexLayer.prototype.constructor=e.FlexLayer,e.FlexLayer.prototype.resize=function(){},e.FlexLayer.prototype.debug=function(){this.game.debug.text(this.bounds.width+" x "+this.bounds.height,this.bounds.x+4,this.bounds.y+16),this.game.debug.geom(this.bounds,"rgba(0,0,255,0.9",!1),this.game.debug.geom(this.topLeft,"rgba(255,255,255,0.9"),this.game.debug.geom(this.topMiddle,"rgba(255,255,255,0.9"),this.game.debug.geom(this.topRight,"rgba(255,255,255,0.9")},e.Color={RED:16711680,ORANGE:16750848,YELLOW:16776960,GREEN:65280,AQUA:65535,BLUE:255,VIOLET:16711935,WHITE:16777215,BLACK:0,GRAY:6710886,packPixel:function(t,i,s,n){return e.Device.LITTLE_ENDIAN?(n<<24|s<<16|i<<8|t)>>>0:(t<<24|i<<16|s<<8|n)>>>0},unpackPixel:function(t,i,s,n){return void 0!==i&&null!==i||(i=e.Color.createColor()),void 0!==s&&null!==s||(s=!1),void 0!==n&&null!==n||(n=!1),e.Device.LITTLE_ENDIAN?(i.a=(4278190080&t)>>>24,i.b=(16711680&t)>>>16,i.g=(65280&t)>>>8,i.r=255&t):(i.r=(4278190080&t)>>>24,i.g=(16711680&t)>>>16,i.b=(65280&t)>>>8,i.a=255&t),i.color=t,i.rgba="rgba("+i.r+","+i.g+","+i.b+","+i.a/255+")",s&&e.Color.RGBtoHSL(i.r,i.g,i.b,i),n&&e.Color.RGBtoHSV(i.r,i.g,i.b,i),i},fromRGBA:function(t,i){return i||(i=e.Color.createColor()),i.r=(4278190080&t)>>>24,i.g=(16711680&t)>>>16,i.b=(65280&t)>>>8,i.a=255&t,i.rgba="rgba("+i.r+","+i.g+","+i.b+","+i.a+")",i},toRGBA:function(t,e,i,s){return t<<24|e<<16|i<<8|s},toABGR:function(t,e,i,s){return(s<<24|i<<16|e<<8|t)>>>0},hexToRGBArray:function(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]},RGBArrayToHex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},RGBtoHSL:function(t,i,s,n){n||(n=e.Color.createColor(t,i,s,1)),t/=255,i/=255,s/=255;var r=Math.min(t,i,s),o=Math.max(t,i,s);if(n.h=0,n.s=0,n.l=(o+r)/2,o!==r){var a=o-r;n.s=n.l>.5?a/(2-o-r):a/(o+r),o===t?n.h=(i-s)/a+(i<s?6:0):o===i?n.h=(s-t)/a+2:o===s&&(n.h=(t-i)/a+4),n.h/=6}return n},HSLtoRGB:function(t,i,s,n){if(n?(n.r=s,n.g=s,n.b=s):n=e.Color.createColor(s,s,s),0!==i){var r=s<.5?s*(1+i):s+i-s*i,o=2*s-r;n.r=e.Color.hueToColor(o,r,t+1/3),n.g=e.Color.hueToColor(o,r,t),n.b=e.Color.hueToColor(o,r,t-1/3)}return n.r=Math.floor(255*n.r|0),n.g=Math.floor(255*n.g|0),n.b=Math.floor(255*n.b|0),e.Color.updateColor(n),n},RGBtoHSV:function(t,i,s,n){n||(n=e.Color.createColor(t,i,s,255)),t/=255,i/=255,s/=255;var r=Math.min(t,i,s),o=Math.max(t,i,s),a=o-r;return n.h=0,n.s=0===o?0:a/o,n.v=o,o!==r&&(o===t?n.h=(i-s)/a+(i<s?6:0):o===i?n.h=(s-t)/a+2:o===s&&(n.h=(t-i)/a+4),n.h/=6),n},HSVtoRGB:function(t,i,s,n){void 0===n&&(n=e.Color.createColor(0,0,0,1,t,i,0,s));var r,o,a,h=Math.floor(6*t),l=6*t-h,c=s*(1-i),u=s*(1-l*i),d=s*(1-(1-l)*i);switch(h%6){case 0:r=s,o=d,a=c;break;case 1:r=u,o=s,a=c;break;case 2:r=c,o=s,a=d;break;case 3:r=c,o=u,a=s;break;case 4:r=d,o=c,a=s;break;case 5:r=s,o=c,a=u}return n.r=Math.floor(255*r),n.g=Math.floor(255*o),n.b=Math.floor(255*a),e.Color.updateColor(n),n},hueToColor:function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t},createColor:function(t,i,s,n,r,o,a,h){var l={r:t||0,g:i||0,b:s||0,a:n||1,h:r||0,s:o||0,l:a||0,v:h||0,color:0,color32:0,rgba:""};return e.Color.updateColor(l)},updateColor:function(t){return t.rgba="rgba("+t.r.toFixed()+","+t.g.toFixed()+","+t.b.toFixed()+","+t.a.toString()+")",t.color=e.Color.getColor(t.r,t.g,t.b),t.color32=e.Color.getColor32(255*t.a,t.r,t.g,t.b),t},getColor32:function(t,e,i,s){return t<<24|e<<16|i<<8|s},getColor:function(t,e,i){return t<<16|e<<8|i},RGBtoString:function(t,i,s,n,r){return void 0===n&&(n=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(i<<8)+s).toString(16).slice(1):"0x"+e.Color.componentToHex(n)+e.Color.componentToHex(t)+e.Color.componentToHex(i)+e.Color.componentToHex(s)},hexToRGB:function(t){var i=e.Color.hexToColor(t);if(i)return e.Color.getColor32(i.a,i.r,i.g,i.b)},hexToColor:function(t,i){t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,s){return e+e+i+i+s+s});var s=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(s){var n=parseInt(s[1],16),r=parseInt(s[2],16),o=parseInt(s[3],16);i?(i.r=n,i.g=r,i.b=o):i=e.Color.createColor(n,r,o)}return i},webToColor:function(t,i){i||(i=e.Color.createColor());var s=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t);return s&&(i.r=~~Number(s[1]),i.g=~~Number(s[2]),i.b=~~Number(s[3]),i.a=void 0!==s[4]?Number(s[4]):1,e.Color.updateColor(i)),i},valueToColor:function(t,i){if(i||(i=e.Color.createColor()),"string"==typeof t)return 0===t.indexOf("rgb")?e.Color.webToColor(t,i):(i.a=1,e.Color.hexToColor(t,i));if("number"==typeof t){var s=e.Color.getRGB(t);return i.r=s.r,i.g=s.g,i.b=s.b,i.a=s.a/255,i}return i},componentToHex:function(t){var e=t.toString(16);return 1===e.length?"0"+e:e},HSVColorWheel:function(t,i){void 0===t&&(t=1),void 0===i&&(i=1);for(var s=[],n=0;n<=359;n++)s.push(e.Color.HSVtoRGB(n/359,t,i));return s},HSLColorWheel:function(t,i){void 0===t&&(t=.5),void 0===i&&(i=.5);for(var s=[],n=0;n<=359;n++)s.push(e.Color.HSLtoRGB(n/359,t,i));return s},interpolateColor:function(t,i,s,n,r,o){void 0===r&&(r=255),void 0===o&&(o=0);var a=e.Color.getRGB(t),h=e.Color.getRGB(i);if(0===o)var l=(h.red-a.red)*n/s+a.red,c=(h.green-a.green)*n/s+a.green,u=(h.blue-a.blue)*n/s+a.blue;if(1===o){var d,p=e.Color.RGBtoHSV(a.r,a.g,a.b),f=e.Color.RGBtoHSV(h.r,h.g,h.b),g=f.h-p.h;if(p.h>f.h){var m=f.h;f.h=p.h,p.h=m,g=-g,n=s-n}g>.5&&(p.h=p.h+1,d=((f.h-p.h)*n/s+p.h)%1),g<=.5&&(d=(f.h-p.h)*n/s+p.h);var y=(f.s-p.s)*n/s+p.s,v=(f.v-p.v)*n/s+p.v,x=e.Color.HSVtoRGB(d,y,v,x),l=x.r,c=x.g,u=x.b}return e.Color.getColor32(r,l,c,u)},interpolateColorWithRGB:function(t,i,s,n,r,o){var a=e.Color.getRGB(t),h=(i-a.red)*o/r+a.red,l=(s-a.green)*o/r+a.green,c=(n-a.blue)*o/r+a.blue;return e.Color.getColor(h,l,c)},interpolateRGB:function(t,i,s,n,r,o,a,h){var l=(n-t)*h/a+t,c=(r-i)*h/a+i,u=(o-s)*h/a+s;return e.Color.getColor(l,c,u)},linear:function(t,e,i){return this.interpolateColor(t,e,1,i)},linearInterpolation:function(t,i){var s=e.Math.linear(0,t.length-1,i),n=t[Math.floor(s)],r=t[Math.ceil(s)];return this.linear(n,r,s%1)},getRandomColor:function(t,i,s){if(void 0===t&&(t=0),void 0===i&&(i=255),void 0===s&&(s=255),i>255||t>i)return e.Color.getColor(255,255,255);var n=t+Math.round(Math.random()*(i-t)),r=t+Math.round(Math.random()*(i-t)),o=t+Math.round(Math.random()*(i-t));return e.Color.getColor32(s,n,r,o)},getRGB:function(t){return t>16777215?{alpha:t>>>24,red:t>>16&255,green:t>>8&255,blue:255&t,a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{alpha:255,red:t>>16&255,green:t>>8&255,blue:255&t,a:255,r:t>>16&255,g:t>>8&255,b:255&t}},getWebRGB:function(t){if("object"==typeof t)return"rgba("+t.r.toString()+","+t.g.toString()+","+t.b.toString()+","+(t.a/255).toString()+")";var i=e.Color.getRGB(t);return"rgba("+i.r.toString()+","+i.g.toString()+","+i.b.toString()+","+(i.a/255).toString()+")"},getAlpha:function(t){return t>>>24},getAlphaFloat:function(t){return(t>>>24)/255},getRed:function(t){return t>>16&255},getGreen:function(t){return t>>8&255},getBlue:function(t){return 255&t},blendNormal:function(t){return t},blendLighten:function(t,e){return e>t?e:t},blendDarken:function(t,e){return e>t?t:e},blendMultiply:function(t,e){return t*e/255},blendAverage:function(t,e){return(t+e)/2},blendAdd:function(t,e){return Math.min(255,t+e)},blendSubtract:function(t,e){return Math.max(0,t+e-255)},blendDifference:function(t,e){return Math.abs(t-e)},blendNegation:function(t,e){return 255-Math.abs(255-t-e)},blendScreen:function(t,e){return 255-((255-t)*(255-e)>>8)},blendExclusion:function(t,e){return t+e-2*t*e/255},blendOverlay:function(t,e){return e<128?2*t*e/255:255-2*(255-t)*(255-e)/255},blendSoftLight:function(t,e){return e<128?2*(64+(t>>1))*(e/255):255-2*(255-(64+(t>>1)))*(255-e)/255},blendHardLight:function(t,i){return e.Color.blendOverlay(i,t)},blendColorDodge:function(t,e){return 255===e?e:Math.min(255,(t<<8)/(255-e))},blendColorBurn:function(t,e){return 0===e?e:Math.max(0,255-(255-t<<8)/e)},blendLinearDodge:function(t,i){return e.Color.blendAdd(t,i)},blendLinearBurn:function(t,i){return e.Color.blendSubtract(t,i)},blendLinearLight:function(t,i){return i<128?e.Color.blendLinearBurn(t,2*i):e.Color.blendLinearDodge(t,2*(i-128))},blendVividLight:function(t,i){return i<128?e.Color.blendColorBurn(t,2*i):e.Color.blendColorDodge(t,2*(i-128))},blendPinLight:function(t,i){return i<128?e.Color.blendDarken(t,2*i):e.Color.blendLighten(t,2*(i-128))},blendHardMix:function(t,i){return e.Color.blendVividLight(t,i)<128?0:255},blendReflect:function(t,e){return 255===e?e:Math.min(255,t*t/(255-e))},blendGlow:function(t,i){return e.Color.blendReflect(i,t)},blendPhoenix:function(t,e){return Math.min(t,e)-Math.max(t,e)+255}},e.Physics=function(t,e){e=e||{},this.game=t,this.config=e,this.arcade=null,this.p2=null,this.ninja=null,this.box2d=null,this.chipmunk=null,this.matter=null,this.parseConfig()},e.Physics.ARCADE=0,e.Physics.P2JS=1,e.Physics.NINJA=2,e.Physics.BOX2D=3,e.Physics.CHIPMUNK=4,e.Physics.MATTERJS=5,e.Physics.prototype={parseConfig:function(){this.config.hasOwnProperty("arcade")&&!0!==this.config.arcade||!e.Physics.hasOwnProperty("Arcade")||(this.arcade=new e.Physics.Arcade(this.game)),this.config.hasOwnProperty("ninja")&&!0===this.config.ninja&&e.Physics.hasOwnProperty("Ninja")&&(this.ninja=new e.Physics.Ninja(this.game)),this.config.hasOwnProperty("p2")&&!0===this.config.p2&&e.Physics.hasOwnProperty("P2")&&(this.p2=new e.Physics.P2(this.game,this.config)),this.config.hasOwnProperty("box2d")&&!0===this.config.box2d&&e.Physics.hasOwnProperty("BOX2D")&&(this.box2d=new e.Physics.Box2D(this.game,this.config)),this.config.hasOwnProperty("matter")&&!0===this.config.matter&&e.Physics.hasOwnProperty("Matter")&&(this.matter=new e.Physics.Matter(this.game,this.config))},startSystem:function(t){t===e.Physics.ARCADE?this.arcade=new e.Physics.Arcade(this.game):t===e.Physics.P2JS?null===this.p2?this.p2=new e.Physics.P2(this.game,this.config):this.p2.reset():t===e.Physics.NINJA?this.ninja=new e.Physics.Ninja(this.game):t===e.Physics.BOX2D?null===this.box2d?this.box2d=new e.Physics.Box2D(this.game,this.config):this.box2d.reset():t===e.Physics.MATTERJS&&(null===this.matter?this.matter=new e.Physics.Matter(this.game,this.config):this.matter.reset())},enable:function(t,i,s){void 0===i&&(i=e.Physics.ARCADE),void 0===s&&(s=!1),i===e.Physics.ARCADE?this.arcade.enable(t):i===e.Physics.P2JS&&this.p2?this.p2.enable(t,s):i===e.Physics.NINJA&&this.ninja?this.ninja.enableAABB(t):i===e.Physics.BOX2D&&this.box2d?this.box2d.enable(t):i===e.Physics.MATTERJS&&this.matter?this.matter.enable(t):console.warn(t.key+" is attempting to enable a physics body using an unknown physics system.")},preUpdate:function(){this.p2&&this.p2.preUpdate(),this.box2d&&this.box2d.preUpdate(),this.matter&&this.matter.preUpdate()},update:function(){this.p2&&this.p2.update(),this.box2d&&this.box2d.update(),this.matter&&this.matter.update()},setBoundsToWorld:function(){this.arcade&&this.arcade.setBoundsToWorld(),this.ninja&&this.ninja.setBoundsToWorld(),this.p2&&this.p2.setBoundsToWorld(),this.box2d&&this.box2d.setBoundsToWorld(),this.matter&&this.matter.setBoundsToWorld()},clear:function(){this.p2&&this.p2.clear(),this.box2d&&this.box2d.clear(),this.matter&&this.matter.clear()},reset:function(){this.p2&&this.p2.reset(),this.box2d&&this.box2d.reset(),this.matter&&this.matter.reset()},destroy:function(){this.p2&&this.p2.destroy(),this.box2d&&this.box2d.destroy(),this.matter&&this.matter.destroy(),this.arcade=null,this.ninja=null,this.p2=null,this.box2d=null,this.matter=null}},e.Physics.prototype.constructor=e.Physics,e.Physics.Arcade=function(t){this.game=t,this.gravity=new e.Point,this.bounds=new e.Rectangle(0,0,t.world.width,t.world.height),this.checkCollision={up:!0,down:!0,left:!0,right:!0},this.maxObjects=10,this.maxLevels=4,this.OVERLAP_BIAS=4,this.forceX=!1,this.sortDirection=e.Physics.Arcade.LEFT_RIGHT,this.skipQuadTree=!0,this.isPaused=!1,this.quadTree=new e.QuadTree(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this._total=0,this.setBoundsToWorld()},e.Physics.Arcade.prototype.constructor=e.Physics.Arcade,e.Physics.Arcade.SORT_NONE=0,e.Physics.Arcade.LEFT_RIGHT=1,e.Physics.Arcade.RIGHT_LEFT=2,e.Physics.Arcade.TOP_BOTTOM=3,e.Physics.Arcade.BOTTOM_TOP=4,e.Physics.Arcade.prototype={setBounds:function(t,e,i,s){this.bounds.setTo(t,e,i,s)},setBoundsToWorld:function(){this.bounds.copyFrom(this.game.world.bounds)},enable:function(t,i){void 0===i&&(i=!0);var s=1;if(Array.isArray(t))for(s=t.length;s--;)t[s]instanceof e.Group?this.enable(t[s].children,i):(this.enableBody(t[s]),i&&t[s].hasOwnProperty("children")&&t[s].children.length>0&&this.enable(t[s],!0));else t instanceof e.Group?this.enable(t.children,i):(this.enableBody(t),i&&t.hasOwnProperty("children")&&t.children.length>0&&this.enable(t.children,!0))},enableBody:function(t){t.hasOwnProperty("body")&&null===t.body&&(t.body=new e.Physics.Arcade.Body(t),t.parent&&t.parent instanceof e.Group&&t.parent.addToHash(t))},updateMotion:function(t){if(t.allowRotation){var e=this.computeVelocity(0,t,t.angularVelocity,t.angularAcceleration,t.angularDrag,t.maxAngular)-t.angularVelocity;t.angularVelocity+=e,t.rotation+=t.angularVelocity*this.game.time.physicsElapsed}t.velocity.x=this.computeVelocity(1,t,t.velocity.x,t.acceleration.x,t.drag.x,t.maxVelocity.x),t.velocity.y=this.computeVelocity(2,t,t.velocity.y,t.acceleration.y,t.drag.y,t.maxVelocity.y)},computeVelocity:function(t,e,i,s,n,r){return void 0===r&&(r=1e4),1===t&&e.allowGravity?i+=(this.gravity.x+e.gravity.x)*this.game.time.physicsElapsed:2===t&&e.allowGravity&&(i+=(this.gravity.y+e.gravity.y)*this.game.time.physicsElapsed),s?i+=s*this.game.time.physicsElapsed:n&&e.allowDrag&&(i-(n*=this.game.time.physicsElapsed)>0?i-=n:i+n<0?i+=n:i=0),i>r?i=r:i<-r&&(i=-r),i},overlap:function(t,e,i,s,n){return i=i||null,s=s||null,n=n||i,this._total=0,this.collideObjects(t,e,i,s,n,!0),this._total>0},collide:function(t,e,i,s,n){return i=i||null,s=s||null,n=n||i,this._total=0,this.collideObjects(t,e,i,s,n,!1),this._total>0},sortLeftRight:function(t,e){return t.body&&e.body?t.body.x-e.body.x:0},sortRightLeft:function(t,e){return t.body&&e.body?e.body.x-t.body.x:0},sortTopBottom:function(t,e){return t.body&&e.body?t.body.y-e.body.y:0},sortBottomTop:function(t,e){return t.body&&e.body?e.body.y-t.body.y:0},sort:function(t,i){null!==t.physicsSortDirection?i=t.physicsSortDirection:void 0===i&&(i=this.sortDirection),i===e.Physics.Arcade.LEFT_RIGHT?t.hash.sort(this.sortLeftRight):i===e.Physics.Arcade.RIGHT_LEFT?t.hash.sort(this.sortRightLeft):i===e.Physics.Arcade.TOP_BOTTOM?t.hash.sort(this.sortTopBottom):i===e.Physics.Arcade.BOTTOM_TOP&&t.hash.sort(this.sortBottomTop)},collideObjects:function(t,e,i,s,n,r){if(!Array.isArray(t)&&Array.isArray(e))for(o=0;o<e.length;o++)e[o]&&this.collideHandler(t,e[o],i,s,n,r);else if(Array.isArray(t)&&!Array.isArray(e))for(o=0;o<t.length;o++)t[o]&&this.collideHandler(t[o],e,i,s,n,r);else if(Array.isArray(t)&&Array.isArray(e)){for(var o=0;o<t.length;o++)if(t[o])for(var a=0;a<e.length;a++)e[a]&&this.collideHandler(t[o],e[a],i,s,n,r)}else this.collideHandler(t,e,i,s,n,r)},collideHandler:function(t,i,s,n,r,o){if(void 0===i&&t.physicsType===e.GROUP)return this.sort(t),void this.collideGroupVsSelf(t,s,n,r,o);t&&i&&t.exists&&i.exists&&(this.sortDirection!==e.Physics.Arcade.SORT_NONE&&(t.physicsType===e.GROUP&&this.sort(t),i.physicsType===e.GROUP&&this.sort(i)),t.physicsType===e.SPRITE?i.physicsType===e.SPRITE?this.collideSpriteVsSprite(t,i,s,n,r,o):i.physicsType===e.GROUP?this.collideSpriteVsGroup(t,i,s,n,r,o):i.physicsType===e.TILEMAPLAYER&&this.collideSpriteVsTilemapLayer(t,i,s,n,r,o):t.physicsType===e.GROUP?i.physicsType===e.SPRITE?this.collideSpriteVsGroup(i,t,s,n,r,o):i.physicsType===e.GROUP?this.collideGroupVsGroup(t,i,s,n,r,o):i.physicsType===e.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(t,i,s,n,r,o):t.physicsType===e.TILEMAPLAYER&&(i.physicsType===e.SPRITE?this.collideSpriteVsTilemapLayer(i,t,s,n,r,o):i.physicsType===e.GROUP&&this.collideGroupVsTilemapLayer(i,t,s,n,r,o)))},collideSpriteVsSprite:function(t,e,i,s,n,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,s,n,r)&&(i&&i.call(n,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,i,s,n,r,o){if(0!==i.length&&t.body)if(this.skipQuadTree||t.body.skipQuadTree)for(var a={},h=0;h<i.hash.length;h++){var l=i.hash[h];if(l&&l.exists&&l.body){if(a=l.body.getBounds(a),this.sortDirection===e.Physics.Arcade.LEFT_RIGHT){if(t.body.right<a.x)break;if(a.right<t.body.x)continue}else if(this.sortDirection===e.Physics.Arcade.RIGHT_LEFT){if(t.body.x>a.right)break;if(a.x>t.body.right)continue}else if(this.sortDirection===e.Physics.Arcade.TOP_BOTTOM){if(t.body.bottom<a.y)break;if(a.bottom<t.body.y)continue}else if(this.sortDirection===e.Physics.Arcade.BOTTOM_TOP){if(t.body.y>a.bottom)break;if(a.y>t.body.bottom)continue}this.collideSpriteVsSprite(t,l,s,n,r,o)}}else{this.quadTree.clear(),this.quadTree.reset(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this.quadTree.populate(i);for(var c=this.quadTree.retrieve(t),h=0;h<c.length;h++)this.separate(t.body,c[h],n,r,o)&&(s&&s.call(r,t,c[h].sprite),this._total++)}},collideGroupVsSelf:function(t,i,s,n,r){if(0!==t.length)for(var o=0;o<t.hash.length;o++){var a={},h=t.hash[o];if(h&&h.exists&&h.body){a=h.body.getBounds(a);for(var l=o+1;l<t.hash.length;l++){var c={},u=t.hash[l];if(u&&u.exists&&u.body){if(c=u.body.getBounds(c),this.sortDirection===e.Physics.Arcade.LEFT_RIGHT){if(a.right<c.x)break;if(c.right<a.x)continue}else if(this.sortDirection===e.Physics.Arcade.RIGHT_LEFT){if(a.x>c.right)continue;if(c.x>a.right)break}else if(this.sortDirection===e.Physics.Arcade.TOP_BOTTOM){if(a.bottom<c.y)continue;if(c.bottom<a.y)break}else if(this.sortDirection===e.Physics.Arcade.BOTTOM_TOP){if(a.y>c.bottom)continue;if(c.y>h.body.bottom)break}this.collideSpriteVsSprite(h,u,i,s,n,r)}}}}},collideGroupVsGroup:function(t,i,s,n,r,o){if(0!==t.length&&0!==i.length)for(var a=0;a<t.children.length;a++)t.children[a].exists&&(t.children[a].physicsType===e.GROUP?this.collideGroupVsGroup(t.children[a],i,s,n,r,o):this.collideSpriteVsGroup(t.children[a],i,s,n,r,o))},separate:function(t,e,i,s,n){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(s,t.sprite,e.sprite))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,n);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,o=t.isCircle?t:e,a={x:r.x,y:r.y,right:r.right,bottom:r.bottom},h=o.center;if((h.y<a.y||h.y>a.bottom)&&(h.x<a.x||h.x>a.right))return this.separateCircle(t,e,n)}var l=!1,c=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)<Math.abs(this.gravity.x+t.gravity.x)?(l=this.separateX(t,e,n),this.intersects(t,e)&&(c=this.separateY(t,e,n))):(c=this.separateY(t,e,n),this.intersects(t,e)&&(l=this.separateX(t,e,n)));var u=l||c;return u&&(n?(t.onOverlap&&t.onOverlap.dispatch(t.sprite,e.sprite),e.onOverlap&&e.onOverlap.dispatch(e.sprite,t.sprite)):(t.onCollide&&t.onCollide.dispatch(t.sprite,e.sprite),e.onCollide&&e.onCollide.dispatch(e.sprite,t.sprite))),u},intersects:function(t,i){return t!==i&&(t.isCircle?i.isCircle?e.Math.distance(t.center.x,t.center.y,i.center.x,i.center.y)<=t.halfWidth+i.halfWidth:this.circleBodyIntersects(t,i):i.isCircle?this.circleBodyIntersects(i,t):!(t.right<=i.position.x)&&(!(t.bottom<=i.position.y)&&(!(t.position.x>=i.right)&&!(t.position.y>=i.bottom))))},circleBodyIntersects:function(t,i){var s=e.Math.clamp(t.center.x,i.left,i.right),n=e.Math.clamp(t.center.y,i.top,i.bottom);return(t.center.x-s)*(t.center.x-s)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},separateCircle:function(t,i,s){this.getOverlapX(t,i),this.getOverlapY(t,i);var n=i.center.x-t.center.x,r=i.center.y-t.center.y,o=Math.atan2(r,n),a=0;if(t.isCircle!==i.isCircle){var h={x:i.isCircle?t.position.x:i.position.x,y:i.isCircle?t.position.y:i.position.y,right:i.isCircle?t.right:i.right,bottom:i.isCircle?t.bottom:i.bottom},l={x:t.isCircle?t.center.x:i.center.x,y:t.isCircle?t.center.y:i.center.y,radius:t.isCircle?t.halfWidth:i.halfWidth};l.y<h.y?l.x<h.x?a=e.Math.distance(l.x,l.y,h.x,h.y)-l.radius:l.x>h.right&&(a=e.Math.distance(l.x,l.y,h.right,h.y)-l.radius):l.y>h.bottom&&(l.x<h.x?a=e.Math.distance(l.x,l.y,h.x,h.bottom)-l.radius:l.x>h.right&&(a=e.Math.distance(l.x,l.y,h.right,h.bottom)-l.radius)),a*=-1}else a=t.halfWidth+i.halfWidth-e.Math.distance(t.center.x,t.center.y,i.center.x,i.center.y);if(s||0===a||t.immovable&&i.immovable||t.customSeparateX||i.customSeparateX)return 0!==a&&(t.onOverlap&&t.onOverlap.dispatch(t.sprite,i.sprite),i.onOverlap&&i.onOverlap.dispatch(i.sprite,t.sprite)),0!==a;var c={x:t.velocity.x*Math.cos(o)+t.velocity.y*Math.sin(o),y:-t.velocity.x*Math.sin(o)+t.velocity.y*Math.cos(o)},u={x:i.velocity.x*Math.cos(o)+i.velocity.y*Math.sin(o),y:-i.velocity.x*Math.sin(o)+i.velocity.y*Math.cos(o)},d=((t.mass-i.mass)*c.x+2*i.mass*u.x)/(t.mass+i.mass),p=(2*t.mass*c.x+(i.mass-t.mass)*u.x)/(t.mass+i.mass);return t.immovable||(t.velocity.x=(d*Math.cos(o)-c.y*Math.sin(o))*t.bounce.x,t.velocity.y=(c.y*Math.cos(o)+d*Math.sin(o))*t.bounce.y),i.immovable||(i.velocity.x=(p*Math.cos(o)-u.y*Math.sin(o))*i.bounce.x,i.velocity.y=(u.y*Math.cos(o)+p*Math.sin(o))*i.bounce.y),Math.abs(o)<Math.PI/2?t.velocity.x>0&&!t.immovable&&i.velocity.x>t.velocity.x?t.velocity.x*=-1:i.velocity.x<0&&!i.immovable&&t.velocity.x<i.velocity.x?i.velocity.x*=-1:t.velocity.y>0&&!t.immovable&&i.velocity.y>t.velocity.y?t.velocity.y*=-1:i.velocity.y<0&&!i.immovable&&t.velocity.y<i.velocity.y&&(i.velocity.y*=-1):Math.abs(o)>Math.PI/2&&(t.velocity.x<0&&!t.immovable&&i.velocity.x<t.velocity.x?t.velocity.x*=-1:i.velocity.x>0&&!i.immovable&&t.velocity.x>i.velocity.x?i.velocity.x*=-1:t.velocity.y<0&&!t.immovable&&i.velocity.y<t.velocity.y?t.velocity.y*=-1:i.velocity.y>0&&!i.immovable&&t.velocity.x>i.velocity.y&&(i.velocity.y*=-1)),t.immovable||(t.x+=t.velocity.x*this.game.time.physicsElapsed-a*Math.cos(o),t.y+=t.velocity.y*this.game.time.physicsElapsed-a*Math.sin(o)),i.immovable||(i.x+=i.velocity.x*this.game.time.physicsElapsed+a*Math.cos(o),i.y+=i.velocity.y*this.game.time.physicsElapsed+a*Math.sin(o)),t.onCollide&&t.onCollide.dispatch(t.sprite,i.sprite),i.onCollide&&i.onCollide.dispatch(i.sprite,t.sprite),!0},getOverlapX:function(t,e,i){var s=0,n=t.deltaAbsX()+e.deltaAbsX()+this.OVERLAP_BIAS;return 0===t.deltaX()&&0===e.deltaX()?(t.embedded=!0,e.embedded=!0):t.deltaX()>e.deltaX()?(s=t.right-e.x)>n&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?s=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0):t.deltaX()<e.deltaX()&&(-(s=t.x-e.width-e.x)>n&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?s=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0)),t.overlapX=s,e.overlapX=s,s},getOverlapY:function(t,e,i){var s=0,n=t.deltaAbsY()+e.deltaAbsY()+this.OVERLAP_BIAS;return 0===t.deltaY()&&0===e.deltaY()?(t.embedded=!0,e.embedded=!0):t.deltaY()>e.deltaY()?(s=t.bottom-e.y)>n&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?s=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0):t.deltaY()<e.deltaY()&&(-(s=t.y-e.bottom)>n&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?s=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0)),t.overlapY=s,e.overlapY=s,s},separateX:function(t,e,i){var s=this.getOverlapX(t,e,i);if(i||0===s||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==s||t.embedded&&e.embedded;var n=t.velocity.x,r=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=s,e.velocity.x=n-r*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=s,t.velocity.x=r-n*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{s*=.5,t.x-=s,e.x+=s;var o=Math.sqrt(r*r*e.mass/t.mass)*(r>0?1:-1),a=Math.sqrt(n*n*t.mass/e.mass)*(n>0?1:-1),h=.5*(o+a);o-=h,a-=h,t.velocity.x=h+o*t.bounce.x,e.velocity.x=h+a*e.bounce.x}return!0},separateY:function(t,e,i){var s=this.getOverlapY(t,e,i);if(i||0===s||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==s||t.embedded&&e.embedded;var n=t.velocity.y,r=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=s,e.velocity.y=n-r*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=s,t.velocity.y=r-n*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{s*=.5,t.y-=s,e.y+=s;var o=Math.sqrt(r*r*e.mass/t.mass)*(r>0?1:-1),a=Math.sqrt(n*n*t.mass/e.mass)*(n>0?1:-1),h=.5*(o+a);o-=h,a-=h,t.velocity.y=h+o*t.bounce.y,e.velocity.y=h+a*e.bounce.y}return!0},getObjectsUnderPointer:function(t,e,i,s){if(0!==e.length&&t.exists)return this.getObjectsAtLocation(t.x,t.y,e,i,s,t)},getObjectsAtLocation:function(t,i,s,n,r,o){this.quadTree.clear(),this.quadTree.reset(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this.quadTree.populate(s);for(var a=new e.Rectangle(t,i,1,1),h=[],l=this.quadTree.retrieve(a),c=0;c<l.length;c++)l[c].hitTest(t,i)&&(n&&n.call(r,o,l[c].sprite),h.push(l[c].sprite));return h},moveToObject:function(t,i,s,n){void 0===s&&(s=60),void 0===n&&(n=0);var r=e.Point.angle(i,t);return n>0&&(s=this.distanceBetween(t,i)/(n/1e3)),t.body.velocity.setToPolar(r,s),r},moveToPointer:function(t,e,i,s){void 0===e&&(e=60),i=i||this.game.input.activePointer,void 0===s&&(s=0);var n=this.angleToPointer(t,i);return s>0&&(e=this.distanceToPointer(t,i)/(s/1e3)),t.body.velocity.setToPolar(n,e),n},moveToXY:function(t,e,i,s,n){void 0===s&&(s=60),void 0===n&&(n=0);var r=Math.atan2(i-t.y,e-t.x);return n>0&&(s=this.distanceToXY(t,e,i)/(n/1e3)),t.body.velocity.setToPolar(r,s),r},velocityFromAngle:function(t,i,s){return void 0===i&&(i=60),(s=s||new e.Point).setToPolar(t,i,!0)},velocityFromRotation:function(t,i,s){return void 0===i&&(i=60),(s=s||new e.Point).setToPolar(t,i)},accelerationFromRotation:function(t,i,s){return void 0===i&&(i=60),(s=s||new e.Point).setToPolar(t,i)},accelerateToObject:function(t,e,i,s,n){void 0===i&&(i=60),void 0===s&&(s=1e3),void 0===n&&(n=1e3);var r=this.angleBetween(t,e);return t.body.acceleration.setToPolar(r,i),t.body.maxVelocity.setTo(s,n),r},accelerateToPointer:function(t,e,i,s,n){void 0===i&&(i=60),void 0===e&&(e=this.game.input.activePointer),void 0===s&&(s=1e3),void 0===n&&(n=1e3);var r=this.angleToPointer(t,e);return t.body.acceleration.setToPolar(r,i),t.body.maxVelocity.setTo(s,n),r},accelerateToXY:function(t,e,i,s,n,r){void 0===s&&(s=60),void 0===n&&(n=1e3),void 0===r&&(r=1e3);var o=this.angleToXY(t,e,i);return t.body.acceleration.setTo(o,s),t.body.maxVelocity.setTo(n,r),o},distanceBetween:function(t,e,i,s){void 0===i&&(i=!1);var n,r;return s?(n=t.centerX-e.centerX,r=t.centerY-e.centerY):i?(n=t.world.x-e.world.x,r=t.world.y-e.world.y):(n=t.x-e.x,r=t.y-e.y),Math.sqrt(n*n+r*r)},distanceToXY:function(t,e,i,s){void 0===s&&(s=!1);var n=s?t.world.x-e:t.x-e,r=s?t.world.y-i:t.y-i;return Math.sqrt(n*n+r*r)},distanceToPointer:function(t,e,i){void 0===e&&(e=this.game.input.activePointer),void 0===i&&(i=!1);var s=i?t.world.x-e.worldX:t.x-e.worldX,n=i?t.world.y-e.worldY:t.y-e.worldY;return Math.sqrt(s*s+n*n)},closest:function(t,e,i,s){for(var n=1/0,r=null,o=0,a=e.length;o<a;o++){var h=e[o],l=this.distanceBetween(t,h,i,s);l<n&&(r=h,n=l)}return r},farthest:function(t,e,i,s){for(var n=-1,r=null,o=0,a=e.length;o<a;o++){var h=e[o],l=this.distanceBetween(t,h,i,s);l>n&&(r=h,n=l)}return r},angleBetween:function(t,i,s){return void 0===s&&(s=!1),s?e.Point.angle(i.world,t.world):e.Point.angle(i,t)},angleBetweenCenters:function(t,e){var i=e.centerX-t.centerX,s=e.centerY-t.centerY;return Math.atan2(s,i)},angleToXY:function(t,e,i,s){return void 0===s&&(s=!1),s?Math.atan2(i-t.world.y,e-t.world.x):Math.atan2(i-t.y,e-t.x)},angleToPointer:function(t,e,i){return void 0===e&&(e=this.game.input.activePointer),void 0===i&&(i=!1),i?Math.atan2(e.worldY-t.world.y,e.worldX-t.world.x):Math.atan2(e.worldY-t.y,e.worldX-t.x)},worldAngleToPointer:function(t,e){return this.angleToPointer(t,e,!0)}},e.Physics.Arcade.Body=function(t){this.sprite=t,this.game=t.game,this.type=e.Physics.ARCADE,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new e.Point,this.position=new e.Point(t.x,t.y),this.prev=new e.Point(this.position.x,this.position.y),this.allowRotation=!0,this.rotation=t.angle,this.preRotation=t.angle,this.width=t.width,this.height=t.height,this.sourceWidth=t.width,this.sourceHeight=t.height,t.texture&&(this.sourceWidth=t.texture.frame.width,this.sourceHeight=t.texture.frame.height),this.halfWidth=Math.abs(t.width/2),this.halfHeight=Math.abs(t.height/2),this.center=new e.Point(t.x+this.halfWidth,t.y+this.halfHeight),this.velocity=new e.Point,this.newVelocity=new e.Point,this.deltaMax=new e.Point,this.acceleration=new e.Point,this.allowDrag=!0,this.drag=new e.Point,this.allowGravity=!0,this.gravity=new e.Point,this.bounce=new e.Point,this.worldBounce=null,this.onWorldBounds=null,this.onCollide=null,this.onOverlap=null,this.maxVelocity=new e.Point(1e4,1e4),this.friction=new e.Point(1,0),this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=e.NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.tilePadding=new e.Point,this.dirty=!1,this.skipQuadTree=!1,this.syncBounds=!1,this.isMoving=!1,this.stopVelocityOnCollide=!0,this.moveTimer=0,this.moveDistance=0,this.moveDuration=0,this.moveTarget=null,this.moveEnd=null,this.onMoveComplete=new e.Signal,this.movementCallback=null,this.movementCallbackContext=null,this._reset=!0,this._sx=t.scale.x,this._sy=t.scale.y,this._dx=0,this._dy=0},e.Physics.Arcade.Body.prototype={updateBounds:function(){if(this.syncBounds){var t=this.sprite.getBounds();t.ceilAll(),t.width===this.width&&t.height===this.height||(this.width=t.width,this.height=t.height,this._reset=!0)}else{var e=Math.abs(this.sprite.scale.x),i=Math.abs(this.sprite.scale.y);e===this._sx&&i===this._sy||(this.width=this.sourceWidth*e,this.height=this.sourceHeight*i,this._sx=e,this._sy=i,this._reset=!0)}this._reset&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},preUpdate:function(){this.enable&&!this.game.physics.arcade.isPaused&&(this.dirty=!0,this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.none=!0,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.updateBounds(),this.position.x=this.sprite.world.x-this.sprite.anchor.x*this.sprite.width+this.sprite.scale.x*this.offset.x,this.position.x-=this.sprite.scale.x<0?this.width:0,this.position.y=this.sprite.world.y-this.sprite.anchor.y*this.sprite.height+this.sprite.scale.y*this.offset.y,this.position.y-=this.sprite.scale.y<0?this.height:0,this.updateCenter(),this.rotation=this.sprite.angle,this.preRotation=this.rotation,(this._reset||this.sprite.fresh)&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves&&(this.game.physics.arcade.updateMotion(this),this.newVelocity.set(this.velocity.x*this.game.time.physicsElapsed,this.velocity.y*this.game.time.physicsElapsed),this.position.x+=this.newVelocity.x,this.position.y+=this.newVelocity.y,this.updateCenter(),this.position.x===this.prev.x&&this.position.y===this.prev.y||(this.angle=this.velocity.atan()),this.speed=Math.sqrt(this.velocity.x*this.velocity.x+this.velocity.y*this.velocity.y),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.onWorldBounds.dispatch(this.sprite,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)),this._dx=this.deltaX(),this._dy=this.deltaY(),this._reset=!1)},updateMovement:function(){var t=0,e=0!==this.overlapX||0!==this.overlapY;if(this.moveDuration>0?(this.moveTimer+=this.game.time.elapsedMS,t=this.moveTimer/this.moveDuration):(this.moveTarget.end.set(this.position.x,this.position.y),t=this.moveTarget.length/this.moveDistance),this.movementCallback)var i=this.movementCallback.call(this.movementCallbackContext,this,this.velocity,t);return!(e||t>=1||void 0!==i&&!0!==i)||(this.stopMovement(t>=1||this.stopVelocityOnCollide&&e),!1)},stopMovement:function(t){this.isMoving&&(this.isMoving=!1,t&&this.velocity.set(0),this.onMoveComplete.dispatch(this.sprite,0!==this.overlapX||0!==this.overlapY))},postUpdate:function(){this.enable&&this.dirty&&(this.isMoving&&this.updateMovement(),this.dirty=!1,this.deltaX()<0?this.facing=e.LEFT:this.deltaX()>0&&(this.facing=e.RIGHT),this.deltaY()<0?this.facing=e.UP:this.deltaY()>0&&(this.facing=e.DOWN),this.moves&&(this._dx=this.deltaX(),this._dy=this.deltaY(),0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.sprite.position.x+=this._dx,this.sprite.position.y+=this._dy,this._reset=!0),this.updateCenter(),this.allowRotation&&(this.sprite.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y)},checkWorldBounds:function(){var t=this.position,e=this.game.physics.arcade.bounds,i=this.game.physics.arcade.checkCollision,s=this.worldBounce?-this.worldBounce.x:-this.bounce.x,n=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.x<e.x&&i.left?(t.x=e.x,this.velocity.x*=s,this.blocked.left=!0,this.blocked.none=!1):this.right>e.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=s,this.blocked.right=!0,this.blocked.none=!1),t.y<e.y&&i.up?(t.y=e.y,this.velocity.y*=n,this.blocked.up=!0,this.blocked.none=!1):this.bottom>e.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=n,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},moveFrom:function(t,e,i){if(void 0===e&&(e=this.speed),0===e)return!1;var s;return void 0===i?(s=this.angle,i=this.game.math.radToDeg(s)):s=this.game.math.degToRad(i),this.moveTimer=0,this.moveDuration=t,0===i||180===i?this.velocity.set(Math.cos(s)*e,0):90===i||270===i?this.velocity.set(0,Math.sin(s)*e):this.velocity.setToPolar(s,e),this.isMoving=!0,!0},moveTo:function(t,i,s){var n=i/(t/1e3);if(0===n)return!1;var r;return void 0===s?(r=this.angle,s=this.game.math.radToDeg(r)):r=this.game.math.degToRad(s),i=Math.abs(i),this.moveDuration=0,this.moveDistance=i,null===this.moveTarget&&(this.moveTarget=new e.Line,this.moveEnd=new e.Point),this.moveTarget.fromAngle(this.x,this.y,r,i),this.moveEnd.set(this.moveTarget.end.x,this.moveTarget.end.y),this.moveTarget.setTo(this.x,this.y,this.x,this.y),0===s||180===s?this.velocity.set(Math.cos(r)*n,0):90===s||270===s?this.velocity.set(0,Math.sin(r)*n):this.velocity.setToPolar(r,n),this.isMoving=!0,!0},setSize:function(t,e,i,s){void 0===i&&(i=this.offset.x),void 0===s&&(s=this.offset.y),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.setTo(i,s),this.updateCenter(),this.isCircle=!1,this.radius=0},setCircle:function(t,e,i){void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.setTo(e,i),this.updateCenter()):this.isCircle=!1},reset:function(t,e){this.stop(),this.position.x=t-this.sprite.anchor.x*this.sprite.width+this.sprite.scale.x*this.offset.x,this.position.x-=this.sprite.scale.x<0?this.width:0,this.position.y=e-this.sprite.anchor.y*this.sprite.height+this.sprite.scale.y*this.offset.y,this.position.y-=this.sprite.scale.y<0?this.height:0,this.prev.x=this.position.x,this.prev.y=this.position.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,this.updateBounds(),this.updateCenter()},stop:function(){this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,i){return this.isCircle?e.Circle.contains(this,t,i):e.Rectangle.contains(this,t,i)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this.deltaX()>0?this.deltaX():-this.deltaX()},deltaAbsY:function(){return this.deltaY()>0?this.deltaY():-this.deltaY()},deltaX:function(){return this.position.x-this.prev.x},deltaY:function(){return this.position.y-this.prev.y},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.sprite.parent&&this.sprite.parent instanceof e.Group&&this.sprite.parent.removeFromHash(this.sprite),this.sprite.body=null,this.sprite=null}},Object.defineProperty(e.Physics.Arcade.Body.prototype,"left",{get:function(){return this.position.x}}),Object.defineProperty(e.Physics.Arcade.Body.prototype,"right",{get:function(){return this.position.x+this.width}}),Object.defineProperty(e.Physics.Arcade.Body.prototype,"top",{get:function(){return this.position.y}}),Object.defineProperty(e.Physics.Arcade.Body.prototype,"bottom",{get:function(){return this.position.y+this.height}}),Object.defineProperty(e.Physics.Arcade.Body.prototype,"x",{get:function(){return this.position.x},set:function(t){this.position.x=t}}),Object.defineProperty(e.Physics.Arcade.Body.prototype,"y",{get:function(){return this.position.y},set:function(t){this.position.y=t}}),e.Physics.Arcade.Body.render=function(t,e,i,s,n){void 0===s&&(s=!0),i=i||"rgba(0,255,0,0.4)",t.fillStyle=i,t.strokeStyle=i,t.lineWidth=n||1,e.isCircle?(t.beginPath(),t.arc(e.center.x-e.game.camera.x,e.center.y-e.game.camera.y,e.halfWidth,0,2*Math.PI),s?t.fill():t.stroke()):s?t.fillRect(e.position.x-e.game.camera.x,e.position.y-e.game.camera.y,e.width,e.height):t.strokeRect(e.position.x-e.game.camera.x,e.position.y-e.game.camera.y,e.width,e.height)},e.Physics.Arcade.Body.renderBodyInfo=function(t,e){t.line("x: "+e.x.toFixed(2),"y: "+e.y.toFixed(2),"width: "+e.width,"height: "+e.height),t.line("velocity x: "+e.velocity.x.toFixed(2),"y: "+e.velocity.y.toFixed(2),"deltaX: "+e._dx.toFixed(2),"deltaY: "+e._dy.toFixed(2)),t.line("acceleration x: "+e.acceleration.x.toFixed(2),"y: "+e.acceleration.y.toFixed(2),"speed: "+e.speed.toFixed(2),"angle: "+e.angle.toFixed(2)),t.line("gravity x: "+e.gravity.x,"y: "+e.gravity.y,"bounce x: "+e.bounce.x.toFixed(2),"y: "+e.bounce.y.toFixed(2)),t.line("touching left: "+e.touching.left,"right: "+e.touching.right,"up: "+e.touching.up,"down: "+e.touching.down),t.line("blocked left: "+e.blocked.left,"right: "+e.blocked.right,"up: "+e.blocked.up,"down: "+e.blocked.down)},e.Physics.Arcade.Body.prototype.constructor=e.Physics.Arcade.Body,e.Physics.Arcade.TilemapCollision=function(){},e.Physics.Arcade.TilemapCollision.prototype={TILE_BIAS:16,collideSpriteVsTilemapLayer:function(t,e,i,s,n,r){if(t.body){var o=e.getTiles(t.body.position.x-t.body.tilePadding.x-e.getTileOffsetX(),t.body.position.y-t.body.tilePadding.y-e.getTileOffsetY(),t.body.width+t.body.tilePadding.x,t.body.height+t.body.tilePadding.y,!1,!1);if(0!==o.length)for(var a=0;a<o.length;a++)s?s.call(n,t,o[a])&&this.separateTile(a,t.body,o[a],e,r)&&(this._total++,i&&i.call(n,t,o[a])):this.separateTile(a,t.body,o[a],e,r)&&(this._total++,i&&i.call(n,t,o[a]))}},collideGroupVsTilemapLayer:function(t,e,i,s,n,r){if(0!==t.length)for(var o=0;o<t.children.length;o++)t.children[o].exists&&this.collideSpriteVsTilemapLayer(t.children[o],e,i,s,n,r)},separateTile:function(t,e,i,s,n){if(!e.enable)return!1;var r=s.getTileOffsetX(),o=s.getTileOffsetY();if(!i.intersects(e.position.x-r,e.position.y-o,e.right-r,e.bottom-o))return!1;if(n)return!0;if(i.collisionCallback&&!i.collisionCallback.call(i.collisionCallbackContext,e.sprite,i))return!1;if(void 0!==i.layer.callbacks&&i.layer.callbacks[i.index]&&!i.layer.callbacks[i.index].callback.call(i.layer.callbacks[i.index].callbackContext,e.sprite,i))return!1;if(!(i.faceLeft||i.faceRight||i.faceTop||i.faceBottom))return!1;var a=0,h=0,l=0,c=1;if(e.deltaAbsX()>e.deltaAbsY()?l=-1:e.deltaAbsX()<e.deltaAbsY()&&(c=-1),0!==e.deltaX()&&0!==e.deltaY()&&(i.faceLeft||i.faceRight)&&(i.faceTop||i.faceBottom)&&(l=Math.min(Math.abs(e.position.x-r-i.right),Math.abs(e.right-r-i.left)),c=Math.min(Math.abs(e.position.y-o-i.bottom),Math.abs(e.bottom-o-i.top))),l<c){if((i.faceLeft||i.faceRight)&&0!==(a=this.tileCheckX(e,i,s))&&!i.intersects(e.position.x-r,e.position.y-o,e.right-r,e.bottom-o))return!0;(i.faceTop||i.faceBottom)&&(h=this.tileCheckY(e,i,s))}else{if((i.faceTop||i.faceBottom)&&0!==(h=this.tileCheckY(e,i,s))&&!i.intersects(e.position.x-r,e.position.y-o,e.right-r,e.bottom-o))return!0;(i.faceLeft||i.faceRight)&&(a=this.tileCheckX(e,i,s))}return 0!==a||0!==h},tileCheckX:function(t,e,i){var s=0,n=i.getTileOffsetX();return t.deltaX()<0&&!t.blocked.left&&e.collideRight&&t.checkCollision.left?e.faceRight&&t.x-n<e.right&&(s=t.x-n-e.right)<-this.TILE_BIAS&&(s=0):t.deltaX()>0&&!t.blocked.right&&e.collideLeft&&t.checkCollision.right&&e.faceLeft&&t.right-n>e.left&&(s=t.right-n-e.left)>this.TILE_BIAS&&(s=0),0!==s&&(t.customSeparateX?t.overlapX=s:this.processTileSeparationX(t,s)),s},tileCheckY:function(t,e,i){var s=0,n=i.getTileOffsetY();return t.deltaY()<0&&!t.blocked.up&&e.collideDown&&t.checkCollision.up?e.faceBottom&&t.y-n<e.bottom&&(s=t.y-n-e.bottom)<-this.TILE_BIAS&&(s=0):t.deltaY()>0&&!t.blocked.down&&e.collideUp&&t.checkCollision.down&&e.faceTop&&t.bottom-n>e.top&&(s=t.bottom-n-e.top)>this.TILE_BIAS&&(s=0),0!==s&&(t.customSeparateY?t.overlapY=s:this.processTileSeparationY(t,s)),s},processTileSeparationX:function(t,e){e<0?(t.blocked.left=!0,t.blocked.none=!1):e>0&&(t.blocked.right=!0,t.blocked.none=!1),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x},processTileSeparationY:function(t,e){e<0?(t.blocked.up=!0,t.blocked.none=!1):e>0&&(t.blocked.down=!0,t.blocked.none=!1),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},e.Utils.mixinPrototype(e.Physics.Arcade.prototype,e.Physics.Arcade.TilemapCollision.prototype),p2.Body.prototype.parent=null,p2.Spring.prototype.parent=null,e.Physics.P2=function(t,i){this.game=t,void 0===i?i={gravity:[0,0],broadphase:new p2.SAPBroadphase}:(i.hasOwnProperty("gravity")||(i.gravity=[0,0]),i.hasOwnProperty("broadphase")||(i.broadphase=new p2.SAPBroadphase)),this.config=i,this.world=new p2.World(this.config),this.frameRate=1/60,this.useElapsedTime=!1,this.paused=!1,this.materials=[],this.gravity=new e.Physics.P2.InversePointProxy(this,this.world.gravity),this.walls={left:null,right:null,top:null,bottom:null},this.onBodyAdded=new e.Signal,this.onBodyRemoved=new e.Signal,this.onSpringAdded=new e.Signal,this.onSpringRemoved=new e.Signal,this.onConstraintAdded=new e.Signal,this.onConstraintRemoved=new e.Signal,this.onContactMaterialAdded=new e.Signal,this.onContactMaterialRemoved=new e.Signal,this.postBroadphaseCallback=null,this.callbackContext=null,this.onBeginContact=new e.Signal,this.onEndContact=new e.Signal,i.hasOwnProperty("mpx")&&i.hasOwnProperty("pxm")&&i.hasOwnProperty("mpxi")&&i.hasOwnProperty("pxmi")&&(this.mpx=i.mpx,this.mpxi=i.mpxi,this.pxm=i.pxm,this.pxmi=i.pxmi),this.world.on("beginContact",this.beginContactHandler,this),this.world.on("endContact",this.endContactHandler,this),this.collisionGroups=[],this.nothingCollisionGroup=new e.Physics.P2.CollisionGroup(1),this.boundsCollisionGroup=new e.Physics.P2.CollisionGroup(2),this.everythingCollisionGroup=new e.Physics.P2.CollisionGroup(2147483648),this.boundsCollidesWith=[],this._toRemove=[],this._collisionGroupID=2,this._boundsLeft=!0,this._boundsRight=!0,this._boundsTop=!0,this._boundsBottom=!0,this._boundsOwnGroup=!1,this.setBoundsToWorld(!0,!0,!0,!0,!1)},e.Physics.P2.prototype={removeBodyNextStep:function(t){this._toRemove.push(t)},preUpdate:function(){for(var t=this._toRemove.length;t--;)this.removeBody(this._toRemove[t]);this._toRemove.length=0},enable:function(t,i,s){void 0===i&&(i=!1),void 0===s&&(s=!0);var n=1;if(Array.isArray(t))for(n=t.length;n--;)t[n]instanceof e.Group?this.enable(t[n].children,i,s):(this.enableBody(t[n],i),s&&t[n].hasOwnProperty("children")&&t[n].children.length>0&&this.enable(t[n],i,!0));else t instanceof e.Group?this.enable(t.children,i,s):(this.enableBody(t,i),s&&t.hasOwnProperty("children")&&t.children.length>0&&this.enable(t.children,i,!0))},enableBody:function(t,i){t.hasOwnProperty("body")&&null===t.body&&(t.body=new e.Physics.P2.Body(this.game,t,t.x,t.y,1),t.body.debug=i,void 0!==t.anchor&&t.anchor.set(.5))},setImpactEvents:function(t){t?this.world.on("impact",this.impactHandler,this):this.world.off("impact",this.impactHandler,this)},setPostBroadphaseCallback:function(t,e){this.postBroadphaseCallback=t,this.callbackContext=e,null!==t?this.world.on("postBroadphase",this.postBroadphaseHandler,this):this.world.off("postBroadphase",this.postBroadphaseHandler,this)},postBroadphaseHandler:function(t){if(this.postBroadphaseCallback&&0!==t.pairs.length)for(var e=t.pairs.length-2;e>=0;e-=2)t.pairs[e].parent&&t.pairs[e+1].parent&&!this.postBroadphaseCallback.call(this.callbackContext,t.pairs[e].parent,t.pairs[e+1].parent)&&t.pairs.splice(e,2)},impactHandler:function(t){if(t.bodyA.parent&&t.bodyB.parent){var e=t.bodyA.parent,i=t.bodyB.parent;e._bodyCallbacks[t.bodyB.id]&&e._bodyCallbacks[t.bodyB.id].call(e._bodyCallbackContext[t.bodyB.id],e,i,t.shapeA,t.shapeB),i._bodyCallbacks[t.bodyA.id]&&i._bodyCallbacks[t.bodyA.id].call(i._bodyCallbackContext[t.bodyA.id],i,e,t.shapeB,t.shapeA),e._groupCallbacks[t.shapeB.collisionGroup]&&e._groupCallbacks[t.shapeB.collisionGroup].call(e._groupCallbackContext[t.shapeB.collisionGroup],e,i,t.shapeA,t.shapeB),i._groupCallbacks[t.shapeA.collisionGroup]&&i._groupCallbacks[t.shapeA.collisionGroup].call(i._groupCallbackContext[t.shapeA.collisionGroup],i,e,t.shapeB,t.shapeA)}},beginContactHandler:function(t){t.bodyA&&t.bodyB&&(this.onBeginContact.dispatch(t.bodyA,t.bodyB,t.shapeA,t.shapeB,t.contactEquations),t.bodyA.parent&&t.bodyA.parent.onBeginContact.dispatch(t.bodyB.parent,t.bodyB,t.shapeA,t.shapeB,t.contactEquations),t.bodyB.parent&&t.bodyB.parent.onBeginContact.dispatch(t.bodyA.parent,t.bodyA,t.shapeB,t.shapeA,t.contactEquations))},endContactHandler:function(t){t.bodyA&&t.bodyB&&(this.onEndContact.dispatch(t.bodyA,t.bodyB,t.shapeA,t.shapeB),t.bodyA.parent&&t.bodyA.parent.onEndContact.dispatch(t.bodyB.parent,t.bodyB,t.shapeA,t.shapeB),t.bodyB.parent&&t.bodyB.parent.onEndContact.dispatch(t.bodyA.parent,t.bodyA,t.shapeB,t.shapeA))},setBoundsToWorld:function(t,e,i,s,n){this.setBounds(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,t,e,i,s,n)},setWorldMaterial:function(t,e,i,s,n){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===s&&(s=!0),void 0===n&&(n=!0),e&&this.walls.left&&(this.walls.left.shapes[0].material=t),i&&this.walls.right&&(this.walls.right.shapes[0].material=t),s&&this.walls.top&&(this.walls.top.shapes[0].material=t),n&&this.walls.bottom&&(this.walls.bottom.shapes[0].material=t)},updateBoundsCollisionGroup:function(t){void 0===t&&(t=!0);var e=t?this.boundsCollisionGroup.mask:this.everythingCollisionGroup.mask;this.walls.left&&(this.walls.left.shapes[0].collisionGroup=e),this.walls.right&&(this.walls.right.shapes[0].collisionGroup=e),this.walls.top&&(this.walls.top.shapes[0].collisionGroup=e),this.walls.bottom&&(this.walls.bottom.shapes[0].collisionGroup=e),this._boundsOwnGroup=t},setBounds:function(t,e,i,s,n,r,o,a,h){void 0===n&&(n=this._boundsLeft),void 0===r&&(r=this._boundsRight),void 0===o&&(o=this._boundsTop),void 0===a&&(a=this._boundsBottom),void 0===h&&(h=this._boundsOwnGroup),this.setupWall(n,"left",t,e,1.5707963267948966,h),this.setupWall(r,"right",t+i,e,-1.5707963267948966,h),this.setupWall(o,"top",t,e,-3.141592653589793,h),this.setupWall(a,"bottom",t,e+s,0,h),this._boundsLeft=n,this._boundsRight=r,this._boundsTop=o,this._boundsBottom=a,this._boundsOwnGroup=h},setupWall:function(t,e,i,s,n,r){t?(this.walls[e]?this.walls[e].position=[this.pxmi(i),this.pxmi(s)]:(this.walls[e]=new p2.Body({mass:0,position:[this.pxmi(i),this.pxmi(s)],angle:n}),this.walls[e].addShape(new p2.Plane),this.world.addBody(this.walls[e])),r&&(this.walls[e].shapes[0].collisionGroup=this.boundsCollisionGroup.mask)):this.walls[e]&&(this.world.removeBody(this.walls[e]),this.walls[e]=null)},pause:function(){this.paused=!0},resume:function(){this.paused=!1},update:function(){this.paused||(this.useElapsedTime?this.world.step(this.game.time.physicsElapsed):this.world.step(this.frameRate))},reset:function(){this.world.on("beginContact",this.beginContactHandler,this),this.world.on("endContact",this.endContactHandler,this),this.nothingCollisionGroup=new e.Physics.P2.CollisionGroup(1),this.boundsCollisionGroup=new e.Physics.P2.CollisionGroup(2),this.everythingCollisionGroup=new e.Physics.P2.CollisionGroup(2147483648),this._collisionGroupID=2,this.setBoundsToWorld(!0,!0,!0,!0,!1)},clear:function(){this.world.time=0,this.world.fixedStepTime=0,this.world.solver&&this.world.solver.equations.length&&this.world.solver.removeAllEquations();for(var t=this.world.constraints,e=t.length-1;e>=0;e--)this.world.removeConstraint(t[e]);for(var i=this.world.bodies,e=i.length-1;e>=0;e--)this.world.removeBody(i[e]);for(var s=this.world.springs,e=s.length-1;e>=0;e--)this.world.removeSpring(s[e]);for(var n=this.world.contactMaterials,e=n.length-1;e>=0;e--)this.world.removeContactMaterial(n[e]);this.world.off("beginContact",this.beginContactHandler,this),this.world.off("endContact",this.endContactHandler,this),this.postBroadphaseCallback=null,this.callbackContext=null,this.impactCallback=null,this.collisionGroups=[],this._toRemove=[],this.boundsCollidesWith=[],this.walls={left:null,right:null,top:null,bottom:null}},destroy:function(){this.clear(),this.game=null},addBody:function(t){return!t.data.world&&(this.world.addBody(t.data),this.onBodyAdded.dispatch(t),!0)},removeBody:function(t){return t.data.world===this.world&&(this.world.removeBody(t.data),this.onBodyRemoved.dispatch(t)),t},addSpring:function(t){return t instanceof e.Physics.P2.Spring||t instanceof e.Physics.P2.RotationalSpring?this.world.addSpring(t.data):this.world.addSpring(t),this.onSpringAdded.dispatch(t),t},removeSpring:function(t){return t instanceof e.Physics.P2.Spring||t instanceof e.Physics.P2.RotationalSpring?this.world.removeSpring(t.data):this.world.removeSpring(t),this.onSpringRemoved.dispatch(t),t},createDistanceConstraint:function(t,i,s,n,r,o){if(t=this.getBody(t),i=this.getBody(i),t&&i)return this.addConstraint(new e.Physics.P2.DistanceConstraint(this,t,i,s,n,r,o));console.warn("Cannot create Constraint, invalid body objects given")},createGearConstraint:function(t,i,s,n){if(t=this.getBody(t),i=this.getBody(i),t&&i)return this.addConstraint(new e.Physics.P2.GearConstraint(this,t,i,s,n));console.warn("Cannot create Constraint, invalid body objects given")},createRevoluteConstraint:function(t,i,s,n,r,o){if(t=this.getBody(t),s=this.getBody(s),t&&s)return this.addConstraint(new e.Physics.P2.RevoluteConstraint(this,t,i,s,n,r,o));console.warn("Cannot create Constraint, invalid body objects given")},createLockConstraint:function(t,i,s,n,r){if(t=this.getBody(t),i=this.getBody(i),t&&i)return this.addConstraint(new e.Physics.P2.LockConstraint(this,t,i,s,n,r));console.warn("Cannot create Constraint, invalid body objects given")},createPrismaticConstraint:function(t,i,s,n,r,o,a){if(t=this.getBody(t),i=this.getBody(i),t&&i)return this.addConstraint(new e.Physics.P2.PrismaticConstraint(this,t,i,s,n,r,o,a));console.warn("Cannot create Constraint, invalid body objects given")},addConstraint:function(t){return this.world.addConstraint(t),this.onConstraintAdded.dispatch(t),t},removeConstraint:function(t){return this.world.removeConstraint(t),this.onConstraintRemoved.dispatch(t),t},addContactMaterial:function(t){return this.world.addContactMaterial(t),this.onContactMaterialAdded.dispatch(t),t},removeContactMaterial:function(t){return this.world.removeContactMaterial(t),this.onContactMaterialRemoved.dispatch(t),t},getContactMaterial:function(t,e){return this.world.getContactMaterial(t,e)},setMaterial:function(t,e){for(var i=e.length;i--;)e[i].setMaterial(t)},createMaterial:function(t,i){t=t||"";var s=new e.Physics.P2.Material(t);return this.materials.push(s),void 0!==i&&i.setMaterial(s),s},createContactMaterial:function(t,i,s){void 0===t&&(t=this.createMaterial()),void 0===i&&(i=this.createMaterial());var n=new e.Physics.P2.ContactMaterial(t,i,s);return this.addContactMaterial(n)},getBodies:function(){for(var t=[],e=this.world.bodies.length;e--;)t.push(this.world.bodies[e].parent);return t},getBody:function(t){return t instanceof p2.Body?t:t instanceof e.Physics.P2.Body?t.data:t.body&&t.body.type===e.Physics.P2JS?t.body.data:null},getSprings:function(){for(var t=[],e=this.world.springs.length;e--;)t.push(this.world.springs[e].parent);return t},getConstraints:function(){for(var t=[],e=this.world.constraints.length;e--;)t.push(this.world.constraints[e]);return t},hitTest:function(t,i,s,n){void 0===i&&(i=this.world.bodies),void 0===s&&(s=5),void 0===n&&(n=!1);for(var r=[this.pxmi(t.x),this.pxmi(t.y)],o=[],a=i.length;a--;)i[a]instanceof e.Physics.P2.Body&&(!n||i[a].data.type!==p2.Body.STATIC)?o.push(i[a].data):i[a]instanceof p2.Body&&i[a].parent&&(!n||i[a].type!==p2.Body.STATIC)?o.push(i[a]):i[a]instanceof e.Sprite&&i[a].hasOwnProperty("body")&&(!n||i[a].body.data.type!==p2.Body.STATIC)&&o.push(i[a].body.data);return this.world.hitTest(r,o,s)},toJSON:function(){return this.world.toJSON()},createCollisionGroup:function(t){var i=Math.pow(2,this._collisionGroupID);this.walls.left&&(this.walls.left.shapes[0].collisionMask=this.walls.left.shapes[0].collisionMask|i),this.walls.right&&(this.walls.right.shapes[0].collisionMask=this.walls.right.shapes[0].collisionMask|i),this.walls.top&&(this.walls.top.shapes[0].collisionMask=this.walls.top.shapes[0].collisionMask|i),this.walls.bottom&&(this.walls.bottom.shapes[0].collisionMask=this.walls.bottom.shapes[0].collisionMask|i),this._collisionGroupID++;var s=new e.Physics.P2.CollisionGroup(i);return this.collisionGroups.push(s),t&&this.setCollisionGroup(t,s),s},setCollisionGroup:function(t,i){if(t instanceof e.Group)for(var s=0;s<t.total;s++)t.children[s].body&&t.children[s].body.type===e.Physics.P2JS&&t.children[s].body.setCollisionGroup(i);else t.body.setCollisionGroup(i)},createSpring:function(t,i,s,n,r,o,a,h,l){if(t=this.getBody(t),i=this.getBody(i),t&&i)return this.addSpring(new e.Physics.P2.Spring(this,t,i,s,n,r,o,a,h,l));console.warn("Cannot create Spring, invalid body objects given")},createRotationalSpring:function(t,i,s,n,r){if(t=this.getBody(t),i=this.getBody(i),t&&i)return this.addSpring(new e.Physics.P2.RotationalSpring(this,t,i,s,n,r));console.warn("Cannot create Rotational Spring, invalid body objects given")},createBody:function(t,i,s,n,r,o){void 0===n&&(n=!1);var a=new e.Physics.P2.Body(this.game,null,t,i,s);return!(o&&!a.addPolygon(r,o))&&(n&&this.world.addBody(a.data),a)},createParticle:function(t,i,s,n,r,o){void 0===n&&(n=!1);var a=new e.Physics.P2.Body(this.game,null,t,i,s);return!(o&&!a.addPolygon(r,o))&&(n&&this.world.addBody(a.data),a)},convertCollisionObjects:function(t,e,i){void 0===i&&(i=!0);for(var s=[],n=0,r=t.collision[e].length;n<r;n++){var o=t.collision[e][n],a=o.polyline||o.polygon;if(a)var h=this.createBody(o.x,o.y,0,i,{},a);else o.rectangle&&(h=this.createBody(o.x,o.y,0,i)).addRectangle(o.width,o.height,o.width/2,o.height/2);h&&s.push(h)}return s},clearTilemapLayerBodies:function(t,e){e=t.getLayer(e);for(var i=t.layers[e].bodies.length;i--;)t.layers[e].bodies[i].destroy();t.layers[e].bodies.length=0},convertTilemap:function(t,e,i,s){e=t.getLayer(e),void 0===i&&(i=!0),void 0===s&&(s=!0),this.clearTilemapLayerBodies(t,e);for(var n=0,r=0,o=0,a=0,h=t.layers[e].height;a<h;a++){n=0;for(var l=0,c=t.layers[e].width;l<c;l++){var u=t.layers[e].data[a][l];if(u&&u.index>-1&&u.collides)if(s){var d=t.getTileRight(e,l,a);0===n&&(r=u.x*u.width,o=u.y*u.height,n=u.width),d&&d.collides?n+=u.width:((p=this.createBody(r,o,0,!1)).addRectangle(n,u.height,n/2,u.height/2,0),i&&this.addBody(p),t.layers[e].bodies.push(p),n=0)}else{var p=this.createBody(u.x*u.width,u.y*u.height,0,!1);p.addRectangle(u.width,u.height,u.width/2,u.height/2,0),i&&this.addBody(p),t.layers[e].bodies.push(p)}}}return t.layers[e].bodies},mpx:function(t){return t*=20},pxm:function(t){return.05*t},mpxi:function(t){return t*=-20},pxmi:function(t){return-.05*t}},Object.defineProperty(e.Physics.P2.prototype,"friction",{get:function(){return this.world.defaultContactMaterial.friction},set:function(t){this.world.defaultContactMaterial.friction=t}}),Object.defineProperty(e.Physics.P2.prototype,"restitution",{get:function(){return this.world.defaultContactMaterial.restitution},set:function(t){this.world.defaultContactMaterial.restitution=t}}),Object.defineProperty(e.Physics.P2.prototype,"contactMaterial",{get:function(){return this.world.defaultContactMaterial},set:function(t){this.world.defaultContactMaterial=t}}),Object.defineProperty(e.Physics.P2.prototype,"applySpringForces",{get:function(){return this.world.applySpringForces},set:function(t){this.world.applySpringForces=t}}),Object.defineProperty(e.Physics.P2.prototype,"applyDamping",{get:function(){return this.world.applyDamping},set:function(t){this.world.applyDamping=t}}),Object.defineProperty(e.Physics.P2.prototype,"applyGravity",{get:function(){return this.world.applyGravity},set:function(t){this.world.applyGravity=t}}),Object.defineProperty(e.Physics.P2.prototype,"solveConstraints",{get:function(){return this.world.solveConstraints},set:function(t){this.world.solveConstraints=t}}),Object.defineProperty(e.Physics.P2.prototype,"time",{get:function(){return this.world.time}}),Object.defineProperty(e.Physics.P2.prototype,"emitImpactEvent",{get:function(){return this.world.emitImpactEvent},set:function(t){this.world.emitImpactEvent=t}}),Object.defineProperty(e.Physics.P2.prototype,"sleepMode",{get:function(){return this.world.sleepMode},set:function(t){this.world.sleepMode=t}}),Object.defineProperty(e.Physics.P2.prototype,"total",{get:function(){return this.world.bodies.length}}),e.Physics.P2.FixtureList=function(t){Array.isArray(t)||(t=[t]),this.rawList=t,this.init(),this.parse(this.rawList)},e.Physics.P2.FixtureList.prototype={init:function(){this.namedFixtures={},this.groupedFixtures=[],this.allFixtures=[]},setCategory:function(t,e){this.getFixtures(e).forEach(function(e){e.collisionGroup=t})},setMask:function(t,e){this.getFixtures(e).forEach(function(e){e.collisionMask=t})},setSensor:function(t,e){this.getFixtures(e).forEach(function(e){e.sensor=t})},setMaterial:function(t,e){this.getFixtures(e).forEach(function(e){e.material=t})},getFixtures:function(t){var e=[];if(t){t instanceof Array||(t=[t]);var i=this;return t.forEach(function(t){i.namedFixtures[t]&&e.push(i.namedFixtures[t])}),this.flatten(e)}return this.allFixtures},getFixtureByKey:function(t){return this.namedFixtures[t]},getGroup:function(t){return this.groupedFixtures[t]},parse:function(){var t,e,i,s;i=this.rawList,s=[];for(t in i)e=i[t],isNaN(t-0)?this.namedFixtures[t]=this.flatten(e):(this.groupedFixtures[t]=this.groupedFixtures[t]||[],this.groupedFixtures[t]=this.groupedFixtures[t].concat(e)),s.push(this.allFixtures=this.flatten(this.groupedFixtures))},flatten:function(t){var e,i;return e=[],i=arguments.callee,t.forEach(function(t){return Array.prototype.push.apply(e,Array.isArray(t)?i(t):[t])}),e}},e.Physics.P2.PointProxy=function(t,e){this.world=t,this.destination=e},e.Physics.P2.PointProxy.prototype.constructor=e.Physics.P2.PointProxy,Object.defineProperty(e.Physics.P2.PointProxy.prototype,"x",{get:function(){return this.world.mpx(this.destination[0])},set:function(t){this.destination[0]=this.world.pxm(t)}}),Object.defineProperty(e.Physics.P2.PointProxy.prototype,"y",{get:function(){return this.world.mpx(this.destination[1])},set:function(t){this.destination[1]=this.world.pxm(t)}}),Object.defineProperty(e.Physics.P2.PointProxy.prototype,"mx",{get:function(){return this.destination[0]},set:function(t){this.destination[0]=t}}),Object.defineProperty(e.Physics.P2.PointProxy.prototype,"my",{get:function(){return this.destination[1]},set:function(t){this.destination[1]=t}}),e.Physics.P2.InversePointProxy=function(t,e){this.world=t,this.destination=e},e.Physics.P2.InversePointProxy.prototype.constructor=e.Physics.P2.InversePointProxy,Object.defineProperty(e.Physics.P2.InversePointProxy.prototype,"x",{get:function(){return this.world.mpxi(this.destination[0])},set:function(t){this.destination[0]=this.world.pxmi(t)}}),Object.defineProperty(e.Physics.P2.InversePointProxy.prototype,"y",{get:function(){return this.world.mpxi(this.destination[1])},set:function(t){this.destination[1]=this.world.pxmi(t)}}),Object.defineProperty(e.Physics.P2.InversePointProxy.prototype,"mx",{get:function(){return this.destination[0]},set:function(t){this.destination[0]=-t}}),Object.defineProperty(e.Physics.P2.InversePointProxy.prototype,"my",{get:function(){return this.destination[1]},set:function(t){this.destination[1]=-t}}),e.Physics.P2.Body=function(t,i,s,n,r){i=i||null,s=s||0,n=n||0,void 0===r&&(r=1),this.game=t,this.world=t.physics.p2,this.sprite=i,this.type=e.Physics.P2JS,this.offset=new e.Point,this.data=new p2.Body({position:[this.world.pxmi(s),this.world.pxmi(n)],mass:r}),this.data.parent=this,this.velocity=new e.Physics.P2.InversePointProxy(this.world,this.data.velocity),this.force=new e.Physics.P2.InversePointProxy(this.world,this.data.force),this.gravity=new e.Point,this.onBeginContact=new e.Signal,this.onEndContact=new e.Signal,this.collidesWith=[],this.removeNextStep=!1,this.debugBody=null,this.dirty=!1,this._collideWorldBounds=!0,this._bodyCallbacks={},this._bodyCallbackContext={},this._groupCallbacks={},this._groupCallbackContext={},this._reset=!1,i&&(this.setRectangleFromSprite(i),i.exists&&this.game.physics.p2.addBody(this))},e.Physics.P2.Body.prototype={createBodyCallback:function(t,e,i){var s=-1;t.id?s=t.id:t.body&&(s=t.body.id),s>-1&&(null===e?(delete this._bodyCallbacks[s],delete this._bodyCallbackContext[s]):(this._bodyCallbacks[s]=e,this._bodyCallbackContext[s]=i))},createGroupCallback:function(t,e,i){null===e?(delete this._groupCallbacks[t.mask],delete this._groupCallbackContext[t.mask]):(this._groupCallbacks[t.mask]=e,this._groupCallbackContext[t.mask]=i)},getCollisionMask:function(){var t=0;this._collideWorldBounds&&(t=this.game.physics.p2.boundsCollisionGroup.mask);for(var e=0;e<this.collidesWith.length;e++)t|=this.collidesWith[e].mask;return t},updateCollisionMask:function(t){var e=this.getCollisionMask();if(void 0===t)for(var i=this.data.shapes.length-1;i>=0;i--)this.data.shapes[i].collisionMask=e;else t.collisionMask=e},setCollisionGroup:function(t,e){var i=this.getCollisionMask();if(void 0===e)for(var s=this.data.shapes.length-1;s>=0;s--)this.data.shapes[s].collisionGroup=t.mask,this.data.shapes[s].collisionMask=i;else e.collisionGroup=t.mask,e.collisionMask=i},clearCollision:function(t,e,i){if(void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i)for(var s=this.data.shapes.length-1;s>=0;s--)t&&(this.data.shapes[s].collisionGroup=null),e&&(this.data.shapes[s].collisionMask=null);else t&&(i.collisionGroup=null),e&&(i.collisionMask=null);t&&(this.collidesWith.length=0)},removeCollisionGroup:function(t,e,i){void 0===e&&(e=!0);var s;if(Array.isArray(t))for(r=0;r<t.length;r++)(s=this.collidesWith.indexOf(t[r]))>-1&&(this.collidesWith.splice(s,1),e&&(delete this._groupCallbacks[t.mask],delete this._groupCallbackContext[t.mask]));else(s=this.collidesWith.indexOf(t))>-1&&(this.collidesWith.splice(s,1),e&&(delete this._groupCallbacks[t.mask],delete this._groupCallbackContext[t.mask]));var n=this.getCollisionMask();if(void 0===i)for(var r=this.data.shapes.length-1;r>=0;r--)this.data.shapes[r].collisionMask=n;else i.collisionMask=n},collides:function(t,e,i,s){if(Array.isArray(t))for(r=0;r<t.length;r++)-1===this.collidesWith.indexOf(t[r])&&(this.collidesWith.push(t[r]),e&&this.createGroupCallback(t[r],e,i));else-1===this.collidesWith.indexOf(t)&&(this.collidesWith.push(t),e&&this.createGroupCallback(t,e,i));var n=this.getCollisionMask();if(void 0===s)for(var r=this.data.shapes.length-1;r>=0;r--)this.data.shapes[r].collisionMask=n;else s.collisionMask=n},adjustCenterOfMass:function(){this.data.adjustCenterOfMass(),this.shapeChanged()},getVelocityAtPoint:function(t,e){return this.data.getVelocityAtPoint(t,e)},applyDamping:function(t){this.data.applyDamping(t)},applyImpulse:function(t,e,i){this.data.applyImpulse(t,[this.world.pxmi(e),this.world.pxmi(i)])},applyImpulseLocal:function(t,e,i){this.data.applyImpulseLocal(t,[this.world.pxmi(e),this.world.pxmi(i)])},applyForce:function(t,e,i){this.data.applyForce(t,[this.world.pxmi(e),this.world.pxmi(i)])},setZeroForce:function(){this.data.setZeroForce()},setZeroRotation:function(){this.data.angularVelocity=0},setZeroVelocity:function(){this.data.velocity[0]=0,this.data.velocity[1]=0},setZeroDamping:function(){this.data.damping=0,this.data.angularDamping=0},toLocalFrame:function(t,e){return this.data.toLocalFrame(t,e)},toWorldFrame:function(t,e){return this.data.toWorldFrame(t,e)},rotateLeft:function(t){this.data.angularVelocity=this.world.pxm(-t)},rotateRight:function(t){this.data.angularVelocity=this.world.pxm(t)},moveForward:function(t){var e=this.world.pxmi(-t),i=this.data.angle+Math.PI/2;this.data.velocity[0]=e*Math.cos(i),this.data.velocity[1]=e*Math.sin(i)},moveBackward:function(t){var e=this.world.pxmi(-t),i=this.data.angle+Math.PI/2;this.data.velocity[0]=-e*Math.cos(i),this.data.velocity[1]=-e*Math.sin(i)},thrust:function(t){var e=this.world.pxmi(-t),i=this.data.angle+Math.PI/2;this.data.force[0]+=e*Math.cos(i),this.data.force[1]+=e*Math.sin(i)},thrustLeft:function(t){var e=this.world.pxmi(-t),i=this.data.angle;this.data.force[0]+=e*Math.cos(i),this.data.force[1]+=e*Math.sin(i)},thrustRight:function(t){var e=this.world.pxmi(-t),i=this.data.angle;this.data.force[0]-=e*Math.cos(i),this.data.force[1]-=e*Math.sin(i)},reverse:function(t){var e=this.world.pxmi(-t),i=this.data.angle+Math.PI/2;this.data.force[0]-=e*Math.cos(i),this.data.force[1]-=e*Math.sin(i)},moveLeft:function(t){this.data.velocity[0]=this.world.pxmi(-t)},moveRight:function(t){this.data.velocity[0]=this.world.pxmi(t)},moveUp:function(t){this.data.velocity[1]=this.world.pxmi(-t)},moveDown:function(t){this.data.velocity[1]=this.world.pxmi(t)},preUpdate:function(){this.dirty=!0,this.removeNextStep&&(this.removeFromWorld(),this.removeNextStep=!1)},postUpdate:function(){this.sprite.x=this.world.mpxi(this.data.position[0])+this.offset.x,this.sprite.y=this.world.mpxi(this.data.position[1])+this.offset.y,this.fixedRotation||(this.sprite.rotation=this.data.angle),this.debugBody&&this.debugBody.updateSpriteTransform(),this.dirty=!1},reset:function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!1),this.setZeroForce(),this.setZeroVelocity(),this.setZeroRotation(),i&&this.setZeroDamping(),s&&(this.mass=1),this.x=t,this.y=e},addToWorld:function(){if(this.game.physics.p2._toRemove)for(var t=0;t<this.game.physics.p2._toRemove.length;t++)this.game.physics.p2._toRemove[t]===this&&this.game.physics.p2._toRemove.splice(t,1);this.data.world!==this.game.physics.p2.world&&this.game.physics.p2.addBody(this)},removeFromWorld:function(){this.data.world===this.game.physics.p2.world&&this.game.physics.p2.removeBodyNextStep(this)},destroy:function(){this.removeFromWorld(),this.clearShapes(),this._bodyCallbacks={},this._bodyCallbackContext={},this._groupCallbacks={},this._groupCallbackContext={},this.debugBody&&this.debugBody.destroy(!0,!0),this.debugBody=null,this.sprite&&(this.sprite.body=null,this.sprite=null)},clearShapes:function(){for(var t=this.data.shapes.length;t--;)this.data.removeShape(this.data.shapes[t]);this.shapeChanged()},addShape:function(t,e,i,s){return void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.data.addShape(t,[this.world.pxmi(e),this.world.pxmi(i)],s),this.shapeChanged(),t},addCircle:function(t,e,i,s){var n=new p2.Circle({radius:this.world.pxm(t)});return this.addShape(n,e,i,s)},addRectangle:function(t,e,i,s,n){var r=new p2.Box({width:this.world.pxm(t),height:this.world.pxm(e)});return this.addShape(r,i,s,n)},addPlane:function(t,e,i){var s=new p2.Plane;return this.addShape(s,t,e,i)},addParticle:function(t,e,i){var s=new p2.Particle;return this.addShape(s,t,e,i)},addLine:function(t,e,i,s){var n=new p2.Line({length:this.world.pxm(t)});return this.addShape(n,e,i,s)},addCapsule:function(t,e,i,s,n){var r=new p2.Capsule({length:this.world.pxm(t),radius:this.world.pxm(e)});return this.addShape(r,i,s,n)},addPolygon:function(t,e){t=t||{},Array.isArray(e)||(e=Array.prototype.slice.call(arguments,1));var i=[];if(1===e.length&&Array.isArray(e[0]))i=e[0].slice(0);else if(Array.isArray(e[0]))i=e.slice();else if("number"==typeof e[0])for(var s=0,n=e.length;s<n;s+=2)i.push([e[s],e[s+1]]);var r=i.length-1;i[r][0]===i[0][0]&&i[r][1]===i[0][1]&&i.pop();for(var o=0;o<i.length;o++)i[o][0]=this.world.pxmi(i[o][0]),i[o][1]=this.world.pxmi(i[o][1]);var a=this.data.fromPolygon(i,t);return this.shapeChanged(),a},removeShape:function(t){var e=this.data.removeShape(t);return this.shapeChanged(),e},setCircle:function(t,e,i,s){return this.clearShapes(),this.addCircle(t,e,i,s)},setRectangle:function(t,e,i,s,n){return void 0===t&&(t=16),void 0===e&&(e=16),this.clearShapes(),this.addRectangle(t,e,i,s,n)},setRectangleFromSprite:function(t){return void 0===t&&(t=this.sprite),this.clearShapes(),this.addRectangle(t.width,t.height,0,0,t.rotation)},setMaterial:function(t,e){if(void 0===e)for(var i=this.data.shapes.length-1;i>=0;i--)this.data.shapes[i].material=t;else e.material=t},shapeChanged:function(){this.debugBody&&this.debugBody.draw()},addPhaserPolygon:function(t,e){for(var i=this.game.cache.getPhysicsData(t,e),s=[],n=0;n<i.length;n++){var r=i[n],o=this.addFixture(r);s[r.filter.group]=s[r.filter.group]||[],s[r.filter.group]=s[r.filter.group].concat(o),r.fixtureKey&&(s[r.fixtureKey]=o)}return this.data.aabbNeedsUpdate=!0,this.shapeChanged(),s},addFixture:function(t){var e=[];if(t.circle){(l=new p2.Circle({radius:this.world.pxm(t.circle.radius)})).collisionGroup=t.filter.categoryBits,l.collisionMask=t.filter.maskBits,l.sensor=t.isSensor;var i=p2.vec2.create();i[0]=this.world.pxmi(t.circle.position[0]-this.sprite.width/2),i[1]=this.world.pxmi(t.circle.position[1]-this.sprite.height/2),this.data.addShape(l,i),e.push(l)}else for(var s=t.polygons,n=p2.vec2.create(),r=0;r<s.length;r++){for(var o=s[r],a=[],h=0;h<o.length;h+=2)a.push([this.world.pxmi(o[h]),this.world.pxmi(o[h+1])]);for(var l=new p2.Convex({vertices:a}),c=0;c!==l.vertices.length;c++){var u=l.vertices[c];p2.vec2.sub(u,u,l.centerOfMass)}p2.vec2.scale(n,l.centerOfMass,1),n[0]-=this.world.pxmi(this.sprite.width/2),n[1]-=this.world.pxmi(this.sprite.height/2),l.updateTriangles(),l.updateCenterOfMass(),l.updateBoundingRadius(),l.collisionGroup=t.filter.categoryBits,l.collisionMask=t.filter.maskBits,l.sensor=t.isSensor,this.data.addShape(l,n),e.push(l)}return e},loadPolygon:function(t,e,i){if(null===t)s=e;else var s=this.game.cache.getPhysicsData(t,e);"number"!=typeof i&&(i=1);for(var n=p2.vec2.create(),r=0;r<s.length;r++){for(var o=[],a=0;a<s[r].shape.length;a+=2)o.push([this.world.pxmi(s[r].shape[a]*i),this.world.pxmi(s[r].shape[a+1]*i)]);for(var h=new p2.Convex({vertices:o}),l=0;l!==h.vertices.length;l++){var c=h.vertices[l];p2.vec2.sub(c,c,h.centerOfMass)}p2.vec2.scale(n,h.centerOfMass,1),n[0]-=this.world.pxmi(this.sprite.width/2),n[1]-=this.world.pxmi(this.sprite.height/2),h.updateTriangles(),h.updateCenterOfMass(),h.updateBoundingRadius(),this.data.addShape(h,n)}return this.data.aabbNeedsUpdate=!0,this.shapeChanged(),!0}},e.Physics.P2.Body.prototype.constructor=e.Physics.P2.Body,e.Physics.P2.Body.DYNAMIC=1,e.Physics.P2.Body.STATIC=2,e.Physics.P2.Body.KINEMATIC=4,Object.defineProperty(e.Physics.P2.Body.prototype,"static",{get:function(){return this.data.type===e.Physics.P2.Body.STATIC},set:function(t){t&&this.data.type!==e.Physics.P2.Body.STATIC?(this.data.type=e.Physics.P2.Body.STATIC,this.mass=0):t||this.data.type!==e.Physics.P2.Body.STATIC||(this.data.type=e.Physics.P2.Body.DYNAMIC,this.mass=1)}}),Object.defineProperty(e.Physics.P2.Body.prototype,"dynamic",{get:function(){return this.data.type===e.Physics.P2.Body.DYNAMIC},set:function(t){t&&this.data.type!==e.Physics.P2.Body.DYNAMIC?(this.data.type=e.Physics.P2.Body.DYNAMIC,this.mass=1):t||this.data.type!==e.Physics.P2.Body.DYNAMIC||(this.data.type=e.Physics.P2.Body.STATIC,this.mass=0)}}),Object.defineProperty(e.Physics.P2.Body.prototype,"kinematic",{get:function(){return this.data.type===e.Physics.P2.Body.KINEMATIC},set:function(t){t&&this.data.type!==e.Physics.P2.Body.KINEMATIC?(this.data.type=e.Physics.P2.Body.KINEMATIC,this.mass=4):t||this.data.type!==e.Physics.P2.Body.KINEMATIC||(this.data.type=e.Physics.P2.Body.STATIC,this.mass=0)}}),Object.defineProperty(e.Physics.P2.Body.prototype,"allowSleep",{get:function(){return this.data.allowSleep},set:function(t){t!==this.data.allowSleep&&(this.data.allowSleep=t)}}),Object.defineProperty(e.Physics.P2.Body.prototype,"angle",{get:function(){return e.Math.wrapAngle(e.Math.radToDeg(this.data.angle))},set:function(t){this.data.angle=e.Math.degToRad(e.Math.wrapAngle(t))}}),Object.defineProperty(e.Physics.P2.Body.prototype,"angularDamping",{get:function(){return this.data.angularDamping},set:function(t){this.data.angularDamping=t}}),Object.defineProperty(e.Physics.P2.Body.prototype,"angularForce",{get:function(){return this.data.angularForce},set:function(t){this.data.angularForce=t}}),Object.defineProperty(e.Physics.P2.Body.prototype,"angularVelocity",{get:function(){return this.data.angularVelocity},set:function(t){this.data.angularVelocity=t}}),Object.defineProperty(e.Physics.P2.Body.prototype,"damping",{get:function(){return this.data.damping},set:function(t){this.data.damping=t}}),Object.defineProperty(e.Physics.P2.Body.prototype,"fixedRotation",{get:function(){return this.data.fixedRotation},set:function(t){t!==this.data.fixedRotation&&(this.data.fixedRotation=t)}}),Object.defineProperty(e.Physics.P2.Body.prototype,"inertia",{get:function(){return this.data.inertia},set:function(t){this.data.inertia=t}}),Object.defineProperty(e.Physics.P2.Body.prototype,"mass",{get:function(){return this.data.mass},set:function(t){t!==this.data.mass&&(this.data.mass=t,this.data.updateMassProperties())}}),Object.defineProperty(e.Physics.P2.Body.prototype,"motionState",{get:function(){return this.data.type},set:function(t){t!==this.data.type&&(this.data.type=t)}}),Object.defineProperty(e.Physics.P2.Body.prototype,"rotation",{get:function(){return this.data.angle},set:function(t){this.data.angle=t}}),Object.defineProperty(e.Physics.P2.Body.prototype,"sleepSpeedLimit",{get:function(){return this.data.sleepSpeedLimit},set:function(t){this.data.sleepSpeedLimit=t}}),Object.defineProperty(e.Physics.P2.Body.prototype,"x",{get:function(){return this.world.mpxi(this.data.position[0])},set:function(t){this.data.position[0]=this.world.pxmi(t)}}),Object.defineProperty(e.Physics.P2.Body.prototype,"y",{get:function(){return this.world.mpxi(this.data.position[1])},set:function(t){this.data.position[1]=this.world.pxmi(t)}}),Object.defineProperty(e.Physics.P2.Body.prototype,"id",{get:function(){return this.data.id}}),Object.defineProperty(e.Physics.P2.Body.prototype,"debug",{get:function(){return null!==this.debugBody},set:function(t){t&&!this.debugBody?this.debugBody=new e.Physics.P2.BodyDebug(this.game,this.data):!t&&this.debugBody&&(this.debugBody.destroy(),this.debugBody=null)}}),Object.defineProperty(e.Physics.P2.Body.prototype,"collideWorldBounds",{get:function(){return this._collideWorldBounds},set:function(t){t&&!this._collideWorldBounds?(this._collideWorldBounds=!0,this.updateCollisionMask()):!t&&this._collideWorldBounds&&(this._collideWorldBounds=!1,this.updateCollisionMask())}}),e.Physics.P2.BodyDebug=function(t,i,s){e.Group.call(this,t);var n={pixelsPerLengthUnit:t.physics.p2.mpx(1),debugPolygons:!1,lineWidth:1,alpha:.5};this.settings=Object.assign(n,s),this.ppu=this.settings.pixelsPerLengthUnit,this.ppu=-1*this.ppu,this.body=i,this.canvas=new e.Graphics(t),this.canvas.alpha=this.settings.alpha,this.add(this.canvas),this.draw(),this.updateSpriteTransform()},e.Physics.P2.BodyDebug.prototype=Object.create(e.Group.prototype),e.Physics.P2.BodyDebug.prototype.constructor=e.Physics.P2.BodyDebug,Object.assign(e.Physics.P2.BodyDebug.prototype,{updateSpriteTransform:function(){this.position.x=this.body.position[0]*this.ppu,this.position.y=this.body.position[1]*this.ppu,this.rotation=this.body.angle},draw:function(){var t,e,i,s,n,r,o,a,h,l,c,u,d,p;if(o=this.body,(h=this.canvas).clear(),i=parseInt(this.randomPastelHex(),16),16711680,r=this.lineWidth,o instanceof p2.Body&&o.shapes.length){var f=o.shapes.length;for(s=0;s!==f;){if(e=o.shapes[s],a=e.position||0,t=e.angle||0,e instanceof p2.Circle)this.drawCircle(h,a[0]*this.ppu,a[1]*this.ppu,t,e.radius*this.ppu,i,r);else if(e instanceof p2.Capsule)this.drawCapsule(h,a[0]*this.ppu,a[1]*this.ppu,t,e.length*this.ppu,e.radius*this.ppu,16711680,i,r);else if(e instanceof p2.Plane)this.drawPlane(h,a[0]*this.ppu,-a[1]*this.ppu,i,16711680,5*r,10*r,10*r,100*this.ppu,t);else if(e instanceof p2.Line)this.drawLine(h,e.length*this.ppu,16711680,r);else if(e instanceof p2.Box)this.drawRectangle(h,a[0]*this.ppu,a[1]*this.ppu,t,e.width*this.ppu,e.height*this.ppu,16711680,i,r);else if(e instanceof p2.Convex){for(c=[],u=p2.vec2.create(),n=d=0,p=e.vertices.length;p>=0?d<p:d>p;n=p>=0?++d:--d)l=e.vertices[n],p2.vec2.rotate(u,l,t),c.push([(u[0]+a[0])*this.ppu,-(u[1]+a[1])*this.ppu]);this.drawConvex(h,c,e.triangles,16711680,i,r,this.settings.debugPolygons,[a[0]*this.ppu,-a[1]*this.ppu])}s++}}},drawRectangle:function(t,e,i,s,n,r,o,a,h){void 0===h&&(h=1),void 0===o&&(o=0),t.lineStyle(h,o,1),t.beginFill(a),t.drawRect(e-n/2,i-r/2,n,r)},drawCircle:function(t,e,i,s,n,r,o){void 0===o&&(o=1),void 0===r&&(r=16777215),t.lineStyle(o,0,1),t.beginFill(r,1),t.drawCircle(e,i,2*-n),t.endFill(),t.moveTo(e,i),t.lineTo(e+n*Math.cos(-s),i+n*Math.sin(-s))},drawLine:function(t,e,i,s){void 0===s&&(s=1),void 0===i&&(i=0),t.lineStyle(5*s,i,1),t.moveTo(-e/2,0),t.lineTo(e/2,0)},drawConvex:function(t,e,i,s,n,r,o,a){var h,l,c,u,d,p,f,g,m,y,v;if(void 0===r&&(r=1),void 0===s&&(s=0),o){for(h=[16711680,65280,255],l=0;l!==e.length+1;)u=e[l%e.length],d=e[(l+1)%e.length],f=u[0],y=u[1],g=d[0],v=d[1],t.lineStyle(r,h[l%h.length],1),t.moveTo(f,-y),t.lineTo(g,-v),t.drawCircle(f,-y,2*r),l++;return t.lineStyle(r,0,1),t.drawCircle(a[0],a[1],2*r)}for(t.lineStyle(r,s,1),t.beginFill(n),l=0;l!==e.length;)p=(c=e[l])[0],m=c[1],0===l?t.moveTo(p,-m):t.lineTo(p,-m),l++;if(t.endFill(),e.length>2)return t.moveTo(e[e.length-1][0],-e[e.length-1][1]),t.lineTo(e[0][0],-e[0][1])},drawPath:function(t,e,i,s,n){var r,o,a,h,l,c,u,d,p,f,g;for(void 0===n&&(n=1),void 0===i&&(i=0),t.lineStyle(n,i,1),"number"==typeof s&&t.beginFill(s),o=null,a=null,r=0;r<e.length;)f=(p=e[r])[0],g=p[1],f===o&&g===a||(0===r?t.moveTo(f,g):(h=o,l=a,c=f,u=g,d=e[(r+1)%e.length][0],0!==(c-h)*(e[(r+1)%e.length][1]-l)-(d-h)*(u-l)&&t.lineTo(f,g)),o=f,a=g),r++;"number"==typeof s&&t.endFill(),e.length>2&&"number"==typeof s&&(t.moveTo(e[e.length-1][0],e[e.length-1][1]),t.lineTo(e[0][0],e[0][1]))},drawPlane:function(t,e,i,s,n,r,o,a,h,l){var c,u;void 0===r&&(r=1),void 0===s&&(s=16777215),t.lineStyle(r,n,11),t.beginFill(s),t.moveTo(e,-i),c=e+Math.cos(l)*this.game.width,u=i+Math.sin(l)*this.game.height,t.lineTo(c,-u),t.moveTo(e,-i),c=e+Math.cos(l)*-this.game.width,u=i+Math.sin(l)*-this.game.height,t.lineTo(c,-u)},drawCapsule:function(t,e,i,s,n,r,o,a,h){void 0===h&&(h=1),void 0===o&&(o=0),t.lineStyle(h,o,1);var l=Math.cos(s),c=Math.sin(s);t.beginFill(a,1),t.drawCircle(-n/2*l+e,-n/2*c+i,2*-r),t.drawCircle(n/2*l+e,n/2*c+i,2*-r),t.endFill(),t.lineStyle(h,o,0),t.beginFill(a,1),t.moveTo(-n/2*l+r*c+e,-n/2*c+r*l+i),t.lineTo(n/2*l+r*c+e,n/2*c+r*l+i),t.lineTo(n/2*l-r*c+e,n/2*c-r*l+i),t.lineTo(-n/2*l-r*c+e,-n/2*c-r*l+i),t.endFill(),t.lineStyle(h,o,1),t.moveTo(-n/2*l+r*c+e,-n/2*c+r*l+i),t.lineTo(n/2*l+r*c+e,n/2*c+r*l+i),t.moveTo(-n/2*l-r*c+e,-n/2*c-r*l+i),t.lineTo(n/2*l-r*c+e,n/2*c-r*l+i)},randomPastelHex:function(){var t,e,i,s;return i=[255,255,255],s=Math.floor(256*Math.random()),e=Math.floor(256*Math.random()),t=Math.floor(256*Math.random()),s=Math.floor((s+3*i[0])/4),e=Math.floor((e+3*i[1])/4),t=Math.floor((t+3*i[2])/4),this.rgbToHex(s,e,t)},rgbToHex:function(t,e,i){return this.componentToHex(t)+this.componentToHex(e)+this.componentToHex(i)},componentToHex:function(t){var e;return 2===(e=t.toString(16)).length?e:e+"0"}}),e.Physics.P2.Spring=function(t,e,i,s,n,r,o,a,h,l){this.game=t.game,this.world=t,void 0===s&&(s=1),void 0===n&&(n=100),void 0===r&&(r=1);var c={restLength:s=t.pxm(s),stiffness:n,damping:r};void 0!==o&&null!==o&&(c.worldAnchorA=[t.pxm(o[0]),t.pxm(o[1])]),void 0!==a&&null!==a&&(c.worldAnchorB=[t.pxm(a[0]),t.pxm(a[1])]),void 0!==h&&null!==h&&(c.localAnchorA=[t.pxm(h[0]),t.pxm(h[1])]),void 0!==l&&null!==l&&(c.localAnchorB=[t.pxm(l[0]),t.pxm(l[1])]),this.data=new p2.LinearSpring(e,i,c),this.data.parent=this},e.Physics.P2.Spring.prototype.constructor=e.Physics.P2.Spring,e.Physics.P2.RotationalSpring=function(t,e,i,s,n,r){this.game=t.game,this.world=t,void 0===s&&(s=null),void 0===n&&(n=100),void 0===r&&(r=1),s&&(s=t.pxm(s));var o={restAngle:s,stiffness:n,damping:r};this.data=new p2.RotationalSpring(e,i,o),this.data.parent=this},e.Physics.P2.Spring.prototype.constructor=e.Physics.P2.Spring,e.Physics.P2.Material=function(t){this.name=t,p2.Material.call(this)},e.Physics.P2.Material.prototype=Object.create(p2.Material.prototype),e.Physics.P2.Material.prototype.constructor=e.Physics.P2.Material,e.Physics.P2.ContactMaterial=function(t,e,i){p2.ContactMaterial.call(this,t,e,i)},e.Physics.P2.ContactMaterial.prototype=Object.create(p2.ContactMaterial.prototype),e.Physics.P2.ContactMaterial.prototype.constructor=e.Physics.P2.ContactMaterial,e.Physics.P2.CollisionGroup=function(t){this.mask=t},e.Physics.P2.DistanceConstraint=function(t,e,i,s,n,r,o){void 0===s&&(s=100),void 0===n&&(n=[0,0]),void 0===r&&(r=[0,0]),void 0===o&&(o=Number.MAX_VALUE),this.game=t.game,this.world=t;var a={distance:s=t.pxm(s),localAnchorA:n=[t.pxmi(n[0]),t.pxmi(n[1])],localAnchorB:r=[t.pxmi(r[0]),t.pxmi(r[1])],maxForce:o};p2.DistanceConstraint.call(this,e,i,a)},e.Physics.P2.DistanceConstraint.prototype=Object.create(p2.DistanceConstraint.prototype),e.Physics.P2.DistanceConstraint.prototype.constructor=e.Physics.P2.DistanceConstraint,e.Physics.P2.GearConstraint=function(t,e,i,s,n){void 0===s&&(s=0),void 0===n&&(n=1),this.game=t.game,this.world=t;var r={angle:s,ratio:n};p2.GearConstraint.call(this,e,i,r)},e.Physics.P2.GearConstraint.prototype=Object.create(p2.GearConstraint.prototype),e.Physics.P2.GearConstraint.prototype.constructor=e.Physics.P2.GearConstraint,e.Physics.P2.LockConstraint=function(t,e,i,s,n,r){void 0===s&&(s=[0,0]),void 0===n&&(n=0),void 0===r&&(r=Number.MAX_VALUE),this.game=t.game,this.world=t;var o={localOffsetB:s=[t.pxm(s[0]),t.pxm(s[1])],localAngleB:n,maxForce:r};p2.LockConstraint.call(this,e,i,o)},e.Physics.P2.LockConstraint.prototype=Object.create(p2.LockConstraint.prototype),e.Physics.P2.LockConstraint.prototype.constructor=e.Physics.P2.LockConstraint,e.Physics.P2.PrismaticConstraint=function(t,e,i,s,n,r,o,a){void 0===s&&(s=!0),void 0===n&&(n=[0,0]),void 0===r&&(r=[0,0]),void 0===o&&(o=[0,0]),void 0===a&&(a=Number.MAX_VALUE),this.game=t.game,this.world=t;var h={localAnchorA:n=[t.pxmi(n[0]),t.pxmi(n[1])],localAnchorB:r=[t.pxmi(r[0]),t.pxmi(r[1])],localAxisA:o,maxForce:a,disableRotationalLock:!s};p2.PrismaticConstraint.call(this,e,i,h)},e.Physics.P2.PrismaticConstraint.prototype=Object.create(p2.PrismaticConstraint.prototype),e.Physics.P2.PrismaticConstraint.prototype.constructor=e.Physics.P2.PrismaticConstraint,e.Physics.P2.RevoluteConstraint=function(t,e,i,s,n,r,o){void 0===r&&(r=Number.MAX_VALUE),void 0===o&&(o=null),this.game=t.game,this.world=t,i=[t.pxmi(i[0]),t.pxmi(i[1])],n=[t.pxmi(n[0]),t.pxmi(n[1])],o&&(o=[t.pxmi(o[0]),t.pxmi(o[1])]);var a={worldPivot:o,localPivotA:i,localPivotB:n,maxForce:r};p2.RevoluteConstraint.call(this,e,s,a)},e.Physics.P2.RevoluteConstraint.prototype=Object.create(p2.RevoluteConstraint.prototype),e.Physics.P2.RevoluteConstraint.prototype.constructor=e.Physics.P2.RevoluteConstraint,e.ImageCollection=function(t,e,i,s,n,r,o){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===n&&(n=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|s,this.imageMargin=0|n,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},e.ImageCollection.prototype={containsImageIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},addImage:function(t,e){this.images.push({gid:t,image:e}),this.total++}},e.ImageCollection.prototype.constructor=e.ImageCollection,e.Tile=function(t,e,i,s,n,r){this.layer=t,this.index=e,this.x=i,this.y=s,this.rotation=0,this.flipped=!1,this.worldX=i*n,this.worldY=s*r,this.width=n,this.height=r,this.centerX=Math.abs(n/2),this.centerY=Math.abs(r/2),this.alpha=1,this.properties={},this.scanned=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.collisionCallback=null,this.collisionCallbackContext=this,this.debug=!1},e.Tile.prototype={containsPoint:function(t,e){return!(t<this.worldX||e<this.worldY||t>this.right||e>this.bottom)},intersects:function(t,e,i,s){return!(i<=this.worldX)&&(!(s<=this.worldY)&&(!(t>=this.worldX+this.width)&&!(e>=this.worldY+this.height)))},setCollisionCallback:function(t,e){this.collisionCallback=t,this.collisionCallbackContext=e},destroy:function(){this.collisionCallback=null,this.collisionCallbackContext=null,this.properties=null},setCollision:function(t,e,i,s){this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s},resetCollision:function(){this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1},isInteresting:function(t,e){return t&&e?this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.faceTop||this.faceBottom||this.faceLeft||this.faceRight||this.collisionCallback:t?this.collideLeft||this.collideRight||this.collideUp||this.collideDown:!!e&&(this.faceTop||this.faceBottom||this.faceLeft||this.faceRight)},copy:function(t){this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext}},e.Tile.prototype.constructor=e.Tile,Object.defineProperty(e.Tile.prototype,"collides",{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}}),Object.defineProperty(e.Tile.prototype,"canCollide",{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}}),Object.defineProperty(e.Tile.prototype,"left",{get:function(){return this.worldX}}),Object.defineProperty(e.Tile.prototype,"right",{get:function(){return this.worldX+this.width}}),Object.defineProperty(e.Tile.prototype,"top",{get:function(){return this.worldY}}),Object.defineProperty(e.Tile.prototype,"bottom",{get:function(){return this.worldY+this.height}}),e.Tilemap=function(t,i,s,n,r,o){this.game=t,this.key=i;var a=e.TilemapParser.parse(this.game,i,s,n,r,o);null!==a&&(this.width=a.width,this.height=a.height,this.tileWidth=a.tileWidth,this.tileHeight=a.tileHeight,this.orientation=a.orientation,this.format=a.format,this.version=a.version,this.properties=a.properties,this.widthInPixels=a.widthInPixels,this.heightInPixels=a.heightInPixels,this.layers=a.layers,this.tilesets=a.tilesets,this.imagecollections=a.imagecollections,this.tiles=a.tiles,this.objects=a.objects,this.collideIndexes=[],this.collision=a.collision,this.images=a.images,this.enableDebug=!1,this.currentLayer=0,this.debugMap=[],this._results=[],this._tempA=0,this._tempB=0)},e.Tilemap.CSV=0,e.Tilemap.TILED_JSON=1,e.Tilemap.NORTH=0,e.Tilemap.EAST=1,e.Tilemap.SOUTH=2,e.Tilemap.WEST=3,e.Tilemap.prototype={create:function(t,e,i,s,n,r){return void 0===r&&(r=this.game.world),this.width=e,this.height=i,this.setTileSize(s,n),this.layers.length=0,this.createBlankLayer(t,e,i,s,n,r)},setTileSize:function(t,e){this.tileWidth=t,this.tileHeight=e,this.widthInPixels=this.width*t,this.heightInPixels=this.height*e},addTilesetImage:function(t,i,s,n,r,o,a){if(void 0===t)return null;void 0===s&&(s=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=0),0===s&&(s=32),0===n&&(n=32);var h=null;if(void 0!==i&&null!==i||(i=t),i instanceof e.BitmapData)h=i.canvas;else{if(!this.game.cache.checkImageKey(i))return console.warn('Phaser.Tilemap.addTilesetImage: Invalid image key given: "'+i+'"'),null;h=this.game.cache.getImage(i)}var l=this.getTilesetIndex(t);if(null===l&&this.format===e.Tilemap.TILED_JSON)return console.warn('Phaser.Tilemap.addTilesetImage: No data found in the JSON matching the tileset name: "'+t+'"'),console.log("Tilesets: ",this.tilesets),null;if(this.tilesets[l])return this.tilesets[l].setImage(h),this.tilesets[l];var c=new e.Tileset(t,a,s,n,r,o,{});c.setImage(h),this.tilesets.push(c);for(var u=this.tilesets.length-1,d=r,p=r,f=0,g=0,m=0,y=a;y<a+c.total&&(this.tiles[y]=[d,p,u],d+=s+o,++f!==c.total)&&(++g!==c.columns||(d=r,p+=n+o,g=0,++m!==c.rows));y++);return c},createFromObjects:function(t,i,s,n,r,o,a,h,l,c){if(void 0===r&&(r=!0),void 0===o&&(o=!1),void 0===a&&(a=this.game.world),void 0===h&&(h=e.Sprite),void 0===l&&(l=!0),void 0===c&&(c=!0),!this.objects[t])return console.warn("Tilemap.createFromObjects: Invalid objectgroup name given: "+t),void console.log("Objects: ",this.objects);for(var u=0;u<this.objects[t].length;u++){var d=!1,p=this.objects[t][u];if(void 0!==p.gid&&"number"==typeof i&&p.gid===i?d=!0:void 0!==p.id&&"number"==typeof i&&p.id===i?d=!0:void 0!==p.name&&"string"==typeof i&&p.name===i&&(d=!0),d){var f=new h(this.game,parseFloat(p.x,10),parseFloat(p.y,10),s,n);f.name=p.name,f.autoCull=o,f.exists=r,f.visible=p.visible,c&&(p.width&&(f.width=p.width),p.height&&(f.height=p.height)),p.rotation&&(f.angle=p.rotation),l&&(f.y-=f.height),a.add(f);for(var g in p.properties)a.set(f,g,p.properties[g],!1,!1,0,!0)}}},createFromTiles:function(t,i,s,n,r,o){"number"==typeof t&&(t=[t]),void 0===i||null===i?i=[]:"number"==typeof i&&(i=[i]),n=this.getLayer(n),void 0===r&&(r=this.game.world),void 0===o&&(o={}),void 0===o.customClass&&(o.customClass=e.Sprite),void 0===o.adjustY&&(o.adjustY=!0);var a=this.layers[n].width,h=this.layers[n].height;if(this.copy(0,0,a,h,n),this._results.length<2)return 0;for(var l,c=0,u=1,d=this._results.length;u<d;u++)if(-1!==t.indexOf(this._results[u].index)){l=new o.customClass(this.game,this._results[u].worldX,this._results[u].worldY,s);for(var p in o)l[p]=o[p];r.add(l),c++}if(1===i.length)for(u=0;u<t.length;u++)this.replace(t[u],i[0],0,0,a,h,n);else if(i.length>1)for(u=0;u<t.length;u++)this.replace(t[u],i[u],0,0,a,h,n);return c},createLayer:function(t,i,s,n){void 0===i&&(i=this.game.width),void 0===s&&(s=this.game.height),void 0===n&&(n=this.game.world);var r=t;if("string"==typeof t&&(r=this.getLayerIndex(t)),null===r||r>this.layers.length)return console.warn('Tilemap.createLayer: Invalid layer ID given: "'+t+'"'),void console.log("Layers: ",this.layers);void 0===i||i<=0?i=Math.min(this.game.width,this.layers[r].widthInPixels):i>this.game.width&&(i=this.game.width),void 0===s||s<=0?s=Math.min(this.game.height,this.layers[r].heightInPixels):s>this.game.height&&(s=this.game.height),this.enableDebug&&(console.group("Tilemap.createLayer"),console.log("Name:",this.layers[r].name),console.log("Size:",i,"x",s),console.log("Tileset:",this.tilesets[0].name,"index:",r));var o=n.add(new e.TilemapLayer(this.game,this,r,i,s));return this.enableDebug&&console.groupEnd(),o},createBlankLayer:function(t,i,s,n,r,o){void 0===o&&(o=this.game.world);{if(null===this.getLayerIndex(t)){for(var a,h={name:t,x:0,y:0,width:i,height:s,widthInPixels:i*n,heightInPixels:s*r,alpha:1,visible:!0,properties:{},indexes:[],callbacks:[],bodies:[],data:null},l=[],c=0;c<s;c++){a=[];for(var u=0;u<i;u++)a.push(new e.Tile(h,-1,u,c,n,r));l.push(a)}h.data=l,this.layers.push(h),this.currentLayer=this.layers.length-1;var d=h.widthInPixels,p=h.heightInPixels;return d>this.game.width&&(d=this.game.width),p>this.game.height&&(p=this.game.height),(l=new e.TilemapLayer(this.game,this,this.layers.length-1,d,p)).name=t,o.add(l)}console.warn("Tilemap.createBlankLayer: Layer with matching name already exists: "+t)}},getIndex:function(t,e){for(var i=0;i<t.length;i++)if(t[i].name===e)return i;return null},getLayerIndex:function(t){return this.getIndex(this.layers,t)},getTilesetIndex:function(t){return this.getIndex(this.tilesets,t)},getImageIndex:function(t){return this.getIndex(this.images,t)},setTileIndexCallback:function(t,e,i,s){if(s=this.getLayer(s),"number"==typeof t)null===e?delete this.layers[s].callbacks[t]:this.layers[s].callbacks[t]={callback:e,callbackContext:i};else for(var n=0,r=t.length;n<r;n++)null===e?delete this.layers[s].callbacks[t[n]]:this.layers[s].callbacks[t[n]]={callback:e,callbackContext:i}},setTileLocationCallback:function(t,e,i,s,n,r,o){if(o=this.getLayer(o),this.copy(t,e,i,s,o),!(this._results.length<2))for(var a=1;a<this._results.length;a++)this._results[a].setCollisionCallback(n,r)},setCollision:function(t,e,i,s){if(void 0===e&&(e=!0),void 0===s&&(s=!0),i=this.getLayer(i),"number"==typeof t)return this.setCollisionByIndex(t,e,i,!0);if(Array.isArray(t)){for(var n=0;n<t.length;n++)this.setCollisionByIndex(t[n],e,i,!1);s&&this.calculateFaces(i)}},setCollisionBetween:function(t,e,i,s,n){if(void 0===i&&(i=!0),void 0===n&&(n=!0),s=this.getLayer(s),!(t>e)){for(var r=t;r<=e;r++)this.setCollisionByIndex(r,i,s,!1);n&&this.calculateFaces(s)}},setCollisionByExclusion:function(t,e,i,s){void 0===e&&(e=!0),void 0===s&&(s=!0),i=this.getLayer(i);for(var n=0,r=this.tiles.length;n<r;n++)-1===t.indexOf(n)&&this.setCollisionByIndex(n,e,i,!1);s&&this.calculateFaces(i)},setCollisionByIndex:function(t,e,i,s){if(void 0===e&&(e=!0),void 0===i&&(i=this.currentLayer),void 0===s&&(s=!0),e)this.collideIndexes.push(t);else{var n=this.collideIndexes.indexOf(t);n>-1&&this.collideIndexes.splice(n,1)}for(var r=0;r<this.layers[i].height;r++)for(var o=0;o<this.layers[i].width;o++){var a=this.layers[i].data[r][o];a&&a.index===t&&(e?a.setCollision(!0,!0,!0,!0):a.resetCollision(),a.faceTop=e,a.faceBottom=e,a.faceLeft=e,a.faceRight=e)}return s&&this.calculateFaces(i),i},getLayer:function(t){if(void 0===t)t=this.currentLayer;else if("string"==typeof t){var i=t;null===(t=this.getLayerIndex(t))&&console.warn("No such layer name: "+i)}else t instanceof e.TilemapLayer&&(t=t.index);return t},setPreventRecalculate:function(t){if(!0===t&&!0!==this.preventingRecalculate&&(this.preventingRecalculate=!0,this.needToRecalculate={}),!1===t&&!0===this.preventingRecalculate){this.preventingRecalculate=!1;for(var e in this.needToRecalculate)this.calculateFaces(e);this.needToRecalculate=!1}},calculateFaces:function(t){if(this.preventingRecalculate)this.needToRecalculate[t]=!0;else for(var e=null,i=null,s=null,n=null,r=0,o=this.layers[t].height;r<o;r++)for(var a=0,h=this.layers[t].width;a<h;a++){var l=this.layers[t].data[r][a];l&&(e=this.getTileAbove(t,a,r),i=this.getTileBelow(t,a,r),s=this.getTileLeft(t,a,r),n=this.getTileRight(t,a,r),l.collides&&(l.faceTop=!0,l.faceBottom=!0,l.faceLeft=!0,l.faceRight=!0),e&&e.collides&&(l.faceTop=!1),i&&i.collides&&(l.faceBottom=!1),s&&s.collides&&(l.faceLeft=!1),n&&n.collides&&(l.faceRight=!1))}},getTileAbove:function(t,e,i){return i>0?this.layers[t].data[i-1][e]:null},getTileBelow:function(t,e,i){return i<this.layers[t].height-1?this.layers[t].data[i+1][e]:null},getTileLeft:function(t,e,i){return e>0?this.layers[t].data[i][e-1]:null},getTileRight:function(t,e,i){return e<this.layers[t].width-1?this.layers[t].data[i][e+1]:null},setLayer:function(t){t=this.getLayer(t),this.layers[t]&&(this.currentLayer=t)},hasTile:function(t,e,i){return i=this.getLayer(i),void 0!==this.layers[i].data[e]&&void 0!==this.layers[i].data[e][t]&&this.layers[i].data[e][t].index>-1},removeTile:function(t,i,s){if(s=this.getLayer(s),t>=0&&t<this.layers[s].width&&i>=0&&i<this.layers[s].height&&this.hasTile(t,i,s)){var n=this.layers[s].data[i][t];return this.layers[s].data[i][t]=new e.Tile(this.layers[s],-1,t,i,this.tileWidth,this.tileHeight),this.layers[s].dirty=!0,this.calculateFaces(s),n}},removeTileWorldXY:function(t,e,i,s,n){return n=this.getLayer(n),t=this.game.math.snapToFloor(t,i)/i,e=this.game.math.snapToFloor(e,s)/s,this.removeTile(t,e,n)},putTile:function(t,i,s,n){if(null===t)return this.removeTile(i,s,n);if(n=this.getLayer(n),i>=0&&i<this.layers[n].width&&s>=0&&s<this.layers[n].height){var r;return t instanceof e.Tile?(r=t.index,this.hasTile(i,s,n)?this.layers[n].data[s][i].copy(t):this.layers[n].data[s][i]=new e.Tile(n,r,i,s,t.width,t.height)):(r=t,this.hasTile(i,s,n)?this.layers[n].data[s][i].index=r:this.layers[n].data[s][i]=new e.Tile(this.layers[n],r,i,s,this.tileWidth,this.tileHeight)),this.collideIndexes.indexOf(r)>-1?this.layers[n].data[s][i].setCollision(!0,!0,!0,!0):this.layers[n].data[s][i].resetCollision(),this.layers[n].dirty=!0,this.calculateFaces(n),this.layers[n].data[s][i]}return null},putTileWorldXY:function(t,e,i,s,n,r){return r=this.getLayer(r),e=this.game.math.snapToFloor(e,s)/s,i=this.game.math.snapToFloor(i,n)/n,this.putTile(t,e,i,r)},searchTileIndex:function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=!1),s=this.getLayer(s);var n=0;if(i){for(r=this.layers[s].height-1;r>=0;r--)for(o=this.layers[s].width-1;o>=0;o--)if(this.layers[s].data[r][o].index===t){if(n===e)return this.layers[s].data[r][o];n++}}else for(var r=0;r<this.layers[s].height;r++)for(var o=0;o<this.layers[s].width;o++)if(this.layers[s].data[r][o].index===t){if(n===e)return this.layers[s].data[r][o];n++}return null},getTile:function(t,e,i,s){return void 0===s&&(s=!1),i=this.getLayer(i),t>=0&&t<this.layers[i].width&&e>=0&&e<this.layers[i].height?-1===this.layers[i].data[e][t].index?s?this.layers[i].data[e][t]:null:this.layers[i].data[e][t]:null},getTileWorldXY:function(t,e,i,s,n,r){return void 0===i&&(i=this.tileWidth),void 0===s&&(s=this.tileHeight),n=this.getLayer(n),t=this.game.math.snapToFloor(t,i)/i,e=this.game.math.snapToFloor(e,s)/s,this.getTile(t,e,n,r)},copy:function(t,e,i,s,n){n=this.getLayer(n);{if(this.layers[n]){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.layers[n].width),void 0===s&&(s=this.layers[n].height),t<0&&(t=0),e<0&&(e=0),i>this.layers[n].width&&(i=this.layers[n].width),s>this.layers[n].height&&(s=this.layers[n].height),this._results.length=0,this._results.push({x:t,y:e,width:i,height:s,layer:n});for(var r=e;r<e+s;r++)for(var o=t;o<t+i;o++)this._results.push(this.layers[n].data[r][o]);return this._results}this._results.length=0}},paste:function(t,e,i,s){if(void 0===t&&(t=0),void 0===e&&(e=0),s=this.getLayer(s),i&&!(i.length<2)){for(var n=t-i[1].x,r=e-i[1].y,o=1;o<i.length;o++)this.layers[s].data[r+i[o].y][n+i[o].x].copy(i[o]);this.layers[s].dirty=!0,this.calculateFaces(s)}},swap:function(t,e,i,s,n,r,o){o=this.getLayer(o),this.copy(i,s,n,r,o),this._results.length<2||(this._tempA=t,this._tempB=e,this._results.forEach(this.swapHandler,this),this.paste(i,s,this._results,o))},swapHandler:function(t){t.index===this._tempA?t.index=this._tempB:t.index===this._tempB&&(t.index=this._tempA)},forEach:function(t,e,i,s,n,r,o){o=this.getLayer(o),this.copy(i,s,n,r,o),this._results.length<2||(this._results.forEach(t,e),this.paste(i,s,this._results,o))},replace:function(t,e,i,s,n,r,o){if(o=this.getLayer(o),this.copy(i,s,n,r,o),!(this._results.length<2)){for(var a=1;a<this._results.length;a++)this._results[a].index===t&&(this._results[a].index=e);this.paste(i,s,this._results,o)}},random:function(t,e,i,s,n){if(n=this.getLayer(n),this.copy(t,e,i,s,n),!(this._results.length<2)){for(var r=[],o=1;o<this._results.length;o++)if(this._results[o].index){var a=this._results[o].index;-1===r.indexOf(a)&&r.push(a)}for(var h=1;h<this._results.length;h++)this._results[h].index=this.game.rnd.pick(r);this.paste(t,e,this._results,n)}},shuffle:function(t,i,s,n,r){if(r=this.getLayer(r),this.copy(t,i,s,n,r),!(this._results.length<2)){for(var o=[],a=1;a<this._results.length;a++)this._results[a].index&&o.push(this._results[a].index);e.ArrayUtils.shuffle(o);for(var h=1;h<this._results.length;h++)this._results[h].index=o[h-1];this.paste(t,i,this._results,r)}},fill:function(t,e,i,s,n,r){if(r=this.getLayer(r),this.copy(e,i,s,n,r),!(this._results.length<2)){for(var o=1;o<this._results.length;o++)this._results[o].index=t;this.paste(e,i,this._results,r)}},removeAllLayers:function(){this.layers.length=0,this.currentLayer=0},dump:function(){for(var t="",e=[""],i=0;i<this.layers[this.currentLayer].height;i++){for(var s=0;s<this.layers[this.currentLayer].width;s++)t+="%c ",this.layers[this.currentLayer].data[i][s]>1?this.debugMap[this.layers[this.currentLayer].data[i][s]]?e.push("background: "+this.debugMap[this.layers[this.currentLayer].data[i][s]]):e.push("background: #ffffff"):e.push("background: rgb(0, 0, 0)");t+="\n"}e[0]=t,console.log.apply(console,e)},destroy:function(){this.removeAllLayers(),this.data=[],this.game=null}},e.Tilemap.prototype.constructor=e.Tilemap,Object.defineProperty(e.Tilemap.prototype,"layer",{get:function(){return this.layers[this.currentLayer]},set:function(t){t!==this.currentLayer&&this.setLayer(t)}}),e.TilemapLayer=function(t,i,s,n,r){n|=0,r|=0,e.Sprite.call(this,t,0,0),this.map=i,this.index=s,this.layer=i.layers[s],this.canvas=e.CanvasPool.create(this,n,r),this.context=this.canvas.getContext("2d"),this.setTexture(new PIXI.Texture(new PIXI.BaseTexture(this.canvas,null,this.game.resolution))),this.type=e.TILEMAPLAYER,this.physicsType=e.TILEMAPLAYER,this.renderSettings={enableScrollDelta:!0,overdrawRatio:.2,copyCanvas:null},this.debug=!1,this.exists=!0,this.debugSettings={missingImageFill:"rgb(255,255,255)",debuggedTileOverfill:"rgba(0,255,0,0.4)",forceFullRedraw:!0,debugAlpha:.5,facingEdgeStroke:"rgba(0,255,0,1)",collidingTileOverfill:"rgba(0,255,0,0.2)"},this.scrollFactorX=1,this.scrollFactorY=1,this.dirty=!0,this.rayStepRate=4,this._wrap=!1,this._mc={scrollX:0,scrollY:0,renderWidth:0,renderHeight:0,tileWidth:i.tileWidth,tileHeight:i.tileHeight,cw:i.tileWidth,ch:i.tileHeight,tilesets:[]},this._scrollX=0,this._scrollY=0,this.tileOffset=new e.Point(this.layer.offsetX||0,this.layer.offsetY||0),this._results=[],t.device.canvasBitBltShift||(this.renderSettings.copyCanvas=e.TilemapLayer.ensureSharedCopyCanvas()),this.fixedToCamera=!0},e.TilemapLayer.prototype=Object.create(e.Sprite.prototype),e.TilemapLayer.prototype.constructor=e.TilemapLayer,e.TilemapLayer.prototype.preUpdateCore=e.Component.Core.preUpdate,e.TilemapLayer.sharedCopyCanvas=null,e.TilemapLayer.ensureSharedCopyCanvas=function(){return this.sharedCopyCanvas||(this.sharedCopyCanvas=e.CanvasPool.create(this,2,2)),this.sharedCopyCanvas},e.TilemapLayer.prototype.preUpdate=function(){return this.preUpdateCore()},e.TilemapLayer.prototype.postUpdate=function(){this.fixedToCamera&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y),this._scrollX=(this.game.camera.view.x-this.tileOffset.x)*this.scrollFactorX/this.scale.x,this._scrollY=(this.game.camera.view.y-this.tileOffset.y)*this.scrollFactorY/this.scale.y},e.TilemapLayer.prototype._renderCanvas=function(t){this.fixedToCamera&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y),this._scrollX=(this.game.camera.view.x-this.tileOffset.x)*this.scrollFactorX/this.scale.x,this._scrollY=(this.game.camera.view.y-this.tileOffset.y)*this.scrollFactorY/this.scale.y,this.render(),PIXI.Sprite.prototype._renderCanvas.call(this,t)},e.TilemapLayer.prototype._renderWebGL=function(t){this.fixedToCamera&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y),this._scrollX=(this.game.camera.view.x-this.tileOffset.x)*this.scrollFactorX/this.scale.x,this._scrollY=(this.game.camera.view.y-this.tileOffset.y)*this.scrollFactorY/this.scale.y,this.render(),PIXI.Sprite.prototype._renderWebGL.call(this,t)},e.TilemapLayer.prototype.destroy=function(){e.CanvasPool.remove(this),e.Component.Destroy.prototype.destroy.call(this)},e.TilemapLayer.prototype.resize=function(t,e){this.canvas.width=t,this.canvas.height=e,this.texture.frame.resize(t,e),this.texture.width=t,this.texture.height=e,this.texture.crop.width=t,this.texture.crop.height=e,this.texture.baseTexture.width=t,this.texture.baseTexture.height=e,this.texture.baseTexture.dirty(),this.texture.requiresUpdate=!0,this.texture._updateUvs(),this.dirty=!0},e.TilemapLayer.prototype.resizeWorld=function(){this.game.world.setBounds(0,0,this.layer.widthInPixels*this.scale.x,this.layer.heightInPixels*this.scale.y)},e.TilemapLayer.prototype.getTileOffsetX=function(){return this.tileOffset.x||(this.fixedToCamera?0:this.position.x)},e.TilemapLayer.prototype.getTileOffsetY=function(){return this.tileOffset.y||(this.fixedToCamera?0:this.position.y)},e.TilemapLayer.prototype._fixX=function(t){return 1===this.scrollFactorX||0===this.scrollFactorX&&0===this.position.x?t:0===this.scrollFactorX&&0!==this.position.x?t-this.position.x:this._scrollX+(t-this._scrollX/this.scrollFactorX)},e.TilemapLayer.prototype._unfixX=function(t){return 1===this.scrollFactorX?t:this._scrollX/this.scrollFactorX+(t-this._scrollX)},e.TilemapLayer.prototype._fixY=function(t){return 1===this.scrollFactorY||0===this.scrollFactorY&&0===this.position.y?t:0===this.scrollFactorY&&0!==this.position.y?t-this.position.y:this._scrollY+(t-this._scrollY/this.scrollFactorY)},e.TilemapLayer.prototype._unfixY=function(t){return 1===this.scrollFactorY?t:this._scrollY/this.scrollFactorY+(t-this._scrollY)},e.TilemapLayer.prototype.getTileX=function(t){return Math.floor(this._fixX(t)/this._mc.tileWidth)},e.TilemapLayer.prototype.getTileY=function(t){return Math.floor(this._fixY(t)/this._mc.tileHeight)},e.TilemapLayer.prototype.getTileXY=function(t,e,i){return i.x=this.getTileX(t),i.y=this.getTileY(e),i},e.TilemapLayer.prototype.getRayCastTiles=function(t,e,i,s){e||(e=this.rayStepRate),void 0===i&&(i=!1),void 0===s&&(s=!1);var n=this.getTiles(t.x,t.y,t.width,t.height,i,s);if(0===n.length)return[];for(var r=t.coordinatesOnLine(e),o=[],a=0;a<n.length;a++)for(var h=0;h<r.length;h++){var l=n[a],c=r[h];if(l.containsPoint(c[0],c[1])){o.push(l);break}}return o},e.TilemapLayer.prototype.getTiles=function(t,e,i,s,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1);var o=!(n||r);t=this._fixX(t),e=this._fixY(e);for(var a=Math.floor(t/(this._mc.cw*this.scale.x)),h=Math.floor(e/(this._mc.ch*this.scale.y)),l=Math.ceil((t+i)/(this._mc.cw*this.scale.x))-a,c=Math.ceil((e+s)/(this._mc.ch*this.scale.y))-h;this._results.length;)this._results.pop();for(var u=h;u<h+c;u++)for(var d=a;d<a+l;d++){var p=this.layer.data[u];p&&p[d]&&(o||p[d].isInteresting(n,r))&&this._results.push(p[d])}return this._results.slice()},e.TilemapLayer.prototype.resolveTileset=function(t){var e=this._mc.tilesets;if(t<2e3)for(;e.length<t;)e.push(void 0);var i=this.map.tiles[t]&&this.map.tiles[t][2];if(null!==i){var s=this.map.tilesets[i];if(s&&s.containsTileIndex(t))return e[t]=s}return e[t]=null},e.TilemapLayer.prototype.resetTilesetCache=function(){for(var t=this._mc.tilesets;t.length;)t.pop()},e.TilemapLayer.prototype.setScale=function(t,e){t=t||1,e=e||t;for(var i=0;i<this.layer.data.length;i++)for(var s=this.layer.data[i],n=0;n<s.length;n++){var r=s[n];r.width=this.map.tileWidth*t,r.height=this.map.tileHeight*e,r.worldX=r.x*r.width,r.worldY=r.y*r.height}this.scale.setTo(t,e)},e.TilemapLayer.prototype.shiftCanvas=function(t,e,i){var s=t.canvas,n=s.width-Math.abs(e),r=s.height-Math.abs(i),o=0,a=0,h=e,l=i;e<0&&(o=-e,h=0),i<0&&(a=-i,l=0);var c=this.renderSettings.copyCanvas;if(c){(c.width<n||c.height<r)&&(c.width=n,c.height=r);var u=c.getContext("2d");u.clearRect(0,0,n,r),u.drawImage(s,o,a,n,r,0,0,n,r),t.clearRect(h,l,n,r),t.drawImage(c,0,0,n,r,h,l,n,r)}else t.save(),t.globalCompositeOperation="copy",t.drawImage(s,o,a,n,r,h,l,n,r),t.restore()},e.TilemapLayer.prototype.renderRegion=function(t,e,i,s,n,r){var o=this.context,a=this.layer.width,h=this.layer.height,l=this._mc.tileWidth,c=this._mc.tileHeight,u=this._mc.tilesets,d=NaN;this._wrap||(i<=n&&(i=Math.max(0,i),n=Math.min(a-1,n)),s<=r&&(s=Math.max(0,s),r=Math.min(h-1,r)));var p,f,g,m,y,v,x=i*l-t,b=(i+(1<<20)*a)%a;for(m=(s+(1<<20)*h)%h,v=r-s,f=s*c-e;v>=0;m++,v--,f+=c){m>=h&&(m-=h);var _=this.layer.data[m];for(g=b,y=n-i,p=x;y>=0;g++,y--,p+=l){g>=a&&(g-=a);var w=_[g];if(w&&!(w.index<0)){var T=w.index,P=u[T];void 0===P&&(P=this.resolveTileset(T)),w.alpha===d||this.debug||(o.globalAlpha=w.alpha,d=w.alpha),P?w.rotation||w.flipped?(o.save(),o.translate(p+w.centerX,f+w.centerY),o.rotate(w.rotation),w.flipped&&o.scale(-1,1),P.draw(o,-w.centerX,-w.centerY,T),o.restore()):P.draw(o,p,f,T):this.debugSettings.missingImageFill&&(o.fillStyle=this.debugSettings.missingImageFill,o.fillRect(p,f,l,c)),w.debug&&this.debugSettings.debuggedTileOverfill&&(o.fillStyle=this.debugSettings.debuggedTileOverfill,o.fillRect(p,f,l,c))}}}},e.TilemapLayer.prototype.renderDeltaScroll=function(t,e){var i=this._mc.scrollX,s=this._mc.scrollY,n=this.canvas.width,r=this.canvas.height,o=this._mc.tileWidth,a=this._mc.tileHeight,h=0,l=-o,c=0,u=-a;if(t<0?(h=n+t,l=n-1):t>0&&(l=t),e<0?(c=r+e,u=r-1):e>0&&(u=e),this.shiftCanvas(this.context,t,e),h=Math.floor((h+i)/o),l=Math.floor((l+i)/o),c=Math.floor((c+s)/a),u=Math.floor((u+s)/a),h<=l){this.context.clearRect(h*o-i,0,(l-h+1)*o,r);var d=Math.floor((0+s)/a),p=Math.floor((r-1+s)/a);this.renderRegion(i,s,h,d,l,p)}if(c<=u){this.context.clearRect(0,c*a-s,n,(u-c+1)*a);var f=Math.floor((0+i)/o),g=Math.floor((n-1+i)/o);this.renderRegion(i,s,f,c,g,u)}},e.TilemapLayer.prototype.renderFull=function(){var t=this._mc.scrollX,e=this._mc.scrollY,i=this.canvas.width,s=this.canvas.height,n=this._mc.tileWidth,r=this._mc.tileHeight,o=Math.floor(t/n),a=Math.floor((i-1+t)/n),h=Math.floor(e/r),l=Math.floor((s-1+e)/r);this.context.clearRect(0,0,i,s),this.renderRegion(t,e,o,h,a,l)},e.TilemapLayer.prototype.render=function(){var t=!1;if(this.visible){(this.dirty||this.layer.dirty)&&(this.layer.dirty=!1,t=!0);var e=this.canvas.width,i=this.canvas.height,s=0|this._scrollX,n=0|this._scrollY,r=this._mc,o=r.scrollX-s,a=r.scrollY-n;if(t||0!==o||0!==a||r.renderWidth!==e||r.renderHeight!==i)return this.context.save(),r.scrollX=s,r.scrollY=n,r.renderWidth===e&&r.renderHeight===i||(r.renderWidth=e,r.renderHeight=i),this.debug&&(this.context.globalAlpha=this.debugSettings.debugAlpha,this.debugSettings.forceFullRedraw&&(t=!0)),!t&&this.renderSettings.enableScrollDelta&&Math.abs(o)+Math.abs(a)<Math.min(e,i)?this.renderDeltaScroll(o,a):this.renderFull(),this.debug&&(this.context.globalAlpha=1,this.renderDebug()),this.texture.baseTexture.dirty(),this.dirty=!1,this.context.restore(),!0}},e.TilemapLayer.prototype.renderDebug=function(){var t,e,i,s,n,r,o=this._mc.scrollX,a=this._mc.scrollY,h=this.context,l=this.canvas.width,c=this.canvas.height,u=this.layer.width,d=this.layer.height,p=this._mc.tileWidth,f=this._mc.tileHeight,g=Math.floor(o/p),m=Math.floor((l-1+o)/p),y=Math.floor(a/f),v=Math.floor((c-1+a)/f),x=g*p-o,b=y*f-a,_=(g+(1<<20)*u)%u,w=(y+(1<<20)*d)%d;for(h.strokeStyle=this.debugSettings.facingEdgeStroke,s=w,r=v-y,e=b;r>=0;s++,r--,e+=f){s>=d&&(s-=d);var T=this.layer.data[s];for(i=_,n=m-g,t=x;n>=0;i++,n--,t+=p){i>=u&&(i-=u);var P=T[i];!P||P.index<0||!P.collides||(this.debugSettings.collidingTileOverfill&&(h.fillStyle=this.debugSettings.collidingTileOverfill,h.fillRect(t,e,this._mc.cw,this._mc.ch)),this.debugSettings.facingEdgeStroke&&(h.beginPath(),P.faceTop&&(h.moveTo(t,e),h.lineTo(t+this._mc.cw,e)),P.faceBottom&&(h.moveTo(t,e+this._mc.ch),h.lineTo(t+this._mc.cw,e+this._mc.ch)),P.faceLeft&&(h.moveTo(t,e),h.lineTo(t,e+this._mc.ch)),P.faceRight&&(h.moveTo(t+this._mc.cw,e),h.lineTo(t+this._mc.cw,e+this._mc.ch)),h.closePath(),h.stroke()))}}},Object.defineProperty(e.TilemapLayer.prototype,"wrap",{get:function(){return this._wrap},set:function(t){this._wrap=t,this.dirty=!0}}),Object.defineProperty(e.TilemapLayer.prototype,"scrollX",{get:function(){return this._scrollX},set:function(t){this._scrollX=t}}),Object.defineProperty(e.TilemapLayer.prototype,"scrollY",{get:function(){return this._scrollY},set:function(t){this._scrollY=t}}),Object.defineProperty(e.TilemapLayer.prototype,"collisionWidth",{get:function(){return this._mc.cw},set:function(t){this._mc.cw=0|t,this.dirty=!0}}),Object.defineProperty(e.TilemapLayer.prototype,"collisionHeight",{get:function(){return this._mc.ch},set:function(t){this._mc.ch=0|t,this.dirty=!0}}),e.TilemapParser={INSERT_NULL:!1,parse:function(t,i,s,n,r,o){if(void 0===s&&(s=32),void 0===n&&(n=32),void 0===r&&(r=10),void 0===o&&(o=10),void 0===i)return this.getEmptyData();if(null===i)return this.getEmptyData(s,n,r,o);var a=t.cache.getTilemapData(i);if(a){if(a.format===e.Tilemap.CSV)return this.parseCSV(i,a.data,s,n);if(!a.format||a.format===e.Tilemap.TILED_JSON)return this.parseTiledJSON(a.data)}else console.warn("Phaser.TilemapParser.parse - No map data found for key "+i)},parseCSV:function(t,i,s,n){for(var r=this.getEmptyData(),o=[],a=(i=i.trim()).split("\n"),h=a.length,l=0,c=0;c<a.length;c++){o[c]=[];for(var u=a[c].split(","),d=0;d<u.length;d++)o[c][d]=new e.Tile(r.layers[0],parseInt(u[d],10),d,c,s,n);0===l&&(l=u.length)}return r.format=e.Tilemap.CSV,r.name=t,r.width=l,r.height=h,r.tileWidth=s,r.tileHeight=n,r.widthInPixels=l*s,r.heightInPixels=h*n,r.layers[0].width=l,r.layers[0].height=h,r.layers[0].widthInPixels=r.widthInPixels,r.layers[0].heightInPixels=r.heightInPixels,r.layers[0].data=o,r},getEmptyData:function(t,e,i,s){return{width:void 0!==i&&null!==i?i:0,height:void 0!==s&&null!==s?s:0,tileWidth:void 0!==t&&null!==t?t:0,tileHeight:void 0!==e&&null!==e?e:0,orientation:"orthogonal",version:"1",properties:{},widthInPixels:0,heightInPixels:0,layers:[{name:"layer",x:0,y:0,width:0,height:0,widthInPixels:0,heightInPixels:0,alpha:1,visible:!0,properties:{},indexes:[],callbacks:[],bodies:[],data:[]}],images:[],objects:{},collision:{},tilesets:[],tiles:[]}},_slice:function(t,e){var i={};for(var s in e){var n=e[s];void 0!==t[n]&&(i[n]=t[n])}return i},parseObjectGroup:function(t,e,i,s,n){var s=s||t.name,n=n||{x:0,y:0},r=this._slice;s||console.warn("No name found for objectGroup",t),void 0!==n.x&&void 0!==n.y||console.warn("Malformed xy properties in relativePosition",n),e[s]=e[s]||[],i[s]=i[s]||[];for(var o=0,a=t.objects.length;o<a;o++){var h=t.objects[o];if(h.gid){l={gid:h.gid,name:h.name,type:h.type||"",x:h.x+n.x,y:h.y+n.y,width:h.width,height:h.height,visible:h.visible,properties:h.properties};h.rotation&&(l.rotation=h.rotation),e[s].push(l)}else if(h.polyline){var l={name:h.name,type:h.type,x:h.x+n.x,y:h.y+n.y,width:h.width,height:h.height,visible:h.visible,properties:h.properties};h.rotation&&(l.rotation=h.rotation),l.polyline=[];for(c=0;c<h.polyline.length;c++)l.polyline.push([h.polyline[c].x,h.polyline[c].y]);i[s].push(l),e[s].push(l)}else if(h.polygon){(l=r(h,["name","type","x","y","visible","rotation","properties"])).x+=n.x,l.y+=n.y,l.polygon=[];for(var c=0;c<h.polygon.length;c++)l.polygon.push([h.polygon[c].x,h.polygon[c].y]);i[s].push(l),e[s].push(l)}else h.ellipse?((l=r(h,["name","type","ellipse","x","y","width","height","visible","rotation","properties"])).x+=n.x,l.y+=n.y,i[s].push(l),e[s].push(l)):((l=r(h,["name","type","x","y","width","height","visible","rotation","properties"])).x+=n.x,l.y+=n.y,l.rectangle=!0,i[s].push(l),e[s].push(l))}return{objectsCollection:e,collisionCollection:i}},parseTiledJSON:function(t){if("orthogonal"!==t.orientation)return console.warn("TilemapParser.parseTiledJSON - Only orthogonal map types are supported in this version of Phaser"),null;for(var i={width:t.width,height:t.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,orientation:t.orientation,format:e.Tilemap.TILED_JSON,version:t.version,properties:t.properties,widthInPixels:t.width*t.tilewidth,heightInPixels:t.height*t.tileheight},s=[],n=0;n<t.layers.length;n++)if("tilelayer"===t.layers[n].type){var r=t.layers[n];if(!r.compression&&r.encoding&&"base64"===r.encoding){for(var o=window.atob(r.data),a=o.length,h=new Array(a),l=0;l<a;l+=4)h[l/4]=(o.charCodeAt(l)|o.charCodeAt(l+1)<<8|o.charCodeAt(l+2)<<16|o.charCodeAt(l+3)<<24)>>>0;r.data=h,delete r.encoding}else if(r.compression){console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+r.name+"'");continue}k={name:r.name,x:r.x,y:r.y,width:r.width,height:r.height,widthInPixels:r.width*t.tilewidth,heightInPixels:r.height*t.tileheight,alpha:r.opacity,offsetX:r.offsetx,offsetY:r.offsety,visible:r.visible,properties:{},indexes:[],callbacks:[],bodies:[]};r.properties&&(k.properties=r.properties);for(var c,u,d,p=0,f=[],g=[],m=0,a=r.data.length;m<a;m++){if(c=0,u=!1,A=r.data[m],d=0,A>536870912)switch(A>2147483648&&(A-=2147483648,d+=4),A>1073741824&&(A-=1073741824,d+=2),A>536870912&&(A-=536870912,d+=1),d){case 5:c=Math.PI/2;break;case 6:c=Math.PI;break;case 3:c=3*Math.PI/2;break;case 4:c=0,u=!0;break;case 7:c=Math.PI/2,u=!0;break;case 2:c=Math.PI,u=!0;break;case 1:c=3*Math.PI/2,u=!0}A>0?((F=new e.Tile(k,A,p,g.length,t.tilewidth,t.tileheight)).rotation=c,F.flipped=u,0!==d&&(F.flippedVal=d),f.push(F)):e.TilemapParser.INSERT_NULL?f.push(null):f.push(new e.Tile(k,-1,p,g.length,t.tilewidth,t.tileheight)),++p===r.width&&(g.push(f),p=0,f=[])}k.data=g,s.push(k)}i.layers=s;for(var y=[],n=0;n<t.layers.length;n++)if("imagelayer"===t.layers[n].type){var v=t.layers[n],x={name:v.name,image:v.image,x:v.x,y:v.y,alpha:v.opacity,visible:v.visible,properties:{}};v.properties&&(x.properties=v.properties),y.push(x)}i.images=y;for(var b=[],_={},w=[],T=null,n=0;n<t.tilesets.length;n++){if((U=t.tilesets[n]).source)console.warn("Phaser.TilemapParser - Phaser can't load external tilesets (%s). Use the Embed Tileset button and then export the map again.",U.source);else if(U.image){var P=new e.Tileset(U.name,U.firstgid,U.tilewidth,U.tileheight,U.margin,U.spacing,U.properties);U.tileproperties&&(P.tileProperties=U.tileproperties),P.updateTileData(U.imagewidth,U.imageheight),b.push(P)}else{if(!U.tiles)throw new Error("Tileset "+U.name+" has no `image` or `tiles` property.");var C=new e.ImageCollection(U.name,U.firstgid,U.tilewidth,U.tileheight,U.margin,U.spacing,U.properties);for(var S in U.tiles){var x=U.tiles[S].image,A=U.firstgid+parseInt(S,10);C.addImage(A,x)}w.push(C)}for(var S in U.tiles)(R=U.tiles[S].objectgroup)&&(_[parseInt(S,10)+U.firstgid]=R);T&&(T.lastgid=U.firstgid-1),T=U}if(0===b.length&&0===w.length)throw new Error("This tilemap has no tilesets.");i.tilesets=b,i.imagecollections=w;for(var E={},M={},n=0;n<t.layers.length;n++)if("objectgroup"===t.layers[n].type){var R=t.layers[n];this.parseObjectGroup(R,E,M)}i.objects=E,i.collision=M,i.tiles=[];for(n=0;n<i.tilesets.length;n++)for(var p=(U=i.tilesets[n]).tileMargin,L=U.tileMargin,B=0,I=0,O=0,m=U.firstgid;m<U.firstgid+U.total&&(i.tiles[m]=[p,L,n],p+=U.tileWidth+U.tileSpacing,++B!==U.total)&&(++I!==U.columns||(p=U.tileMargin,L+=U.tileHeight+U.tileSpacing,I=0,++O!==U.rows));m++);for(var k,F,D,U,n=0;n<i.layers.length;n++){M[(k=i.layers[n]).name]=[],U=null;for(l=0;l<k.data.length;l++){f=k.data[l];for(var G=0;G<f.length;G++)null===(F=f[G])||F.index<0||(D=i.tiles[F.index][2],(U=i.tilesets[D]).tileProperties&&U.tileProperties[F.index-U.firstgid]&&(F.properties=e.Utils.mixin(U.tileProperties[F.index-U.firstgid],F.properties)),(R=_[F.index])&&this.parseObjectGroup(R,i.objects,i.collision,F.layer.name,{x:F.worldX+R.x,y:F.worldY+R.y}))}}return i}},e.Tileset=function(t,e,i,s,n,r,o){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===n&&(n=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.tileWidth=0|i,this.tileHeight=0|s,this.tileMargin=0|n,this.tileSpacing=0|r,this.properties=o||{},this.image=null,this.rows=0,this.columns=0,this.total=0,this.drawCoords=[]},e.Tileset.prototype={draw:function(t,e,i,s){var n=s-this.firstgid<<1;n>=0&&n+1<this.drawCoords.length&&t.drawImage(this.image,this.drawCoords[n],this.drawCoords[n+1],this.tileWidth,this.tileHeight,e,i,this.tileWidth,this.tileHeight)},containsTileIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},setImage:function(t){this.image=t,this.updateTileData(t.width,t.height)},setSpacing:function(t,e){this.tileMargin=0|t,this.tileSpacing=0|e,this.image&&this.updateTileData(this.image.width,this.image.height)},updateTileData:function(t,e){var i=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),s=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);i%1==0&&s%1==0||console.warn("Phaser.Tileset - '%s' image tile area (%s x %s) is not a whole multiple of tile size (%s x %s + %s + %s)",this.name,t,e,this.tileWidth,this.tileHeight,this.tileMargin,this.tileSpacing),i=Math.floor(i),s=Math.floor(s),(this.rows&&this.rows!==i||this.columns&&this.columns!==s)&&console.warn("Phaser.Tileset - Tile layout from image '%s' (%s rows by %s columns) differs from tileset '%s' (%s rows by %s columns)",this.image.name,s,i,this.name,this.columns,this.rows),this.rows=i,this.columns=s,this.total=i*s,this.drawCoords.length=0;for(var n=this.tileMargin,r=this.tileMargin,o=0;o<this.rows;o++){for(var a=0;a<this.columns;a++)this.drawCoords.push(n),this.drawCoords.push(r),n+=this.tileWidth+this.tileSpacing;n=this.tileMargin,r+=this.tileHeight+this.tileSpacing}}},e.Tileset.prototype.constructor=e.Tileset,e.Particle=function(t,i,s,n,r){e.Sprite.call(this,t,i,s,n,r),this.autoScale=!1,this.scaleData=null,this._s=0,this.autoAlpha=!1,this.alphaData=null,this._a=0},e.Particle.prototype=Object.create(e.Sprite.prototype),e.Particle.prototype.constructor=e.Particle,e.Particle.prototype.update=function(){this.autoScale&&(--this._s?this.scale.set(this.scaleData[this._s].x,this.scaleData[this._s].y):this.autoScale=!1),this.autoAlpha&&(--this._a?this.alpha=this.alphaData[this._a].v:this.autoAlpha=!1)},e.Particle.prototype.onEmit=function(){},e.Particle.prototype.setAlphaData=function(t){this.alphaData=t,this._a=t.length-1,this.alpha=this.alphaData[this._a].v,this.autoAlpha=!0},e.Particle.prototype.setScaleData=function(t){this.scaleData=t,this._s=t.length-1,this.scale.set(this.scaleData[this._s].x,this.scaleData[this._s].y),this.autoScale=!0},e.Particle.prototype.reset=function(t,i,s){return e.Component.Reset.prototype.reset.call(this,t,i,s),this.alpha=1,this.scale.set(1),this.autoScale=!1,this.autoAlpha=!1,this},e.Particles=function(t){this.game=t,this.emitters={},this.ID=0},e.Particles.prototype={add:function(t){return this.emitters[t.id]=t,t},remove:function(t){delete this.emitters[t.id]}},e.Particles.prototype.constructor=e.Particles,e.Particles.Arcade={},e.Particles.Arcade.Emitter=function(t,i,s,n){this.maxParticles=n||50,e.Group.call(this,t),this._id=this.game.particles.ID++,this.name="emitter"+this.id,this.type=e.EMITTER,this.physicsType=e.GROUP,this.area=new e.Rectangle(i,s,1,1),this.minAngle=null,this.maxAngle=null,this.minSpeed=0,this.maxSpeed=100,this.minParticleSpeed=new e.Point(-100,-100),this.maxParticleSpeed=new e.Point(100,100),this.minParticleScale=1,this.maxParticleScale=1,this.scaleData=null,this.minRotation=-360,this.maxRotation=360,this.minParticleAlpha=1,this.maxParticleAlpha=1,this.alphaData=null,this.particleClass=e.Particle,this.particleDrag=new e.Point,this.angularDrag=0,this.frequency=100,this.lifespan=2e3,this.bounce=new e.Point,this.on=!1,this.particleAnchor=new e.Point(.5,.5),this.blendMode=e.blendModes.NORMAL,this.emitX=i,this.emitY=s,this.autoScale=!1,this.autoAlpha=!1,this.particleBringToTop=!1,this.particleSendToBack=!1,this.counts={emitted:0,failed:0,totalEmitted:0,totalFailed:0},this._gravity=new e.Point(0,100),this._minParticleScale=new e.Point(1,1),this._maxParticleScale=new e.Point(1,1),this._total=0,this._timer=0,this._counter=0,this._flowQuantity=0,this._flowTotal=0,this._explode=!0,this._frames=null},e.Particles.Arcade.Emitter.prototype=Object.create(e.Group.prototype),e.Particles.Arcade.Emitter.prototype.constructor=e.Particles.Arcade.Emitter,e.Particles.Arcade.Emitter.prototype.update=function(){if(this.counts.emitted=0,this.counts.failed=0,this.on&&this.game.time.time>=this._timer)if(this._timer=this.game.time.time+this.frequency*this.game.time.slowMotion,0!==this._flowTotal)if(this._flowQuantity>0){for(t=0;t<this._flowQuantity;t++)if(this.emitParticle()&&(this._counter++,-1!==this._flowTotal&&this._counter>=this._flowTotal)){this.on=!1;break}}else this.emitParticle()&&(this._counter++,-1!==this._flowTotal&&this._counter>=this._flowTotal&&(this.on=!1));else this.emitParticle()&&(this._counter++,this._total>0&&this._counter>=this._total&&(this.on=!1));for(var t=this.children.length;t--;)this.children[t].exists&&this.children[t].update()},e.Particles.Arcade.Emitter.prototype.makeParticles=function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=this.maxParticles),void 0===s&&(s=!1),void 0===n&&(n=!1),void 0===r&&(r=null);var o,a=0,h=t,l=e;for(this._frames=e,i>this.maxParticles&&(this.maxParticles=i);a<i;)Array.isArray(t)&&(h=this.game.rnd.pick(t)),Array.isArray(e)&&(l=this.game.rnd.pick(e)),o=new this.particleClass(this.game,0,0,h,l,r),this.game.physics.arcade.enable(o,!1),o.body.checkCollision.none=!s,o.body.collideWorldBounds=n,o.body.skipQuadTree=!0,o.exists=!1,o.visible=!1,o.anchor.copyFrom(this.particleAnchor),this.add(o),a++;return this},e.Particles.Arcade.Emitter.prototype.kill=function(){return this.on=!1,this.alive=!1,this.exists=!1,this},e.Particles.Arcade.Emitter.prototype.revive=function(){return this.alive=!0,this.exists=!0,this},e.Particles.Arcade.Emitter.prototype.explode=function(t,e){return void 0===e&&(e=this.maxParticles),this._flowTotal=0,this.start(!0,t,0,e,!1),this},e.Particles.Arcade.Emitter.prototype.flow=function(t,e,i,s,n){return void 0!==e&&null!==e||(e=250),void 0!==i&&0!==i||(i=1),void 0===s&&(s=-1),void 0===n&&(n=!0),i>this.maxParticles&&(i=this.maxParticles),this._counter=0,this._flowQuantity=i,this._flowTotal=s,n?(this.start(!0,t,e,i),this._counter+=i,this.on=!0,this._timer=this.game.time.time+e*this.game.time.slowMotion):this.start(!1,t,e,i),this},e.Particles.Arcade.Emitter.prototype.start=function(t,e,i,s,n){if(void 0===t&&(t=!0),void 0===e&&(e=0),void 0!==i&&null!==i||(i=250),void 0===s&&(s=0),void 0===n&&(n=!1),s>this.maxParticles&&(s=this.maxParticles),this.revive(),this.visible=!0,this.lifespan=e,this.frequency=i,t||n)for(var r=0;r<s;r++)this.emitParticle();else this.on=!0,this._total=s,this._counter=0,this._timer=this.game.time.time+i*this.game.time.slowMotion;return this},e.Particles.Arcade.Emitter.prototype.emitParticle=function(t,e,i,s){void 0===t&&(t=null),void 0===e&&(e=null);var n=this.getNextParticle();if(null===n)return this.counts.failed++,this.counts.totalFailed++,!1;this.counts.emitted++,this.counts.totalEmitted++;var r=this.game.rnd;void 0!==i&&void 0!==s?n.loadTexture(i,s):void 0!==i&&(n.loadTexture(i),n.frame=Array.isArray(this._frames)?r.pick(this._frames):this._frames);var o=this.emitX,a=this.emitY;return null!==t?o=t:this.width>1&&(o=r.between(this.left,this.right)),null!==e?a=e:this.height>1&&(a=r.between(this.top,this.bottom)),this.resetParticle(n,o,a),!0},e.Particles.Arcade.Emitter.prototype.getNextParticle=function(){for(var t=this.length;t--;){var e=this.next();if(!e.exists)return e}return null},e.Particles.Arcade.Emitter.prototype.resetParticle=function(t,e,i){var s=this.game.rnd;t.reset(e,i),t.angle=0,t.lifespan=this.lifespan,this.particleBringToTop?this.bringToTop(t):this.particleSendToBack&&this.sendToBack(t),this.autoScale?t.setScaleData(this.scaleData):1!==this.minParticleScale||1!==this.maxParticleScale?t.scale.set(s.realInRange(this.minParticleScale,this.maxParticleScale)):this._minParticleScale.x!==this._maxParticleScale.x||this._minParticleScale.y!==this._maxParticleScale.y?t.scale.set(s.realInRange(this._minParticleScale.x,this._maxParticleScale.x),s.realInRange(this._minParticleScale.y,this._maxParticleScale.y)):t.scale.set(this._minParticleScale.x,this._minParticleScale.y),this.autoAlpha?t.setAlphaData(this.alphaData):t.alpha=s.realInRange(this.minParticleAlpha,this.maxParticleAlpha),t.blendMode=this.blendMode;var n=t.body;n.updateBounds(),n.bounce.copyFrom(this.bounce),n.drag.copyFrom(this.particleDrag),null!=this.minAngle&&null!=this.maxAngle?this.game.physics.arcade.velocityFromAngle(this.minAngle===this.maxAngle?this.minAngle:s.between(this.minAngle,this.maxAngle),this.minSpeed===this.maxSpeed?this.minSpeed:s.between(this.minSpeed,this.maxSpeed),n.velocity):(n.velocity.x=s.between(this.minParticleSpeed.x,this.maxParticleSpeed.x),n.velocity.y=s.between(this.minParticleSpeed.y,this.maxParticleSpeed.y)),n.angularVelocity=s.between(this.minRotation,this.maxRotation),n.gravity.copyFrom(this.gravity),n.angularDrag=this.angularDrag,t.onEmit()},e.Particles.Arcade.Emitter.prototype.destroy=function(){this.game.particles.remove(this),e.Group.prototype.destroy.call(this,!0,!1)},e.Particles.Arcade.Emitter.prototype.setSize=function(t,e){return this.area.width=t,this.area.height=e,this},e.Particles.Arcade.Emitter.prototype.setXSpeed=function(t,e){return t=t||0,e=e||0,this.minParticleSpeed.x=t,this.maxParticleSpeed.x=e,this},e.Particles.Arcade.Emitter.prototype.setYSpeed=function(t,e){return t=t||0,e=e||0,this.minParticleSpeed.y=t,this.maxParticleSpeed.y=e,this},e.Particles.Arcade.Emitter.prototype.setRotation=function(t,e){return t=t||0,e=e||0,this.minRotation=t,this.maxRotation=e,this},e.Particles.Arcade.Emitter.prototype.setAlpha=function(t,i,s,n,r){if(void 0===t&&(t=1),void 0===i&&(i=1),void 0===s&&(s=0),void 0===n&&(n=e.Easing.Linear.None),void 0===r&&(r=!1),this.minParticleAlpha=t,this.maxParticleAlpha=i,this.autoAlpha=!1,s>0&&t!==i){var o={v:t},a=this.game.make.tween(o).to({v:i},s,n);a.yoyo(r),this.alphaData=a.generateData(60),this.alphaData.reverse(),this.autoAlpha=!0}return this},e.Particles.Arcade.Emitter.prototype.setScale=function(t,i,s,n,r,o,a){if(void 0===t&&(t=1),void 0===i&&(i=1),void 0===s&&(s=1),void 0===n&&(n=1),void 0===r&&(r=0),void 0===o&&(o=e.Easing.Linear.None),void 0===a&&(a=!1),this.minParticleScale=1,this.maxParticleScale=1,this._minParticleScale.set(t,s),this._maxParticleScale.set(i,n),this.autoScale=!1,r>0&&(t!==i||s!==n)){var h={x:t,y:s},l=this.game.make.tween(h).to({x:i,y:n},r,o);l.yoyo(a),this.scaleData=l.generateData(60),this.scaleData.reverse(),this.autoScale=!0}return this},e.Particles.Arcade.Emitter.prototype.setAngle=function(t,e,i,s){return this.minAngle=t,this.maxAngle=e,null!=i&&(this.minSpeed=i),null!=s&&(this.maxSpeed=s),this},e.Particles.Arcade.Emitter.prototype.at=function(t){return t.center?(this.emitX=t.center.x,this.emitY=t.center.y):(this.emitX=t.world.x+t.anchor.x*t.width,this.emitY=t.world.y+t.anchor.y*t.height),this},Object.defineProperty(e.Particles.Arcade.Emitter.prototype,"gravity",{get:function(){return this._gravity},set:function(t){"number"==typeof t?this._gravity.y=t:this._gravity=t}}),Object.defineProperty(e.Particles.Arcade.Emitter.prototype,"id",{get:function(){return this._id}}),Object.defineProperty(e.Particles.Arcade.Emitter.prototype,"width",{get:function(){return this.area.width},set:function(t){this.area.width=t}}),Object.defineProperty(e.Particles.Arcade.Emitter.prototype,"height",{get:function(){return this.area.height},set:function(t){this.area.height=t}}),Object.defineProperty(e.Particles.Arcade.Emitter.prototype,"x",{get:function(){return this.emitX},set:function(t){this.emitX=t}}),Object.defineProperty(e.Particles.Arcade.Emitter.prototype,"y",{get:function(){return this.emitY},set:function(t){this.emitY=t}}),Object.defineProperty(e.Particles.Arcade.Emitter.prototype,"left",{get:function(){return Math.floor(this.x-this.area.width/2)}}),Object.defineProperty(e.Particles.Arcade.Emitter.prototype,"right",{get:function(){return Math.floor(this.x+this.area.width/2)}}),Object.defineProperty(e.Particles.Arcade.Emitter.prototype,"top",{get:function(){return Math.floor(this.y-this.area.height/2)}}),Object.defineProperty(e.Particles.Arcade.Emitter.prototype,"bottom",{get:function(){return Math.floor(this.y+this.area.height/2)}}),Object.defineProperty(e.Particles.Arcade.Emitter.prototype,"output",{get:function(){return 1e3*this._flowQuantity/this.frequency}}),Object.defineProperty(e.Particles.Arcade.Emitter.prototype,"lifespanOutput",{get:function(){return(0===this.lifespan?1/0:this.lifespan)*this._flowQuantity/this.frequency}}),Object.defineProperty(e.Particles.Arcade.Emitter.prototype,"remainder",{get:function(){return this.maxParticles-this.lifespanOutput}}),e.Weapon=function(t,i){e.Plugin.call(this,t,i),this.bullets=null,this.autoExpandBulletsGroup=!1,this.autofire=!1,this.shots=0,this.fireLimit=0,this.fireRate=100,this.fireRateVariance=0,this.fireFrom=new e.Rectangle(0,0,1,1),this.fireAngle=e.ANGLE_UP,this.bulletInheritSpriteSpeed=!1,this.bulletAnimation="",this.bulletFrameRandom=!1,this.bulletFrameCycle=!1,this.bulletWorldWrap=!1,this.bulletWorldWrapPadding=0,this.bulletAngleOffset=0,this.bulletAngleVariance=0,this.bulletSpeed=200,this.bulletSpeedVariance=0,this.bulletLifespan=0,this.bulletKillDistance=0,this.bulletGravity=new e.Point(0,0),this.bulletRotateToVelocity=!1,this.bulletKey="",this.bulletFrame="",this._bulletClass=e.Bullet,this._bulletCollideWorldBounds=!1,this._bulletKillType=e.Weapon.KILL_WORLD_BOUNDS,this._data={customBody:!1,width:0,height:0,offsetX:0,offsetY:0},this.bounds=new e.Rectangle,this.bulletBounds=t.world.bounds,this.bulletFrames=[],this.bulletFrameIndex=0,this.anims={},this.onFire=new e.Signal,this.onKill=new e.Signal,this.onFireLimit=new e.Signal,this.trackedSprite=null,this.trackedPointer=null,this.multiFire=!1,this._hasFired=!1,this.trackRotation=!1,this.trackOffset=new e.Point,this._nextFire=0,this._tempNextFire=0,this._rotatedPoint=new e.Point},e.Weapon.prototype=Object.create(e.Plugin.prototype),e.Weapon.prototype.constructor=e.Weapon,e.Weapon.KILL_NEVER=0,e.Weapon.KILL_LIFESPAN=1,e.Weapon.KILL_DISTANCE=2,e.Weapon.KILL_WEAPON_BOUNDS=3,e.Weapon.KILL_CAMERA_BOUNDS=4,e.Weapon.KILL_WORLD_BOUNDS=5,e.Weapon.KILL_STATIC_BOUNDS=6,e.Weapon.prototype.createBullets=function(t,i,s,n){return void 0===t&&(t=1),void 0===n&&(n=this.game.world),this.bullets&&!this.bullets.game&&(this.bullets=null),this.bullets||(this.bullets=this.game.add.physicsGroup(e.Physics.ARCADE,n),this.bullets.classType=this._bulletClass),0!==t&&(-1===t&&(this.autoExpandBulletsGroup=!0,t=1),this.bullets.createMultiple(t,i,s),this.bullets.setAll("data.bulletManager",this),this.bulletKey=i,this.bulletFrame=s),this},e.Weapon.prototype.forEach=function(t,e){return this.bullets.forEachExists(t,e,arguments),this},e.Weapon.prototype.pauseAll=function(){return this.bullets.setAll("body.enable",!1),this},e.Weapon.prototype.resumeAll=function(){return this.bullets.setAll("body.enable",!0),this},e.Weapon.prototype.killAll=function(){return this.bullets.callAllExists("kill",!0),this.bullets.setAll("body.enable",!0),this},e.Weapon.prototype.resetShots=function(t){return this.shots=0,void 0!==t&&(this.fireLimit=t),this},e.Weapon.prototype.destroy=function(){this.parent.remove(this,!1),this.bullets.destroy(),this.game=null,this.parent=null,this.active=!1,this.visible=!1},e.Weapon.prototype.update=function(){this._bulletKillType===e.Weapon.KILL_WEAPON_BOUNDS&&(this.trackedSprite?(this.trackedSprite.updateTransform(),this.bounds.centerOn(this.trackedSprite.worldPosition.x,this.trackedSprite.worldPosition.y)):this.trackedPointer&&this.bounds.centerOn(this.trackedPointer.worldX,this.trackedPointer.worldY)),this.autofire&&this.fire()},e.Weapon.prototype.postRender=function(){this.multiFire&&this._hasFired&&(this._hasFired=!1,this._nextFire=this._tempNextFire)},e.Weapon.prototype.trackSprite=function(t,e,i,s){return void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=!1),this.trackedPointer=null,this.trackedSprite=t,this.trackRotation=s,this.trackOffset.set(e,i),this},e.Weapon.prototype.trackPointer=function(t,e,i){return void 0===t&&(t=this.game.input.activePointer),void 0===e&&(e=0),void 0===i&&(i=0),this.trackedPointer=t,this.trackedSprite=null,this.trackRotation=!1,this.trackOffset.set(e,i),this},e.Weapon.prototype.fireMany=function(t,e){this.multiFire=!0;var i=[],s=this;return e||this.trackedSprite||this.trackedPointer?t.forEach(function(t){i.push(s.fire(e,null,null,t.x,t.y))}):t.forEach(function(t){i.push(s.fire(t))}),i},e.Weapon.prototype.fireOffset=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.fire(null,null,null,t,e)},e.Weapon.prototype.fire=function(t,i,s,n,r){if(void 0===i&&(i=null),void 0===s&&(s=null),this.game.time.now<this._nextFire||this.fireLimit>0&&this.shots===this.fireLimit)return null;var o=this.bulletSpeed;0!==this.bulletSpeedVariance&&(o+=e.Math.between(-this.bulletSpeedVariance,this.bulletSpeedVariance)),t?this.fireFrom.width>1?this.fireFrom.centerOn(t.x,t.y):(this.fireFrom.x=t.x,this.fireFrom.y=t.y):this.trackedSprite?(this.trackRotation?(this._rotatedPoint.set(this.trackedSprite.world.x+this.trackOffset.x,this.trackedSprite.world.y+this.trackOffset.y),this._rotatedPoint.rotate(this.trackedSprite.world.x,this.trackedSprite.world.y,this.trackedSprite.worldRotation),this.fireFrom.width>1?this.fireFrom.centerOn(this._rotatedPoint.x,this._rotatedPoint.y):(this.fireFrom.x=this._rotatedPoint.x,this.fireFrom.y=this._rotatedPoint.y)):this.fireFrom.width>1?this.fireFrom.centerOn(this.trackedSprite.world.x+this.trackOffset.x,this.trackedSprite.world.y+this.trackOffset.y):(this.fireFrom.x=this.trackedSprite.world.x+this.trackOffset.x,this.fireFrom.y=this.trackedSprite.world.y+this.trackOffset.y),this.bulletInheritSpriteSpeed&&(o+=this.trackedSprite.body.speed)):this.trackedPointer&&(this.fireFrom.width>1?this.fireFrom.centerOn(this.trackedPointer.world.x+this.trackOffset.x,this.trackedPointer.world.y+this.trackOffset.y):(this.fireFrom.x=this.trackedPointer.world.x+this.trackOffset.x,this.fireFrom.y=this.trackedPointer.world.y+this.trackOffset.y)),void 0!==n&&(this.fireFrom.x+=n),void 0!==r&&(this.fireFrom.y+=r);var a=this.fireFrom.width>1?this.fireFrom.randomX:this.fireFrom.x,h=this.fireFrom.height>1?this.fireFrom.randomY:this.fireFrom.y,l=this.trackRotation?this.trackedSprite.angle:this.fireAngle;null!==i&&null!==s&&(l=this.game.math.radToDeg(Math.atan2(s-h,i-a))),0!==this.bulletAngleVariance&&(l+=e.Math.between(-this.bulletAngleVariance,this.bulletAngleVariance));var c=0,u=0;0===l||180===l?c=Math.cos(this.game.math.degToRad(l))*o:90===l||270===l?u=Math.sin(this.game.math.degToRad(l))*o:(c=Math.cos(this.game.math.degToRad(l))*o,u=Math.sin(this.game.math.degToRad(l))*o);var d=null;if(this.autoExpandBulletsGroup?(d=this.bullets.getFirstExists(!1,!0,a,h,this.bulletKey,this.bulletFrame)).data.bulletManager=this:d=this.bullets.getFirstExists(!1),d){if(d.reset(a,h),d.data.fromX=a,d.data.fromY=h,d.data.killType=this.bulletKillType,d.data.killDistance=this.bulletKillDistance,d.data.rotateToVelocity=this.bulletRotateToVelocity,this.bulletKillType===e.Weapon.KILL_LIFESPAN&&(d.lifespan=this.bulletLifespan),d.angle=l+this.bulletAngleOffset,""!==this.bulletAnimation){if(null===d.animations.getAnimation(this.bulletAnimation)){var p=this.anims[this.bulletAnimation];d.animations.add(p.name,p.frames,p.frameRate,p.loop,p.useNumericIndex)}d.animations.play(this.bulletAnimation)}else this.bulletFrameCycle?(d.frame=this.bulletFrames[this.bulletFrameIndex],++this.bulletFrameIndex>=this.bulletFrames.length&&(this.bulletFrameIndex=0)):this.bulletFrameRandom&&(d.frame=this.bulletFrames[Math.floor(Math.random()*this.bulletFrames.length)]);d.data.bodyDirty&&(this._data.customBody&&d.body.setSize(this._data.width,this._data.height,this._data.offsetX,this._data.offsetY),d.body.collideWorldBounds=this.bulletCollideWorldBounds,d.data.bodyDirty=!1),d.body.velocity.set(c,u),d.body.gravity.set(this.bulletGravity.x,this.bulletGravity.y);var f=0;if(0!==this.bulletSpeedVariance){var g=this.fireRate;(g+=e.Math.between(-this.fireRateVariance,this.fireRateVariance))<0&&(g=0),f=this.game.time.now+g}else f=this.game.time.now+this.fireRate;this.multiFire?this._hasFired||(this._hasFired=!0,this._tempNextFire=f,this.shots++):(this._nextFire=f,this.shots++),this.onFire.dispatch(d,this,o),this.fireLimit>0&&this.shots===this.fireLimit&&this.onFireLimit.dispatch(this,this.fireLimit)}return d},e.Weapon.prototype.fireAtPointer=function(t){return void 0===t&&(t=this.game.input.activePointer),this.fire(null,t.worldX,t.worldY)},e.Weapon.prototype.fireAtSprite=function(t){return this.fire(null,t.world.x,t.world.y)},e.Weapon.prototype.fireAtXY=function(t,e){return this.fire(null,t,e)},e.Weapon.prototype.setBulletBodyOffset=function(t,e,i,s){return void 0===i&&(i=0),void 0===s&&(s=0),this._data.customBody=!0,this._data.width=t,this._data.height=e,this._data.offsetX=i,this._data.offsetY=s,this.bullets.callAll("body.setSize","body",t,e,i,s),this.bullets.setAll("data.bodyDirty",!1),this},e.Weapon.prototype.setBulletFrames=function(t,i,s,n){return void 0===s&&(s=!0),void 0===n&&(n=!1),this.bulletFrames=e.ArrayUtils.numberArray(t,i),this.bulletFrameIndex=0,this.bulletFrameCycle=s,this.bulletFrameRandom=n,this},e.Weapon.prototype.addBulletAnimation=function(t,e,i,s,n){return this.anims[t]={name:t,frames:e,frameRate:i,loop:s,useNumericIndex:n},this.bullets.callAll("animations.add","animations",t,e,i,s,n),this.bulletAnimation=t,this},e.Weapon.prototype.debug=function(t,e,i){void 0===t&&(t=16),void 0===e&&(e=32),void 0===i&&(i=!1),this.game.debug.text("Weapon Plugin",t,e),this.game.debug.text("Bullets Alive: "+this.bullets.total+" - Total: "+this.bullets.length,t,e+24),i&&this.bullets.forEachExists(this.game.debug.body,this.game.debug,"rgba(255, 0, 255, 0.8)")},Object.defineProperty(e.Weapon.prototype,"bulletClass",{get:function(){return this._bulletClass},set:function(t){this._bulletClass=t,this.bullets&&(this.bullets.classType=this._bulletClass)}}),Object.defineProperty(e.Weapon.prototype,"bulletKillType",{get:function(){return this._bulletKillType},set:function(t){switch(t){case e.Weapon.KILL_STATIC_BOUNDS:case e.Weapon.KILL_WEAPON_BOUNDS:this.bulletBounds=this.bounds;break;case e.Weapon.KILL_CAMERA_BOUNDS:this.bulletBounds=this.game.camera.view;break;case e.Weapon.KILL_WORLD_BOUNDS:this.bulletBounds=this.game.world.bounds}this._bulletKillType=t}}),Object.defineProperty(e.Weapon.prototype,"bulletCollideWorldBounds",{get:function(){return this._bulletCollideWorldBounds},set:function(t){this._bulletCollideWorldBounds=t,this.bullets.setAll("body.collideWorldBounds",t),this.bullets.setAll("data.bodyDirty",!1)}}),Object.defineProperty(e.Weapon.prototype,"x",{get:function(){return this.fireFrom.x},set:function(t){this.fireFrom.x=t}}),Object.defineProperty(e.Weapon.prototype,"y",{get:function(){return this.fireFrom.y},set:function(t){this.fireFrom.y=t}}),e.Bullet=function(t,i,s,n,r){e.Sprite.call(this,t,i,s,n,r),this.anchor.set(.5),this.data={bulletManager:null,fromX:0,fromY:0,bodyDirty:!0,rotateToVelocity:!1,killType:0,killDistance:0}},e.Bullet.prototype=Object.create(e.Sprite.prototype),e.Bullet.prototype.constructor=e.Bullet,e.Bullet.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.data.bulletManager.onKill.dispatch(this),this},e.Bullet.prototype.update=function(){this.exists&&(this.data.killType>e.Weapon.KILL_LIFESPAN&&(this.data.killType===e.Weapon.KILL_DISTANCE?this.game.physics.arcade.distanceToXY(this,this.data.fromX,this.data.fromY,!0)>this.data.killDistance&&this.kill():this.data.bulletManager.bulletBounds.intersects(this)||this.kill()),this.data.rotateToVelocity&&(this.rotation=this.body.velocity.atan()),this.data.bulletManager.bulletWorldWrap&&this.game.world.wrap(this,this.data.bulletManager.bulletWorldWrapPadding))},e.Video=function(t,i,s){if(void 0===i&&(i=null),void 0===s&&(s=null),this.game=t,this.key=i,this.width=0,this.height=0,this.type=e.VIDEO,this.disableTextureUpload=!1,this.touchLocked=!1,this.onPlay=new e.Signal,this.onChangeSource=new e.Signal,this.onComplete=new e.Signal,this.onAccess=new e.Signal,this.onError=new e.Signal,this.onTimeout=new e.Signal,this.onTouchUnlock=new e.Signal,this.playWhenUnlocked=!0,this.timeout=15e3,this._timeOutID=null,this.video=null,this.videoStream=null,this.isStreaming=!1,this.retryLimit=20,this.retry=0,this.retryInterval=500,this._retryID=null,this._codeMuted=!1,this._muted=!1,this._codePaused=!1,this._paused=!1,this._pending=!1,this._pendingChangeSource=!1,this._autoplay=!1,this._endCallback=null,this._playCallback=null,i&&this.game.cache.checkVideoKey(i)){var n=this.game.cache.getVideo(i);n.isBlob?this.createVideoFromBlob(n.data):this.video=n.data,this.width=this.video.videoWidth,this.height=this.video.videoHeight}else s&&this.createVideoFromURL(s,!1);this.video&&!s?(this.baseTexture=new PIXI.BaseTexture(this.video,null,this.game.resolution),this.baseTexture.forceLoaded(this.width,this.height)):(this.baseTexture=new PIXI.BaseTexture(e.Cache.DEFAULT.baseTexture.source,null,this.game.resolution),this.baseTexture.forceLoaded(this.width,this.height)),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new e.Frame(0,0,0,this.width,this.height,"video"),this.texture.setFrame(this.textureFrame),this.texture.valid=!1,null!==i&&this.video&&(this.texture.valid=this.video.canplay),this.snapshot=null,e.BitmapData&&(this.snapshot=new e.BitmapData(this.game,"",this.width,this.height)),this.game.device.needsTouchUnlock()?this.setTouchLock():n&&(n.locked=!1)},e.Video.prototype={connectToMediaStream:function(t,e){return t&&e&&(this.video=t,this.videoStream=e,this.isStreaming=!0,this.baseTexture.source=this.video,this.updateTexture(null,this.video.videoWidth,this.video.videoHeight),this.onAccess.dispatch(this)),this},startMediaStream:function(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=null),!this.game.device.getUserMedia)return this.onError.dispatch(this,"No getUserMedia"),!1;null!==this.videoStream&&(this.videoStream.active?this.videoStream.active=!1:this.videoStream.stop()),this.removeVideoElement(),this.video=document.createElement("video"),this.video.setAttribute("autoplay","autoplay"),null!==e&&(this.video.width=e),null!==i&&(this.video.height=i),this._timeOutID=window.setTimeout(this.getUserMediaTimeout.bind(this),this.timeout);try{navigator.getUserMedia({audio:t,video:!0},this.getUserMediaSuccess.bind(this),this.getUserMediaError.bind(this))}catch(t){this.getUserMediaError(t)}return this},getUserMediaTimeout:function(){clearTimeout(this._timeOutID),this.onTimeout.dispatch(this)},getUserMediaError:function(t){clearTimeout(this._timeOutID),this.onError.dispatch(this,t)},getUserMediaSuccess:function(t){clearTimeout(this._timeOutID),this.videoStream=t,void 0!==this.video.mozSrcObject?this.video.mozSrcObject=t:this.video.src=window.URL&&window.URL.createObjectURL(t)||t;var e=this;this.video.onloadeddata=function(){function t(){if(i>0)if(e.video.videoWidth>0){var s=e.video.videoWidth,n=e.video.videoHeight;isNaN(e.video.videoHeight)&&(n=s/(4/3)),e.video.play(),e.isStreaming=!0,e.baseTexture.source=e.video,e.updateTexture(null,s,n),e.onAccess.dispatch(e)}else window.setTimeout(t,500);else console.warn("Unable to connect to video stream. Webcam error?");i--}var i=10;t()}},createVideoFromBlob:function(t){var e=this;return this.video=document.createElement("video"),this.video.controls=!1,this.video.setAttribute("autoplay","autoplay"),this.video.addEventListener("loadeddata",function(t){e.updateTexture(t)},!0),this.video.src=window.URL.createObjectURL(t),this.video.canplay=!0,this},createVideoFromURL:function(t,e){return void 0===e&&(e=!1),this.texture&&(this.texture.valid=!1),this.video=document.createElement("video"),this.video.controls=!1,e&&this.video.setAttribute("autoplay","autoplay"),this.video.src=t,this.video.canplay=!0,this.video.load(),this.retry=this.retryLimit,this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval),this.key=t,this},updateTexture:function(t,e,i){var s=!1;void 0!==e&&null!==e||(e=this.video.videoWidth,s=!0),void 0!==i&&null!==i||(i=this.video.videoHeight),this.width=e,this.height=i,this.baseTexture.source!==this.video&&(this.baseTexture.source=this.video),this.baseTexture.forceLoaded(e,i),this.texture.frame.resize(e,i),this.texture.width=e,this.texture.height=i,this.texture.valid=!0,this.snapshot&&this.snapshot.resize(e,i),s&&null!==this.key&&(this.onChangeSource.dispatch(this,e,i),this._autoplay&&(this.video.play(),this.onPlay.dispatch(this,this.loop,this.playbackRate)))},complete:function(){this.onComplete.dispatch(this)},play:function(t,e){return this._pendingChangeSource?this:(void 0===t&&(t=!1),void 0===e&&(e=1),this.game.sound.onMute&&(this.game.sound.onMute.add(this.setMute,this),this.game.sound.onUnMute.add(this.unsetMute,this),this.game.sound.mute&&this.setMute()),this.game.onPause.add(this.setPause,this),this.game.onResume.add(this.setResume,this),this._endCallback=this.complete.bind(this),this.video.addEventListener("ended",this._endCallback,!0),this.video.addEventListener("webkitendfullscreen",this._endCallback,!0),this.video.loop=t?"loop":"",this.video.playbackRate=e,this.touchLocked?this._pending=!0:(this._pending=!1,null!==this.key&&(4!==this.video.readyState?(this.retry=this.retryLimit,this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval)):(this._playCallback=this.playHandler.bind(this),this.video.addEventListener("playing",this._playCallback,!0))),this.video.play(),this.onPlay.dispatch(this,t,e)),this)},playHandler:function(){this.video.removeEventListener("playing",this._playCallback,!0),this.updateTexture()},stop:function(){return this.game.sound.onMute&&(this.game.sound.onMute.remove(this.setMute,this),this.game.sound.onUnMute.remove(this.unsetMute,this)),this.game.onPause.remove(this.setPause,this),this.game.onResume.remove(this.setResume,this),this.isStreaming?(this.video.mozSrcObject?(this.video.mozSrcObject.stop(),this.video.src=null):(this.video.src="",this.videoStream.active?this.videoStream.active=!1:this.videoStream.getTracks?this.videoStream.getTracks().forEach(function(t){t.stop()}):this.videoStream.stop()),this.videoStream=null,this.isStreaming=!1):(this.video.removeEventListener("ended",this._endCallback,!0),this.video.removeEventListener("webkitendfullscreen",this._endCallback,!0),this.video.removeEventListener("playing",this._playCallback,!0),this.touchLocked?this._pending=!1:this.video.pause()),this},add:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)t[e].loadTexture&&t[e].loadTexture(this);else t.loadTexture(this);return this},addToWorld:function(t,e,i,s,n,r){n=n||1,r=r||1;var o=this.game.add.image(t,e,this);return o.anchor.set(i,s),o.scale.set(n,r),o},render:function(){!this.disableTextureUpload&&this.playing&&this.baseTexture.dirty()},setMute:function(){this._muted||(this._muted=!0,this.video.muted=!0)},unsetMute:function(){this._muted&&!this._codeMuted&&(this._muted=!1,this.video.muted=!1)},setPause:function(){this._paused||this.touchLocked||(this._paused=!0,this.video.pause())},setResume:function(){!this._paused||this._codePaused||this.touchLocked||(this._paused=!1,this.video.ended||this.video.play())},changeSource:function(t,e){return void 0===e&&(e=!0),this.texture.valid=!1,this.video.pause(),this._pendingChangeSource=!0,this.retry=this.retryLimit,this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval),this.video.src=t,this.video.load(),this._autoplay=e,e||(this.paused=!0),this},checkVideoProgress:function(){4===this.video.readyState?(this._pendingChangeSource=!1,this.updateTexture()):--this.retry>0?this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval):console.warn("Phaser.Video: Unable to start downloading video in time",this.isStreaming)},setTouchLock:function(){this.game.input.addTouchLockCallback(this.unlock,this,!0),this.touchLocked=!0},unlock:function(){if(this.touchLocked=!1,this.playWhenUnlocked&&(this.video.play(),this.onPlay.dispatch(this,this.loop,this.playbackRate)),this.key){var t=this.game.cache.getVideo(this.key);t&&!t.isBlob&&(t.locked=!1)}return this.onTouchUnlock.dispatch(this),!0},grab:function(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=1),void 0===i&&(i=null),null!==this.snapshot)return t&&this.snapshot.cls(),this.snapshot.copy(this.video,0,0,this.width,this.height,0,0,this.width,this.height,0,0,0,1,1,e,i),this.snapshot;console.warn("Video.grab cannot run because Phaser.BitmapData is unavailable")},removeVideoElement:function(){if(this.video){for(this.video.parentNode&&this.video.parentNode.removeChild(this.video);this.video.hasChildNodes();)this.video.removeChild(this.video.firstChild);this.video.removeAttribute("autoplay"),this.video.removeAttribute("src"),this.video=null}},destroy:function(){this.stop(),this.removeVideoElement(),this.touchLocked&&this.game.input.touch.removeTouchLockCallback(this.unlock,this),this._retryID&&window.clearTimeout(this._retryID)}},Object.defineProperty(e.Video.prototype,"currentTime",{get:function(){return this.video?this.video.currentTime:0},set:function(t){this.video.currentTime=t}}),Object.defineProperty(e.Video.prototype,"duration",{get:function(){return this.video?this.video.duration:0}}),Object.defineProperty(e.Video.prototype,"progress",{get:function(){return this.video?this.video.currentTime/this.video.duration:0}}),Object.defineProperty(e.Video.prototype,"mute",{get:function(){return this._muted},set:function(t){if(t=t||null){if(this._muted)return;this._codeMuted=!0,this.setMute()}else{if(!this._muted)return;this._codeMuted=!1,this.unsetMute()}}}),Object.defineProperty(e.Video.prototype,"paused",{get:function(){return this._paused},set:function(t){if(t=t||null,!this.touchLocked)if(t){if(this._paused)return;this._codePaused=!0,this.setPause()}else{if(!this._paused)return;this._codePaused=!1,this.setResume()}}}),Object.defineProperty(e.Video.prototype,"volume",{get:function(){return this.video?this.video.volume:1},set:function(t){t<0?t=0:t>1&&(t=1),this.video&&(this.video.volume=t)}}),Object.defineProperty(e.Video.prototype,"playbackRate",{get:function(){return this.video?this.video.playbackRate:1},set:function(t){this.video&&(this.video.playbackRate=t)}}),Object.defineProperty(e.Video.prototype,"loop",{get:function(){return!!this.video&&this.video.loop},set:function(t){t&&this.video?this.video.loop="loop":this.video&&(this.video.loop="")}}),Object.defineProperty(e.Video.prototype,"playing",{get:function(){return!!this.video&&!(this.video.paused&&this.video.ended)}}),e.Video.prototype.constructor=e.Video,void 0===PIXI.blendModes&&(PIXI.blendModes=e.blendModes),void 0===PIXI.scaleModes&&(PIXI.scaleModes=e.scaleModes),void 0===PIXI.Texture.emptyTexture&&(PIXI.Texture.emptyTexture=new PIXI.Texture(new PIXI.BaseTexture)),void 0===PIXI.DisplayObject._tempMatrix&&(PIXI.DisplayObject._tempMatrix=new e.Matrix),PIXI.TextureSilentFail=!0,PIXI.canUseNewCanvasBlendModes=function(){return e.Device.canUseMultiply},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=e),exports.Phaser=e):"undefined"!=typeof define&&define.amd?define("Phaser",t.Phaser=e):t.Phaser=e,e}.call(this); +//# sourceMappingURL=phaser.map \ No newline at end of file