text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).rexlosspinner=e()}(this,function(){"use strict";function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}function t(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&&i(t,e)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e){return!e||"object"!=typeof 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 f(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);if(r){var i=a(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return s(this,t)}}function r(t,e,i){return(r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(i):r.value}})(t,e,i||t)}var e=Phaser.GameObjects.Components.TransformMatrix,h=new e,u=new e,l=new e,p={camera:h,sprite:u,calc:l},v=function(t,e,i){var n=h,r=u,s=l;return r.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),r.e=t.x,r.f=t.y):(r.e-=e.scrollX*t.scrollFactorX,r.f-=e.scrollY*t.scrollFactorY),n.multiply(r,s),p},d=Phaser.Renderer.Canvas.SetTransform,y={renderWebGL:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var r=t.pipelines.set(e.pipeline),s=v(e,i,n),h=r.calcMatrix.copyFrom(s.calc),a=e._displayOriginX,o=e._displayOriginY,u=i.alpha*e.alpha;t.pipelines.preBatch(e);for(var l=e.geom,c=0,f=l.length;c<f;c++)l[c].webglRender(r,h,u,a,o);t.pipelines.postBatch(e)},renderCanvas:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var r=t.currentContext;if(d(t,r,e,i,n)){for(var s=e._displayOriginX,h=e._displayOriginY,a=e.geom,o=0,u=a.length;o<u;o++)a[o].canvasRender(r,s,h);r.restore()}}},m=Phaser.GameObjects.Shape,g=Phaser.Utils.Array.Remove,k=function(){t(a,m);var h=f(a);function a(t,e,i,n,r){var s;return c(this,a),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=n),(s=h.call(this,t,"rexShapes",[]))._width=-1,s._height=-1,s.shapes={},s.setPosition(e,i),s.setSize(n,r),s.updateDisplayOrigin(),s.dirty=!0,s}return o(a,[{key:"width",get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},{key:"height",get:function(){return this._height},set:function(t){this.setSize(this._width,t)}},{key:"setDirty",value:function(t){return void 0===t&&(t=!0),this.dirty=t,this}},{key:"setSize",value:function(t,e){this.dirty=this.dirty||this._width!==t||this._height!==e,this._width=t,this._height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}},{key:"updateShapes",value:function(){}},{key:"updateData",value:function(){this.updateShapes();for(var t=this.geom,e=0,i=t.length;e<i;e++){var n=t[e];n.dirty&&n.updateData()}return this}},{key:"clear",value:function(){return this.geom.length=0,function(t){if(Array.isArray(t))t.length=0;else for(var e in t)delete t[e]}(this.shapes),this}},{key:"getShape",value:function(t){return this.shapes[t]}},{key:"getShapes",value:function(){return this.geom}},{key:"addShape",value:function(t){this.geom.push(t);var e=t.name;return e&&(this.shapes[e]=t),this.dirty=!0,this}},{key:"deleteShape",value:function(t){var e=this.getShape(t);return e&&(delete this.shapes[t],g(this.geom,e)),this}}]),a}();Object.assign(k.prototype,y);function _(t){return t instanceof w}var E={setEventEmitter:function(t,e){return void 0===e&&(e=Phaser.Events.EventEmitter),this._privateEE=void 0===t,this._eventEmitter=this._privateEE?new e:t,this},destroyEventEmitter:function(){return this._eventEmitter&&this._privateEE&&this._eventEmitter.shutdown(),this},getEventEmitter:function(){return this._eventEmitter},on:function(){return this._eventEmitter&&this._eventEmitter.on.apply(this._eventEmitter,arguments),this},once:function(){return this._eventEmitter&&this._eventEmitter.once.apply(this._eventEmitter,arguments),this},off:function(){return this._eventEmitter&&this._eventEmitter.off.apply(this._eventEmitter,arguments),this},emit:function(t){return this._eventEmitter&&t&&this._eventEmitter.emit.apply(this._eventEmitter,arguments),this},addListener:function(){return this._eventEmitter&&this._eventEmitter.addListener.apply(this._eventEmitter,arguments),this},removeListener:function(){return this._eventEmitter&&this._eventEmitter.removeListener.apply(this._eventEmitter,arguments),this},removeAllListeners:function(){return this._eventEmitter&&this._eventEmitter.removeAllListeners.apply(this._eventEmitter,arguments),this},listenerCount:function(){return this._eventEmitter?this._eventEmitter.listenerCount.apply(this._eventEmitter,arguments):0},listeners:function(){return this._eventEmitter?this._eventEmitter.listeners.apply(this._eventEmitter,arguments):[]}},w=Phaser.Scene,b=Phaser.GameObjects.GameObject,P=Phaser.Utils.Objects.GetValue,S=function(){function r(t,e){var i;c(this,r),this.parent=t,this.scene=_(i=t)?i:i.scene&&_(i.scene)?i.scene:i.parent&&i.parent.scene&&_(i.parent.scene)?i.parent.scene:void 0;var n=P(e,"eventEmitter",!1);!0===n&&(n=void 0),this.setEventEmitter(n),this.boot()}return o(r,[{key:"boot",value:function(){this.parent instanceof b?this.parent.once&&this.parent.on("destroy",this.destroy,this):_(this.parent)&&this.parent.events.once("shutdown",this.destroy,this)}},{key:"shutdown",value:function(){return this.stop(),_(this.parent)&&this.parent.events.off("shutdown",this.destroy,this),this.destroyEventEmitter(),this.parent=void 0,this.scene=void 0,this}},{key:"destroy",value:function(){return this.shutdown(),this}},{key:"start",value:function(t){return this.isRunning||(this.tween=this.scene.tweens.add(t).on("complete",this.complete,this),!1===this.getEventEmitter()&&this.setEventEmitter(this.tween)),this}},{key:"restart",value:function(){return this.stop().start(),this}},{key:"stop",value:function(){return this.tween&&(this.getEventEmitter()===this.tween&&this.setEventEmitter(!1),this.tween.remove(),this.tween=void 0),this}},{key:"pause",value:function(){return this.tween&&this.tween.pause(),this}},{key:"resume",value:function(){return this.tween&&this.tween.resume(),this}},{key:"complete",value:function(){return this.stop(),this.getEventEmitter()&&this.emit("complete"),this}},{key:"isRunning",get:function(){return!!this.tween}}]),r}();Object.assign(S.prototype,E);var O={start:function(t){void 0!==t&&(this.duration=t),this.tweenTask||(this.tweenTask=new S(this)),this.setValue(0),this.tweenTask.start({targets:this,value:1,ease:this.ease,duration:this.duration,repeat:-1,yoyo:!1})},stop:function(){return this.tweenTask&&this.tweenTask.stop(),this},pause:function(){return this.tweenTask&&this.tweenTask.pause(),this},resume:function(){return this.tweenTask&&this.tweenTask.pause(),this}},R=Phaser.Utils.Objects.GetValue,x=function(){t(l,k);var u=f(l);function l(t,e){var i;c(this,l);var n=R(e,"x",0),r=R(e,"y",0),s=R(e,"width",64),h=R(e,"height",64);(i=u.call(this,t,n,r,s,h)).duration=R(e,"duration",1e3),i.ease=R(e,"ease","Linear");var a=R(e,"color",16777215),o=R(e,"start",!0);return i.buildShapes(e),i.setColor(a),i.setValue(0),o&&i.start(),i}return o(l,[{key:"buildShapes",value:function(){}},{key:"centerX",get:function(){return this.width/2}},{key:"centerY",get:function(){return this.height/2}},{key:"radius",get:function(){return Math.min(this.centerX,this.centerY)}},{key:"color",get:function(){return this._color},set:function(t){this.dirty=this.dirty||this._color!==t,this._color=t,this.setShapesColor(t)}},{key:"setColor",value:function(t){return this.color=t,this}},{key:"setShapesColor",value:function(){}},{key:"value",get:function(){return this._value},set:function(t){t=Phaser.Math.Clamp(t,0,1),this.dirty=this.dirty||this._value!=t,this._value=t}},{key:"setValue",value:function(t){return this.value=t,this}}]),l}();Object.assign(x.prototype,O);var T={fillStyle:function(t,e){return void 0===t?this.isFilled=!1:(void 0===e&&(e=1),this.isFilled=!0,this.fillColor=t,this.fillAlpha=e),this},lineStyle:function(t,e,i){return void 0===t?this.isStroked=!1:(void 0===i&&(i=1),this.isStroked=!0,this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i),this}},D={setData:function(t,e){return void 0===this.data&&(this.data={}),this.data[t]=e,this},getData:function(t,e){return void 0===this.data&&(this.data={}),this.data.hasOwnProperty(t)||(this.data[t]=e),this.data[t]}},C=function(){function t(){c(this,t),this.name=void 0,this.dirty=!0,this.data=void 0,this.isFilled=!1,this.fillColor=void 0,this.fillAlpha=1,this.isStroked=!1,this.lineWidth=1,this.strokeColor=void 0,this.strokeAlpha=1}return o(t,[{key:"setName",value:function(t){return this.name=t,this}},{key:"reset",value:function(){return this.fillStyle(),this.lineStyle(),this}},{key:"webglRender",value:function(){}},{key:"canvasRender",value:function(){}},{key:"updateData",value:function(){}}]),t}();Object.assign(C.prototype,T,D);var A=Phaser.Renderer.WebGL.Utils,j=function(t,e,i,n,r,s){for(var h=A.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*n),a=i.pathData,o=i.pathIndexes,u=0;u<o.length;u+=3){var l=2*o[u],c=2*o[u+1],f=2*o[u+2],p=a[0+l]-r,v=a[1+l]-s,d=a[0+c]-r,y=a[1+c]-s,m=a[0+f]-r,g=a[1+f]-s,k=e.getX(p,v),_=e.getY(p,v),E=e.getX(d,y),w=e.getY(d,y),b=e.getX(m,g),P=e.getY(m,g);t.batchTri(k,_,E,w,b,P,h,h,h)}},L=Phaser.Renderer.WebGL.Utils,M=function(t,e,i,n,r){var s=t.strokeTint,h=L.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*i);s.TL=h,s.TR=h,s.BL=h,s.BR=h;var a=e.pathData,o=a.length-1,u=e.lineWidth,l=u/2,c=a[0]-n,f=a[1]-r;e.closePath||(o-=2);for(var p=2;p<o;p+=2){var v=a[p]-n,d=a[p+1]-r;t.batchLine(c,f,v,d,l,l,u,p-2,!!e.closePath&&p===o-1),c=v,f=d}},X=function(t,e,i,n){var r=i||e.fillColor,s=n||e.fillAlpha,h=(16711680&r)>>>16,a=(65280&r)>>>8,o=255&r;t.fillStyle="rgba("+h+","+a+","+o+","+s+")"},Y=function(t,e,i,n){var r=i||e.strokeColor,s=n||e.strokeAlpha,h=(16711680&r)>>>16,a=(65280&r)>>>8,o=255&r;t.strokeStyle="rgba("+h+","+a+","+o+","+s+")",t.lineWidth=e.lineWidth},F=Phaser.Geom.Polygon.Earcut,G=function(){t(i,C);var e=f(i);function i(){var t;return c(this,i),(t=e.call(this)).pathData=[],t.pathIndexes=[],t.closePath=!1,t}return o(i,[{key:"updateData",value:function(){return this.pathIndexes=F(this.pathData),this.dirty=!1,this}},{key:"webglRender",value:function(t,e,i,n,r){this.isFilled&&j(t,e,this,i,n,r),this.isStroked&&M(t,this,i,n,r)}},{key:"canvasRender",value:function(t,e,i){var n=this.pathData,r=n.length-1,s=n[0]-e,h=n[1]-i;t.beginPath(),t.moveTo(s,h),this.closePath||(r-=2);for(var a=2;a<r;a+=2){var o=n[a]-e,u=n[a+1]-i;t.lineTo(o,u)}this.closePath&&t.closePath(),this.isFilled&&(X(t,this),t.fill()),this.isStroked&&(Y(t,this),t.stroke())}}]),i}();Phaser.Math.DegToRad,Phaser.Math.DegToRad;var W=function(){t(h,G);var s=f(h);function h(t,e,i,n){var r;return c(this,h),(r=s.call(this)).setP0(t,e),r.setP1(i,n),r}return o(h,[{key:"x0",get:function(){return this._x0},set:function(t){this.dirty=this.dirty||this._x0!==t,this._x0=t}},{key:"y0",get:function(){return this._y0},set:function(t){this.dirty=this.dirty||this._y0!==t,this._y0=t}},{key:"setP0",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"x1",get:function(){return this._x1},set:function(t){this.dirty=this.dirty||this._x1!==t,this._x1=t}},{key:"y1",get:function(){return this._y1},set:function(t){this.dirty=this.dirty||this._y1!==t,this._y1=t}},{key:"setP1",value:function(t,e){return this.x1=t,this.y1=e,this}},{key:"updateData",value:function(){return this.pathData.length=0,this.pathData.push(this.x0,this.y0),this.pathData.push(this.x1,this.y1),this.pathData.push(this.x0,this.y0),r(a(h.prototype),"updateData",this).call(this),this}}]),h}();Phaser.Math.DegToRad,Phaser.Math.RotateAround,Phaser.Math.Interpolation.QuadraticBezier,Phaser.Math.Interpolation.CubicBezier,Phaser.Renderer.WebGL.Utils,Phaser.Renderer.WebGL.Utils;var z=Phaser.Math.Linear;return function(){t(r,x);var n=f(r);function r(t,e){var i;return c(this,r),(i=n.call(this,t,e)).type="rexSpinnerLos",i}return o(r,[{key:"buildShapes",value:function(){for(var t=0;t<12;t++)this.addShape(new W)}},{key:"updateShapes",value:function(){for(var t=this.centerX,e=this.centerY,i=this.prevCenterX!==t||this.prevCenterY!==e,n=this.radius,r=n/2,s=Math.ceil(n/20),h=this.getShapes(),a=0,o=h.length;a<o;a++){var u=h[a],l=a/o,c=2*Math.PI*l,f=z(.25,1,(1-this.value+l)%1);u.lineStyle(s,this.color,f),i&&u.setP0(t+Math.cos(c)*r,e+Math.sin(c)*r).setP1(t+Math.cos(c)*n,e+Math.sin(c)*n)}this.prevCenterX=t,this.prevCenterY=e}}]),r}()});
  