diff --git a/docs/examples/js/phaser3/hscrollbar.js b/docs/examples/js/phaser3/hscrollbar.js index f6c57bc..84242c0 100644 --- a/docs/examples/js/phaser3/hscrollbar.js +++ b/docs/examples/js/phaser3/hscrollbar.js @@ -13,9 +13,9 @@ var game = new Phaser.Game(config); function preload() { var assetRoot = '../../assets/horizontal/'; - this.load.image("dummyButton", assetRoot + "sprite.png"); - this.load.image("track", assetRoot + 'track.png'); - this.load.spritesheet('bar', assetRoot + 'bar.png', { frameWidth: 44, frameHeight: 22 }); + this.load.image('dummyButton', `${assetRoot}sprite.png`); + this.load.image('track', `${assetRoot}track.png`); + this.load.spritesheet('bar', `${assetRoot}bar.png`, { frameWidth: 44, frameHeight: 22 }); } function create() { @@ -25,15 +25,15 @@ function create() { viewport.addNode(row); // Add things to the row. - var dummy_sprite_a = this.add.image(0, 0, "dummyButton"); - var dummy_sprite_b = this.add.image(0, 0, "dummyButton"); - var dummy_sprite_c = this.add.image(0, 0, "dummyButton"); - var dummy_sprite_d = this.add.image(0, 0, "dummyButton"); - var dummy_sprite_e = this.add.image(0, 0, "dummyButton"); - var dummy_sprite_f = this.add.image(0, 0, "dummyButton"); - var dummy_sprite_g = this.add.image(0, 0, "dummyButton"); - var dummy_sprite_h = this.add.image(0, 0, "dummyButton"); - var dummy_sprite_i = this.add.image(0, 0, "dummyButton"); + var dummy_sprite_a = this.add.image(0, 0, 'dummyButton'); + var dummy_sprite_b = this.add.image(0, 0, 'dummyButton'); + var dummy_sprite_c = this.add.image(0, 0, 'dummyButton'); + var dummy_sprite_d = this.add.image(0, 0, 'dummyButton'); + var dummy_sprite_e = this.add.image(0, 0, 'dummyButton'); + var dummy_sprite_f = this.add.image(0, 0, 'dummyButton'); + var dummy_sprite_g = this.add.image(0, 0, 'dummyButton'); + var dummy_sprite_h = this.add.image(0, 0, 'dummyButton'); + var dummy_sprite_i = this.add.image(0, 0, 'dummyButton'); row.addNode(dummy_sprite_a); row.addNode(dummy_sprite_b); diff --git a/docs/examples/lib/phaser-ui-tools.js b/docs/examples/lib/phaser-ui-tools.js index af5ea6f..a8846e6 100644 --- a/docs/examples/lib/phaser-ui-tools.js +++ b/docs/examples/lib/phaser-ui-tools.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("uiWidgets",[],e):"object"==typeof exports?exports.uiWidgets=e():t.uiWidgets=e()}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){"use strict";var i=Object.prototype.hasOwnProperty,r="~";function o(){}function a(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,n,i,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,i||t,o),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(r=!1)),c.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)i.call(t,e)&&n.push(r?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},c.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i=i&&e.draggableArea.y<=i&&(e.y=i);else{var r=n+e.displayWidth;e.draggableArea.x+e.draggableArea.w>=r&&e.draggableArea.x<=n&&(e.x=n)}}},{key:"setDragBounds",value:function(t){this.draggableArea=t}},{key:"enableDragging",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.setInteractive({useHandCursor:!0}),this.vertical=t,this.game.input.setDraggable(this),this.game.input.on("drag",this.updateDrag)}}]),n}(d):p=function(t){w(n,Phaser.Button);var e=x(n);function n(t,i,r,o,a,s,u,c,l,h){var f;return b(this,n),f=e.call(this,t,i,r,o,a,s,u,c,l,h),t.add.existing(S(f)),f}return m(n,[{key:"setInteractive",value:function(){this.inputEnabled=!0,this.input.useHandCursor=!0}},{key:"disableInteractive",value:function(){this.inputEnabled=!1}},{key:"setDragBounds",value:function(t){this.input.boundsRect=new Phaser.Rectangle(t.x,t.y,t.w,t.h)}},{key:"enableDragging",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.inputEnabled=!0,this.input.enableDrag(),t?this.input.allowHorizontalDrag=!1:this.input.allowVerticalDrag=!1}},{key:"addOutEvent",value:function(t,e){this.events.onInputOut.add(t,e)}},{key:"addUpEvent",value:function(t,e){this.events.onInputUp.add(t,e)}},{key:"addDownEvent",value:function(t,e){this.events.onInputDown.add(t,e)}},{key:"addDragEvent",value:function(t,e){this.events.onDragUpdate.add(t,e)}},{key:"displayHeight",get:function(){return this.height},set:function(t){this.height=t}},{key:"displayWidth",get:function(){return this.width},set:function(t){this.width=t}}]),n}();var R,_=p,j=void 0===Phaser.Easing?Phaser.Math.Easing:Phaser.Easing;function E(t){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return G(this,n),i=e.call(this,t,r,o),t.add.existing(N(i)),i.SORT_ASCENDING=-1,i.SORT_DESCENDING=1,i.version=3,i.alignToMapping={0:Phaser.Display.Align.To.TopLeft,1:Phaser.Display.Align.To.TopCenter,8:Phaser.Display.Align.To.RightCenter,11:Phaser.Display.Align.To.BottomCenter},i.worldPosition=new U(N(i)),i}return L(n,[{key:"getNodes",value:function(){return this.getAll()}},{key:"alignToContainerBottom",value:function(t,e){var n,i,r=0;if(this.parentContainer&&(r=this.parentContainer.y),"layout"===e.uiWidgetsObjectRole){var o=t.getBounds();n=o.width-this.worldPosition.x,i=o.height-this.worldPosition.y}else n=t.width,i=t.height;var a=.5*n,s=i,u=e.width;"layout"===e.uiWidgetsObjectRole&&(u=e.getBounds().width),e.x=a-.5*u,e.y=t.getBounds().y+s-r}},{key:"alignContainerToBottom",value:function(t,e){var n=t.getBounds(),i=t.x+.5*n.width,r=n.height-this.worldPosition.y;e.x=i-.5*(e.getBounds().width-this.worldPosition.x),e.y=n.y+r}},{key:"alignNodeToPrevious",value:function(t,e,i,r){var o=this.getNodes(),a=o[o.length-2];a instanceof n?this.alignToContainerBottom(a,t):t instanceof n&&void 0!==a?this.alignContainerToBottom(a,t):void 0!==a&&this.alignToMapping[e](t,a,i,r)}},{key:"children",get:function(){return this.list}},{key:"realHeight",get:function(){return this.getBounds().height-this.y}},{key:"realWidth",get:function(){return this.getBounds().width-this.x}}]),n}()}else{I=function(t){W(n,Phaser.Group);var e=H(n);function n(t){var i;return G(this,n),(i=e.call(this,t)).SORT_ASCENDING=-1,i.SORT_DESCENDING=1,i}return L(n,[{key:"getNodes",value:function(){return this.children}},{key:"alignNodeToPrevious",value:function(t,e,n,i){var r=this.getNodes(),o=r[r.length-2];void 0!==o&&t.alignTo(o,e,n,i)}},{key:"realHeight",get:function(){return this.height}},{key:"realWidth",get:function(){return this.width}}]),n}()}var F,Q=I;function Z(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function q(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;Bt(this,t),this.x=e,this.y=n,this.z=i,this.sprite=r,this.position=o}return zt(t,[{key:"getSinCosOfAngle",value:function(t){var e=t*Math.PI/180;return{cosine:Math.cos(e),sine:Math.sin(e)}}},{key:"rotateY",value:function(e){var n=this.getSinCosOfAngle(e),i=this.z*n.cosine-this.x*n.sine;return new t(this.z*n.sine+this.x*n.cosine,this.y,i)}},{key:"rotateX",value:function(e){var n=this.getSinCosOfAngle(e),i=this.y*n.cosine-this.z*n.sine,r=this.y*n.sine+this.z*n.cosine;return new t(this.x,i,r)}},{key:"rotateZ",value:function(e){var n=this.getSinCosOfAngle(e);return new t(this.x*n.cosine-this.y*n.sine,this.x*n.sine+this.y*n.cosine,this.z)}},{key:"rotate",value:function(t,e){var n=null;return"x"===t?n=this.rotateX(e):"y"===t?n=this.rotateY(e):"z"===t&&(n=this.rotateZ(e)),n}},{key:"project",value:function(e,n,i){return new t(this.x*i+e,-this.y*i+n,this.z)}}]),t}(),Wt=function(){function t(e,n,i,r,o,a,s,u,c){Bt(this,t),this.game=e,this.xy=n,this.sprites=i,this.firstPlace=r,this.zoom=o,this.axis=a,this.rotationAxis=s,this.visibleRange=u||null,this.tweenParams=c||{duration:300,ease:j.Quadratic.Out},this.emitter=new Dt,this.group=new Q(e)}return zt(t,[{key:"activate",value:function(){var t,e,n,i,r,o;if(this.pointsAmount=this.sprites.length,this.totalPositions=this.pointsAmount-1,this.rotationAmount=360/this.pointsAmount,null!==this.visibleRange){for(var a=[],s=0;s<=this.totalPositions;s++)a.push(s);var u=a.slice(0,this.visibleRange.max),c=a.slice(this.visibleRange.min);this.visiblePositions=u.concat(c)}this.moving=!1,this.direction=null,this.wheelItems=[];for(var l=2*Math.PI/this.pointsAmount,h=0;h1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Ht(this,o),e=r.call(this,t),t.add.existing(Xt(e)),e.game=t,e.x=n,e.y=i,e.vertical=a,e.parentContainer=null,e}return e=o,(n=[{key:"setTrackScrollAreaSize",value:function(){this.vertical?this.trackScrollAreaSize=this.track.height-this.vslice:this.trackScrollAreaSize=this.track.width-this.hslice}},{key:"centerStaticAxis",value:function(){this.vertical?this.bar.x=this.track.x+this.track.width/2-this.bar.displayWidth/2:this.bar.y=this.track.y+this.track.height/2-this.bar.displayHeight/2}}])&&Kt(e.prototype,n),i&&Kt(e,i),o}(Q);function Ft(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qt(t,e){for(var n=0;n1&&(this.ratio=1),this.currentValue=n,this.steps=[];for(var r=0;r1&&(this.ratio=1)}return Zt(t,[{key:"adjustValue",value:function(t){this.vertical?this.viewport.y=t+this.viewport.area.y:this.viewport.x=t+this.viewport.area.x,this.viewport.disableOutOfBounds(this.viewport.children,this,this.vertical)}},{key:"getCurrentValue",value:function(){return this.vertical?this.viewport.y-this.viewport.area.y:this.viewport.x-this.viewport.area.x}}]),t}();function te(t){return(te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ee(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ce(this,o),(e=r.call(this,t,n,i)).emitter=new Dt,e}return e=o,(n=[{key:"verticalTrackClick",value:function(){var t=this.game.input.mousePointer.y,e=this.bar.y+this.worldPosition.y;this.parentContainer&&(e+=this.parentContainer.y),t>e+this.bar.displayHeight?this.scrollDown():te+this.bar.displayWidth?this.scrollRight():t=this.track.y+this.track.height?this.maxY:this.bar.y+this.vslice,this.addScrollTween({y:e})}}},{key:"scrollLeft",value:function(){if(this.bar.x!==this.track.x&&!this.barMoving){var t=this.bar.x-this.hslice,e=null;this.barMoving=!0,this.bar.disableInteractive(),e=t<=this.track.x?this.minX:this.bar.x-this.hslice,this.addScrollTween({x:e})}}},{key:"scrollRight",value:function(){if(this.bar.x+this.bar.displayWidth!==this.track.x+this.track.width&&!this.barMoving){var t=this.bar.x+2*this.hslice,e=null;this.barMoving=!0,this.bar.disableInteractive(),e=t>=this.track.x+this.track.width?this.maxX:this.bar.x+this.hslice,this.addScrollTween({x:e})}}},{key:"moveContent",value:function(){var t=this.getGripPositionRatio()*this.windowScrollAreaSize;this.valueRange.adjustValue(t),this.emitter.emit("movement",this)}}])&&le(e.prototype,n),i&&le(e,i),o}(Ut);function ve(t){return(ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function be(t,e){for(var n=0;n0?t=0:t<=-this.trackScrollAreaSize&&(t=-this.trackScrollAreaSize),this.vertical?this.bar.y<=this.track.y?t=0:this.bar.y+this.bar.displayHeight>=this.track.y+this.track.displayHeight&&(t=-this.trackScrollAreaSize):this.bar.x<=this.track.x?t=0:this.bar.x+this.bar.displayWidth>=this.track.x+this.track.displayWidth&&(t=-this.trackScrollAreaSize);var e=t/this.trackScrollAreaSize;return Number.isNaN(e)&&(e=0),e}}])&&be(e.prototype,n),i&&be(e,i),o}(de);function Se(t){return(Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pe(t,e){for(var n=0;n=this.trackScrollAreaSize&&(t=this.trackScrollAreaSize),this.vertical?this.bar.y<=this.track.y?t=0:this.bar.y+this.bar.displayHeight>=this.track.y+this.track.displayHeight&&(t=this.trackScrollAreaSize):this.bar.x<=this.track.x?t=0:this.bar.x+this.bar.displayWidth>=this.track.x+this.track.displayWidth&&(t=this.trackScrollAreaSize);var e=t/this.trackScrollAreaSize;return Number.isNaN(e)&&(e=0),e}}])&&Pe(e.prototype,n),i&&Pe(e,i),o}(de),Te=0,Ae=8,Be=11;function Ie(t){return(Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ze(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Me(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(ze(this,o),e=r.call(this,t),t.add.existing(Ke(e)),e.x=n,e.y=i,e.uiWidgetsObjectRole="layout",e.modal=s,e.background=null,e.back=null,s){var u,c=new z(t,{x:0,y:0});c.fillStyle(16777215,1),c.fillRect(0,0,t.scale.width,t.scale.height),3===e.version?(c.generateTexture("modalBack"),u="modalBack"):u=c.generateTexture(),e.back=new d(t,0,0,u),e.back.setInteractive(),e.back.setOrigin(0,0),e.back.moveDown();var l=new vt(t,0,0);e.back.mask=l.create(0,0,0,0),t.add.existing(e.back),e.depth=9999,e.back.depth=9998}return null!==a&&(e.background=new d(t,0,0,a),t.add.existing(e.background),e.background.sendToBack(),e.background.alignIn(Ke(e),Te)),e}return e=o,(n=[{key:"dismiss",value:function(){this.modal&&this.back.destroy(),null!==this.background&&this.background.destroy(),this.destroy()}},{key:"addNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=i||this.alignment;t instanceof Q||(t.displayOriginX=0,t.displayOriginY=0),this.add(t),this.alignNodeToPrevious(t,r,e,n),t.parentContainer=this,"enableBarDrag"in t&&t.enableBarDrag()}}])&&Me(e.prototype,n),i&&Me(e,i),o}(Q);function Ge(t){return(Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Le(t,e){return(Le=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ue(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Qe(t);if(e){var r=Qe(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Fe(this,n)}}function Fe(t,e){return!e||"object"!==Ge(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Qe(t){return(Qe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ze=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Le(t,e)}(n,t);var e=Ue(n);function n(t){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return Xe(this,n),(i=e.call(this,t,r,o,a,s)).alignment=Be,i}return n}(Ye);function qe(t){return(qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Je(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $e(t,e){return($e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function tn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=nn(t);if(e){var r=nn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return en(this,n)}}function en(t,e){return!e||"object"!==qe(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function nn(t){return(nn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var rn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$e(t,e)}(n,t);var e=tn(n);function n(t){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return Je(this,n),(i=e.call(this,t,r,o,a,s)).alignment=Ae,i}return n}(Ye);function on(t){return(on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function an(t,e){for(var n=0;n(()=>{"use strict";var t={729:t=>{var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new i(n,o||t,a),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;rP,Column:()=>ir,Frame:()=>$e,KeyboardGroup:()=>Wt,QuantityBar:()=>ge,Row:()=>lr,Scrollbar:()=>De,TextButton:()=>Ct,TextSprite:()=>Bt,ValueBar:()=>Ne,Viewport:()=>mr,Wheel3D:()=>Gt});var y=void 0===Phaser.Sprite?function(t){function r(t,n,i,o){var a;e(this,r),a=s(this,r,[t,n,i,o]),t.add.existing(l(a));var u=Phaser.Display.Align.In;return a.alignInMapping={0:u.TopLeft,1:u.TopCenter,2:u.TopRight,3:u.LeftTop,4:u.LeftCenter,5:u.LeftBottom,6:u.Center,7:u.RightTop,8:u.RightCenter,9:u.RightBottom,10:u.BottomLeft,11:u.BottomCenter,12:u.BottomRight},a}return h(r,Phaser.GameObjects.Sprite),o(r,[{key:"maskX",get:function(){return this.x}},{key:"maskY",get:function(){return this.y}},{key:"sendToBack",value:function(){this.depth=-9999}},{key:"moveDown",value:function(){this.depth-=1}},{key:"alignIn",value:function(t,e){this.alignInMapping[e](this,t,t.width)}},{key:"addOutEvent",value:function(t,e){this.on("pointerout",(function(r){t.call(e,r)}))}},{key:"addUpEvent",value:function(t,e){this.on("pointerup",(function(r){t.call(e,r)}))}},{key:"addDownEvent",value:function(t,e){this.on("pointerdown",(function(r){t.call(e,r)}))}},{key:"addDragEvent",value:function(t,e){this.on("drag",(function(){t.call(e)}))}}]),r}():function(t){function r(t,n,i,o){var a;return e(this,r),a=s(this,r,[t,n,i,o]),t.add.existing(l(a)),a}return h(r,Phaser.Sprite),o(r,[{key:"setOrigin",value:function(t,e){this.anchor=new Phaser.Point(t,e)}},{key:"maskX",get:function(){return 0}},{key:"maskY",get:function(){return 0}},{key:"setInteractive",value:function(){this.inputEnabled=!0}},{key:"disableInteractive",value:function(){this.inputEnabled=!1}},{key:"addOutEvent",value:function(t,e){this.events.onInputOut.add(t,e)}},{key:"addUpEvent",value:function(t,e){this.events.onInputUp.add(t,e)}},{key:"addDownEvent",value:function(t,e){this.events.onInputDown.add(t,e)}},{key:"displayHeight",get:function(){return this.height},set:function(t){this.height=t}},{key:"displayWidth",get:function(){return this.width},set:function(t){this.width=t}}]),r}();function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){for(var r=0;r=n&&e.draggableArea.y<=n&&(e.y=n);else{var i=r+e.displayWidth;e.draggableArea.x+e.draggableArea.w>=i&&e.draggableArea.x<=r&&(e.x=r)}}},{key:"setDragBounds",value:function(t){this.draggableArea=t}},{key:"enableDragging",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.setInteractive({useHandCursor:!0}),this.vertical=t,this.game.input.setDraggable(this),this.game.input.on("drag",this.updateDrag)}}]),e}(y):function(t){function e(t,r,n,i,o,a,s,u,c,l){var h;return v(this,e),h=m(this,e,[t,r,n,i,o,a,s,u,c,l]),t.add.existing(O(h)),h}return S(e,Phaser.Button),d(e,[{key:"setInteractive",value:function(){this.inputEnabled=!0,this.input.useHandCursor=!0}},{key:"disableInteractive",value:function(){this.inputEnabled=!1}},{key:"setDragBounds",value:function(t){this.input.boundsRect=new Phaser.Rectangle(t.x,t.y,t.w,t.h)}},{key:"enableDragging",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.inputEnabled=!0,this.input.enableDrag(),t?this.input.allowHorizontalDrag=!1:this.input.allowVerticalDrag=!1}},{key:"addOutEvent",value:function(t,e){this.events.onInputOut.add(t,e)}},{key:"addUpEvent",value:function(t,e){this.events.onInputUp.add(t,e)}},{key:"addDownEvent",value:function(t,e){this.events.onInputDown.add(t,e)}},{key:"addDragEvent",value:function(t,e){this.events.onDragUpdate.add(t,e)}},{key:"displayHeight",get:function(){return this.height},set:function(t){this.height=t}},{key:"displayWidth",get:function(){return this.width},set:function(t){this.width=t}}]),e}(),j=void 0===Phaser.Easing?Phaser.Math.Easing:Phaser.Easing;function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function E(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return N(this,e),r=M(this,e,[t,n,i]),t.add.existing(K(r)),r.parentContainer=null,r.SORT_ASCENDING=-1,r.SORT_DESCENDING=1,r.version=3,r.alignToMapping={0:Phaser.Display.Align.To.TopLeft,1:Phaser.Display.Align.To.TopCenter,8:Phaser.Display.Align.To.RightCenter,11:Phaser.Display.Align.To.BottomCenter},r.worldPosition=new U(K(r)),r}return H(e,Phaser.GameObjects.Container),G(e,[{key:"children",get:function(){return this.list}},{key:"realHeight",get:function(){return this.getBounds().height-this.y}},{key:"realWidth",get:function(){return this.getBounds().width-this.x}},{key:"setOrigin",value:function(){for(var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;Kt(this,t),this.x=e,this.y=r,this.z=n,this.sprite=i,this.position=o}return Yt(t,[{key:"getSinCosOfAngle",value:function(t){var e=t*Math.PI/180;return{cosine:Math.cos(e),sine:Math.sin(e)}}},{key:"rotateY",value:function(e){var r=this.getSinCosOfAngle(e),n=this.z*r.cosine-this.x*r.sine;return new t(this.z*r.sine+this.x*r.cosine,this.y,n)}},{key:"rotateX",value:function(e){var r=this.getSinCosOfAngle(e),n=this.y*r.cosine-this.z*r.sine,i=this.y*r.sine+this.z*r.cosine;return new t(this.x,n,i)}},{key:"rotateZ",value:function(e){var r=this.getSinCosOfAngle(e);return new t(this.x*r.cosine-this.y*r.sine,this.x*r.sine+this.y*r.cosine,this.z)}},{key:"rotate",value:function(t,e){var r=null;return"x"===t?r=this.rotateX(e):"y"===t?r=this.rotateY(e):"z"===t&&(r=this.rotateZ(e)),r}},{key:"project",value:function(e,r,n){return new t(this.x*n+e,-this.y*n+r,this.z)}}]),t}(),Gt=function(){function t(e,r,n,i,o,a,s,u,c){Kt(this,t),this.game=e,this.xy=r,this.sprites=n,this.firstPlace=i,this.zoom=o,this.axis=a,this.rotationAxis=s,this.visibleRange=u||null,this.tweenParams=c||{duration:300,ease:j.Quadratic.Out},this.emitter=new At,this.group=new F(e)}return Yt(t,[{key:"activate",value:function(){var t,e,r,n,i,o;if(this.pointsAmount=this.sprites.length,this.totalPositions=this.pointsAmount-1,this.rotationAmount=360/this.pointsAmount,null!==this.visibleRange){for(var a=[],s=0;s<=this.totalPositions;s++)a.push(s);var u=a.slice(0,this.visibleRange.max),c=a.slice(this.visibleRange.min);this.visiblePositions=u.concat(c)}this.moving=!1,this.direction=null,this.wheelItems=[];for(var l=2*Math.PI/this.pointsAmount,h=0;h1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=Qt(this,e,[t]),t.add.existing($t(r)),r.game=t,r.x=n,r.y=i,r.vertical=o,r.trackKey=a,r.barKey=s,r}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Jt(t,e)}(e,t),r=e,(n=[{key:"setTrackScrollAreaSize",value:function(){this.vertical?this.trackScrollAreaSize=this.track.height-this.vslice:this.trackScrollAreaSize=this.track.width-this.hslice}},{key:"centerStaticAxis",value:function(){this.vertical?this.bar.x=this.track.x+this.track.width/2-this.bar.displayWidth/2:this.bar.y=this.track.y+this.track.height/2-this.bar.displayHeight/2}}])&&Ut(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(F);function ee(t){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ee(t)}function re(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ne(t,e){for(var r=0;r1&&(this.ratio=1),this.currentValue=r,this.steps=[];for(var i=0;i1&&(this.ratio=1)}return ie(t,[{key:"adjustValue",value:function(t){this.vertical?this.viewport.y=t+this.viewport.area.y:this.viewport.x=t+this.viewport.area.x,this.viewport.disableOutOfBounds(this.viewport.children,this,this.vertical)}},{key:"getCurrentValue",value:function(){return this.vertical?this.viewport.y-this.viewport.area.y:this.viewport.x-this.viewport.area.x}}]),t}();function ce(t){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(t)}function le(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=ye(this,e,[t,r.x,r.y,o,s,u])).uiWidgetsObjectRole="quantitybar",i.valueRange=new ae(be(i),n.startValue,n.maxValue),i.reverse=a||!1,i.tweenParams=c||{duration:300,ease:j.Quadratic.Out},i.track=new y(t,0,0,i.trackKey),i.track.displayOriginX=0,i.track.displayOriginY=0,i.add(i.track),i.width=i.track.width,i.height=i.track.height,i.bar=new y(t,0,0,i.barKey),i.bar.displayOriginX=0,i.bar.displayOriginY=0,i.add(i.bar),i.create(),i}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&de(t,e)}(e,t),r=e,n=[{key:"setMask",value:function(){null!==this.bar.mask&&(this.bar.mask.destroy(),this.bar.mask=null);var t=new gt(this.game,this.maskX,this.maskY);this.bar.mask=t.create(this.bar.maskX,this.bar.maskY,this.maskW,this.maskH),void 0===this.version&&this.add(t)}},{key:"getMaskXY",value:function(){var t,e;return t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,void 0===this.version?(t+=this.bar.x,e+=this.bar.y):(t+=this.x,e+=this.y),this.reverse&&(this.vertical?e+=this.getBarFraction():t+=this.getBarFraction()),[t,e]}},{key:"getBarPosition",value:function(){var t=this.valueRange.getRatio()/this.windowScrollAreaSize;return this.trackScrollAreaSize*t}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.centerStaticAxis(),this.maskW=this.bar.width,this.maskH=this.bar.height;var r,n,i=(r=this.getMaskXY(t,e),n=2,function(t){if(Array.isArray(t))return t}(r)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(r,n)||function(t,e){if(t){if("string"==typeof t)return le(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?le(t,e):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=i[0],a=i[1];this.maskX=o,this.maskY=a,this.setMask();var s=this.getBarSize();this.reverse,this.vertical?this.bar.mask.geometryMask.scaleY=s:this.bar.mask.geometryMask.scaleX=s,this.windowScrollAreaSize=this.valueRange.maxValue,this.vslice=this.track.height*this.valueRange.getRatio(),this.hslice=this.track.width*this.valueRange.getRatio(),this.setTrackScrollAreaSize()}},{key:"addScrollTweenMask",value:function(t,e,r){new st(this.game).add(this.bar.mask.geometryMask,t,e,r)}},{key:"adjustBar",value:function(t){var e;this.valueRange.currentValue+=t;var r,n,i=this.getBarSize();void 0===this.version?(r=0,n=0):(r=this.x,n=this.y),e=this.reverse?this.vertical?{scaleY:i,y:n+this.getBarFraction()}:{scaleX:i,x:r+this.getBarFraction()}:this.vertical?{scaleY:i}:{scaleX:i},this.addScrollTweenMask(e,this.tweenParams.duration,this.tweenParams.ease)}},{key:"getBarFraction",value:function(){return this.vertical?this.track.height*this.valueRange.getRatio():this.track.width*this.valueRange.getRatio()}},{key:"getBarSize",value:function(){return this.reverse?1-this.valueRange.getRatio():this.valueRange.getRatio()}}],n&&he(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(te);function me(t){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(t)}function we(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=Oe(this,e,[t,n,i,o,a,s])).emitter=new At,r}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pe(t,e)}(e,t),r=e,(n=[{key:"verticalTrackClick",value:function(){var t=this.game.input.mousePointer.y,e=this.bar.y+this.worldPosition.y;this.parentContainer&&(e+=this.parentContainer.y),t>e+this.bar.displayHeight?this.scrollDown():te+this.bar.displayWidth?this.scrollRight():t=this.track.y+this.track.height?this.maxY:this.bar.y+this.vslice,this.addScrollTween({y:t})}}},{key:"scrollLeft",value:function(){if(this.bar.x!==this.track.x&&!this.barMoving){var t,e=this.bar.x-this.hslice;this.barMoving=!0,this.bar.disableInteractive(),t=e<=this.track.x?this.minX:this.bar.x-this.hslice,this.addScrollTween({x:t})}}},{key:"scrollRight",value:function(){if(this.bar.x+this.bar.displayWidth!==this.track.x+this.track.width&&!this.barMoving){var t,e=this.bar.x+2*this.hslice;this.barMoving=!0,this.bar.disableInteractive(),t=e>=this.track.x+this.track.width?this.maxX:this.bar.x+this.hslice,this.addScrollTween({x:t})}}},{key:"moveContent",value:function(){var t=this.getGripPositionRatio()*this.windowScrollAreaSize;this.valueRange.adjustValue(t),this.emitter.emit("movement",this)}}])&&we(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(te);function _e(t){return _e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_e(t)}function Ee(t,e){for(var r=0;r3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=Re(this,e,[t,0,0,o,a,s])).game=t,i.content=r,i.valueRange=new ue(r,o),i.draggable=n||!1,i.minBarSize=1,i.tweenParams=u||{duration:300,ease:j.Quadratic.Out},i.trackClicked=!1,i.barMoving=!1,i.mousePointer=null,i.track=new y(t,i.x,i.y,i.trackKey),i.track.displayOriginX=0,i.track.displayOriginY=0,i.add(i.track),i.draggable&&i.enableTrackClick(),i.createBar(),i.add(i.bar),i.minY=i.track.y,i.maxY=i.track.y+i.track.height-i.bar.displayHeight,i.minX=i.track.x,i.maxX=i.track.x+i.track.width-i.bar.displayWidth,i.create(),i.vertical?(i.maxValue=i.track.displayHeight+i.worldPosition.y,void 0===i.version&&(i.maxValue+=i.bar.displayHeight)):(i.maxValue=i.track.displayWidth+i.worldPosition.x,void 0===i.version&&(i.maxValue+=i.bar.displayWidth)),i}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ae(t,e)}(e,t),r=e,(n=[{key:"createBar",value:function(){var t=new P(this.game,this.x,this.y,this.barKey,this.moveContent,this,1,0);return t.displayOriginX=0,t.displayOriginY=0,this.bar=t,this.resizeBar(),t}},{key:"resizeBar",value:function(){var t;(t=this.vertical?this.track.height*this.valueRange.ratio:this.track.width*this.valueRange.ratio)0?t=0:t<=-this.trackScrollAreaSize&&(t=-this.trackScrollAreaSize),this.vertical?this.bar.y<=this.track.y?t=0:this.bar.y+this.bar.displayHeight>=this.track.y+this.track.displayHeight&&(t=-this.trackScrollAreaSize):this.bar.x<=this.track.x?t=0:this.bar.x+this.bar.displayWidth>=this.track.x+this.track.displayWidth&&(t=-this.trackScrollAreaSize);var e=t/this.trackScrollAreaSize;return Number.isNaN(e)&&(e=0),e}}])&&Ee(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(je);function Ie(t){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ie(t)}function ze(t,e){for(var r=0;r4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(o=We(this,e,[t,r.x,r.y,a,s,u])).valueRange=new se(n.step,n.startValue,n.maxValue),o.draggable=i||!1,o.tweenParams=c||{duration:300,ease:j.Quadratic.Out},o.trackClicked=!1,o.barMoving=!1,o.mousePointer=null,o.track=new y(t,0,0,o.trackKey),o.track.displayOriginX=0,o.track.displayOriginY=0,o.add(o.track),o.width=o.track.width,o.height=o.track.height,o.draggable&&o.enableTrackClick(),o.bar=new P(t,o.x,o.y,o.barKey,o.moveContent,He(o),1,0),o.bar.displayOriginX=0,o.bar.displayOriginY=0,o.bg=new I(t,{x:0,y:0}),o.add(o.bg),o.sendToBack(o.bg),o.bg.fillStyle(16711680,0),o.vertical?o.bg.fillRect(0,0-o.bar.height/2,1,o.track.height+o.bar.height):o.bg.fillRect(0-o.bar.width/2,0,o.track.width+o.bar.width,1),o.snapping=!0,o.add(o.bar),o.minY=o.track.y-o.bar.height/2,o.maxY=o.track.y+o.track.height-o.bar.height/2,o.minX=o.track.x-o.bar.width/2,o.maxX=o.track.x+o.track.width-o.bar.width/2,o.create(),o.vertical?(o.upEvent=o.scrollUp,o.downEvent=o.scrollDown):(o.upEvent=o.scrollLeft,o.downEvent=o.scrollRight),o.vertical?(o.maxValue=o.track.displayHeight+o.worldPosition.y,void 0===o.version&&(o.maxValue+=o.bar.displayHeight)):(o.maxValue=o.track.displayWidth+o.worldPosition.x,void 0===o.version&&(o.maxValue+=o.bar.displayWidth)),o}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ye(t,e)}(e,t),r=e,(n=[{key:"create",value:function(){this.centerStaticAxis(),this.draggable&&this.enableBarDrag(),this.windowScrollAreaSize=this.valueRange.maxValue-this.valueRange.step,this.vslice=this.track.displayHeight*this.valueRange.ratio,this.hslice=this.track.displayWidth*this.valueRange.ratio,this.setTrackScrollAreaSize(),this.setInitialBarPosition(),this.mousePointer={x:this.bar.x,y:this.bar.y}}},{key:"setDraggableArea",value:function(){var t=this.track.displayHeight;void 0===this.version&&(t+=this.bar.displayHeight),this.verticalDraggableArea={x:this.track.x-(this.bar.displayWidth-this.track.displayWidth)/2,y:this.track.y-this.bar.displayHeight/2,w:this.bar.displayWidth,h:t},this.horizontalDraggableArea={x:this.track.x-this.bar.displayWidth/2,y:this.track.y-(this.bar.displayHeight-this.track.displayHeight)/2,w:this.track.displayWidth+this.bar.displayWidth,h:this.bar.displayHeight}}},{key:"setTrackScrollAreaSize",value:function(){this.vertical?this.trackScrollAreaSize=this.track.displayHeight:this.trackScrollAreaSize=this.track.displayWidth}},{key:"setInitialBarPosition",value:function(){var t=this.getBarPosition();this.vertical?this.bar.y=t+this.track.y-this.bar.displayHeight/2:this.bar.x=t+this.track.x-this.bar.displayWidth/2}},{key:"getClosestPosition",value:function(){for(var t=this.valueRange.getCurrentValue(),e=Math.abs(t-this.valueRange.steps[0]),r=this.valueRange.steps[0],n=0;n=this.trackScrollAreaSize&&(t=this.trackScrollAreaSize),this.vertical?this.bar.y<=this.track.y?t=0:this.bar.y+this.bar.displayHeight>=this.track.y+this.track.displayHeight&&(t=this.trackScrollAreaSize):this.bar.x<=this.track.x?t=0:this.bar.x+this.bar.displayWidth>=this.track.x+this.track.displayWidth&&(t=this.trackScrollAreaSize);var e=t/this.trackScrollAreaSize;return Number.isNaN(e)&&(e=0),e}}])&&ze(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(je);function Xe(t){return Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xe(t)}function Ge(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=Ue(this,e,[t]),t.add.existing(qe(r)),r.x=n,r.y=i,r.uiWidgetsObjectRole="layout",r.modal=a,r.background=null,r.back=null,a){var s,u=new I(t,{x:0,y:0});u.fillStyle(16777215,1),u.fillRect(0,0,t.scale.width,t.scale.height),3===r.version?(u.generateTexture("modalBack"),s="modalBack"):s=u.generateTexture(),r.back=new y(t,0,0,s),r.back.setInteractive(),r.back.setOrigin(0,0),r.back.moveDown();var c=new gt(t,0,0);r.back.mask=c.create(0,0,0,0),t.add.existing(r.back),r.depth=9999,r.back.depth=9998}return null!==o&&(r.background=new y(t,0,0,o),t.add.existing(r.background),r.background.sendToBack(),r.background.alignIn(qe(r),0)),r}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ze(t,e)}(e,t),r=e,n=[{key:"dismiss",value:function(){this.modal&&this.back.destroy(),null!==this.background&&this.background.destroy(),this.destroy()}},{key:"addNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:null)||this.alignment;t instanceof F?t instanceof F&&t.setOrigin(0,0):(t.displayOriginX=0,t.displayOriginY=0),this.add(t),this.alignNodeToPrevious(t,n,e,r),t.parentContainer=this,"quantitybar"===t.uiWidgetsObjectRole&&3===t.version&&t.create(this.x,this.y),"enableBarDrag"in t&&t.enableBarDrag()}}],n&&Ge(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(F);function Je(t){return Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Je(t)}function tr(t,e,r){return e=rr(e),function(t,e){if(e&&("object"===Je(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,er()?Reflect.construct(e,r||[],rr(t).constructor):e.apply(t,r))}function er(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(er=function(){return!!t})()}function rr(t){return rr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rr(t)}function nr(t,e){return nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nr(t,e)}var ir=function(t){function e(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=tr(this,e,[t,n,i,o,a])).alignment=11,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nr(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}($e);function or(t){return or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},or(t)}function ar(t,e,r){return e=ur(e),function(t,e){if(e&&("object"===or(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,sr()?Reflect.construct(e,r||[],ur(t).constructor):e.apply(t,r))}function sr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(sr=function(){return!!t})()}function ur(t){return ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ur(t)}function cr(t,e){return cr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},cr(t,e)}var lr=function(t){function e(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=ar(this,e,[t,n,i,o,a])).alignment=8,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cr(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}($e);function hr(t){return hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hr(t)}function fr(t,e){for(var r=0;r { this.dispatchOnStart(); }, this, - null, - null, ); } }