phaser3-rex-plugins
Version:
1 lines • 170 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).rextextplayerplugin=e();}(undefined,(function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,w(n.key),n);}}function n(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a(t,e);}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function o(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return !1}}();return function(){var i,n=s(t);if(e){var r=s(this).constructor;i=Reflect.construct(n,arguments,r);}else i=n.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return o(t)}(this,i)}}function c(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=c(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(arguments.length<3?t:i):r.value}},h.apply(this,arguments)}function l(t,e,i,n){return l="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,i,n){var r,s=c(t,e);if(s){if((r=Object.getOwnPropertyDescriptor(s,e)).set)return r.set.call(n,i),!0;if(!r.writable)return !1}if(r=Object.getOwnPropertyDescriptor(n,e)){if(!r.writable)return !1;r.value=i,Object.defineProperty(n,e,r);}else !function(t,e,i){(e=w(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;}(n,e,i);return !0},l(t,e,i,n)}function f(t,e,i,n,r){if(!l(t,e,i,n||t)&&r)throw new TypeError("failed to set property");return i}function d(t,e){return v(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,s,a,o=[],u=!0,c=!1;try{if(s=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;u=!1;}else for(;!(u=(n=s.call(i)).done)&&(o.push(n.value),o.length!==e);u=!0);}catch(t){c=!0,r=t;}finally{try{if(!u&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw r}}return o}}(t,e)||m(t,e)||b()}function g(t){return v(t)||y(t)||m(t)||b()}function p(t){return function(t){if(Array.isArray(t))return k(t)}(t)||y(t)||m(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t){if(Array.isArray(t))return t}function y(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function m(t,e){if(t){if("string"==typeof t)return k(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return "Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?k(t,e):void 0}}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(t,"string");return "symbol"==typeof e?e:String(e)}var S={setEventEmitter:function(t,e){return void 0===e&&(e=Phaser.Events.EventEmitter),this._privateEE=!0===t||void 0===t,this._eventEmitter=this._privateEE?new e:t,this},destroyEventEmitter:function(){return this._eventEmitter&&this._privateEE&&this._eventEmitter.shutdown(),this},getEventEmitter:function(){return this._eventEmitter},on:function(){return this._eventEmitter&&this._eventEmitter.on.apply(this._eventEmitter,arguments),this},once:function(){return this._eventEmitter&&this._eventEmitter.once.apply(this._eventEmitter,arguments),this},off:function(){return this._eventEmitter&&this._eventEmitter.off.apply(this._eventEmitter,arguments),this},emit:function(t){return this._eventEmitter&&t&&this._eventEmitter.emit.apply(this._eventEmitter,arguments),this},addListener:function(){return this._eventEmitter&&this._eventEmitter.addListener.apply(this._eventEmitter,arguments),this},removeListener:function(){return this._eventEmitter&&this._eventEmitter.removeListener.apply(this._eventEmitter,arguments),this},removeAllListeners:function(){return this._eventEmitter&&this._eventEmitter.removeAllListeners.apply(this._eventEmitter,arguments),this},listenerCount:function(){return this._eventEmitter?this._eventEmitter.listenerCount.apply(this._eventEmitter,arguments):0},listeners:function(){return this._eventEmitter?this._eventEmitter.listeners.apply(this._eventEmitter,arguments):[]},eventNames:function(){return this._eventEmitter?this._eventEmitter.eventNames.apply(this._eventEmitter,arguments):[]}},E={hasProperty:function(t){var e=this.gameObject;return !!e.hasOwnProperty(t)||void 0!==e[t]},getProperty:function(t){return this.gameObject[t]},setProperty:function(t,e){return this.gameObject[t]=e,this},easeProperty:function(t,e,i,n,r,s,a,o){void 0===o&&(o=this.gameObject);var u=this.tweens,c=u[t];c&&c.remove();var h={targets:o,duration:i,ease:n,repeat:r,yoyo:s,onComplete:function(){u[t].remove(),u[t]=null,a&&a(o,t);},onCompleteScope:this};return h[t]=e,(c=this.scene.tweens.add(h)).timeScale=this.timeScale,u[t]=c,this},getTweenTask:function(t){return this.tweens[t]},freeTweens:function(){var t,e=this.tweens;for(var i in e)(t=e[i])&&t.remove(),e[i]=null;return this}},O={hasMethod:function(t){return "function"==typeof this.gameObject[t]},call:function(t){if(!this.hasMethod(t))return this;for(var e=this.gameObject,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return e[t].apply(e,n),this}},x=function(){function t(i,n,r){e(this,t),this.GOManager=i,this.tweens={},this.effects={},this.setGO(n,r);}return n(t,[{key:"scene",get:function(){return this.GOManager.scene}},{key:"timeScale",get:function(){return this.GOManager.timeScale}},{key:"destroy",value:function(){this.freeGO(),this.GOManager=void 0;}},{key:"freeGO",value:function(){return this.freeTweens(),this.gameObject.destroy(),this.gameObject=void 0,this}},{key:"setGO",value:function(t,e){return t.setName(e),this.gameObject=t,this.name=e,this.freeTweens(),this}},{key:"setTimeScale",value:function(t){var e=this.tweens;for(var i in e){var n=e[i];n&&(n.timeScale=t);}return this}}]),t}();Object.assign(x.prototype,E,O,{hasData:function(t){var e=this.gameObject;return !!e.data&&e.data.has(t)},getData:function(t){return this.gameObject.getData(t)},setData:function(t,e){return this.gameObject.setData(t,e),this}});var M=function(t,e){if(!t)return !1;if(t.hasOwnProperty(e))return !0;for(;t;){if(Object.getOwnPropertyDescriptor(t,e))return !0;t=t.__proto__;}return !1},P=function(t){return t.preFX?t.preFX:t.postFX?t.postFX:null},T=function(t,e){t._effectSwitchNames||(t._effectSwitchNames=[],t.clearAllEffects=function(){for(var e=t._effectSwitchNames,i=0,n=e.length;i<n;i++)t[e[i]]=null;return t},t.on("destroy",t.clearAllEffects,t)),t._effectSwitchNames.push(e);},C=function(t,e,i){if(M(t,e))return t;var n=P(t);if(!n)return t;var r,s="_".concat(e,"Effect");return Object.defineProperty(t,e,{get:function(){return r},set:function(a){r!==a&&(null===(r=a)||!1===r?t[s]&&(n.remove(t[s]),t[s]=void 0):(t[s]||(t[s]=n.addColorMatrix()),t[s][e](1===i?a:void 0)));}}),t[e]=null,T(t,e),t},_={barrel:function(t){if(M(t,"barrel"))return t;var e,i=P(t);return i?(Object.defineProperty(t,"barrel",{get:function(){return e},set:function(n){e!==n&&(null===(e=n)||!1===e?t._barrelEffect&&(i.remove(t._barrelEffect),t._barrelEffect=void 0):(t._barrelEffect||(t._barrelEffect=i.addBarrel()),t._barrelEffect.amount=e));}}),t.barrel=null,T(t,"barrel"),t):t},blackWhite:function(t){return C(t,"blackWhite"),t},bloom:function(t){if(M(t,"bloomColor"))return t;var e=P(t);if(!e)return t;var i,n=1,r=1,s=1,a=1,o=4;return Object.defineProperty(t,"bloomColor",{get:function(){return i},set:function(u){i!==u&&(null===(i=u)||!1===i?t._bloom&&(e.remove(t._bloom),t._bloom=void 0,e.setPadding(0)):(t._bloom||(t._bloom=e.addBloom(i,n,r,s,a,o),e.setPadding(Math.max(n,r)+1)),t._bloom.color=i));}}),Object.defineProperty(t,"bloomOffsetX",{get:function(){return n},set:function(i){if(n!==i&&(n=i,t._bloom)){var s=Math.max(n,r);e.setPadding(s+1),t._bloom.offsetX=n;}}}),Object.defineProperty(t,"bloomOffsetY",{get:function(){return r},set:function(i){if(r!==i&&(r=i,t._bloom)){var s=Math.max(n,r);e.setPadding(s+1),t._bloom.offsetY=r;}}}),Object.defineProperty(t,"bloomBlurStrength",{get:function(){return s},set:function(e){s!==e&&(s=e,t._bloom&&(t._bloom.blurStrength=s));}}),Object.defineProperty(t,"bloomStrength",{get:function(){return a},set:function(e){a!==e&&(a=e,t._bloom&&(t._bloom.strength=a));}}),Object.defineProperty(t,"bloomSteps",{get:function(){return o},set:function(e){o!==e&&(o=e,t._bloom&&(t._bloom.steps=o));}}),t.bloomColor=null,T(t,"bloomColor"),t},blur:function(t){if(M(t,"blurColor"))return t;var e=P(t);if(!e)return t;var i,n=0,r=1,s=1,a=1,o=4;return Object.defineProperty(t,"blurColor",{get:function(){return i},set:function(u){i!==u&&(null===(i=u)||!1===i?t._blur&&(e.remove(t._blur),t._blur=void 0,e.setPadding(0)):(t._blur||(t._blur=e.addBlur(n,r,s,a,i,o),e.setPadding(Math.max(r,s)+1)),t._blur.color=i));}}),Object.defineProperty(t,"blurQuality",{get:function(){return n},set:function(e){n!==e&&(n=e,t._blur&&(t._blur.quality=n));}}),Object.defineProperty(t,"blurX",{get:function(){return r},set:function(i){if(r!==i&&(r=i,t._blur)){var n=Math.max(r,s);e.setPadding(n+1),t._blur.x=r;}}}),Object.defineProperty(t,"blurY",{get:function(){return s},set:function(i){if(s!==i&&(s=i,t._blur)){var n=Math.max(r,s);e.setPadding(n+1),t._blur.y=s;}}}),Object.defineProperty(t,"blurStrength",{get:function(){return a},set:function(e){a!==e&&(a=e,t._blur&&(t._blur.strength=a));}}),Object.defineProperty(t,"blurSteps",{get:function(){return o},set:function(e){o!==e&&(o=e,t._blur&&(t._blur.steps=o));}}),t.blurColor=null,T(t,"blurColor"),t},bokeh:function(t){if(M(t,"bokehRadius"))return t;var e=P(t);if(!e)return t;var i,n=1,r=.2;return Object.defineProperty(t,"bokehRadius",{get:function(){return i},set:function(s){i!==s&&(null===(i=s)||!1===i?t._bokeh&&(e.remove(t._bokeh),t._bokeh=void 0):(t._bokeh||(t._bokeh=e.addBokeh(i,n,r)),t._bokeh.radius=i));}}),Object.defineProperty(t,"bokehAmount",{get:function(){return n},set:function(e){n!==e&&(n=e,t._bokeh&&(t._bokeh.amount=n));}}),Object.defineProperty(t,"bokehContrast",{get:function(){return r},set:function(e){r!==e&&(r=e,t._bokeh&&(t._bokeh.contrast=r));}}),t.bokehRadius=null,T(t,"bokehRadius"),t},brightness:function(t){return C(t,"brightness",1),t},brown:function(t){return C(t,"brown"),t},circle:function(t){if(M(t,"circleColor"))return t;var e=P(t);if(!e)return t;var i,n=8,r=0,s=.4,a=1,o=.005;return Object.defineProperty(t,"circleColor",{get:function(){return i},set:function(u){i!==u&&(null===(i=u)||!1===i?t._circle&&(e.remove(t._circle),t._circle=void 0):(t._circle||(t._circle=e.addCircle(n,i,r,a,o),t.circleBackgroundAlpha=s),t._circle.color=i));}}),Object.defineProperty(t,"circleThickness",{get:function(){return n},set:function(e){n!==e&&(n=e,t._circle&&(t._circle.thickness=n));}}),Object.defineProperty(t,"circleBackgroundColor",{get:function(){return r},set:function(e){r!==e&&(r=e,t._circle&&(t._circle.backgroundColor=r));}}),Object.defineProperty(t,"circleBackgroundAlpha",{get:function(){return s},set:function(e){s!==e&&(s=e,t._circle&&(t._circle.glcolor2[3]=s));}}),Object.defineProperty(t,"circleScale",{get:function(){return a},set:function(e){a!==e&&(a=e,t._circle&&(t._circle.scale=a));}}),Object.defineProperty(t,"circleFeather",{get:function(){return o},set:function(e){o!==e&&(o=e,t._circle&&(t._circle.feather=o));}}),t.circleColor=null,T(t,"circleColor"),t},contrast:function(t){return C(t,"contrast",1),t},desaturate:function(t){return C(t,"desaturate",1),t},desaturateLuminance:function(t){return C(t,"desaturateLuminance"),t},displacement:function(t){if(M(t,"displacementKey"))return t;var e=P(t);if(!e)return t;var i,n=.005,r=.005;return Object.defineProperty(t,"displacementKey",{get:function(){return i},set:function(s){i!==s&&(null===(i=s)||!1===i?t._displacement&&(e.remove(t._displacement),t._displacement=void 0):(t._displacement||(t._displacement=e.addDisplacement(i,n,r)),t._displacement.setTexture(i)));}}),Object.defineProperty(t,"displacementX",{get:function(){return n},set:function(e){n!==e&&(n=e,t._displacement&&(t._displacement.x=n));}}),Object.defineProperty(t,"displacementY",{get:function(){return r},set:function(e){r!==e&&(r=e,t._displacement&&(t._displacement.y=r));}}),t.displacementKey=null,T(t,"displacementKey"),t},glow:function(t){if(M(t,"glowColor"))return t;var e=P(t);if(!e)return t;var i,n=4,r=0;return Object.defineProperty(t,"glowColor",{get:function(){return i},set:function(s){i!==s&&(null===(i=s)||!1===i?t._glow&&(e.remove(t._glow),t._glow=void 0,e.setPadding(0)):(t._glow||(t._glow=e.addGlow(i,n,r),e.setPadding(n+1)),t._glow.color=i));}}),Object.defineProperty(t,"glowOuterStrength",{get:function(){return n},set:function(i){n!==i&&(n=i,t._glow&&(e.setPadding(n+1),t._glow.outerStrength=n));}}),Object.defineProperty(t,"glowInnerStrength",{get:function(){return r},set:function(e){r!==e&&(r=e,t._glow&&(t._glow.innerStrength=r));}}),t.glowColor=null,T(t,"glowColor"),t},gradient:function(t){if(M(t,"gradientColor"))return t;var e=P(t);if(!e)return t;var i,n,r=.5,s=0,a=0,o=0,u=1,c=0;return Object.defineProperty(t,"gradientColor",{get:function(){return [i,n]},set:function(h){var l,f;null===h||!1===h?(l=null,f=null):(l=h[0],f=h[1]),i===l&&n===f||(n=f,null===(i=l)||!1===i?t._gradient&&(e.remove(t._gradient),t._gradient=void 0):(t._gradient||(t._gradient=e.addGradient(i,n,r,s,a,o,u,c)),t._gradient.color1=i,t._gradient.color2=n));}}),Object.defineProperty(t,"gradientColor1",{get:function(){return i},set:function(e){null!==e&&!1!==e?i!==e&&(i=e,t._gradient&&(t._gradient.color1=i)):t.gradientColor=e;}}),Object.defineProperty(t,"gradientColor2",{get:function(){return n},set:function(e){null!==e&&!1!==e?n!==e&&(n=e,t._gradient&&(t._gradient.color2=n)):t.gradientColor=e;}}),Object.defineProperty(t,"gradientAlpha",{get:function(){return r},set:function(e){r!==e&&(r=e,t._gradient&&(t._gradient.alpha=r));}}),Object.defineProperty(t,"gradientFromX",{get:function(){return s},set:function(e){s!==e&&(s=e,t._gradient&&(t._gradient.fromX=s));}}),Object.defineProperty(t,"gradientFromY",{get:function(){return a},set:function(e){a!==e&&(a=e,t._gradient&&(t._gradient.fromY=a));}}),Object.defineProperty(t,"gradientToX",{get:function(){return o},set:function(e){o!==e&&(o=e,t._gradient&&(t._gradient.toX=o));}}),Object.defineProperty(t,"gradientToY",{get:function(){return u},set:function(e){u!==e&&(u=e,t._gradient&&(t._gradient.toY=u));}}),Object.defineProperty(t,"gradientSize",{get:function(){return c},set:function(e){c!==e&&(c=e,t._gradient&&(t._gradient.size=c));}}),t.gradientColor=null,T(t,"gradientColor"),t},grayscale:function(t){return C(t,"grayscale",1),t},hue:function(t){return C(t,"hue",1),t},kodachrome:function(t){return C(t,"kodachrome"),t},lsd:function(t){return C(t,"lsd"),t},negative:function(t){return C(t,"negative"),t},pixelate:function(t){if(M(t,"pixelate"))return t;var e,i=P(t);return i?(Object.defineProperty(t,"pixelate",{get:function(){return e},set:function(n){e!==n&&(null===(e=n)||!1===e?t._pixelateEffect&&(i.remove(t._pixelateEffect),t._pixelateEffect=void 0):(t._pixelateEffect||(t._pixelateEffect=i.addPixelate()),t._pixelateEffect.amount=e));}}),t.pixelate=null,T(t,"pixelate"),t):t},polaroid:function(t){return C(t,"polaroid"),t},reveal:function(t){if(M(t,"revealLeft"))return t;var e=P(t);if(!e)return t;var i,n,r,s,a=.1,o=function(){i=null,n=null,r=null,s=null;},u=function(t){t._revealEffect&&(e.remove(t._revealEffect),t._revealEffect=void 0);};return Object.defineProperty(t,"revealLeft",{get:function(){return i},set:function(n){i!==n&&(o(),null===(i=n)||!1===i?u(t):(t._revealEffect||(t._revealEffect=e.addReveal(a,0,0)),t._revealEffect.direction=1,t._revealEffect.axis=0,t._revealEffect.progress=i));}}),Object.defineProperty(t,"revealRight",{get:function(){return n},set:function(i){n!==i&&(o(),null===(n=i)||!1===n?u(t):(t._revealEffect||(t._revealEffect=e.addReveal(a,0,0)),t._revealEffect.direction=0,t._revealEffect.axis=0,t._revealEffect.progress=n));}}),Object.defineProperty(t,"revealUp",{get:function(){return r},set:function(i){r!==i&&(o(),null===(r=i)||!1===r?u(t):(t._revealEffect||(t._revealEffect=e.addReveal(a,0,0)),t._revealEffect.direction=1,t._revealEffect.axis=1,t._revealEffect.progress=r));}}),Object.defineProperty(t,"revealDown",{get:function(){return s},set:function(i){s!==i&&(o(),null===(s=i)||!1===s?u(t):(t._revealEffect||(t._revealEffect=e.addReveal(a,0,0)),t._revealEffect.direction=0,t._revealEffect.axis=1,t._revealEffect.progress=s));}}),Object.defineProperty(t,"revealWidth",{get:function(){return a},set:function(e){a!==e&&(a=e,t._revealEffect&&(t._revealEffect.wipeWidth=a));}}),t.revealLeft=null,T(t,"revealLeft"),T(t,"revealRight"),T(t,"revealUp"),T(t,"revealDown"),t},saturate:function(t){return C(t,"saturate",1),t},sepia:function(t){return C(t,"sepia"),t},shadow:function(t){if(M(t,"shadowColor"))return t;var e=P(t);if(!e)return t;var i,n=0,r=0,s=.1,a=1,o=6,u=1;return Object.defineProperty(t,"shadowColor",{get:function(){return i},set:function(c){i!==c&&(null===(i=c)||!1===i?t._shadow&&(e.remove(t._shadow),t._shadow=void 0):(t._shadow||(t._shadow=e.addShadow(n,r,s,a,i,o,u)),t._shadow.color=i));}}),Object.defineProperty(t,"shadowX",{get:function(){return n},set:function(e){n!==e&&(n=e,t._shadow&&(t._shadow.x=n));}}),Object.defineProperty(t,"shadowY",{get:function(){return r},set:function(e){r!==e&&(r=e,t._shadow&&(t._shadow.y=r));}}),Object.defineProperty(t,"decay",{get:function(){return s},set:function(e){s!==e&&(s=e,t._shadow&&(t._shadow.decay=s));}}),Object.defineProperty(t,"shadowPower",{get:function(){return a},set:function(e){a!==e&&(a=e,t._shadow&&(t._shadow.power=a));}}),Object.defineProperty(t,"shadowSamples",{get:function(){return o},set:function(e){o!==e&&(o=e,t._shadow&&(t._shadow.samples=o));}}),Object.defineProperty(t,"shadowIntensity",{get:function(){return u},set:function(e){u!==e&&(u=e,t._shadow&&(t._shadow.intensity=u));}}),t.shadowColor=null,T(t,"shadowColor"),t},shiftToBGR:function(t){return C(t,"shiftToBGR"),t},shine:function(t){if(M(t,"shineSpeed"))return t;var e=P(t);if(!e)return t;var i,n=.5,r=3;return Object.defineProperty(t,"shineSpeed",{get:function(){return i},set:function(s){i!==s&&(null===(i=s)||!1===i?t._shine&&(e.remove(t._shine),t._shine=void 0):(t._shine||(t._shine=e.addShine(i,n,r)),t._shine.speed=i));}}),Object.defineProperty(t,"shineLineWidth",{get:function(){return n},set:function(e){n!==e&&(n=e,t._shine&&(t._shine.lineWidth=n));}}),Object.defineProperty(t,"shineGradient",{get:function(){return r},set:function(e){r!==e&&(r=e,t._shine&&(t._shine.gradient=r));}}),t.shineSpeed=null,T(t,"shineSpeed"),t},technicolor:function(t){return C(t,"technicolor"),t},tiltShift:function(t){if(M(t,"tiltShiftRadius"))return t;var e=P(t);if(!e)return t;var i,n=1,r=.2,s=1,a=1,o=1;return Object.defineProperty(t,"tiltShiftRadius",{get:function(){return i},set:function(u){i!==u&&(null===(i=u)||!1===i?t._tiltShift&&(e.remove(t._tiltShift),t._tiltShift=void 0):(t._tiltShift||(t._tiltShift=e.addTiltShift(i,n,r,s,a,o)),t._tiltShift.radius=i));}}),Object.defineProperty(t,"tiltShiftAmount",{get:function(){return n},set:function(e){n!==e&&(n=e,t._tiltShift&&(t._tiltShift.amount=n));}}),Object.defineProperty(t,"tiltShiftContrast",{get:function(){return r},set:function(e){r!==e&&(r=e,t._tiltShift&&(t._tiltShift.contrast=r));}}),Object.defineProperty(t,"tiltShiftBlurX",{get:function(){return s},set:function(e){s!==e&&(s=e,t._tiltShift&&(t._tiltShift.blurX=s));}}),Object.defineProperty(t,"tiltShiftBlurY",{get:function(){return a},set:function(e){a!==e&&(a=e,t._tiltShift&&(t._tiltShift.blurY=a));}}),Object.defineProperty(t,"tiltShiftStrength",{get:function(){return o},set:function(e){o!==e&&(o=e,t._tiltShift&&(t._tiltShift.strength=o));}}),t.tiltShiftRadius=null,T(t,"tiltShiftRadius"),t},vignette:function(t){if(M(t,"vignetteColor"))return t;var e=P(t);if(!e)return t;var i,n=.5,r=.5,s=.5;return Object.defineProperty(t,"vignetteRadius",{get:function(){return i},set:function(a){i!==a&&(null===(i=a)||!1===i?t._vignette&&(e.remove(t._vignette),t._vignette=void 0):(t._vignette||(t._vignette=e.addVignette(n,r,i,s)),t._vignette.radius=i));}}),Object.defineProperty(t,"vignetteX",{get:function(){return n},set:function(e){n!==e&&(n=e,t._vignette&&(t._vignette.x=n));}}),Object.defineProperty(t,"vignetteY",{get:function(){return r},set:function(e){r!==e&&(r=e,t._vignette&&(t._vignette.y=r));}}),Object.defineProperty(t,"vignetteStrength",{get:function(){return s},set:function(e){s!==e&&(s=e,t._vignette&&(t._vignette.strength=s));}}),t.vignetteRadius=null,T(t,"vignetteRadius"),t},vintagePinhole:function(t){return C(t,"vintagePinhole"),t},wipe:function(t){if(M(t,"wipeLeft"))return t;var e=P(t);if(!e)return t;var i,n,r,s,a=.1,o=function(){i=null,n=null,r=null,s=null;},u=function(t){t._wipeEffect&&(e.remove(t._wipeEffect),t._wipeEffect=void 0);};return Object.defineProperty(t,"wipeLeft",{get:function(){return i},set:function(n){i!==n&&(o(),null===(i=n)||!1===i?u(t):(t._wipeEffect||(t._wipeEffect=e.addWipe(a,0,0)),t._wipeEffect.direction=1,t._wipeEffect.axis=0,t._wipeEffect.progress=i));}}),Object.defineProperty(t,"wipeRight",{get:function(){return n},set:function(i){n!==i&&(o(),null===(n=i)||!1===n?u(t):(t._wipeEffect||(t._wipeEffect=e.addWipe(a,0,0)),t._wipeEffect.direction=0,t._wipeEffect.axis=0,t._wipeEffect.progress=n));}}),Object.defineProperty(t,"wipeUp",{get:function(){return r},set:function(i){r!==i&&(o(),null===(r=i)||!1===r?u(t):(t._wipeEffect||(t._wipeEffect=e.addWipe(a,0,0)),t._wipeEffect.direction=1,t._wipeEffect.axis=1,t._wipeEffect.progress=r));}}),Object.defineProperty(t,"wipeDown",{get:function(){return s},set:function(i){s!==i&&(o(),null===(s=i)||!1===s?u(t):(t._wipeEffect||(t._wipeEffect=e.addWipe(a,0,0)),t._wipeEffect.direction=0,t._wipeEffect.axis=1,t._wipeEffect.progress=s));}}),Object.defineProperty(t,"wipeWidth",{get:function(){return a},set:function(e){a!==e&&(a=e,t._wipeEffect&&(t._wipeEffect.wipeWidth=a));}}),t.wipeLeft=null,T(t,"wipeLeft"),T(t,"wipeRight"),T(t,"wipeUp"),T(t,"wipeDown"),t}},j=function(t,e){if(void 0===e)e=!0;else if("string"==typeof e)e={config:!0};else if(Array.isArray(e))for(var i=e,n=(e={},0),r=i.length;n<r;n++)e[i[n]]=!0;if(!0===e)for(var s in _)_[s](t);else for(var s in e)e[s]&&_[s]&&_[s](t);return t},R={tint:0,alpha:1,revealUp:2,revealDown:3,revealLeft:4,revealRight:5},B={setGOFadeMode:function(t){return "string"==typeof t&&(t=R[t]),this.fadeMode=t,this},setGOFadeTime:function(t){return this.fadeTime=t,this},useTintFadeEffect:function(t){return (void 0===this.fadeMode||0===this.fadeMode)&&this.fadeTime>0&&void 0!==t.setTint},useAlphaFadeEffect:function(t){return (void 0===this.fadeMode||1===this.fadeMode)&&this.fadeTime>0&&void 0!==t.setAlpha},useRevealEffect:function(t){return this.fadeMode>=2&&this.fadeMode<=5&&this.fadeTime>0&&(t.preFX||t.postFX)},fadeBob:function(t,e,i,n){var r=t.gameObject;if(this.useTintFadeEffect(r))void 0!==e&&t.setProperty("tintGray",255*e),t.easeProperty("tintGray",Math.floor(255*i),this.fadeTime,"Linear",0,!1,n);else if(this.useAlphaFadeEffect(r))void 0!==e&&t.setProperty("alpha",e),t.easeProperty("alpha",i,this.fadeTime,"Linear",0,!1,n);else if(this.useRevealEffect(r)){var s;switch(j(r,"reveal"),this.fadeMode){case 2:s="revealUp";break;case 3:s="revealDown";break;case 4:s="revealLeft";break;case 5:s="revealRight";}void 0===e&&(e=0),r[s]=e,t.easeProperty(s,i,this.fadeTime,"Linear",0,!1,n),t.getTweenTask(s).once("complete",(function(){r[s]=null;}));}else n&&n(r);return this}},G=function(t){return t>>16&255},A=function(t){return t>>8&255},D=function(t){return 255&t},W=Phaser.Events.EventEmitter,L=function(t,e,i,n,r,s){return void 0===s?s={}:!0===s&&(s=F),"number"!=typeof i&&(i=0,n=0),s.x=r.x+r.width*t+i,s.y=r.y+r.height*e+n,s},F={},X=function(t,e,i,n,r,s,a){if(t.hasOwnProperty("vp"))return t;"function"==typeof i&&(a=i,i=void 0),"function"==typeof r&&(a=r,r=void 0),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===r&&(r=0),void 0===s&&(s=0),void 0===a&&(a=L),function(t){if(t.events)return t;var e=new W,i=t.x;Object.defineProperty(t,"x",{get:function(){return i},set:function(n){i!==n&&(i=n,e.emit("update",t));}});var n=t.y;Object.defineProperty(t,"y",{get:function(){return n},set:function(i){n!==i&&(n=i,e.emit("update",t));}});var r=t.width;Object.defineProperty(t,"width",{get:function(){return r},set:function(i){r!==i&&(r=i,e.emit("update",t));}});var s=t.height;Object.defineProperty(t,"height",{get:function(){return s},set:function(i){s!==i&&(s=i,e.emit("update",t));}}),t.events=e;}(e);var o=e.events;t.vp=e;var u=function(){a(i,n,r,s,e,t);};o.on("update",u),t.once("destroy",(function(){o.off("update",u),t.vp=void 0;})),Object.defineProperty(t,"vpx",{get:function(){return i},set:function(t){i!==t&&(i=t,u());}}),Object.defineProperty(t,"vpy",{get:function(){return n},set:function(t){n!==t&&(n=t,u());}}),Object.defineProperty(t,"vpxOffset",{get:function(){return r},set:function(t){r!==t&&(r=t,u());}}),Object.defineProperty(t,"vpyOffset",{get:function(){return s},set:function(t){s!==t&&(s=t,u());}}),u();},Y=Phaser.Utils.Array.Remove,I={has:function(t){return this.bobs.hasOwnProperty(t)},exists:function(t){return this.bobs.hasOwnProperty(t)},get:function(t){return this.bobs[t]},getGO:function(t){var e=this.get(t);return e?e.gameObject:null},addGO:function(t,e){this.remove(t,!0),this.useTintFadeEffect(e)&&function(t,e){if(t.hasOwnProperty("tintR"))return t;void 0===e&&(e=16777215);var i=G(e),n=A(e),r=D(e);Object.defineProperty(t,"tint",{get:function(){return e},set:function(s){s=16777215&Math.floor(s),t.setTint&&t.setTint(s),e!==s&&(i=G(e=s),n=A(e),r=D(e));}}),Object.defineProperty(t,"tintR",{get:function(){return i},set:function(n){n=255&Math.floor(n),i!==n&&(i=n,t.tint=(255&n)<<16|65535&e);}}),Object.defineProperty(t,"tintG",{get:function(){return n},set:function(i){i=255&Math.floor(i),n!==i&&(n=i,t.tint=(255&i)<<8|16711935&e);}}),Object.defineProperty(t,"tintB",{get:function(){return r},set:function(i){i=255&Math.floor(i),r!==i&&(r=i,t.tint=255&i|16776960&e);}}),Object.defineProperty(t,"tintGray",{get:function(){return Math.floor((i+n+r)/3)},set:function(e){e=255&Math.floor(e),i===e&&n===e&&r===e||(i=e,n=e,r=e,t.tint=(255&e)<<16|(255&e)<<8|255&e);}}),t.tint=e;}(e),this.viewportCoordinateEnable&&X(e,this.viewport),this.effectPropertiesConfig&&j(e,this.effectPropertiesConfig),e.once("destroy",(function(){Y(this.removedGOs,e),this.isEmpty&&this.emit("empty");}),this);var i=new this.BobClass(this,e,t);return this.bobs[t]=i,this},add:function(t){for(var e=this.createGameObjectCallback,i=this.createGameObjectScope,n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];var a=e.call.apply(e,[i,this.scene].concat(r));this.addGO(t,a);var o=this.get(t);return this.fadeBob(o,0,1),this},forEachGO:function(t,e){for(var i in this.bobs){var n=this.bobs[i].gameObject;if(e?t.call(e,n,i,this):t(n,i,this))break}return this}},V={remove:function(t,e){if(!this.has(t))return this;var i=this.get(t);return delete this.bobs[t],this.removedGOs.push(i.gameObject),e?i.destroy():this.fadeBob(i,void 0,0,(function(){i.destroy();})),this},removeAll:function(){var t=this.bobs;for(var e in t)this.remove(e);return this},clear:function(t){void 0===t&&(t=!0);var e=this.bobs;for(var i in e)t&&e[i].destroy(),delete e[i];return this.removedGOs.length=0,this}},z={hasProperty:function(t,e){return !!this.has(t)&&this.get(t).hasProperty(e)},getProperty:function(t,e){if(this.has(t))return this.get(t).getProperty(e)},isNumberProperty:function(t,e){return "number"==typeof this.getProperty(t,e)},setProperty:function(t,e,i){return this.has(t)?(this.symbols&&"string"==typeof i&&this.isNumberProperty(t,e)&&(i in this.symbols?i=this.symbols[i]:console.warn("Can't find symbol ".concat(i))),this.get(t).setProperty(e,i),this):this},easeProperty:function(t,e,i,n,r,s,a,o){return this.has(t)?(void 0===n&&(n=1e3),void 0===r&&(r="Linear"),void 0===s&&(s=0),void 0===a&&(a=!1),this.symbols&&"string"==typeof i&&this.isNumberProperty(t,e)&&(i in this.symbols?i=this.symbols[i]:console.warn("Can't find symbol ".concat(i))),this.get(t).easeProperty(e,i,n,r,s,a,o),this):this},hasTweenTask:function(t,e){return !!this.has(t)&&this.get(t).tweens.hasOwnProperty(e)},getTweenTask:function(t,e){if(!this.has(t))return null;var i=this.get(t).tweens[e];return i||null}},U={hasMethod:function(t,e){return !!this.has(t)&&this.get(t).hasMethod(e)},call:function(t,e){var i;if(!this.has(t))return this;for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];return (i=this.get(t)).call.apply(i,[e].concat(r)),this}},N={hasData:function(t,e){return !!this.has(t)&&this.get(t).hasData(e)},getData:function(t,e){if(this.has(t))return this.get(t).getData(e)},setData:function(t,e,i){return this.has(t)?(this.get(t).setData(e,i),this):this}},H=function(t){return void 0!==t.displayWidth?t.displayWidth:t.width},J=function(t){return void 0!==t.displayHeight?t.displayHeight:t.height};Phaser.Geom.Rectangle;var K=Phaser.Math.Vector2,q=Phaser.Math.RotateAround,$=void 0,Q=function(t,e,i){(void 0===i&&(i=!1),0!==t.rotation&&q(e,t.x,t.y,t.rotation),i&&t.parentContainer)&&t.parentContainer.getBoundsTransformMatrix().transformPoint(e.x,e.y,e);return e},Z=Phaser.Utils.Objects.GetValue,tt=function(t,e,i,n,r,s,a){if(t.getBounds||void 0!==t.width&&void 0!==t.height){void 0===i&&(i=16777215),void 0===n&&(n=1),void 0===r&&(r=null),void 0===s&&(s=1),void 0===a&&(a=0);var o=function(t,e,i){return void 0===e?e=new K:!0===e&&(void 0===$&&($=new K),e=$),t.getTopLeft?t.getTopLeft(e):(e.x=t.x-H(t)*t.originX,e.y=t.y-J(t)*t.originY,Q(t,e,i))}(t,et[0]);o.x-=a,o.y-=a;var u=function(t,e,i){return void 0===e?e=new K:!0===e&&(void 0===$&&($=new K),e=$),t.getTopRight?t.getTopRight(e):(e.x=t.x-H(t)*t.originX+H(t),e.y=t.y-J(t)*t.originY,Q(t,e,i))}(t,et[1]);u.x+=a,u.y-=a;var c=function(t,e,i){return void 0===e?e=new K:!0===e&&(void 0===$&&($=new K),e=$),t.getBottomRight?t.getBottomRight(e):(e.x=t.x-H(t)*t.originX+H(t),e.y=t.y-J(t)*t.originY+J(t),Q(t,e,i))}(t,et[2]);c.x+=a,c.y+=a;var h=function(t,e,i){return void 0===e?e=new K:!0===e&&(void 0===$&&($=new K),e=$),t.getBottomLeft?t.getBottomLeft(e):(e.x=t.x-H(t)*t.originX,e.y=t.y-J(t)*t.originY+J(t),Q(t,e,i))}(t,et[3]);h.x-=a,h.y+=a,null!==r&&e.fillStyle(r,s).fillPoints(et,!0,!0),null!==i&&e.lineStyle(n,i).strokePoints(et,!0,!0);}},et=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],it={drawGameObjectsBounds:function(t,e){return this.forEachGO((function(i){i.drawBounds?i.drawBounds(t,e):function(t,e,i){var n,r,s,a,o;if("number"==typeof i?n=i:(n=Z(i,"color"),r=Z(i,"lineWidth"),s=Z(i,"fillColor"),a=Z(i,"fillAlpha",1),o=Z(i,"padding",0)),Array.isArray(t))for(var u=0,c=t.length;u<c;u++)tt(t[u],e,n,r,s,a,o);else tt(t,e,n,r,s,a,o);}(i,t,e);})),this}};Object.assign(it,B,I,V,z,U,N);var nt=Phaser.Cameras.Scene2D.BaseCamera,rt=Phaser.Geom.Rectangle,st=function(t,e,i){return e instanceof nt||(i=e,e=void 0),void 0===i?i=new rt:!0===i&&(i=at),e?t.scale.getViewPort(e,i):t.scale.getViewPort(i)},at=new rt,ot=Phaser.Utils.Objects.GetValue,ut=function(){function t(i,n){e(this,t),this.scene=i,this.BobClass=ot(n,"BobClass",x),this.setCreateGameObjectCallback(ot(n,"createGameObject"),ot(n,"createGameObjectScope")),this.setEventEmitter(ot(n,"eventEmitter",void 0));var r=ot(n,"fade",500);"number"==typeof r?(this.setGOFadeMode(),this.setGOFadeTime(r)):(this.setGOFadeMode(ot(r,"mode")),this.setGOFadeTime(ot(r,"time",500)));var s=ot(n,"viewportCoordinate",!1);!1!==s?(this.setViewportCoordinateEnable(ot(n,"enable",!0)),this.setViewport(ot(s,"viewport"))):this.setViewportCoordinateEnable(!1);var a=ot(n,"effectProperties",!1);this.setEffectPropertiesConfig(a),this.setSymbols(ot(n,"symbols")),this.bobs={},this.removedGOs=[],this._timeScale=1;}return n(t,[{key:"destroy",value:function(t){this.clear(!t),this.createGameObjectCallback=void 0,this.viewport=void 0,this.scene=void 0;}},{key:"timeScale",get:function(){return this._timeScale},set:function(t){if(this._timeScale!==t){this._timeScale=t;var e=this.bobs;for(var i in e)e[i].setTimeScale(t);}}},{key:"setTimeScale",value:function(t){return this.timeScale=t,this}},{key:"setCreateGameObjectCallback",value:function(t,e){return this.createGameObjectCallback=t,this.createGameObjectScope=e,this}},{key:"setViewportCoordinateEnable",value:function(t){return void 0===t&&(t=!0),this.viewportCoordinateEnable=t,this}},{key:"setEffectPropertiesConfig",value:function(t){return void 0===t&&(t=!0),this.effectPropertiesConfig=t,this}},{key:"setViewport",value:function(t){return void 0===t&&(t=st(this.scene,this.scene.cameras.main)),this.viewport=t,this}},{key:"setSymbols",value:function(t){return this.symbols=t,this}},{key:"isEmpty",get:function(){return function(t){for(var e in t)return !1;return !0}(this.bobs)&&0===this.removedGOs.length}}]),t}();Object.assign(ut.prototype,S,it);var ct=Phaser.Utils.Objects.GetValue,ht=function(t){r(a,t);var i=u(a);function a(t,n){var r;e(this,a),void 0===n?n={}:Array.isArray(n)&&(n={layers:n}),n.hasOwnProperty("fade")||(n.fade=0),n.viewportCoordinate=!1,r=i.call(this,t,n);var s=ct(n,"layers");if(s)for(var o=0,u=s.length;o<u;o++)r.add(s[o]);return r}return n(a,[{key:"setCreateGameObjectCallback",value:function(t,e){return t||(t=lt),h(s(a.prototype),"setCreateGameObjectCallback",this).call(this,t,e),this}},{key:"addGO",value:function(t,e){return h(s(a.prototype),"addGO",this).call(this,t,e),e.name=t,this}},{key:"getLayer",value:function(t){return this.getGO(t)}},{key:"getLayers",value:function(t){return void 0===t&&(t=[]),this.forEachGO((function(e){t.push(e);})),function(t,e){if(t.length<=1)return t;var i;void 0===e&&(e=!1);var n=t[0];(i=n.displayList?n.displayList:n.parentContainer?n.parentContainer.list:n.scene.sys.displayList).depthSort&&(i.depthSort(),i=i.list),e?t.sort((function(t,e){return i.indexOf(e)-i.indexOf(t)})):t.sort((function(t,e){return i.indexOf(t)-i.indexOf(e)}));}(t,!1),t}},{key:"addToLayer",value:function(t,e){var i=this.getGO(t);if(i)return e.isRexContainerLite?e.addToLayer(i):i.add(e),this;console.warn("Can't get layer \"".concat(t,'"'));}},{key:"removeFromLayer",value:function(t,e,i){var n=this.getGO(t);if(n)return void 0===i&&(i=!0),e.isRexContainerLite?e.removeFromLayer(n,i):(n.remove(e),i&&e.addToDisplayList()),this;console.warn("Can't get layer \"".concat(t,'"'));}},{key:"clearLayer",value:function(t,e){void 0===e&&(e=!0);var i=this.getGO(t);if(i){if(e)for(var n=i.getAll(),r=0,s=n.length;r<s;r++)n.destroy();else i.removeAll();return this}console.warn("Can't get layer \"".concat(t,'"'));}}]),a}(ut),lt=function(t,e){var i=t.add.layer();return void 0!==e&&i.setDepth(e),i},ft=Phaser.Scene,dt=function(t){return t instanceof ft},gt=function(e){return null==e||"object"!==t(e)?null:dt(e)?e:e.scene&&dt(e.scene)?e.scene:e.parent&&e.parent.scene&&dt(e.parent.scene)?e.parent.scene:null},pt=Phaser.Game,vt=function(t){return t instanceof pt},yt=Phaser.Utils.Objects.GetValue,mt=function(){function i(t,n){e(this,i),this.setParent(t),this.isShutdown=!1,this.setEventEmitter(yt(n,"eventEmitter",!0)),this.parent&&(this.parent===this.scene?this.scene.sys.events.once("shutdown",this.onEnvDestroy,this):this.parent===this.game?this.game.events.once("shutdown",this.onEnvDestroy,this):this.parent.once&&this.parent.once("destroy",this.onParentDestroy,this));}return n(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.parent&&(this.parent===this.scene?this.scene.sys.events.off("shutdown",this.onEnvDestroy,this):this.parent===this.game?this.game.events.off("shutdown",this.onEnvDestroy,this):this.parent.once&&this.parent.off("destroy",this.onParentDestroy,this)),this.destroyEventEmitter(),this.parent=void 0,this.scene=void 0,this.game=void 0,this.isShutdown=!0);}},{key:"destroy",value:function(t){this.shutdown(t);}},{key:"onEnvDestroy",value:function(){this.destroy(!0);}},{key:"onParentDestroy",value:function(t,e){this.destroy(e);}},{key:"setParent",value:function(e){var i;return this.parent=e,this.scene=gt(e),this.game=null==(i=e)||"object"!==t(i)?null:vt(i)?i:vt(i.game)?i.game:dt(i)?i.sys.game:dt(i.scene)?i.scene.sys.game:void 0,this}}]),i}();Object.assign(mt.prototype,S);var kt=Phaser.Utils.Objects.GetValue,bt=function(t){r(a,t);var i=u(a);function a(t,n){var r;return e(this,a),(r=i.call(this,t,n))._isRunning=!1,r.isPaused=!1,r.tickingState=!1,r.setTickingMode(kt(n,"tickingMode",1)),r}return n(a,[{key:"boot",value:function(){2!==this.tickingMode||this.tickingState||this.startTicking();}},{key:"shutdown",value:function(t){this.isShutdown||(this.stop(),this.tickingState&&this.stopTicking(),h(s(a.prototype),"shutdown",this).call(this,t));}},{key:"setTickingMode",value:function(t){"string"==typeof t&&(t=wt[t]),this.tickingMode=t;}},{key:"startTicking",value:function(){this.tickingState=!0;}},{key:"stopTicking",value:function(){this.tickingState=!1;}},{key:"isRunning",get:function(){return this._isRunning},set:function(t){this._isRunning!==t&&(this._isRunning=t,1===this.tickingMode&&t!=this.tickingState&&(t?this.startTicking():this.stopTicking()));}},{key:"start",value:function(){return this.isPaused=!1,this.isRunning=!0,this}},{key:"pause",value:function(){return this.isRunning&&(this.isPaused=!0,this.isRunning=!1),this}},{key:"resume",value:function(){return this.isPaused&&(this.isRunning=!0),this}},{key:"stop",value:function(){return this.isPaused=!1,this.isRunning=!1,this}},{key:"complete",value:function(){this.isPaused=!1,this.isRunning=!1,this.emit("complete",this.parent,this);}}]),a}(mt),wt={no:0,lazy:1,always:2},St=Phaser.Utils.Objects.GetValue,Et=function(t){r(a,t);var i=u(a);function a(t,n){var r;e(this,a);var s=(r=i.call(this,t,n)).scene?"update":"step";return r.tickEventName=St(n,"tickEventName",s),r.isSceneTicker=!Ot(r.tickEventName),r}return n(a,[{key:"startTicking",value:function(){h(s(a.prototype),"startTicking",this).call(this),this.isSceneTicker?this.scene.sys.events.on(this.tickEventName,this.update,this):this.game.events.on(this.tickEventName,this.update,this);}},{key:"stopTicking",value:function(){h(s(a.prototype),"stopTicking",this).call(this),this.isSceneTicker&&this.scene?this.scene.sys.events.off(this.tickEventName,this.update,this):this.game&&this.game.events.off(this.tickEventName,this.update,this);}}]),a}(bt),Ot=function(t){return "step"===t||"poststep"===t},xt=Phaser.Utils.Objects.GetValue,Mt=Phaser.Math.Clamp,Pt=function(){function t(i){e(this,t),this.resetFromJSON(i);}return n(t,[{key:"resetFromJSON",value:function(t){this.state=xt(t,"state",Tt),this.timeScale=xt(t,"timeScale",1),this.delay=xt(t,"delay",0),this.repeat=xt(t,"repeat",0),this.repeatCounter=xt(t,"repeatCounter",0),this.repeatDelay=xt(t,"repeatDelay",0),this.duration=xt(t,"duration",0),this.nowTime=xt(t,"nowTime",0),this.justRestart=xt(t,"justRestart",!1);}},{key:"toJSON",value:function(){return {state:this.state,timeScale:this.timeScale,delay:this.delay,repeat:this.repeat,repeatCounter:this.repeatCounter,repeatDelay:this.repeatDelay,duration:this.duration,nowTime:this.nowTime,justRestart:this.justRestart}}},{key:"destroy",value:function(){}},{key:"setTimeScale",value:function(t){return this.timeScale=t,this}},{key:"setDelay",value:function(t){return void 0===t&&(t=0),this.delay=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setRepeat",value:function(t){return this.repeat=t,this}},{key:"setRepeatInfinity",value:function(){return this.repeat=-1,this}},{key:"setRepeatDelay",value:function(t){return this.repeatDelay=t,this}},{key:"start",value:function(){return this.nowTime=this.delay>0?-this.delay:0,this.state=this.nowTime>=0?_t:Ct,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=Tt,this}},{key:"update",value:function(t,e){this.state!==Tt&&this.state!==Rt&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.justRestart=!1,this.nowTime>=this.duration?-1===this.repeat||this.repeatCounter<this.repeat?(this.repeatCounter++,this.justRestart=!0,this.nowTime-=this.duration,this.repeatDelay>0&&(this.nowTime-=this.repeatDelay,this.state=jt)):(this.nowTime=this.duration,this.state=Rt):this.nowTime>=0&&(this.state=_t));}},{key:"t",get:function(){var t;switch(this.state){case Tt:case Ct:case jt:t=0;break;case _t:t=this.nowTime/this.duration;break;case Rt:t=1;}return Mt(t,0,1)},set:function(t){(t=Mt(t,-1,1))<0?(this.state=Ct,this.nowTime=-this.delay*t):(this.state=_t,this.nowTime=this.duration*t,1===t&&0!==this.repeat&&this.repeatCounter++);}},{key:"setT",value:function(t){return this.t=t,this}},{key:"isIdle",get:function(){return this.state===Tt}},{key:"isDelay",get:function(){return this.state===Ct}},{key:"isCountDown",get:function(){return this.state===_t}},{key:"isRunning",get:function(){return this.state===Ct||this.state===_t}},{key:"isDone",get:function(){return this.state===Rt}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),Tt=0,Ct=1,_t=2,jt=3,Rt=-1,Bt=function(t){r(a,t);var i=u(a);function a(t,n){var r;return e(this,a),(r=i.call(this,t,n)).timer=new Pt,r}return n(a,[{key:"shutdown",value:function(t){this.isShutdown||(h(s(a.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"start",value:function(){return this.timer.start(),h(s(a.prototype),"start",this).call(this),this}},{key:"stop",value:function(){return this.timer.stop(),h(s(a.prototype),"stop",this).call(this),this}},{key:"complete",value:function(){return this.timer.stop(),h(s(a.prototype),"complete",this).call(this),this}}]),a}(Et),Gt=Phaser.Utils.Objects.GetValue,At=Phaser.Utils.Objects.GetAdvancedValue,Dt=Phaser.Tweens.Builders.GetEaseFunction,Wt=function(t){r(a,t);var i=u(a);function a(){return e(this,a),i.apply(this,arguments)}return n(a,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(Gt(t,"timer")),this.setEnable(Gt(t,"enable",!0)),this.setTarget(Gt(t,"target",this.parent)),this.setDelay(At(t,"delay",0)),this.setDuration(At(t,"duration",1e3)),this.setEase(Gt(t,"ease","Linear")),this.setRepeat(Gt(t,"repeat",0)),this}},{key:"setEnable",value:function(t){return null==t&&(t=!0),this.enable=t,this}},{key:"setTarget",value:function(t){return void 0===t&&(t=this.parent),this.target=t,this}},{key:"setDelay",value:function(t){return this.delay=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setRepeat",value:function(t){return this.repeat=t,this}},{key:"setRepeatDelay",value:function(t){return this.repeatDelay=t,this}},{key:"setEase",value:function(t){return void 0===t&&(t="Linear"),this.ease=t,this.easeFn=Dt(t),this}},{key:"start",value:function(){return this.timer.isRunning||h(s(a.prototype),"start",this).call(this),this}},{key:"restart",value:function(){return this.timer.stop(),this.start.apply(this,arguments),this}},{key:"stop",value:function(t){return void 0===t&&(t=!1),h(s(a.prototype),"stop",this).call(this),t&&(this.timer.setT(1),this.updateGameObject(this.target,this.timer),this.complete()),this}},{key:"update",value:function(t,e){if(!this.isRunning||!this.enable||!this.parent.active)return this;var i=this.target,n=this.timer;return n.update(t,e),n.isDelay||this.updateGameObject(i,n),this.emit("update",i,this),n.isDone&&this.complete(),this}},{key:"updateGameObject",value:function(t,e){}}]),a}(Bt),Lt=Phaser.Sound.BaseSound,Ft=function(t){return t instanceof Lt},Xt=Phaser.Utils.Objects.GetValue,Yt=Phaser.Utils.Objects.GetAdvancedValue,It=Phaser.Math.Linear,Vt=function(t){r(a,t);var i=u(a);function a(t,n,r){var s;return e(this,a),Ft(t)&&(r=n,n=t,t=void 0),n.active=!0,n.scene=t,n.game=n.manager.game,(s=i.call(this,n,r)).volume={},s.resetFromJSON(r),s}return n(a,[{key:"resetFromJSON",value:function(t){return h(s(a.prototype),"resetFromJSON",this).call(this,t),this.setMode(Xt(t,"mode",0)),this.setEnable(Xt(t,"enable",!0)),this.setVolumeRange(Yt(t,"volume.start",this.parent.volume),Yt(t,"volume.end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=zt[t]),this.mode=t,this}},{key:"setVolumeRange",value:function(t,e){return this.volume.start=t,this.volume.end=e,this}},{key:"start",value:function(){return this.timer.isRunning||(this.parent.setVolume(this.volume.start),this.timer.setDelay(this.delay).setDuration(this.duration),h(s(a.prototype),"start",this).call(this)),this}},{key:"updateGameObject",value:function(t,e){t.volume=It(this.volume.start,this.volume.end,e.t);}},{key:"complete",value:function(){switch(h(s(a.prototype),"complete",this).call(this),this.mode){case 1:this.parent.stop();break;case 2:this.parent.destroy();}return this}}]),a}(Wt),zt={stop:1,destroy:2},Ut=function(t,e,i,n,r){Ft(t)&&(r=n,n=i,i=e,e=t,t=void 0),void 0===n&&(n=1),void 0===r&&(r=0);var s,a={mode:0,volume:{start:r,end:n},duration:i};return "string"==typeof e&&(e=t.sys.sound.add(e)),e.hasOwnProperty("_fade")?(s=e._fade).stop().resetFromJSON(a):(s=new Vt(t,e,a),e._fade=s),s.start(),e.isPlaying||e.setVolume(r).play(),e},Nt=function(t,e,i,n){Ft(t)&&(n=i,i=e,e=t,t=void 0),void 0===n&&(n=!0);var r,s={mode:n?2:1,volume:{start:e.volume,end:0},duration:i};return e.hasOwnProperty("_fade")?(r=e._fade).stop().resetFromJSON(s):(r=new Vt(t,e,s),e._fade=r),r.start(),e.isPlaying||e.play(),e},Ht=Phaser.Utils.Objects.GetValue,Jt={setBackgroundMusicLoop:function(t){return void 0===t&&(t=!0),this.backgroundMusicLoop=t,this},setBackgroundMusicFadeTime:function(t){return this.backgroundMusicFadeTime=t,this},getBackgroundMusic:function(){return this.backgroundMusic},setCurrentBackgroundMusic:function(t){return this.backgroundMusic=t,t&&(t.once("complete",(function(){this.backgroundMusic===t&&(this.backgroundMusic.destroy(),this.backgroundMusic=void 0);}),this).once("destroy",(function(){this.backgroundMusic===t&&(this.backgroundMusic=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic:function(t,e){if(this.backgroundMusic&&this.backgroundMusic.key===t)return this;this.stopBackgroundMusic();var i=this.sound.add(t,{loop:Ht(e,"loop",this.backgroundMusicLoop),mute:Ht(e,"mute",this.backgroundMusicMute),volume:Ht(e,"volume",this.backgroundMusicVolume),detune:Ht(e,"detune",0),rate:Ht(e,"rate",1)});return this.setCurrentBackgroundMusic(i),this.backgroundMusicFadeTime>0&&this.fadeInBackgroundMusic(this.backgroundMusicFadeTime),this},pauseBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.pause(),this},resumeBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.resume(),this},stopBackgroundMusic:function(){return this.backgroundMusic&&(this.backgroundMusicFadeTime>0?this.fadeOutBackgroundMusic(this.backgroundMusicFadeTime,!0):(this.backgroundMusic.stop(),this.backgroundMusic.destroy(),this.backgroundMusic=void 0)),this},fadeInBackgroundMusic:function(t){return this.backgroundMusic&&Ut(this.backgroundMusic,t,this.backgroundMusicVolume,0),this},fadeOutBackgroundMusic:function(t,e){return this.backgroundMusic&&Nt(this.backgroundMusic,t,e),this},crossFadeBackgroundMusic:function(t,e){var i=this.backgroundMusicFadeTime;return this.backgroundMusicFadeTime=0,this.fadeOutBackgroundMusic(e,!0).playBackgroundMusic(t).fadeInBackgroundMusic(e),this.backgroundMusicFadeTime=i,this},setBackgroundMusicMute:function(t){return void 0===t&&(t=!0),this.backgroundMusicMute=t,this},setBackgroundMusicVolume:function(t){return this.backgroundMusicVolume=t,this},setBackgroundMusicRate:function(t){return this.backgroundMusic&&this.backgroundMusic.setRate(t),this},setBackgroundMusicDetune:function(t){return this.backgroundMusic&&this.backgroundMusic.setDetune(t),this}},Kt=Phaser.Utils.Objects.GetValue,qt={setBackgroundMusic2Loop:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Loop=t,this},setBackgroundMusic2FadeTime:function(t){return this.backgroundMusic2FadeTime=t,this},getBackgroundMusic2:function(){return this.backgroundMusic2},setCurrentBackgroundMusic2:function(t){return this.backgroundMusic2=t,t&&(t.once("complete",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2