text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rexbuttonplugin=e():t.rexbuttonplugin=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=300)}({2:function(t,e,n){"use strict";var i=Phaser.Scene;e.a=function(t){return t instanceof i}},3:function(t,e,n){"use strict";e.a={setEventEmitter:function(t,e){return void 0===e&&(e=Phaser.Events.EventEmitter),this._privateEE=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):[]}}},300:function(t,e,n){"use strict";n.r(e);var i=n(56).a;function r(t){return(r="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)}function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),s(this,u(e).call(this,t))}var n,r,a;return function(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}}),e&&c(t,e)}(e,Phaser.Plugins.BasePlugin),n=e,(r=[{key:"start",value:function(){this.game.events.on("destroy",this.destroy,this)}},{key:"add",value:function(t,e){return new i(t,e)}}])&&o(n.prototype,r),a&&o(n,a),e}();e.default=a},56:function(t,e,n){"use strict";var i=n(3),r=n(6);function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var s=Phaser.Utils.Objects.GetValue,u=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gameObject=e,this.scene=Object(r.a)(e),this.setEventEmitter(s(n,"eventEmitter",void 0)),e.setInteractive(s(n,"inputConfig",void 0)),this.resetFromJSON(n),this.boot()}var e,n,i;return e=t,(n=[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.lastClickTime=void 0,this.setEnable(s(t,"enable",!0)),this.setMode(s(t,"mode",1)),this.setClickInterval(s(t,"clickInterval",100)),this.setDragThreshold(s(t,"threshold",void 0)),this}},{key:"boot",value:function(){this.gameObject.on("pointerdown",this.onPress,this),this.gameObject.on("pointerup",this.onRelease,this),this.gameObject.on("pointerout",this.onPointOut,this),this.gameObject.on("pointermove",this.onMove,this),this.gameObject.on("destroy",this.destroy,this)}},{key:"shutdown",value:function(){this.destroyEventEmitter(),this.pointer=void 0,this.gameObject=void 0,this.scene=void 0}},{key:"destroy",value:function(){this.shutdown()}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable===t?this:(t||this.cancel(),this.enable=t,this.gameObject.input.enabled=t,this)}},{key:"setMode",value:function(t){return"string"==typeof t&&(t=c[t]),this.mode=t,this}},{key:"setClickInterval",value:function(t){return this.clickInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"onPress",value:function(t,e,n,i){void 0===this.pointer&&(this.pointer=t,0===this.mode&&this.click(t.downTime,t,i))}},{key:"onRelease",value:function(t,e,n,i){this.pointer===t&&(1===this.mode&&this.click(t.upTime,t,i),this.pointer=void 0)}},{key:"onPointOut",value:function(t,e){this.pointer===t&&this.cancel()}},{key:"onMove",value:function(t,e,n,i){this.pointer===t&&void 0!==this.dragThreshold&&t.getDistance()>=this.dragThreshold&&this.cancel()}},{key:"click",value:function(t,e,n){if(void 0===t)return this.emit("click",this,this.gameObject,e,n),this;this.pointer=void 0;var i=this.lastClickTime;return void 0!==i&&t-i<=this.clickInterval?this:(this.lastClickTime=t,this.emit("click",this,this.gameObject,e,n),this)}},{key:"cancel",value:function(){return this.pointer=void 0,this}}])&&o(e.prototype,n),i&&o(e,i),t}();Object.assign(u.prototype,i.a);var c={press:0,pointerdown:0,release:1,pointerup:1};e.a=u},6:function(t,e,n){"use strict";var i=n(2);e.a=function(t){return Object(i.a)(t)?t:t.scene&&Object(i.a)(t.scene)?t.scene:t.parent&&t.parent.scene&&Object(i.a)(t.parent.scene)?t.parent.scene:void 0}}}).default});