!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=1075)}([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;i0&&(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){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){"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=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,i){var n=i(0),s=i(12),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){var n=i(302),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(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=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={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;no.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=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e,i){var n=i(0),s=i(18),r=i(20),o=i(7),a=i(1),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;ss||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,i){var n=i(0),s=i(155),r=i(278),o=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.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this.red=0,this.green=0,this.blue=0,this.alpha=0,this.update()},setTo:function(t,e,i,n){return void 0===n&&(n=255),this.red=t,this.green=e,this.blue=i,this.alpha=n,this.update()},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this.update()},setFromRGB:function(t){return this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this.update()},update:function(){return this._color=s(this.r,this.g,this.b),this._color32=r(this.r,this.g,this.b,this.a),this._rgba="rgba("+this.r+","+this.g+","+this.b+","+this.a/255+")",this},clone:function(){return new o(this.r,this.g,this.b,this.a)},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()}},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()}},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()}},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()}},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()}},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()}},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()}}});t.exports=o},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,i){var n=new(i(0))({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},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},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=n},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){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){var n=i(0),s=i(17),r=i(2),o=i(526),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.anims=new s.Animation(this),this.setTexture(n,o),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline("TextureTintPipeline")},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)}});t.exports=a},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=0;o--)t[o][e]+=i+a*n,a++;return t}},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;s0;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 t instanceof HTMLElement},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]"===Object.prototype.toString.call(t)},i.clamp=function(t,e,i){return ti?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.map=function(t,e){if(t.map)return t.map(e);for(var i=[],n=0;n=t.length)){for(var i=t.length-1,n=t[e],s=e;s=0&&y>=0&&v+y<1}},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,i){var n=i(123);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(19);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e,i){var n=i(0),s=i(17),r=i(394),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!(tthis.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=i(0),s=i(60),r=i(232),o=i(231),a=i(96),h=i(158),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(0),s=i(17),r=i(2),o=i(432),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.setTexture(n,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline("TextureTintPipeline")}});t.exports=a},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;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 this.entries.length=t}}});t.exports=n},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,i){var n=i(100),s=i(10),r=i(62),o=i(63),a=i(72),h=i(168),l=i(102),u=i(4),c=i(101),d=i(99),f=i(98);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),A=r(e,"flipX",i.flipX),C=r(e,"flipY",i.flipY),_=[],M=0;M0&&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,i,r,o){o=o||t.position;for(var a=0;a0&&(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};var e=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0: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,i){var n,s=i(57),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,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;nl&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a=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=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},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){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){var n=i(0),s=i(268),r=i(13),o=i(6),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=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(33),r=i(303),o=i(301),a=i(162),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=i(150),s=i(0),r=i(3),o=i(83),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;n0?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.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},function(t,e,i){var n=i(34);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){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=i(0),s=i(298),r=i(161),o=i(160),a=i(6),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){t.exports=function(t){return 2*(t.width+t.height)}},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(14),r=i(11),o=i(61),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;n0&&(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;i0){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;i0?(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=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&&ns.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.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;n0){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(0),s=i(1),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.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(1),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=0&&el){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;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=u,n+=a[h],h0&&(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.dirty=!0,this},getTextMetrics:function(){return this.style.getTextMetrics()},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this.text,style:this.style.toJSON(),resolution:this.resolution,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)}});t.exports=p},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e,i){var n=i(604),s=i(0),r=i(1),o=i(4),a=i(247),h=i(69),l=i(35),u=new s({initialize:function(t,e,i){void 0!==i||Array.isArray(e)||"object"!=typeof e||(i=e,e=null),this.scene=t,this.children=new h(e),this.isParent=!0,this.classType=r(i,"classType",l),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[];if(Array.isArray(t)||(t=[t]),void 0===t[0].key)return[];for(var e=[],i=0;i=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=0&&(s=s%h-h-a):(s-=n,(s+=a)>h+a?s=h+a:s<-a&&(s=h+s%h-a)),this.commandBuffer.push(r.ARC,t,e,i,n,s,o),this},slice:function(t,e,i,n,s,o,a){void 0===o&&(o=!1),void 0===a&&(a=0);var h=2*Math.PI;return o?s<-h?s=-h-a:s>=0&&(s=s%h-h-a):(s-=n,(s+=a)>h+a?s=h+a:s<=-a&&(s=h+s%h-a)),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),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;if(void 0===e&&(e=r.game.config.width),void 0===i&&(i=r.game.config.height),f.TargetCamera.setViewport(0,0,e,i),f.TargetCamera.scrollX=this.x,f.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var o=(n=r.textures.get(t)).getSourceImage();o instanceof HTMLCanvasElement&&(s=o.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(r.game.renderer,this,0,f.TargetCamera,null,s),r.game.renderer.gl&&n&&(n.source[0].glTexture=r.game.renderer.canvasToTexture(s.canvas,n.source[0].glTexture))),this},preDestroy:function(){this.commandBuffer=[]}});f.TargetCamera=new n(0,0,0,0),t.exports=f},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;i0},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-y&&T>-m&&b-y&&A>-m&&Sf.right&&(p=l(p,p+(v-f.right),this.lerp.x)),yf.bottom&&(g=l(g,g+(y-f.bottom),this.lerp.y))):(p=l(p,v-u,this.lerp.x),g=l(g,y-c,this.lerp.y))}this.useBounds&&(p=this.clampX(p),g=this.clampY(g)),this.roundPixels&&(u=Math.round(u),c=Math.round(c)),this.scrollX=p,this.scrollY=g;var m=p+r,x=g+o;this.midPoint.set(m,x);var w=i/a,b=s/a;this.worldView.setTo(m-w/2,x-b/2,w,b),h.loadIdentity(),h.scale(e,e),h.translate(this.x+u,this.y+c),h.rotate(this.rotation),h.scale(a,a),h.translate(-u,-c),this.shakeEffect.preRender()},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 ts&&(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 ts&&(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=o(t),this},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},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=d(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){return this.scene=t,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},setVisible:function(t){return this.visible=t,this},startFollow:function(t,e,i,n,r,o){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===r&&(r=0),void 0===o&&(o=r),this._follow=t,this.roundPixels=e,i=s(i,0,1),n=s(n,0,1),this.lerp.set(i,n),this.followOffset.set(r,o);var a=this.width/2,h=this.height/2,l=t.x-r,u=t.y-o;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this},stopFollow:function(){return this._follow=null,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},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.emit("cameradestroy",this),this.removeAllListeners(),this.resetFX(),this.matrix.destroy(),this.culledObjects=[],this._follow=null,this._bounds=null,this.scene=null,this.deadzone=null},width:{get:function(){return this._width},set:function(t){this._width=t,this.dirty=!0}},height:{get:function(){return this._height},set:function(t){this._height=t,this.dirty=!0}},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=p},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;et.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y0?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,i){var n={};t.exports=n;var s=i(106),r=i(42);n.create=function(t,e){for(var i=[],n=0;n0)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=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(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=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(10);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(0),s=i(19),r=i(16),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,b=i+r;if(!(x.rw||x.y>b)){var T=Math.max(x.x,e),S=Math.max(x.y,i),A=Math.min(x.r,w)-T,C=Math.min(x.b,b)-S;v=A,y=C,p=o?h+(u-(T-x.x)-A):h+(T-x.x),g=a?l+(c-(S-x.y)-C):l+(S-x.y),e=T,i=S,n=A,r=C}else p=0,g=0,v=0,y=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var _=this.source.width,M=this.source.height;return t.u0=Math.max(0,p/_),t.v0=Math.max(0,g/M),t.u1=Math.min(1,(p+v)/_),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(1),r=i(207),o=i(32),a=i(496),h=i(495),l=i(21),u=i(84),c=new n({Extends:u,Mixins:[r],initialize:function(t){var e=t.renderer.config;u.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:s(t,"topology",t.renderer.gl.TRIANGLES),vertShader:s(t,"vertShader",h),fragShader:s(t,"fragShader",a),vertexCapacity:s(t,"vertexCapacity",6*e.batchSize),vertexSize:s(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 o,this._tempMatrix2=new o,this._tempMatrix3=new o,this._tempMatrix4=new o,this.mvpInit()},setTexture2D:function(t,e){if(!t)return this;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.renderer,r=this.vertexCount,o=this.topology,a=this.vertexSize,h=this.batches,l=0,u=null;if(0===h.length||0===r)return this.flushLocked=!1,this;n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,r*a));for(var c=0;c0){for(e=0;e0){for(e=0;e0&&(s.setTexture2D(u.texture,0),n.drawArrays(o,u.first,l)),this.vertexCount=0,h.length=0,this.pushBatch(),this.flushLocked=!1,this},onBind:function(){return u.prototype.onBind.call(this),this.mvpUpdate(),0===this.batches.length&&this.pushBatch(),this},resize:function(t,e,i){return u.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),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,u=o.v0,c=o.u1,d=o.v1,f=o.x,p=o.y,g=o.width,v=o.height,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,u=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=y*r.a+m*r.c+r.e,S=y*r.b+m*r.d+r.f,A=y*r.a+b*r.c+r.e,C=y*r.b+b*r.d+r.f,_=w*r.a+b*r.c+r.e,M=w*r.b+b*r.d+r.f,E=w*r.a+m*r.c+r.e,P=w*r.b+m*r.d+r.f,k=l.getTintAppendFloatAlpha(t._tintTL,e.alpha*t._alphaTL),F=l.getTintAppendFloatAlpha(t._tintTR,e.alpha*t._alphaTR),L=l.getTintAppendFloatAlpha(t._tintBL,e.alpha*t._alphaBL),R=l.getTintAppendFloatAlpha(t._tintBR,e.alpha*t._alphaBR);e.roundPixels&&(T|=0,S|=0,A|=0,C|=0,_|=0,M|=0,E|=0,P|=0),this.setTexture2D(a,0);var O=t._isTinted&&t.tintFill;this.batchVertices(T,S,A,C,_,M,E,P,h,u,c,d,k,F,L,R,O)},batchVertices: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,this.vertexCapacity-this.vertexCount<6&&(this.flush(),y=!0),y},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,E,P){this.renderer.setPipeline(this,t);var k=this._tempMatrix1,F=this._tempMatrix2,L=this._tempMatrix3,R=o,O=a,B=-g,D=-v;d^=e.isRenderTexture?1:0,c&&(R*=-1,B+=o),d&&(O*=-1,D+=a),E.roundPixels&&(B|=0,D|=0);var I=B+R,z=D+O;F.applyITRS(s,r,u,h,l),k.copyFrom(E.matrix),P?(k.multiplyWithOffset(P,-E.scrollX*f,-E.scrollY*p),F.e=s,F.f=r,k.multiply(F,L)):(F.e-=E.scrollX*f,F.f-=E.scrollY*p,k.multiply(F,L));var Y=B*L.a+D*L.c+L.e,X=B*L.b+D*L.d+L.f,N=B*L.a+z*L.c+L.e,V=B*L.b+z*L.d+L.f,U=I*L.a+z*L.c+L.e,G=I*L.b+z*L.d+L.f,W=I*L.a+D*L.c+L.e,H=I*L.b+D*L.d+L.f;E.roundPixels&&(Y|=0,X|=0,N|=0,V|=0,U|=0,G|=0,W|=0,H|=0);var j=y/i+_,q=m/n+M,K=(y+x)/i+_,J=(m+w)/n+M;this.setTexture2D(e,0),this.batchVertices(Y,X,N,V,U,G,W,H,j,q,K,J,b,T,S,A,C)},drawTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var a=this._tempMatrix1.copyFromArray(r),h=this._tempMatrix2,u=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=e*h.a+i*h.c+h.e,f=e*h.b+i*h.d+h.f,p=e*h.a+c*h.c+h.e,g=e*h.b+c*h.d+h.f,v=u*h.a+c*h.c+h.e,y=u*h.b+c*h.d+h.f,m=u*h.a+i*h.c+h.e,x=u*h.b+i*h.d+h.f;this.renderer.config.roundPixels&&(d|=0,f|=0,p|=0,g|=0,v|=0,y|=0,m|=0,x|=0),this.setTexture2D(t.glTexture,0),n=l.getTintAppendFloatAlpha(n,s),this.batchVertices(d,f,p,g,v,y,m,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0)||this.flush()}});t.exports=c},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){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=(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=i(5);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,i){var n=i(97),s=i(5);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(5);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,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=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(17),r=i(2),o=i(865),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.length0&&a.length=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e,i){var n=i(5);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(5);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(5);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(70),s=i(5);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;u1?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(52),s=i(88),r=i(33),o=i(0),a=i(17),h=i(2),l=i(13),u=i(31),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},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){var i=-t/2,n=-e/2;return this.setDropZone(new l(i,n,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=i(0),s=i(9),r=i(71),o=i(61),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;n0?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;e0){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;s0?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;y0){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=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(127),r=i(42),o=i(73),a=i(126),h=i(106),l=i(1021);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;d0&&s.area(A)1?(f=o.create(r.extend({parts:p.slice(0)},n)),o.setPosition(f,{x:t,y:e}),f):p[0]}},function(t,e,i){var n=i(0),s=i(20),r=i(1),o=i(108),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=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.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)0&&e.cameraFilter&r.id)){var l=r.scrollX*e.scrollFactorX,u=r.scrollY*e.scrollFactorY,c=e.x,d=e.y,f=e.scaleX,p=e.scaleY,g=e.rotation,v=e.commandBuffer,y=a||t.currentContext,m=1,x=1,w=0,b=0,T=1,S=0,A=0,C=0,_=r.alpha*e.alpha;if(0!==_){if(t.currentAlpha!==_&&(t.currentAlpha=_,y.globalAlpha=_),t.currentBlendMode!==e.blendMode&&(t.currentBlendMode=e.blendMode,y.globalCompositeOperation=t.blendModes[e.blendMode]),t.currentScaleMode!==e.scaleMode&&(t.currentScaleMode=e.scaleMode),y.save(),o){var M=o.matrix;y.transform(M[0],M[1],M[2],M[3],M[4],M[5])}y.translate(c-l,d-u),y.rotate(g),y.scale(f,p),y.fillStyle="#fff",y.globalAlpha=e.alpha;for(var E=0,P=v.length;E>>16,A=(65280&w)>>>8,C=255&w,y.strokeStyle="rgba("+S+","+A+","+C+","+m+")",y.lineWidth=T,E+=3;break;case n.FILL_STYLE:b=v[E+1],x=v[E+2],S=(16711680&b)>>>16,A=(65280&b)>>>8,C=255&b,y.fillStyle="rgba("+S+","+A+","+C+","+x+")",E+=2;break;case n.BEGIN_PATH:y.beginPath();break;case n.CLOSE_PATH:y.closePath();break;case n.FILL_PATH:h||y.fill();break;case n.STROKE_PATH:h||y.stroke();break;case n.FILL_RECT:h?y.rect(v[E+1],v[E+2],v[E+3],v[E+4]):y.fillRect(v[E+1],v[E+2],v[E+3],v[E+4]),E+=4;break;case n.FILL_TRIANGLE:y.beginPath(),y.moveTo(v[E+1],v[E+2]),y.lineTo(v[E+3],v[E+4]),y.lineTo(v[E+5],v[E+6]),y.closePath(),h||y.fill(),E+=6;break;case n.STROKE_TRIANGLE:y.beginPath(),y.moveTo(v[E+1],v[E+2]),y.lineTo(v[E+3],v[E+4]),y.lineTo(v[E+5],v[E+6]),y.closePath(),h||y.stroke(),E+=6;break;case n.LINE_TO:y.lineTo(v[E+1],v[E+2]),E+=2;break;case n.MOVE_TO:y.moveTo(v[E+1],v[E+2]),E+=2;break;case n.LINE_FX_TO:y.lineTo(v[E+1],v[E+2]),E+=5;break;case n.MOVE_FX_TO:y.moveTo(v[E+1],v[E+2]),E+=5;break;case n.SAVE:y.save();break;case n.RESTORE:y.restore();break;case n.TRANSLATE:y.translate(v[E+1],v[E+2]),E+=2;break;case n.SCALE:y.scale(v[E+1],v[E+2]),E+=2;break;case n.ROTATE:y.rotate(v[E+1]),E+=1}y.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(182),s=i(113),r=i(64),o=i(15);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;hr;){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);v0;)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 te?1:0}t.exports=i},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),s=0;s-1;r--)n[s][r]=t[r][s]}return n}},function(t,e,i){t.exports={AtlasXML:i(484),Canvas:i(483),Image:i(482),JSONArray:i(481),JSONHash:i(480),SpriteSheet:i(479),SpriteSheetFromAtlas:i(478),UnityYAML:i(477)}},function(t,e,i){var n=i(24),s=i(0),r=i(85),o=i(59),a=new s({initialize:function(t,e,i,n){var s=t.manager.game;this.renderer=s.renderer,this.texture=t,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.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.glTexture=this.renderer.createTextureFromSource(this.image,this.width,this.height,this.scaleMode)),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.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.image=null}});t.exports=a},function(t,e,i){var n=i(24),s=i(485),r=i(0),o=i(30),a=i(22),h=i(9),l=i(270),u=i(4),c=i(187),d=i(117),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("ready"))},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}},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},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){var i=null;return this.checkKey(t)&&(i=new s(this,t,e,e.width,e.height),this.list[t]=i,this.emit("addtexture",t,i)),i},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=0&&t<=r.width&&e>=0&&e<=r.height){t+=s.cutX,e+=s.cutY;var a=this._tempContext;a.clearRect(0,0,1,1),a.drawImage(r,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){var r=s.source.image;if(t>=0&&t<=r.width&&e>=0&&e<=r.height){t+=s.cutX,e+=s.cutY;var o=this._tempContext;return o.clearRect(0,0,1,1),o.drawImage(r,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},each:function(t,e){for(var i=[null],n=1;n0)&&(!!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;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):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(78),s=i(0),r=i(194),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-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=s.LOADING&&i.settings.status0){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=0;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(56);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(9),r=i(7),o=i(14),a=i(11),h=i(1),l=i(12),u=i(200),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=this.game.config,a=o.installGlobalPlugins;for(a=a.concat(this._pendingGlobal),t=0;t10&&(t=10-this.pointersTotal);for(var i=0;i0},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)}},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){var e=t.input;if(!e||!e.enabled||!t.willRender())return!1;var i=!0,n=t.parentContainer;if(n)do{if(!n.visible){i=!1;break}n=n.parentContainer}while(n);return i},hitTest:function(t,e,i,n){void 0===n&&(n=this._tempHitTest);var s=this._tempPoint,r=i.width,o=i.height;n.length=0;var a=t.x,h=t.y;if(!(a>=i.x&&h>=i.y&&a<=i.x+r&&h<=i.y+o))return n;i.getWorldPoint(a,h,s),t.worldX=s.x,t.worldY=s.y;for(var l={x:0,y:0},u=this.game.config.resolution,d=this._tempMatrix,f=0;fe.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(19),s=i(0),r=i(214),o=i(213),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&&t0){s.isLast=!0,s.nextFrame=l[0],l[0].prevFrame=s;var v=1/(l.length-1);for(r=0;r=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._timeScale=1,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo),t.updateFrame(this.frames[e])},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?(t.forward=!1,t.updateFrame(e.prevFrame),this.getNextTick(t)):t.repeatCounter>0?this.repeatAnimation(t):this.completeAnimation(t):(t.updateFrame(e.nextFrame),this.getNextTick(t))},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.repeatCounter>0?this.repeatAnimation(t):this.completeAnimation(t):(t.updateFrame(e.prevFrame),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.forward=!0,t.updateFrame(t.currentFrame.nextFrame),t.isPlaying&&(this.getNextTick(t),t.pendingRepeat=!1,t.parent.emit("animationrepeat",this,t.currentFrame,t.repeatCounter)))},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;i1&&(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=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=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=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;tl+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(5),s=i(70);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 ch+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){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},function(t,e){t.exports=function(t,e,i){for(var n=!1,s=-1,r=t.points.length-1;++s=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.righte.right||t.y>e.bottom)}},function(t,e,i){var n=i(0),s=i(147),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,i){var n=i(24),s=i(0),r=i(17),o=i(22),a=i(2),h=i(415),l=i(889),u=new s({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScaleMode,r.ScrollFactor,r.Texture,r.Tint,r.Transform,r.Visible,l],initialize:function(t,e,i,s,r,l,u){var c=t.sys.game.renderer;a.call(this,t,"TileSprite"),this.tilePositionX=0,this.tilePositionY=0,this.tileScaleX=1,this.tileScaleY=1,this.dirty=!0,this.tileTexture=null,this.renderer=c,this.setTexture(l,u),this.setPosition(e,i),this.setSize(s,r),this.setOriginFromFrame(),this.initPipeline("TextureTintPipeline"),this.potWidth=h(this.frame.width),this.potHeight=h(this.frame.height),this.canvasBuffer=n.create2D(this,this.potWidth,this.potHeight),this.canvasBufferCtx=this.canvasBuffer.getContext("2d"),this.oldFrame=null,this.updateTileTexture(),t.sys.game.config.renderType===o.WEBGL&&t.sys.game.renderer.onContextRestored(function(t){var e=t.gl;this.tileTexture=null,this.dirty=!0,this.tileTexture=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.canvasBuffer,this.potWidth,this.potHeight)},this)},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},updateTileTexture:function(){var t=this.frame;if(this.dirty||this.oldFrame!==t){this.oldFrame=t;var e=this.canvasBufferCtx,i=this.canvasBuffer,n=this.potWidth,s=this.potHeight;this.renderer.gl||(n=t.cutWidth,s=t.cutHeight),e.clearRect(0,0,i.width,i.height),i.width=n,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,n,s),this.tileTexture=this.renderer.gl?this.renderer.canvasToTexture(i,this.tileTexture):e.createPattern(i,"repeat"),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.tileTexture),n.remove(this.canvasBuffer),this.tileTexture=null,this.canvasBufferCtx=null,this.canvasBuffer=null,this.renderer=null}});t.exports=u},function(t,e,i){var n=i(24),s=i(0),r=i(17),o=i(22),a=i(2),h=i(897),l=i(894),u=i(893),c=new s({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Depth,r.Flip,r.GetBounds,r.Mask,r.MatrixStack,r.Origin,r.Pipeline,r.ScaleMode,r.ScrollFactor,r.Tint,r.Transform,r.Visible,h],initialize:function(t,e,i,s,r){if(void 0===s&&(s=32),void 0===r&&(r=32),a.call(this,t,"RenderTexture"),this.initMatrixStack(),this.renderer=t.sys.game.renderer,this.globalTint=16777215,this.globalAlpha=1,this.canvas=null,this.context=null,this.framebuffer=null,this.renderer.type===o.WEBGL){var h=this.renderer.gl;this.gl=h,this.fill=u.fill,this.clear=u.clear,this.draw=u.draw,this.drawFrame=u.drawFrame,this.texture=this.renderer.createTexture2D(0,h.NEAREST,h.NEAREST,h.CLAMP_TO_EDGE,h.CLAMP_TO_EDGE,h.RGBA,null,s,r,!1),this.framebuffer=this.renderer.createFramebuffer(s,r,this.texture,!1)}else this.renderer.type===o.CANVAS&&(this.fill=l.fill,this.clear=l.clear,this.draw=l.draw,this.drawFrame=l.drawFrame,this.canvas=n.create2D(this,s,r),this.context=this.canvas.getContext("2d"));this.setPosition(e,i),this.setSize(s,r),this.initPipeline("TextureTintPipeline")},resize:function(t,e){if(void 0===e&&(e=t),t!==this.width||e!==this.height){if(this.canvas)this.canvas.width=t,this.canvas.height=e;else{this.renderer.deleteTexture(this.texture),this.renderer.deleteFramebuffer(this.framebuffer);var i=this.renderer.gl;this.texture=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.texture,!1)}this.setSize(t,e)}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},preDestroy:function(){this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.texture),this.renderer.deleteFramebuffer(this.framebuffer))}});t.exports=c},function(t,e,i){var n=i(0),s=i(17),r=i(2),o=i(429),a=i(93),h=i(427),l=i(901),u=new n({Extends:r,Mixins:[s.Depth,s.Pipeline,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("TextureTintPipeline"),this.emitters=new a(this),this.wells=new a(this),n){Array.isArray(n)||(n=[n]);for(var s=0;s0?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;s0)for(var e=this.list,i=new a,n=0;n-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;i0?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.position0?(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=c},function(t,e,i){var n=i(913),s=i(910),r=i(0),o=i(17),a=i(129),h=i(2),l=i(93),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("TextureTintPipeline"),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;r0},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,i){var n=i(4),s=i(95),r=function(t,e,i){for(var n=[],s=0;s0?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},function(t,e,i){var n=i(6);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=c*p-d*f,v=p/g,y=-d/g,m=-f/g,x=c/g,w=(f*s-p*i)/g,b=-(c*s-d*i)/g;return h.x=t*v+e*m+w,h.y=t*y+e*x+b,h}},function(t,e,i){var n=i(157);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},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;o80*i){n=h=t[0],a=l=t[1];for(var w=i;wh&&(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===C(t,e,i,n)>0)for(r=e;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;e0||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.xr.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.x&&n.x>=u&&s!==n.x&&g(ri.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=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 A(t.i,t.x,t.y),n=new A(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 A(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 A(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 C(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e,i){var n=i(0),s=i(119),r=i(252),o=i(207),a=i(499),h=i(498),l=i(21),u=i(84),c=function(t,e,i,n,s){this.x=t,this.y=e,this.width=i,this.rgb=n,this.alpha=s},d=function(t,e,i,n,s){this.points=[],this.pointsLength=1,this.points[0]=new c(t,e,i,n,s)},f=new Float32Array([1,0,0,1,0,0]),p=new Float32Array(6e3),g=0,v=[],y=new n({Extends:u,Mixins:[o],initialize:function(t){u.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:h,fragShader:t.fragShader?t.fragShader:a,vertexCapacity:t.vertexCapcity?t.vertexCapacity:12e3,vertexSize:t.vertexSize?t.vertexSize:2*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT,attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:2*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.tempTriangle=[{x:0,y:0,width:0,rgb:16777215,alpha:1},{x:0,y:0,width:0,rgb:16777215,alpha:1},{x:0,y:0,width:0,rgb:16777215,alpha:1},{x:0,y:0,width:0,rgb:16777215,alpha:1}],this.polygonCache=[],this.mvpInit()},onBind:function(){return u.prototype.onBind.call(this),this.mvpUpdate(),this},resize:function(t,e,i){return u.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},batchFillRect:function(t,e,i,n,s,r,o,a,h,u,c,d,f,p,g,v,y,m){this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var x=this.vertexViewF32,w=this.vertexViewU32,b=this.vertexCount*this.vertexComponentCount,T=r+a,S=o+h,A=m[0],C=m[1],_=m[2],M=m[3],E=d*A+f*_,P=d*C+f*M,k=p*A+g*_,F=p*C+g*M,L=v*A+y*_+m[4],R=v*C+y*M+m[5],O=r*E+o*k+L,B=r*P+o*F+R,D=r*E+S*k+L,I=r*P+S*F+R,z=T*E+S*k+L,Y=T*P+S*F+R,X=T*E+o*k+L,N=T*P+o*F+R,V=l.getTintAppendFloatAlphaAndSwap(u,c);x[b+0]=O,x[b+1]=B,w[b+2]=V,x[b+3]=D,x[b+4]=I,w[b+5]=V,x[b+6]=z,x[b+7]=Y,w[b+8]=V,x[b+9]=O,x[b+10]=B,w[b+11]=V,x[b+12]=z,x[b+13]=Y,w[b+14]=V,x[b+15]=X,x[b+16]=N,w[b+17]=V,this.vertexCount+=6},batchFillTriangle:function(t,e,i,n,s,r,o,a,h,u,c,d,f,p,g,v,y,m,x,w){this.renderer.setPipeline(this),this.vertexCount+3>this.vertexCapacity&&this.flush();var b=this.vertexViewF32,T=this.vertexViewU32,S=this.vertexCount*this.vertexComponentCount,A=w[0],C=w[1],_=w[2],M=w[3],E=p*A+g*_,P=p*C+g*M,k=v*A+y*_,F=v*C+y*M,L=m*A+x*_+w[4],R=m*C+x*M+w[5],O=r*E+o*k+L,B=r*P+o*F+R,D=a*E+h*k+L,I=a*P+h*F+R,z=u*E+c*k+L,Y=u*P+c*F+R,X=l.getTintAppendFloatAlphaAndSwap(d,f);b[S+0]=O,b[S+1]=B,T[S+2]=X,b[S+3]=D,b[S+4]=I,T[S+5]=X,b[S+6]=z,b[S+7]=Y,T[S+8]=X,this.vertexCount+=3},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w){var b=this.tempTriangle;b[0].x=r,b[0].y=o,b[0].width=c,b[0].rgb=d,b[0].alpha=f,b[1].x=a,b[1].y=h,b[1].width=c,b[1].rgb=d,b[1].alpha=f,b[2].x=l,b[2].y=u,b[2].width=c,b[2].rgb=d,b[2].alpha=f,b[3].x=r,b[3].y=o,b[3].width=c,b[3].rgb=d,b[3].alpha=f,this.batchStrokePath(t,e,i,n,s,b,c,d,f,p,g,v,y,m,x,!1,w)},batchFillPath:function(t,e,i,n,s,o,a,h,u,c,d,f,p,g,v){this.renderer.setPipeline(this);for(var y,m,x,w,b,T,S,A,C,_,M,E,P,k,F,L,R,O=o.length,B=this.polygonCache,D=this.vertexViewF32,I=this.vertexViewU32,z=0,Y=v[0],X=v[1],N=v[2],V=v[3],U=u*Y+c*N,G=u*X+c*V,W=d*Y+f*N,H=d*X+f*V,j=p*Y+g*N+v[4],q=p*X+g*V+v[5],K=l.getTintAppendFloatAlphaAndSwap(a,h),J=0;Jthis.vertexCapacity&&this.flush(),z=this.vertexCount*this.vertexComponentCount,E=(T=B[x+0])*U+(S=B[x+1])*W+j,P=T*G+S*H+q,k=(A=B[w+0])*U+(C=B[w+1])*W+j,F=A*G+C*H+q,L=(_=B[b+0])*U+(M=B[b+1])*W+j,R=_*G+M*H+q,D[z+0]=E,D[z+1]=P,I[z+2]=K,D[z+3]=k,D[z+4]=F,I[z+5]=K,D[z+6]=L,D[z+7]=R,I[z+8]=K,this.vertexCount+=3;B.length=0},batchStrokePath:function(t,e,i,n,s,r,o,a,h,u,c,d,f,p,g,v,y){var m,x;this.renderer.setPipeline(this);for(var w,b,T,S,A=r.length,C=this.polygonCache,_=this.vertexViewF32,M=this.vertexViewU32,E=l.getTintAppendFloatAlphaAndSwap,P=0;P+1this.vertexCapacity&&this.flush(),w=C[k-1]||C[F-1],b=C[k],_[(T=this.vertexCount*this.vertexComponentCount)+0]=w[6],_[T+1]=w[7],M[T+2]=E(w[8],h),_[T+3]=w[0],_[T+4]=w[1],M[T+5]=E(w[2],h),_[T+6]=b[9],_[T+7]=b[10],M[T+8]=E(b[11],h),_[T+9]=w[0],_[T+10]=w[1],M[T+11]=E(w[2],h),_[T+12]=w[6],_[T+13]=w[7],M[T+14]=E(w[8],h),_[T+15]=b[3],_[T+16]=b[4],M[T+17]=E(b[5],h),this.vertexCount+=6;C.length=0},batchLine:function(t,e,i,n,s,r,o,a,h,u,c,d,f,p,g,v,y,m,x,w,b){this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var T=b[0],S=b[1],A=b[2],C=b[3],_=g*T+v*A,M=g*S+v*C,E=y*T+m*A,P=y*S+m*C,k=x*T+w*A+b[4],F=x*S+w*C+b[5],L=this.vertexViewF32,R=this.vertexViewU32,O=a-r,B=h-o,D=Math.sqrt(O*O+B*B),I=u*(h-o)/D,z=u*(r-a)/D,Y=c*(h-o)/D,X=c*(r-a)/D,N=a-Y,V=h-X,U=r-I,G=o-z,W=a+Y,H=h+X,j=r+I,q=o+z,K=N*_+V*E+k,J=N*M+V*P+F,Z=U*_+G*E+k,Q=U*M+G*P+F,$=W*_+H*E+k,tt=W*M+H*P+F,et=j*_+q*E+k,it=j*M+q*P+F,nt=l.getTintAppendFloatAlphaAndSwap,st=nt(d,p),rt=nt(f,p),ot=this.vertexCount*this.vertexComponentCount;return L[ot+0]=K,L[ot+1]=J,R[ot+2]=rt,L[ot+3]=Z,L[ot+4]=Q,R[ot+5]=st,L[ot+6]=$,L[ot+7]=tt,R[ot+8]=rt,L[ot+9]=Z,L[ot+10]=Q,R[ot+11]=st,L[ot+12]=et,L[ot+13]=it,R[ot+14]=st,L[ot+15]=$,L[ot+16]=tt,R[ot+17]=rt,this.vertexCount+=6,[K,J,f,Z,Q,d,$,tt,f,et,it,d]},batchGraphics:function(t,e,i){if(!(t.commandBuffer.length<=0)){var n=null;i&&(n=i.matrix),this.renderer.setPipeline(this);var r,o,a,h,l,u,y,m,x=e.scrollX*t.scrollFactorX,w=e.scrollY*t.scrollFactorY,b=t.x,T=t.y,S=t.scaleX,A=t.scaleY,C=t.rotation,_=t.commandBuffer,M=e.alpha*t.alpha,E=1,P=1,k=0,F=0,L=1,R=e.matrix.matrix,O=null,B=0,D=0,I=0,z=0,Y=0,X=0,N=0,V=0,U=0,G=null,W=Math.sin,H=Math.cos,j=W(C),q=H(C),K=q*S,J=j*S,Z=-j*A,Q=q*A,$=b,tt=T,et=R[0],it=R[1],nt=R[2],st=R[3],rt=R[4],ot=R[5];if(n){var at=n[0],ht=n[1],lt=n[2],ut=n[3],ct=n[4],dt=n[5],ft=-x,pt=-w,gt=at*et+ht*nt,vt=at*it+ht*st,yt=lt*et+ut*nt,mt=lt*it+ut*st;r=K*gt+J*yt,o=K*vt+J*mt,a=Z*gt+Q*yt,h=Z*vt+Q*mt,l=$*gt+tt*yt+(ct*et+dt*nt+(ft*et+pt*nt+rt)),u=$*vt+tt*mt+(ct*it+dt*st+(ft*it+pt*st+ot))}else r=K*et+J*nt,o=K*it+J*st,a=Z*et+Q*nt,h=Z*it+Q*st,l=($-=x)*et+(tt-=w)*nt+rt,u=$*it+tt*st+ot;v.length=0;for(var xt=0,wt=_.length;xt=0&&n>=0;return r[0]===t&&r[1]===e&&r[2]===i&&r[3]===n||this.flush(),r[0]=t,r[1]=e,r[2]=i,r[3]=n,this.currentScissorEnabled=o,o?(s.disable(s.SCISSOR_TEST),this):(s.enable(s.SCISSOR_TEST),s.scissor(t,this.drawingBufferHeight-e-n,i,n),this)},pushScissor:function(t,e,i,n){var s=this.scissorStack,r=this.currentScissorIdx,o=this.currentScissor;return s[r+0]=o[0],s[r+1]=o[1],s[r+2]=o[2],s[r+3]=o[3],this.currentScissorIdx+=4,this.setScissor(t,e,i,n),this},popScissor:function(){var t=this.scissorStack,e=this.currentScissorIdx-4,i=t[e+0],n=t[e+1],s=t[e+2],r=t[e+3];return this.currentScissorIdx=e,this.setScissor(i,n,s,r),this},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!==s.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),this},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},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;return t!==this.currentFramebuffer&&(this.flush(),e.bindFramebuffer(e.FRAMEBUFFER,t),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 o=this.gl,a=o.NEAREST,h=o.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,r(e,i)&&(h=o.REPEAT),n===s.ScaleModes.LINEAR&&this.config.antialias&&(a=o.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,a,a,h,h,o.RGBA,t):this.createTexture2D(0,a,a,h,h,o.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){var u=this.gl,c=u.createTexture();return l=void 0===l||null===l||l,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&&o(this.nativeTextures,e),this.gl.deleteTexture(t),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=this.config.resolution,i=Math.floor(t.x*e),n=Math.floor(t.y*e),s=Math.floor(t.width*e),r=Math.floor(t.height*e);if(this.pushScissor(i,n,s,r),t.backgroundColor.alphaGL>0){var o=t.backgroundColor,h=this.pipelines.FlatTintPipeline;h.batchFillRect(0,0,1,1,0,t.x,t.y,t.width,t.height,a.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL,1,0,0,1,0,0,[1,0,0,1,0,0]),h.flush()}},postRenderCamera:function(t){var e=this.pipelines.FlatTintPipeline,i=t.flashEffect.postRenderWebGL(e,a.getTintFromFloats);(t.fadeEffect.postRenderWebGL(e,a.getTintFromFloats)||i)&&e.flush(),t.dirty=!1,this.popScissor()},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.config.backgroundColor,i=this.pipelines;for(var n in t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),this.config.clearBeforeRender&&t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT),i)i[n].onPreRender()}},render:function(t,e,i,n){if(!this.contextLost){var r=e.list,o=r.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);this.preRenderCamera(n);for(var l=0;l=0?v=-(v+p):v<0&&(v=Math.abs(v)-p)),-1===x&&(y>=0?y=-(y+g):y<0&&(y=Math.abs(y)-g))}a.copyFrom(e.matrix),i?(a.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y,l=a.multiply(h)):l=h.multiply(a),n.save(),n.transform(l.a,l.b,l.c,l.d,l.e,l.f),n.scale(m,x),n.drawImage(u.source.image,d,f,p,g,v,y,p,g),n.restore()}}},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){var i=!1,n=function(t,e,n){var s=this.currentContext,r=n.canvasData;i&&(t|=0,e|=0),s.drawImage(n.source.image,r.x,r.y,r.width,r.height,t,e,r.width,r.height)};t.exports=function(t){return i=t,n}},function(t,e,i){var n=i(260),s=i(259),r=i(0),o=i(22),a=i(258),h=i(257),l=i(59),u=i(132),c=new r({initialize:function(t){this.game=t,this.type=o.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?l.LINEAR:l.NEAREST,this.gameCanvas=t.canvas,this.gameContext=this.game.config.context?this.game.config.context:this.gameCanvas.getContext("2d"),this.currentContext=this.gameContext,this.drawImage=a,this.blitImage=n(this.config.roundPixels),this.blendModes=h(),this.currentAlpha=1,this.currentBlendMode=0,this.currentScaleMode=0,this.snapshotCallback=null,this.snapshotType=null,this.snapshotEncoder=null,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===l.NEAREST&&u.disable(this.gameContext)},onContextLost:function(){},onContextRestored:function(){},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentBlendMode!==t&&(this.currentContext.globalCompositeOperation=t,this.currentBlendMode=t),this.currentBlendMode},setAlpha:function(t){return this.currentAlpha!==t&&(this.currentContext.globalAlpha=t,this.currentAlpha=t),this.currentAlpha},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=t.sys.context,r=0!==n.x||0!==n.y||n.width!==s.canvas.width||n.height!==s.canvas.height,o=e.list,a=this.config.resolution;this.currentContext=s,n.transparent||(s.fillStyle=n.backgroundColor.rgba,s.fillRect(n.x,n.y,n.width,n.height)),s.globalAlpha=n.alpha,this.currentAlpha=n.alpha,0!==this.currentBlendMode&&(s.globalCompositeOperation="source-over",this.currentBlendMode=0),this.currentScaleMode=0,this.drawCount+=o.length,r&&(s.save(),s.beginPath(),s.rect(n.x*a,n.y*a,n.width*a,n.height*a),s.clip());var h=n.matrix.matrix;s.setTransform(h[0],h[1],h[2],h[3],h[4],h[5]);for(var l=0;l0&&(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,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,A=l*g-c*f,C=l*v-d*f,_=u*g-c*p,M=u*v-d*p,E=c*v-d*g,P=y*E-m*M+x*_+w*C-b*A+T*S;return P?(P=1/P,t[0]=(o*E-a*M+h*_)*P,t[1]=(n*M-i*E-s*_)*P,t[2]=(p*T-g*b+v*w)*P,t[3]=(c*b-u*T-d*w)*P,t[4]=(a*C-r*E-h*A)*P,t[5]=(e*E-n*C+s*A)*P,t[6]=(g*x-f*T-v*m)*P,t[7]=(l*T-c*x+d*m)*P,t[8]=(r*M-o*C+h*S)*P,t[9]=(i*C-e*M-s*S)*P,t[10]=(f*b-p*x+v*y)*P,t[11]=(u*x-l*b-d*y)*P,t[12]=(o*A-r*_-a*S)*P,t[13]=(e*_-i*A+n*S)*P,t[14]=(p*m-f*w-g*y)*P,t[15]=(l*w-u*m+c*y)*P,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,A=r*n*l-s*a,C=n*s*l-r*a,_=s*s*l+h,M=r*s*l+n*a,E=n*r*l+s*a,P=s*r*l-n*a,k=r*r*l+h;return i[0]=u*T+p*S+m*A,i[1]=c*T+g*S+x*A,i[2]=d*T+v*S+w*A,i[3]=f*T+y*S+b*A,i[4]=u*C+p*_+m*M,i[5]=c*C+g*_+x*M,i[6]=d*C+v*_+w*M,i[7]=f*C+y*_+b*M,i[8]=u*E+p*P+m*k,i[9]=c*E+g*P+x*k,i[10]=d*E+v*P+w*k,i[11]=f*E+y*P+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=i(0),s=i(272),r=i(531),o=i(530),a=i(529),h=i(69),l=i(154),u=i(6),c=i(87),d=i(271),f=new c,p=new d,g=new c,v=new c,y=new s,m=new n({initialize:function(t){this.scene=t,this.displayList=t.sys.displayList,this.updateList=t.sys.updateList,this.name="",this.direction=new c(0,0,-1),this.up=new c(0,1,0),this.position=new c,this.pixelScale=128,this.projection=new s,this.view=new s,this.combined=new s,this.invProjectionView=new s,this.near=1,this.far=100,this.ray={origin:new c,direction:new c},this.viewportWidth=0,this.viewportHeight=0,this.billboardMatrixDirty=!0,this.children=new h},setPosition:function(t,e,i){return this.position.set(t,e,i),this.update()},setScene:function(t){return this.scene=t,this},setPixelScale:function(t){return this.pixelScale=t,this.update()},add:function(t){return this.children.set(t),this.updateChildren(),t},remove:function(t){return this.displayList.remove(t.gameObject),this.updateList.remove(t.gameObject),this.children.delete(t),this},clear:function(){for(var t=this.getChildren(),e=0;e16777215?{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(30),s=i(276);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){return n<<24|t<<16|e<<8|i}},function(t,e,i){var n=i(30);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){t.exports=i(535)},function(t,e,i){t.exports={In:i(538),Out:i(537),InOut:i(536)}},function(t,e,i){t.exports={In:i(541),Out:i(540),InOut:i(539)}},function(t,e,i){t.exports={In:i(544),Out:i(543),InOut:i(542)}},function(t,e,i){t.exports={In:i(547),Out:i(546),InOut:i(545)}},function(t,e,i){t.exports=i(548)},function(t,e,i){t.exports={In:i(551),Out:i(550),InOut:i(549)}},function(t,e,i){t.exports={In:i(554),Out:i(553),InOut:i(552)}},function(t,e,i){t.exports={In:i(557),Out:i(556),InOut:i(555)}},function(t,e,i){t.exports={In:i(560),Out:i(559),InOut:i(558)}},function(t,e,i){t.exports={In:i(563),Out:i(562),InOut:i(561)}},function(t,e,i){t.exports={In:i(566),Out:i(565),InOut:i(564)}},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){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n>>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;e0;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(137),s=i(64),r=i(15),o=i(5);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){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(127),r=i(106),o=i(336),a=i(126),h=i(685),l=i(42);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;e0&&(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(42);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r=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.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),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,i){var n=i(0),s=i(166),r=i(12),o=i(165),a=i(61),h=i(71),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;for(t=0;t-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=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;ta&&(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(1),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(638),s=i(321),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-1}return!1}},function(t,e,i){var n=i(23);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l=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(79),s=i(16),r={SceneManager:i(199),ScenePlugin:i(332),Settings:i(197),Systems:i(118)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(170),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(170),DefaultPlugins:i(121),PluginCache:i(12),PluginManager:i(201),ScenePlugin:i(334)}},function(t,e,i){var n={};t.exports=n;var s=i(306);n._motionWakeThreshold=.18,n._motionSleepThreshold=.08,n._minBias=.9,n.update=function(t,e){for(var i=e*e*e,s=0;s0&&r.motion=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;sn._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(33),s=i(0),r=i(43),o=i(31),a=i(6),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){return void 0===i&&(i=this.offset.x),void 0===n&&(n=this.offset.y),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)},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(43);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._dyo&&!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(43);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._dxo&&!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(33),s=i(0),r=i(43),o=i(153),a=i(13),h=i(31),l=i(32),u=i(6),c=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 u,this.position=new u(e.x,e.y),this.prev=new u(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 u(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=new u,this.newVelocity=new u,this.deltaMax=new u,this.acceleration=new u,this.allowDrag=!0,this.drag=new u,this.allowGravity=!0,this.gravity=new u,this.bounce=new u,this.worldBounce=null,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new u(1e4,1e4),this.friction=new u(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,this._tempMatrix=new l},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this._tempMatrix);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY;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.deltaX(),this._dy=this.deltaY()},postUpdate:function(){this._dx=this.deltaX(),this._dy=this.deltaY(),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.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.ye.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(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.position.x-this.prev.x},deltaY:function(){return this.position.y-this.prev.y},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},setVelocityX:function(t){return this.velocity.x=t,this},setVelocityY:function(t){return this.velocity.y=t,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},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=c},function(t,e,i){var n=i(344),s=i(19),r=i(0),o=i(343),a=i(43),h=i(58),l=i(9),u=i(357),c=i(356),d=i(355),f=i(342),p=i(341),g=i(4),v=i(228),y=i(694),m=i(13),x=i(227),w=i(693),b=i(688),T=i(687),S=i(69),A=i(339),C=i(340),_=i(6),M=i(40),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 _(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.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=a.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=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;e0){var l=this.tree,u=this.staticTree;for(o=(r=s.entries).length,t=0;ta.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,u=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)l.right&&(a=h(u.x,u.y,l.right,l.y)-u.radius):u.y>l.bottom&&(u.xl.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),A=(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=(A*Math.cos(o)-T*Math.sin(o))*e.bounce.x,e.velocity.y=(T*Math.cos(o)+A*Math.sin(o))*e.bounce.y,v=e.velocity.x,y=e.velocity.y),Math.abs(o)0&&!t.immovable&&v>c?t.velocity.x*=-1:v<0&&!e.immovable&&c0&&!t.immovable&&y>d?t.velocity.y*=-1:y<0&&!e.immovable&&dMath.PI/2&&(c<0&&!t.immovable&&v0&&!e.immovable&&c>v?e.velocity.x*=-1:d<0&&!t.immovable&&y0&&!e.immovable&&c>y&&(e.velocity.y*=-1));var C=this._frameTime;return t.immovable||(t.x+=t.velocity.x*C-a*Math.cos(o),t.y+=t.velocity.y*C-a*Math.sin(o)),e.immovable||(e.x+=e.velocity.x*C+a*Math.cos(o),e.y+=e.velocity.y*C+a*Math.sin(o)),(t.onCollide||e.onCollide)&&this.emit("collide",t.gameObject,e.gameObject,t,e),!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;o0},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;oc.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;ve-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)=0?t:t+2*Math.PI}},function(t,e,i){var n=i(0),s=i(18),r=i(69),o=i(9),a=i(7),h=i(1),l=i(12),u=i(74),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;e0},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.size0&&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(9),r=i(4),o=i(75),a=i(176),h=i(109),l=i(175),u=i(375),c=i(374),d=i(373),f=i(145),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-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}}},function(t,e,i){var n=i(88),s=i(33),r=i(0),o=i(180),a=i(381),h=i(58),l=i(114),u=i(55),c=i(9),d=i(1),f=i(75),p=i(8),g=i(12),v=i(13),y=i(31),m=i(67),x=i(60),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,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-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;r0&&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,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;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=this._temp;this.emit("pointerdown",t,e);for(var i=0,n=0;n0?t.dragState=1:t.dragState>0&&!t.primaryDown&&t.justUp&&(t.dragState=5),1===t.dragState){var a=[];for(i=0;i1&&(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;i0?(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;i0)for(this.sortGameObjects(s),this.emit("pointerout",t,s),e=0;e0)for(this.sortGameObjects(r),this.emit("pointerover",t,r),e=0;e-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;ct.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom0){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(847),CircleToRectangle:i(846),GetRectangleIntersection:i(845),LineToCircle:i(402),LineToLine:i(146),LineToRectangle:i(844),PointToLine:i(401),PointToLineSegment:i(843),RectangleToRectangle:i(237),RectangleToTriangle:i(842),RectangleToValues:i(841),TriangleToCircle:i(840),TriangleToLine:i(839),TriangleToTriangle:i(838)}},function(t,e,i){t.exports={Circle:i(857),Ellipse:i(243),Intersects:i(403),Line:i(837),Point:i(819),Polygon:i(805),Rectangle:i(394),Triangle:i(776)}},function(t,e,i){var n=i(0),s=i(406),r=i(151),o=i(21),a=new n({initialize:function(){this.lightPool=[],this.lights=[],this.culledLights=[],this.ambientColor={r:.1,g:.1,b:.1},this.active=!1},enable:function(){return 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,o=t.y+t.height/2,a=(t.width+t.height)/2,h={x:0,y:0},l=t.matrix,u=this.systems.game.config.height;i.length=0;for(var c=0;c0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],r):h=new s(t,e,i,a[0],a[1],a[2],r),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=a},function(t,e,i){var n=i(0),s=i(21),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(25),s=i(14),r=i(10),o=i(110);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(25),s=i(128),r=i(14),o=i(10),a=i(35);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(25),s=i(14),r=i(10),o=i(68);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(14),s=i(115);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(110);i(11).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(11),s=i(35);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(68);i(11).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(115);i(11).register("graphics",function(t){return this.displayList.add(new n(this.scene,t))})},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<r;h--){for(l=0;l0&&e.cameraFilter&s.id||""===e.text)){var o=t.currentContext,a=s.alpha*e.alpha;if(0!==a){t.currentAlpha!==a&&(t.currentAlpha=a,o.globalAlpha=a),t.currentBlendMode!==e.blendMode&&(t.currentBlendMode=e.blendMode,o.globalCompositeOperation=t.blendModes[e.blendMode]),t.currentScaleMode!==e.scaleMode&&(t.currentScaleMode=e.scaleMode);var h=e.canvas;if(o.save(),void 0!==r){var l=r.matrix;o.transform(l[0],l[1],l[2],l[3],l[4],l[5])}var u=e.x-s.scrollX*e.scrollFactorX,c=e.y-s.scrollY*e.scrollFactorY;s.roundPixels&&(u|=0,c|=0),o.translate(u,c),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY),o.translate(h.width*(e.flipX?1:0),h.height*(e.flipY?1:0)),o.scale(e.flipX?-1:1,e.flipY?-1:1),o.drawImage(h,0,0,h.width,h.height,-e.displayOriginX,-e.displayOriginY,h.width,h.height),o.restore()}}}},function(t,e,i){var n=i(2),s=i(21);t.exports=function(t,e,i,r,o){if(!(n.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&r.id||""===e.text)){e.dirty&&(e.canvasTexture=t.canvasToTexture(e.canvas,e.canvasTexture),e.dirty=!1);var a=s.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,e.canvasTexture,e.canvasTexture.width,e.canvasTexture.height,e.x,e.y,e.canvasTexture.width,e.canvasTexture.height,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,e.canvasTexture.width,e.canvasTexture.height,a(e._tintTL,r.alpha*e._alphaTL),a(e._tintTR,r.alpha*e._alphaTR),a(e._tintBL,r.alpha*e._alphaBL),a(e._tintBR,r.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,r,o)}}},function(t,e,i){var n=i(3),s=i(3);n=i(419),s=i(418),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.maxLinesc&&(f=-c),0!==f&&(d+=f>0?f*i.length:f*(i.length-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(0),s=i(39),r=i(62),o=i(4),a=i(35),h=i(61),l=i(6),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(6),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;ithis._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(52),s=i(0),r=i(17),o=i(426),a=i(425),h=i(902),l=i(1),u=i(149),c=i(424),d=i(111),f=i(428),p=i(423),g=i(13),v=i(83),y=i(6),m=i(40),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;e0&&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;s0?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;o0){var u=s.splice(s.length-l,l),c=this.deathCallback,d=this.deathCallbackScope;if(c)for(var f=0;f0&&(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(39),r=i(58),o=function(t){return(t>>16)+(65280&t)+((255&t)<<16)},a=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.color=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"),a=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var h=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(h)*Math.abs(n),this.velocityY=Math.sin(h)*Math.abs(a)}else if(i.moveTo){var l=i.moveToX.onEmit(this,"moveToX"),u=i.moveToY?i.moveToY.onEmit(this,"moveToY"):l,c=Math.atan2(u-this.y,l-this.x),d=r(this.x,this.y,l,u)/(this.life/1e3);this.velocityX=Math.cos(c)*d,this.velocityY=Math.sin(c)*d}else this.velocityX=n,this.velocityY=a;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");var f=255&(255*this.alpha|0);this.color=(f<<24|o(this.tint))>>>0,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;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.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;if(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))return 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);var a=255&(255*this.alpha|0);return this.color=(a<<24|o(this.tint))>>>0,this.lifeCurrent-=t,this.lifeCurrent<=0}});t.exports=a},function(t,e,i){var n=i(0),s=i(1),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);s0&&e.cameraFilter&s.id||t.drawImage(e,s,r)}},function(t,e,i){var n=i(2);t.exports=function(t,e,i,s,r){n.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&s.id||this.pipeline.batchSprite(e,s,r)}},function(t,e,i){var n=i(3),s=i(3);n=i(431),s=i(430),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(2);t.exports=function(t,e,i,s,r){n.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&s._id||this.pipeline.batchGraphics(this,s,r)}},function(t,e,i){var n=i(3),s=i(3);n=i(433),s=i(181),s=i(181),t.exports={renderWebGL:n,renderCanvas:s}},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(13);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(55);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(55);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(114);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(13);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-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;i0&&(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(56);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(29);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;ht.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(248);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=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(29);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;o0){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;a0||!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;athis.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;cx||a<-x)&&(a=0),a<0&&(a=x+a),-1!==h&&(x=a+(h+1));for(var _=l,M=l,E=0,P=e.sourceIndex,k=0;kg||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;wr&&(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(34);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(34);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=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(57),s=i(80),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){t.exports={os:i(57),browser:i(80),features:i(120),input:i(492),audio:i(491),video:i(490),fullscreen:i(489),canvasFeatures:i(208)}},function(t,e,i){var n=i(22);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 texel = texture2D(uMainSampler, outTexCoord);",""," if (outTintEffect == 1.0)"," {"," texel.rgb = mix(texel.rgb, outTint.rgb, texel.a);"," }"," else"," {"," texel *= vec4(outTint.rgb * outTint.a, outTint.a);"," }",""," gl_FragColor = texel;","}",""].join("\n")},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_FLAT_TINT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform mat4 uModelMatrix;","","attribute vec2 inPosition;","attribute vec4 inTint;","","varying vec4 outTint;","","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);"," outTint = inTint;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_FLAT_TINT_FS","","precision mediump float;","","varying vec4 outTint;","","void main() {"," gl_FragColor = vec4(outTint.rgb * outTint.a, outTint.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(266),s=i(24),r=i(22),o=i(120);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=s.create(t,h.width,h.height,h.renderType),h.canvasStyle&&(t.canvas.style=h.canvasStyle),h.antialias||n.setCrisp(t.canvas),1!==h.zoom&&(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(261),a=i(256),h.renderType===r.WEBGL?(t.renderer=new a(t),t.context=null):(t.renderer=new e(t),t.context=t.renderer.gameContext))}},function(t,e,i){var n=i(0),s=i(22),r=i(1),o=i(4),a=i(8),h=i(15),l=i(3),u=i(121),c=i(133),d=new n({initialize:function(t){void 0===t&&(t={});this.width=o(t,"width",1024),this.height=o(t,"height",768),this.zoom=o(t,"zoom",1),this.resolution=o(t,"resolution",1),this.renderType=o(t,"type",s.AUTO),this.parent=o(t,"parent",null),this.canvas=o(t,"canvas",null),this.context=o(t,"context",null),this.canvasStyle=o(t,"canvasStyle",null),this.sceneConfig=o(t,"scene",null),this.seed=o(t,"seed",[(Date.now()*Math.random()).toString()]),h.RND.init(this.seed),this.gameTitle=o(t,"title",""),this.gameURL=o(t,"url","https://phaser.io"),this.gameVersion=o(t,"version",""),this.autoFocus=o(t,"autoFocus",!0),this.inputKeyboard=o(t,"input.keyboard",!0),this.inputKeyboardEventTarget=o(t,"input.keyboard.target",window),this.inputMouse=o(t,"input.mouse",!0),this.inputMouseEventTarget=o(t,"input.mouse.target",null),this.inputMouseCapture=o(t,"input.mouse.capture",!0),this.inputTouch=o(t,"input.touch",!0),this.inputTouchEventTarget=o(t,"input.touch.target",null),this.inputTouchCapture=o(t,"input.touch.capture",!0),this.inputActivePointers=o(t,"input.activePointers",1),this.inputGamepad=o(t,"input.gamepad",!1),this.inputGamepadEventTarget=o(t,"input.gamepad.target",window),this.disableContextMenu=o(t,"disableContextMenu",!1),this.audio=o(t,"audio"),this.hideBanner=!1===o(t,"banner",null),this.hidePhaser=o(t,"banner.hidePhaser",!1),this.bannerTextColor=o(t,"banner.text","#ffffff"),this.bannerBackgroundColor=o(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=o(t,"fps",null);var e=o(t,"render",t);this.autoResize=o(e,"autoResize",!1),this.antialias=o(e,"antialias",!0),this.roundPixels=o(e,"roundPixels",!1),this.pixelArt=o(e,"pixelArt",!1),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=o(e,"transparent",!1),this.clearBeforeRender=o(e,"clearBeforeRender",!0),this.premultipliedAlpha=o(e,"premultipliedAlpha",!0),this.preserveDrawingBuffer=o(e,"preserveDrawingBuffer",!1),this.failIfMajorPerformanceCaveat=o(e,"failIfMajorPerformanceCaveat",!1),this.powerPreference=o(e,"powerPreference","default"),this.batchSize=o(e,"batchSize",2e3);var i=o(t,"backgroundColor",0);this.backgroundColor=c(i),0===i&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=o(t,"callbacks.preBoot",l),this.postBoot=o(t,"callbacks.postBoot",l),this.physics=o(t,"physics",{}),this.defaultPhysicsSystem=o(this.physics,"default",!1),this.loaderBaseURL=o(t,"loader.baseURL",""),this.loaderPath=o(t,"loader.path",""),this.loaderMaxParallelDownloads=o(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=o(t,"loader.crossOrigin",void 0),this.loaderResponseType=o(t,"loader.responseType",""),this.loaderAsync=o(t,"loader.async",!0),this.loaderUser=o(t,"loader.user",""),this.loaderPassword=o(t,"loader.password",""),this.loaderTimeout=o(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var n=o(t,"plugins",null),d=u.DefaultScene;n&&(Array.isArray(n)?this.defaultPlugins=n:a(n)&&(this.installGlobalPlugins=r(n,"global",[]),this.installScenePlugins=r(n,"scene",[]),Array.isArray(n.default)?d=n.default:Array.isArray(n.defaultMerge)&&(d=d.concat(n.defaultMerge)))),this.defaultPlugins=d;var f="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=o(t,"images.default",f+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=o(t,"images.missing",f+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg==")}});t.exports=d},function(t,e,i){var n=i(131),s=i(212),r=i(210),o=i(24),a=i(0),h=i(503),l=i(502),u=i(81),c=i(494),d=i(493),f=i(265),p=i(9),g=i(206),v=i(201),y=i(199),m=i(196),x=i(189),w=i(476),b=i(475),T=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 x(this),this.cache=new r(this),this.registry=new u(this),this.input=new g(this,this.config),this.scene=new y(this,this.config.sceneConfig),this.device=d,this.sound=m.create(this),this.loop=new w(this,this.config.fps),this.plugins=new v(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.hasFocus=!1,this.isOver=!0,f(this.boot.bind(this))},boot:function(){this.isBooted=!0,this.config.preBoot(this),l(this),c(this),n(this.canvas,this.config.parent),this.events.emit("boot"),this.events.once("ready",this.start,this)},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)),b(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){this.pendingDestroy=!0,this.removeCanvas=t},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=T},function(t,e,i){var n=i(0),s=i(9),r=i(12),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(505)}},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=[];++c1)for(var i=1;i1&&(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(30);n.ColorToRGBA=i(927),n.ComponentToHex=i(511),n.GetColor=i(155),n.GetColor32=i(278),n.HexStringToColor=i(279),n.HSLToColor=i(926),n.HSVColorWheel=i(925),n.HSVToRGB=i(509),n.HueToComponent=i(510),n.IntegerToColor=i(277),n.IntegerToRGB=i(276),n.Interpolate=i(924),n.ObjectToColor=i(275),n.RandomRGB=i(923),n.RGBStringToColor=i(274),n.RGBToHSV=i(922),n.RGBToString=i(921),n.ValueToColor=i(133),t.exports=n},function(t,e,i){var n=i(0),s=i(81),r=i(12),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(81),DataManagerPlugin:i(513)}},function(t,e,i){var n=i(267),s=i(0),r=i(86),o=i(6),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;ei.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;ei;)n-=i;n0&&e.cameraFilter&s.id||t.drawImage(e,s,r)}},function(t,e,i){var n=i(2);t.exports=function(t,e,i,s,r){n.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&s.id||this.pipeline.batchSprite(e,s,r)}},function(t,e,i){var n=i(3),s=i(3);n=i(525),s=i(524),t.exports={renderWebGL:n,renderCanvas:s}},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,A=r*u-o*l,C=c*v-d*g,_=c*y-f*g,M=c*m-p*g,E=d*y-f*v,P=d*m-p*v,k=f*m-p*y,F=x*k-w*P+b*E+T*M-S*_+A*C;return F?(F=1/F,i[0]=(h*k-l*P+u*E)*F,i[1]=(l*M-a*k-u*_)*F,i[2]=(a*P-h*M+u*C)*F,i[3]=(r*P-s*k-o*E)*F,i[4]=(n*k-r*M+o*_)*F,i[5]=(s*M-n*P-o*C)*F,i[6]=(v*A-y*S+m*T)*F,i[7]=(y*b-g*A-m*w)*F,i[8]=(g*S-v*b+m*x)*F,this):null}});t.exports=n},function(t,e,i){var n=i(0),s=i(87),r=i(527),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=i(87),s=i(272),r=i(528),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){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,i){var n=i(124),s=i(0),r=i(1),o=i(12),a=i(31),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(){this.main||this.boot();var t=this.systems.events;t.on("update",this.update,this),t.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;s0&&(h.preRender(r,o),t.render(n,e,i,h))}},resetAll:function(){for(var t=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(19),s=i(0),r=i(6),o=i(123),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-h&&(c-=h,n+=l),f=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(15),s=i(32),r=i(217),o=i(216),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){void 0===t&&(t=new s);var e=this.parentContainer;if(!e)return this.getLocalTransformMatrix(t);for(var i=[];e;)i.unshift(e),e=e.parentContainer;t.loadIdentity();for(var n=i.length,r=0;r>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,_crop:{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},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}};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){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=i(59),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){var i={matrixStack:null,currentMatrix:null,currentMatrixIndex:0,initMatrixStack:function(){return this.matrixStack=new Float32Array(6e3),this.currentMatrix=new Float32Array([1,0,0,1,0,0]),this.currentMatrixIndex=0,this},save:function(){if(this.currentMatrixIndex>=this.matrixStack.length)return this;var t=this.matrixStack,e=this.currentMatrix,i=this.currentMatrixIndex;return this.currentMatrixIndex+=6,t[i+0]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=e[3],t[i+4]=e[4],t[i+5]=e[5],this},restore:function(){if(this.currentMatrixIndex<=0)return this;this.currentMatrixIndex-=6;var t=this.matrixStack,e=this.currentMatrix,i=this.currentMatrixIndex;return e[0]=t[i+0],e[1]=t[i+1],e[2]=t[i+2],e[3]=t[i+3],e[4]=t[i+4],e[5]=t[i+5],this},loadIdentity:function(){return this.setTransform(1,0,0,1,0,0),this},transform:function(t,e,i,n,s,r){var o=this.currentMatrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=a*t+l*e,o[1]=h*t+u*e,o[2]=a*i+l*n,o[3]=h*i+u*n,o[4]=a*s+l*r+c,o[5]=h*s+u*r+d,this},setTransform:function(t,e,i,n,s,r){var o=this.currentMatrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},translate:function(t,e){var i=this.currentMatrix,n=i[0],s=i[1],r=i[2],o=i[3],a=i[4],h=i[5];return i[4]=n*t+r*e+a,i[5]=s*t+o*e+h,this},scale:function(t,e){var i=this.currentMatrix,n=i[0],s=i[1],r=i[2],o=i[3];return i[0]=n*t,i[1]=s*t,i[2]=r*e,i[3]=o*e,this},rotate:function(t){var e=this.currentMatrix,i=e[0],n=e[1],s=e[2],r=e[3],o=Math.sin(t),a=Math.cos(t);return e[0]=i*a+s*o,e[1]=n*a+r*o,e[2]=i*-o+s*a,e[3]=n*-o+r*a,this}};t.exports=i},function(t,e,i){var n=i(219),s=i(218),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,i){var n=i(13),s=i(297),r=i(6),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={_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){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(52),s={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),(t|=0)>=0&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,e,i){var n=i(19),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,i){var n=i(47),s=i(45),r=i(46),o=i(44);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(49),s=i(45),r=i(48),o=i(44);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(92),s=i(45),r=i(91),o=i(44);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(89),s=i(47),r=i(90),o=i(46);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(89),s=i(49),r=i(90),o=i(48);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(91),s=i(90);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(598),s=i(92),r=i(89);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(51),s=i(47),r=i(50),o=i(46);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(51),s=i(49),r=i(50),o=i(48);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(51),s=i(92),r=i(50),o=i(91);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(304),s=[];s[n.BOTTOM_CENTER]=i(602),s[n.BOTTOM_LEFT]=i(601),s[n.BOTTOM_RIGHT]=i(600),s[n.CENTER]=i(599),s[n.LEFT_CENTER]=i(597),s[n.RIGHT_CENTER]=i(596),s[n.TOP_CENTER]=i(595),s[n.TOP_LEFT]=i(594),s[n.TOP_RIGHT]=i(593);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){t.exports={Angle:i(1011),Call:i(1010),GetFirst:i(1009),GetLast:i(1008),GridAlign:i(1007),IncAlpha:i(1006),IncX:i(1005),IncXY:i(1004),IncY:i(1003),PlaceOnCircle:i(1002),PlaceOnEllipse:i(1001),PlaceOnLine:i(1e3),PlaceOnRectangle:i(999),PlaceOnTriangle:i(998),PlayAnimation:i(997),PropertyValueInc:i(36),PropertyValueSet:i(26),RandomCircle:i(996),RandomEllipse:i(995),RandomLine:i(994),RandomRectangle:i(993),RandomTriangle:i(992),Rotate:i(991),RotateAround:i(990),RotateAroundDistance:i(989),ScaleX:i(988),ScaleXY:i(987),ScaleY:i(986),SetAlpha:i(985),SetBlendMode:i(984),SetDepth:i(983),SetHitArea:i(982),SetOrigin:i(981),SetRotation:i(980),SetScale:i(979),SetScaleX:i(978),SetScaleY:i(977),SetTint:i(976),SetVisible:i(975),SetX:i(974),SetXY:i(973),SetY:i(972),ShiftPosition:i(971),Shuffle:i(970),SmootherStep:i(969),SmoothStep:i(968),Spread:i(967),ToggleVisible:i(966),WrapInRectangle:i(965)}},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>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s0&&e.cameraFilter&s.id)){e.cull(s);var r=e.culledTiles,o=this.tileset,a=t.gameContext,h=r.length,l=o.image.getSourceImage(),u=e.x-s.scrollX*e.scrollFactorX,c=e.y-s.scrollY*e.scrollFactorY;a.save(),a.translate(u,c),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY),a.scale(e.flipX?-1:1,e.flipY?-1:1),a.globalAlpha=s.alpha*e.alpha;for(var d=0;d0&&e.cameraFilter&s.id)&&(e.upload(s),e.vertexCount>0)){var r=t.gl,o=this.pipeline,a=o.vertexBuffer,h=e.tileset.image.get();t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),o.vertexBuffer=e.vertexBuffer,t.setPipeline(o),t.setTexture2D(h.glTexture,0),r.drawArrays(o.topology,0,e.vertexCount),o.vertexBuffer=a,o.viewIdentity(),o.modelIdentity()}}},function(t,e,i){var n=i(3),s=i(3);n=i(628),s=i(627),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(2);t.exports=function(t,e,i,s){if(!(n.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&s.id)){e.cull(s);var r=e.culledTiles,o=r.length,a=e.tileset.image.getSourceImage(),h=this.tileset,l=e.x-s.scrollX*e.scrollFactorX,u=e.y-s.scrollY*e.scrollFactorY,c=t.gameContext;c.save(),c.translate(l,u),c.rotate(e.rotation),c.scale(e.scaleX,e.scaleY),c.scale(e.flipX?-1:1,e.flipY?-1:1);for(var d=0;d0&&e.cameraFilter&r.id||o<=0)){e.cull(r);for(var a=this.pipeline,h=s.getTintAppendFloatAlpha,l=e.culledTiles,u=l.length,c=e.tileset,d=c.glTexture,f=e.scrollFactorX,p=e.scrollFactorY,g=e.x,v=e.y,y=e.scaleX,m=e.scaleY,x=0;x-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(16);t.exports=function(t){for(var e,i,s,r,o,a=0;a>>0;return n}},function(t,e,i){var n=i(641),s=i(1),r=i(104),o=i(321),a=i(65);t.exports=function(t,e){for(var i=[],h=0;h0){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(324),Parse2DArray:i(222),ParseCSV:i(323),Impact:i(317),Tiled:i(322)}},function(t,e,i){var n=i(54),s=i(53),r=i(6);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(23);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;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e,i){var n=i(66),s=i(41),r=i(111);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;ae)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(66),s=i(41),r=i(223);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=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=d&&x+a<=f&&w>=p&&w+h<=g)&&i.push(m)}}return r.tilesDrawn=i.length,r.tilesTotal=u*c,i}},function(t,e,i){var n=i(140),s=i(139),r=i(23),o=i(327);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=0&&p=0&&gr?(s.warn("Plugin.register:",n.toString(e),"was upgraded to",n.toString(t)),n._registry[t.name]=t):i-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;a0&&!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=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(1017);n.Body=i(73),n.Composite=i(226),n.World=i(679),n.Detector=i(683),n.Grid=i(1016),n.Pairs=i(1015),n.Pair=i(615),n.Query=i(1037),n.Resolver=i(1014),n.SAT=i(682),n.Constraint=i(305),n.Common=i(42),n.Engine=i(1013),n.Events=i(306),n.Sleeping=i(336),n.Plugin=i(680),n.Bodies=i(171),n.Composites=i(1020),n.Axes=i(685),n.Bounds=i(126),n.Svg=i(1035),n.Vector=i(106),n.Vertices=i(127),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(127),r=i(106);!function(){n.collides=function(e,n,o){var a,h,l,u,c=!1;if(o){var d=e.parent,f=n.parent,p=d.speed*d.speed+d.angularSpeed*d.angularSpeed+f.speed*f.speed+f.angularSpeed*f.angularSpeed;c=o&&o.collided&&p<.2,u=o}else u={collided:!1,bodyA:e,bodyB:n};if(o&&c){var g=u.axisBody,v=g===e?n:e,y=[g.axes[o.axisNumber]];if(l=t(g.vertices,v.vertices,y),u.reused=!0,l.overlap<=0)return u.collided=!1,u}else{if((a=t(e.vertices,n.vertices,e.axes)).overlap<=0)return u.collided=!1,u;if((h=t(n.vertices,e.vertices,n.axes)).overlap<=0)return u.collided=!1,u;a.overlaps?s=a:a=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))1?1:0;d1?1:0;p0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n=i(171),s=i(73),r=i(0),o=i(616),a=i(1),h=i(111),l=i(127),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;f1&&(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(106),r=i(42);n.fromVertices=function(t){for(var e={},i=0;i0?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(342);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(689);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.y0&&!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(691);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.x0&&!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(692),s=i(690),r=i(340);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()=0;a--){var h=e[a],l=r(s,o,h.x,h.y);l=0;a--){var h=e[a],l=r(s,o,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 u),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new u),i.setToPolar(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}});l.register("ArcadePhysics",d,"arcadePhysics"),t.exports=d},function(t,e,i){var n=i(43),s=i(16),r={ArcadePhysics:i(707),Body:i(344),Collider:i(343),Factory:i(350),Group:i(347),Image:i(349),Sprite:i(143),StaticBody:i(339),StaticGroup:i(346),World:i(345)};r=s(!1,r,n),t.exports=r},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;o1?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;i0&&0==(t&t-1)}},function(t,e,i){t.exports={GetNext:i(415),IsSize:i(85),IsValue:i(725)}},function(t,e,i){var n=i(292);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var n=i(122);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(267);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=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");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("html",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)e.x&&t.ye.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;on(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(233);t.exports=function(t,e){var i=n(t);return ii&&(i=h.x),h.xr&&(r=h.y),h.ye.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e,i){var n=i(60),s=i(146);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(402),s=i(60);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottomt.right+r||it.bottom+r||st.right||e.rightt.bottom||e.bottom0}},function(t,e,i){var n=i(401);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){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){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(13),s=i(237);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(58);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(13);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(33);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(33);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(88);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(88);n.Area=i(856),n.Circumference=i(300),n.CircumferencePoint=i(137),n.Clone=i(855),n.Contains=i(33),n.ContainsPoint=i(854),n.ContainsRect=i(853),n.CopyFrom=i(852),n.Equals=i(851),n.GetBounds=i(850),n.GetPoint=i(303),n.GetPoints=i(301),n.Offset=i(849),n.OffsetPoint=i(848),n.Random=i(162),t.exports=n},function(t,e,i){var n=i(0),s=i(405),r=i(12),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(25),s=i(14),r=i(10),o=i(238);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(25),s=i(14),r=i(10),o=i(4),a=i(147);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(238);i(11).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(147);i(11).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(2),s=i(21);t.exports=function(t,e,i,r,o){if(!(n.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&r.id)){var a=this.pipeline;t.setPipeline(a,e);var h=a._tempMatrix1,l=a._tempMatrix2,u=a._tempMatrix3;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,h.multiply(l,u)):(l.e-=r.scrollX*e.scrollFactorX,l.f-=r.scrollY*e.scrollFactorY,h.multiply(l,u));var c=e.frame.glTexture;a.setTexture2D(c,0);var d=e.vertices,f=e.uv,p=e.colors,g=e.alphas,v=d.length,y=Math.floor(.5*v);a.vertexCount+y>=a.vertexCapacity&&a.flush();for(var m=a.vertexViewF32,x=a.vertexViewU32,w=a.vertexCount*a.vertexComponentCount-1,b=0,T=e.tintFill,S=0;S0&&e.cameraFilter&s.id)){var o=t.currentContext,a=e.frame;e.updateTileTexture();var h=s.alpha*e.alpha;if(0!==h){t.currentAlpha!==h&&(t.currentAlpha=h,o.globalAlpha=h),t.currentBlendMode!==e.blendMode&&(t.currentBlendMode=e.blendMode,o.globalCompositeOperation=t.blendModes[e.blendMode]),t.currentScaleMode!==e.scaleMode&&(t.currentScaleMode=e.scaleMode);var l=a.x-e.originX*e.width,u=a.y-e.originY*e.height,c=e.x-s.scrollX*e.scrollFactorX,d=e.y-s.scrollY*e.scrollFactorY,f=1,p=1;if(e.flipX&&(f=-1,l+=e.width),e.flipY&&(p=-1,u+=e.height),s.roundPixels&&(l|=0,u|=0,c|=0,d|=0),o.save(),void 0!==r){var g=r.matrix;o.transform(g[0],g[1],g[2],g[3],g[4],g[5])}o.translate(l,u),o.translate(c,d),o.scale(f,p),o.translate(e.originX*e.width,e.originY*e.height),o.rotate(f*p*e.rotation),o.scale(this.scaleX,this.scaleY),o.translate(-e.originX*e.width,-e.originY*e.height),o.scale(e.tileScaleX,e.tileScaleY),o.translate(-this.tilePositionX,-this.tilePositionY),o.fillStyle=e.tileTexture,o.fillRect(this.tilePositionX,this.tilePositionY,e.width/e.tileScaleX,e.height/e.tileScaleY),o.restore()}}}},function(t,e,i){var n=i(2),s=i(21);t.exports=function(t,e,i,r,o){if(!(n.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&r.id)){e.updateTileTexture();var a=s.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,e.tileTexture,e.frame.width*e.tileScaleX,e.frame.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,a(e._tintTL,r.alpha*e._alphaTL),a(e._tintTR,r.alpha*e._alphaTR),a(e._tintBL,r.alpha*e._alphaBL),a(e._tintBR,r.alpha*e._alphaBR),e._isTinted&&e.tintFill,e.tilePositionX%e.frame.width/e.frame.width,e.tilePositionY%e.frame.height/e.frame.height,r,o)}}},function(t,e,i){var n=i(3),s=i(3);n=i(888),s=i(887),t.exports={renderWebGL:n,renderCanvas:s}},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,"charsPerRow",null);null===f&&(f=t.sys.textures.getFrame(h).width/i)>a.length&&(f=a.length);for(var p=l,g=u,v={retroFont:!0,font:h,size:i,lineHeight:s,chars:{}},y=0,m=0;m?@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(891),s=i(16),r={Parse:i(890)};r=s(!1,r,n),t.exports=r},function(t,e){var i={fill:function(t,e){void 0===e&&(e=1);var i=255&(t>>16|0),n=255&(t>>8|0),s=255&(0|t);this.renderer.setFramebuffer(this.framebuffer);var r=this.gl;return r.clearColor(i/255,n/255,s/255,e),r.clear(r.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null),this},clear:function(){this.renderer.setFramebuffer(this.framebuffer);var t=this.gl;return t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null),this},draw:function(t,e,i,n,s){s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),this.renderer.setFramebuffer(this.framebuffer);var r=this.pipeline;return r.projOrtho(0,r.width,0,r.height,-1e3,1e3),r.drawTextureFrame(e,i,n,s,this.globalAlpha,this.currentMatrix,null),this.renderer.setFramebuffer(null),r.projOrtho(0,r.width,r.height,0,-1e3,1e3),this}};t.exports=i},function(t,e){t.exports={fill:function(t){var e=255&(t>>16|0),i=255&(t>>8|0),n=255&(0|t);return this.context.fillStyle="rgb("+e+","+i+","+n+")",this.context.fillRect(0,0,this.canvas.width,this.canvas.height),this},clear:function(){return this.context.save(),this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.restore(),this},draw:function(t,e,i,n){var s=e.canvasData,r=e.source.image,o=this.currentMatrix;return this.context.globalAlpha=this.globalAlpha,this.context.setTransform(o[0],o[1],o[2],o[3],o[4],o[5]),this.context.drawImage(r,s.sx,s.sy,s.sWidth,s.sHeight,i,n,s.dWidth,s.dHeight),this}}},function(t,e,i){var n=i(2);t.exports=function(t,e,i,s,r){if(!(n.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&s._id)){var o=t.currentContext,a=s.alpha*e.alpha;if(0!==a){t.currentAlpha!==a&&(t.currentAlpha=a,o.globalAlpha=a),t.currentBlendMode!==e.blendMode&&(t.currentBlendMode=e.blendMode,o.globalCompositeOperation=t.blendModes[e.blendMode]),t.currentScaleMode!==e.scaleMode&&(t.currentScaleMode=e.scaleMode);var h=0,l=0,u=1,c=1;if(e.flipX?(u=-1,h-=e.canvas.width-e.displayOriginX):h-=e.displayOriginX,e.flipY?(c=-1,l-=e.canvas.height-e.displayOriginY):l-=e.displayOriginY,o.save(),void 0!==r){var d=r.matrix;o.transform(d[0],d[1],d[2],d[3],d[4],d[5])}o.translate(e.x-s.scrollX*e.scrollFactorX,e.y-s.scrollY*e.scrollFactorY),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY),o.scale(u,c),o.drawImage(e.canvas,h,l),o.restore()}}}},function(t,e,i){var n=i(2),s=i(21);t.exports=function(t,e,i,r,o){if(!(n.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&r._id)){var a=s.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,e.texture,e.texture.width,e.texture.height,e.x,e.y,e.width,e.height,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,e.texture.width,e.texture.height,a(e._tintTL,r.alpha*e._alphaTL),a(e._tintTR,r.alpha*e._alphaTR),a(e._tintBL,r.alpha*e._alphaBL),a(e._tintBR,r.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,r,o)}}},function(t,e,i){var n=i(3),s=i(3);n=i(896),s=i(895),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){t.exports={DeathZone:i(426),EdgeZone:i(425),RandomZone:i(423)}},function(t,e,i){var n=i(2);t.exports=function(t,e,i,s,r){var o=e.emitters.list;if(!(0===o.length||n.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&s._id)){var a=t.currentContext;if(a.save(),void 0!==r){var h=r.matrix;a.transform(h[0],h[1],h[2],h[3],h[4],h[5])}for(var l=0;l>24&255)/255;if(!(m<=0)){var x=y.frame,w=.5*x.width,b=.5*x.height,T=x.canvasData,S=-w,A=-b,C=y.x-p,_=y.y-g;s.roundPixels&&(C|=0,_|=0),a.globalAlpha=m,a.save(),a.translate(C,_),a.rotate(y.rotation),a.scale(y.scaleX,y.scaleY),a.drawImage(x.source.image,T.sx,T.sy,T.sWidth,T.sHeight,S,A,T.dWidth,T.dHeight),a.restore()}}a.globalAlpha=f}}a.restore()}}},function(t,e,i){var n=i(2);t.exports=function(t,e,i,s,r){var o=e.emitters.list;if(!(0===o.length||n.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&s._id)){var a=this.pipeline,h=a._tempMatrix1.copyFrom(s.matrix),l=a._tempMatrix2,u=a._tempMatrix3;t.setPipeline(a);var c=s.roundPixels,d=e.defaultFrame.glTexture;a.setTexture2D(d,0);for(var f=0;f0&&e.cameraFilter&s.id)){var h=e.frame,l=e.displayCallback,u=s.scrollX*e.scrollFactorX,c=s.scrollY*e.scrollFactorY,d=e.fontData.chars,f=e.fontData.lineHeight,p=0,g=0,v=0,y=0,m=null,x=0,w=0,b=0,T=0,S=0,A=0,C=null,_=0,M=t.currentContext,E=e.frame.source.image,P=h.cutX,k=h.cutY,F=0,L=e.fontSize/e.fontData.size,R=s.alpha*e.alpha;if(0!==R){if(t.currentAlpha!==R&&(t.currentAlpha=R,M.globalAlpha=R),t.currentBlendMode!==e.blendMode&&(t.currentBlendMode=e.blendMode,M.globalCompositeOperation=t.blendModes[e.blendMode]),t.currentAlpha!==e.alpha&&(t.currentAlpha=e.alpha,M.globalAlpha=e.alpha),t.currentScaleMode!==e.scaleMode&&(t.currentScaleMode=e.scaleMode),M.save(),void 0!==r){var O=r.matrix;M.transform(O[0],O[1],O[2],O[3],O[4],O[5])}M.translate(e.x,e.y),M.rotate(e.rotation),M.translate(-e.displayOriginX,-e.displayOriginY),M.scale(e.scaleX,e.scaleY),e.cropWidth>0&&e.cropHeight>0&&(M.save(),M.beginPath(),M.rect(0,0,e.cropWidth,e.cropHeight),M.clip());for(var B=0;B0&&e.cropHeight>0&&M.restore(),M.restore()}}}},function(t,e,i){var n=i(2),s=i(21);t.exports=function(t,e,i,r,o){var a=e.text,h=a.length;if(!(n.RENDER_MASK!==e.renderFlags||0===h||e.cameraFilter>0&&e.cameraFilter&r._id)){var l=this.pipeline;t.setPipeline(l,e);var u=e.cropWidth>0||e.cropHeight>0;u&&(l.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var c=l._tempMatrix1,d=l._tempMatrix2,f=l._tempMatrix3,p=l._tempMatrix4;d.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),c.copyFrom(r.matrix),o?(c.multiplyWithOffset(o,-r.scrollX*e.scrollFactorX,-r.scrollY*e.scrollFactorY),d.e=e.x,d.f=e.y,c.multiply(d,f)):(d.e-=r.scrollX*e.scrollFactorX,d.f-=r.scrollY*e.scrollFactorY,c.multiply(d,f));var g=e.frame,v=g.glTexture,y=g.cutX,m=g.cutY,x=v.width,w=v.height,b=e._isTinted&&e.tintFill,T=s.getTintAppendFloatAlpha(e._tintTL,r.alpha*e._alphaTL),S=s.getTintAppendFloatAlpha(e._tintTR,r.alpha*e._alphaTR),A=s.getTintAppendFloatAlpha(e._tintBL,r.alpha*e._alphaBL),C=s.getTintAppendFloatAlpha(e._tintBR,r.alpha*e._alphaBR);l.setTexture2D(v,0);var _,M,E=0,P=0,k=0,F=0,L=e.letterSpacing,R=0,O=0,B=0,D=0,I=e.scrollX,z=e.scrollY,Y=e.fontData,X=Y.chars,N=Y.lineHeight,V=e.fontSize/Y.size,U=0,G=e._align,W=0,H=0;e.getTextBounds(!1);var j=e._bounds.lines;1===G?H=(j.longest-j.lengths[0])/2:2===G&&(H=j.longest-j.lengths[0]);for(var q=r.roundPixels,K=e.displayCallback,J=e.callbackData,Z=0;Z0&&e.cameraFilter&s._id)){var o=e.list,a=e.localTransform;void 0===r?a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY):(a.loadIdentity(),a.multiply(r),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY));for(var h=e._alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c0&&e.cameraFilter&s._id)){var o=e.list,a=e.localTransform;void 0===r?a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY):(a.loadIdentity(),a.multiply(r),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY));for(var h=e._alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c0&&e.cameraFilter&s.id||0===o.length)){var a=t.gameContext,h=s.alpha*e.alpha;if(0!==h){t.currentAlpha!==h&&(t.currentAlpha=h,a.globalAlpha=h),t.setBlendMode(e.blendMode);var l=e.x-s.scrollX*e.scrollFactorX,u=e.y-s.scrollY*e.scrollFactorY;if(a.save(),void 0!==r){var c=r.matrix;a.transform(c[0],c[1],c[2],c[3],c[4],c[5])}for(var d=0;d0&&e.cameraFilter&r._id)){var a=this.pipeline;t.setPipeline(a,e);var h=r.scrollX*e.scrollFactorX,l=r.scrollY*e.scrollFactorY,u=a._tempMatrix1;u.copyFrom(r.matrix),o&&(u.multiplyWithOffset(o,-h,-l),h=0,l=0);for(var c=e.getRenderList(),d=e.x-h,f=e.y-l,p=-1,g=r.alpha*e.alpha,v=r.roundPixels,y=0;y0&&e.cameraFilter&s.id)){var h=e.frame,l=e.fontData.chars,u=e.fontData.lineHeight,c=e._letterSpacing,d=0,f=0,p=0,g=null,v=0,y=0,m=0,x=0,w=0,b=0,T=null,S=0,A=t.currentContext,C=e.frame.source.image,_=h.cutX,M=h.cutY,E=e._fontSize/e.fontData.size,P=e._align,k=0,F=0;e.getTextBounds(!1);var L=e._bounds.lines;1===P?F=(L.longest-L.lengths[0])/2:2===P&&(F=L.longest-L.lengths[0]);var R=s.alpha*e.alpha;if(0!==R){t.currentAlpha!==R&&(t.currentAlpha=R,A.globalAlpha=R),t.currentBlendMode!==e.blendMode&&(t.currentBlendMode=e.blendMode,A.globalCompositeOperation=t.blendModes[e.blendMode]),t.currentScaleMode!==e.scaleMode&&(t.currentScaleMode=e.scaleMode);var O=e.x-s.scrollX*e.scrollFactorX+e.frame.x,B=e.y-s.scrollY*e.scrollFactorY+e.frame.y,D=s.roundPixels;if(D&&(O|=0,B|=0),A.save(),void 0!==r){var I=r.matrix;A.transform(I[0],I[1],I[2],I[3],I[4],I[5])}A.translate(O,B),A.rotate(e.rotation),A.translate(-e.displayOriginX,-e.displayOriginY),A.scale(e.scaleX,e.scaleY);for(var z=0;z0&&e.cameraFilter&r._id)){var l=this.pipeline;t.setPipeline(l,e);var u=l._tempMatrix1,c=l._tempMatrix2,d=l._tempMatrix3;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(r.matrix),o?(u.multiplyWithOffset(o,-r.scrollX*e.scrollFactorX,-r.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=r.scrollX*e.scrollFactorX,c.f-=r.scrollY*e.scrollFactorY,u.multiply(c,d));var f=e.frame,p=f.glTexture,g=f.cutX,v=f.cutY,y=p.width,m=p.height,x=e._isTinted&&e.tintFill,w=s.getTintAppendFloatAlpha(e._tintTL,r.alpha*e._alphaTL),b=s.getTintAppendFloatAlpha(e._tintTR,r.alpha*e._alphaTR),T=s.getTintAppendFloatAlpha(e._tintBL,r.alpha*e._alphaBL),S=s.getTintAppendFloatAlpha(e._tintBR,r.alpha*e._alphaBR);l.setTexture2D(p,0);var A,C,_=0,M=0,E=0,P=0,k=e._letterSpacing,F=0,L=0,R=0,O=0,B=e.fontData,D=B.chars,I=B.lineHeight,z=e._fontSize/B.size,Y=e._align,X=0,N=0;e.getTextBounds(!1);var V=e._bounds.lines;1===Y?N=(V.longest-V.lengths[0])/2:2===Y&&(N=V.longest-V.lengths[0]);for(var U=r.roundPixels,G=0;Gv&&(r=v),o>y&&(o=y);var k=v+g.xAdvance,F=y+u;aC&&(C=M),MC&&(C=M),M>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={Interpolation:i(266),Pool:i(24),Smoothing:i(132),TouchAction:i(929),UserSelect:i(928)}},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(598),GetBottom:i(51),GetCenterX:i(92),GetCenterY:i(89),GetLeft:i(49),GetOffsetX:i(932),GetOffsetY:i(931),GetRight:i(47),GetTop:i(45),SetBottom:i(50),SetCenterX:i(91),SetCenterY:i(90),SetLeft:i(48),SetRight:i(46),SetTop:i(44)}},function(t,e,i){var n=i(47),s=i(45),r=i(50),o=i(46);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(49),s=i(45),r=i(50),o=i(48);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(92),s=i(45),r=i(50),o=i(91);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(47),s=i(45),r=i(48),o=i(44);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(89),s=i(47),r=i(90),o=i(48);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(51),s=i(47),r=i(50),o=i(48);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(49),s=i(45),r=i(46),o=i(44);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(89),s=i(49),r=i(90),o=i(46);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(51),s=i(49),r=i(50),o=i(46);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(51),s=i(47),r=i(46),o=i(44);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(51),s=i(49),r=i(48),o=i(44);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(51),s=i(92),r=i(91),o=i(44);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(945),BottomLeft:i(944),BottomRight:i(943),LeftBottom:i(942),LeftCenter:i(941),LeftTop:i(940),RightBottom:i(939),RightCenter:i(938),RightTop:i(937),TopCenter:i(936),TopLeft:i(935),TopRight:i(934)}},function(t,e,i){t.exports={BottomCenter:i(602),BottomLeft:i(601),BottomRight:i(600),Center:i(599),LeftCenter:i(597),QuickSet:i(603),RightCenter:i(596),TopCenter:i(595),TopLeft:i(594),TopRight:i(593)}},function(t,e,i){var n=i(304),s=i(16),r={In:i(947),To:i(946)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={Align:i(948),Bounds:i(933),Canvas:i(930),Color:i(512),Masks:i(508)}},function(t,e,i){var n=i(0),s=i(6),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(521),r=i(519),o=i(11),a=i(518),h=i(950),l=i(517),u=i(13),c=i(515),d=i(6),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;i0?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=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;n1&&!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;e0;){this.cameras.pop().destroy()}return this.main},update:function(t,e){for(var i=0,n=this.cameras.length;i0?(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(962),SmoothedKeyControl:i(961)}},function(t,e,i){t.exports={Controls:i(963),Scene2D:i(570),Sprite3D:i(960)}},function(t,e,i){var n=i(40);t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=0;s1)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;h0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a0&&(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;i0&&u.trigger(n,"collisionStart",{pairs:T.collisionStart}),o.preSolvePosition(T.list),f=0;f0&&u.trigger(n,"collisionActive",{pairs:T.collisionActive}),T.collisionEnd.length>0&&u.trigger(n,"collisionEnd",{pairs:T.collisionEnd}),h.update(n.metrics,n),t(x),u.trigger(n,"afterUpdate",m),n},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;sf.friction*f.frictionStatic*O*i&&(D=F,B=o.clamp(f.friction*L*i,-D,D));var I=r.cross(A,y),z=r.cross(C,y),Y=w/(g.inverseMass+v.inverseMass+g.inverseInertia*I*I+v.inverseInertia*z*z);if(R*=Y,B*=Y,P<0&&P*P>n._restingThresh*i)T.normalImpulse=0;else{var X=T.normalImpulse;T.normalImpulse=Math.min(T.normalImpulse+R,0),R=T.normalImpulse-X}if(k*k>n._restingThreshTangent*i)T.tangentImpulse=0;else{var N=T.tangentImpulse;T.tangentImpulse=o.clamp(T.tangentImpulse+B,-D,D),B=T.tangentImpulse-N}s.x=y.x*R+m.x*B,s.y=y.y*R+m.y*B,g.isStatic||g.isSleeping||(g.positionPrev.x+=s.x*g.inverseMass,g.positionPrev.y+=s.y*g.inverseMass,g.anglePrev+=r.cross(A,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(C,s)*v.inverseInertia)}}}}},function(t,e,i){var n={};t.exports=n;var s=i(615),r=i(42);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;a1e3&&h.push(r);for(r=0;rv.bounds.max.x||w.bounds.max.yv.bounds.max.y)){var b=e(i,w);if(!w.region||b.id!==w.region.id||r){x.broadphaseTests+=1,w.region&&!r||(w.region=b);var T=t(b,w.region);for(d=T.startCol;d<=T.endCol;d++)for(f=T.startRow;f<=T.endRow;f++){p=y[g=a(d,f)];var S=d>=b.startCol&&d<=b.endCol&&f>=b.startRow&&f<=b.endRow,A=d>=w.region.startCol&&d<=w.region.endCol&&f>=w.region.startRow&&f<=w.region.endRow;!S&&A&&A&&p&&u(i,p,w),(w.region===b||S&&!A||r)&&(p||(p=h(y,g)),l(i,p,w))}w.region=b,m=!0}}}m&&(i.pairsList=c(i))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]};var t=function(t,e){var n=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 i(n,s,r,o)},e=function(t,e){var n=e.bounds,s=Math.floor(n.min.x/t.bucketWidth),r=Math.floor(n.max.x/t.bucketWidth),o=Math.floor(n.min.y/t.bucketHeight),a=Math.floor(n.max.y/t.bucketHeight);return i(s,r,o,a)},i=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},a=function(t,e){return"C"+t+"R"+e},h=function(t,e){return t[e]=[]},l=function(t,e,i){for(var n=0;n0?n.push(i):delete t.pairs[e[s]];return n}}()},function(t,e,i){var n={};t.exports=n;var s=i(680),r=i(42);n.name="matter-js",n.version="0.13.1",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(307),s=i(0),r=i(616),o=i(2),a=i(1),h=i(296),l=i(35),u=i(6),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(616),r=i(2),o=i(1),a=i(68),h=i(296),l=i(6),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(226),r=i(305),o=i(42),a=i(73),h=i(171);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;pg&&(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;u0)for(l=0;l0&&(d=f[l-1+(h-1)*e],s.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),n&&ld||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=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;a0?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;su)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var F=0;FA&&(A+=e.length),S=Number.MAX_VALUE,A3&&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},makeCCW:function(t){for(var e=0,i=t,n=1;ni[e][0])&&(e=n);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)}};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))r.ACTIVE&&c(this,t,e))},setCollidesNever:function(t){for(var e=0;e1)for(var h=i/a,l=n/a,u=0;u0?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&&u1&&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),A=Math.min(Math.ceil((t.pos.x+r)/f),p);c=Math.floor((t.pos.y+b)/f);var C=Math.floor((i+b)/f);if((l>0||c===C||C<0||C>=g)&&(C=-1),c>=0&&c1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,u,C));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,A=b*T;return S*S+A*A>=s*s+r*r?v||p*(m-r)-g*(y-s)<.5:(t.pos.x=i+s-S,t.pos.y=n+r-A,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(338),r=i(1072),o=i(337),a=i(1071),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){var n=i(681),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;oe.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?n=e.min.y-t.max.y:t.max.y0)for(var a=s+1;a1;if(!c||t!=c.x||e!=c.y){c&&n?(d=c.x,f=c.y):(d=0,f=0);var s={x:d+t,y:f+e};!n&&c||(c=s),p.push(s),v=d+t,y=f+e}},x=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":v=t.x,y=t.y;break;case"H":v=t.x;break;case"V":y=t.y}m(v,y,t.pathSegType)}};for(t(e),r=e.getTotalLength(),h=[],n=0;n1?1:0;n0))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(338),s=i(1055),r=i(1054);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.xi.last.y&&e.last.y0&&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&&o0?e-o:e+o<0?e+o:0}return n(e,-r,r)}},function(t,e,i){t.exports={Body:i(1029),COLLIDES:i(338),CollisionMap:i(1028),Factory:i(1027),Image:i(1025),ImpactBody:i(1026),ImpactPhysics:i(1057),Sprite:i(1024),TYPE:i(337),World:i(1023)}},function(t,e,i){t.exports={Arcade:i(708),Impact:i(1073),Matter:i(1053)}},function(t,e,i){(function(e){i(614);var n=i(22),s=i(16),r={Actions:i(604),Animation:i(572),Cache:i(571),Cameras:i(964),Class:i(0),Create:i(958),Curves:i(952),Data:i(514),Display:i(949),DOM:i(920),Events:i(506),Game:i(504),GameObjects:i(919),Geom:i(404),Input:i(389),Loader:i(761),Math:i(747),Physics:i(1074),Plugins:i(335),Renderer:i(678),Scene:i(198),Scenes:i(333),Sound:i(331),Structs:i(330),Textures:i(329),Tilemaps:i(673),Time:i(313),Tweens:i(311),Utils:i(624)};r=s(!1,r,n),t.exports=r,e.Phaser=r}).call(this,i(220))}])});