}}),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("Phaser.Signal: 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;dob--;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.validateListener(a,"remove");varc=this._indexOfListener(a,b);return-1!==c&&(this._bindings[c]._destroy(),this._bindings.splice(c,1)),a},removeAll:function(a){"undefined"==typeofa&&(a=null);for(varb=this._bindings.length;b--;)a?this._bindings[b].context===a&&(this._bindings[b]._destroy(),this._bindings.splice(b,1)):this._bindings[b]._destroy();a||(this._bindings.length=0)},getNumListeners:function(){returnthis._bindings.length},halt:function(){this._shouldPropagate=!1},dispatch:function(){if(this.active){vara,b=Array.prototype.slice.call(arguments),c=this._bindings.length;if(this.memorize&&(this._prevParams=b),c){a=this._bindings.slice(),this._shouldPropagate=!0;doc--;while(a[c]&&this._shouldPropagate&&a[c].execute(b)!==!1)}}},forget:function(){this._prevParams=null},dispose:function(){this.removeAll(),deletethis._bindings,deletethis._prevParams},toString:function(){return"[Phaser.Signal active:"+this.active+" numListeners:"+this.getNumListeners()+"]"}},b.Signal.prototype.constructor=b.Signal,b.SignalBinding=function(a,b,c,d,e){this._listener=b,this._isOnce=c,this.context=d,this._signal=a,this._priority=e||0},b.SignalBinding.prototype={active:!0,params:null,execute:function(a){varb,c;returnthis.active&&this._listener&&(c=this.params?this.params.concat(a):a,b=this._listener.apply(this.context,c),this._isOnce&&this.detach()),b},detach:function(){returnthis.isBound()?this._signal.remove(this._listener,this.context):null},isBound:function(){return!!this._signal&&!!this._listener},isOnce:function(){returnthis._isOnce},getListener:function(){returnthis._listener},getSignal:function(){returnthis._signal},_destroy:function(){deletethis._signal,deletethis._listener,deletethis.context},toString:function(){return"[Phaser.SignalBinding isOnce:"+this._isOnce+", isBound:"+this.isBound()+", active:"+this.active+"]"}},b.SignalBinding.prototype.constructor=b.SignalBinding,b.Filter=function(a,c,d){this.game=a,this.type=b.WEBGL_FILTER,this.passes=[this],this.shaders=[],this.dirty=!0,this.padding=0,this.prevPoint=newb.Point;vare=newDate;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:[e.getFullYear(),e.getMonth(),e.getDate(),60*e.getHours()*60+60*e.getMinutes()+e.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}}},c)for(varfinc)this.uniforms[f]=c[f];this.fragmentSrc=d||[]},b.Filter.prototype={init:functi
},b.BitmapData.prototype.constructor=b.BitmapData,b.Sprite=function(a,c,d,e,f){c=c||0,d=d||0,e=e||null,f=f||null,this.game=a,this.name="",this.type=b.SPRITE,this.z=0,this.events=newb.Events(this),this.animations=newb.AnimationManager(this),this.key=e,PIXI.Sprite.call(this,PIXI.TextureCache.__default),this.position.set(c,d),this.world=newb.Point(c,d),this.autoCull=!1,this.input=null,this.body=null,this.alive=!0,this.health=1,this.lifespan=0,this.checkWorldBounds=!1,this.outOfBoundsKill=!1,this.debug=!1,this.cameraOffset=newb.Point,this.cropRect=null,this._cache=[0,0,0,0,1,0,1,0],this._crop=null,this._frame=null,this._bounds=newb.Rectangle,this.loadTexture(e,f)},b.Sprite.prototype=Object.create(PIXI.Sprite.prototype),b.Sprite.prototype.constructor=b.Sprite,b.Sprite.prototype.preUpdate=function(){if(1===this._cache[4]&&this.exists)returnthis.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._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,this.body&&this.body.preUpdate(),this._cache[4]=0,!1;if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)returnthis._cache[3]=-1,!1;if(this.lifespan>0&&(this.lifespan-=this.game.time.elapsed,this.lifespan<=0))returnthis.kill(),!1;if((this.autoCull||this.checkWorldBounds)&&this._bounds.copyFrom(this.getBounds()),this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this._bounds)),this.checkWorldBounds)if(1===this._cache[5]&&this.game.world.bounds.intersects(this._bounds))this._cache[5]=0,this.events.onEnterBounds.dispatch(this);elseif(0===this._cache[5]&&!this.game.world.bounds.intersects(this._bounds)&&(this._cache[5]=1,this.events.onOutOfBounds.dispatch(this),this.outOfBoundsKill))returnthis.kill(),!1;this.world.setTo(this.game.camera.x+this.worldTransform.tx,this.game.camera.y+this.worldTransform.ty),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++),this.animations.update(),this.body&&this.body.preUpdate();for(vara=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Sprite.prototype.update=function(){},b.Sprite.prototype.postUpdate=function(){this.keyinstanceofb.BitmapData&&this.key.render(),this.exists&&this.body&&this.body.postUpdate(),1===this._cache[7]&&(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);for(vara=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Sprite.prototype.loadTexture=function(a,c,d){c=c||0,(d||"undefined"==typeofd)&&this.animations.stop(),this.key=a;vare=!0,f=this.smoothed;ainstanceofb.RenderTexture?(this.key=a.key,this.setTexture(a)):ainstanceofb.BitmapData?(this.setTexture(a.texture),this.game.cache.getFrameData(a.key,b.Cache.BITMAPDATA)&&(e=!this.animations.loadFrameData(this.game.cache.getFrameData(a.key,b.Cache.BITMAPDATA),c))):ainstanceofPIXI.Texture?this.setTexture(a):null===a||"undefined"==typeofa?(this.key="__default",this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeofa||this.game.cache.checkImageKey(a)?(this.setTexture(newPIXI.Texture(PIXI.BaseTextureCache[a])),e=!this.animations.loadFrameData(this.game.cache.getFrameData(a),c)):(console.warn("Texture with key '"+a+"' not found."),this.key="__missing",this.setTexture(PIXI.TextureCache[this.key])),this.texture.baseTexture.dirty(),e&&(this._frame=b.Rectangle.clone(this.texture.frame)),f||(this.smoothed=!1)},b.Sprite.prototype.setFrame=function(a){this._frame=a,this.texture.frame.x=a.x,this.texture.frame.y=a.y,this.texture.frame.width=a.width,this.texture.frame.height=a.height,this.texture.crop.x=a.x,this.texture.crop.y=a.y,this.texture.crop.width=a.width,this.texture.crop.height=a.height,a.trimmed?(this.texture.trim?(this.texture.trim.x=a.spriteSourceSizeX,this.texture.trim.y=a.spriteSourceSizeY,this.texture.trim.width=a.sourceSizeW,this.texture.trim
for(varainthis._bitmapDatas)deletethis._bitmapDatas[a];for(varainthis._bitmapFont)deletethis._bitmapFont[a];this._urlMap=null,this._urlResolver=null,this._urlTemp=null}},b.Cache.prototype.constructor=b.Cache,b.Loader=function(a){this.game=a,this.isLoading=!1,this.hasLoaded=!1,this.progress=0,this.progressFloat=0,this.preloadSprite=null,this.crossOrigin=!1,this.baseURL="",this.onLoadStart=newb.Signal,this.onFileStart=newb.Signal,this.onFileComplete=newb.Signal,this.onFileError=newb.Signal,this.onLoadComplete=newb.Signal,this.onPackComplete=newb.Signal,this.useXDomainRequest=9===this.game.device.ieVersion,this._packList=[],this._packIndex=0,this._fileList=[],this._fileIndex=0,this._progressChunk=0,this._xhr=newXMLHttpRequest,this._ajax=null},b.Loader.TEXTURE_ATLAS_JSON_ARRAY=0,b.Loader.TEXTURE_ATLAS_JSON_HASH=1,b.Loader.TEXTURE_ATLAS_XML_STARLING=2,b.Loader.PHYSICS_LIME_CORONA_JSON=3,b.Loader.PHYSICS_PHASER_JSON=4,b.Loader.prototype={setPreloadSprite:function(a,c){c=c||0,this.preloadSprite={sprite:a,direction:c,width:a.width,height:a.height,rect:null},this.preloadSprite.rect=0===c?newb.Rectangle(0,0,1,a.height):newb.Rectangle(0,0,a.width,1),a.crop(this.preloadSprite.rect),a.visible=!0},checkKeyExists:function(a,b){if(this._fileList.length>0)for(varc=0;c<this._fileList.length;c++)if(this._fileList[c].type===a&&this._fileList[c].key===b)return!0;return!1},getAssetIndex:function(a,b){if(this._fileList.length>0)for(varc=0;c<this._fileList.length;c++)if(this._fileList[c].type===a&&this._fileList[c].key===b)returnc;return-1},getAsset:function(a,b){if(this._fileList.length>0)for(varc=0;c<this._fileList.length;c++)if(this._fileList[c].type===a&&this._fileList[c].key===b)return{index:c,file:this._fileList[c]};return!1},reset:function(){this.preloadSprite=null,this.isLoading=!1,this._packList.length=0,this._packIndex=0,this._fileList.length=0,this._fileIndex=0},addToFileList:function(a,b,c,d){vare={type:a,key:b,url:c,data:null,error:!1,loaded:!1};if("undefined"!=typeofd)for(varfind)e[f]=d[f];this.checkKeyExists(a,b)===!1&&this._fileList.push(e)},replaceInFileList:function(a,b,c,d){vare={type:a,key:b,url:c,data:null,error:!1,loaded:!1};if("undefined"!=typeofd)for(varfind)e[f]=d[f];varg=this.getAssetIndex(a,b);-1===g?this._fileList.push(e):this._fileList[g]=e},pack:function(a,b,c,d){return"undefined"==typeofb&&(b=null),"undefined"==typeofc&&(c=null),"undefined"==typeofd&&(d=this),null===b&&null===c?(console.warn("Phaser.Loader.pack - Both url and data are null. One must be set."),this):(c&&"string"==typeofc&&(c=JSON.parse(c)),this._packList.push({key:a,url:b,data:c,loaded:!1,error:!1,callbackContext:d}),this)},image:function(a,b,c){return"undefined"==typeofc&&(c=!1),c?this.replaceInFileList("image",a,b):this.addToFileList("image",a,b),this},text:function(a,b,c){return"undefined"==typeofc&&(c=!1),c?this.replaceInFileList("text",a,b):this.addToFileList("text",a,b),this},json:function(a,b,c){return"undefined"==typeofc&&(c=!1),c?this.replaceInFileList("json",a,b):this.addToFileList("json",a,b),this},xml:function(a,b,c){return"undefined"==typeofc&&(c=!1),c?this.replaceInFileList("xml",a,b):this.addToFileList("xml",a,b),this},script:function(a,b,c,d){return"undefined"==typeofc&&(c=!1),c!==!1&&"undefined"==typeofd&&(d=c),this.addToFileList("script",a,b,{callback:c,callbackContext:d}),this},binary:function(a,b,c,d){return"undefined"==typeofc&&(c=!1),c!==!1&&"undefined"==typeofd&&(d=c),this.addToFileList("binary",a,b,{callback:c,callbackContext:d}),this},spritesheet:function(a,b,c,d,e,f,g){return"undefined"==typeofe&&(e=-1),"undefined"==typeoff&&(f=0),"undefined"==typeofg&&(g=0),this.addToFileList("spritesheet",a,b,{frameWidth:c,frameHeight:d,frameMax:e,margin:f,spacing:g}),this},audio:function(a,b,c){return"undefined"==typeofc&&(c=!0),this.addToFileList("audio",a,b,{buffer:null,autoDecode:c}),this},audiosprite:function(a,b,c){returnthis.audio(a,b),this.json(a+"-audioatlas",c),this},tilemap:function(a,c,d,e){if("undefined"==typeofc&&(c=null),"undefined"==typeofd&&(d=null),"undefined"==typeof
},set:function(a,b,c){a._arr[b]=c}}},{"base64-js":3,typedarray:4}],"native-buffer-browserify":[function(a,b){b.exports=a("PcZj9L")},{}],3:[function(a,b){!function(){"use strict";functiona(a){varb,c,e,f,g,h;if(a.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(g=a.indexOf("="),g=g>0?a.length-g:0,h=[],e=g>0?a.length-4:a.length,b=0,c=0;e>b;b+=4,c+=3)f=d.indexOf(a[b])<<18|d.indexOf(a[b+1])<<12|d.indexOf(a[b+2])<<6|d.indexOf(a[b+3]),h.push((16711680&f)>>16),h.push((65280&f)>>8),h.push(255&f);return2===g?(f=d.indexOf(a[b])<<2|d.indexOf(a[b+1])>>4,h.push(255&f)):1===g&&(f=d.indexOf(a[b])<<10|d.indexOf(a[b+1])<<4|d.indexOf(a[b+2])>>2,h.push(f>>8&255),h.push(255&f)),h}functionc(a){functionb(a){returnd[a>>18&63]+d[a>>12&63]+d[a>>6&63]+d[63&a]}varc,e,f,g=a.length%3,h="";for(c=0,f=a.length-g;f>c;c+=3)e=(a[c]<<16)+(a[c+1]<<8)+a[c+2],h+=b(e);switch(g){case1:e=a[a.length-1],h+=d[e>>2],h+=d[e<<4&63],h+="==";break;case2:e=(a[a.length-2]<<8)+a[a.length-1],h+=d[e>>10],h+=d[e>>4&63],h+=d[e<<2&63],h+="="}returnh}vard="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";b.exports.toByteArray=a,b.exports.fromByteArray=c}()},{}],4:[function(a,b,c){functiond(a){if(L&&K){varb,c=L(a);for(b=0;b<c.length;b+=1)K(a,c[b],{value:a[c[b]],writable:!1,enumerable:!1,configurable:!1})}}functione(a){functionb(b){K(a,b,{get:function(){returna._getter(b)},set:function(c){a._setter(b,c)},enumerable:!0,configurable:!1})}if(K){if(a.length>B)thrownewRangeError("Array too large for polyfill");varc;for(c=0;c<a.length;c+=1)b(c)}}functionf(a,b){varc=32-b;returna<<c>>c}functiong(a,b){varc=32-b;returna<<c>>>c}functionh(a){return[255&a]}functioni(a){returnf(a[0],8)}functionj(a){return[255&a]}functionk(a){returng(a[0],8)}functionl(a){returna=J(Number(a)),[0>a?0:a>255?255:255&a]}functionm(a){return[a>>8&255,255&a]}functionn(a){returnf(a[0]<<8|a[1],16)}functiono(a){return[a>>8&255,255&a]}functionp(a){returng(a[0]<<8|a[1],16)}functionq(a){return[a>>24&255,a>>16&255,a>>8&255,255&a]}functionr(a){returnf(a[0]<<24|a[1]<<16|a[2]<<8|a[3],32)}functions(a){return[a>>24&255,a>>16&255,a>>8&255,255&a]}functiont(a){returng(a[0]<<24|a[1]<<16|a[2]<<8|a[3],32)}functionu(a,b,c){functiond(a){varb=F(a),c=a-b;return.5>c?b:c>.5?b+1:b%2?b+1:b}vare,f,g,h,i,j,k,l=(1<<b-1)-1;for(a!==a?(f=(1<<b)-1,g=I(2,c-1),e=0):1/0===a||a===-1/0?(f=(1<<b)-1,g=0,e=0>a?1:0):0===a?(f=0,g=0,e=1/a===-1/0?1:0):(e=0>a,a=E(a),a>=I(2,1-l)?(f=H(F(G(a)/D),1023),g=d(a/I(2,f)*I(2,c)),g/I(2,c)>=2&&(f+=1,g=1),f>l?(f=(1<<b)-1,g=0):(f+=l,g-=I(2,c))):(f=0,g=d(a/I(2,1-l-c)))),i=[],h=c;h;h-=1)i.push(g%2?1:0),g=F(g/2);for(h=b;h;h-=1)i.push(f%2?1:0),f=F(f/2);for(i.push(e?1:0),i.reverse(),j=i.join(""),k=[];j.length;)k.push(parseInt(j.substring(0,8),2)),j=j.substring(8);returnk}functionv(a,b,c){vard,e,f,g,h,i,j,k,l=[];for(d=a.length;d;d-=1)for(f=a[d-1],e=8;e;e-=1)l.push(f%2?1:0),f>>=1;returnl.reverse(),g=l.join(""),h=(1<<b-1)-1,i=parseInt(g.substring(0,1),2)?-1:1,j=parseInt(g.substring(1,1+b),2),k=parseInt(g.substring(1+b),2),j===(1<<b)-1?0!==k?0/0:1/0*i:j>0?i*I(2,j-h)*(1+k/I(2,c)):0!==k?i*I(2,-(h-1))*(k/I(2,c)):0>i?-0:0}functionw(a){returnv(a,11,52)}functionx(a){returnu(a,11,52)}functiony(a){returnv(a,8,23)}functionz(a){returnu(a,8,23)}varA=void0,B=1e5,C=function(){vara=Object.prototype.toString,b=Object.prototype.hasOwnProperty;return{Class:function(b){returna.call(b).replace(/^\[object *|\]$/g,"")},HasProperty:function(a,b){returnbina},HasOwnProperty:function(a,c){returnb.call(a,c)},IsCallable:function(a){return"function"==typeofa},ToInt32:function(a){returna>>0},ToUint32:function(a){returna>>>0}}}(),D=Math.LN2,E=Math.abs,F=Math.floor,G=Math.log,H=Math.min,I=Math.pow,J=Math.round,K=Object.defineProperty||function(a,b,c){if(!a===Object(a))thrownewTypeError("Object.defineProperty called on non-object");returnC.HasProperty(c,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(a,b,c.get),C.HasProperty(c,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(a,b,c.set),C.HasPr
c.prototype.computeGiMf=function(){vara=this.bodyA,b=this.bodyB,c=a.force,e=a.angularForce,f=b.force,g=b.angularForce,j=a.invMassSolve,k=b.invMassSolve,l=a.invInertiaSolve,m=b.invInertiaSolve,n=this.G;returnd.scale(h,c,j),d.scale(i,f,k),this.gmult(n,h,e*l,i,g*m)},c.prototype.computeGiMGt=function(){vara=this.bodyA,b=this.bodyB,c=a.invMassSolve,d=b.invMassSolve,e=a.invInertiaSolve,f=b.invInertiaSolve,g=this.G;returng[0]*g[0]*c+g[1]*g[1]*c+g[2]*g[2]*e+g[3]*g[3]*d+g[4]*g[4]*d+g[5]*g[5]*f};{varj=d.create(),k=d.create(),l=d.create();d.create(),d.create(),d.create()}c.prototype.addToWlambda=function(a){varb=this.bodyA,c=this.bodyB,e=j,f=k,g=l,h=b.invMassSolve,i=c.invMassSolve,m=b.invInertiaSolve,n=c.invInertiaSolve,o=this.G;f[0]=o[0],f[1]=o[1],g[0]=o[3],g[1]=o[4],d.scale(e,f,h*a),d.add(b.vlambda,b.vlambda,e),b.wlambda+=m*o[2]*a,d.scale(e,g,i*a),d.add(c.vlambda,c.vlambda,e),c.wlambda+=n*o[5]*a},c.prototype.computeInvC=function(a){return1/(this.computeGiMGt()+a)}},{"../math/vec2":31,"../objects/Body":32,"../utils/Utils":50,__browserify_Buffer:1,__browserify_process:2}],24:[function(a,b){functionc(a,b,c){e.call(this,a,b,-c,c),this.contactPointA=d.create(),this.contactPointB=d.create(),this.t=d.create(),this.contactEquations=[],this.shapeA=null,this.shapeB=null,this.frictionCoefficient=.3}{vard=(a("__browserify_process"),a("__browserify_Buffer"),a("../math/vec2")),e=a("./Equation");a("../utils/Utils")}b.exports=c,c.prototype=newe,c.prototype.constructor=c,c.prototype.setSlipForce=function(a){this.maxForce=a,this.minForce=-a},c.prototype.getSlipForce=function(){returnthis.maxForce},c.prototype.computeB=function(a,b,c){vare=(this.bodyA,this.bodyB,this.contactPointA),f=this.contactPointB,g=this.t,h=this.G;h[0]=-g[0],h[1]=-g[1],h[2]=-d.crossLength(e,g),h[3]=g[0],h[4]=g[1],h[5]=d.crossLength(f,g);vari=this.computeGW(),j=this.computeGiMf(),k=-i*b-c*j;returnk}},{"../math/vec2":31,"../utils/Utils":50,"./Equation":23,__browserify_Buffer:1,__browserify_process:2}],25:[function(a,b){functionc(a,b,c){c=c||{},d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.angle=c.angle||0;vare=this.G;e[2]=1,e[5]=-1}vard=(a("__browserify_process"),a("__browserify_Buffer"),a("./Equation")),e=a("../math/vec2");b.exports=c,c.prototype=newd,c.prototype.constructor=c;varf=e.create(),g=e.create(),h=e.fromValues(1,0),i=e.fromValues(0,1);c.prototype.computeGq=function(){returne.rotate(f,h,this.bodyA.angle+this.angle),e.rotate(g,i,this.bodyB.angle),e.dot(f,g)}},{"../math/vec2":31,"./Equation":23,__browserify_Buffer:1,__browserify_process:2}],26:[function(a,b){functionc(a,b){d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.relativeVelocity=1,this.ratio=1}{vard=(a("__browserify_process"),a("__browserify_Buffer"),a("./Equation"));a("../math/vec2")}b.exports=c,c.prototype=newd,c.prototype.constructor=c,c.prototype.computeB=function(a,b,c){vard=this.G;d[2]=-1,d[5]=this.ratio;vare=this.computeGiMf(),f=this.computeGW(),g=-f*b-c*e;returng}},{"../math/vec2":31,"./Equation":23,__browserify_Buffer:1,__browserify_process:2}],27:[function(a,b){varc=(a("__browserify_process"),a("__browserify_Buffer"),function(){});b.exports=c,c.prototype={constructor:c,on:function(a,b,c){b.context=c||this,void0===this._listeners&&(this._listeners={});vard=this._listeners;returnvoid0===d[a]&&(d[a]=[]),-1===d[a].indexOf(b)&&d[a].push(b),this},has:function(a,b){if(void0===this._listeners)return!1;varc=this._listeners;if(b){if(void0!==c[a]&&-1!==c[a].indexOf(b))return!0}elseif(void0!==c[a])return!0;return!1},off:function(a,b){if(void0===this._listeners)returnthis;varc=this._listeners,d=c[a].indexOf(b);return-1!==d&&c[a].splice(d,1),this},emit:function(a){if(void0===this._listeners)returnthis;varb=this._listeners,c=b[a.type];if(void0!==c){a.target=this;for(vard=0,e=c.length;e>d;d++){varf=c[d];f.call(f.context,a)}}returnthis}}},{__browserify_Buffer:1,__browserify_process:2}],28:[function(a,b){functionc(a,b,f){if(f=f||{},!(ainstanceofd&&binstanceofd))thrownewError("First two arguments must be Material instances.");this.id=c.idCounter++,
A*=z.frictionCoefficient/z.contactEquations.length,z.maxForce=A,z.minForce=-A}}}for(f=0;f!==i;f++){for(w=0,x=0;x!==l;x++){v=k[x];vary=c.iterateEquation(x,v,v.epsilon,u,t,q,p,a,f);w+=Math.abs(y)}if(this.usedIterations++,m>=w*w)break}for(r=0;r!==o;r++)n[r].addConstraintVelocity();c.updateMultipliers(k,q,1/a)}},c.updateMultipliers=function(a,b,c){for(vard=a.length;d--;)a[d].multiplier=b[d]*c},c.iterateEquation=function(a,b,c,d,e,f,g,h){vari=d[a],j=e[a],k=f[a],l=b.computeGWlambda(),m=b.maxForce,n=b.minForce;g&&(i=0);varo=j*(i-l-c*k),p=k+o;returnn*h>p?o=n*h-k:p>m*h&&(o=m*h-k),f[a]+=o,b.addToWlambda(o),o}},{"../equations/FrictionEquation":24,"../math/vec2":31,"../utils/Utils":50,"./Solver":47,__browserify_Buffer:1,__browserify_process:2}],47:[function(a,b){functionc(a,b){a=a||{},d.call(this),this.type=b,this.equations=[],this.equationSortFunction=a.equationSortFunction||!1}vard=(a("__browserify_process"),a("__browserify_Buffer"),a("../utils/Utils"),a("../events/EventEmitter"));b.exports=c,c.prototype=newd,c.prototype.solve=function(){thrownewError("Solver.solve should be implemented by subclasses!")};vare={bodies:[]};c.prototype.solveIsland=function(a,b){this.removeAllEquations(),b.equations.length&&(this.addEquations(b.equations),e.bodies.length=0,b.getBodies(e.bodies),e.bodies.length&&this.solve(a,e))},c.prototype.sortEquations=function(){this.equationSortFunction&&this.equations.sort(this.equationSortFunction)},c.prototype.addEquation=function(a){a.enabled&&this.equations.push(a)},c.prototype.addEquations=function(a){for(varb=0,c=a.length;b!==c;b++){vard=a[b];d.enabled&&this.equations.push(d)}},c.prototype.removeEquation=function(a){varb=this.equations.indexOf(a);-1!==b&&this.equations.splice(b,1)},c.prototype.removeAllEquations=function(){this.equations.length=0},c.GS=1,c.ISLAND=2},{"../events/EventEmitter":27,"../utils/Utils":50,__browserify_Buffer:1,__browserify_process:2}],48:[function(a,b){functionc(){this.overlappingShapesLastState=newe,this.overlappingShapesCurrentState=newe,this.recordPool=[],this.tmpDict=newe,this.tmpArray1=[]}functiond(a,b,c,d){this.shapeA=b,this.shapeB=d,this.bodyA=a,this.bodyB=c}{vare=(a("__browserify_process"),a("__browserify_Buffer"),a("./TupleDictionary"));a("./Utils")}b.exports=c,c.prototype.tick=function(){for(vara=this.overlappingShapesLastState,b=this.overlappingShapesCurrentState,c=a.keys.length;c--;){vard=a.keys[c],e=a.getByKey(d),f=b.getByKey(d);e&&!f&&this.recordPool.push(e)}a.reset(),a.copy(b),b.reset()},c.prototype.setOverlapping=function(a,b,c,e){varf=(this.overlappingShapesLastState,this.overlappingShapesCurrentState);if(!f.get(b.id,e.id)){varg;this.recordPool.length?(g=this.recordPool.pop(),g.set(a,b,c,e)):g=newd(a,b,c,e),f.set(b.id,e.id,g)}},c.prototype.getNewOverlaps=function(a){returnthis.getDiff(this.overlappingShapesLastState,this.overlappingShapesCurrentState,a)},c.prototype.getEndOverlaps=function(a){returnthis.getDiff(this.overlappingShapesCurrentState,this.overlappingShapesLastState,a)},c.prototype.bodiesAreOverlapping=function(a,b){for(varc=this.overlappingShapesCurrentState,d=c.keys.length;d--;){vare=c.keys[d],f=c.data[e];if(f.bodyA===a&&f.bodyB===b||f.bodyA===b&&f.bodyB===a)return!0}return!1},c.prototype.getDiff=function(a,b,c){varc=c||[],d=a,e=b;c.length=0;for(varf=e.keys.length;f--;){varg=e.keys[f],h=e.data[g];if(!h)thrownewError("Key "+g+" had no data!");vari=d.data[g];i||c.push(h)}returnc},c.prototype.isNewOverlap=function(a,b){varc=0|a.id,d=0|b.id,e=this.overlappingShapesLastState,f=this.overlappingShapesCurrentState;return!e.get(c,d)&&!!f.get(c,d)},c.prototype.getNewBodyOverlaps=function(a){this.tmpArray1.length=0;varb=this.getNewOverlaps(this.tmpArray1);returnthis.getBodyDiff(b,a)},c.prototype.getEndBodyOverlaps=function(a){this.tmpArray1.length=0;varb=this.getEndOverlaps(this.tmpArray1);returnthis.getBodyDiff(b,a)},c.prototype.getBodyDiff=function(a,b){b=b||[];for(varc=this.tmpDict,d=a.length;d--;){vare=a[d];c.set(0|e.bodyA.id,0|e.bodyB.id,e)}for(d=c.keys.length;d--;){vare=c.getByKey(c.keys[d]);e&&b.push(e.bodyA,e.b
},addConstraint:function(a){returnthis.world.addConstraint(a),this.onConstraintAdded.dispatch(a),a},removeConstraint:function(a){returnthis.world.removeConstraint(a),this.onConstraintRemoved.dispatch(a),a},addContactMaterial:function(a){returnthis.world.addContactMaterial(a),this.onContactMaterialAdded.dispatch(a),a},removeContactMaterial:function(a){returnthis.world.removeContactMaterial(a),this.onContactMaterialRemoved.dispatch(a),a},getContactMaterial:function(a,b){returnthis.world.getContactMaterial(a,b)},setMaterial:function(a,b){for(varc=b.length;c--;)b[c].setMaterial(a)},createMaterial:function(a,b){a=a||"";varc=newPhaser.Physics.P2.Material(a);returnthis.materials.push(c),"undefined"!=typeofb&&b.setMaterial(c),c},createContactMaterial:function(a,b,c){"undefined"==typeofa&&(a=this.createMaterial()),"undefined"==typeofb&&(b=this.createMaterial());vard=newPhaser.Physics.P2.ContactMaterial(a,b,c);returnthis.addContactMaterial(d)},getBodies:function(){for(vara=[],b=this.world.bodies.length;b--;)a.push(this.world.bodies[b].parent);returna},getBody:function(a){returnainstanceofp2.Body?a:ainstanceofPhaser.Physics.P2.Body?a.data:a.body&&a.body.type===Phaser.Physics.P2JS?a.body.data:null},getSprings:function(){for(vara=[],b=this.world.springs.length;b--;)a.push(this.world.springs[b].parent);returna},getConstraints:function(){for(vara=[],b=this.world.constraints.length;b--;)a.push(this.world.constraints[b].parent);returna},hitTest:function(a,b,c,d){"undefined"==typeofb&&(b=this.world.bodies),"undefined"==typeofc&&(c=5),"undefined"==typeofd&&(d=!1);for(vare=[this.pxmi(a.x),this.pxmi(a.y)],f=[],g=b.length;g--;)b[g]instanceofPhaser.Physics.P2.Body&&(!d||b[g].data.type!==p2.Body.STATIC)?f.push(b[g].data):b[g]instanceofp2.Body&&b[g].parent&&(!d||b[g].type!==p2.Body.STATIC)?f.push(b[g]):b[g]instanceofPhaser.Sprite&&b[g].hasOwnProperty("body")&&(!d||b[g].body.data.type!==p2.Body.STATIC)&&f.push(b[g].body.data);returnthis.world.hitTest(e,f,c)},toJSON:function(){returnthis.world.toJSON()},createCollisionGroup:function(a){varb=Math.pow(2,this._collisionGroupID);this.walls.left&&(this.walls.left.shapes[0].collisionMask=this.walls.left.shapes[0].collisionMask|b),this.walls.right&&(this.walls.right.shapes[0].collisionMask=this.walls.right.shapes[0].collisionMask|b),this.walls.top&&(this.walls.top.shapes[0].collisionMask=this.walls.top.shapes[0].collisionMask|b),this.walls.bottom&&(this.walls.bottom.shapes[0].collisionMask=this.walls.bottom.shapes[0].collisionMask|b),this._collisionGroupID++;varc=newPhaser.Physics.P2.CollisionGroup(b);returnthis.collisionGroups.push(c),a&&this.setCollisionGroup(a,c),c},setCollisionGroup:function(a,b){if(ainstanceofPhaser.Group)for(varc=0;c<a.total;c++)a.children[c].body&&a.children[c].body.type===Phaser.Physics.P2JS&&a.children[c].body.setCollisionGroup(b);elsea.body.setCollisionGroup(b)},createSpring:function(a,b,c,d,e,f,g,h,i){returna=this.getBody(a),b=this.getBody(b),a&&b?this.addSpring(newPhaser.Physics.P2.Spring(this,a,b,c,d,e,f,g,h,i)):voidconsole.warn("Cannot create Spring, invalid body objects given")},createRotationalSpring:function(a,b,c,d,e){returna=this.getBody(a),b=this.getBody(b),a&&b?this.addSpring(newPhaser.Physics.P2.RotationalSpring(this,a,b,c,d,e)):voidconsole.warn("Cannot create Rotational Spring, invalid body objects given")},createBody:function(a,b,c,d,e,f){"undefined"==typeofd&&(d=!1);varg=newPhaser.Physics.P2.Body(this.game,null,a,b,c);if(f){varh=g.addPolygon(e,f);if(!h)return!1}returnd&&this.world.addBody(g.data),g},createParticle:function(a,b,c,d,e,f){"undefined"==typeofd&&(d=!1);varg=newPhaser.Physics.P2.Body(this.game,null,a,b,c);if(f){varh=g.addPolygon(e,f);if(!h)return!1}returnd&&this.world.addBody(g.data),g},convertCollisionObjects:function(a,b,c){"undefined"==typeofc&&(c=!0);for(vard=[],e=0,f=a.collision[b].length;f>e;e++){varg=a.collision[b][e],h=this.createBody(g.x,g.y,0,c,{},g.polyline);h&&d.push(h)}returnd},clearTilemapLayerBodies:function(a,b){b=a.getLayer(b);for(varc=a.layers[b].bodies.length;c--;)a.lay