phaser-ui-comps
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("phaser")):"function"==typeof define&&define.amd?define(["phaser"],e):"object"==typeof exports?exports.PhaserComps=e(require("phaser")):t.PhaserComps=e(t.Phaser)}(window,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},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=9)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(1),u=(r=o)&&r.__esModule?r:{default:r};var a="event_state",s=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r._parent=t,r._key=n,r._clip=null,r._texts={},n&&t&&t.on(a,r._onEventState,r),r._clipUpdate(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,u.default.Events.EventEmitter),i(e,null,[{key:"EVENT_STATE",get:function(){return a}}]),i(e,[{key:"appendClip",value:function(t){this._clip!==t&&(null!==this._clip&&this.removeClip(),this._clip=t,this._clip&&this.onClipAppend(this._clip),this._clipProcess())}},{key:"onClipAppend",value:function(t){}},{key:"removeClip",value:function(){this.onClipRemove(this._clip),this._clip=null}},{key:"onClipRemove",value:function(t){}},{key:"doState",value:function(){var t=this.getStateId();this._setupState(t)}},{key:"getText",value:function(t){return this._texts[t]}},{key:"setText",value:function(t,e){if(this._texts[t]!==e&&(this._texts[t]=e,this._clip)){var n=this._clip.getChildText(t);n&&(n.text=e)}}},{key:"getStateId",value:function(){return"default"}},{key:"destroy",value:function(){this._parent&&this._parent.removeListener(a,this._onEventState),this._clip&&this._clip.destroy()}},{key:"_clipUpdate",value:function(){if(this._key)if(this._parent._clip){var t=this._parent._clip.getChildClip(this._key);this.appendClip(t)}else this.appendClip(null);else;}},{key:"_clipProcess",value:function(){this._clip&&(this.doState(),this.onClipProcess())}},{key:"onClipProcess",value:function(){}},{key:"_setupState",value:function(t){if(this._clip)for(var e in this._clip.setState(t),this._texts){var n=this._clip.getChildText(e);n&&(n.text=this._texts[e])}this.emit(a)}},{key:"_onEventState",value:function(){this._clipUpdate()}}]),e}();e.default=s},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),u=(r=o)&&r.__esModule?r:{default:r};var a=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._enable=!0,i._isPressed=!1,i._isOver=!1,r&&(i.label=r),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,u.default),i(e,null,[{key:"EVENT_CLICK",get:function(){return"event_click"}}]),i(e,[{key:"onClipAppend",value:function(t){this._updateInteractive()}},{key:"onClipRemove",value:function(t){var e=t.getChildClip("HIT_ZONE");e&&this._removeInteractive(e)}},{key:"_setupInteractive",value:function(t){t.setInteractive({useHandCursor:!0}),t.on("pointerdown",this._onPointerDown,this),t.on("pointerup",this._onPointerUp,this),t.on("pointerover",this._onPointerOver,this),t.on("pointerout",this._onPointerOut,this)}},{key:"_removeInteractive",value:function(t){t.disableInteractive(),t.removeListener("pointerdown",this._onPointerDown,this),t.removeListener("pointerup",this._onPointerUp,this),t.removeListener("pointerover",this._onPointerOver,this),t.removeListener("pointerout",this._onPointerOut,this)}},{key:"_updateInteractive",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&(this.enable?this._setupInteractive(t):this._removeInteractive(t))}}},{key:"getStateId",value:function(){return this.enable?this._isPressed?this.STATE_DOWN:this._isOver?this.STATE_OVER:this.STATE_UP:this.STATE_DISABLE}},{key:"_onClick",value:function(){this.emit("event_click")}},{key:"_onPointerOut",value:function(){this._isOver=!1,this._isPressed=!1,this.doState()}},{key:"_onPointerOver",value:function(){this._isOver=!0,this.doState()}},{key:"_onPointerDown",value:function(){this._isPressed=!0,this.doState()}},{key:"_onPointerUp",value:function(){var t=this._isPressed&&this._isOver;this._isPressed=!1,this.doState(),t&&this._onClick()}},{key:"destroy",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&this._removeInteractive(t)}(function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"label",get:function(){return this.getText("label")},set:function(t){this.setText("label",t)}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(this._enable=t,this._updateInteractive(),this.doState())}},{key:"STATE_UP",get:function(){return"up"}},{key:"STATE_DOWN",get:function(){return"down"}},{key:"STATE_OVER",get:function(){return"over"}},{key:"STATE_DISABLE",get:function(){return"disable"}}]),e}();e.default=a},function(t,e,n){(function(t,n){var r;!function(){var i="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this||{},o=i._,u=Array.prototype,a=Object.prototype,s="undefined"!=typeof Symbol?Symbol.prototype:null,l=u.push,c=u.slice,f=a.toString,p=a.hasOwnProperty,h=Array.isArray,_=Object.keys,v=Object.create,y=function(){},d=function(t){return t instanceof d?t:this instanceof d?void(this._wrapped=t):new d(t)};e.nodeType?i._=d:(!n.nodeType&&n.exports&&(e=n.exports=d),e._=d),d.VERSION="1.9.1";var g,b=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},m=function(t,e,n){return d.iteratee!==g?d.iteratee(t,e):null==t?d.identity:d.isFunction(t)?b(t,e,n):d.isObject(t)&&!d.isArray(t)?d.matcher(t):d.property(t)};d.iteratee=g=function(t,e){return m(t,e,1/0)};var O=function(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var o=Array(e+1);for(i=0;i<e;i++)o[i]=arguments[i];return o[e]=r,t.apply(this,o)}},C=function(t){if(!d.isObject(t))return{};if(v)return v(t);y.prototype=t;var e=new y;return y.prototype=null,e},k=function(t){return function(e){return null==e?void 0:e[t]}},w=function(t,e){return null!=t&&p.call(t,e)},P=function(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0},j=Math.pow(2,53)-1,S=k("length"),x=function(t){var e=S(t);return"number"==typeof e&&e>=0&&e<=j};d.each=d.forEach=function(t,e,n){var r,i;if(e=b(e,n),x(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=d.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},d.map=d.collect=function(t,e,n){e=m(e,n);for(var r=!x(t)&&d.keys(t),i=(r||t).length,o=Array(i),u=0;u<i;u++){var a=r?r[u]:u;o[u]=e(t[a],a,t)}return o};var I=function(t){return function(e,n,r,i){var o=arguments.length>=3;return function(e,n,r,i){var o=!x(e)&&d.keys(e),u=(o||e).length,a=t>0?0:u-1;for(i||(r=e[o?o[a]:a],a+=t);a>=0&&a<u;a+=t){var s=o?o[a]:a;r=n(r,e[s],s,e)}return r}(e,b(n,i,4),r,o)}};d.reduce=d.foldl=d.inject=I(1),d.reduceRight=d.foldr=I(-1),d.find=d.detect=function(t,e,n){var r=(x(t)?d.findIndex:d.findKey)(t,e,n);if(void 0!==r&&-1!==r)return t[r]},d.filter=d.select=function(t,e,n){var r=[];return e=m(e,n),d.each(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r},d.reject=function(t,e,n){return d.filter(t,d.negate(m(e)),n)},d.every=d.all=function(t,e,n){e=m(e,n);for(var r=!x(t)&&d.keys(t),i=(r||t).length,o=0;o<i;o++){var u=r?r[o]:o;if(!e(t[u],u,t))return!1}return!0},d.some=d.any=function(t,e,n){e=m(e,n);for(var r=!x(t)&&d.keys(t),i=(r||t).length,o=0;o<i;o++){var u=r?r[o]:o;if(e(t[u],u,t))return!0}return!1},d.contains=d.includes=d.include=function(t,e,n,r){return x(t)||(t=d.values(t)),("number"!=typeof n||r)&&(n=0),d.indexOf(t,e,n)>=0},d.invoke=O(function(t,e,n){var r,i;return d.isFunction(e)?i=e:d.isArray(e)&&(r=e.slice(0,-1),e=e[e.length-1]),d.map(t,function(t){var o=i;if(!o){if(r&&r.length&&(t=P(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)})}),d.pluck=function(t,e){return d.map(t,d.property(e))},d.where=function(t,e){return d.filter(t,d.matcher(e))},d.findWhere=function(t,e){return d.find(t,d.matcher(e))},d.max=function(t,e,n){var r,i,o=-1/0,u=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,s=(t=x(t)?t:d.values(t)).length;a<s;a++)null!=(r=t[a])&&r>o&&(o=r);else e=m(e,n),d.each(t,function(t,n,r){((i=e(t,n,r))>u||i===-1/0&&o===-1/0)&&(o=t,u=i)});return o},d.min=function(t,e,n){var r,i,o=1/0,u=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,s=(t=x(t)?t:d.values(t)).length;a<s;a++)null!=(r=t[a])&&r<o&&(o=r);else e=m(e,n),d.each(t,function(t,n,r){((i=e(t,n,r))<u||i===1/0&&o===1/0)&&(o=t,u=i)});return o},d.shuffle=function(t){return d.sample(t,1/0)},d.sample=function(t,e,n){if(null==e||n)return x(t)||(t=d.values(t)),t[d.random(t.length-1)];var r=x(t)?d.clone(t):d.values(t),i=S(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,u=0;u<e;u++){var a=d.random(u,o),s=r[u];r[u]=r[a],r[a]=s}return r.slice(0,e)},d.sortBy=function(t,e,n){var r=0;return e=m(e,n),d.pluck(d.map(t,function(t,n,i){return{value:t,index:r++,criteria:e(t,n,i)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index}),"value")};var E=function(t,e){return function(n,r,i){var o=e?[[],[]]:{};return r=m(r,i),d.each(n,function(e,i){var u=r(e,i,n);t(o,e,u)}),o}};d.groupBy=E(function(t,e,n){w(t,n)?t[n].push(e):t[n]=[e]}),d.indexBy=E(function(t,e,n){t[n]=e}),d.countBy=E(function(t,e,n){w(t,n)?t[n]++:t[n]=1});var T=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;d.toArray=function(t){return t?d.isArray(t)?c.call(t):d.isString(t)?t.match(T):x(t)?d.map(t,d.identity):d.values(t):[]},d.size=function(t){return null==t?0:x(t)?t.length:d.keys(t).length},d.partition=E(function(t,e,n){t[n?0:1].push(e)},!0),d.first=d.head=d.take=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[0]:d.initial(t,t.length-e)},d.initial=function(t,e,n){return c.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},d.last=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[t.length-1]:d.rest(t,Math.max(0,t.length-e))},d.rest=d.tail=d.drop=function(t,e,n){return c.call(t,null==e||n?1:e)},d.compact=function(t){return d.filter(t,Boolean)};var A=function(t,e,n,r){for(var i=(r=r||[]).length,o=0,u=S(t);o<u;o++){var a=t[o];if(x(a)&&(d.isArray(a)||d.isArguments(a)))if(e)for(var s=0,l=a.length;s<l;)r[i++]=a[s++];else A(a,e,n,r),i=r.length;else n||(r[i++]=a)}return r};d.flatten=function(t,e){return A(t,e,!1)},d.without=O(function(t,e){return d.difference(t,e)}),d.uniq=d.unique=function(t,e,n,r){d.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=m(n,r));for(var i=[],o=[],u=0,a=S(t);u<a;u++){var s=t[u],l=n?n(s,u,t):s;e&&!n?(u&&o===l||i.push(s),o=l):n?d.contains(o,l)||(o.push(l),i.push(s)):d.contains(i,s)||i.push(s)}return i},d.union=O(function(t){return d.uniq(A(t,!0,!0))}),d.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=S(t);r<i;r++){var o=t[r];if(!d.contains(e,o)){var u;for(u=1;u<n&&d.contains(arguments[u],o);u++);u===n&&e.push(o)}}return e},d.difference=O(function(t,e){return e=A(e,!0,!0),d.filter(t,function(t){return!d.contains(e,t)})}),d.unzip=function(t){for(var e=t&&d.max(t,S).length||0,n=Array(e),r=0;r<e;r++)n[r]=d.pluck(t,r);return n},d.zip=O(d.unzip),d.object=function(t,e){for(var n={},r=0,i=S(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n};var M=function(t){return function(e,n,r){n=m(n,r);for(var i=S(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}};d.findIndex=M(1),d.findLastIndex=M(-1),d.sortedIndex=function(t,e,n,r){for(var i=(n=m(n,r,1))(e),o=0,u=S(t);o<u;){var a=Math.floor((o+u)/2);n(t[a])<i?o=a+1:u=a}return o};var B=function(t,e,n){return function(r,i,o){var u=0,a=S(r);if("number"==typeof o)t>0?u=o>=0?o:Math.max(o+a,u):a=o>=0?Math.min(o+1,a):o+a+1;else if(n&&o&&a)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(c.call(r,u,a),d.isNaN))>=0?o+u:-1;for(o=t>0?u:a-1;o>=0&&o<a;o+=t)if(r[o]===i)return o;return-1}};d.indexOf=B(1,d.findIndex,d.sortedIndex),d.lastIndexOf=B(-1,d.findLastIndex),d.range=function(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i},d.chunk=function(t,e){if(null==e||e<1)return[];for(var n=[],r=0,i=t.length;r<i;)n.push(c.call(t,r,r+=e));return n};var F=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=C(t.prototype),u=t.apply(o,i);return d.isObject(u)?u:o};d.bind=O(function(t,e,n){if(!d.isFunction(t))throw new TypeError("Bind must be called on a function");var r=O(function(i){return F(t,r,e,this,n.concat(i))});return r}),d.partial=O(function(t,e){var n=d.partial.placeholder,r=function(){for(var i=0,o=e.length,u=Array(o),a=0;a<o;a++)u[a]=e[a]===n?arguments[i++]:e[a];for(;i<arguments.length;)u.push(arguments[i++]);return F(t,r,this,this,u)};return r}),d.partial.placeholder=d,d.bindAll=O(function(t,e){var n=(e=A(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=d.bind(t[r],t)}}),d.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return w(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},d.delay=O(function(t,e,n){return setTimeout(function(){return t.apply(null,n)},e)}),d.defer=d.partial(d.delay,d,1),d.throttle=function(t,e,n){var r,i,o,u,a=0;n||(n={});var s=function(){a=!1===n.leading?0:d.now(),r=null,u=t.apply(i,o),r||(i=o=null)},l=function(){var l=d.now();a||!1!==n.leading||(a=l);var c=e-(l-a);return i=this,o=arguments,c<=0||c>e?(r&&(clearTimeout(r),r=null),a=l,u=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(s,c)),u};return l.cancel=function(){clearTimeout(r),a=0,r=i=o=null},l},d.debounce=function(t,e,n){var r,i,o=function(e,n){r=null,n&&(i=t.apply(e,n))},u=O(function(u){if(r&&clearTimeout(r),n){var a=!r;r=setTimeout(o,e),a&&(i=t.apply(this,u))}else r=d.delay(o,e,this,u);return i});return u.cancel=function(){clearTimeout(r),r=null},u},d.wrap=function(t,e){return d.partial(e,t)},d.negate=function(t){return function(){return!t.apply(this,arguments)}},d.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},d.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},d.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},d.once=d.partial(d.before,2),d.restArguments=O;var V=!{toString:null}.propertyIsEnumerable("toString"),D=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],N=function(t,e){var n=D.length,r=t.constructor,i=d.isFunction(r)&&r.prototype||a,o="constructor";for(w(t,o)&&!d.contains(e,o)&&e.push(o);n--;)(o=D[n])in t&&t[o]!==i[o]&&!d.contains(e,o)&&e.push(o)};d.keys=function(t){if(!d.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)w(t,n)&&e.push(n);return V&&N(t,e),e},d.allKeys=function(t){if(!d.isObject(t))return[];var e=[];for(var n in t)e.push(n);return V&&N(t,e),e},d.values=function(t){for(var e=d.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},d.mapObject=function(t,e,n){e=m(e,n);for(var r=d.keys(t),i=r.length,o={},u=0;u<i;u++){var a=r[u];o[a]=e(t[a],a,t)}return o},d.pairs=function(t){for(var e=d.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},d.invert=function(t){for(var e={},n=d.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},d.functions=d.methods=function(t){var e=[];for(var n in t)d.isFunction(t[n])&&e.push(n);return e.sort()};var X=function(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],u=t(o),a=u.length,s=0;s<a;s++){var l=u[s];e&&void 0!==n[l]||(n[l]=o[l])}return n}};d.extend=X(d.allKeys),d.extendOwn=d.assign=X(d.keys),d.findKey=function(t,e,n){e=m(e,n);for(var r,i=d.keys(t),o=0,u=i.length;o<u;o++)if(e(t[r=i[o]],r,t))return r};var Y,L,U=function(t,e,n){return e in n};d.pick=O(function(t,e){var n={},r=e[0];if(null==t)return n;d.isFunction(r)?(e.length>1&&(r=b(r,e[1])),e=d.allKeys(t)):(r=U,e=A(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var u=e[i],a=t[u];r(a,u,t)&&(n[u]=a)}return n}),d.omit=O(function(t,e){var n,r=e[0];return d.isFunction(r)?(r=d.negate(r),e.length>1&&(n=e[1])):(e=d.map(A(e,!1,!1),String),r=function(t,n){return!d.contains(e,n)}),d.pick(t,r,n)}),d.defaults=X(d.allKeys,!0),d.create=function(t,e){var n=C(t);return e&&d.extendOwn(n,e),n},d.clone=function(t){return d.isObject(t)?d.isArray(t)?t.slice():d.extend({},t):t},d.tap=function(t,e){return e(t),t},d.isMatch=function(t,e){var n=d.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var u=n[o];if(e[u]!==i[u]||!(u in i))return!1}return!0},Y=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&L(t,e,n,r)},L=function(t,e,n,r){t instanceof d&&(t=t._wrapped),e instanceof d&&(e=e._wrapped);var i=f.call(t);if(i!==f.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return s.valueOf.call(t)===s.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var u=t.constructor,a=e.constructor;if(u!==a&&!(d.isFunction(u)&&u instanceof u&&d.isFunction(a)&&a instanceof a)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var l=(n=n||[]).length;l--;)if(n[l]===t)return r[l]===e;if(n.push(t),r.push(e),o){if((l=t.length)!==e.length)return!1;for(;l--;)if(!Y(t[l],e[l],n,r))return!1}else{var c,p=d.keys(t);if(l=p.length,d.keys(e).length!==l)return!1;for(;l--;)if(c=p[l],!w(e,c)||!Y(t[c],e[c],n,r))return!1}return n.pop(),r.pop(),!0},d.isEqual=function(t,e){return Y(t,e)},d.isEmpty=function(t){return null==t||(x(t)&&(d.isArray(t)||d.isString(t)||d.isArguments(t))?0===t.length:0===d.keys(t).length)},d.isElement=function(t){return!(!t||1!==t.nodeType)},d.isArray=h||function(t){return"[object Array]"===f.call(t)},d.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},d.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(t){d["is"+t]=function(e){return f.call(e)==="[object "+t+"]"}}),d.isArguments(arguments)||(d.isArguments=function(t){return w(t,"callee")});var R=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof R&&(d.isFunction=function(t){return"function"==typeof t||!1}),d.isFinite=function(t){return!d.isSymbol(t)&&isFinite(t)&&!isNaN(parseFloat(t))},d.isNaN=function(t){return d.isNumber(t)&&isNaN(t)},d.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===f.call(t)},d.isNull=function(t){return null===t},d.isUndefined=function(t){return void 0===t},d.has=function(t,e){if(!d.isArray(e))return w(t,e);for(var n=e.length,r=0;r<n;r++){var i=e[r];if(null==t||!p.call(t,i))return!1;t=t[i]}return!!n},d.noConflict=function(){return i._=o,this},d.identity=function(t){return t},d.constant=function(t){return function(){return t}},d.noop=function(){},d.property=function(t){return d.isArray(t)?function(e){return P(e,t)}:k(t)},d.propertyOf=function(t){return null==t?function(){}:function(e){return d.isArray(e)?P(t,e):t[e]}},d.matcher=d.matches=function(t){return t=d.extendOwn({},t),function(e){return d.isMatch(e,t)}},d.times=function(t,e,n){var r=Array(Math.max(0,t));e=b(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},d.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},d.now=Date.now||function(){return(new Date).getTime()};var K={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Z=d.invert(K),q=function(t){var e=function(e){return t[e]},n="(?:"+d.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};d.escape=q(K),d.unescape=q(Z),d.result=function(t,e,n){d.isArray(e)||(e=[e]);var r=e.length;if(!r)return d.isFunction(n)?n.call(t):n;for(var i=0;i<r;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=n,i=r),t=d.isFunction(o)?o.call(t):o}return t};var H=0;d.uniqueId=function(t){var e=++H+"";return t?t+e:e},d.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var z=/(.)^/,G={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},W=/\\|'|\r|\n|\u2028|\u2029/g,$=function(t){return"\\"+G[t]};d.template=function(t,e,n){!e&&n&&(e=n),e=d.defaults({},e,d.templateSettings);var r,i=RegExp([(e.escape||z).source,(e.interpolate||z).source,(e.evaluate||z).source].join("|")+"|$","g"),o=0,u="__p+='";t.replace(i,function(e,n,r,i,a){return u+=t.slice(o,a).replace(W,$),o=a+e.length,n?u+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?u+="'+\n((__t=("+r+"))==null?'':__t)+\n'":i&&(u+="';\n"+i+"\n__p+='"),e}),u+="';\n",e.variable||(u="with(obj||{}){\n"+u+"}\n"),u="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+u+"return __p;\n";try{r=new Function(e.variable||"obj","_",u)}catch(t){throw t.source=u,t}var a=function(t){return r.call(this,t,d)},s=e.variable||"obj";return a.source="function("+s+"){\n"+u+"}",a},d.chain=function(t){var e=d(t);return e._chain=!0,e};var J=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(t){return d.each(d.functions(t),function(e){var n=d[e]=t[e];d.prototype[e]=function(){var t=[this._wrapped];return l.apply(t,arguments),J(this,n.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=u[t];d.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],J(this,n)}}),d.each(["concat","join","slice"],function(t){var e=u[t];d.prototype[t]=function(){return J(this,e.apply(this._wrapped,arguments))}}),d.prototype.value=function(){return this._wrapped},d.prototype.valueOf=d.prototype.toJSON=d.prototype.value,d.prototype.toString=function(){return String(this._wrapped)},void 0===(r=function(){return d}.apply(e,[]))||(n.exports=r)}()}).call(this,n(4),n(11)(t))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=u(n(1)),o=u(n(3));function u(t){return t&&t.__esModule?t:{default:t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s=function(){function t(e,n,r,i){a(this,t),this.scene=e,this.childrenList=[],this._groupConfig={x:0,y:0,scaleX:1,scaleY:1,angle:0,alpha:1,visible:!0},this._x=0,this._y=0,this._scaleX=1,this._scaleY=1,this._angle=0,this._angle=0,this._alpha=1,this._visible=!0,this._isChildComponent=i||!1,this._isChildComponent&&(this._container=e.add.container(0,0),this.childrenList.push(this._container)),this._config=n,this._key=n.key,this._textures=r,this.imageFramesMap={},this._stateManager=new c(this,n),this._childrenById={},this._createImagesMap(r),this._parseConfig()}return r(t,[{key:"setMask",value:function(t){o.default.each(this.childrenList,function(e){e.setMask(t)},this)}},{key:"getStateConfig",value:function(t){return this._stateManager.getStateConfigById(t)}},{key:"getStateIds",value:function(){return this._stateManager.stateIds}},{key:"setState",value:function(t,e){this._stateManager.setState(t,e)}},{key:"applyChildParams",value:function(e,n){this._childrenById.hasOwnProperty(e)&&t._setupCommonParams(this._childrenById[e],n,this._groupConfig)}},{key:"getChildClip",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"getChildText",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"destroy",value:function(){o.default.each(this.childrenList,function(t){t.destroy()},this)}},{key:"_createImagesMap",value:function(t){var e=this;o.default.each(t,function(t){var n=e.scene.textures.get(t);if(n){var r=n.getFrameNames();o.default.each(r,function(n){e.imageFramesMap[n]=t},e)}},this)}},{key:"_parseConfig",value:function(){var t=this;this._config.hasOwnProperty("children")&&o.default.each(this._config.children,function(e){t._createChildFromConfig(e)},this)}},{key:"_createChildFromConfig",value:function(e){var n=this,r=null,i=null,u=e.childId,a=e.key;if("image"===e.type?r=this._createImageFromConfig(e):"text"===e.type?r=this._createTextFromConfig(e):"tileSprite"===e.type?r=this._createTileSpriteFromConfig(e):"component"===e.type?(r=new t(this.scene,e,this._textures,!0),t._setupCommonParams(r,e),i=r._container):"zone"===e.type?r=this._createHitZoneFromConfig(e):"polygon"===e.type&&(r=this._createPolygonFromConfig(e)),null!==r){if(null===i&&(i=r),this._childrenById[u]=r,e.hasOwnProperty("masking")){var s=r.createGeometryMask();o.default.each(e.masking,function(t){n._childrenById[t].setMask(s)},this)}this._isChildComponent?this._container.add(i):this.childrenList.push(r),this._stateManager.addComponent(r,u,a)}}},{key:"_createPolygonFromConfig",value:function(e){var n=this.scene.make.graphics();n.fillStyle(e.color,e.hasOwnProperty("alpha")?e.alpha:1),n.beginPath();for(var r=e.vertices,i=r.length,o=0;o<i;o+=2)n.lineTo(r[o],r[o+1]);return n.closePath(),n.fillPath(),t._setupCommonParams(n,e),e.hasOwnProperty("masking")||this.scene.add.existing(n),n}},{key:"_createTileSpriteFromConfig",value:function(e){var n=this.scene.add.tileSprite(0,0,e.width,e.height,this.imageFramesMap[e.image],e.image);return n.setOrigin(.5,.5),t._setupCommonParams(n,e),n}},{key:"_createImageFromConfig",value:function(e){var n=this.scene.add.image(0,0,this.imageFramesMap[e.image],e.image);return n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createTextFromConfig",value:function(e){var n=this.scene.add.text(0,0,e.text,e.textStyle);return"center"===e.textStyle.align?n.setOrigin(.5,0):"right"===e.textStyle.align?n.setOrigin(1,0):n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createHitZoneFromConfig",value:function(t){return this.scene.add.zone(t.x||0,t.y||0,t.width,t.height).setOrigin(0)}},{key:"groupX",get:function(){return this._groupConfig.x},set:function(t){if(this._groupConfig.x!==t){var e=t-this._groupConfig.x;this._groupConfig.x=t,this.x+=e}}},{key:"groupY",get:function(){return this._groupConfig.y},set:function(t){if(this._groupConfig.y!==t){var e=t-this._groupConfig.y;this._groupConfig.y=t,this.y+=e}}},{key:"groupScaleX",get:function(){return this._groupConfig.scaleX},set:function(t){if(this._groupConfig.scaleX!==t){var e=t/this._groupConfig.scaleX;this._groupConfig.scaleX=t,this.scaleX*=e}}},{key:"groupScaleY",get:function(){return this._groupConfig.scaleY},set:function(t){if(this._groupConfig.scaleY!==t){var e=t/this._groupConfig.scaleY;this._groupConfig.scaleY=t,this.scaleY*=e}}},{key:"groupAlpha",get:function(){return this._groupConfig.alpha},set:function(t){if(this._groupConfig.alpha!==t){var e=t/this._groupConfig.alpha;this._groupConfig.alpha=t,this.alpha*=e}}},{key:"groupVisible",get:function(){return this._groupConfig.visible},set:function(t){this._groupConfig.visible!==t&&(this._groupConfig.visible=t,this._stateManager.setupState())}},{key:"x",get:function(){return this._x},set:function(t){var e=t-this.x;i.default.Actions.IncX(this.childrenList,e),this._x=t}},{key:"y",get:function(){return this._y},set:function(t){var e=t-this.y;i.default.Actions.IncY(this.childrenList,e),this._y=t}},{key:"visible",get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,i.default.Actions.SetVisible(this.childrenList,t))}},{key:"alpha",get:function(){return this._alpha},set:function(t){this._alpha!==t&&(this._alpha=t,i.default.Actions.SetAlpha(this.childrenList,t))}},{key:"scaleX",get:function(){return this._scaleX},set:function(t){this._scaleX!==t&&(this._scaleX=t,i.default.Actions.SetScaleX(this.childrenList,t))}},{key:"scaleY",get:function(){return this._scaleY},set:function(t){this._scaleY!==t&&(this._scaleY=t,i.default.Actions.SetScaleY(this.childrenList,t))}},{key:"angle",get:function(){return this._angle},set:function(t){this._angle!==t&&i.default.Actions.PropertyValueSet(this.childrenList,"angle",t)}}],[{key:"_setupCommonParams",value:function(t,e,n){var r=e.x||0,i=e.y||0,o=e.scaleX||1,u=e.scaleY||1,a=e.angle||0,s=e.hasOwnProperty("alpha")?e.alpha:1;n&&(r+=n.x,i+=n.y,o*=n.scaleX,u*=n.scaleY,a+=n.angle,s*=n.alpha),t.x=r,t.y=i,t.scaleX=o,t.scaleY=u,t.angle=a,t.alpha=s}}]),t}();e.default=s;var l=function t(e){a(this,t),this.config=e,this.componentIds=[],this.componentIds=Object.keys(e)},c=function(){function t(e,n){a(this,t),this._clip=e,this._dynamicChildrenIds=[],this._states={},this.stateIds=[],this._components={},this._currentState=null,this._currentStateId=null,this._componentKeys={},this._residentComponentsByKey={};var r=[];for(var i in n.states){this.stateIds.push(i);var u=new l(n.states[i]);this._states[i]=u,r.push(u.componentIds)}this._dynamicChildrenIds=o.default.uniq(o.default.flatten(r))}return r(t,[{key:"getStateConfigById",value:function(t){return this._states.hasOwnProperty(t)?this._states[t].config:null}},{key:"addComponent",value:function(t,e,n){-1===o.default.indexOf(this._dynamicChildrenIds,e)?void 0!==n&&(this._residentComponentsByKey[n]=t):(this._components[e]=t,void 0!==n&&(this._componentKeys[e]=n))}},{key:"setState",value:function(t,e){(this._currentStateId!==t||e)&&this._states.hasOwnProperty(t)&&(this._currentStateId=t,this._currentState=this._states[t],this.setupState())}},{key:"getActiveComponentByKey",value:function(t){if(this._residentComponentsByKey.hasOwnProperty(t))return this._residentComponentsByKey[t];if(null===this._currentState)return null;for(var e in this._currentState.componentIds){var n=this._currentState.componentIds[e];if(this._componentKeys[n]===t)return this._components[n]}return null}},{key:"setupState",value:function(){var t=this,e=this._currentState.componentIds,n=o.default.difference(this._dynamicChildrenIds,e);o.default.each(n,function(e){t._components[e].visible=!1},this),o.default.each(e,function(e){var n=t._components[e];n.visible=t._clip._groupConfig.visible,s._setupCommonParams(n,t._currentState.config[e],t._clip._groupConfig)},this)}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},u=n(2),a=(r=u)&&r.__esModule?r:{default:r};var s=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));return i._select=!1,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default),i(e,[{key:"getStateId",value:function(){return o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"getStateId",this).call(this)+(this._select?"_select":"")}},{key:"_onClick",value:function(){this._select=!this._select,this.doState(),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_onClick",this).call(this)}},{key:"select",get:function(){return this._select},set:function(t){this._select!==t&&(this._select=t,this.doState())}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(2),a=(r=u)&&r.__esModule?r:{default:r};var s=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));return i._dragBounds={minX:0,maxX:0,minY:0,maxY:0},i._startDragX=0,i._startDragY=0,i._dragZone=null,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default),o(e,null,[{key:"EVENT_DRAG",get:function(){return"event_drag"}}]),o(e,[{key:"setDragBounds",value:function(t,e,n,r){this._dragBounds.minX=t,this._dragBounds.maxX=n,this._dragBounds.minY=e,this._dragBounds.maxY=r}},{key:"_onDragStart",value:function(t,e){this._dragZone&&this._dragZone===e&&this._clip&&(this._startDragX=this._clip.x-e.input.dragStartX,this._startDragY=this._clip.y-e.input.dragStartY)}},{key:"_onDrag",value:function(t,e,n,r){if(this._dragZone&&this._dragZone===e&&!this.clip){var i=this._startDragX+n,o=this._startDragY+r;i<this._dragBounds.minX?i=this._dragBounds.minX:i>this._dragBounds.maxX&&(i=this._dragBounds.maxX),o<this._dragBounds.minY?o=this._dragBounds.minY:o>this._dragBounds.maxY&&(o=this._dragBounds.maxY),this.emit("event_drag",i,o)}}},{key:"_setupInteractive",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_setupInteractive",this).call(this,t),this._dragZone=t,t.scene.input.setDraggable(t,!0),t.scene.input.on("dragstart",this._onDragStart,this),t.scene.input.on("drag",this._onDrag,this)}},{key:"_removeInteractive",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_removeInteractive",this).call(this,t),this._dragZone=null,t.scene.input.setDraggable(t,!1),t.scene.input.removeListener("dragstart",this._onDragStart),t.scene.input.removeListener("drag",this._onDrag)}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=s(n(0)),u=s(n(2)),a=s(n(7));function s(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._vertical=r||!1,i._value=0,i._minValue=0,i._maxValue=1,i._valueStep=0,i._buttonStep=.1,i.btnPrev=new u.default(i,"btn_up"),i.btnPrev.on(u.default.EVENT_CLICK,i.onPrevClick,i),i.btnNext=new u.default(i,"btn_down"),i.btnNext.on(u.default.EVENT_CLICK,i.onNextClick,i),i.thumb=new a.default(i,"thumb"),i.thumb.on(a.default.EVENT_DRAG,i._onThumbDrag,i),i._trackStart=0,i._trackLength=100,i._thumbClip=null,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),i(e,null,[{key:"EVENT_CHANGE",get:function(){return"event_change"}}]),i(e,[{key:"setValueBounds",value:function(t,e,n){this._minValue=t,this._maxValue=e,void 0!==n?(this._valueStep=n,this._buttonStep<n&&(this._buttonStep=n)):this._valueStep=0}},{key:"setButtonStep",value:function(t){this._buttonStep=t}},{key:"onClipAppend",value:function(t){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._updateClips()}},{key:"_updateClips",value:function(){if(this._clip){this._thumbClip=this.thumb._clip;var t=this._clip.getChildClip("DIMENSIONS");t&&(this._trackStart=this._vertical?t.y:t.x,this._trackLength=this._vertical?t.height:t.width,this._thumbClip&&this.thumb.setDragBounds(this._vertical?this._thumbClip.x:t.x,this._vertical?t.y:this._thumbClip.y,this._vertical?this._thumbClip.x:t.x+t.width,this._vertical?t.y+t.height:this._thumbClip.y));var e=this._clip.getChildClip("HIT_ZONE");e&&e.on("pointerdown",this._onZoneDown,this),this._updateThumbFromValue()}}},{key:"onClipProcess",value:function(){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipProcess",this).call(this),this.thumb&&this._updateClips()}},{key:"onPrevClick",value:function(){this.value-=this._buttonStep}},{key:"onNextClick",value:function(){this.value+=this._buttonStep}},{key:"_updateThumbFromValue",value:function(){if(this._thumbClip){var t=Math.round(this._trackStart+this._trackLength*this._value);this._vertical?this._thumbClip.y=t:this._thumbClip.x=t,this.emit("event_change",this.value)}}},{key:"_onThumbDrag",value:function(t,e){if(0!==this._trackLength){var n=((this._vertical?e:t)-this._trackStart)/this._trackLength*(this._maxValue-this._minValue);0!==this._valueStep&&(n=Math.round(n/this._valueStep)*this._valueStep),this.value=n+this._minValue}}},{key:"_onZoneDown",value:function(){}},{key:"value",get:function(){var t=this._value*(this._maxValue-this._minValue);return 0===this._valueStep?t+this._minValue:(t=Math.round(t/this._valueStep)*this._valueStep)+this._minValue},set:function(t){var e=(t-this._minValue)/(this._maxValue-this._minValue);e<0&&(e=0),e>1&&(e=1),e!==this._value&&(this._value=e,this._updateThumbFromValue())}}]),e}();e.default=l},function(t,e,n){t.exports=n(10)},function(t,e,n){"use strict";(function(e){var r=u(n(5)),i=u(n(12)),o=u(n(17));function u(t){return t&&t.__esModule?t:{default:t}}var a={ComponentClip:r.default,UIComponents:i.default,Plugin:o.default};t.exports=a,e.PhaserComps=a}).call(this,n(4))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=p(n(2)),i=p(n(13)),o=p(n(0)),u=p(n(6)),a=p(n(7)),s=p(n(8)),l=p(n(14)),c=p(n(15)),f=p(n(16));function p(t){return t&&t.__esModule?t:{default:t}}var h={UIComponentPrototype:o.default,UIButton:r.default,UIButtonSelect:u.default,UIButtonRadio:i.default,UIButtonDraggable:a.default,UIScrollBar:s.default,UIScrollPanel:l.default,UIProgressBar:c.default,UIContainer:f.default};e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(6),u=(r=o)&&r.__esModule?r:{default:r};var a=function(t){function e(t,n,r,i,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var u=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));return u._sibling=u,u._value=i,void 0!==o&&u.appendToRadio(o),u}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,u.default),i(e,null,[{key:"EVENT_SELECT",get:function(){return"event_select"}}]),i(e,[{key:"appendToRadio",value:function(t){this._sibling!==this&&this.removeFromSibling(),this._sibling=t._sibling,t._sibling=this}},{key:"removeFromSibling",value:function(){}},{key:"_onClick",value:function(){this.select=!0}},{key:"_broadcastSelect",value:function(){this.emit("event_select",this.value);for(var t=this._sibling;t!==this;)t.emit("event_select",this._value),t=t._sibling}},{key:"select",get:function(){return function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",this)},set:function(t){if(this._select!==t&&(function t(e,n,r,i){var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var u=Object.getPrototypeOf(e);null!==u&&t(u,n,r,i)}else if("value"in o&&o.writable)o.value=r;else{var a=o.set;void 0!==a&&a.call(i,r)}return r}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",t,this),t)){for(var n=this._sibling;n!==this;)n.select=!1,n=n._sibling;this._broadcastSelect()}}},{key:"value",get:function(){return this._value},set:function(t){this._value=t}},{key:"valueSelected",get:function(){if(this.select)return this.value;for(var t=this._sibling;t!==this;){if(t.select)return t.value;t=t._sibling}return null},set:function(t){if(this.value!==t){for(var e=this._sibling;e!==this;)if(e.value===t)return void(e.select=!0)}else this.select=!0}}]),e}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=u(n(0)),o=u(n(8));function u(t){return t&&t.__esModule?t:{default:t}}var a=function(){function t(e,n,r,u,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._container=e,e.on(i.default.EVENT_STATE,this._onContainerUpdate,this),this._panelKey=n,this._dimensionsKey=u,this._scrollBar=new o.default(e,r,a),this._scrollBar.on(o.default.EVENT_CHANGE,this._onScrollBar,this),this._vertical=a||!1}return r(t,[{key:"_onContainerUpdate",value:function(){var t=this._container._clip;if(t){this._panel=t.getChildClip(this._panelKey);var e=t.getChildClip(this._dimensionsKey);this._panel&&e&&(this._scrollBounds={x:e.x,y:e.y,len:this._vertical?this._panel.height-e.height:this._panel.width-e.width},this._onScrollBar(this._onScrollBar.value))}}},{key:"_onScrollBar",value:function(t){this._panel&&this._scrollBounds&&(this._vertical?this._panel.y=this._scrollBounds.y-this._scrollBounds.len*t:this._panel.x=this._scrollBounds.x-this._scrollBounds.len*t)}}]),t}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),u=(r=o)&&r.__esModule?r:{default:r},a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(3));var s=/progress_(\d+)$/,l=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._value=0,r._steps=[],r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,u.default),i(e,[{key:"onClipAppend",value:function(t){(function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._makeSteps(t),this._applyValue()}},{key:"_applyValue",value:function(){if(this._clip){var t=void 0,e=void 0,n=void 0,r=void 0,i=void 0,o=void 0,u=this._steps.length;for(t=0;t<u-1;t++){var a=this._steps[t],s=this._steps[t+1];if(a.stepValue===this._value){i=a.config;break}if(s.stepValue===this._value){i=s.config;break}if(this._value>a.stepValue&&this._value<s.stepValue){e=a.config,n=s.config,r=(this._value-a.stepValue)/(s.stepValue-a.stepValue);break}}if(!i)for(o in i={},e)if(n.hasOwnProperty(o)){var l=e[o],c=n[o];i[o]={x:l.x+(c.x-l.x)*r,y:l.y+(c.y-l.y)*r,scaleX:l.scaleX+(c.scaleX-l.scaleX)*r,scaleY:l.scaleY+(c.scaleY-l.scaleY)*r,angle:l.angle+(c.angle-l.angle)*r,alpha:l.alpha+(c.alpha-l.alpha)*r}}for(o in i)this._clip.applyChildParams(o,i[o])}}},{key:"_makeSteps",value:function(t){var n=this,r=t.getStateIds();this._steps=[],a.each(r,function(r){if(s.test(r)){var i={},o={stepValue:parseInt(s.exec(r)[1])/100,config:i},u=t.getStateConfig(r);for(var a in u)i[a]=e._makeFullConfig(u[a]);n._steps.push(o)}},this),a.sortBy(this._steps,"stepValue")}},{key:"value",get:function(){return this._value},set:function(t){this._value=t,this._applyValue()}}],[{key:"_makeFullConfig",value:function(t){return{x:t.hasOwnProperty("x")?t.x:0,y:t.hasOwnProperty("y")?t.y:0,scaleX:t.hasOwnProperty("scaleX")?t.scaleX:1,scaleY:t.hasOwnProperty("scaleY")?t.scaleY:1,angle:t.hasOwnProperty("angle")?t.angle:0,alpha:t.hasOwnProperty("alpha")?t.alpha:1}}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},o=a(n(0)),u=(a(n(1)),a(n(3)));function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._children=[],r._containerClip=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),r(e,[{key:"addChild",value:function(t){return-1!==this._children.indexOf(t)?t:(this._children.push(t),this._containerClip?this._addUIComponentToContainerClip(t):t._clip.groupVisible=!1,t)}},{key:"removeChild",value:function(t){var e=this._children.indexOf(t);return-1===e?t:(this._children.splice(e,1),this._containerClip&&this._removeUIComponentFromContainerClip(t),t)}},{key:"_addUIComponentToContainerClip",value:function(t){var e=this;u.default.each(t._clip.childrenList,function(t){e._containerClip.add(t)},this),t._clip.groupVisible=!0}},{key:"_removeUIComponentFromContainerClip",value:function(t,e){var n=this;u.default.each(t._clip.childrenList,function(t){n._containerClip.remove(t,e)},this),t._clip.groupVisible=!1}},{key:"onClipAppend",value:function(t){var n=this;i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._containerClip=t._container,this._containerClip&&u.default.each(this._children,function(t){n._addUIComponentToContainerClip(t)},this)}},{key:"onClipRemove",value:function(t){var n=this;i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipRemove",this).call(this,t),this._containerClip&&u.default.each(this._children,function(t){n._removeUIComponentFromContainerClip(t)},this)}},{key:"destroy",value:function(){var t=this;u.default.each(this._children,function(e){t._containerClip&&t._removeUIComponentFromContainerClip(e),e.destroy()},this),this._children.length=0,i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=u(n(1)),o=u(n(5));function u(t){return t&&t.__esModule?t:{default:t}}var a=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return t.registerGameObject("ui_component",n.addComponent,n.addComponent),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i.default.Plugins.BasePlugin),r(e,[{key:"addComponent",value:function(t,e){return new o.default(this.scene,t,e)}}]),e}();e.default=a;var s={key:"UIComponents",plugin:a,start:!0};a.DefaultCfg=s}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("phaser")):"function"==typeof define&&define.amd?define(["phaser"],e):"object"==typeof exports?exports.PhaserComps=e(require("phaser")):t.PhaserComps=e(t.Phaser)}(window,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},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=10)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=o(n(2));o(n(1));function o(t){return t&&t.__esModule?t:{default:t}}var u="event_state",a=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.lockId=null,r._parent=t,r._key=n,r._clip=null,r._texts={},n&&t&&t.on(u,r._onEventState,r),r._clipUpdate(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i.default.Events.EventEmitter),r(e,null,[{key:"EVENT_STATE",get:function(){return u}}]),r(e,[{key:"appendClip",value:function(t){this._clip!==t&&(null!==this._clip&&this.removeClip(),this._clip=t,this._clip&&this.onClipAppend(this._clip),this._clipProcess())}},{key:"onClipAppend",value:function(t){}},{key:"removeClip",value:function(){this.onClipRemove(this._clip),this._clip=null}},{key:"onClipRemove",value:function(t){}},{key:"doState",value:function(){var t=this.getStateId();this._setupState(t)}},{key:"getText",value:function(t){return this._texts[t]}},{key:"setText",value:function(t,e){if(this._texts[t]!==e&&(this._texts[t]=e,this._clip)){var n=this._clip.getChildText(t);n&&(n.text=e)}}},{key:"getStateId",value:function(){return"default"}},{key:"destroy",value:function(){this._parent&&this._parent.removeListener(u,this._onEventState),this._clip&&this._clip.destroy()}},{key:"_clipUpdate",value:function(){if(this._key)if(this._parent._clip){var t=this._parent._clip.getChildClip(this._key);this.appendClip(t)}else this.appendClip(null);else;}},{key:"_clipProcess",value:function(){this._clip&&(this.doState(),this.onClipProcess())}},{key:"onClipProcess",value:function(){}},{key:"_setupState",value:function(t){if(this._clip)for(var e in this._clip.setState(t),this._texts){var n=this._clip.getChildText(e);n&&(n.text=this._texts[e])}this.emit(u)}},{key:"_onEventState",value:function(){this._clipUpdate()}}]),e}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var i=!1,o=[],u=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return r(t,null,[{key:"lock",value:function(t){this.unlock(),"string"==typeof t?o.push(t):t.forEach(function(t){return o.push(t)}),i=!0}},{key:"unlock",value:function(){o.length=0,i=!1}},{key:"check",value:function(t){return!i||-1!==o.indexOf(t)}}]),t}();e.default=u},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=u(n(0)),o=u(n(1));function u(t){return t&&t.__esModule?t:{default:t}}var a=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._enable=!0,i._isPressed=!1,i._isOver=!1,r&&(i.label=r),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i.default),r(e,null,[{key:"EVENT_CLICK",get:function(){return"event_click"}}]),r(e,[{key:"onClipAppend",value:function(t){this._updateInteractive()}},{key:"onClipRemove",value:function(t){var e=t.getChildClip("HIT_ZONE");e&&this._removeInteractive(e)}},{key:"_setupInteractive",value:function(t){t.setInteractive({useHandCursor:!0}),t.on("pointerdown",this._onPointerDown,this),t.on("pointerup",this._onPointerUp,this),t.on("pointerover",this._onPointerOver,this),t.on("pointerout",this._onPointerOut,this)}},{key:"_removeInteractive",value:function(t){t.disableInteractive(),t.removeListener("pointerdown",this._onPointerDown,this),t.removeListener("pointerup",this._onPointerUp,this),t.removeListener("pointerover",this._onPointerOver,this),t.removeListener("pointerout",this._onPointerOut,this)}},{key:"_updateInteractive",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&(this.enable?this._setupInteractive(t):this._removeInteractive(t))}}},{key:"getStateId",value:function(){return this.enable?this._isPressed?this.STATE_DOWN:this._isOver?this.STATE_OVER:this.STATE_UP:this.STATE_DISABLE}},{key:"_onClick",value:function(){this.emit("event_click")}},{key:"_onPointerOut",value:function(){this._isOver=!1,this._isPressed=!1,this.doState()}},{key:"_onPointerOver",value:function(){this._isOver=!0,this.doState()}},{key:"_onPointerDown",value:function(){this._isPressed=!0,this.doState()}},{key:"_onPointerUp",value:function(){var t=this._isPressed&&this._isOver;this._isPressed=!1,this.doState(),t&&o.default.check(this.lockId)&&this._onClick()}},{key:"destroy",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&this._removeInteractive(t)}(function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"label",get:function(){return this.getText("label")},set:function(t){this.setText("label",t)}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(this._enable=t,this._updateInteractive(),this.doState())}},{key:"STATE_UP",get:function(){return"up"}},{key:"STATE_DOWN",get:function(){return"down"}},{key:"STATE_OVER",get:function(){return"over"}},{key:"STATE_DISABLE",get:function(){return"disable"}}]),e}();e.default=a},function(t,e,n){(function(t,n){var r;!function(){var i="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this||{},o=i._,u=Array.prototype,a=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,s=u.push,c=u.slice,f=a.toString,p=a.hasOwnProperty,h=Array.isArray,_=Object.keys,v=Object.create,y=function(){},d=function(t){return t instanceof d?t:this instanceof d?void(this._wrapped=t):new d(t)};e.nodeType?i._=d:(!n.nodeType&&n.exports&&(e=n.exports=d),e._=d),d.VERSION="1.9.1";var g,b=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},m=function(t,e,n){return d.iteratee!==g?d.iteratee(t,e):null==t?d.identity:d.isFunction(t)?b(t,e,n):d.isObject(t)&&!d.isArray(t)?d.matcher(t):d.property(t)};d.iteratee=g=function(t,e){return m(t,e,1/0)};var O=function(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var o=Array(e+1);for(i=0;i<e;i++)o[i]=arguments[i];return o[e]=r,t.apply(this,o)}},k=function(t){if(!d.isObject(t))return{};if(v)return v(t);y.prototype=t;var e=new y;return y.prototype=null,e},C=function(t){return function(e){return null==e?void 0:e[t]}},w=function(t,e){return null!=t&&p.call(t,e)},P=function(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0},j=Math.pow(2,53)-1,S=C("length"),x=function(t){var e=S(t);return"number"==typeof e&&e>=0&&e<=j};d.each=d.forEach=function(t,e,n){var r,i;if(e=b(e,n),x(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=d.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},d.map=d.collect=function(t,e,n){e=m(e,n);for(var r=!x(t)&&d.keys(t),i=(r||t).length,o=Array(i),u=0;u<i;u++){var a=r?r[u]:u;o[u]=e(t[a],a,t)}return o};var I=function(t){return function(e,n,r,i){var o=arguments.length>=3;return function(e,n,r,i){var o=!x(e)&&d.keys(e),u=(o||e).length,a=t>0?0:u-1;for(i||(r=e[o?o[a]:a],a+=t);a>=0&&a<u;a+=t){var l=o?o[a]:a;r=n(r,e[l],l,e)}return r}(e,b(n,i,4),r,o)}};d.reduce=d.foldl=d.inject=I(1),d.reduceRight=d.foldr=I(-1),d.find=d.detect=function(t,e,n){var r=(x(t)?d.findIndex:d.findKey)(t,e,n);if(void 0!==r&&-1!==r)return t[r]},d.filter=d.select=function(t,e,n){var r=[];return e=m(e,n),d.each(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r},d.reject=function(t,e,n){return d.filter(t,d.negate(m(e)),n)},d.every=d.all=function(t,e,n){e=m(e,n);for(var r=!x(t)&&d.keys(t),i=(r||t).length,o=0;o<i;o++){var u=r?r[o]:o;if(!e(t[u],u,t))return!1}return!0},d.some=d.any=function(t,e,n){e=m(e,n);for(var r=!x(t)&&d.keys(t),i=(r||t).length,o=0;o<i;o++){var u=r?r[o]:o;if(e(t[u],u,t))return!0}return!1},d.contains=d.includes=d.include=function(t,e,n,r){return x(t)||(t=d.values(t)),("number"!=typeof n||r)&&(n=0),d.indexOf(t,e,n)>=0},d.invoke=O(function(t,e,n){var r,i;return d.isFunction(e)?i=e:d.isArray(e)&&(r=e.slice(0,-1),e=e[e.length-1]),d.map(t,function(t){var o=i;if(!o){if(r&&r.length&&(t=P(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)})}),d.pluck=function(t,e){return d.map(t,d.property(e))},d.where=function(t,e){return d.filter(t,d.matcher(e))},d.findWhere=function(t,e){return d.find(t,d.matcher(e))},d.max=function(t,e,n){var r,i,o=-1/0,u=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=x(t)?t:d.values(t)).length;a<l;a++)null!=(r=t[a])&&r>o&&(o=r);else e=m(e,n),d.each(t,function(t,n,r){((i=e(t,n,r))>u||i===-1/0&&o===-1/0)&&(o=t,u=i)});return o},d.min=function(t,e,n){var r,i,o=1/0,u=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=x(t)?t:d.values(t)).length;a<l;a++)null!=(r=t[a])&&r<o&&(o=r);else e=m(e,n),d.each(t,function(t,n,r){((i=e(t,n,r))<u||i===1/0&&o===1/0)&&(o=t,u=i)});return o},d.shuffle=function(t){return d.sample(t,1/0)},d.sample=function(t,e,n){if(null==e||n)return x(t)||(t=d.values(t)),t[d.random(t.length-1)];var r=x(t)?d.clone(t):d.values(t),i=S(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,u=0;u<e;u++){var a=d.random(u,o),l=r[u];r[u]=r[a],r[a]=l}return r.slice(0,e)},d.sortBy=function(t,e,n){var r=0;return e=m(e,n),d.pluck(d.map(t,function(t,n,i){return{value:t,index:r++,criteria:e(t,n,i)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index}),"value")};var E=function(t,e){return function(n,r,i){var o=e?[[],[]]:{};return r=m(r,i),d.each(n,function(e,i){var u=r(e,i,n);t(o,e,u)}),o}};d.groupBy=E(function(t,e,n){w(t,n)?t[n].push(e):t[n]=[e]}),d.indexBy=E(function(t,e,n){t[n]=e}),d.countBy=E(function(t,e,n){w(t,n)?t[n]++:t[n]=1});var T=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;d.toArray=function(t){return t?d.isArray(t)?c.call(t):d.isString(t)?t.match(T):x(t)?d.map(t,d.identity):d.values(t):[]},d.size=function(t){return null==t?0:x(t)?t.length:d.keys(t).length},d.partition=E(function(t,e,n){t[n?0:1].push(e)},!0),d.first=d.head=d.take=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[0]:d.initial(t,t.length-e)},d.initial=function(t,e,n){return c.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},d.last=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[t.length-1]:d.rest(t,Math.max(0,t.length-e))},d.rest=d.tail=d.drop=function(t,e,n){return c.call(t,null==e||n?1:e)},d.compact=function(t){return d.filter(t,Boolean)};var A=function(t,e,n,r){for(var i=(r=r||[]).length,o=0,u=S(t);o<u;o++){var a=t[o];if(x(a)&&(d.isArray(a)||d.isArguments(a)))if(e)for(var l=0,s=a.length;l<s;)r[i++]=a[l++];else A(a,e,n,r),i=r.length;else n||(r[i++]=a)}return r};d.flatten=function(t,e){return A(t,e,!1)},d.without=O(function(t,e){return d.difference(t,e)}),d.uniq=d.unique=function(t,e,n,r){d.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=m(n,r));for(var i=[],o=[],u=0,a=S(t);u<a;u++){var l=t[u],s=n?n(l,u,t):l;e&&!n?(u&&o===s||i.push(l),o=s):n?d.contains(o,s)||(o.push(s),i.push(l)):d.contains(i,l)||i.push(l)}return i},d.union=O(function(t){return d.uniq(A(t,!0,!0))}),d.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=S(t);r<i;r++){var o=t[r];if(!d.contains(e,o)){var u;for(u=1;u<n&&d.contains(arguments[u],o);u++);u===n&&e.push(o)}}return e},d.difference=O(function(t,e){return e=A(e,!0,!0),d.filter(t,function(t){return!d.contains(e,t)})}),d.unzip=function(t){for(var e=t&&d.max(t,S).length||0,n=Array(e),r=0;r<e;r++)n[r]=d.pluck(t,r);return n},d.zip=O(d.unzip),d.object=function(t,e){for(var n={},r=0,i=S(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n};var M=function(t){return function(e,n,r){n=m(n,r);for(var i=S(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}};d.findIndex=M(1),d.findLastIndex=M(-1),d.sortedIndex=function(t,e,n,r){for(var i=(n=m(n,r,1))(e),o=0,u=S(t);o<u;){var a=Math.floor((o+u)/2);n(t[a])<i?o=a+1:u=a}return o};var B=function(t,e,n){return function(r,i,o){var u=0,a=S(r);if("number"==typeof o)t>0?u=o>=0?o:Math.max(o+a,u):a=o>=0?Math.min(o+1,a):o+a+1;else if(n&&o&&a)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(c.call(r,u,a),d.isNaN))>=0?o+u:-1;for(o=t>0?u:a-1;o>=0&&o<a;o+=t)if(r[o]===i)return o;return-1}};d.indexOf=B(1,d.findIndex,d.sortedIndex),d.lastIndexOf=B(-1,d.findLastIndex),d.range=function(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i},d.chunk=function(t,e){if(null==e||e<1)return[];for(var n=[],r=0,i=t.length;r<i;)n.push(c.call(t,r,r+=e));return n};var F=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=k(t.prototype),u=t.apply(o,i);return d.isObject(u)?u:o};d.bind=O(function(t,e,n){if(!d.isFunction(t))throw new TypeError("Bind must be called on a function");var r=O(function(i){return F(t,r,e,this,n.concat(i))});return r}),d.partial=O(function(t,e){var n=d.partial.placeholder,r=function(){for(var i=0,o=e.length,u=Array(o),a=0;a<o;a++)u[a]=e[a]===n?arguments[i++]:e[a];for(;i<arguments.length;)u.push(arguments[i++]);return F(t,r,this,this,u)};return r}),d.partial.placeholder=d,d.bindAll=O(function(t,e){var n=(e=A(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=d.bind(t[r],t)}}),d.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return w(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},d.delay=O(function(t,e,n){return setTimeout(function(){return t.apply(null,n)},e)}),d.defer=d.partial(d.delay,d,1),d.throttle=function(t,e,n){var r,i,o,u,a=0;n||(n={});var l=function(){a=!1===n.leading?0:d.now(),r=null,u=t.apply(i,o),r||(i=o=null)},s=function(){var s=d.now();a||!1!==n.leading||(a=s);var c=e-(s-a);return i=this,o=arguments,c<=0||c>e?(r&&(clearTimeout(r),r=null),a=s,u=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(l,c)),u};return s.cancel=function(){clearTimeout(r),a=0,r=i=o=null},s},d.debounce=function(t,e,n){var r,i,o=function(e,n){r=null,n&&(i=t.apply(e,n))},u=O(function(u){if(r&&clearTimeout(r),n){var a=!r;r=setTimeout(o,e),a&&(i=t.apply(this,u))}else r=d.delay(o,e,this,u);return i});return u.cancel=function(){clearTimeout(r),r=null},u},d.wrap=function(t,e){return d.partial(e,t)},d.negate=function(t){return function(){return!t.apply(this,arguments)}},d.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},d.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},d.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},d.once=d.partial(d.before,2),d.restArguments=O;var V=!{toString:null}.propertyIsEnumerable("toString"),D=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],N=function(t,e){var n=D.length,r=t.constructor,i=d.isFunction(r)&&r.prototype||a,o="constructor";for(w(t,o)&&!d.contains(e,o)&&e.push(o);n--;)(o=D[n])in t&&t[o]!==i[o]&&!d.contains(e,o)&&e.push(o)};d.keys=function(t){if(!d.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)w(t,n)&&e.push(n);return V&&N(t,e),e},d.allKeys=function(t){if(!d.isObject(t))return[];var e=[];for(var n in t)e.push(n);return V&&N(t,e),e},d.values=function(t){for(var e=d.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},d.mapObject=function(t,e,n){e=m(e,n);for(var r=d.keys(t),i=r.length,o={},u=0;u<i;u++){var a=r[u];o[a]=e(t[a],a,t)}return o},d.pairs=function(t){for(var e=d.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},d.invert=function(t){for(var e={},n=d.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},d.functions=d.methods=function(t){var e=[];for(var n in t)d.isFunction(t[n])&&e.push(n);return e.sort()};var X=function(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],u=t(o),a=u.length,l=0;l<a;l++){var s=u[l];e&&void 0!==n[s]||(n[s]=o[s])}return n}};d.extend=X(d.allKeys),d.extendOwn=d.assign=X(d.keys),d.findKey=function(t,e,n){e=m(e,n);for(var r,i=d.keys(t),o=0,u=i.length;o<u;o++)if(e(t[r=i[o]],r,t))return r};var Y,L,U=function(t,e,n){return e in n};d.pick=O(function(t,e){var n={},r=e[0];if(null==t)return n;d.isFunction(r)?(e.length>1&&(r=b(r,e[1])),e=d.allKeys(t)):(r=U,e=A(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var u=e[i],a=t[u];r(a,u,t)&&(n[u]=a)}return n}),d.omit=O(function(t,e){var n,r=e[0];return d.isFunction(r)?(r=d.negate(r),e.length>1&&(n=e[1])):(e=d.map(A(e,!1,!1),String),r=function(t,n){return!d.contains(e,n)}),d.pick(t,r,n)}),d.defaults=X(d.allKeys,!0),d.create=function(t,e){var n=k(t);return e&&d.extendOwn(n,e),n},d.clone=function(t){return d.isObject(t)?d.isArray(t)?t.slice():d.extend({},t):t},d.tap=function(t,e){return e(t),t},d.isMatch=function(t,e){var n=d.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var u=n[o];if(e[u]!==i[u]||!(u in i))return!1}return!0},Y=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&L(t,e,n,r)},L=function(t,e,n,r){t instanceof d&&(t=t._wrapped),e instanceof d&&(e=e._wrapped);var i=f.call(t);if(i!==f.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return l.valueOf.call(t)===l.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var u=t.constructor,a=e.constructor;if(u!==a&&!(d.isFunction(u)&&u instanceof u&&d.isFunction(a)&&a instanceof a)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var s=(n=n||[]).length;s--;)if(n[s]===t)return r[s]===e;if(n.push(t),r.push(e),o){if((s=t.length)!==e.length)return!1;for(;s--;)if(!Y(t[s],e[s],n,r))return!1}else{var c,p=d.keys(t);if(s=p.length,d.keys(e).length!==s)return!1;for(;s--;)if(c=p[s],!w(e,c)||!Y(t[c],e[c],n,r))return!1}return n.pop(),r.pop(),!0},d.isEqual=function(t,e){return Y(t,e)},d.isEmpty=function(t){return null==t||(x(t)&&(d.isArray(t)||d.isString(t)||d.isArguments(t))?0===t.length:0===d.keys(t).length)},d.isElement=function(t){return!(!t||1!==t.nodeType)},d.isArray=h||function(t){return"[object Array]"===f.call(t)},d.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},d.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(t){d["is"+t]=function(e){return f.call(e)==="[object "+t+"]"}}),d.isArguments(arguments)||(d.isArguments=function(t){return w(t,"callee")});var R=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof R&&(d.isFunction=function(t){return"function"==typeof t||!1}),d.isFinite=function(t){return!d.isSymbol(t)&&isFinite(t)&&!isNaN(parseFloat(t))},d.isNaN=function(t){return d.isNumber(t)&&isNaN(t)},d.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===f.call(t)},d.isNull=function(t){return null===t},d.isUndefined=function(t){return void 0===t},d.has=function(t,e){if(!d.isArray(e))return w(t,e);for(var n=e.length,r=0;r<n;r++){var i=e[r];if(null==t||!p.call(t,i))return!1;t=t[i]}return!!n},d.noConflict=function(){return i._=o,this},d.identity=function(t){return t},d.constant=function(t){return function(){return t}},d.noop=function(){},d.property=function(t){return d.isArray(t)?function(e){return P(e,t)}:C(t)},d.propertyOf=function(t){return null==t?function(){}:function(e){return d.isArray(e)?P(t,e):t[e]}},d.matcher=d.matches=function(t){return t=d.extendOwn({},t),function(e){return d.isMatch(e,t)}},d.times=function(t,e,n){var r=Array(Math.max(0,t));e=b(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},d.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},d.now=Date.now||function(){return(new Date).getTime()};var K={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Z=d.invert(K),q=function(t){var e=function(e){return t[e]},n="(?:"+d.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};d.escape=q(K),d.unescape=q(Z),d.result=function(t,e,n){d.isArray(e)||(e=[e]);var r=e.length;if(!r)return d.isFunction(n)?n.call(t):n;for(var i=0;i<r;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=n,i=r),t=d.isFunction(o)?o.call(t):o}return t};var H=0;d.uniqueId=function(t){var e=++H+"";return t?t+e:e},d.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var z=/(.)^/,G={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},W=/\\|'|\r|\n|\u2028|\u2029/g,$=function(t){return"\\"+G[t]};d.template=function(t,e,n){!e&&n&&(e=n),e=d.defaults({},e,d.templateSettings);var r,i=RegExp([(e.escape||z).source,(e.interpolate||z).source,(e.evaluate||z).source].join("|")+"|$","g"),o=0,u="__p+='";t.replace(i,function(e,n,r,i,a){return u+=t.slice(o,a).replace(W,$),o=a+e.length,n?u+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?u+="'+\n((__t=("+r+"))==null?'':__t)+\n'":i&&(u+="';\n"+i+"\n__p+='"),e}),u+="';\n",e.variable||(u="with(obj||{}){\n"+u+"}\n"),u="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+u+"return __p;\n";try{r=new Function(e.variable||"obj","_",u)}catch(t){throw t.source=u,t}var a=function(t){return r.call(this,t,d)},l=e.variable||"obj";return a.source="function("+l+"){\n"+u+"}",a},d.chain=function(t){var e=d(t);return e._chain=!0,e};var J=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(t){return d.each(d.functions(t),function(e){var n=d[e]=t[e];d.prototype[e]=function(){var t=[this._wrapped];return s.apply(t,arguments),J(this,n.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=u[t];d.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],J(this,n)}}),d.each(["concat","join","slice"],function(t){var e=u[t];d.prototype[t]=function(){return J(this,e.apply(this._wrapped,arguments))}}),d.prototype.value=function(){return this._wrapped},d.prototype.valueOf=d.prototype.toJSON=d.prototype.value,d.prototype.toString=function(){return String(this._wrapped)},void 0===(r=function(){return d}.apply(e,[]))||(n.exports=r)}()}).call(this,n(5),n(12)(t))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=u(n(2)),o=u(n(4));function u(t){return t&&t.__esModule?t:{default:t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var l=function(){function t(e,n,r,i){a(this,t),this.scene=e,this.childrenList=[],this._groupConfig={x:0,y:0,scaleX:1,scaleY:1,angle:0,alpha:1,visible:!0},this._x=0,this._y=0,this._scaleX=1,this._scaleY=1,this._angle=0,this._angle=0,this._alpha=1,this._visible=!0,this._isChildComponent=i||!1,this._isChildComponent&&(this._container=e.add.container(0,0),this.childrenList.push(this._container)),this._config=n,this._key=n.key,this._textures=r,this.imageFramesMap={},this._stateManager=new c(this,n),this._childrenById={},this._createImagesMap(r),this._parseConfig()}return r(t,[{key:"setMask",value:function(t){o.default.each(this.childrenList,function(e){e.setMask(t)},this)}},{key:"getStateConfig",value:function(t){return this._stateManager.getStateConfigById(t)}},{key:"getStateIds",value:function(){return this._stateManager.stateIds}},{key:"setState",value:function(t,e){this._stateManager.setState(t,e)}},{key:"applyChildParams",value:function(e,n){this._childrenById.hasOwnProperty(e)&&t._setupCommonParams(this._childrenById[e],n,this._groupConfig)}},{key:"getChildClip",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"getChildText",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"destroy",value:function(){o.default.each(this.childrenList,function(t){t.destroy()},this)}},{key:"_createImagesMap",value:function(t){var e=this;o.default.each(t,function(t){var n=e.scene.textures.get(t);if(n){var r=n.getFrameNames();o.default.each(r,function(n){e.imageFramesMap[n]=t},e)}},this)}},{key:"_parseConfig",value:function(){var t=this;this._config.hasOwnProperty("children")&&o.default.each(this._config.children,function(e){t._createChildFromConfig(e)},this)}},{key:"_createChildFromConfig",value:function(e){var n=this,r=null,i=null,u=e.childId,a=e.key;if("image"===e.type?r=this._createImageFromConfig(e):"text"===e.type?r=this._createTextFromConfig(e):"tileSprite"===e.type?r=this._createTileSpriteFromConfig(e):"component"===e.type?(r=new t(this.scene,e,this._textures,!0),t._setupCommonParams(r,e),i=r._container):"zone"===e.type?r=this._createHitZoneFromConfig(e):"polygon"===e.type&&(r=this._createPolygonFromConfig(e)),null!==r){if(null===i&&(i=r),this._childrenById[u]=r,e.hasOwnProperty("masking")){var l=r.createGeometryMask();o.default.each(e.masking,function(t){n._childrenById[t].setMask(l)},this)}this._isChildComponent?this._container.add(i):this.childrenList.push(r),this._stateManager.addComponent(r,u,a)}}},{key:"_createPolygonFromConfig",value:function(e){var n=this.scene.make.graphics();n.fillStyle(e.color,e.hasOwnProperty("alpha")?e.alpha:1),n.beginPath();for(var r=e.vertices,i=r.length,o=0;o<i;o+=2)n.lineTo(r[o],r[o+1]);return n.closePath(),n.fillPath(),t._setupCommonParams(n,e),e.hasOwnProperty("masking")||this.scene.add.existing(n),n}},{key:"_createTileSpriteFromConfig",value:function(e){var n=this.scene.add.tileSprite(0,0,e.width,e.height,this.imageFramesMap[e.image],e.image);return n.setOrigin(.5,.5),t._setupCommonParams(n,e),n}},{key:"_createImageFromConfig",value:function(e){var n=this.scene.add.image(0,0,this.imageFramesMap[e.image],e.image);return n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createTextFromConfig",value:function(e){var n=this.scene.add.text(0,0,e.text,e.textStyle);return"center"===e.textStyle.align?n.setOrigin(.5,0):"right"===e.textStyle.align?n.setOrigin(1,0):n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createHitZoneFromConfig",value:function(t){return this.scene.add.zone(t.x||0,t.y||0,t.width,t.height).setOrigin(0)}},{key:"groupX",get:function(){return this._groupConfig.x},set:function(t){if(this._groupConfig.x!==t){var e=t-this._groupConfig.x;this._groupConfig.x=t,this.x+=e}}},{key:"groupY",get:function(){return this._groupConfig.y},set:function(t){if(this._groupConfig.y!==t){var e=t-this._groupConfig.y;this._groupConfig.y=t,this.y+=e}}},{key:"groupScaleX",get:function(){return this._groupConfig.scaleX},set:function(t){if(this._groupConfig.scaleX!==t){var e=t/this._groupConfig.scaleX;this._groupConfig.scaleX=t,this.scaleX*=e}}},{key:"groupScaleY",get:function(){return this._groupConfig.scaleY},set:function(t){if(this._groupConfig.scaleY!==t){var e=t/this._groupConfig.scaleY;this._groupConfig.scaleY=t,this.scaleY*=e}}},{key:"groupAlpha",get:function(){return this._groupConfig.alpha},set:function(t){if(this._groupConfig.alpha!==t){var e=t/this._groupConfig.alpha;this._groupConfig.alpha=t,this.alpha*=e}}},{key:"groupVisible",get:function(){return this._groupConfig.visible},set:function(t){this._groupConfig.visible!==t&&(this._groupConfig.visible=t,this._stateManager.setupState())}},{key:"x",get:function(){return this._x},set:function(t){var e=t-this.x;i.default.Actions.IncX(this.childrenList,e),this._x=t}},{key:"y",get:function(){return this._y},set:function(t){var e=t-this.y;i.default.Actions.IncY(this.childrenList,e),this._y=t}},{key:"visible",get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,i.default.Actions.SetVisible(this.childrenList,t))}},{key:"alpha",get:function(){return this._alpha},set:function(t){this._alpha!==t&&(this._alpha=t,i.default.Actions.SetAlpha(this.childrenList,t))}},{key:"scaleX",get:function(){return this._scaleX},set:function(t){this._scaleX!==t&&(this._scaleX=t,i.default.Actions.SetScaleX(this.childrenList,t))}},{key:"scaleY",get:function(){return this._scaleY},set:function(t){this._scaleY!==t&&(this._scaleY=t,i.default.Actions.SetScaleY(this.childrenList,t))}},{key:"angle",get:function(){return this._angle},set:function(t){this._angle!==t&&i.default.Actions.PropertyValueSet(this.childrenList,"angle",t)}}],[{key:"_setupCommonParams",value:function(t,e,n){var r=e.x||0,i=e.y||0,o=e.scaleX||1,u=e.scaleY||1,a=e.angle||0,l=e.hasOwnProperty("alpha")?e.alpha:1;n&&(r+=n.x,i+=n.y,o*=n.scaleX,u*=n.scaleY,a+=n.angle,l*=n.alpha),t.x=r,t.y=i,t.scaleX=o,t.scaleY=u,t.angle=a,t.alpha=l}}]),t}();e.default=l;var s=function t(e){a(this,t),this.config=e,this.componentIds=[],this.componentIds=Object.keys(e)},c=function(){function t(e,n){a(this,t),this._clip=e,this._dynamicChildrenIds=[],this._states={},this.stateIds=[],this._components={},this._currentState=null,this._currentStateId=null,this._componentKeys={},this._residentComponentsByKey={};var r=[];for(var i in n.states){this.stateIds.push(i);var u=new s(n.states[i]);this._states[i]=u,r.push(u.componentIds)}this._dynamicChildrenIds=o.default.uniq(o.default.flatten(r))}return r(t,[{key:"getStateConfigById",value:function(t){return this._states.hasOwnProperty(t)?this._states[t].config:null}},{key:"addComponent",value:function(t,e,n){-1===o.default.indexOf(this._dynamicChildrenIds,e)?void 0!==n&&(this._residentComponentsByKey[n]=t):(this._components[e]=t,void 0!==n&&(this._componentKeys[e]=n))}},{key:"setState",value:function(t,e){(this._currentStateId!==t||e)&&this._states.hasOwnProperty(t)&&(this._currentStateId=t,this._currentState=this._states[t],this.setupState())}},{key:"getActiveComponentByKey",value:function(t){if(this._residentComponentsByKey.hasOwnProperty(t))return this._residentComponentsByKey[t];if(null===this._currentState)return null;for(var e in this._currentState.componentIds){var n=this._currentState.componentIds[e];if(this._componentKeys[n]===t)return this._components[n]}return null}},{key:"setupState",value:function(){var t=this,e=this._currentState.componentIds,n=o.default.difference(this._dynamicChildrenIds,e);o.default.each(n,function(e){t._components[e].visible=!1},this),o.default.each(e,function(e){var n=t._components[e];n.visible=t._clip._groupConfig.visible,l._setupCommonParams(n,t._currentState.config[e],t._clip._groupConfig)},this)}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},u=n(3),a=(r=u)&&r.__esModule?r:{default:r};var l=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));return i._select=!1,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default),i(e,[{key:"getStateId",value:function(){return o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"getStateId",this).call(this)+(this._select?"_select":"")}},{key:"_onClick",value:function(){this._select=!this._select,this.doState(),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_onClick",this).call(this)}},{key:"select",get:function(){return this._select},set:function(t){this._select!==t&&(this._select=t,this.doState())}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=a(n(3)),u=a(n(1));function a(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));return i._dragBounds={minX:0,maxX:0,minY:0,maxY:0},i._startDragX=0,i._startDragY=0,i._dragZone=null,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),i(e,null,[{key:"EVENT_DRAG",get:function(){return"event_drag"}}]),i(e,[{key:"setDragBounds",value:function(t,e,n,r){this._dragBounds.minX=t,this._dragBounds.maxX=n,this._dragBounds.minY=e,this._dragBounds.maxY=r}},{key:"_onDragStart",value:function(t,e){this._dragZone&&this._dragZone===e&&this._clip&&(this._startDragX=this._clip.x-e.input.dragStartX,this._startDragY=this._clip.y-e.input.dragStartY)}},{key:"_onDrag",value:function(t,e,n,r){if(u.default.check(this.lockId)&&this._dragZone&&this._dragZone===e&&!this.clip){var i=this._startDragX+n,o=this._startDragY+r;i<this._dragBounds.minX?i=this._dragBounds.minX:i>this._dragBounds.maxX&&(i=this._dragBounds.maxX),o<this._dragBounds.minY?o=this._dragBounds.minY:o>this._dragBounds.maxY&&(o=this._dragBounds.maxY),this.emit("event_drag",i,o)}}},{key:"_setupInteractive",value:function(t){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_setupInteractive",this).call(this,t),this._dragZone=t,t.scene.input.setDraggable(t,!0),t.scene.input.on("dragstart",this._onDragStart,this),t.scene.input.on("drag",this._onDrag,this)}},{key:"_removeInteractive",value:function(t){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_removeInteractive",this).call(this,t),this._dragZone=null,t.scene.input.setDraggable(t,!1),t.scene.input.removeListener("dragstart",this._onDragStart),t.scene.input.removeListener("drag",this._onDrag)}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=s(n(0)),u=s(n(3)),a=s(n(8)),l=s(n(1));function s(t){return t&&t.__esModule?t:{default:t}}var c=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._vertical=r||!1,i._value=0,i._minValue=0,i._maxValue=1,i._valueStep=0,i._buttonStep=.1,i.btnPrev=new u.default(i,"btn_up"),i.btnPrev.on(u.default.EVENT_CLICK,i.onPrevClick,i),i.btnNext=new u.default(i,"btn_down"),i.btnNext.on(u.default.EVENT_CLICK,i.onNextClick,i),i.thumb=new a.default(i,"thumb"),i.thumb.on(a.default.EVENT_DRAG,i._onThumbDrag,i),i._trackStart=0,i._trackLength=100,i._thumbClip=null,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),i(e,null,[{key:"EVENT_CHANGE",get:function(){return"event_change"}}]),i(e,[{key:"setValueBounds",value:function(t,e,n){this._minValue=t,this._maxValue=e,void 0!==n?(this._valueStep=n,this._buttonStep<n&&(this._buttonStep=n)):this._valueStep=0}},{key:"setButtonStep",value:function(t){this._buttonStep=t}},{key:"onClipAppend",value:function(t){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._updateClips()}},{key:"_updateClips",value:function(){if(this._clip){this._thumbClip=this.thumb._clip;var t=this._clip.getChildClip("DIMENSIONS");t&&(this._trackStart=this._vertical?t.y:t.x,this._trackLength=this._vertical?t.height:t.width,this._thumbClip&&this.thumb.setDragBounds(this._vertical?this._thumbClip.x:t.x,this._vertical?t.y:this._thumbClip.y,this._vertical?this._thumbClip.x:t.x+t.width,this._vertical?t.y+t.height:this._thumbClip.y));var e=this._clip.getChildClip("HIT_ZONE");e&&e.on("pointerdown",this._onZoneDown,this),this._updateThumbFromValue()}}},{key:"onClipProcess",value:function(){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipProcess",this).call(this),this.thumb&&this._updateClips()}},{key:"onPrevClick",value:function(){l.default.check(this.lockId)&&(this.value-=this._buttonStep)}},{key:"onNextClick",value:function(){l.default.check(this.lockId)&&(this.value+=this._buttonStep)}},{key:"_updateThumbFromValue",value:function(){if(this._thumbClip){var t=Math.round(this._trackStart+this._trackLength*this._value);this._vertical?this._thumbClip.y=t:this._thumbClip.x=t,this.emit("event_change",this.value)}}},{key:"_onThumbDrag",value:function(t,e){if(0!==this._trackLength&&l.default.check(this.lockId)){var n=((this._vertical?e:t)-this._trackStart)/this._trackLength*(this._maxValue-this._minValue);0!==this._valueStep&&(n=Math.round(n/this._valueStep)*this._valueStep),this.value=n+this._minValue}}},{key:"_onZoneDown",value:function(){}},{key:"value",get:function(){var t=this._value*(this._maxValue-this._minValue);return 0===this._valueStep?t+this._minValue:(t=Math.round(t/this._valueStep)*this._valueStep)+this._minValue},set:function(t){var e=(t-this._minValue)/(this._maxValue-this._minValue);e<0&&(e=0),e>1&&(e=1),e!==this._value&&(this._value=e,this._updateThumbFromValue())}}]),e}();e.default=c},function(t,e,n){t.exports=n(11)},function(t,e,n){"use strict";(function(e){var r=a(n(6)),i=a(n(13)),o=a(n(18)),u=a(n(1));function a(t){return t&&t.__esModule?t:{default:t}}var l={ComponentClip:r.default,UIComponents:i.default,Plugin:o.default,UIManager:u.default};t.exports=l,e.PhaserComps=l}).call(this,n(5))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=p(n(3)),i=p(n(14)),o=p(n(0)),u=p(n(7)),a=p(n(8)),l=p(n(9)),s=p(n(15)),c=p(n(16)),f=p(n(17));function p(t){return t&&t.__esModule?t:{default:t}}var h={UIComponentPrototype:o.default,UIButton:r.default,UIButtonSelect:u.default,UIButtonRadio:i.default,UIButtonDraggable:a.default,UIScrollBar:l.default,UIScrollPanel:s.default,UIProgressBar:c.default,UIContainer:f.default};e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(7),u=(r=o)&&r.__esModule?r:{default:r};var a=function(t){function e(t,n,r,i,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var u=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));return u._sibling=u,u._value=i,void 0!==o&&u.appendToRadio(o),u}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,u.default),i(e,null,[{key:"EVENT_SELECT",get:function(){return"event_select"}}]),i(e,[{key:"appendToRadio",value:function(t){this._sibling!==this&&this.removeFromSibling(),this._sibling=t._sibling,t._sibling=this}},{key:"removeFromSibling",value:function(){}},{key:"_onClick",value:function(){this.select=!0}},{key:"_broadcastSelect",value:function(){this.emit("event_select",this.value);for(var t=this._sibling;t!==this;)t.emit("event_select",this._value),t=t._sibling}},{key:"select",get:function(){return function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",this)},set:function(t){if(this._select!==t&&(function t(e,n,r,i){var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var u=Object.getPrototypeOf(e);null!==u&&t(u,n,r,i)}else if("value"in o&&o.writable)o.value=r;else{var a=o.set;void 0!==a&&a.call(i,r)}return r}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",t,this),t)){for(var n=this._sibling;n!==this;)n.select=!1,n=n._sibling;this._broadcastSelect()}}},{key:"value",get:function(){return this._value},set:function(t){this._value=t}},{key:"valueSelected",get:function(){if(this.select)return this.value;for(var t=this._sibling;t!==this;){if(t.select)return t.value;t=t._sibling}return null},set:function(t){if(this.value!==t){for(var e=this._sibling;e!==this;)if(e.value===t)return void(e.select=!0)}else this.select=!0}}]),e}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=u(n(0)),o=u(n(9));function u(t){return t&&t.__esModule?t:{default:t}}var a=function(){function t(e,n,r,u,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._container=e,e.on(i.default.EVENT_STATE,this._onContainerUpdate,this),this._panelKey=n,this._dimensionsKey=u,this._scrollBar=new o.default(e,r,a),this._scrollBar.on(o.default.EVENT_CHANGE,this._onScrollBar,this),this._vertical=a||!1}return r(t,[{key:"_onContainerUpdate",value:function(){var t=this._container._clip;if(t){this._panel=t.getChildClip(this._panelKey);var e=t.getChildClip(this._dimensionsKey);this._panel&&e&&(this._scrollBounds={x:e.x,y:e.y,len:this._vertical?this._panel.height-e.height:this._panel.width-e.width},this._onScrollBar(this._onScrollBar.value))}}},{key:"_onScrollBar",value:function(t){this._panel&&this._scrollBounds&&(this._vertical?this._panel.y=this._scrollBounds.y-this._scrollBounds.len*t:this._panel.x=this._scrollBounds.x-this._scrollBounds.len*t)}}]),t}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),u=(r=o)&&r.__esModule?r:{default:r},a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(4));var l=/progress_(\d+)$/,s=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._value=0,r._steps=[],r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,u.default),i(e,[{key:"onClipAppend",value:function(t){(function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._makeSteps(t),this._applyValue()}},{key:"_applyValue",value:function(){if(this._clip){var t=void 0,e=void 0,n=void 0,r=void 0,i=void 0,o=void 0,u=this._steps.length;for(t=0;t<u-1;t++){var a=this._steps[t],l=this._steps[t+1];if(a.stepValue===this._value){i=a.config;break}if(l.stepValue===this._value){i=l.config;break}if(this._value>a.stepValue&&this._value<l.stepValue){e=a.config,n=l.config,r=(this._value-a.stepValue)/(l.stepValue-a.stepValue);break}}if(!i)for(o in i={},e)if(n.hasOwnProperty(o)){var s=e[o],c=n[o];i[o]={x:s.x+(c.x-s.x)*r,y:s.y+(c.y-s.y)*r,scaleX:s.scaleX+(c.scaleX-s.scaleX)*r,scaleY:s.scaleY+(c.scaleY-s.scaleY)*r,angle:s.angle+(c.angle-s.angle)*r,alpha:s.alpha+(c.alpha-s.alpha)*r}}for(o in i)this._clip.applyChildParams(o,i[o])}}},{key:"_makeSteps",value:function(t){var n=this,r=t.getStateIds();this._steps=[],a.each(r,function(r){if(l.test(r)){var i={},o={stepValue:parseInt(l.exec(r)[1])/100,config:i},u=t.getStateConfig(r);for(var a in u)i[a]=e._makeFullConfig(u[a]);n._steps.push(o)}},this),a.sortBy(this._steps,"stepValue")}},{key:"value",get:function(){return this._value},set:function(t){this._value=t,this._applyValue()}}],[{key:"_makeFullConfig",value:function(t){return{x:t.hasOwnProperty("x")?t.x:0,y:t.hasOwnProperty("y")?t.y:0,scaleX:t.hasOwnProperty("scaleX")?t.scaleX:1,scaleY:t.hasOwnProperty("scaleY")?t.scaleY:1,angle:t.hasOwnProperty("angle")?t.angle:0,alpha:t.hasOwnProperty("alpha")?t.alpha:1}}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},o=a(n(0)),u=(a(n(2)),a(n(4)));function a(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._children=[],r._containerClip=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),r(e,[{key:"addChild",value:function(t){return-1!==this._children.indexOf(t)?t:(this._children.push(t),this._containerClip?this._addUIComponentToContainerClip(t):t._clip.groupVisible=!1,t)}},{key:"removeChild",value:function(t){var e=this._children.indexOf(t);return-1===e?t:(this._children.splice(e,1),this._containerClip&&this._removeUIComponentFromContainerClip(t),t)}},{key:"_addUIComponentToContainerClip",value:function(t){var e=this;u.default.each(t._clip.childrenList,function(t){e._containerClip.add(t)},this),t._clip.groupVisible=!0}},{key:"_removeUIComponentFromContainerClip",value:function(t,e){var n=this;u.default.each(t._clip.childrenList,function(t){n._containerClip.remove(t,e)},this),t._clip.groupVisible=!1}},{key:"onClipAppend",value:function(t){var n=this;i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._containerClip=t._container,this._containerClip&&u.default.each(this._children,function(t){n._addUIComponentToContainerClip(t)},this)}},{key:"onClipRemove",value:function(t){var n=this;i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipRemove",this).call(this,t),this._containerClip&&u.default.each(this._children,function(t){n._removeUIComponentFromContainerClip(t)},this)}},{key:"destroy",value:function(){var t=this;u.default.each(this._children,function(e){t._containerClip&&t._removeUIComponentFromContainerClip(e),e.destroy()},this),this._children.length=0,i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=u(n(2)),o=u(n(6));function u(t){return t&&t.__esModule?t:{default:t}}var a=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return t.registerGameObject("ui_component",n.addComponent,n.addComponent),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i.default.Plugins.BasePlugin),r(e,[{key:"addComponent",value:function(t,e){return new o.default(this.scene,t,e)}}]),e}();e.default=a;var l={key:"UIComponents",plugin:a,start:!0};a.DefaultCfg=l}])}); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("phaser"),require("underscore")):"function"==typeof define&&define.amd?define(["phaser","underscore"],e):"object"==typeof exports?exports.PhaserComps=e(require("phaser"),require("underscore")):t.PhaserComps=e(t.Phaser,t._)}(window,function(t,e){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=8)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),a=(i=o)&&i.__esModule?i:{default:i};var s="event_state",u=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i._parent=t,i._key=n,i._clip=null,i._texts={},n&&t&&t.on(s,i._onEventState,i),i._clipUpdate(),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default.Events.EventEmitter),r(e,null,[{key:"EVENT_STATE",get:function(){return s}}]),r(e,[{key:"appendClip",value:function(t){this._clip!==t&&(null!==this._clip&&this.removeClip(),this._clip=t,this._clip&&this.onClipAppend(this._clip),this._clipProcess())}},{key:"onClipAppend",value:function(t){}},{key:"removeClip",value:function(){this.onClipRemove(this._clip),this._clip=null}},{key:"onClipRemove",value:function(t){}},{key:"doState",value:function(){var t=this.getStateId();this._setupState(t)}},{key:"getText",value:function(t){return this._texts[t]}},{key:"setText",value:function(t,e){if(this._texts[t]!==e&&(this._texts[t]=e,this._clip)){var n=this._clip.getChildText(t);n&&(n.text=e)}}},{key:"getStateId",value:function(){return"default"}},{key:"destroy",value:function(){this._parent&&this._parent.removeListener(s,this._onEventState),this._clip&&this._clip.destroy()}},{key:"_clipUpdate",value:function(){if(this._key)if(this._parent._clip){var t=this._parent._clip.getChildClip(this._key);this.appendClip(t)}else this.appendClip(null);else;}},{key:"_clipProcess",value:function(){this._clip&&(this.doState(),this.onClipProcess())}},{key:"onClipProcess",value:function(){}},{key:"_setupState",value:function(t){if(this._clip)for(var e in this._clip.setState(t),this._texts){var n=this._clip.getChildText(e);n&&(n.text=this._texts[e])}this.emit(s)}},{key:"_onEventState",value:function(){this._clipUpdate()}}]),e}();e.default=u},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(0),a=(i=o)&&i.__esModule?i:{default:i};var s=function(t){function e(t,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._enable=!0,r._isPressed=!1,r._isOver=!1,i&&(r.label=i),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default),r(e,null,[{key:"EVENT_CLICK",get:function(){return"event_click"}}]),r(e,[{key:"onClipAppend",value:function(t){this._updateInteractive()}},{key:"onClipRemove",value:function(t){var e=t.getChildClip("HIT_ZONE");e&&this._removeInteractive(e)}},{key:"_setupInteractive",value:function(t){t.setInteractive({useHandCursor:!0}),t.on("pointerdown",this._onPointerDown,this),t.on("pointerup",this._onPointerUp,this),t.on("pointerover",this._onPointerOver,this),t.on("pointerout",this._onPointerOut,this)}},{key:"_removeInteractive",value:function(t){t.disableInteractive(),t.removeListener("pointerdown",this._onPointerDown,this),t.removeListener("pointerup",this._onPointerUp,this),t.removeListener("pointerover",this._onPointerOver,this),t.removeListener("pointerout",this._onPointerOut,this)}},{key:"_updateInteractive",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&(this.enable?this._setupInteractive(t):this._removeInteractive(t))}}},{key:"getStateId",value:function(){return this.enable?this._isPressed?this.STATE_DOWN:this._isOver?this.STATE_OVER:this.STATE_UP:this.STATE_DISABLE}},{key:"_onClick",value:function(){this.emit("event_click")}},{key:"_onPointerOut",value:function(){this._isOver=!1,this._isPressed=!1,this.doState()}},{key:"_onPointerOver",value:function(){this._isOver=!0,this.doState()}},{key:"_onPointerDown",value:function(){this._isPressed=!0,this.doState()}},{key:"_onPointerUp",value:function(){var t=this._isPressed&&this._isOver;this._isPressed=!1,this.doState(),t&&this._onClick()}},{key:"destroy",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&this._removeInteractive(t)}(function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"label",get:function(){return this.getText("label")},set:function(t){this.setText("label",t)}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(this._enable=t,this._updateInteractive(),this.doState())}},{key:"STATE_UP",get:function(){return"up"}},{key:"STATE_DOWN",get:function(){return"down"}},{key:"STATE_OVER",get:function(){return"over"}},{key:"STATE_DISABLE",get:function(){return"disable"}}]),e}();e.default=s},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(1)),o=a(n(3));function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var u=function(){function t(e,n,i,r){s(this,t),this.scene=e,this.childrenList=[],this._groupConfig={x:0,y:0,scaleX:1,scaleY:1,angle:0,alpha:1,visible:!0},this._x=0,this._y=0,this._scaleX=1,this._scaleY=1,this._angle=0,this._angle=0,this._alpha=1,this._visible=!0,this._isChildComponent=r||!1,this._isChildComponent&&(this._container=e.add.container(0,0),this.childrenList.push(this._container)),this._config=n,this._key=n.key,this._textures=i,this.imageFramesMap={},this._stateManager=new c(this,n),this._childrenById={},this._createImagesMap(i),this._parseConfig()}return i(t,[{key:"setMask",value:function(t){o.default.each(this.childrenList,function(e){e.setMask(t)},this)}},{key:"getStateConfig",value:function(t){return this._stateManager.getStateConfigById(t)}},{key:"getStateIds",value:function(){return this._stateManager.stateIds}},{key:"setState",value:function(t,e){this._stateManager.setState(t,e)}},{key:"applyChildParams",value:function(e,n){this._childrenById.hasOwnProperty(e)&&t._setupCommonParams(this._childrenById[e],n,this._groupConfig)}},{key:"getChildClip",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"getChildText",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"destroy",value:function(){o.default.each(this.childrenList,function(t){t.destroy()},this)}},{key:"_createImagesMap",value:function(t){var e=this;o.default.each(t,function(t){var n=e.scene.textures.get(t);if(n){var i=n.getFrameNames();o.default.each(i,function(n){e.imageFramesMap[n]=t},e)}},this)}},{key:"_parseConfig",value:function(){var t=this;this._config.hasOwnProperty("children")&&o.default.each(this._config.children,function(e){t._createChildFromConfig(e)},this)}},{key:"_createChildFromConfig",value:function(e){var n=this,i=null,r=null,a=e.childId,s=e.key;if("image"===e.type?i=this._createImageFromConfig(e):"text"===e.type?i=this._createTextFromConfig(e):"tileSprite"===e.type?i=this._createTileSpriteFromConfig(e):"component"===e.type?(i=new t(this.scene,e,this._textures,!0),t._setupCommonParams(i,e),r=i._container):"zone"===e.type?i=this._createHitZoneFromConfig(e):"polygon"===e.type&&(i=this._createPolygonFromConfig(e)),null!==i){if(null===r&&(r=i),this._childrenById[a]=i,e.hasOwnProperty("masking")){var u=i.createGeometryMask();o.default.each(e.masking,function(t){n._childrenById[t].setMask(u)},this)}this._isChildComponent?this._container.add(r):this.childrenList.push(i),this._stateManager.addComponent(i,a,s)}}},{key:"_createPolygonFromConfig",value:function(e){var n=this.scene.make.graphics();n.fillStyle(e.color,e.hasOwnProperty("alpha")?e.alpha:1),n.beginPath();for(var i=e.vertices,r=i.length,o=0;o<r;o+=2)n.lineTo(i[o],i[o+1]);return n.closePath(),n.fillPath(),t._setupCommonParams(n,e),e.hasOwnProperty("masking")||this.scene.add.existing(n),n}},{key:"_createTileSpriteFromConfig",value:function(e){var n=this.scene.add.tileSprite(0,0,e.width,e.height,this.imageFramesMap[e.image],e.image);return n.setOrigin(.5,.5),t._setupCommonParams(n,e),n}},{key:"_createImageFromConfig",value:function(e){var n=this.scene.add.image(0,0,this.imageFramesMap[e.image],e.image);return n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createTextFromConfig",value:function(e){var n=this.scene.add.text(0,0,e.text,e.textStyle);return"center"===e.textStyle.align?n.setOrigin(.5,0):"right"===e.textStyle.align?n.setOrigin(1,0):n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createHitZoneFromConfig",value:function(t){return this.scene.add.zone(t.x||0,t.y||0,t.width,t.height).setOrigin(0)}},{key:"groupX",get:function(){return this._groupConfig.x},set:function(t){if(this._groupConfig.x!==t){var e=t-this._groupConfig.x;this._groupConfig.x=t,this.x+=e}}},{key:"groupY",get:function(){return this._groupConfig.y},set:function(t){if(this._groupConfig.y!==t){var e=t-this._groupConfig.y;this._groupConfig.y=t,this.y+=e}}},{key:"groupScaleX",get:function(){return this._groupConfig.scaleX},set:function(t){if(this._groupConfig.scaleX!==t){var e=t/this._groupConfig.scaleX;this._groupConfig.scaleX=t,this.scaleX*=e}}},{key:"groupScaleY",get:function(){return this._groupConfig.scaleY},set:function(t){if(this._groupConfig.scaleY!==t){var e=t/this._groupConfig.scaleY;this._groupConfig.scaleY=t,this.scaleY*=e}}},{key:"groupAlpha",get:function(){return this._groupConfig.alpha},set:function(t){if(this._groupConfig.alpha!==t){var e=t/this._groupConfig.alpha;this._groupConfig.alpha=t,this.alpha*=e}}},{key:"groupVisible",get:function(){return this._groupConfig.visible},set:function(t){this._groupConfig.visible!==t&&(this._groupConfig.visible=t,this._stateManager.setupState())}},{key:"x",get:function(){return this._x},set:function(t){var e=t-this.x;r.default.Actions.IncX(this.childrenList,e),this._x=t}},{key:"y",get:function(){return this._y},set:function(t){var e=t-this.y;r.default.Actions.IncY(this.childrenList,e),this._y=t}},{key:"visible",get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,r.default.Actions.SetVisible(this.childrenList,t))}},{key:"alpha",get:function(){return this._alpha},set:function(t){this._alpha!==t&&(this._alpha=t,r.default.Actions.SetAlpha(this.childrenList,t))}},{key:"scaleX",get:function(){return this._scaleX},set:function(t){this._scaleX!==t&&(this._scaleX=t,r.default.Actions.SetScaleX(this.childrenList,t))}},{key:"scaleY",get:function(){return this._scaleY},set:function(t){this._scaleY!==t&&(this._scaleY=t,r.default.Actions.SetScaleY(this.childrenList,t))}},{key:"angle",get:function(){return this._angle},set:function(t){this._angle!==t&&r.default.Actions.PropertyValueSet(this.childrenList,"angle",t)}}],[{key:"_setupCommonParams",value:function(t,e,n){var i=e.x||0,r=e.y||0,o=e.scaleX||1,a=e.scaleY||1,s=e.angle||0,u=e.hasOwnProperty("alpha")?e.alpha:1;n&&(i+=n.x,r+=n.y,o*=n.scaleX,a*=n.scaleY,s+=n.angle,u*=n.alpha),t.x=i,t.y=r,t.scaleX=o,t.scaleY=a,t.angle=s,t.alpha=u}}]),t}();e.default=u;var l=function t(e){s(this,t),this.config=e,this.componentIds=[],this.componentIds=Object.keys(e)},c=function(){function t(e,n){s(this,t),this._clip=e,this._dynamicChildrenIds=[],this._states={},this.stateIds=[],this._components={},this._currentState=null,this._currentStateId=null,this._componentKeys={},this._residentComponentsByKey={};var i=[];for(var r in n.states){this.stateIds.push(r);var a=new l(n.states[r]);this._states[r]=a,i.push(a.componentIds)}this._dynamicChildrenIds=o.default.uniq(o.default.flatten(i))}return i(t,[{key:"getStateConfigById",value:function(t){return this._states.hasOwnProperty(t)?this._states[t].config:null}},{key:"addComponent",value:function(t,e,n){-1===o.default.indexOf(this._dynamicChildrenIds,e)?void 0!==n&&(this._residentComponentsByKey[n]=t):(this._components[e]=t,void 0!==n&&(this._componentKeys[e]=n))}},{key:"setState",value:function(t,e){(this._currentStateId!==t||e)&&this._states.hasOwnProperty(t)&&(this._currentStateId=t,this._currentState=this._states[t],this.setupState())}},{key:"getActiveComponentByKey",value:function(t){if(this._residentComponentsByKey.hasOwnProperty(t))return this._residentComponentsByKey[t];if(null===this._currentState)return null;for(var e in this._currentState.componentIds){var n=this._currentState.componentIds[e];if(this._componentKeys[n]===t)return this._components[n]}return null}},{key:"setupState",value:function(){var t=this,e=this._currentState.componentIds,n=o.default.difference(this._dynamicChildrenIds,e);o.default.each(n,function(e){t._components[e].visible=!1},this),o.default.each(e,function(e){var n=t._components[e];n.visible=t._clip._groupConfig.visible,u._setupCommonParams(n,t._currentState.config[e],t._clip._groupConfig)},this)}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},a=n(2),s=(i=a)&&i.__esModule?i:{default:i};var u=function(t){function e(t,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));return r._select=!1,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,s.default),r(e,[{key:"getStateId",value:function(){return o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"getStateId",this).call(this)+(this._select?"_select":"")}},{key:"_onClick",value:function(){this._select=!this._select,this.doState(),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_onClick",this).call(this)}},{key:"select",get:function(){return this._select},set:function(t){this._select!==t&&(this._select=t,this.doState())}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},o=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(2),s=(i=a)&&i.__esModule?i:{default:i};var u=function(t){function e(t,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));return r._dragBounds={minX:0,maxX:0,minY:0,maxY:0},r._startDragX=0,r._startDragY=0,r._dragZone=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,s.default),o(e,null,[{key:"EVENT_DRAG",get:function(){return"event_drag"}}]),o(e,[{key:"setDragBounds",value:function(t,e,n,i){this._dragBounds.minX=t,this._dragBounds.maxX=n,this._dragBounds.minY=e,this._dragBounds.maxY=i}},{key:"_onDragStart",value:function(t,e){this._dragZone&&this._dragZone===e&&this._clip&&(this._startDragX=this._clip.x-e.input.dragStartX,this._startDragY=this._clip.y-e.input.dragStartY)}},{key:"_onDrag",value:function(t,e,n,i){if(this._dragZone&&this._dragZone===e&&!this.clip){var r=this._startDragX+n,o=this._startDragY+i;r<this._dragBounds.minX?r=this._dragBounds.minX:r>this._dragBounds.maxX&&(r=this._dragBounds.maxX),o<this._dragBounds.minY?o=this._dragBounds.minY:o>this._dragBounds.maxY&&(o=this._dragBounds.maxY),this.emit("event_drag",r,o)}}},{key:"_setupInteractive",value:function(t){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_setupInteractive",this).call(this,t),this._dragZone=t,t.scene.input.setDraggable(t,!0),t.scene.input.on("dragstart",this._onDragStart,this),t.scene.input.on("drag",this._onDrag,this)}},{key:"_removeInteractive",value:function(t){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_removeInteractive",this).call(this,t),this._dragZone=null,t.scene.input.setDraggable(t,!1),t.scene.input.removeListener("dragstart",this._onDragStart),t.scene.input.removeListener("drag",this._onDrag)}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},r=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=u(n(0)),a=u(n(2)),s=u(n(6));function u(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function e(t,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._vertical=i||!1,r._value=0,r._minValue=0,r._maxValue=1,r._valueStep=0,r._buttonStep=.1,r.btnPrev=new a.default(r,"btn_up"),r.btnPrev.on(a.default.EVENT_CLICK,r.onPrevClick,r),r.btnNext=new a.default(r,"btn_down"),r.btnNext.on(a.default.EVENT_CLICK,r.onNextClick,r),r.thumb=new s.default(r,"thumb"),r.thumb.on(s.default.EVENT_DRAG,r._onThumbDrag,r),r._trackStart=0,r._trackLength=100,r._thumbClip=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),r(e,null,[{key:"EVENT_CHANGE",get:function(){return"event_change"}}]),r(e,[{key:"setValueBounds",value:function(t,e,n){this._minValue=t,this._maxValue=e,void 0!==n?(this._valueStep=n,this._buttonStep<n&&(this._buttonStep=n)):this._valueStep=0}},{key:"setButtonStep",value:function(t){this._buttonStep=t}},{key:"onClipAppend",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._updateClips()}},{key:"_updateClips",value:function(){if(this._clip){this._thumbClip=this.thumb._clip;var t=this._clip.getChildClip("DIMENSIONS");t&&(this._trackStart=this._vertical?t.y:t.x,this._trackLength=this._vertical?t.height:t.width,this._thumbClip&&this.thumb.setDragBounds(this._vertical?this._thumbClip.x:t.x,this._vertical?t.y:this._thumbClip.y,this._vertical?this._thumbClip.x:t.x+t.width,this._vertical?t.y+t.height:this._thumbClip.y));var e=this._clip.getChildClip("HIT_ZONE");e&&e.on("pointerdown",this._onZoneDown,this),this._updateThumbFromValue()}}},{key:"onClipProcess",value:function(){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipProcess",this).call(this),this.thumb&&this._updateClips()}},{key:"onPrevClick",value:function(){this.value-=this._buttonStep}},{key:"onNextClick",value:function(){this.value+=this._buttonStep}},{key:"_updateThumbFromValue",value:function(){if(this._thumbClip){var t=Math.round(this._trackStart+this._trackLength*this._value);this._vertical?this._thumbClip.y=t:this._thumbClip.x=t,this.emit("event_change",this.value)}}},{key:"_onThumbDrag",value:function(t,e){if(0!==this._trackLength){var n=((this._vertical?e:t)-this._trackStart)/this._trackLength*(this._maxValue-this._minValue);0!==this._valueStep&&(n=Math.round(n/this._valueStep)*this._valueStep),this.value=n+this._minValue}}},{key:"_onZoneDown",value:function(){}},{key:"value",get:function(){var t=this._value*(this._maxValue-this._minValue);return 0===this._valueStep?t+this._minValue:(t=Math.round(t/this._valueStep)*this._valueStep)+this._minValue},set:function(t){var e=(t-this._minValue)/(this._maxValue-this._minValue);e<0&&(e=0),e>1&&(e=1),e!==this._value&&(this._value=e,this._updateThumbFromValue())}}]),e}();e.default=l},function(t,e,n){t.exports=n(9)},function(t,e,n){"use strict";(function(e){var i=a(n(4)),r=a(n(11)),o=a(n(16));function a(t){return t&&t.__esModule?t:{default:t}}var s={ComponentClip:i.default,UIComponents:r.default,Plugin:o.default};t.exports=s,e.PhaserComps=s}).call(this,n(10))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=p(n(2)),r=p(n(12)),o=p(n(0)),a=p(n(5)),s=p(n(6)),u=p(n(7)),l=p(n(13)),c=p(n(14)),h=p(n(15));function p(t){return t&&t.__esModule?t:{default:t}}var f={UIComponentPrototype:o.default,UIButton:i.default,UIButtonSelect:a.default,UIButtonRadio:r.default,UIButtonDraggable:s.default,UIScrollBar:u.default,UIScrollPanel:l.default,UIProgressBar:c.default,UIContainer:h.default};e.default=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(5),a=(i=o)&&i.__esModule?i:{default:i};var s=function(t){function e(t,n,i,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var a=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));return a._sibling=a,a._value=r,void 0!==o&&a.appendToRadio(o),a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default),r(e,null,[{key:"EVENT_SELECT",get:function(){return"event_select"}}]),r(e,[{key:"appendToRadio",value:function(t){this._sibling!==this&&this.removeFromSibling(),this._sibling=t._sibling,t._sibling=this}},{key:"removeFromSibling",value:function(){}},{key:"_onClick",value:function(){this.select=!0}},{key:"_broadcastSelect",value:function(){this.emit("event_select",this.value);for(var t=this._sibling;t!==this;)t.emit("event_select",this._value),t=t._sibling}},{key:"select",get:function(){return function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",this)},set:function(t){if(this._select!==t&&(function t(e,n,i,r){var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var a=Object.getPrototypeOf(e);null!==a&&t(a,n,i,r)}else if("value"in o&&o.writable)o.value=i;else{var s=o.set;void 0!==s&&s.call(r,i)}return i}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",t,this),t)){for(var n=this._sibling;n!==this;)n.select=!1,n=n._sibling;this._broadcastSelect()}}},{key:"value",get:function(){return this._value},set:function(t){this._value=t}},{key:"valueSelected",get:function(){if(this.select)return this.value;for(var t=this._sibling;t!==this;){if(t.select)return t.value;t=t._sibling}return null},set:function(t){if(this.value!==t){for(var e=this._sibling;e!==this;)if(e.value===t)return void(e.select=!0)}else this.select=!0}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(0)),o=a(n(7));function a(t){return t&&t.__esModule?t:{default:t}}var s=function(){function t(e,n,i,a,s){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._container=e,e.on(r.default.EVENT_STATE,this._onContainerUpdate,this),this._panelKey=n,this._dimensionsKey=a,this._scrollBar=new o.default(e,i,s),this._scrollBar.on(o.default.EVENT_CHANGE,this._onScrollBar,this),this._vertical=s||!1}return i(t,[{key:"_onContainerUpdate",value:function(){var t=this._container._clip;if(t){this._panel=t.getChildClip(this._panelKey);var e=t.getChildClip(this._dimensionsKey);this._panel&&e&&(this._scrollBounds={x:e.x,y:e.y,len:this._vertical?this._panel.height-e.height:this._panel.width-e.width},this._onScrollBar(this._onScrollBar.value))}}},{key:"_onScrollBar",value:function(t){this._panel&&this._scrollBounds&&(this._vertical?this._panel.y=this._scrollBounds.y-this._scrollBounds.len*t:this._panel.x=this._scrollBounds.x-this._scrollBounds.len*t)}}]),t}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(0),a=(i=o)&&i.__esModule?i:{default:i},s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(3));var u=/progress_(\d+)$/,l=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._value=0,i._steps=[],i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default),r(e,[{key:"onClipAppend",value:function(t){(function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._makeSteps(t),this._applyValue()}},{key:"_applyValue",value:function(){if(this._clip){var t=void 0,e=void 0,n=void 0,i=void 0,r=void 0,o=void 0,a=this._steps.length;for(t=0;t<a-1;t++){var s=this._steps[t],u=this._steps[t+1];if(s.stepValue===this._value){r=s.config;break}if(u.stepValue===this._value){r=u.config;break}if(this._value>s.stepValue&&this._value<u.stepValue){e=s.config,n=u.config,i=(this._value-s.stepValue)/(u.stepValue-s.stepValue);break}}if(!r)for(o in r={},e)if(n.hasOwnProperty(o)){var l=e[o],c=n[o];r[o]={x:l.x+(c.x-l.x)*i,y:l.y+(c.y-l.y)*i,scaleX:l.scaleX+(c.scaleX-l.scaleX)*i,scaleY:l.scaleY+(c.scaleY-l.scaleY)*i,angle:l.angle+(c.angle-l.angle)*i,alpha:l.alpha+(c.alpha-l.alpha)*i}}for(o in r)this._clip.applyChildParams(o,r[o])}}},{key:"_makeSteps",value:function(t){var n=this,i=t.getStateIds();this._steps=[],s.each(i,function(i){if(u.test(i)){var r={},o={stepValue:parseInt(u.exec(i)[1])/100,config:r},a=t.getStateConfig(i);for(var s in a)r[s]=e._makeFullConfig(a[s]);n._steps.push(o)}},this),s.sortBy(this._steps,"stepValue")}},{key:"value",get:function(){return this._value},set:function(t){this._value=t,this._applyValue()}}],[{key:"_makeFullConfig",value:function(t){return{x:t.hasOwnProperty("x")?t.x:0,y:t.hasOwnProperty("y")?t.y:0,scaleX:t.hasOwnProperty("scaleX")?t.scaleX:1,scaleY:t.hasOwnProperty("scaleY")?t.scaleY:1,angle:t.hasOwnProperty("angle")?t.angle:0,alpha:t.hasOwnProperty("alpha")?t.alpha:1}}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},o=s(n(0)),a=(s(n(1)),s(n(3)));function s(t){return t&&t.__esModule?t:{default:t}}var u=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._children=[],i._containerClip=null,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),i(e,[{key:"addChild",value:function(t){return-1!==this._children.indexOf(t)?t:(this._children.push(t),this._containerClip?this._addUIComponentToContainerClip(t):t._clip.groupVisible=!1,t)}},{key:"removeChild",value:function(t){var e=this._children.indexOf(t);return-1===e?t:(this._children.splice(e,1),this._containerClip&&this._removeUIComponentFromContainerClip(t),t)}},{key:"_addUIComponentToContainerClip",value:function(t){var e=this;a.default.each(t._clip.childrenList,function(t){e._containerClip.add(t)},this),t._clip.groupVisible=!0}},{key:"_removeUIComponentFromContainerClip",value:function(t,e){var n=this;a.default.each(t._clip.childrenList,function(t){n._containerClip.remove(t,e)},this),t._clip.groupVisible=!1}},{key:"onClipAppend",value:function(t){var n=this;r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._containerClip=t._container,this._containerClip&&a.default.each(this._children,function(t){n._addUIComponentToContainerClip(t)},this)}},{key:"onClipRemove",value:function(t){var n=this;r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipRemove",this).call(this,t),this._containerClip&&a.default.each(this._children,function(t){n._removeUIComponentFromContainerClip(t)},this)}},{key:"destroy",value:function(){var t=this;a.default.each(this._children,function(e){t._containerClip&&t._removeUIComponentFromContainerClip(e),e.destroy()},this),this._children.length=0,r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(1)),o=a(n(4));function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return t.registerGameObject("ui_component",n.addComponent,n.addComponent),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.default.Plugins.BasePlugin),i(e,[{key:"addComponent",value:function(t,e){return new o.default(this.scene,t,e)}}]),e}();e.default=s;var u={key:"UIComponents",plugin:s,start:!0};s.DefaultCfg=u}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("phaser"),require("underscore")):"function"==typeof define&&define.amd?define(["phaser","underscore"],e):"object"==typeof exports?exports.PhaserComps=e(require("phaser"),require("underscore")):t.PhaserComps=e(t.Phaser,t._)}(window,function(t,e){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=9)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=o(n(2));o(n(1));function o(t){return t&&t.__esModule?t:{default:t}}var a="event_state",s=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.lockId=null,i._parent=t,i._key=n,i._clip=null,i._texts={},n&&t&&t.on(a,i._onEventState,i),i._clipUpdate(),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.default.Events.EventEmitter),i(e,null,[{key:"EVENT_STATE",get:function(){return a}}]),i(e,[{key:"appendClip",value:function(t){this._clip!==t&&(null!==this._clip&&this.removeClip(),this._clip=t,this._clip&&this.onClipAppend(this._clip),this._clipProcess())}},{key:"onClipAppend",value:function(t){}},{key:"removeClip",value:function(){this.onClipRemove(this._clip),this._clip=null}},{key:"onClipRemove",value:function(t){}},{key:"doState",value:function(){var t=this.getStateId();this._setupState(t)}},{key:"getText",value:function(t){return this._texts[t]}},{key:"setText",value:function(t,e){if(this._texts[t]!==e&&(this._texts[t]=e,this._clip)){var n=this._clip.getChildText(t);n&&(n.text=e)}}},{key:"getStateId",value:function(){return"default"}},{key:"destroy",value:function(){this._parent&&this._parent.removeListener(a,this._onEventState),this._clip&&this._clip.destroy()}},{key:"_clipUpdate",value:function(){if(this._key)if(this._parent._clip){var t=this._parent._clip.getChildClip(this._key);this.appendClip(t)}else this.appendClip(null);else;}},{key:"_clipProcess",value:function(){this._clip&&(this.doState(),this.onClipProcess())}},{key:"onClipProcess",value:function(){}},{key:"_setupState",value:function(t){if(this._clip)for(var e in this._clip.setState(t),this._texts){var n=this._clip.getChildText(e);n&&(n.text=this._texts[e])}this.emit(a)}},{key:"_onEventState",value:function(){this._clipUpdate()}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();var r=!1,o=[],a=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,null,[{key:"lock",value:function(t){this.unlock(),"string"==typeof t?o.push(t):t.forEach(function(t){return o.push(t)}),r=!0}},{key:"unlock",value:function(){o.length=0,r=!1}},{key:"check",value:function(t){return!r||-1!==o.indexOf(t)}}]),t}();e.default=a},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(0)),o=a(n(1));function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t){function e(t,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._enable=!0,r._isPressed=!1,r._isOver=!1,i&&(r.label=i),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.default),i(e,null,[{key:"EVENT_CLICK",get:function(){return"event_click"}}]),i(e,[{key:"onClipAppend",value:function(t){this._updateInteractive()}},{key:"onClipRemove",value:function(t){var e=t.getChildClip("HIT_ZONE");e&&this._removeInteractive(e)}},{key:"_setupInteractive",value:function(t){t.setInteractive({useHandCursor:!0}),t.on("pointerdown",this._onPointerDown,this),t.on("pointerup",this._onPointerUp,this),t.on("pointerover",this._onPointerOver,this),t.on("pointerout",this._onPointerOut,this)}},{key:"_removeInteractive",value:function(t){t.disableInteractive(),t.removeListener("pointerdown",this._onPointerDown,this),t.removeListener("pointerup",this._onPointerUp,this),t.removeListener("pointerover",this._onPointerOver,this),t.removeListener("pointerout",this._onPointerOut,this)}},{key:"_updateInteractive",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&(this.enable?this._setupInteractive(t):this._removeInteractive(t))}}},{key:"getStateId",value:function(){return this.enable?this._isPressed?this.STATE_DOWN:this._isOver?this.STATE_OVER:this.STATE_UP:this.STATE_DISABLE}},{key:"_onClick",value:function(){this.emit("event_click")}},{key:"_onPointerOut",value:function(){this._isOver=!1,this._isPressed=!1,this.doState()}},{key:"_onPointerOver",value:function(){this._isOver=!0,this.doState()}},{key:"_onPointerDown",value:function(){this._isPressed=!0,this.doState()}},{key:"_onPointerUp",value:function(){var t=this._isPressed&&this._isOver;this._isPressed=!1,this.doState(),t&&o.default.check(this.lockId)&&this._onClick()}},{key:"destroy",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&this._removeInteractive(t)}(function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"label",get:function(){return this.getText("label")},set:function(t){this.setText("label",t)}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(this._enable=t,this._updateInteractive(),this.doState())}},{key:"STATE_UP",get:function(){return"up"}},{key:"STATE_DOWN",get:function(){return"down"}},{key:"STATE_OVER",get:function(){return"over"}},{key:"STATE_DISABLE",get:function(){return"disable"}}]),e}();e.default=s},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(2)),o=a(n(4));function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var u=function(){function t(e,n,i,r){s(this,t),this.scene=e,this.childrenList=[],this._groupConfig={x:0,y:0,scaleX:1,scaleY:1,angle:0,alpha:1,visible:!0},this._x=0,this._y=0,this._scaleX=1,this._scaleY=1,this._angle=0,this._angle=0,this._alpha=1,this._visible=!0,this._isChildComponent=r||!1,this._isChildComponent&&(this._container=e.add.container(0,0),this.childrenList.push(this._container)),this._config=n,this._key=n.key,this._textures=i,this.imageFramesMap={},this._stateManager=new c(this,n),this._childrenById={},this._createImagesMap(i),this._parseConfig()}return i(t,[{key:"setMask",value:function(t){o.default.each(this.childrenList,function(e){e.setMask(t)},this)}},{key:"getStateConfig",value:function(t){return this._stateManager.getStateConfigById(t)}},{key:"getStateIds",value:function(){return this._stateManager.stateIds}},{key:"setState",value:function(t,e){this._stateManager.setState(t,e)}},{key:"applyChildParams",value:function(e,n){this._childrenById.hasOwnProperty(e)&&t._setupCommonParams(this._childrenById[e],n,this._groupConfig)}},{key:"getChildClip",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"getChildText",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"destroy",value:function(){o.default.each(this.childrenList,function(t){t.destroy()},this)}},{key:"_createImagesMap",value:function(t){var e=this;o.default.each(t,function(t){var n=e.scene.textures.get(t);if(n){var i=n.getFrameNames();o.default.each(i,function(n){e.imageFramesMap[n]=t},e)}},this)}},{key:"_parseConfig",value:function(){var t=this;this._config.hasOwnProperty("children")&&o.default.each(this._config.children,function(e){t._createChildFromConfig(e)},this)}},{key:"_createChildFromConfig",value:function(e){var n=this,i=null,r=null,a=e.childId,s=e.key;if("image"===e.type?i=this._createImageFromConfig(e):"text"===e.type?i=this._createTextFromConfig(e):"tileSprite"===e.type?i=this._createTileSpriteFromConfig(e):"component"===e.type?(i=new t(this.scene,e,this._textures,!0),t._setupCommonParams(i,e),r=i._container):"zone"===e.type?i=this._createHitZoneFromConfig(e):"polygon"===e.type&&(i=this._createPolygonFromConfig(e)),null!==i){if(null===r&&(r=i),this._childrenById[a]=i,e.hasOwnProperty("masking")){var u=i.createGeometryMask();o.default.each(e.masking,function(t){n._childrenById[t].setMask(u)},this)}this._isChildComponent?this._container.add(r):this.childrenList.push(i),this._stateManager.addComponent(i,a,s)}}},{key:"_createPolygonFromConfig",value:function(e){var n=this.scene.make.graphics();n.fillStyle(e.color,e.hasOwnProperty("alpha")?e.alpha:1),n.beginPath();for(var i=e.vertices,r=i.length,o=0;o<r;o+=2)n.lineTo(i[o],i[o+1]);return n.closePath(),n.fillPath(),t._setupCommonParams(n,e),e.hasOwnProperty("masking")||this.scene.add.existing(n),n}},{key:"_createTileSpriteFromConfig",value:function(e){var n=this.scene.add.tileSprite(0,0,e.width,e.height,this.imageFramesMap[e.image],e.image);return n.setOrigin(.5,.5),t._setupCommonParams(n,e),n}},{key:"_createImageFromConfig",value:function(e){var n=this.scene.add.image(0,0,this.imageFramesMap[e.image],e.image);return n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createTextFromConfig",value:function(e){var n=this.scene.add.text(0,0,e.text,e.textStyle);return"center"===e.textStyle.align?n.setOrigin(.5,0):"right"===e.textStyle.align?n.setOrigin(1,0):n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createHitZoneFromConfig",value:function(t){return this.scene.add.zone(t.x||0,t.y||0,t.width,t.height).setOrigin(0)}},{key:"groupX",get:function(){return this._groupConfig.x},set:function(t){if(this._groupConfig.x!==t){var e=t-this._groupConfig.x;this._groupConfig.x=t,this.x+=e}}},{key:"groupY",get:function(){return this._groupConfig.y},set:function(t){if(this._groupConfig.y!==t){var e=t-this._groupConfig.y;this._groupConfig.y=t,this.y+=e}}},{key:"groupScaleX",get:function(){return this._groupConfig.scaleX},set:function(t){if(this._groupConfig.scaleX!==t){var e=t/this._groupConfig.scaleX;this._groupConfig.scaleX=t,this.scaleX*=e}}},{key:"groupScaleY",get:function(){return this._groupConfig.scaleY},set:function(t){if(this._groupConfig.scaleY!==t){var e=t/this._groupConfig.scaleY;this._groupConfig.scaleY=t,this.scaleY*=e}}},{key:"groupAlpha",get:function(){return this._groupConfig.alpha},set:function(t){if(this._groupConfig.alpha!==t){var e=t/this._groupConfig.alpha;this._groupConfig.alpha=t,this.alpha*=e}}},{key:"groupVisible",get:function(){return this._groupConfig.visible},set:function(t){this._groupConfig.visible!==t&&(this._groupConfig.visible=t,this._stateManager.setupState())}},{key:"x",get:function(){return this._x},set:function(t){var e=t-this.x;r.default.Actions.IncX(this.childrenList,e),this._x=t}},{key:"y",get:function(){return this._y},set:function(t){var e=t-this.y;r.default.Actions.IncY(this.childrenList,e),this._y=t}},{key:"visible",get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,r.default.Actions.SetVisible(this.childrenList,t))}},{key:"alpha",get:function(){return this._alpha},set:function(t){this._alpha!==t&&(this._alpha=t,r.default.Actions.SetAlpha(this.childrenList,t))}},{key:"scaleX",get:function(){return this._scaleX},set:function(t){this._scaleX!==t&&(this._scaleX=t,r.default.Actions.SetScaleX(this.childrenList,t))}},{key:"scaleY",get:function(){return this._scaleY},set:function(t){this._scaleY!==t&&(this._scaleY=t,r.default.Actions.SetScaleY(this.childrenList,t))}},{key:"angle",get:function(){return this._angle},set:function(t){this._angle!==t&&r.default.Actions.PropertyValueSet(this.childrenList,"angle",t)}}],[{key:"_setupCommonParams",value:function(t,e,n){var i=e.x||0,r=e.y||0,o=e.scaleX||1,a=e.scaleY||1,s=e.angle||0,u=e.hasOwnProperty("alpha")?e.alpha:1;n&&(i+=n.x,r+=n.y,o*=n.scaleX,a*=n.scaleY,s+=n.angle,u*=n.alpha),t.x=i,t.y=r,t.scaleX=o,t.scaleY=a,t.angle=s,t.alpha=u}}]),t}();e.default=u;var l=function t(e){s(this,t),this.config=e,this.componentIds=[],this.componentIds=Object.keys(e)},c=function(){function t(e,n){s(this,t),this._clip=e,this._dynamicChildrenIds=[],this._states={},this.stateIds=[],this._components={},this._currentState=null,this._currentStateId=null,this._componentKeys={},this._residentComponentsByKey={};var i=[];for(var r in n.states){this.stateIds.push(r);var a=new l(n.states[r]);this._states[r]=a,i.push(a.componentIds)}this._dynamicChildrenIds=o.default.uniq(o.default.flatten(i))}return i(t,[{key:"getStateConfigById",value:function(t){return this._states.hasOwnProperty(t)?this._states[t].config:null}},{key:"addComponent",value:function(t,e,n){-1===o.default.indexOf(this._dynamicChildrenIds,e)?void 0!==n&&(this._residentComponentsByKey[n]=t):(this._components[e]=t,void 0!==n&&(this._componentKeys[e]=n))}},{key:"setState",value:function(t,e){(this._currentStateId!==t||e)&&this._states.hasOwnProperty(t)&&(this._currentStateId=t,this._currentState=this._states[t],this.setupState())}},{key:"getActiveComponentByKey",value:function(t){if(this._residentComponentsByKey.hasOwnProperty(t))return this._residentComponentsByKey[t];if(null===this._currentState)return null;for(var e in this._currentState.componentIds){var n=this._currentState.componentIds[e];if(this._componentKeys[n]===t)return this._components[n]}return null}},{key:"setupState",value:function(){var t=this,e=this._currentState.componentIds,n=o.default.difference(this._dynamicChildrenIds,e);o.default.each(n,function(e){t._components[e].visible=!1},this),o.default.each(e,function(e){var n=t._components[e];n.visible=t._clip._groupConfig.visible,u._setupCommonParams(n,t._currentState.config[e],t._clip._groupConfig)},this)}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},a=n(3),s=(i=a)&&i.__esModule?i:{default:i};var u=function(t){function e(t,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));return r._select=!1,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,s.default),r(e,[{key:"getStateId",value:function(){return o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"getStateId",this).call(this)+(this._select?"_select":"")}},{key:"_onClick",value:function(){this._select=!this._select,this.doState(),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_onClick",this).call(this)}},{key:"select",get:function(){return this._select},set:function(t){this._select!==t&&(this._select=t,this.doState())}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},r=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=s(n(3)),a=s(n(1));function s(t){return t&&t.__esModule?t:{default:t}}var u=function(t){function e(t,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));return r._dragBounds={minX:0,maxX:0,minY:0,maxY:0},r._startDragX=0,r._startDragY=0,r._dragZone=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),r(e,null,[{key:"EVENT_DRAG",get:function(){return"event_drag"}}]),r(e,[{key:"setDragBounds",value:function(t,e,n,i){this._dragBounds.minX=t,this._dragBounds.maxX=n,this._dragBounds.minY=e,this._dragBounds.maxY=i}},{key:"_onDragStart",value:function(t,e){this._dragZone&&this._dragZone===e&&this._clip&&(this._startDragX=this._clip.x-e.input.dragStartX,this._startDragY=this._clip.y-e.input.dragStartY)}},{key:"_onDrag",value:function(t,e,n,i){if(a.default.check(this.lockId)&&this._dragZone&&this._dragZone===e&&!this.clip){var r=this._startDragX+n,o=this._startDragY+i;r<this._dragBounds.minX?r=this._dragBounds.minX:r>this._dragBounds.maxX&&(r=this._dragBounds.maxX),o<this._dragBounds.minY?o=this._dragBounds.minY:o>this._dragBounds.maxY&&(o=this._dragBounds.maxY),this.emit("event_drag",r,o)}}},{key:"_setupInteractive",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_setupInteractive",this).call(this,t),this._dragZone=t,t.scene.input.setDraggable(t,!0),t.scene.input.on("dragstart",this._onDragStart,this),t.scene.input.on("drag",this._onDrag,this)}},{key:"_removeInteractive",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_removeInteractive",this).call(this,t),this._dragZone=null,t.scene.input.setDraggable(t,!1),t.scene.input.removeListener("dragstart",this._onDragStart),t.scene.input.removeListener("drag",this._onDrag)}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},r=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=l(n(0)),a=l(n(3)),s=l(n(7)),u=l(n(1));function l(t){return t&&t.__esModule?t:{default:t}}var c=function(t){function e(t,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._vertical=i||!1,r._value=0,r._minValue=0,r._maxValue=1,r._valueStep=0,r._buttonStep=.1,r.btnPrev=new a.default(r,"btn_up"),r.btnPrev.on(a.default.EVENT_CLICK,r.onPrevClick,r),r.btnNext=new a.default(r,"btn_down"),r.btnNext.on(a.default.EVENT_CLICK,r.onNextClick,r),r.thumb=new s.default(r,"thumb"),r.thumb.on(s.default.EVENT_DRAG,r._onThumbDrag,r),r._trackStart=0,r._trackLength=100,r._thumbClip=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),r(e,null,[{key:"EVENT_CHANGE",get:function(){return"event_change"}}]),r(e,[{key:"setValueBounds",value:function(t,e,n){this._minValue=t,this._maxValue=e,void 0!==n?(this._valueStep=n,this._buttonStep<n&&(this._buttonStep=n)):this._valueStep=0}},{key:"setButtonStep",value:function(t){this._buttonStep=t}},{key:"onClipAppend",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._updateClips()}},{key:"_updateClips",value:function(){if(this._clip){this._thumbClip=this.thumb._clip;var t=this._clip.getChildClip("DIMENSIONS");t&&(this._trackStart=this._vertical?t.y:t.x,this._trackLength=this._vertical?t.height:t.width,this._thumbClip&&this.thumb.setDragBounds(this._vertical?this._thumbClip.x:t.x,this._vertical?t.y:this._thumbClip.y,this._vertical?this._thumbClip.x:t.x+t.width,this._vertical?t.y+t.height:this._thumbClip.y));var e=this._clip.getChildClip("HIT_ZONE");e&&e.on("pointerdown",this._onZoneDown,this),this._updateThumbFromValue()}}},{key:"onClipProcess",value:function(){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipProcess",this).call(this),this.thumb&&this._updateClips()}},{key:"onPrevClick",value:function(){u.default.check(this.lockId)&&(this.value-=this._buttonStep)}},{key:"onNextClick",value:function(){u.default.check(this.lockId)&&(this.value+=this._buttonStep)}},{key:"_updateThumbFromValue",value:function(){if(this._thumbClip){var t=Math.round(this._trackStart+this._trackLength*this._value);this._vertical?this._thumbClip.y=t:this._thumbClip.x=t,this.emit("event_change",this.value)}}},{key:"_onThumbDrag",value:function(t,e){if(0!==this._trackLength&&u.default.check(this.lockId)){var n=((this._vertical?e:t)-this._trackStart)/this._trackLength*(this._maxValue-this._minValue);0!==this._valueStep&&(n=Math.round(n/this._valueStep)*this._valueStep),this.value=n+this._minValue}}},{key:"_onZoneDown",value:function(){}},{key:"value",get:function(){var t=this._value*(this._maxValue-this._minValue);return 0===this._valueStep?t+this._minValue:(t=Math.round(t/this._valueStep)*this._valueStep)+this._minValue},set:function(t){var e=(t-this._minValue)/(this._maxValue-this._minValue);e<0&&(e=0),e>1&&(e=1),e!==this._value&&(this._value=e,this._updateThumbFromValue())}}]),e}();e.default=c},function(t,e,n){t.exports=n(10)},function(t,e,n){"use strict";(function(e){var i=s(n(5)),r=s(n(12)),o=s(n(17)),a=s(n(1));function s(t){return t&&t.__esModule?t:{default:t}}var u={ComponentClip:i.default,UIComponents:r.default,Plugin:o.default,UIManager:a.default};t.exports=u,e.PhaserComps=u}).call(this,n(11))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=f(n(3)),r=f(n(13)),o=f(n(0)),a=f(n(6)),s=f(n(7)),u=f(n(8)),l=f(n(14)),c=f(n(15)),h=f(n(16));function f(t){return t&&t.__esModule?t:{default:t}}var p={UIComponentPrototype:o.default,UIButton:i.default,UIButtonSelect:a.default,UIButtonRadio:r.default,UIButtonDraggable:s.default,UIScrollBar:u.default,UIScrollPanel:l.default,UIProgressBar:c.default,UIContainer:h.default};e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(6),a=(i=o)&&i.__esModule?i:{default:i};var s=function(t){function e(t,n,i,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var a=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));return a._sibling=a,a._value=r,void 0!==o&&a.appendToRadio(o),a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default),r(e,null,[{key:"EVENT_SELECT",get:function(){return"event_select"}}]),r(e,[{key:"appendToRadio",value:function(t){this._sibling!==this&&this.removeFromSibling(),this._sibling=t._sibling,t._sibling=this}},{key:"removeFromSibling",value:function(){}},{key:"_onClick",value:function(){this.select=!0}},{key:"_broadcastSelect",value:function(){this.emit("event_select",this.value);for(var t=this._sibling;t!==this;)t.emit("event_select",this._value),t=t._sibling}},{key:"select",get:function(){return function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",this)},set:function(t){if(this._select!==t&&(function t(e,n,i,r){var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var a=Object.getPrototypeOf(e);null!==a&&t(a,n,i,r)}else if("value"in o&&o.writable)o.value=i;else{var s=o.set;void 0!==s&&s.call(r,i)}return i}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",t,this),t)){for(var n=this._sibling;n!==this;)n.select=!1,n=n._sibling;this._broadcastSelect()}}},{key:"value",get:function(){return this._value},set:function(t){this._value=t}},{key:"valueSelected",get:function(){if(this.select)return this.value;for(var t=this._sibling;t!==this;){if(t.select)return t.value;t=t._sibling}return null},set:function(t){if(this.value!==t){for(var e=this._sibling;e!==this;)if(e.value===t)return void(e.select=!0)}else this.select=!0}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(0)),o=a(n(8));function a(t){return t&&t.__esModule?t:{default:t}}var s=function(){function t(e,n,i,a,s){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._container=e,e.on(r.default.EVENT_STATE,this._onContainerUpdate,this),this._panelKey=n,this._dimensionsKey=a,this._scrollBar=new o.default(e,i,s),this._scrollBar.on(o.default.EVENT_CHANGE,this._onScrollBar,this),this._vertical=s||!1}return i(t,[{key:"_onContainerUpdate",value:function(){var t=this._container._clip;if(t){this._panel=t.getChildClip(this._panelKey);var e=t.getChildClip(this._dimensionsKey);this._panel&&e&&(this._scrollBounds={x:e.x,y:e.y,len:this._vertical?this._panel.height-e.height:this._panel.width-e.width},this._onScrollBar(this._onScrollBar.value))}}},{key:"_onScrollBar",value:function(t){this._panel&&this._scrollBounds&&(this._vertical?this._panel.y=this._scrollBounds.y-this._scrollBounds.len*t:this._panel.x=this._scrollBounds.x-this._scrollBounds.len*t)}}]),t}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(0),a=(i=o)&&i.__esModule?i:{default:i},s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(4));var u=/progress_(\d+)$/,l=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._value=0,i._steps=[],i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default),r(e,[{key:"onClipAppend",value:function(t){(function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._makeSteps(t),this._applyValue()}},{key:"_applyValue",value:function(){if(this._clip){var t=void 0,e=void 0,n=void 0,i=void 0,r=void 0,o=void 0,a=this._steps.length;for(t=0;t<a-1;t++){var s=this._steps[t],u=this._steps[t+1];if(s.stepValue===this._value){r=s.config;break}if(u.stepValue===this._value){r=u.config;break}if(this._value>s.stepValue&&this._value<u.stepValue){e=s.config,n=u.config,i=(this._value-s.stepValue)/(u.stepValue-s.stepValue);break}}if(!r)for(o in r={},e)if(n.hasOwnProperty(o)){var l=e[o],c=n[o];r[o]={x:l.x+(c.x-l.x)*i,y:l.y+(c.y-l.y)*i,scaleX:l.scaleX+(c.scaleX-l.scaleX)*i,scaleY:l.scaleY+(c.scaleY-l.scaleY)*i,angle:l.angle+(c.angle-l.angle)*i,alpha:l.alpha+(c.alpha-l.alpha)*i}}for(o in r)this._clip.applyChildParams(o,r[o])}}},{key:"_makeSteps",value:function(t){var n=this,i=t.getStateIds();this._steps=[],s.each(i,function(i){if(u.test(i)){var r={},o={stepValue:parseInt(u.exec(i)[1])/100,config:r},a=t.getStateConfig(i);for(var s in a)r[s]=e._makeFullConfig(a[s]);n._steps.push(o)}},this),s.sortBy(this._steps,"stepValue")}},{key:"value",get:function(){return this._value},set:function(t){this._value=t,this._applyValue()}}],[{key:"_makeFullConfig",value:function(t){return{x:t.hasOwnProperty("x")?t.x:0,y:t.hasOwnProperty("y")?t.y:0,scaleX:t.hasOwnProperty("scaleX")?t.scaleX:1,scaleY:t.hasOwnProperty("scaleY")?t.scaleY:1,angle:t.hasOwnProperty("angle")?t.angle:0,alpha:t.hasOwnProperty("alpha")?t.alpha:1}}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},o=s(n(0)),a=(s(n(2)),s(n(4)));function s(t){return t&&t.__esModule?t:{default:t}}var u=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._children=[],i._containerClip=null,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),i(e,[{key:"addChild",value:function(t){return-1!==this._children.indexOf(t)?t:(this._children.push(t),this._containerClip?this._addUIComponentToContainerClip(t):t._clip.groupVisible=!1,t)}},{key:"removeChild",value:function(t){var e=this._children.indexOf(t);return-1===e?t:(this._children.splice(e,1),this._containerClip&&this._removeUIComponentFromContainerClip(t),t)}},{key:"_addUIComponentToContainerClip",value:function(t){var e=this;a.default.each(t._clip.childrenList,function(t){e._containerClip.add(t)},this),t._clip.groupVisible=!0}},{key:"_removeUIComponentFromContainerClip",value:function(t,e){var n=this;a.default.each(t._clip.childrenList,function(t){n._containerClip.remove(t,e)},this),t._clip.groupVisible=!1}},{key:"onClipAppend",value:function(t){var n=this;r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._containerClip=t._container,this._containerClip&&a.default.each(this._children,function(t){n._addUIComponentToContainerClip(t)},this)}},{key:"onClipRemove",value:function(t){var n=this;r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipRemove",this).call(this,t),this._containerClip&&a.default.each(this._children,function(t){n._removeUIComponentFromContainerClip(t)},this)}},{key:"destroy",value:function(){var t=this;a.default.each(this._children,function(e){t._containerClip&&t._removeUIComponentFromContainerClip(e),e.destroy()},this),this._children.length=0,r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(2)),o=a(n(5));function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return t.registerGameObject("ui_component",n.addComponent,n.addComponent),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.default.Plugins.BasePlugin),i(e,[{key:"addComponent",value:function(t,e){return new o.default(this.scene,t,e)}}]),e}();e.default=s;var u={key:"UIComponents",plugin:s,start:!0};s.DefaultCfg=u}])}); |
{ | ||
"name": "phaser-ui-comps", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Phaser 3 UI Components Framework and JSFL builder for Adobe Animate", | ||
@@ -5,0 +5,0 @@ "main": "src/phasercomps.js", |
import UIComponentPrototype from "./UIComponentPrototype"; | ||
import UIManager from "../manager/UIManager"; | ||
@@ -203,3 +204,5 @@ const HIT_ZONE = "HIT_ZONE"; | ||
if (isClicked) { | ||
this._onClick(); | ||
if (UIManager.check(this.lockId)) { | ||
this._onClick(); | ||
} | ||
} | ||
@@ -206,0 +209,0 @@ } |
import UIButton from "./UIButton"; | ||
import UIManager from "../manager/UIManager"; | ||
@@ -120,2 +121,5 @@ const _EVENT_DRAG = "event_drag"; | ||
_onDrag(pointer, gameObject, dragX, dragY) { | ||
if (!UIManager.check(this.lockId)){ | ||
return; | ||
} | ||
if (!this._dragZone || this._dragZone !== gameObject || this.clip) { | ||
@@ -122,0 +126,0 @@ return; |
import Phaser from "phaser"; | ||
import UIManager from "../manager/UIManager"; | ||
@@ -19,2 +20,3 @@ const _EVENT_STATE = "event_state"; | ||
* @extends Phaser.Events.EventEmitter | ||
* @property {String} lockId Used by UIManager, see {@link PhaserComps.UIManager} | ||
* @param {PhaserComps.UIComponents.UIComponentPrototype} [parent] UIComponentPrototype instance to find clip inside | ||
@@ -31,2 +33,7 @@ * @param {String} [key] key to find clip inside parent | ||
/** | ||
* @type {String} | ||
*/ | ||
this.lockId = null; | ||
/** | ||
* | ||
@@ -33,0 +40,0 @@ * @type {UIComponentPrototype} |
import UIComponentPrototype from "./UIComponentPrototype"; | ||
import UIButton from "./UIButton"; | ||
import UIButtonDraggable from "./UIButtonDraggable"; | ||
import UIManager from "../manager/UIManager"; | ||
@@ -201,2 +202,5 @@ const _EVENT_CHANGE = "event_change"; | ||
onPrevClick() { | ||
if (!UIManager.check(this.lockId)) { | ||
return; | ||
} | ||
this.value -= this._buttonStep; | ||
@@ -210,2 +214,5 @@ } | ||
onNextClick() { | ||
if (!UIManager.check(this.lockId)) { | ||
return; | ||
} | ||
this.value += this._buttonStep; | ||
@@ -261,2 +268,5 @@ } | ||
} | ||
if (!UIManager.check(this.lockId)) { | ||
return; | ||
} | ||
let barPosition = this._vertical ? positionY : positionX; | ||
@@ -263,0 +273,0 @@ let newValue = (barPosition - this._trackStart) / this._trackLength; |
@@ -8,2 +8,3 @@ /** | ||
import Plugin from "./plugin/Plugin"; | ||
import UIManager from "./manager/UIManager"; | ||
@@ -13,3 +14,4 @@ var PhaserComps = { | ||
UIComponents: UIComponents, | ||
Plugin: Plugin | ||
Plugin: Plugin, | ||
UIManager: UIManager | ||
}; | ||
@@ -16,0 +18,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
186943
23
2398