},preRender:function(){this.onPreRenderCallback&&this.onPreRenderCallback.call(this.callbackContext,this.game)},render:function(){this._created&&this.onRenderCallback?(this.game.renderType===b.CANVAS&&(this.game.context.save(),this.game.context.setTransform(1,0,0,1,0,0)),this.onRenderCallback.call(this.callbackContext,this.game),this.game.renderType===b.CANVAS&&this.game.context.restore()):this.onLoadRenderCallback&&this.onLoadRenderCallback.call(this.callbackContext,this.game)},destroy:function(){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.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onPauseUpdateCallback=null,this.game=null,this.states={},this._pendingState=null}},b.StateManager.prototype.constructor=b.StateManager,b.LinkedList=function(){this.next=null,this.prev=null,this.first=null,this.last=null,this.total=0},b.LinkedList.prototype={add:function(a){return0===this.total&&null===this.first&&null===this.last?(this.first=a,this.last=a,this.next=a,a.prev=this,this.total++,a):(this.last.next=a,a.prev=this.last,this.last=a,this.total++,a)},reset:function(){this.first=null,this.last=null,this.next=null,this.prev=null,this.total=0},remove:function(a){return1===this.total?(this.reset(),void(a.next=a.prev=null)):(a===this.first?this.first=this.first.next:a===this.last&&(this.last=this.last.prev),a.prev&&(a.prev.next=a.next),a.next&&(a.next.prev=a.prev),a.next=a.prev=null,null===this.first&&(this.last=null),voidthis.total--)},callAll:function(a){if(this.first&&this.last){varb=this.first;dob&&b[a]&&b[a].call(b),b=b.next;while(b!=this.last.next)}}},b.LinkedList.prototype.constructor=b.LinkedList,b.ArrayList=function(){this.total=0,this.position=0,this.list=[]},b.ArrayList.prototype={add:function(a){returnthis.exists(a)||(this.list.push(a),this.total++),a},getIndex:function(a){returnthis.list.indexOf(a)},exists:function(a){returnthis.list.indexOf(a)>-1},reset:function(){this.list.length=0,this.total=0},remove:function(a){varb=this.list.indexOf(a);returnb>-1?(this.list.splice(b,1),this.total--,a):void0},callAll:function(a){for(varb=Array.prototype.splice.call(arguments,1),c=this.list.length;c--;)this.list[c]&&this.list[c][a]&&this.list[c][a].apply(this.list[c],b)}},Object.defineProperty(b.ArrayList.prototype,"first",{get:function(){returnthis.position=0,this.total>0?this.list[0]:null}}),Object.defineProperty(b.ArrayList.prototype,"next",{get:function(){returnthis.position<this.total?(this.position++,this.list[this.position]):null}}),b.ArrayList.prototype.constructor=b.ArrayList,b.Signal=function(){this._bindings=[],this._prevParams=null;vara=this;this.dispatch=function(){b.Signal.prototype.dispatch.apply(a,arguments)}},b.Signal.prototype={memorize:!1,_shouldPropagate:!0,active:!0,validateListener:function(a,b){if("function"!=typeofa)thrownewError("listener is a required param of {fn}() and should be a Function.".replace("{fn}",b))},_registerListener:function(a,c,d,e){varf,g=this._indexOfListener(a,d);if(-1!==g){if(f=this._bindings[g],f.isOnce()!==c)thrownewError("You cannot add"+(c?"":"Once")+"() then add"+(c?"Once":"")+"() the same listener without removing the relationship first.")}elsef=newb.SignalBinding(this,a,c,d,e),this._addBinding(f);returnthis.memorize&&this._prevParams&&f.execute(this._prevParams),f},_addBinding:function(a){varb=this._bindings.length;do--b;while(this._bindings[b]&&a._priority<=this._bindings[b]._priority);this._bindings.splice(b+1,0,a)},_indexOfListener:function(a,b){for(varc,d=this._bindings.length;d--;)if(c=this._bindings[d],c._listener===a&&c.context===b)returnd;return-1},has:function(a,b){return-1!==this._indexOfListener(a,b)},add:function(a,b,c){returnthis.validateListener(a,"add"),this._registerListener(a,!1,b,c)},addOnce:function(a,b,c){returnthis.validateListener(a,"addOnce"),this._registerListener(a,!0,b,c)},remove:function(a,b){this.validateListene
this.events.length>this._marked?this.order():(this.expired=!0,this.onComplete.dispatch(this))}returnthis.expired&&this.autoDestroy?!1:!0},pause:function(){this.running&&(this._codePaused=!0,this.paused||(this._pauseStarted=this.game.time.now,this.paused=!0))},_pause:function(){!this.paused&&this.running&&(this._pauseStarted=this.game.time.now,this.paused=!0)},adjustEvents:function(a){for(varb=0;b<this.events.length;b++)if(!this.events[b].pendingDelete){varc=this.events[b].tick-a;0>c&&(c=0),this.events[b].tick=this._now+c}vard=this.nextTick-a;this.nextTick=0>d?this._now:this._now+d},resume:function(){if(this.paused){vara=this.game.time.now;this._pauseTotal+=a-this._now,this._now=a,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.events=[],this._len=0,this._i=0}},Object.defineProperty(b.Timer.prototype,"next",{get:function(){returnthis.nextTick}}),Object.defineProperty(b.Timer.prototype,"duration",{get:function(){returnthis.running&&this.nextTick>this._now?this.nextTick-this._now:0}}),Object.defineProperty(b.Timer.prototype,"length",{get:function(){returnthis.events.length}}),Object.defineProperty(b.Timer.prototype,"ms",{get:function(){returnthis._now-this._started-this._pauseTotal}}),Object.defineProperty(b.Timer.prototype,"seconds",{get:function(){return.001*this.ms}}),b.Timer.prototype.constructor=b.Timer,b.TimerEvent=function(a,b,c,d,e,f,g,h){this.timer=a,this.delay=b,this.tick=c,this.repeatCount=d-1,this.loop=e,this.callback=f,this.callbackContext=g,this.args=h,this.pendingDelete=!1},b.TimerEvent.prototype.constructor=b.TimerEvent,b.AnimationManager=function(a){this.sprite=a,this.game=a.game,this.currentFrame=null,this.currentAnim=null,this.updateIfVisible=!0,this.isLoaded=!1,this._frameData=null,this._anims={},this._outputFrames=[]},b.AnimationManager.prototype={loadFrameData:function(a){this._frameData=a,this.frame=0,this.isLoaded=!0},add:function(a,c,d,e,f){returnnull===this._frameData?voidconsole.warn("No FrameData available for Phaser.Animation "+a):(c=c||[],d=d||60,"undefined"==typeofe&&(e=!1),"undefined"==typeoff&&(f=c&&"number"==typeofc[0]?!0:!1),null===this.sprite.events.onAnimationStart&&(this.sprite.events.onAnimationStart=newb.Signal,this.sprite.events.onAnimationComplete=newb.Signal,this.sprite.events.onAnimationLoop=newb.Signal),this._outputFrames.length=0,this._frameData.getFrameIndexes(c,f,this._outputFrames),this._anims[a]=newb.Animation(this.game,this.sprite,a,this._frameData,this._outputFrames,d,e),this.currentAnim=this._anims[a],this.currentFrame=this.currentAnim.currentFrame,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1),this._anims[a])},validateFrames:function(a,b){"undefined"==typeofb&&(b=!0);for(varc=0;c<a.length;c++)if(b===!0){if(a[c]>this._frameData.total)return!1}elseif(this._frameData.checkFrameName(a[c])===!1)return!1;return!0},play:function(a,b,c,d){if(this._anims[a]){if(this.currentAnim!==this._anims[a])returnthis.currentAnim&&this.currentAnim.isPlaying&&this.currentAnim.stop(),this.currentAnim=this._anims[a],this.currentAnim.paused=!1,this.currentAnim.play(b,c,d);if(this.currentAnim.isPlaying===!1)returnthis.currentAnim.paused=!1,this.currentAnim.play(b,c,d)}},stop:function(a,b){"undefined"==typeofb&&(b=!1),"string"==typeofa?this._anims[a]&&(this.currentAnim=this._anims[a],this.currentAnim.stop(b)):this.currentAnim&&this.currentAnim.stop(b)},update:function(){returnthis.updateIfVisible&&!this.sprite.visible?!1:this.currentAnim&&this.currentAnim.update()===!0?(this.currentFrame=this.currentAnim.currentFrame,!0):!1},getAnimation:function(a){return"string"==typeofa&&this._anims[a]?this._anims[a]:null},refreshFrame:function(){this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!
g=h.parseFromString(e,"text/xml")}elseg=newActiveXObject("Microsoft.XMLDOM"),g.async="false",g.loadXML(e)}catch(i){g=void0}if(!g||!g.documentElement||g.getElementsByTagName("parsererror").length)thrownewError("Phaser.Loader. Invalid Texture Atlas XML given");e=g}}this.addToFileList("textureatlas",a,c,{atlasURL:null,atlasData:e,format:f})}returnthis},removeFile:function(a,b){varc=this.getAsset(a,b);c!==!1&&this._fileList.splice(c.index,1)},removeAll:function(){this._fileList.length=0},start:function(){this.isLoading||(this.progress=0,this.progressFloat=0,this.hasLoaded=!1,this.isLoading=!0,this.onLoadStart.dispatch(this._fileList.length),this._fileList.length>0?(this._fileIndex=0,this._progressChunk=100/this._fileList.length,this.loadFile()):(this.progress=100,this.progressFloat=100,this.hasLoaded=!0,this.onLoadComplete.dispatch()))},loadFile:function(){if(!this._fileList[this._fileIndex])returnvoidconsole.warn("Phaser.Loader loadFile invalid index "+this._fileIndex);vara=this._fileList[this._fileIndex],c=this;switch(this.onFileStart.dispatch(this.progress,a.key),a.type){case"image":case"spritesheet":case"textureatlas":case"bitmapfont":a.data=newImage,a.data.name=a.key,a.data.onload=function(){returnc.fileComplete(c._fileIndex)},a.data.onerror=function(){returnc.fileError(c._fileIndex)},this.crossOrigin&&(a.data.crossOrigin=this.crossOrigin),a.data.src=this.baseURL+a.url;break;case"audio":a.url=this.getAudioURL(a.url),null!==a.url?this.game.sound.usingWebAudio?(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){returnc.fileComplete(c._fileIndex)},this._xhr.onerror=function(){returnc.fileError(c._fileIndex)},this._xhr.send()):this.game.sound.usingAudioTag&&(this.game.sound.touchLocked?(a.data=newAudio,a.data.name=a.key,a.data.preload="auto",a.data.src=this.baseURL+a.url,this.fileComplete(this._fileIndex)):(a.data=newAudio,a.data.name=a.key,a.data.onerror=function(){returnc.fileError(c._fileIndex)},a.data.preload="auto",a.data.src=this.baseURL+a.url,a.data.addEventListener("canplaythrough",b.GAMES[this.game.id].load.fileComplete(this._fileIndex),!1),a.data.load())):this.fileError(this._fileIndex);break;case"json":window.XDomainRequest?(this._ajax=newwindow.XDomainRequest,this._ajax.timeout=3e3,this._ajax.onerror=function(){returnc.dataLoadError(c._fileIndex)},this._ajax.ontimeout=function(){returnc.dataLoadError(c._fileIndex)},this._ajax.onprogress=function(){},this._ajax.onload=function(){returnc.jsonLoadComplete(c._fileIndex)},this._ajax.open("GET",this.baseURL+a.url,!0),this._ajax.send()):(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){returnc.jsonLoadComplete(c._fileIndex)},this._xhr.onerror=function(){returnc.dataLoadError(c._fileIndex)},this._xhr.send());break;case"tilemap":if(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",a.format===b.Tilemap.TILED_JSON)this._xhr.onload=function(){returnc.jsonLoadComplete(c._fileIndex)};else{if(a.format!==b.Tilemap.CSV)thrownewError("Phaser.Loader. Invalid Tilemap format: "+a.format);this._xhr.onload=function(){returnc.csvLoadComplete(c._fileIndex)}}this._xhr.onerror=function(){returnc.dataLoadError(c._fileIndex)},this._xhr.send();break;case"text":case"script":case"physics":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){returnc.fileComplete(c._fileIndex)},this._xhr.onerror=function(){returnc.fileError(c._fileIndex)},this._xhr.send();break;case"binary":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){returnc.fileComplete(c._fileIndex)},this._xhr.onerror=function(){returnc.fileError(c._fileIndex)},this._xhr.send()}},getAudioURL:function(a){varb;"string"==typeofa&&(a=[a]);for(varc=0;c<a.length;c++)if(b=a[c].toLowerCase(),b=b.substr((Math.max(0,b.lastIndexOf("."))||1/0)+1),this.game.device.canPlayAudio(b))returna[c];returnnull},fileError:function(a){this._fileList[a].loaded=!0,this._fileList[a].erro