},c.Point.normalize=function(a,b){"undefined"==typeofb&&(b=newc.Point);vard=a.getMagnitude();return0!==d&&b.setTo(a.x/d,a.y/d),b},c.Point.rotate=function(a,b,d,e,f,g){f=f||!1,g=g||null,f&&(e=c.Math.degToRad(e)),null===g&&(g=Math.sqrt((b-a.x)*(b-a.x)+(d-a.y)*(d-a.y)));varh=e+Math.atan2(a.y-d,a.x-b);returna.setTo(b+g*Math.cos(h),d+g*Math.sin(h))},c.Point.centroid=function(a,b){if("undefined"==typeofb&&(b=newc.Point),"[object Array]"!==Object.prototype.toString.call(a))thrownewError("Phaser.Point. Parameter 'points' must be an array");vard=a.length;if(1>d)thrownewError("Phaser.Point. Parameter 'points' array must not be empty");if(1===d)returnb.copyFrom(a[0]),b;for(vare=0;d>e;e++)c.Point.add(b,a[e],b);returnb.divide(d,d),b},c.Point.parse=function(a,b,d){b=b||"x",d=d||"y";vare=newc.Point;returna[b]&&(e.x=parseInt(a[b],10)),a[d]&&(e.y=parseInt(a[d],10)),e},PIXI.Point=c.Point,c.Rectangle=function(a,b,c,d){a=a||0,b=b||0,c=c||0,d=d||0,this.x=a,this.y=b,this.width=c,this.height=d},c.Rectangle.prototype={offset:function(a,b){returnthis.x+=a,this.y+=b,this},offsetPoint:function(a){returnthis.offset(a.x,a.y)},setTo:function(a,b,c,d){returnthis.x=a,this.y=b,this.width=c,this.height=d,this},scale:function(a,b){return"undefined"==typeofb&&(b=a),this.width*=a,this.height*=b,this},centerOn:function(a,b){returnthis.centerX=a,this.centerY=b,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)},copyFrom:function(a){returnthis.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){returna.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},inflate:function(a,b){returnc.Rectangle.inflate(this,a,b)},size:function(a){returnc.Rectangle.size(this,a)},clone:function(a){returnc.Rectangle.clone(this,a)},contains:function(a,b){returnc.Rectangle.contains(this,a,b)},containsRect:function(a){returnc.Rectangle.containsRect(a,this)},equals:function(a){returnc.Rectangle.equals(this,a)},intersection:function(a,b){returnc.Rectangle.intersection(this,a,b)},intersects:function(a,b){returnc.Rectangle.intersects(this,a,b)},intersectsRaw:function(a,b,d,e,f){returnc.Rectangle.intersectsRaw(this,a,b,d,e,f)},union:function(a,b){returnc.Rectangle.union(this,a,b)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},Object.defineProperty(c.Rectangle.prototype,"halfWidth",{get:function(){returnMath.round(this.width/2)}}),Object.defineProperty(c.Rectangle.prototype,"halfHeight",{get:function(){returnMath.round(this.height/2)}}),Object.defineProperty(c.Rectangle.prototype,"bottom",{get:function(){returnthis.y+this.height},set:function(a){this.height=a<=this.y?0:a-this.y}}),Object.defineProperty(c.Rectangle.prototype,"bottomRight",{get:function(){returnnewc.Point(this.right,this.bottom)},set:function(a){this.right=a.x,this.bottom=a.y}}),Object.defineProperty(c.Rectangle.prototype,"left",{get:function(){returnthis.x},set:function(a){this.width=a>=this.right?0:this.right-a,this.x=a}}),Object.defineProperty(c.Rectangle.prototype,"right",{get:function(){returnthis.x+this.width},set:function(a){this.width=a<=this.x?0:a-this.x}}),Object.defineProperty(c.Rectangle.prototype,"volume",{get:function(){returnthis.width*this.height}}),Object.defineProperty(c.Rectangle.prototype,"perimeter",{get:function(){return2*this.width+2*this.height}}),Object.defineProperty(c.Rectangle.prototype,"centerX",{get:function(){returnthis.x+this.halfWidth},set:function(a){this.x=a-this.halfWidth}}),Object.defineProperty(c.Rectangle.prototype,"centerY",{get:function(){returnthis.y+this.halfHeight},set:function(a){this.y=a-this.halfHeight}}),Object.defineProperty(c.Rectangle.prototype,"randomX",{get:function(){returnthis.x+Math.random()*this.width}}),Object.defineProperty(c.Rectangle.prototype,"randomY",{get:function(){returnthis.y+Math.random()*this.height}}),Object.defineProperty(c.Rectangle.prototype
},unlink:function(a){this.states[a]&&(this.states[a].game=null,this.states[a].add=null,this.states[a].make=null,this.states[a].camera=null,this.states[a].cache=null,this.states[a].input=null,this.states[a].load=null,this.states[a].math=null,this.states[a].sound=null,this.states[a].scale=null,this.states[a].state=null,this.states[a].stage=null,this.states[a].time=null,this.states[a].tweens=null,this.states[a].world=null,this.states[a].particles=null,this.states[a].rnd=null,this.states[a].physics=null)},setCurrentState:function(a){this.callbackContext=this.states[a],this.link(a),this.onInitCallback=this.states[a].init||this.dummy,this.onPreloadCallback=this.states[a].preload||null,this.onLoadRenderCallback=this.states[a].loadRender||null,this.onLoadUpdateCallback=this.states[a].loadUpdate||null,this.onCreateCallback=this.states[a].create||null,this.onUpdateCallback=this.states[a].update||null,this.onPreRenderCallback=this.states[a].preRender||null,this.onRenderCallback=this.states[a].render||null,this.onResizeCallback=this.states[a].resize||null,this.onPausedCallback=this.states[a].paused||null,this.onResumedCallback=this.states[a].resumed||null,this.onPauseUpdateCallback=this.states[a].pauseUpdate||null,this.onShutDownCallback=this.states[a].shutdown||this.dummy,this.current=a,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),a===this._pendingState&&(this._args=[])},getCurrentState:function(){returnthis.states[this.current]},loadComplete:function(){this._created===!1&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.call(this.callbackContext,this.game)):this._created=!0},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)},pauseUpdate:function(){this._created&&this.onPauseUpdateCallback?this.onPauseUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},preRender:function(a){this.onPreRenderCallback&&this.onPreRenderCallback.call(this.callbackContext,this.game,a)},resize:function(a,b){this.onResizeCallback&&this.onResizeCallback.call(this.callbackContext,a,b)},render:function(){this._created&&this.onRenderCallback?(this.game.renderType===c.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===c.CANVAS&&this.game.context.restore()):this.onLoadRenderCallback&&this.onLoadRenderCallback.call(this.callbackContext,this.game)},destroy:function(){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.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onPauseUpdateCallback=null,this.game=null,this.states={},this._pendingState=null}},c.StateManager.prototype.constructor=c.StateManager,c.Signal=function(){},c.Signal.prototype={_bindings:null,_prevParams:null,memorize:!1,_shouldPropagate:!0,active:!0,_boundDispatch:!0,validateListener:function(a,b){if("function"!=typeofa)thrownewError("Phaser.Signal: listener is a required param of {fn}() and should be a Function.".replace("{fn}",b))},_registerListener:function(a,b,d,e){varf,g=this._indexOfListener(a,d);if(-1!==g){if(f=this._bindings[g],f.isOnce()!==b)thrownewError("You cannot add"+(b?"":"Once")+"() then add"+(b?"Once":"")+"() the same listener without removing the relationship first.")}elsef=newc.SignalBinding(this,a,b,d,e),this._addBinding(f);returnthis.memorize&&this._prevParams&&f.execute(this._prevParams),f},_addBinding:function(a){this
vard=newc.FlexLayer(this,this.positionFluid,this.boundsFluid,this.scaleFluid);returnb&&this.game.world.add(d),this.layers.push(d),"undefined"!=typeofa&&null!==typeofa&&d.addMultiple(a),d},createFullLayer:function(a){varb=newc.FlexLayer(this,this.positionFull,this.boundsFull,this.scaleFluid);returnthis.game.world.add(b),this.layers.push(b),"undefined"!=typeofa&&b.addMultiple(a),b},createFixedLayer:function(a){varb=newc.FlexLayer(this,this.positionNone,this.boundsNone,this.scaleNone);returnthis.game.world.add(b),this.layers.push(b),"undefined"!=typeofa&&b.addMultiple(a),b},reset:function(){for(vara=this.layers.length;a--;)this.layers[a].persist||(this.layers[a].position=null,this.layers[a].scale=null,this.layers.slice(a,1))},onResize:function(a,b){this.ratioH=a/b,this.ratioV=b/a,this.refresh(a,b)},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(a){this.manager.scaleSprite(a),a.x=this.manager.bounds.centerX,a.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)}},c.FlexGrid.prototype.constructor=c.FlexGrid,c.FlexLayer=function(a,b,d,e){c.Group.call(this,a.game,null,"__flexLayer"+a.game.rnd.uuid(),!1),this.manager=a.manager,this.grid=a,this.persist=!1,this.position=b,this.bounds=d,this.scale=e,this.topLeft=d.topLeft,this.topMiddle=newc.Point(d.halfWidth,0),this.topRight=d.topRight,this.bottomLeft=d.bottomLeft,this.bottomMiddle=newc.Point(d.halfWidth,d.bottom),this.bottomRight=d.bottomRight},c.FlexLayer.prototype=Object.create(c.Group.prototype),c.FlexLayer.prototype.constructor=c.FlexLayer,c.FlexLayer.prototype.resize=function(){},c.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")},c.ScaleManager=function(a,b,d){this.game=a,this.dom=c.DOM,this.grid=null,this.width=0,this.height=0,this.minWidth=null,this.maxWidth=null,this.minHeight=null,this.maxHeight=null,this.offset=newc.Point,this.forceLandscape=!1,this.forcePortrait=!1,this.incorrectOrientation=!1,this._pageAlignHorizontally=!1,this._pageAlignVertically=!1,this.maxIterations=5,this.onOrientationChange=newc.Signal,this.enterLandscape=newc.Signal,this.enterPortrait=newc.Signal,this.enterIncorrectOrientation=newc.Signal,this.leaveIncorrectOrientation=newc.Signal,this.fullScreenTarget=null,this._createdFullScreenTarget=null,this.onFullScreenInit=newc.Signal,this.onFullScreenChange=newc.Signal,this.onFullScreenError=newc.Signal,this.enterFullScreen=newc.Signal,this.leaveFullScreen=newc.Signal,this.fullScreenFailed=this.onFullScreenError,this.screenOrientation=this.dom.getScreenOrientation(),this.scaleFactor=newc.Point(1,1),this.scaleFactorInversed=newc.Point(1,1),this.margin={left:0,top:0,right:0,bottom:0,x:0,y:0},this.bounds=newc.Rectangle,this.aspec
},c.Input.MOUSE_OVERRIDES_TOUCH=0,c.Input.TOUCH_OVERRIDES_MOUSE=1,c.Input.MOUSE_TOUCH_COMBINE=2,c.Input.MAX_POINTERS=10,c.Input.prototype={boot:function(){this.mousePointer=newc.Pointer(this.game,0),this.addPointer(),this.addPointer(),this.mouse=newc.Mouse(this.game),this.keyboard=newc.Keyboard(this.game),this.touch=newc.Touch(this.game),this.mspointer=newc.MSPointer(this.game),this.gamepad=newc.Gamepad(this.game),this.onDown=newc.Signal,this.onUp=newc.Signal,this.onTap=newc.Signal,this.onHold=newc.Signal,this.scale=newc.Point(1,1),this.speed=newc.Point,this.position=newc.Point,this._oldPosition=newc.Point,this.circle=newc.Circle(0,0,44),this.activePointer=this.mousePointer,this.currentPointers=0,this.hitCanvas=document.createElement("canvas"),this.hitCanvas.width=1,this.hitCanvas.height=1,this.hitContext=this.hitCanvas.getContext("2d"),this.mouse.start(),this.keyboard.start(),this.touch.start(),this.mspointer.start(),this.mousePointer.active=!0;vara=this;this._onClickTrampoline=function(b){a.onClickTrampoline(b)},this.game.canvas.addEventListener("click",this._onClickTrampoline,!1)},destroy:function(){this.mouse.stop(),this.keyboard.stop(),this.touch.stop(),this.mspointer.stop(),this.gamepad.stop(),this.moveCallbacks=[],this.game.canvas.removeEventListener("click",this._onClickTrampoline)},addMoveCallback:function(a,b){returnthis.moveCallbacks.push({callback:a,context:b})-1},deleteMoveCallback:function(a){this.moveCallbacks[a]&&this.moveCallbacks.splice(a,1)},addPointer:function(){if(this.pointers.length>=c.Input.MAX_POINTERS)returnconsole.warn("Phaser.Input.addPointer: only "+c.Input.MAX_POINTERS+" pointer allowed"),null;vara=this.pointers.length+1,b=newc.Pointer(this.game,a);returnthis.pointers.push(b),this["pointer"+a]=b,b},update:function(){if(this.keyboard.update(),this.pollRate>0&&this._pollCounter<this.pollRate)returnvoidthis._pollCounter++;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.active&&this.gamepad.update();for(vara=0;a<this.pointers.length;a++)this.pointers[a].update();this._pollCounter=0},reset:function(a){if(this.game.isBooted&&!this.resetLocked){"undefined"==typeofa&&(a=!1),this.keyboard.reset(a),this.mousePointer.reset(),this.gamepad.reset();for(varb=0;b<this.pointers.length;b++)this.pointers[b].reset();this.currentPointers=0,"none"!==this.game.canvas.style.cursor&&(this.game.canvas.style.cursor="inherit"),a&&(this.onDown.dispose(),this.onUp.dispose(),this.onTap.dispose(),this.onHold.dispose(),this.onDown=newc.Signal,this.onUp=newc.Signal,this.onTap=newc.Signal,this.onHold=newc.Signal,this.moveCallbacks=[]),this._pollCounter=0}},resetSpeed:function(a,b){this._oldPosition.setTo(a,b),this.speed.setTo(0,0)},startPointer:function(a){if(this.maxPointers>=0&&this.countActivePointers(this.maxPointers)>=this.maxPointers)returnnull;if(!this.pointer1.active)returnthis.pointer1.start(a);if(!this.pointer2.active)returnthis.pointer2.start(a);for(varb=2;b<this.pointers.length;b++){varc=this.pointers[b];if(!c.active)returnc.start(a)}returnnull},updatePointer:function(a){if(this.pointer1.active&&this.pointer1.identifier===a.identifier)returnthis.pointer1.move(a);if(this.pointer2.active&&this.pointer2.identifier===a.identifier)returnthis.pointer2.move(a);for(varb=2;b<this.pointers.length;b++){varc=this.pointers[b];if(c.active&&c.identifier===a.identifier)returnc.move(a)}returnnull},stopPointer:function(a){if(this.pointer1.active&&this.pointer1.identifier===a.identifier)returnthis.pointer1.stop(a);if(this.pointer2.active&&this.pointer2.identifier===a.identifier)returnthis.pointer2.stop(a);for(varb=2;b<this.pointers.length;b++){varc=this.pointers[b];if(c.active&&c.identifier===a.identifier)returnc.stop(a)}returnnull},countActivePointers:function(a){"undefined"==typeofa&&(a=this.pointers.length);for(varb=a,c=0;c<this.pointers.length&&b>0;c++){vard=this.pointers[c];d.active&&b--}returnthis.currentPointers=a-b,a-b},getPointer:function(a)
},play:function(a,b,c,d){returnthis._anims[a]?this.currentAnim===this._anims[a]?this.currentAnim.isPlaying===!1?(this.currentAnim.paused=!1,this.currentAnim.play(b,c,d)):this.currentAnim:(this.currentAnim&&this.currentAnim.isPlaying&&this.currentAnim.stop(),this.currentAnim=this._anims[a],this.currentAnim.paused=!1,this.currentFrame=this.currentAnim.currentFrame,this.currentAnim.play(b,c,d)):void0},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},next:function(a){this.currentAnim&&(this.currentAnim.next(a),this.currentFrame=this.currentAnim.currentFrame)},previous:function(a){this.currentAnim&&(this.currentAnim.previous(a),this.currentFrame=this.currentAnim.currentFrame)},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=!1,this.tilingTexture=!1)},destroy:function(){vara=null;for(varainthis._anims)this._anims.hasOwnProperty(a)&&this._anims[a].destroy();this._anims={},this._frameData=null,this._frameIndex=0,this.currentAnim=null,this.currentFrame=null}},c.AnimationManager.prototype.constructor=c.AnimationManager,Object.defineProperty(c.AnimationManager.prototype,"frameData",{get:function(){returnthis._frameData}}),Object.defineProperty(c.AnimationManager.prototype,"frameTotal",{get:function(){returnthis._frameData.total}}),Object.defineProperty(c.AnimationManager.prototype,"paused",{get:function(){returnthis.currentAnim.isPaused},set:function(a){this.currentAnim.paused=a}}),Object.defineProperty(c.AnimationManager.prototype,"name",{get:function(){returnthis.currentAnim?this.currentAnim.name:void0}}),Object.defineProperty(c.AnimationManager.prototype,"frame",{get:function(){returnthis.currentFrame?this._frameIndex:void0},set:function(a){"number"==typeofa&&null!==this._frameData.getFrame(a)&&(this.currentFrame=this._frameData.getFrame(a),this.currentFrame&&(this._frameIndex=a,this.sprite.setFrame(this.currentFrame),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)))}}),Object.defineProperty(c.AnimationManager.prototype,"frameName",{get:function(){returnthis.currentFrame?this.currentFrame.name:void0},set:function(a){"string"==typeofa&&null!==this._frameData.getFrameByName(a)?(this.currentFrame=this._frameData.getFrameByName(a),this.currentFrame&&(this._frameIndex=this.currentFrame.index,this.sprite.setFrame(this.currentFrame),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1))):console.warn("Cannot set frameName: "+a)}}),c.Animation=function(a,b,d,e,f,g,h){"undefined"==typeofh&&(h=!1),this.game=a,this._parent=b,this._frameData=e,this.name=d,this._frames=[],this._frames=this._frames.concat(f),this.delay=1e3/g,this.loop=h,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=newc.Signal,this.onUpdate=null,this.onComplete=newc.Signal,this.onLoop=newc.Signal,this.game.onPause.add(this.onPause,this),this.game.onResume.add(this.onResume,this)},c.Animation.prototype={play:function(a,b,c){return"number"==typeofa&&(this.delay=1e3/a),"boolean"==typeofb&&(this.loop=b),"undefined"!=typeofc&&(this.killOnComplete=c),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.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTextur
},bitmapFont:function(a,b,c,d,e,f){if("undefined"==typeofc&&(c=null),"undefined"==typeofd&&(d=null),"undefined"==typeofe&&(e=0),"undefined"==typeoff&&(f=0),c)this.addToFileList("bitmapfont",a,b,{xmlURL:c,xSpacing:e,ySpacing:f});elseif("string"==typeofd){varg;try{if(window.DOMParser){varh=newDOMParser;g=h.parseFromString(d,"text/xml")}elseg=newActiveXObject("Microsoft.XMLDOM"),g.async="false",g.loadXML(d)}catch(i){g=void0}if(!g||!g.documentElement||g.getElementsByTagName("parsererror").length)thrownewError("Phaser.Loader. Invalid Bitmap Font XML given");this.addToFileList("bitmapfont",a,b,{xmlURL:null,xmlData:g,xSpacing:e,ySpacing:f})}returnthis},atlasJSONArray:function(a,b,d,e){returnthis.atlas(a,b,d,e,c.Loader.TEXTURE_ATLAS_JSON_ARRAY)},atlasJSONHash:function(a,b,d,e){returnthis.atlas(a,b,d,e,c.Loader.TEXTURE_ATLAS_JSON_HASH)},atlasXML:function(a,b,d,e){returnthis.atlas(a,b,d,e,c.Loader.TEXTURE_ATLAS_XML_STARLING)},atlas:function(a,b,d,e,f){if("undefined"==typeofd&&(d=null),"undefined"==typeofe&&(e=null),"undefined"==typeoff&&(f=c.Loader.TEXTURE_ATLAS_JSON_ARRAY),d)this.addToFileList("textureatlas",a,b,{atlasURL:d,format:f});else{switch(f){casec.Loader.TEXTURE_ATLAS_JSON_ARRAY:"string"==typeofe&&(e=JSON.parse(e));break;casec.Loader.TEXTURE_ATLAS_XML_STARLING:if("string"==typeofe){varg;try{if(window.DOMParser){varh=newDOMParser;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,b,{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._packList.length>0?(this._packIndex=0,this.loadPack()):this.beginLoad())},beginLoad:function(){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.isLoading=!1,this.onLoadComplete.dispatch())},loadPack:function(){if(!this._packList[this._packIndex])returnvoidconsole.warn("Phaser.Loader loadPackList invalid index "+this._packIndex);vara=this._packList[this._packIndex];null!==a.data?this.packLoadComplete(this._packIndex,!1):this.xhrLoad(this._packIndex,this.baseURL+a.url,"text","packLoadComplete","packLoadError")},packLoadComplete:function(a,b){if("undefined"==typeofb&&(b=!0),!this._packList[a])returnvoidconsole.warn("Phaser.Loader packLoadComplete invalid index "+a);vard=this._packList[a];if(d.loaded=!0,b)vare=JSON.parse(this._xhr.responseText);elsevare=this._packList[a].data;if(e[d.key])for(varf,g=0;g<e[d.key].length;g++)switch(f=e[d.key][g],f.type){case"image":this.image(f.key,f.url,f.overwrite);break;case"text":this.text(f.key,f.url,f.overwrite);break;case"json":this.json(f.key,f.url,f.overwrite);break;case"xml":this.xml(f.key,f.url,f.overwrite);break;case"script":this.script(f.key,f.url,f.callback,d.callbackContext);break;case"binary":this.binary(f.key,f.url,f.callback,d.callbackContext);break;case"spritesheet":this.spritesheet(f.key,f.url,f.frameWidth,f.frameHeight,f.frameMax,f.margin,f.spacing);break;case"audio":this.audio(f.key,f.urls,f.autoDecode);break;case"tilemap":this.tilemap(f.key,f.url,f.data,c.Tilemap[f.format]);break;case"physics":this.physics(f.key,f.url,f.data,c.Loader[f.format]);break;case"bitmapFont":this.bitmapFont(f.key,f.textureURL,f.xmlURL,f.xmlData,f.xSpacing,f.ySpacing);break;case"atlasJSONArray":this.atlasJSONArray(f.key,f.textureURL,f.atlasURL,f.atlasData);break;case"atlasJSONHash":this.atlasJSONHash(f.key,f.textureURL,f.atlasURL,f.atlasData);break;case"atlasXML":this.atlasXML(f.key,f.textureURL,f.atlasURL,f.atlasData);break;case"atlas":this.atlas(f.key,f.textureURL,f.at